Geovisualization Developer's Guide

Layers

Use this resource to retrieve the geometry and metadata for layers and shapes. A layer is a collection of geometric shapes sharing some common features, such as country administrative boundaries containing polygons that designate the different countries.

The table below summarizes the available endpoints supported by the layers resource along with their HTTP methods and responses.

Table 1. Layers Endpoints
Resource Functions Method Response
/layers List all layers GET 200 OK with a response body listing all layers available
/layers/{LAYER_NAME}... List all shapes in a specific layer for a specified zoom level. The layer can be specified by its name, if it is publicly available, or its ID, if it is private. The request can also include filters, described below, to limit the number of features returned. See the examples. GET 200 OK with a response body listing all the shapes in GeoJSON format in the layer for the specified zoom level.
/layers/?description=... Upload a layer defined in the request body using a supported spatial format or JSON. See the examples. POST 201 CREATED with a response body listing all the shapes in GeoJSON format in the layer for the specified zoom level.

Example

Example of filtering for shapes in a specific layer for a specified zoom level, specifying additional filters:

GET https://datalens.api.here.com/v1/layers/{LAYER_NAME}?zoom={zoom_level}&maxFeatures={max_features}&bbox=MinX,MinY,MaxX,MaxY&cql_filter=name in ('name1','name2')&propertyName=iso3,name&srsName=EPSG:32636...

Example of uploading a layer using a supported spatial format or JSON:

GET https://datalens.api.here.com/v1/layers/?description={description}&to_srid={srid}&capabilities={capabilities_list}

Request Parameters

The table below documents the mandatory request parameters required by this resource.

Table 2. Mandatory Request Parameters
Parameter Datatype Description
app_id String

A-20 byte Base64 URL-safe encoded string used for the authentication of the client application.

app_code String

A-20 byte Base64 URL-safe encoded string used for the authentication of the client application.

access_token String

A temporary string used for the authentication. Tokens are valid for one hour.

description String A human-readable layer description. It is displayed as the layer title when querying the /layers resource.
zoom Integer Zoom level used for retrieving details about a specific layer. Valid values are integers between 1 and 18.

The table below documents the optional request parameters that can be specified with this resource.

Table 3. Optional Request Parameters
Parameter Datatype Description
bbox Geocoordinates Filter to limit the number of shapes returned, where the upper left and bottom right corners of a box are given in WGS-84 compliant geocoordinates. For example, a possible bounding box value is: &bbox=52.8,11.37309,52.31,13.2
capabilities List of Strings A comma-separated list of tags that indicate the capabilities of the layer. The special capability 'georeference' makes the layer available for georeferencing (required for choropleth visualizations).
cql_filter String Filter to limit the number of shapes returned, by attribute or by spatial data.

You can filter by the field name for the values of 'Germany' or 'France', for example, with &cql_filter=name in ('Germany','France').

You can do spatial filtering with the format: INTERSECTS(<geom_column_name>, POLYGON ((MinX MinY, MinX MaxY, MaxX MaxY, MaxX MinY, MinX MinY))) For example, to filter for shapes in Australia, use &cql_filter=INTERSECTS(geom, POLYGON((115.0 -30.0, 115.0 -32.0, 120.0 -30.0, 120.0 -30.0, 115.0 -30.0)))

maxFeatures Integer Filter to limit the number of shapes returned. For example, if you specify &maxFeatures=15, then the response only includes the first 15 rows. To return all rows, use &maxFeatures=all (the number of rows returned is limited to 50 by default).
propertyname String Filter to limit the number of shapes returned, based on a property in the GeoJSON schema. Possible values include:
  • admin_lev
  • iso3
  • navteq_id
  • name
For example, to retrieve only columns named 'iso3' and 'name', use &propertyName=iso3,name
srsName String Filter to retrieve the layer in another projection. The default projection is WGS84 (EPSG:4326). For example, to reproject to UTM 36N, include the parameter &srsName=EPSG:32636
to_srid String Forces layer reprojection to the specified SRID. If not specified, the default is 4326 (that is, WGS84).