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