GeoTools
  1. GeoTools
  2. GEOT-2782

IndexedShapefileDataStore Query Bug

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0
    • Component/s: shapefile plugin
    • Labels:
      None
    • Environment:
      Windows XP, Java 1.5.0_16
    • Testcase included:
      yes

      Description

      If I query an IndexedShapefileDataStore for a subset of attributes and no geometry, the first attribute in the resulting feature collection is always the wkt version of the geometry. This does not happen if I use a ShapefileDataStore.

      For example in this code:

      IndexedShapefileDataStore indexedstore = new IndexedShapefileDataStore(TestData.url(STATEPOP));
      final Query query = new DefaultQuery(indexedstore.getSchema().getName().getLocalPart(), idFilter, new String[]

      { "STATE_NAME"}

      );
      final FeatureCollection<SimpleFeatureType, SimpleFeature> indexedfeatures = indexedstore.getFeatureSource().getFeatures(query);

      indexedfeatures.iterator().next().getAttribute("STATE_NAME") returns 'POLYGON((......))' which is not correct.

      I've attached a test case that provides an example of this issue.

      This bug is producing invalid results in the uDig Table View. The first attribute column is always displaying the geometry wkt instead of the attribute.

      1. reindex.patch
        6 kB
        Jody Garnett
      2. ShapefileAttributeReaderTest.java
        2 kB
        Emily Gouge

        Activity

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Emily Gouge
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: