Versions Compared

Key

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

...

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

Tags

mapengine

Properties


Name

Type

Required

Default

Description

id

string

yes


Unique identifier for tyhis map engine

spatialengine

string

urn:com.cohga.server.spatial.geotools#1.0


The spatial engine that will be providing the data

format

string

yes


What image format the map engine will support

layers

#layer

yes


A list of the layers that this map engine will provide

styles

#style

yes


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

Alternatively this can point to an external SLD file

layer

Properties

Name

Type

Cardinality

Description

id

string

1..1

The unique id of the layer

label

string

1..1

The user visible label for the label

layer

string

1..1

The layer, within the spatial engine, that this layer will use

style

#style

1..1

The style that this layer should be displayed with

style

Properties

Name

Type

Cardinality

Description

id

string

1..1

The unique id for this style, which can then be referenced by a layer

type

string

0..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

Example Weave map engine
Code Block
languagexmltitleExample 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>

...

You can specify one or more filters for each layer that can be used to refine what data is retrieved from the underlying table, e.g.

Filtering data using CQL
Code Block
languagexmltitleFiltering data using CQL
<layer id="active_incidents" label="Active Incidents" layer="GIS.INCIDENTS" style="incidents">
	<filter>STATUS = 'ACTIVE'</filter>
</layer>
<layer id="inactive_incidents" label="Inactive Incidents" layer="GIS.INCIDENTS" style="incidents">
	<filter><![CDATA[STATUS <> 'ACTIVE']]></filter>
</layer>

...

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.

...

Using an external SLD file to style a layer
Code Block
languagexml
			<layer id="contours01" label="Contours 1m" layer="GIS.CONTOURS_01M" style="sld\contours.sld"/>

In this example there should be a file located at weave\platform\workspace\sld\contours.sld that contains the XML definition for the style.

Example SLD file
Code Block
languagexmltitleExample SLD file
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
  <NamedLayer>
    <Name>Contour</Name>
    <UserStyle>
      <Title>Contour</Title>
      <FeatureTypeStyle>
        <Rule>
          <LineSymbolizer>
            <Stroke>
              <CssParameter name="stroke">#853111</CssParameter>
              <CssParameter name="stroke-width">2</CssParameter>
            </Stroke>
          </LineSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

...

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

Stroke

Name

Default

stroke-colour

orange

stroke-width

3

stroke-opacity

1

Fill

Name

Default

fill-colour

orange

fill-opacity

0.125

Mark

Name

Default

mark-type

circle

mark-size

10

mark-opacity

1

mark-rotation

0

Joining Tables

From 2.6.4 it's possible to join to another table if the underlying spatial engine is using a database, i.e. this won't work for shapefiles for example. 

This would for example provide the ability to filter the rows displayed on the map based on the value in a column in a table different from the one containing the geometry. To join the additional table you need to add a <join/> tag with the information about the other table (which must be in the same database) and how it is joined to the source table. Additionally you can set the type of join, inner or outer, and add a filter for the extra table.

Code Block
<layer id="my_active_incidents" label="My Active Incidents" layer="GIS.INCIDENTS" style="incidents">
	<join>
		<type>inner</type> <!-- this is the default, and will result in only the rows that are in both tables being displayed -->
		<table>GIS.INCIDENT_DETAILS</table> <!-- The name of the table to join to GIS.INCIDENTS -->
		<where>ID = ID</where> <!-- The columns in the two tables to join, must always be an equals -->
		<filter>STATUS = 'ACTIVE'</filter> <!-- An additional filter to further reduce the rows that are displayed -->
		<filter>USERID = '${user.id}'/> <!-- Another filter, this time selecting rows that belong to the current user -->
	</join>
</layer>

Join

Name

Type

Carnality

Default

Description

table

string

1..1


The name of the table to join to the source table

where

string

1..1


A description of the join between the two columns. This should always be a X = Y type of expression where X is the column in the source table and Y is the column in the extra table. The rows from the two tables will be matched based on the values in the X column in the source table having the same value as the Y column in the target table.

type

'outer' or 'inner'

0..1

'inner'

Should the join between the two tables be an inner join, only rows in both tables are returned, or an outer join, rows in the source table are still returned even if they don't have a matching row in the extra table

filter

string

0..n


This is a ECQL expression that will be applied to the extra table to filter the rows that should be included, this includes support for user attributes.