com.esri.core.geometry.OperatorImportFromGeoJson Java Examples

The following examples show how to use com.esri.core.geometry.OperatorImportFromGeoJson. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UserDefinedGeoJsonSpatialFilter.java    From bboxdb with Apache License 2.0 5 votes vote down vote up
/**
 * Convert the geojson element to a ESRI geometry
 * @param jsonString
 * @return
 */
private OGCGeometry geoJoinToGeomety(String jsonString) {
	final OperatorImportFromGeoJson op = (OperatorImportFromGeoJson) OperatorFactoryLocal
	        .getInstance().getOperator(Operator.Type.ImportFromGeoJson);
			
    final MapOGCStructure structure = op.executeOGC(WktImportFlags.wktImportDefaults, jsonString, null);

    return OGCGeometry.createFromOGCStructure(structure.m_ogcStructure,
    		structure.m_spatialReference);
}
 
Example #2
Source File: MainActivity.java    From arcgis-runtime-demos-android with Apache License 2.0 5 votes vote down vote up
/**
 * Converts a geojson string to com.esri.core.geometry.Point.
 *
 * @param jsonPoint geoJson string representation of a Point
 * @return com.esri.core.geometry.Point
 * @throws Exception
 */
static Point createPointFromGeoJson(String jsonPoint) throws Exception {

    MapGeometry mapGeom = OperatorImportFromGeoJson.local().execute(GeoJsonImportFlags.geoJsonImportDefaults,
            Geometry.Type.Point,
            jsonPoint,
            null);

    return (Point) mapGeom.getGeometry();
}
 
Example #3
Source File: OGCGeometry.java    From geometry-api-java with Apache License 2.0 5 votes vote down vote up
public static OGCGeometry fromGeoJson(String string) {
	OperatorImportFromGeoJson op = (OperatorImportFromGeoJson) OperatorFactoryLocal
			.getInstance().getOperator(Operator.Type.ImportFromGeoJson);
	MapOGCStructure mapOGCStructure = op.executeOGC(0, string, null);
	return OGCGeometry.createFromOGCStructure(
			mapOGCStructure.m_ogcStructure,
			mapOGCStructure.m_spatialReference);
}