GIS_GEOMETRY: Building a JSON Geometry Object

How to:

The GIS_GEOMETRY function builds a JSON Geometry object given a geometry type, WKID, and a geometry.

Syntax: How to Build a JSON Geometry Object

GIS_GEOMETRY(geotype, wkid, geometry)

where:

geotype

Alphanumeric

Is a geometry type, for example, 'esriGeometryPolygon' ,esriGeometryPolyline, 'esriGeometryMultipoint', 'EsriGeometryPoint', 'EsriGeometryExtent'..

wkid

Alphanumeric

Is a valid spatial reference ID. WKID is an abbreviation for Well-Known ID, which identifies a projected or geographic coordinate system.

geometry

TX

A geometry in JSON.

The output is returned as TX.

Example: Building a JSON Geometry Object

The following request builds a polygon geometry of the area encompassing ZIP code 10036 in Manhattan. The input geometry object is stored in a text (.ftm) file that is cross-referenced in the esri-citibike Master File. The field containing the geometry object is GEOMETRY.

DEFINE FILE esri/esri-citibike
WKID/A10  = '4326';
 MASTER_GEOMETRY/TX256 (GEOGRAPHIC_ROLE=GEOMETRY_AREA) = 
    GIS_GEOMETRY( 'esriGeometryPolygon', WKID , GEOMETRY );
END
TABLE FILE esri/esri-citibike 
 PRINT 
    START_STATION_NAME AS Station
    START_STATION_LATITUDE AS Latitude
    START_STATION_LONGITUDE AS Longitude
    MASTER_GEOMETRY AS 'JSON Geometry Object'
 WHERE START_STATION_ID EQ 479  
ON TABLE SET PAGE NOLEAD
 ON TABLE SET STYLE * 
type=report, grid=off, size=10,$
 ENDSTYLE 
END  

The output is shown in the following image.

WebFOCUS

Feedback