Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Contact:

AndreaAime

Tracker:

GEOT-4444

Tagline:

Clean up shapefile store implementation

Children:

Description

The current shapefile datastore is based on AbstractDataStore, a base class that while not deprecated, is not favoured either for new implementation (the new reference being ContentDataStore). The current implementation is brittle and harder than it should be to maintain, and it's also based on two stores, the plain and indexed ones, that were never merged togheter, effectively duplicating the effort to maintain the code.

The current shapefile-ng module, in unsupported, is based on ContentDataStore instead, providing a set of advantages:

  • the base class is actively maintained and improved
  • cleaner implementation, with less classes, less duplication, better leveraging what the base library has to offer
  • tidied up set of constructors, smaller public interface, with behavior variants exposed as properties
  • cleaner package structure
  • several unused classes removed
  • unit tests migrated to JUnit 4
  • small performance improvements in the non indexed case (useful when reading from read only media or remote locations)
The change only affected the upper level, whilst the code reading shp/dbf/shx/fix/qix files has remained largely untouched.
Migration wise, there are a few cases depending on how much the client code is linked to the shapefile data store specific methods:
  • if the code creates the shapefile store by using either the factory or the DataStoreFinder no changes are needed, as the same parameters are exposed in the two stores
  • if the code manually creates the shapefile store using its constructors, changes will be required as the new code has a single constructor with the shapefile URL, and all other parameters are provided via setters instead
  • if the code uses methods specific to ShapefileDataStore some renames of the methods being called are in order

Status

This proposal is open for discussion and voting.

Current voting status:

Tasks

This section is used to make sure your proposal is complete (did you remember documentation?) and has enough paid or volunteer time lined up to be a success

 

no progress

(tick)

done

(error)

impeded

(warning)

lack mandate/funds/time

(question)

volunteer needed

  1. (tick) Rename gt-shapefile plugin as shapefile-old in unsupported land
  2. (tick) Move shapefile-ng to plugins/shapefile
  3. (tick) Transition any direct use of ShapefileDataStore to use of factory (done)
  4. Fix up the user guide upgrade instructions using BEFORE / AFTER examples as shown below
  5. Initial pull request https://github.com/geotools/geotools/pull/176

API Changes

Using ShapefileDataStore directly

BEFORE:

AFTER:

  • No labels