GIS_SERV_AREA_XY: Calculating a Service Area Around a Given Coordinate

How to:

The GIS_SERV_AREA_XY function uses a GIS service to calculate the geometry area with access boundaries within the given time or distance from the provided coordinate. The output is returned in text format.

Note: This function uses GIS services and requires an Esri ArcGIS adapter connection with named credentials.

Syntax: How to Calculate a Geometry Area Around a Coordinate

GIS_SERV_AREA_XY(longitude, latitude, distance, travel_mode[, wkid])

where:

longitude

Alphanumeric

Is the longitude of the starting point.

latitude

Alphanumeric

Is the latitude of the starting point.

distance

Integer

Is the travel limitation in either time or distance units.

travel_mode

Alphanumeric

Is a valid travel mode as defined in gis_serv_area.mas in the Catalog directory, located in drive:\ibi\WebFOCUS\srv\home\catalog. The accepted travel modes are;

  • 'Miles'. This is the default value.
  • 'TravelTime'.
  • 'TruckTravelTime'.
  • 'WalkTime'.
  • 'Kilometers'.
wkid

Alphanumeric

Is the spatial reference ID for the coordinate. WKID is an abbreviation for Well-Known ID, which identifies a projected or geographic coordinate system. The default value is '4326', which represents decimal degrees.

Example: Calculating a Service Area Around a Coordinate

The following request calculates the geometry area that is a five-minute walk around a station, using the longitude and latitude that specify the station location.

DEFINE FILE esri/esri-citibike 
DISTANCE/I4=5;
WKID/A10='4326';
TRAVEL_MODE/A10='WalkTime';
STATION_SERVICE_AREA/TX80 (GEOGRAPHIC_ROLE=GEOMETRY_AREA)=
   GIS_SERV_AREA_XY(START_STATION_LONGITUDE, START_STATION_LATITUDE, DISTANCE, TRAVEL_MODE, WKID);
END
TABLE FILE esri/esri-citibike 
 PRINT 
    START_STATION_ID AS 'Station ID'
    START_STATION_NAME AS 'Station Name'
    STATION_SERVICE_AREA 
       AS '5-Minute Walk Service Area Around Station Coordinate'
 WHERE START_STATION_ID EQ 479 OR 512;
ON TABLE SET PAGE NOLEAD 
ON TABLE SET STYLE * 
TYPE=REPORT, GRID=OFF, SIZE=12,$
ENDSTYLE 
END  

The output is shown in the following image.

Example: Charting a Geometry Service Area Around a Coordinate

The following request generates service areas that are 5-minute walking distances from start station coordinates and charts them on an Esri map.

DEFINE FILE esri-citibike 
WKID/A10='4326';
DISTANCE/A10='5';
TRAVEL_MODE/A10='WalkTime';
STATION_SERVICE_AREA/TX80 (GEOGRAPHIC_ROLE=GEOMETRY_AREA)=
   GIS_SERV_AREA_XY(START_STATION_LONGITUDE, START_STATION_LATITUDE, DISTANCE, TRAVEL_MODE, WKID);
END
GRAPH FILE ESRI-CITIBIKE 
 PRINT 
   START_STATION_NAME
   END_STATION_NAME
   DISTANCE
 ON TABLE PCHOLD FORMAT JSCHART 
 ON TABLE SET LOOKGRAPH CHOROPLETH
 ON TABLE SET EMBEDHEADING ON 
 ON TABLE SET AUTOFIT ON 
 ON TABLE SET STYLE * 
  TYPE=REPORT, TITLETEXT='Map', PAGESIZE=E, CHART-LOOK=com.esri.map, $ 
  TYPE=DATA, COLUMN=N1, /*START_STATION_NAME*/  
   BUCKET=tooltip, $
  TYPE=DATA, COLUMN=N2, /*END_STATION_NAME*/
   BUCKET=tooltip, $
  TYPE=DATA, COLUMN=N3, /*DISTANCE*/
   BUCKET=tooltip, $
  *GRAPH_JS_FINAL 
"legend": {"visible": true}, 
"extensions" : { "com.esri.map" : 
  { "scalebar" : 
{ 
    "scalebarUnit": "dual", 
    "attachTo" : "bottom-left" 
  }, 
  "baseMapInfo": { 
       "drawBasemapControl" : false, 
       "showArcGISBasemaps" : false, 
            "customBaseMaps" : [ 
            {"ibiBaseLayer" : "dark-gray"} 
        ] 
   }, 
  "overlayLayers": 
  [{ 
  "ibiDataLayer": {"map-geometry" :  {"map_by_field" : "STATION_SERVICE_AREA"}}, "title" : "Chart"}] 
  }, 
"introAnimation": "{\"enabled\":false}" 
} 
 
  *END 
 ENDSTYLE 
 HEADING 
  "Chart Geometry Service Area" 
END 

The output is shown in the following image.