"Seegrid will be due for a migration to confluence on the 1st of August. Any update on or after the 1st of August will NOT be migrated"
Configuration instructions for using the new geoserver build against a non-spatial feature type or with a non-spatial JDBC database.

This is now a plug-in datastore and is installed by default in the Geoserver build/svn branch used for SEEGrid. All you have to do is set up a data store with the correct parameters and it should work. This is the only way to map a feature to a table that doesnt have a geometry object - even if you are using OracleSpatial etc as the back end. So, measurement features etc will need to use this capability.

NOTE - you will need to edit the configuration files manually - there is a bug in the forms interface and it also wont support the bypassSQL additions and will overwrite your configuration. You can edit server/geoserver/WEB-INF/catalog.xml and input a datastore directly:

Geometryless features

  
<datastore namespace = "biz" enabled = "true" id = "mysql" >
<connectionParams>
<parameter  name = "namespace" value = "biz" />
<parameter  name = "user" value = "me" />
<parameter  name = "passwd" value = "foo" />
<parameter  name = "dbtype" value = "jdbc" />
<parameter name = "driver" value = "com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"  />
<parameter name = "urlprefix"  value = "jdbc:mysql://localhost:3306/mydb" />
</connectionParams>
</datastore>

note change - urlprefix is now the entire JDBC url except for username password

e.g. for oracle: jdbc:oracle:thin:@localhost:1521:beryl

the only really tricky thing is the driver parameter: this must match a class of type: javax.sql.ConnectionPoolDataSource e.g.
  • oracle.jdbc.pool.OracleConnectionPoolDataSource
  • com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
  • org.postgresql.jdbc2.optional.ConnectionPool

For Microsoft SQL-Server you can use the jtds drivers from jtds.sourceforge.net and the wrapper I wrote for the actual driver class:
  • org.geotools.data.geometryless.wrapper.JtdsConnectionPoolDataSource
and the URL syntax: jdbc:jtds:sqlserver://localhost:1433;INSTANCE=TEST;DatabaseName=Test_DB

this class should be sourced from a JDBC2 driver package installed in server/geoserver/WEB-INF/lib

Mapping numerical x,y, columns to point features

A special subclass of this datastore called LocationsXYDataStore performs the mapping from designated x,y, columns to geometry attributes.

note the dbtype parameter is different:

  
<datastore namespace = "biz" enabled = "true" id = "mysql" >
<connectionParams>
<datastore namespace = "biz" enabled = "true" id = "mysql" >
<connectionParams>
<parameter  name = "namespace" value = "biz" />
<parameter  name = "user" value = "me" />
<parameter  name = "passwd" value = "foo" />
<parameter  name = "dbtype" value = "locationsxy" />
<parameter name = "driver" value = "com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"  />
<parameter name = "urlprefix"  value = "jdbc:mysql://localhost:3306/mydb" />
<parameter name="xcolumn"  value = "a.x" />
<parameter name="ycolumn"  value = "a.y" />
<parameter name="geom_name" value = "location"  />
</connectionParams>
</datastore>

Critical notes:

  1. this mapping is global to the datastore, so you may need to register more than one data store against your database if you have different column names or geometry names (anything else will require a morte significant change to the underlying geotools - this is in train but will take some time)
  2. the x,y columns must be the last columns in the result set (underlying table or bypassSQL statement)
  3. if you are using a join in bypassSQL you must take care to make sure column names are not ambiguous

-- RobAtkinson - 07 Oct 2004

Bounding Box Data Store

This variant allows a bounding box represented in 4 columns to be used as a geometry

  
<datastore namespace = "biz" enabled = "true" id = "bboxtest" >
<connectionParams>
<datastore namespace = "biz" enabled = "true" id = "mysql" >
<connectionParams>
<datastore namespace = "biz" enabled = "true" id = "mysql" >
<connectionParams>
<parameter  name = "namespace" value = "biz" />
<parameter  name = "user" value = "me" />
<parameter  name = "passwd" value = "foo" />
<parameter  name = "dbtype" value = "jdbc" />
<parameter name = "driver" value = "com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"  />
<parameter name = "urlprefix"  value = "jdbc:mysql://localhost:3306/mydb" />
<parameter name="minxcolumn"  value = "x1" />
<parameter name="minycolumn"  value = "y1" />
<parameter name="maxxcolumn" value = "x2" />
<parameter name="maxycolumn" value = "y2" />
<parameter name="geom_name" value = "bbox" />
</connectionParams>
</datastore>

The same caveats regarding columns being the last in the list apply to this store.

Additionally, currently the resulting geometry is always mapped to a Polygon object for output. Somoe more thinking is required to support a Box object due to limitations in the Java Topology Suite

-- RobAtkinson - 21 Oct 2004
Topic revision: r8 - 15 Oct 2010, UnknownUser
 

Current license: All material on this collaboration platform is licensed under a Creative Commons Attribution 3.0 Australia Licence (CC BY 3.0).