Skip to content

remove datastore getview method

Jody Garnett edited this page Apr 11, 2015 · 8 revisions

Description

DataStore.getView(Query) returns a SimpleFeatureSource. The javadocs are a bit vague on the purpose of this method. It doesn't seem to be used in GeoTools or GeoServer (aaime) although Jody says he makes some use of it in uDig to get read-only views.

It is proposed to drop this method in 2.7 and replace it with a DataUtilities method.

Most DataStore implementations in the library are just mirroring AbstractDataStore.getView method which returns a DefaultView. The exceptions are VersionedPostgisDataStore and WS_DataStore which throw an UnsupportedOperationException; and ContentDataStore which does something a bit different (Jody ?).

The patch attached to the Jira issue moves the AbstractDataStore.getView method into DataUtilities, renaming it to createView. It also updates the DataStore implementations other than the three mentioned above. The patch has been tested against trunk.

API Changes

Before:

DataStore ds = ...
Query query = ...
SimpleFeatureSource view = ds.getView( query );

After:

DataStore ds = ...
Query query = ...
SimpleFeatureSource view = DataUtilities.createView( ds, query );

Status

Done. Patch applied to 2.7.x

Voting was:

------------|--------------------|------------|-------------------------|-------------------------------| no progress | done | impeded | lack mandate/funds/time | volunteer needed |

  1. Apply patch from https://osgeo-org.atlassian.net/browse/GEOT-3063 to trunk :white_check_mark:
Clone this wiki locally