4.2 Accessing Spatial Studio REST API Programmatically

You can programmatically interact with the Spatial Studio REST API endpoints from another application.

A typical use case is to consume a Spatial Studio dataset or analysis, and showing its contents (geometries and attributes) on a map that you are creating either from scratch or in an existing web mapping application (such as a map region inside your Oracle Apex application). To implement this, you must first understand the ways Spatial Studio can serve its datasets for mapping purposes.

Spatial Studio can serve its geometry datasets in two formats - GeoJSON and Vector Tiles, with each format using its own REST endpoint. The endpoint that applies for GeoRaster datasets, returns its contents as image tiles. Table 4-1 summarizes all the relevant REST endpoints Spatial Studio uses to serve the data of the datasets.

Table 4-1 Dataset Format Specific Endpoint

Format Endpoint

Vector Tiles

(for table/view/analysis datasets containing geometry or lat/lon indexed columns)

https://localhost:4040/spatialstudio/oauth/v1/vt/<DATASET_ID>/<GEOM_COLUMN_NAME>/{z}/{x}/{y}.mvt

Ensure to substitute the string <DATASET_ID> with the id of the target dataset and <GEOM_COLUMN_NAME> with the name (not id) of the geometry column.

GeoJSON

(for geometry type datasets)

https://localhost:4040/spatialstudio/oauth/v1/jsonstream/<DATASET_ID>?geo=<GEOM_COLUMN_NAME>

  • If the dataset has only one geometry column, then the geo query parameter can be omitted.
  • Also, ensure to substitute the string <DATASET_ID> with the id of the target dataset and <GEOM_COLUMN_NAME> with the name (not id) of the geometry column.

Image Tiles

(for GeoRaster datasets)

https://localhost:4040/spatialstudio/oauth/v1/rt/<COLUMN_ID>/{z}/{x}/{y}.png

Note that this requires <COLUMN_ID> and not <DATASET_ID>. Also, replace <COLUMN_ID> with the image column id of the GeoRaster dataset. See Displaying a Spatial Studio GeoRaster Dataset as Image Tiles for more information on how to obtain the image column id of GeoRaster datasets.

This is different from the REST endpoints for Vector Tiles or GeoJSON data, which require the id of the dataset and the name of the geometry column.