Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 31 Next »

The minimum setup required for a WMS map engine is the capabilities URL for the service.

Optionally you can specify the format of the image generated (gif, jpeg, png, etc.), if the background of the image should be transparent or not, and if not, the colour of the background.
You are also able to change the colours or styling Weave uses to colour selections.

A WMS Tester tool is available from here, it can help resolve issues with WMS servers.

Namespace

urn:com.cohga.server.map.wms#1.0

Tags

mapengine

Properties

Name

Type

Required

Description

id

string

yes

Unique identifier

url

string

yes

The capabilities URL for the WMS service. You should not include the SERVICE, REQUEST or VERSION parameters in the URL, just use the base URL, these parameters will be added automatically based on the type of request that is being made.

Note: WMS version 1.3.0 may be forced by including the URL VERSION parameter, however this is not recommended and Weave will use WMS version 1.1.1 by default.

format

string

no

Default format that the map engine will request from the WMS server if one is not specified.

transparent

boolean

no

Determines if the areas of the image that are not covered by spatial data are rendered as transparent or as a solid colour (as set by the background property). Enabling transparency requires an image format that supports it (jpeg and png24 do not).

background

integer

no

The RGB value for the image background if transparency is not enabled, the default is #ffffff

username

string

no

A username to connect to the server as.

password

string

no

A password to connect to the server as. This should be encrypted using 'encrypt' at the osgi prompt.

qgisbooleannoForce the map engine as to be treated as though it were QGis. Weave will try and figure out if the underlying WMS service is QGis and perform additional optimisations and expose additional capabilities if it is, but sometimes Weave might not be able to determine this correctly in which case you can set this property to true in the config and the map engine will be treated as though it were being served from QGis. Additionally if Weave is incorrectly guessing that a WMS service is QGis when it isn't you can set this property to false to disable the additional functionality. (Note: Weave does not automatically identify QGis 3.4 hence need to set qgis=true.)
disableTestsbooleanfalseSet to true to disable the background checks to validate WMS connections
testIntervalinteger60,000milliseconds between tests when the WMS connection is working (minimum 15,000)
testIntervalWhileFailinginteger15,000milliseconds between tests when the WMS connection is failing (minimum 5,000)
testFailingDurationinteger300,000how long before a failing WMS connection is determined to have failed (minimum 60,000)
testIntervalWhenFailedinteger600,000milliseconds between tests when the WMS connection has failed (minimum 120,000)

Sub-tags

Name

Type

Cardinality

Description

layers

#layers

0..1

Refine what layers are included in the map description.

sort

#sort

0..1


styles

#style

0..1


crs#crs0..n

Refine what CRSs the map engine lists as being supported, as opposed to including all of them (as there might be thousands of CRSs that the WMS server says that it supports).

Without any crs tags a map engine will report all the projections the WMS server says it supports. By adding one or more crs tag you can refine this list so that the map engine only includes those projections that you're actually interested in using (which helps to improve performance). 

layers

Sub-tags

Name

Type

Cardinality

layer

#layer

0..n

remove

#remove

0..1

You should include one remove tag or one or more layer tags, not both.

remove

Sub-tags

Name

Type

Cardinality

layer

#layer

1..n

sort

Properties

Name

Type

Required

Description

method

"firsttolast" or "lasttofirst"

no

Default is firsttolast. It specifies if the layer list specifies layers to be sorted from top to bottom or from bottom to top.

Sub-tags

Name

Type

Cardinality

layer

#layer

2..n

layer

Content

The id of the layer

You do not need to include all layers in the layer list, only those you want moved, which is where the method property comes in. If you want to list a handful of layers to draw on top then just list them and use firsttolast (or don't set the method). If you only want to list a handful of layers to move to the bottom on the map then just list them and use lasttofirst.

styles

Properties

None.

Sub-tags

Name

Type

Cardinality

style

#style

1..n

style

Properties

Name

Type

Required

Description

layer

string

yes

The id of the layer, from the map engine, to override the style for

name

string

yes

The name of the style to use

crs

Properties

NameTypeRequiredDescription
forcebooleannoEnsure the CRS is added to the list of available CRS's even if the underlying server doesn't indicate that it supports the EPSG code

Content

The EPSG code of the coordinate reference system to add

Examples

Filtering layers to only include specific layers
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <layers>
    <layer>point1</layer>
    <layer>point2</layer>
    <layer>line1</layer>
    <layer>line2</layer>
    <layer>polygon1</layer>
    <layer>polygon2</layer>
  </layers>
</wms:mapengine>
Filtering layers to remove specific layers
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <layers>
    <remove>
      <layer>point2</layer>
      <layer>line2</layer>
      <layer>polygon2</layer>
    </remove>
  </layers>
</wms:mapengine>
Sorting layers
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <sort>
    <layer>point1</layer>
    <layer>point2</layer>
    <layer>line1</layer>
    <layer>line2</layer>
    <layer>polygon1</layer>
    <layer>polygon2</layer>
  </sort>
</wms:mapengine>
Sorting layers by moving one layer to the bottom
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <sort method='lasttofirst'>
    <layer>photo</layer>
  </sort>
</wms:mapengine>
Applying styles
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <styles>
    <style layer="property" name="bw_property"/>
    <style layer="road" name="bw_road"/>
  </styles>
</wms:mapengine>
Adding authentication
<wms:mapengine id="test">
  <url>http://username:password@server/wms/test</url>
</wms:mapengine>
Refine the list of supported CRS's for the map engine
<wms:mapengine id="test">
  <url>http://server/wms/test</url>
  <crs>EPSG:4326</crs>
  <crs>EPSG:28355</crs>
  <crs>EPSG:3857</crs>
</wms:mapengine>

As of version 1.3.7 of the WMS bundle the password can be encrypted using the osgi encrypt command.

WMS 1.3.0

Don't "upgrade" to WMS 1.3.0 unless you really have to.

Version 2.15.16 of the com.cohga.server.map.wms bundle (released as part of Weave 2.5.21) improves support for WMS 1.3.0 by supporting map services that require their axis order to be swapped.

Weave disables the use of WMS 1.3.0 when communicating with a WMS sever unless it's specifically asked to, which can be done by including a VERSION parameters in the map engine url attribute, e.g.

Enabling support for WMS 1.3.0
<wms:mapengine id="test">
  <url>http://server/wms/test?VERSION=1.3.0</url>
</wms:mapengine>

If you're lucky this is all you need to do to enable support for WMS 1.3.0. If you're unlucky you may be using a coordinate reference system that requires requests sent to the server to reverse the order of x, y coordinates, and it's update 2.14.16 of the Weave WMS map engine bundle that allows you to tell Weave to change the order of the coordinates when sending requests to the server. This is done by setting swapAxis to true in the map engine config, e.g.

Swapping coordinate order for a WMS map engine
<wms:mapengine id="test">
  <url>http://server/wms/test?VERSION=1.3.0</url>
  <swapAxis>true</swapAxis>
</wms:mapengine>

Once this is done Weave will send the bounding box parameter in miny, minx, maxy, maxx order, rather than minx, miny, maxx, maxy.

Note that when swapAxis is true swapping the axis order is done for all map requests sent to the server, so if you're trying to use a map service using a coordinate reference system that requires swapping of the coordinates, for example EPSG:3006, along with a coordinate reference system that doesn't, for example EPSG:3857, then you will need to create two map engines, one with swapAxis set to true and one without, and use the appropriate map engine for the different clients (since it's the crs attribute in the clients map view that determines what coordinate reference system will be used, and it's the coordinate reference system in WMS 1.3.0 that determines the axis order).

Further to this the change between 2.14.16 and 2.15.16 adds the ability for Weave to determine automatically if it should swap the axis or not when working with WMS 1.3, removing the need to use the swapAxis setting at all and the need to have two map engines configured if you need to use both swapped and un-swapped axis (you still need to include VERSION=1.3.0 in the url, to enable WMS 1.3 support, but that too may be removed eventually).

Unfortunately to enable the automatic determination of whether to swap the axis or not you must update your startup setting to remove the org.geotools.referencing.forceXY setting. This is done by editing startup.cmd (or startup.sh)or editing wrapper.conf and removing the option that sets this property to true, otherwise Weave will always think that the axis order is x, y regardless of the projection used.

Note that setting swapAxis to false will force x, y ordering of the axis regardless of what the projection information says.

  • No labels