Versions Compared

Key

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

A spatial engine provides access to a service that can perform spatial operations, such as determining what entities fall within a polygon, but it ; The spatial engine also provides a spatial perspective to the entities that that the system will use. For example, providing details about the coordinate reference system that the entity is stored in.

This The spatial engine will generally be something like ArcSDE, Oracle Spatial, Shapefiles or WFS, and usually at least one spatial engine will be defined.

Because there are different spatial engines available, there are different configuration parameters available for each one so . Consequently, the content of this tag is a spatial engine tag will be different depending upon the actual spatial engine implementationbeing used.

Namespace

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

Tags

spatialengine

Properties

Name

Type

Required

Description

id

string

yes

unique identifier

Sub-tags

Depends on type of spatial engine

Content

Depends on type of spatial engine

Resetting a spatial engine

The list of layers/tables available in a spatial engine are read when the spatial engine starts up and are cached for the lifetime of the spatial engine, which means that layers/tables added to the spatial engine after startup are not know to Weave.

To update the spatial engine after a layer/table has been added the spatial engine should be reset, prior to Weave version 2.6.9 this would have to be done by either making a small unimportant change to the spatial engine configuration (e.g. adding <a/> to the config, which would be ignored, but trigger Weave to restart the spatial engine) then saving the change, then reverting it and saving the file again, or commenting out the spatial engine configuration completely, saving the file, undoing the change and saving the file again. Both options would force Weave to reload the list of available tables. And, of course you could just restart the Weave server.

As of Weave version 2.6.9 there are two options to reset a spatial engine without having to edit the configuration. Firstly the spmd command has a new sub-command, reset, which takes the name of the spatial engine to reset, e.g. spmd reset opendata. The second option is a reset button in the Spatial Engine tool in the Admin UI where you can select the spatial engine from the list and click the reset button.

Examples

Connecting to ArcSDE

Code Block
true
xmllinenumberslanguagexml

<spatial:spatialengine id="arcsde">
	<dbtype>arcsde</dbtype>
	<server>hostname</server>
	<port>5151</port>
	<user>username</user>
	<password>password</password>
	<pool>
		<minConnections>2</minConnections>
		<maxConnections>5</maxConnections>
		<timeOut>10000</timeOut>
		<testOnBorrow>true</testOnBorrow>
		<testOnReturn>false</testOnReturn>
		<testWhileIdle>false</testWhileIdle>
		<timeBetweenEvictionRunsMillis>5000</timeBetweenEvictionRunsMillis>
		<whenExhaustedAction>block</whenExhaustedAction>
	</pool>
</spatial:spatialengine>

Connecting to Oracle Spatial

Code Block
xml
language
linenumberstrue
xml

<spatial:spatialengine id="oracle">
	<dbtype>oracle</dbtype>
	<host>hostname</host>
	<port>1521</port>
	<user>username</user>
	<passwd>password</passwd>
	<schema>SCHEMA</schema>
	<instance>instance</instance>
</spatial:spatialengine>

Connecting to Microsoft SQL Server

Code Block
languagexml
<spatial:spatialengine id="sqlserver">
	<dbtype>sqlserver</dbtype>
    <host>hostname</host>
    <port>1433</port>
    <user>username</user>
    <passwd>password</passwd>
    <database>password</database>
    <schema>SCHEMA</schema>
    <geometrymetadatatable>v_geometry_columns</geometrymetadatatable>
</spatial:spatialengine>

Connecting to Microsoft SQL Server using JNDI

Code Block
languagexml
<spatial:spatialengine id="sqlserver">
	<dbtype>sqlserverjndi</dbtype>
    <jndi><![CDATA[java:comp/env/jdbc/spatialDS]]></jndi> <!-- Prior to 2.5.28 this must be <jndiReferenceName>...</jndiReferenceName> -->
</spatial:spatialengine>

Connecting to a Shapefile directory

Code Block
true
xmllinenumberslanguagexml

<spatial:spatialengine id="shapefile">
	<dbtype>shapefiledir</dbtype>
	<url><![CDATA[file:C:/data_dir/data]]></url>
	<memorymapped>true</memorymapped>
</spatial:spatialengine>

Connecting to WFS

Code Block
true
xmllinenumberslanguagexml

<spatial:spatialengine id="wfs">
	<dbtype>wfs</dbtype>
	<url><![CDATA[http://hostname/wfs]]></url>
	<protocol>get</protocol>
	<username>username</username>
	<password>password</password>
	<timeout>5000</timeout>
	<buffersize>100000</buffersize>
	<gzip>true</gzip>
	<lenient>true</lenient>
</spatial:spatialengine>

Connecting to ArcGIS

Code Block
languagexml
<spatial:spatialengine id="arcgis">
	<dbtype>arcgis</dbtype>
	<url>https://services.arcgis.com/3vStCH7NDoBOZ5zn/arcgis/rest/services/Potable_Water_Pipe/FeatureServer</url>
	<crs>EPSG:28356</crs>
</spatial:spatialengine>

Connecting to a GeoPackage

Code Block
languagexml
<spatial:spatialEngine id="opendata">
	<dbtype>geopkg</dbtype>
	<database>./platform/workspace/db/opendata.gpkg</database>
</spatial:spatialEngine>

Connecting to a GeoJSON file

Code Block
languagexml
<spatial:spatialEngine id="geojson_file">
	<dbtype>geojson</dbtype>
	<datasource>./platform/workspace/db/stadiums.geojson</datasource>
</spatial:spatialEngine>