use of com.google.cloud.vision.v1.Feature in project java-mapollage by trixon.
the class Operation method addPolygons.
private void addPolygons(Folder polygonParent, List<Feature> features) {
for (Feature feature : features) {
if (feature instanceof Folder) {
Folder folder = (Folder) feature;
if (folder != mPathFolder && folder != mPathGapFolder && folder != mPolygonFolder) {
System.out.println("ENTER FOLDER=" + folder.getName());
System.out.println("PARENT FOLDER=" + polygonParent.getName());
Folder polygonFolder = polygonParent.createAndAddFolder().withName(folder.getName()).withOpen(true);
mFolderPolygonInputs.put(polygonFolder, new ArrayList<>());
addPolygons(polygonFolder, folder.getFeature());
System.out.println("POLYGON FOLDER=" + polygonFolder.getName() + " CONTAINS");
if (mFolderPolygonInputs.get(polygonFolder) != null) {
addPolygon(folder.getName(), mFolderPolygonInputs.get(polygonFolder), polygonParent);
}
System.out.println("EXIT FOLDER=" + folder.getName());
System.out.println("");
}
}
if (feature instanceof Placemark) {
Placemark placemark = (Placemark) feature;
System.out.println("PLACEMARK=" + placemark.getName() + "(PARENT=)" + polygonParent.getName());
Point point = (Point) placemark.getGeometry();
point.getCoordinates().forEach((coordinate) -> {
mFolderPolygonInputs.get(polygonParent).add(coordinate);
});
}
}
}
Aggregations