The update is intended to expose This update exposes Weave map engines as a WMS service, but the . The bundle can also be used to create URL's that can be called from external application applications to create custom map images, this is because the . The bundle supports additional parameters beyond those required by WMS which and allows for more customised map output.
This update requires at least release 2.4.25.12 and an additional two bundles, com.cohga.server.wms
and com.cohga.server.acetate.highlight
, which can be downloaded below.
Info |
---|
com.cohga.server.wms_1.0.0.jar - Provide a WMS interface into Weave to generate maps |
The bundle must be installed and started (generally by editing the platform\configuration\config.ini file and restarting Weave) and a new configuration created to describe the WMS services that Weave will expose. To add the new bundles to the config.ini file the following 2 lines should be added to the list of bundles to be started as startup
Code Block |
---|
com.cohga.server.wms@:start,\
com.cohga.server.acetate.highlight@:start,\
|
A new configuration describes a map context that is similar to that which is setup for a map view in a client configuration, and . It is generated in a similar way to the maps that are included in a BIRT report.
There can be multiple map context setupsetups, that each describe different map setups.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:wmsserver="urn:com.cohga.server.wms#1.0"> <wmsserver:context id="test"> <mapengine id="mapengine.raster"> <layer>satellite</layer> </mapengine> <mapengine id="mapengine.vector"> <layer>property</layer> <layer>road</layer> <layer>suburb</layer> <layer>mccbound</layer> </mapengine> <mapengine id="mapengine.parks" opacity="0.75"> <layer>Reserve Images</layer> </mapengine> </wmsserver:context> </config> |
The above example will expose exposes a new WMS service at /weave/wms/test
that will contain the layers listed (and only those layers).
And, when When the WMS client tried tries to draw the map, Weave will use the three map engines to generate the individual images and combine them into a single map image to return to the client.
This service should be supported in any WMS compliant client.
Complete option list
Name | Description | WMS Compliant |
---|---|---|
srs | Coordinate reference system of the coordinates specified in the URL |
Y | |
width | Width of generated image in pixels |
Y | |
height | Height of generated image in pixels |
Y | |
format | Output format of the generated image |
Y | |
bgcolor | Background colour |
Y | |
transparent | true if transparent images should be created, false if opaque images should be generated |
Y | |
bbox | Comma separated minx, miny, maxx and maxy of the generated image |
Y | |
layers | List of layers to draw, all layers will be drawn if not set at all, |
and no layers drawn if layers is set to no value |
Y | |
exceptions | Method used to return errors to the caller |
exceptionmessage | The error message to draw on the map if an image can not be generated | |
size | Comma separated width and height of generated image in pixels |
dpi | DPI of generated image, to ensure scale |
dependencies are calculated correctly |
minx | Left X coordinate |
miny | Bottom Y coordinate |
maxx | Right X Coordinate |
maxy | Top Y coordinate |
x | Center X coordinate |
y | Center Y coordinate |
center | Comma separated X and Y coordinate |
. Both | |
scale | Scale to generate map at |
entity | Entity to use to determine map extent and draw highlight |
ids | Identifiers of entities to zoom to and highlight |
filter | Filters to be applied to 'ids' before calculating the extent. For use if external system uses different id's for the underlying GIS data |
buffer | Amount to scale entity extent by to calculate extent, e.g. 1.2 to place a 20% buffer around the entity bounds |
minscale | Minimum scale to zoom to when zooming to an entity |
highlight | false if the entity highlight should not be drawn, true if it should be drawn |
hlcolor
hlcolor | Vector highlight colour | |
mcolor | Marker highlight colour. Should be blue, brown, dark, green, orange, purple, red, silver or yellow. The default is green. The mcolor 'dark' is a dark grey. |
Note |
---|
You must include a parameter or parameters in the URL to set or calculate the map bounding box, this can not be set in the context. When specifying the map extent bounding box setting minx, miny, maxx and maxy is the same as specifying just bbox, and bbox will take precedence if both are present. Setting size will take precedence over setting width and height . |
The above settings will generally be supplied by the WMS client, and defaults can be set in the context
.
Generally these will all be set by the WMS client when sending WMS requests to the Weave server and do not need to be specified in the configuration, however, you may want to set these values in the configuration if you're intending on constructing and using the URL's from another application and you want to simplify the URL that the other application needs to use.
For example, if you have an application that you want to always generate an 800x800 PNG image with a light blue background then you could use the URL:/weave/wms/test?width=800&height=800&bgcolor=0x7f7fff&format=png&bbox=...140,-36,141,-35
or you could set width
, height
, format
and bgcolor
in the context and use the following URL instead/weave/wms/test?bbox=...140,-36,141,-35
This allows you to provide a simplified URL to the application provider while specifying the fixed settings yourself, it all depends upon the requirements of the other application and how much of it can be pre-set.
...
.
...
...
Basic Context Example Requests
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?maxx=355971&maxy=5831675&minx=323098&miny=5807358&width=800&height=600&format=png32
/weave/wms/test?bbox=323098,580735,355971,5831675&size=800,600&format=png32
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?x=355971&y=5831675&scale=5000&width=800&height=600&format=png32
/weave/wms/test?center=355971,5831675&scale=5000&size=800,600&format=png32
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?entity=property&ids=242765&minscale=2500&buffer=1.2&width=800&height=600&format=png32
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?entity=property&ids=242765&minscale=2500&buffer=1.2&highlight=false&width=800&height=600&format=png32
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?x=355971&y=5831675&scale=5000&entity=property&ids=242765&minscale=2500&buffer=1.2&width=800&height=600&format=png32
|
Extended Context Example Requests
The following example examples assume the following map context and are the equivalent of the above.
Code Block | ||||
---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="urn:com.cohga.server.config#1.0" xmlns:wmsserver="urn:com.cohga.server.wms#1.0">
<wmsserver:context id="test">
<minscale>2500</minscale>
<buffer>1.2</buffer>
<width>800</width>
<height>600</height>
<format>png32</format>
<entity>property</entity>
<mapengine id="mapengine.raster">
<layer>satellite</layer>
</mapengine>
<mapengine id="mapengine.vector">
<layer>property</layer>
<layer>road</layer>
<layer>suburb</layer>
<layer>mccbound</layer>
</mapengine>
<mapengine id="mapengine.parks" opacity="0.75">
<layer>Reserve Images</layer>
</mapengine>
</wmsserver:context>
</config>
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?maxx=355971&maxy=5831675&minx=323098&miny=5807358
/weave/wms/test?bbox=323098,580735,355971,5831675
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?x=355971&y=5831675&scale=5000 /weave/wms/test?center=355971,5831675&scale=5000 /weave/wms/test?center=337649.188,5818856.678&scale=1000&srs=EPSG:28355 /weave/wms/test?center=145.1568367,-37.7632155&scale=5000&srs=EPSG:4283 |
Code Block | ||
---|---|---|
| ||
/weave/wms/test?entity=property&ids=242765 |
Code Block | ||
---|---|---|
| ||
/weave/wms/test?entity=roads&ids=AS14124&minscale=5000
|
...
Code Block | ||
---|---|---|
| ||
/weave/wms/test?entity=roads&ids=AS14124&minscale=5000&layers=road,property
|
...
Note |
---|
The last example specifies the layer as |
...