Esri / spatial-framework-for-hadoop

The Spatial Framework for Hadoop allows developers and data scientists to use the Hadoop data processing system for spatial data analysis.
Apache License 2.0
363 stars 160 forks source link

Provide Generalize functionality #95

Open josephyannkaewang opened 8 years ago

josephyannkaewang commented 8 years ago

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.

randallwhitman commented 8 years ago

Are you using Hive or custom Java MapReduce? The Geometry API has Simplify methods.

josephyannkaewang commented 8 years ago

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 .

randallwhitman commented 8 years ago

Oh, the other meaning of Simplify, not in the sense of ST-IsSimple. Better to move the issue to Geometry API.

randallwhitman commented 8 years ago

In the geometry API, the requested operation is called Generalize.

randallwhitman commented 7 years ago

This is Open-Source and accepts contributions.