Open josephyannkaewang opened 8 years ago
Are you using Hive or custom Java MapReduce? The Geometry API has Simplify methods.
I've tried
OGCGeometry ogcGeom = OGCGeometry.fromGeoJson(json); if (ogcGeom != null) { Geometry geometry = ogcGeom.getEsriGeometry(); SpatialReference spatialReference = ogcGeom.getEsriSpatialReference(); Geometry simpleGeometry = GeometryEngine.simplify(geometry, spatialReference); if (simpleGeometry != null && spatialReference != null) { OGCGeometry ogcGeom2 = OGCGeometry.createFromEsriGeometry(simpleGeometry, spatialReference); return GeometryUtils.geometryToEsriShapeBytesWritable(ogcGeom2); } }
GeometryEngine.simplify doesn't seem to take a parameter for specifying how much to simplify it by.
On Mon, Feb 8, 2016 at 2:02 PM, Randall Whitman notifications@github.com wrote:
Are you using Hive or custom Java MapReduce? The Geometry API has Simplify methods https://github.com/Esri/geometry-api-java/wiki#validation.
— Reply to this email directly or view it on GitHub https://github.com/Esri/spatial-framework-for-hadoop/issues/95#issuecomment-181578588 .
Oh, the other meaning of Simplify, not in the sense of ST-IsSimple. Better to move the issue to Geometry API.
In the geometry API, the requested operation is called Generalize.
This is Open-Source and accepts contributions.
To speed up geo query, it will be nice if there is a way to check if the shape is simple and provide a way to convert a shape to its simplified version.