Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Re: Some questions

Reading:
- http://en.wikipedia.org/wiki/Shapefile
-

I think the shx file is important and is what is used to tie your geometry (ie shp) and data (ie dbf) to each other.

Reading (http://en.wikipedia.org/wiki/Shapefile) has the following mandatory files:

Mandatory files :

    * .shp - the file that stores the feature geometry
    * .shx - the file that stores the index of the feature geometry
    * .dbf - the database </wiki/Database> of attributes

The spec (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf) confirms it.
Ok, then another question. If uDig can display shapefiles wthout .shx
file, may be .shx can be generated somehow? It would be great.
So it appears as if you are honestly missing information. uDig can probably show you the raw geometry, but would lack the information needed to match the attributes to the geometry.

If you want to guess that they are in the same order you can use the raw parts of the Shapefile code to make a program to generate your shx file ...
- http://geotools.codehaus.org/Shapefile+Plugin
- http://svn.geotools.org/geotools/trunk/gt/modules/plugin/shapefile/src/main/java/org/geotools/data/shapefile/shp/IndexFile.java - http://svn.geotools.org/geotools/trunk/gt/modules/plugin/shapefile/src/main/java/org/geotools/data/shapefile/dbf/ - http://svn.geotools.org/geotools/trunk/gt/modules/plugin/shapefile/src/main/java/org/geotools/data/shapefile/shp/

Bleck,
Jody


Back to the top