@Override public void serialize(Geometry geometry, JsonGenerator jsonGenerator, SerializerProvider arg2) throws IOException, JsonProcessingException { jsonGenerator.writeRawValue(GeometryEngine.geometryToJson(null, geometry)); } }
/** * * @return Convert to REST JSON. */ public String asJson() { return GeometryEngine.geometryToJson(esriSR, getEsriGeometry()); }
/** * * @return Convert to REST JSON. */ public String asJson() { return GeometryEngine.geometryToJson(esriSR, getEsriGeometry()); }
/** * Exports the specified geometry instance to it's JSON representation. * * See OperatorExportToJson. * * @see GeometryEngine#geometryToJson(SpatialReference spatialiReference, * Geometry geometry) * @param wkid * The spatial reference Well Known ID to be used for the JSON * representation. * @param geometry * The geometry to be exported to JSON. * @return The JSON representation of the specified Geometry. */ public static String geometryToJson(int wkid, Geometry geometry) { return GeometryEngine.geometryToJson( wkid > 0 ? SpatialReference.create(wkid) : null, geometry); }
/** * Exports the specified geometry instance to it's JSON representation. * * See OperatorExportToJson. * * @see GeometryEngine#geometryToJson(SpatialReference spatialiReference, * Geometry geometry) * @param wkid * The spatial reference Well Known ID to be used for the JSON * representation. * @param geometry * The geometry to be exported to JSON. * @return The JSON representation of the specified Geometry. */ public static String geometryToJson(int wkid, Geometry geometry) { return GeometryEngine.geometryToJson( wkid > 0 ? SpatialReference.create(wkid) : null, geometry); }
public Text evaluate(BytesWritable geomref){ if (geomref == null || geomref.getLength() == 0){ LogUtils.Log_ArgumentsNull(LOG); return null; } OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref); if (ogcGeometry == null){ LogUtils.Log_ArgumentsNull(LOG); return null; } Geometry esriGeom = ogcGeometry.getEsriGeometry(); int wkid = GeometryUtils.getWKID(geomref); return new Text(GeometryEngine.geometryToJson(wkid, esriGeom)); } }