3

For a Java application and for my personal understanding, I am exploring how to read and write shapefiles (at least shx, shp, dbf). The main purpose is to keep the resulting Shapefile-class and it's complimentary classes relatively lightweighted but with a backdoor to be able to react on changes of the different file formats as well.

The spatial information is well documented and clearly structured. This goes for the data table (dbf) to some extend as well. However, I am struggling with the different versions of dbf-files at the moment. I know that my version of QGIS Lisboa saves dbf-files as Xbase-files in a fashion which is described here. At the current stage, my Java classes are able to handle those. On the other hand I have read that different dBase-formats might be in use too. The respective file-specification is documented on e.g. this website.

Is the Xbase-format still dominant in comparison to the more complex but also more flexible dBase-formats?

4

The other dBase format you mentioned didn't exist when ESRI published the shapefile format.

Other software packages could certainly use the newer format, but it wouldn't be standard and it's likely that only that program could read the files it creates.

In my own experience, I've never encountered a non standard dbf accompanying a shapefile. This includes shapefiles created from QGIS, ArcGIS/Pad, FME Workbench, OGR (GDAL), AutoDesk products and various GPS utilities.

I wouldn't be concerned with supporting both formats, unless you are certain you will encounter the newer one.

4

The .dbf file used by shapefiles is dBase-III (without Memo fields). There is no need to support more exotic forms, since they would be non-conformant to the specification (which is, admittedly, vague on which dBase format was used). In fact, creating non-conformant "sort of shapefiles" would pollute the usefulness of the standard, and reading non-conformant files would encourage that pollution.

Shapefiles were great back in their day, but the 10 character field name limitation and lack of numeric NULLs, a second (or millisecond) resolution time type, UTF-16 strings, or BLOB & CLOB types hampers their use for modern data exchange. I use ASCII (UTF-8, with Well-Known Text for geometries) before shapefiles for exchange between databases.

  • I cannot upvote yet. Still, you post adds detailed information to the answer of Evil Genius, so I recommand it for future readers. – Florian R. Klein Feb 6 '14 at 19:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.