/map resource
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.
Further reading
Example 1
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/map/mapengines'
Output:
2. /map/mapengines/{mapengineid}/layers
Provides a list of all map layers available for a given map engine.
Example 2 -
curl -X GET --header 'Accept: application/json' 'http://localhost:8080/weave/services/v1/map/mapengine/nswdpe/layers'
Output:
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 layer identifiers as per configuration (Refer to /map/mapengines/{mapengineid}/layers )
styles - comma separated list of strings - styles as per map layer configuration
crs - string - Coordinate reference system used to specify the map envelope coordinates (minx, miny, maxx, maxy)
minx - decimal - Left margin x axis value of the map image
miny - decimal - Bottom margin y axis value of the map image
maxx - decimal - Right margin x axis value of the map image
maxy - decimal - Top margin y axis value of the map image
scale - Map scale - ratio of a unit of distance on the map image to actual distance on land - if different from the scale derived by comparing the map envelope to width and height, envelope will be readjusted
dpi - integer - Logical (CSS) dots-per-inch value on the client display
width - integer - image width in pixels
height - integer - image height in pixels
opacity - decimal - image transparency as a decimal <= 1.0
3.2. Sample POST body parameter
Return values
Accept header | Return value example | Description |
---|---|---|
image/* | <image binary data stream, default format is PNG> | image data |
image/png | <image binary data stream, PNG format> | image data |
image/jpeg | <image binary data stream, JPEG format> | image data |
application/json | JSON object containing a 'path' property which points to a generated image on the server |
Example 3 - Draw a map image using a map engine backed by a WMS server (HTTP GET)
curl -X GET --header 'Accept: image/png' 'http://localhost:8080/weave/services/v1/map/show?mapengine.id=nswdpe&layers=addresspoi%2Clocal_government_area%2Csuburb&crs=EPSG%3A3857&minx=16773188.612842508&miny=-4047990.362440507&maxx=16862619.93593616&maxy=-3982636.7032566806&scale=295000&dpi=96&width=400&height=400&opacity=0.75' > map_show.png
Output:
Example 3 - Draw a map image by specifying pre-configured layers and a selection (HTTP POST)
curl -X POST --header 'Content-Type: application/json' --header 'Accept: image/png' --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
Output: