REST API
Scope
This page is intended for developers who are authorized to manage the MapCore™ Map Layer Server.
This page describes the RESTful API requests sent via HTTP protocol required to manage the MapCore™ Map Layer Server and retrieve information when not using MapCore™ GUI.
The following APIs are available for developers:
Table 6-1 Available REST APIs
| Name | Method | Function |
|---|---|---|
| GetCapabilities | GET | Returns a list of key map data in XML format. |
| remove-layer | POST | Remove a layer from the server. |
General Request Information
Request path
Requests are sent to the following URL:
http://<server>:<port>/
Where <server> is the name or address of the server, such as my_server, and <port> is as described in Server Execution Parameters.
Request header
POST requests have the following header:
X-CALLING-APP management
GET GetCapabilities Request (WMTS Compatible)
Use case
Returns a list in XML format of all MapCore™ Map Layer Server's capabilities (layers). See below for the option to produce a list that is compatible with OGC WMTS standard. (see OpenGIS Web Map Tile Service Implementation Standard) Note, however, that WMTS supports fewer capabilities than the MapCore™ Map Layer Client and therefore the response to the WMTS compliant GET GetCapalities request is not as rich as the MapCore™ compliant response.
For the GetCapabilities list to be compatible with WMTS, it must not have a MAPCORE tiling scheme.
Data stored in the Backlog layer is not retrieved by the GetCapabilities request.
Request
Method
GET
URL
Use either of the following options:
-
MapCore™ compliant: /map/opr
-
WMTS compliant: OGC/WMTS/1.0.0/
Request Parameters
| Parameter | Mandatory | Description | Value |
|---|---|---|---|
| Request | Yes | Receive a list in XML format of all MapCore™ Map Layer Server's capabilities | GetCapabilities |
| service | Yes | The service the request is for. The response format is chosen by the URL, not by this parameter: the WMTS compliant URL returns only the layers that comply with the WMTS standard, without 3D models | wmts |
Example
MapCore™ compliant: http://my\_server:6767/map/opr?request=getCapabilities&service=wmts
WMTS compliant:
http://my_server:6767/OGC/WMTS/1.0.0?service=WMTS&request=GetCapabilities
Response
An XML report of active map layers in the MapCore™ Map Layer Server. Depending on the method for requesting it, this list may be WMTS compliant in format.
Refer to Configure the server for detailed information about each parameter in this file.
For raw vector 3D extrusion layers, the MapCore™ compliant response additionally includes the McDtmLayerID element, which holds the ID of the DTM layer on which the layer is based.
The MapCore™ client is able to parse the response to this request.
Response mime type
application/xml
Example for MapCore™ compliant response
<Capabilities version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns="http://www.opengis.net/wmts/1.0">
<ows:ServiceIdentification>
<ows:Title>MapCore Map Layer Service</ows:Title>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>MapCore Map Layer Server 7.11.11.0-alpha7</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.elbitsystems.com" />
<ows:ServiceContact>
<ows:IndividualName>MapCore's WMTS client</ows:IndividualName>
</ows:ServiceContact>
</ows:ServiceProvider>
<Contents>
<Layer>
<ows:Identifier>aaa</ows:Identifier>
<ows:Title>Vector 3D Exrusion-1</ows:Title>
<Format>MapCoreServerVector3DExtrusion</Format>
<DrawPriority>0</DrawPriority>
<Group>Netanya-group</Group>
<ows:BoundingBox>
<ows:LowerCorner>34.899622 32.309430</ows:LowerCorner>
<ows:UpperCorner>35.000349 32.350264</ows:UpperCorner>
<ows:crs>urn:ogc:def:crs:EPSG::4326</ows:crs>
</ows:BoundingBox>
</Layer>
<Layer>
<ows:Identifier>DTM-1</ows:Identifier>
<ows:Title>DTM-1</ows:Title>
<Format>MapCoreServerDTM</Format>
<DrawPriority>0</DrawPriority>
<Group>Netanya-group</Group>
<ows:BoundingBox>
<ows:LowerCorner>6.969170 35.339500</ows:LowerCorner>
<ows:UpperCorner>7.028920 35.399250</ows:UpperCorner>
<ows:crs>urn:ogc:def:crs:EPSG::4326</ows:crs>
</ows:BoundingBox>
</Layer>
<Layer>
<ows:Identifier>Natanya_GL_DTM</ows:Identifier>
<ows:Title>Netanya GLOBAL_LOGIC</ows:Title>
<Format>MapCoreServerDTM</Format>
<DrawPriority>0</DrawPriority>
<Group>Netanya-group</Group>
<ows:BoundingBox>
<ows:LowerCorner>33.609470 29.307590</ows:LowerCorner>
<ows:UpperCorner>36.861460 34.496000</ows:UpperCorner>
<ows:crs>urn:ogc:def:crs:EPSG::4326</ows:crs>
</ows:BoundingBox>
</Layer>
<Layer>
<ows:Identifier>RAWDTMMACCABIM</ows:Identifier>
<ows:Title>RAWDTMMACCABIM</ows:Title>
<Format>MapCoreServerDTM</Format>
<DrawPriority>0</DrawPriority>
<Group>Netanya-group</Group>
<ows:BoundingBox>
<ows:LowerCorner>6.969170 35.339500</ows:LowerCorner>
<ows:UpperCorner>7.028920 35.399250</ows:UpperCorner>
<ows:crs>urn:ogc:def:crs:EPSG::4326</ows:crs>
</ows:BoundingBox>
</Layer>
<Layer>
<ows:Identifier>PolyVector-Polygons</ows:Identifier>
<ows:Title>PolyVector</ows:Title>
<Format>MapCoreServerVector</Format>
<DrawPriority>0</DrawPriority>
<Group>Netanya-group</Group>
<ows:BoundingBox>
<ows:LowerCorner>6.950150 35.106258</ows:LowerCorner>
<ows:UpperCorner>6.960474 35.117092</ows:UpperCorner>
<ows:crs>urn:ogc:def:crs:EPSG::4326</ows:crs>
</ows:BoundingBox>
<McSubLayerName></McSubLayerName>
<McSubLayerGeometry>Polygons</McSubLayerGeometry>
</Layer>
<Layer>
<ows:Identifier>Raster-2</ows:Identifier>
<ows:Title>Raster-2</ows:Title>
<Format>MapCoreServerRaster</Format>
<DrawPriority>0</DrawPriority>
<Group>bbb</Group>
<ows:BoundingBox>
<ows:LowerCorner>696900.000000 3533950.000000</ows:LowerCorner>
<ows:UpperCorner>702900.000000 3539950.000000</ows:UpperCorner>
<ows:crs>urn:ogc:def:nil:OGC:unknown</ows:crs>
</ows:BoundingBox>
</Layer>
</Contents>
<ServiceMetadataURL xlink:href="http://localhost:6767/?service=WMTS&request=GetCapabilities" />
</Capabilities>
Example for WMTS compliant response
<Capabilities version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns="http://www.opengis.net/wmts/1.0">
<ows:ServiceIdentification>
<ows:Title>MapCore Map Layer Service</ows:Title>
</ows:ServiceIdentification>
<ows:ServiceProvider>
<ows:ProviderName>MapCore Map Layer Server 7.11.11.0-alpha7</ows:ProviderName>
<ows:ProviderSite xlink:href="http://www.elbitsystems.com" />
<ows:ServiceContact>
<ows:IndividualName>MapCore's WMTS client</ows:IndividualName>
</ows:ServiceContact>
</ows:ServiceProvider>
<Contents>
<Layer>
<ows:Identifier>DTM-1</ows:Identifier>
<ows:Title>DTM-1</ows:Title>
<Format>MapCoreServerDTM</Format>
<DrawPriority>0</DrawPriority>
<Group>aaa</Group>
<ows:BoundingBox>
<ows:LowerCorner>6.969170 35.339500</ows:LowerCorner>
<ows:UpperCorner>7.028920 35.399250</ows:UpperCorner>
<ows:crs>urn:ogc:def:crs:EPSG::4326</ows:crs>
</ows:BoundingBox>
</Layer>
</Contents>
<ServiceMetadataURL xlink:href="http://localhost:6767/map/opr?request=getCapabilities&service=wmts" />
</Capabilities>
POST remove-layer Request
Use case
Remove a layer from the database. Data created via the MapCore™ Map Layer Server GUI will be removed from the disk where data imported silently may be optionally saved on the disk even when the layer is removed from the server database.
Request
Method
POST
URL
map/opr/remove-layer
Request parameters
Table 6-2 remove-layer request fields
| Field | Mandatory | Value | |
|---|---|---|---|
| layerId | Yes | Identifier of the layer to be removed. | |
| deleteFromDisk | No | Relevant only for data that was silently imported. Specify true to remove the data from the disk or false (default) to leave the data on the disk. | |
| DeleteDependencies | No | Relevant for DTM layers only. Specify true to delete DTM layers as well as any Raw 3D Extrusion layers dependent on the DTM layer that is to be deleted. Specify false (default) to leave the DTM layer (deletion will fail) if any Raw 3D Extrusion layers are dependent on it. |
POST Request Payload Example
{
"layerId": "RAWDTMMACCABIM",
"deleteFromDisk": "true",
"DeleteDependencies" : "true"
}
Response
Response data
The response includes the data present in both MapCore™ Map Layer Server configuration files in JSON format:
-
McMapLayersServerConfig.xml
-
McLayersDataConfig.xml
Refer to Server Configuration File and Layer Configuration File for more details about these two files.
Table 6-3 remove-layer response fields
| Field | Value |
|---|---|
| operation | remove-layer |
| comment | Success or failure message |
Example
{
"SuffixUrl": "/map/opr",
"MemoryCacheSize": 125,
"DiskCacheSize": 2048,
"DiskCacheFolder": ".",
"IntermediateFilesFolder": ".",
"GpuUsageInSpatialQueries": false,
"SSLUsage": false,
"ImportScansInterval": 15,
"IsClientVerPre_7_11_4": false,
"DefaultTextIndexFilePath": "/data/spatialIndex.sqlite",
"TilingSchemePolicy": {
"DefaultTilingScheme": "GLOBAL_LOGICAL",
"TilingSchemesByCRS": []
},
"DefaultMaxScaleFactor": 1.0,
"MapLayerConfig": [
{
"LayerId": "aaa",
"Title": "Vector 3D Exrusion-1",
"LayerType": "RAW_VECTOR_3D_EXTRUSION",
"LayerUUID": "f8737d19-a46a-4924-9bf1-906b441d83f2",
"Group": "Netanya-group",
"RawLayerInfo": {
"TilingScheme": "GLOBAL_LOGICAL",
"TargetCoordinateSystem": {
"SRIDType": "EPSG",
"Code": 4326
},
"Vector3DExt": {
"DataSource": "./data/maps/aaa/net/net.shp",
"DtmLayerId": "Natanya_GL_DTM",
"HeightColumn": "height",
"UseSpatialIndexing": true
}
},
"LayerImportType": "UPLOADED"
},
{
"LayerId": "DTM-1",
"Title": "DTM-1",
"LayerType": "RAW_DTM",
"LayerUUID": "199cd12c-1003-48e1-8d8f-32f9e04a3bc0",
"Group": "Netanya-group",
"RawLayerInfo": {
"TilingScheme": "GLOBAL_LOGICAL",
"TargetCoordinateSystem": {
"SRIDType": "EPSG",
"Code": 4326
},
"Dtm": {
"Location": [
{
"LocationType": "FOLDER",
"Path": "./data/maps/DTM-1"
}
]
}
},
"LayerImportType": "UPLOADED"
},
{
"LayerId": "Natanya_GL_DTM",
"Title": "Netanya GLOBAL_LOGIC",
"LayerType": "NATIVE_DTM",
"LayerUUID": "1a93d9df-ad64-4493-8fda-22be075d02a0",
"Group": "Netanya-group",
"NativeLayerPath": "../MappingMaterials/Israel/DTM/DtmWgs10-Web",
"LayerImportType": "SILENTLY_IMPORTED",
"OriginalPackageDataFile": "./ExternalLayers/DTM_GL_GEO/PackageDataDTMGL_GEO.json.imported"
},
{
"LayerId": "RAWDTMMACCABIM",
"Title": "RAWDTMMACCABIM",
"LayerType": "RAW_DTM",
"LayerUUID": "3c56cd89-2f42-490a-937a-0f3f83df2616",
"Group": "Netanya-group",
"RawLayerInfo": {
"TilingScheme": "GLOBAL_LOGICAL",
"TargetCoordinateSystem": {
"SRIDType": "EPSG",
"Code": 4326
},
"Dtm": {
"Location": [
{
"LocationType": "FOLDER",
"Path": "./ExternalLayers/DTM/RAWDTM/DTM"
}
]
}
},
"LayerImportType": "SILENTLY_IMPORTED",
"OriginalPackageDataFile": "./ExternalLayers/DTM/PackageDataRawDTM.json.imported"
},
{
"LayerId": "PolyVector-Polygons",
"Title": "PolyVector",
"LayerType": "NATIVE_VECTOR",
"LayerUUID": "68fc2323-e264-4384-99f2-405172b69488",
"Group": "Netanya-group",
"NativeLayerPath": "./ExternalLayers/RawVector/Polygon/Native/PolyVector-Polygons",
"ClientMetadata": {
"McSubLayerName": "",
"McSubLayerGeometry": "Polygons"
},
"LayerImportType": "SILENTLY_IMPORTED",
"OriginalPackageDataFile": "./ExternalLayers/RawVector/PackageData.json.imported"
},
{
"LayerId": "Raster-2",
"Title": "Raster-2",
"LayerType": "RAW_RASTER",
"LayerUUID": "3f1c00e3-0764-4a5a-8576-868f9b56834e",
"Group": "bbb",
"RawLayerInfo": {
"TilingScheme": "GLOBAL_LOGICAL",
"Raster": {
"Location": [
{
"LocationType": "FOLDER",
"Path": "./data/maps/Raster-2"
}
],
"ResolveOverlapConflicts": false,
"EnhanceBorderOverlap": false,
"FillEmptyTilesByLowerResolutionTiles": false,
"IgnoreRasterPalette": false,
"HighestResolution": 0.0
}
},
"LayerImportType": "UPLOADED"
}
]
}
If the layer ID is not found in the database, then the response is the following error message:
{
"errorMessage": "The specified layer is not found"
}