Versions Compared

Key

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

As of Weave 2.5, there is a built-in map engine that is able to generate map images based on spatial data that has been registered using a Spatial Engine.

The configuration for the Weave map engine consists of two parts, the first part defines what data will be made available to be drawn by the map engine, and the second part determines how that data will be drawn.

Note

Currently, all of the data that 's is drawn by a Weave map engine must come from the same spatial engine, but you can have multiple Weave map engines configured.

And the map engine also only supports vector data, it does not currently support raster data.

...

Namespace

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

Tags

mapengine

Properties


NameTypeRequiredDefaultDescription
idstringyes
Unique identifier for tyhis map engine
spatialenginestringurn:com.cohga.server.spatial.geotools#1.0
The spatial engine that will be providing the data
formatstringyes
What image format the map

...

engine will support
layers#layeryes
A list of the layers that this map engine will provide
styles#styleyes

A list of the styles that can be used to display a layer.

Alternatively this can point to an external SLD file

layer


Properties

NameTypeCardinalityDescription
idstring1..1The unique id of the layer
labelstring1..1The user visible label for the label
layerstring1..1The layer, within the spatial engine, that this layer will use
style#style1..1The style that this layer should be displayed with

style

Properties

NameTypeCardinalityDescription
idstring1..1The unique id for this style, which can then be referenced by a layer
typestring0..1

What geometry type does this style represent? point, line or polygon.

This is only used if the style is defined inline and not required if this style references an SLD file

Notes

See the section below on inline styles for information on how the styles are defined.

Example

Code Block
languagexml
titleExample Weave map engine
<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="urn:com.cohga.server.config#1.0" xmlns:weave="urn:com.cohga.server.map.weave#1.0">

	<weave:mapengine id="vector">
		<spatialengine>gis</spatialengine>
		<format>image/png32</format>
		<layers>
			<layer id="contours01" label="Contours 1m" layer="GIS.CONTOURS_01M" style="contour"/>
			<layer id="contours02" label="Contours 2m" layer="GIS.CONTOURS_02M" style="contour"/>
			<layer id="contours05" label="Contours 5m" layer="GIS.CONTOURS_05M" style="contour"/>
			<layer id="contours10" label="Contours 10m" layer="GIS.CONTOURS_10M" style="contour"/>
		</layers>
		<styles>
			<style id="contour">
				<type>line</type>
				<stroke-color>#853111</stroke-color>
				<stroke-width>2</stroke-width>
			</style>
		</styles>
	</weave:mapengine>

</config>

...

The example above uses a simple inline style definition that uses CSS like attributes to define how the vector data should be drawn. It's also possible to use an external SLD (Styled Layer Descriptor) file to describe how the layer should be displayed , if you require more advanced styling. In this case, you can just reference the SLD file using the layer style attribute, e.g.

...

This SLD file does not do much more that than the inline style shown in the first example, but this page isn't a tutorial on SLD.

...

 When specifying a style within the Weave map engine config directly you need to specify an id for the style, so that it can be referenced by the layer, and also what type of features the style will be applied to, point, line (or linestring) or polygon, and you do this by setting the type attribute for the style.

Additionally, you can specify a maximum and minimum scale range for the style using minScale (or minscale) and maxScale (or maxscale).

Finally, you can also specify a label (or title) and a description (or abstract) which can be used when generating the legend.

After that, it's just a case of setting the appropriate attributes that define how you want the data rendered.

...

When specifying colours you can either use hex notation with RRGGBB and prefix the value with a #, for example, #ff0000 for red, or you can use a pre-defined colour from the list black, blue, cyan, darkgray, darkgrey, gray, grey, green, lightgray, lightgrey, magenta, orange, pink, red, whiteyellow.

...

When specifying a style for lines you can specify the stroke attributes, for a polygons polygon both stroke and fill attributes, and for points stroke, fill and mark are required.

...