A spatial mapper links an Entity to a Spatial Engine. This linkage is not required and in fact may not be possible if there is no spatial information associated with the entity. If there is spatial information that relates to the entity and you want the users to be able to perform spatial operations (select by polygon, etc.) on the entity then a link should be set up.
The mapping is actually between the entity and an object that is managed by a spatial engine. The type of object will be different depending upon the spatial engine. For example, if the spatial engine is ArcSDE then the mapping will be between the entity and an ArcSDE Layer, for Oracle Spatial it will be between the entity and a spatially enabled table.
When adding a definition for a spatial mapping, the setup will be the same regardless of the spatial engine type but the "name" of the spatial object may be different. For example, a shapefile based spatial engine will refer to the spatial objects based on the filename which may be case sensitive depending upon the underlying operating system, but an Oracle Spatial engine will refer to a table name which may need to be fully qualified when a schema.
Namespace
urn:com.cohga.server.spatial.mapper#1.0
Tags
mapper
Properties
Name |
Type |
Required |
Description |
id |
string |
yes |
unique identifier |
spatialEngine |
no |
The identifier of the spatial engine that mappings without an explicit spatial engine should link to |
|
crs |
string |
no |
The CRS to override for entities that don't provide an explicit value |
filter |
string |
no |
Provide a CQL formatted filter to apply when performing spatial operations with this mapper |
Sub-tags
Name |
Type |
Cardinality |
Description |
mapping |
urn:com.cohga.server.spatial.mapper#1.0:mapping |
1..n |
A collection of mappings that link entities to spatial items |
Content
None
Notes
- The CRS property does not perform any transform, it just tells the server how the actual data is stored in cases where the underlying spatial engine does not supply this information or supplied an incorrect value.
mapping
Properties
Name |
Type |
Required |
Description |
entity |
yes |
The identifier of the entity that this mapping applies to |
|
spatialEngine |
no |
The identity of the spatial engine that this mapping applies to |
|
table |
string |
yes |
The name of the spatial item within the spatial engine that this mapping applies to |
key |
string |
no |
The attribute of the spatial item that uniquely identifies an entity |
crs |
string |
no |
Provide a Coordinate Reference System if the underlying spatial engine doesn't provide the correct information |
Sub-tags
Name |
Type |
Cardinality |
Description |
mapping |
urn:com.cohga.server.spatial.mapper#1.0:mapping |
0..n |
If more that one underlying feature maps to the entity then multiple sub-mapping tags can be used to specify additional mappings |
Content
None
Notes
- The CRS property does not perform any transformation, it just tells the server how the actual data is stored in cases where the underlying spatial engine does not supply this information or supplied an incorrect value.
- Only 1 level of nesting is supported for sub-mappings.
- Only spatialEngine, table and key are allowed in sub-mapping tags.
- Only table is required, spatialEngine and key and be infered from the parent mapping.
Examples
<mapper:mapper id="mapper.main"> <spatialEngine>spatialengine.arcsde</spatialEngine> <mapping> <entity>property</entity> <table>PROPERTY</table> <key>PID</key> </mapping> <mapping> <entity>roads</entity> <key>RD_NAME</key> <mapping> <table>MAJOR_ROADS</table> </mapping> <mapping> <table>MINOR_ROADS</table> </mapping> </mapping> <mapping> <entity>suburbs</entity> <table>SUBURBS</table> <key>LOC_NAME</key> </mapping> <mapping> <entity>council_buildings</entity> <table>BUILDINGS</table> </mapping> <mapping> <entity>drainage</entity> <spatialEngine>spatialengine.oracle</spatialEngine> <table>DRAINAGE</table> </mapping> </mapper:mapper>
Filters
Simple Filters
<filter>lga_code == 0</filter> <filter><![CDATA[lga_code <> 0]]></filter> <filter><![CDATA[planno = 'LP129263']]></filter> <filter><![CDATA[planno LIKE 'LP%']]></filter> <filter><![CDATA[planno NOT LIKE 'LP%']]></filter> <filter>further_de IS NULL</filter> <filter>further_de IS NOT NULL</filter>
Geometry Filters
<filter><![CDATA[CROSS(the_geom, LINESTRING(332312 5815856, 333688 5823904))]]></filter> <filter><![CDATA[CROSS(the_geom, LINESTRING(332312 5815856, 333688 5823904)) OR CROSS(the_geom, LINESTRING(331312 5814856, 332688 5822904))]]></filter> <filter><![CDATA[BBOX(the_geom, 332312,5815856,333688,5816856)]]></filter>
Other Filters
Does work only with units stored in the DB
<filter><![CDATA[DWITHIN(the_geom, POINT(331899 5818553), 500, meters)]]></mapper:filter>
Works only with units stored in the DB
<filter><![CDATA[BEYOND(the_geom, POINT(331899 5818553), 500, meters)]]></filter>
Does not work in PostGis as it does not like geometry collections
Not tested in other spatial engines
<filter><![CDATA[INTERSECT(the_geom, GEOMETRYCOLLECTION(LINESTRING(332312 5815856, 333688 5823904), LINESTRING(333312 5815856, 334688 5823904)) )]]></filter>
Mapping with Filter
<mapper:mapper id="mapper.main"> <spatialEngine>spatialengine.arcsde</spatialEngine> <mapping> <entity>property</entity> <table>PROPERTY</table> <key>PID</key> <filter><![CDATA[status = 'C']]></filter> </mapping> </mapper:mapper>