Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The /map resource represents the mapping capabilities of Weave.

...

Top-level resource: services/v1/map


Sub-resources:

1

...

. /map/mapengines

Provides a list of all map engines configured and available on Weave.

Info
titleRelated Further reading

Map engine definition

Map engine configuration


Example 1 

...

Code Block
languagejs
collapsetrue
{
  "success": true,
  "mapengines": [
    {"id": "mapengine.upload"},
    {
      "acetate": false,
      "selection": false,
      "legend": true,
      "format": "image/png32",
      "id": "selection.area_details",
      "override": {"entity": {
        "id": "local_government_area",
        "content": "sld/LGA.sld"
      }},
      "orderCheck": false
    },
    {"id": "google.streets"},
    {
      "acetate": false,
      "selection": false,
      "legend": true,
      "format": "image/png32",
      "id": "selection.main",
      "override": {"polygon": {
        "stroke-width": 1,
        "fill-color": "red",
        "fill-opacity": 0.25,
        "stroke-color": "red"
      }},
      "orderCheck": false
    },
    {
      "acetate": false,
      "selection": false,
      "crs": "EPSG:3857",
      "tokens": {"token": {
        "name": "ITEMFONTSIZE",
        "value": 11
      }},
      "id": "nsw_imagery_wms",
      "url": "http://maps.six.nsw.gov.au/arcgis/services/public/NSW_Imagery/MapServer/WMSServer?VERSION=1.3.0"
    },
    {
      "acetate": false,
      "selection": false,
      "legend": true,
      "format": "image/png32",
      "id": "selection.property_details",
      "override": {"entity": {
        "id": "property",
        "content": "sld/Property.sld"
      }},
      "orderCheck": false
    },
    {
      "acetate": false,
      "id": "nswdpe.ov",
      "selection": false,
      "crs": "EPSG:3857",
      "url": "http://192.168.2.146:80/cgi-bin/qgis_mapserv.fcgi?map=/data/maps/nswdpe_ov.qgs&VERSION=1.3.0"
    },
 {
      "acetate": false,
      "selection": false,
      "crs": "EPSG:3857",
      "scales": {"scale": [
        {
          "maxScale": 1,
          "minScale": 1,
          "layer": "development_application"
        },
        {
          "maxScale": 1,
          "minScale": 1,
          "layer": "major_projects_jobs_lap"
        },
        {
          "maxScale": 1,
          "minScale": 1,
          "layer": "major_projects_sites_lap"
        }
      ]},
      "tokens": {"token": {
        "name": "ITEMFONTSIZE",
        "value": 11
      }},
      "id": "nswdpe",
      "url": "http://192.168.2.146:80/cgi-bin/qgis_mapserv.fcgi?map=/data/maps/nswdpe.qgs&VERSION=1.3.0"
    }
]
}




Anchor
layers-info
layers-info
2

...

. /map/mapengines/{mapengineid}/layers

Provides a list of all map layers available for a given map engine.


Example 2 - 

Code Block
languagebash
themeEmacs
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/map/mapengine/nswdpe/layers'

...

Code Block
languagejs
collapsetrue
{
  "success": true,
  "layers": [
    {
      "scaleRange": "<500000.0",
      "boundingBoxes": [
        "{minx: 142.269, miny: -37.5493, maxx: 153.695, maxy: -28.1079, crs: 'GEOGCS[\"WGS 84\", DATUM[\"World Geodetic System 1984\", SPHEROID[\"WGS 84\", 6378137.0, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\", 0.0, AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree\", 0.017453292519943295], AXIS[\"Geodetic longitude\", EAST], AXIS[\"Geodetic latitude\", NORTH], AUTHORITY[\"EPSG\",\"4326\"]]'}",
        "{minx: 1.58373E7, miny: -4515950.0, maxx: 1.71093E7, maxy: -3262580.0, crs: 'PROJCS[\"WGS 84 / Pseudo-Mercator\", GEOGCS[\"WGS 84\", DATUM[\"World Geodetic System 1984\", SPHEROID[\"WGS 84\", 6378137.0, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\", 0.0, AUTHORITY[\"EPSG\",\"8901\"]], UNIT[\"degree\", 0.017453292519943295], AXIS[\"Geodetic longitude\", EAST], AXIS[\"Geodetic latitude\", NORTH], AUTHORITY[\"EPSG\",\"4326\"]], PROJECTION[\"Popular Visualisation Pseudo Mercator\", AUTHORITY[\"EPSG\",\"1024\"]], PARAMETER[\"semi_minor\", 6378137.0], PARAMETER[\"latitude_of_origin\", 0.0], PARAMETER[\"central_meridian\", 0.0], PARAMETER[\"scale_factor\", 1.0], PARAMETER[\"false_easting\", 0.0], PARAMETER[\"false_northing\", 0.0], UNIT[\"m\", 1.0], AXIS[\"Easting\", EAST], AXIS[\"Northing\", NORTH], AUTHORITY[\"EPSG\",\"3857\"]]'}"{
  "success": true,
  "mapengines": [
    {
      "id": "mapengine.upload"
    },
    {
      "acetate": false,
      "selection": false,
      "legend": true,
      "format": "image/png32",
      "id": "selection.area_details",
      "override": {
        "entity": {
          "id": "local_government_area",
          "content": "sld/LGA.sld"
        }
      },
      "orderCheck": false
    },
    {
      "id": "google.streets"
    },
    {
      "acetate": false,
      "selection": false,
      "legend": true,
      "format": "image/png32",
      "id": "selection.main",
      "override": {
        "polygon": {
          "stroke-width": 1,
          "fill-color": "red",
          "fill-opacity": 0.25,
          "stroke-color": "red"
        }
      },
      "orderCheck": false
    },
    {
      "acetate": false,
      "selection": false,
      "crs": "EPSG:3857",
      "tokens": {
        "token": {
          "name": "ITEMFONTSIZE",
          "value": 11
        }
      },
      "id": "nsw_imagery_wms",
      "url": "http://maps.six.nsw.gov.au/arcgis/services/public/NSW_Imagery/MapServer/WMSServer?VERSION=1.3.0"
    },
    {
      "acetate": false,
      "selection": false,
      "legend": true,
      "format": "image/png32",
      "id": "selection.property_details",
      "override": {
        "entity": {
          "id": "property",
          "content": "sld/Property.sld"
        }
      },
      "orderCheck": false
    },
    {
      "acetate": false,
      "id": "nswdpe.ov",
      "selection": false,
      "crs": "EPSG:3857",
      "url": "http://192.168.2.146:80/cgi-bin/qgis_mapserv.fcgi?map=/data/maps/nswdpe_ov.qgs&VERSION=1.3.0"
    },
    {
      "acetate": false,
      "selection": false,
      "crs": "EPSG:3857",
      "scales": {
        "scale": [
          {
            "maxScale": 1,
            "minScale": 1,
            "layer": "development_application"
          },
          {
            "maxScale": 1,
            "minScale": 1,
            "layer": "major_projects_jobs_lap"
          },
          {
            "maxScale": 1,
            "minScale": 1,
            "layer": "major_projects_sites_lap"
          }
        ]
      },
      "tokens": {
        "token": {
          "name": "ITEMFONTSIZE",
          "value": 11
        }
      },
      "id": "nswdpe",
      "url": "http://192.168.2.146:80/cgi-bin/qgis_mapserv.fcgi?map=/data/maps/nswdpe.qgs&VERSION=1.3.0"
    }
  ]
}


3

...

. /map/show

Represents the map imaging capabilities of Weave. This resource supports both HTTP GET and HTTP POST requests. A GET request may specify a map images from a single map engine whereas a POST request may specify a composite image consisting of multiple images sourced from different map engines. POST requests may also specify selections which can be drawn using a specially configured 'selection map engine' in Weave.

Parameters

3.1. GET query parameters

mapengine.id - string - map engine identifier as per configuration

layers - comma separated list of strings - map layers layer identifiers as per configuration (Refer to /map/mapengines/{mapengineid}/layers )

styles - comma separated list of strings - styles as per map layer configuration

...

opacity - decimal - image  transparency as a decimal <= 1.0


3.2. Sample POST body parameter

...

Code Block
languagebash
themeEmacs
curl -X POST --header 'Content-Type: application/json' --header 'Accept: applicationimage/jsonpng' --data '{"map.descriptions":[{"opacity":1,"layers":"0","map.engine":"google.streets"}, {"opacity":1,"layers":"addresspoi","map.engine":"nswdpe"},{"opacity":1,"layers":"_selection.all","map.engine":"selection.main"}],"selections":[{"entityid":"property","featureids":["2035960_Unit_1_1_Market_Street__11_Sydney_DP777449"]}]}' 'http://localhost:8080/weave/services/v1/map/show?crs=EPSG%3A3857&minx=16831751.916958902&miny=-4011871.179336485&maxx=16832450.599170577&maxy=-4011360.603874112&scale=288895.277144&dpi=96&width=960&height=540&opacity=1&imagetype=image%2Fpng' > map_1_layer.png

...

Note
Producing a single map image by combining a number of map images sourced from multiple map engines is a resource - intensive process. Where Weave application's resources are constrained, this approach is not recommended for implementing live map clients. Instead it is recommended that images (with an opacity less than 1) are superimposed as separate layers at the client end.

...