I am trying to achieve simple goal. Using https://github.com/Esri/geometry-api-java library I want to read multiple geometries from shapefile, but so far it seems that API doesn't provide ability to do so, by now I managed to impport single geometry from file (first one).
Here are code samples that I tried in order to make it works:
property in = FileInputStream
Geometry geometry = GeometryEngine.geometryFromEsriShape(IOUtils.toByteArray(in), Geometry.Type.Unknown);
System.out.println(geometry);
OperatorImportFromESRIShape importerShape = (OperatorImportFromESRIShape) OperatorFactoryLocal.getInstance().getOperator(Operator.Type.ImportFromESRIShape);
ByteBuffer byteBuffer = ByteBuffer.wrap(IOUtils.toByteArray(in));
Geometry geometry = importerShape.execute(0, Geometry.Type.Unknown, byteBuffer);
In both cases API returns only single Geometry. The question is how to read multiple geometries from input stream one by one.
Thank you for any help.
When you move your java package to:
You can access a package protected Method, that returns a GeometryCursor: