Remove DataStore getView method - STEMLab/geotools GitHub Wiki
-
Motivation: Removing a seldom used method from the core API
-
Contact: mbedward
-
Tagline: Remove DataStore.getView method
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.
Before:
DataStore ds = ...
Query query = ...
SimpleFeatureSource view = ds.getView( query );
After:
DataStore ds = ...
Query query = ...
SimpleFeatureSource view = DataUtilities.createView( ds, query );
Done. Patch applied to 2.7.x
Voting was:
-
Andrea Aime +1
-
Ian Turton +0
-
Jody Garnett (current OSGeo representative) +1
-
| :white_check_mark: | :no_entry: | :warning: | :negative_squared_cross_mark: |
------------|--------------------|------------|-------------------------|-------------------------------| no progress | done | impeded | lack mandate/funds/time | volunteer needed |
- Apply patch from https://osgeo-org.atlassian.net/browse/GEOT-3063 to trunk :white_check_mark: