@Override public Iterator<Polygon> call(Geometry spatialObject) throws Exception { List<Polygon> result = new ArrayList<Polygon>(); if (spatialObject instanceof MultiPolygon) { MultiPolygon multiObjects = (MultiPolygon) spatialObject; for (int i = 0; i < multiObjects.getNumGeometries(); i++) { Polygon oneObject = (Polygon) multiObjects.getGeometryN(i); oneObject.setUserData(multiObjects.getUserData()); result.add(oneObject); } } else if (spatialObject instanceof Polygon) { result.add((Polygon) spatialObject); } else { throw new Exception("[ShapefileRDD][getPolygonRDD] the object type is not Polygon or MultiPolygon type. It is " + spatialObject.getGeometryType()); } return result.iterator(); } }));
@Override public Iterator<Polygon> call(Geometry spatialObject) throws Exception { List<Polygon> result = new ArrayList<Polygon>(); if (spatialObject instanceof MultiPolygon) { MultiPolygon multiObjects = (MultiPolygon) spatialObject; for (int i = 0; i < multiObjects.getNumGeometries(); i++) { Polygon oneObject = (Polygon) multiObjects.getGeometryN(i); oneObject.setUserData(multiObjects.getUserData()); result.add(oneObject); } } else if (spatialObject instanceof Polygon) { result.add((Polygon) spatialObject); } else { throw new Exception("[ShapefileRDD][getPolygonRDD] the object type is not Polygon or MultiPolygon type. It is " + spatialObject.getGeometryType()); } return result.iterator(); } });
@Override public Iterator<Polygon> call(Geometry spatialObject) throws Exception { List<Polygon> result = new ArrayList<Polygon>(); if (spatialObject instanceof MultiPolygon) { MultiPolygon multiObjects = (MultiPolygon) spatialObject; for (int i = 0; i < multiObjects.getNumGeometries(); i++) { Polygon oneObject = (Polygon) multiObjects.getGeometryN(i); oneObject.setUserData(multiObjects.getUserData()); result.add(oneObject); } } else if (spatialObject instanceof Polygon) { result.add((Polygon) spatialObject); } else { throw new Exception("[ShapefileRDD][getPolygonRDD] the object type is not Polygon or MultiPolygon type. It is " + spatialObject.getGeometryType()); } return result.iterator(); } });
@Override public Iterator<Polygon> call(Geometry spatialObject) throws Exception { List<Polygon> result = new ArrayList<Polygon>(); if (spatialObject instanceof MultiPolygon) { MultiPolygon multiObjects = (MultiPolygon) spatialObject; for (int i = 0; i < multiObjects.getNumGeometries(); i++) { Polygon oneObject = (Polygon) multiObjects.getGeometryN(i); oneObject.setUserData(multiObjects.getUserData()); result.add(oneObject); } } else if (spatialObject instanceof Polygon) { result.add((Polygon) spatialObject); } else { throw new Exception("[ShapefileRDD][getPolygonRDD] the object type is not Polygon or MultiPolygon type. It is " + spatialObject.getGeometryType()); } return result.iterator(); } }));