8 Service APIs

This section provides a reference for APIs that should be implemented by this Building Block.

This section provides a reference for the APIs implemented by the GIS Building Block. The APIs defined here establish a blueprint for how the Building Block will interact with other Building Blocks. Additional APIs may be implemented by the Building Block, but the listed APIs define a minimal set of functionality that should be provided by any implementation of this Building Block.

The GIS BB APIs conform with the OGC web API principles and guidelines and should be deployed as a set of microservices to provide clients consistent access to the key digital functionalities and geographic data in different representations. Microservices are defined to receive requests with relevant inputs and return processed results from key digital functionalities of this Building Block. Microservices are small, independent, and loosely coupled services that perform specific functions within the larger GIS BB key digital functionalities. Each microservice is kept simple and intuitive by focusing on one particular task, and together they form a cohesive and scalable GIS architecture. Each microservice can be developed, deployed, and maintained independently, making it easier to manage and scale the system as needed.

This section provides a reference for APIs that this Building Block should implement. The APIs defined here establish a blueprint for how the Building Block will interact with other Building Blocks. The Building Block may implement additional APIs, but the listed APIs define a minimal set of functionality that any implementation of this Building Block should provide.

The GovStack non-functional requirements document provides additional information on how 'adaptors' may be used to translate an existing API to the patterns described here.

8.1 Map Display

Retrieve the data viewer type

get

Retrieve the type of the data viewer. This endpoint provides information about whether the client data viewer is desktop, mobile, web browser, or unknown.

Query parameters
supportedBrowserstring · enumOptional

Specifies the type of supported browser for the data viewer.

Default: desktopPossible values:
Responses
get
/type

Retrieve GIS map display details

get

Retrieve GIS map display details. This endpoint provides access to GIS data through a data viewer, allowing users to view and query geographic or spatial information presented as graphic representations (points, polygons, lines, or raster grids) through thematic GIS layers or attribute tables. The response will include the symbology (pre-defined styles) for each map layer, displayed as a legend alongside a table of contents listing all layers provided by the service.

Responses
get
/details

Add or update spatial bookmarks

post

Add or update spatial bookmarks. This endpoint allows users to capture the spatial extent of a given location as a spatial bookmark in a GIS data viewer. Users can name the bookmark and zoom to the exact extent whenever needed by selecting the bookmark's name. Users can also add, rename, and remove spatial bookmarks as necessary.

Body
namestringOptionalExample: Bookmark A
createintegerOptionalExample: 1
removebooleanOptionalExample: true
renamebooleanOptionalExample: true
zoomTobooleanOptionalExample: true
minXnumber · doubleOptionalExample: 12.3456
minYnumber · doubleOptionalExample: 34.5678
maxXnumber · doubleOptionalExample: 12.789
maxYnumber · doubleOptionalExample: 34.9012
Responses
post
/bookmarks

Set minimum and maximum scale limits for each layer

put

Set minimum and maximum scale limits for each layer. This endpoint allows users to specify whether a layer is identifiable and/or selectable on the data viewer. These settings are saved as a cache by the data viewer app and are reserved for future data viewer displays. The settings are reset to default when the cache is cleared.

Query parameters
layerTitlestringRequired

The name of the GIS layer

minScaleintegerOptional

The minimum scale to show the layer's feature on the map display

maxScaleintegerOptional

The maximum scale to show the layer's feature on the map display

Responses
204

Successful setting of layer scale limits

No content

put
/scale

No content

Enable basic navigation capabilities on the GIS data viewer

put

Enable basic navigation capabilities on the GIS data viewer. This endpoint allows users to perform basic navigation actions such as zooming in and out of a map, and panning to explore the displayed GIS data.

Query parameters
zoombooleanRequired

Specifies if zooming is supported

zoomLevelintegerRequired

The available zoom levels for the map

panbooleanRequired

Specifies if panning is supported

Responses
204

Successful enabling of basic navigation capabilities

No content

put
/navigation

No content

Add, view, delete, and mark map notes on the GIS data viewer

post

Add, view, delete, and mark map notes on the GIS data viewer. This endpoint allows GIS users to add and share brief notes on the GIS data viewer. Other users can view and comment on these notes. Notes can only be deleted by the creator of the note. Notes are saved and served as a web feature service.

Body
creatorstringOptionalExample: John Doe
contentstringOptionalExample: This is a map note.
timeStampstringOptionalExample: 2023-08-01T12:34:56Z
addbooleanOptionalExample: true
deletebooleanOptionalExample: true
viewbooleanOptionalExample: true
visiblebooleanOptionalExample: true
xnumber · doubleOptionalExample: 12.3456
ynumber · doubleOptionalExample: 34.5678
Responses
post
/notes

Perform measuring actions on the GIS data viewer

post

Perform measuring actions on the GIS data viewer. This endpoint allows users to measure distances and areas on the displayed map.

Body
distancebooleanOptionalExample: true
areabooleanOptionalExample: true
Responses
204

Successful measuring action

No content

post
/measuring

No content

Retrieve the style applied to the data viewer

get

Retrieve the style applied to the data viewer. This endpoint provides information about the style used to portray the geographic features of each layer on the data viewer.

Responses
get
/style
200

Successful retrieval of data viewer style

8.2 GIS Query

Retrieve GIS layer metadata

get

Retrieve GIS layer metadata and feature type definitions.

Responses
get
/layerMetadata

Retrieve non-spatial table metadata

get

Retrieve non-spatial table metadata.

Responses
get
/nonSpatialTableMetadata

Execute a GIS Query

post

Execute GIS feature or attribute query operations interactively or through predefined expressions.

Body
typestringOptional
queryFormatstringOptional
queryStringstringOptional
timeStampstring · date-timeOptional
Responses
post
/gisQuery

Execute a Locational Query

post

Execute a spatial query based on location.

Body
layerTypestringOptional
spatialRelationstringOptional
longitudenumberOptional
latitudenumberOptional
distancenumberOptional
Responses
post
/locationalQuery

Execute an Attribute Query

post

Execute an attribute-based query.

Body
attributeNamestringOptional
operatorstringOptional
valuestringOptional
Responses
post
/attributeQuery

Execute a Discovery Query

post

Execute a metadata discovery query.

Body
attributeNamestringOptional
Responses
post
/discoveryQuery

Retrieve Query Results

get

Retrieve the results of a previously executed query.

Responses
get
/queryResult

8.3 GIS Data Management

Create a GIS Data Store

post

Create a new GIS data store.

Body
namestringOptional
descriptionstringOptional
providerstringOptional
connectionStringstringOptional
accessRestrictionsbooleanOptional
updateFrequencystringOptional
Responses
post
/dataStore

No content

Retrieve Data Store by ID

get

Retrieve details of a specific GIS data store.

Path parameters
dataStoreIdstringRequired

ID of the GIS data store to retrieve

Responses
get
/dataStore/{dataStoreId}

No content

Update Data Store by ID

patch

Update details of a specific GIS data store.

Path parameters
dataStoreIdstringRequired

ID of the GIS data store to update

Body
namestringOptional
descriptionstringOptional
providerstringOptional
connectionStringstringOptional
accessRestrictionsbooleanOptional
updateFrequencystringOptional
Responses
patch
/dataStore/{dataStoreId}

No content

Publish Data Store Metadata

post

Publish metadata descriptions of a GIS database schema and its contents.

Body
namestringOptional
sourcestringOptional
descriptionstringOptional
keywordsstringOptional
lastUpdatedstring · date-timeOptional
Responses
post
/dataStoreMetadata

No content

Create User Control

post

Create user control for authentication and access permissions.

Body
usernamestringOptional
passwordstringOptional
editorPermissionsstringOptional
editorTrackingbooleanOptional
ownerControlbooleanOptional
Responses
post
/userControl

No content

Record Editor Tracking

post

Record editor tracking information for feature editing.

Body
editTypestringOptional
timeStampstring · date-timeOptional
Responses
post
/editorTracking

No content

Replicate GIS Data Store

post

Replicate a remote GIS database schema.

Body
sourceDataStorestringOptional
targetDataStorestringOptional
replicaTypestringOptional
Responses
post
/replicate

No content

Extract and Transfer GIS Data

post

Extract and transfer GIS data layers or features from a remote GIS database.

Body
sourceDataStorestringOptional
targetDataStorestringOptional
Responses
post
/extractTransfer

No content

Edit Geographic Features

post

Create, edit, modify, or delete geographic features on the extracted GIS data layers.

Body
layerTypestringOptional
featureIDstringOptional
operationstringOptional
Responses
post
/editFeature

No content

8.4 Geocoding and Reverse Geocoding

Geocode an Address

post

Geocode an address to obtain geographic coordinates.

Body
addressstringOptional
longitudenumber · doubleOptional
latitudenumber · doubleOptional
Responses
post
/geocode

No content

Reverse Geocode Coordinates

post

Reverse geocode geographic coordinates to obtain an address.

Body
longitudenumber · doubleOptional
latitudenumber · doubleOptional
Responses
post
/reverseGeocode

No content

Batch Geocode

post

Perform batch geocoding or reverse geocoding using a table file with multiple addresses or coordinates.

Body
batchTypestringOptional
batchNamestringOptional
statusstringOptional
timeStampstring · date-timeOptional
Responses
post
/batchGeocode

No content

Retrieve Geocode Result by ID

get

Retrieve the geocoding result for a specific ID.

Path parameters
resultIdstringRequired

ID of the geocoding result to retrieve

Responses
get
/geocodeResult/{resultId}

No content

Retrieve Reverse Geocode Result by ID

get

Retrieve the reverse geocoding result for a specific ID.

Path parameters
resultIdstringRequired

ID of the reverse geocoding result to retrieve

Responses
get
/reverseGeocodeResult/{resultId}

No content

8.5 Spatial Awareness and Analysis

Get Metadata

get

Retrieve metadata that describes the purpose and functionality of geospatial analysis tasks or processes.

Responses
get
/metadata

No content

Get Available Processes

get

Retrieve detailed information that describes the processes that can be run on the service.

Responses
get
/processes

No content

Execute Geoprocessing Task

post

Execute a geoprocessing task to perform basic spatial analysis operations.

Body
processingNamestringOptional
descriptionstringOptional
Responses
post
/executeTask

No content

Get Task Status

get

Get the status of an asynchronously executed geoprocessing task.

Path parameters
taskIdstringRequired

ID of the geoprocessing task

Responses
get
/taskStatus/{taskId}

No content

Get Task Result

get

Get the result of a finished geoprocessing task.

Path parameters
taskIdstringRequired

ID of the geoprocessing task

Responses
get
/taskResult/{taskId}

No content

Terminate Task

post

Terminate an asynchronously executed geoprocessing task.

Path parameters
taskIdstringRequired

ID of the geoprocessing task

Responses
post
/terminateTask/{taskId}

No content

8.6 Reporting

Get Templates

get

Retrieve templates and resources for creating map layouts and cartographic reports.

Responses
get
/templates

No content

Add Dynamic GIS Layer

post

Add a dynamic GIS layer to a map layout or report.

Body
titlestringOptional
abstractstringOptional
authorstringOptional
keywordsstringOptional
lastUpdatedstring · date-timeOptional
Responses
post
/dynamicLayers

No content

Remove Dynamic GIS Layer

delete

Remove a dynamic GIS layer from a map layout or report.

Path parameters
layerIdstringRequired

ID of the dynamic GIS layer to be removed

Responses
delete
/dynamicLayers/{layerId}

No content

Add Label

post

Add a label to a map layout or report.

Body
labelTextstringOptional
positionXnumber · floatOptional
positionYnumber · floatOptional
fontstringOptional
sizeintegerOptional
colorstringOptional
Responses
post
/labels

No content

Remove Label

delete

Remove a label from a map layout or report.

Path parameters
labelIdstringRequired

ID of the label to be removed

Responses
delete
/labels/{labelId}

No content

Add Chart

post

Add a chart to a map layout or report.

Body
titlestringOptional
typestringOptional
datastringOptional
Responses
post
/charts

No content

Remove Chart

delete

Remove a chart from a map layout or report.

Path parameters
chartIdstringRequired

ID of the chart to be removed

Responses
delete
/charts/{chartId}

No content

Add Legend

post

Add a legend to a map layout or report.

Body
labelTextstringOptional
positionXnumber · floatOptional
positionYnumber · floatOptional
fontstringOptional
sizeintegerOptional
colorstringOptional
Responses
post
/legends

No content

Remove Legend

delete

Remove a legend from a map layout or report.

Path parameters
legendIdstringRequired

ID of the legend to be removed

Responses
delete
/legends/{legendId}

No content

Add Scale Bar

post

Add a scale bar to a map layout or report.

Body
titlestringOptional
stylestringOptional
lengthnumber · floatOptional
unitsstringOptional
positionXnumber · floatOptional
positionYnumber · floatOptional
fontstringOptional
sizeintegerOptional
colorstringOptional
Responses
post
/scaleBars

No content

Remove Scale Bar

delete

Remove a scale bar from a map layout or report.

Path parameters
scaleBarIdstringRequired

ID of the scale bar to be removed

Responses
delete
/scaleBars/{scaleBarId}

No content

Add North Arrow

post

Add a north arrow to a map layout or report.

Body
titlestringOptional
stylestringOptional
lengthnumber · floatOptional
unitsstringOptional
positionXnumber · floatOptional
positionYnumber · floatOptional
fontstringOptional
sizeintegerOptional
colorstringOptional
Responses
post
/northArrows

No content

Remove North Arrow

delete

Remove a north arrow from a map layout or report.

Path parameters
northArrowIdstringRequired

ID of the north arrow to be removed

Responses
delete
/northArrows/{northArrowId}

No content

8.7 Geofencing

List Geofences

get
Responses
get
/geofences
200

Successful response with a list of geofences

No content

Create Geofence

post
Body
namestringOptional
shapestringOptional
sizenumber · doubleOptional
statusbooleanOptional
Responses
post
/geofences
201

Successful response after creating geofence

No content

Get Geofence by ID

get
Path parameters
geofenceIdstringRequired
Responses
get
/geofences/{geofenceId}

No content

Update Geofence

put
Path parameters
geofenceIdstringRequired
Body
namestringOptional
shapestringOptional
sizenumber · doubleOptional
statusbooleanOptional
Responses
204

Successful response after updating geofence

No content

put
/geofences/{geofenceId}

No content

Delete Geofence

delete
Path parameters
geofenceIdstringRequired
Responses
204

Successful response after deleting geofence

No content

delete
/geofences/{geofenceId}

No content

Get Geofence Status

get
Path parameters
geofenceIdstringRequired
Responses
get
/geofences/{geofenceId}/status

No content

Activate Geofence

post
Path parameters
geofenceIdstringRequired
Responses
post
/geofences/{geofenceId}/activate

No content

Deactivate Geofence

post
Path parameters
geofenceIdstringRequired
Responses
post
/geofences/{geofenceId}/deactivate

No content

List Geofence Elements

get
Path parameters
geofenceIdstringRequired
Responses
get
/geofences/{geofenceId}/elements

No content

Add Geofence Element

post
Path parameters
geofenceIdstringRequired
Body
elementTypestringOptional
trackingMethodstringOptional
Responses
post
/geofences/{geofenceId}/elements

No content

Remove Geofence Element

delete
Path parameters
geofenceIdstringRequired
elementIdstringRequired
Responses
204

Successful response after removing geofence element

No content

delete
/geofences/{geofenceId}/elements/{elementId}

No content

Create Action Rule for Geofence

post
Path parameters
geofenceIdstringRequired
Body
actionTypestringOptional
actionstringOptional
Responses
post
/geofences/{geofenceId}/rules

No content

Create Element Action Rule for Geofence

post
Path parameters
geofenceIdstringRequired
elementIdstringRequired
Body
notificationTypestringOptional
recipientstringOptional
recipientTypestringOptional
Responses
post
/geofences/{geofenceId}/elements/{elementId}/actions

No content

8.8 Routing

Create Route

post
Body
startNodeobjectOptional
endNodeobjectOptional
passThroughbooleanOptional
restrictionsstringOptional
additionalParametersstringOptional
Responses
post
/routes
201

Successful response after creating a route

No content

Get Route by ID

get
Path parameters
routeIdstringRequired
Responses
get
/routes/{routeId}

No content

Delete Route

delete
Path parameters
routeIdstringRequired
Responses
204

Successful response after deleting route

No content

delete
/routes/{routeId}

No content

Generate Direction Report for Route

get
Path parameters
routeIdstringRequired
Responses
get
/routes/{routeId}/directions

No content

List Route Segments

get
Path parameters
routeIdstringRequired
Responses
get
/routes/{routeId}/segments

No content

List Service Areas

get
Responses
get
/service-areas
200

Successful response with a list of service areas

No content

Last updated

Was this helpful?