6

I have been looking around like crazy, not finding any specification which versions of dBase shapefiles support (ESRI shapefiles).

I found that GeoTools uses dBase III only, and Wikipedia says dBase IV only.

I'm writing a reader, how should I decide which formats to use, and are they any different?

2
  • Man called William Huber writes here that it is labeled as dBASE IV but dBASE III works just fine, too forums.esri.com/Thread.asp?c=3&f=38&t=104464%29. But there are quite a many shapefile readers already, perhaps you cold spend your time to something more exciting and valuable for the people?
    – user30184
    Commented Nov 11, 2014 at 15:08
  • Writing your own reader might make sense if you are writing your own query/render engine. For instance, MapDotNet shapefile support includes simple attribute queries and a proprietary indexing schema for geometry or attribute indexes. Commented Nov 11, 2014 at 15:30

2 Answers 2

5

Having written a shapefile reader for MapDotNet, I recommend following the dBase IV spec. Once you start opening files from many sources you will find odd discrepancies, for instance older versions of the PostGIS tools filled null numeric with *.

3
  • dBase IV didn't exist when shapefile was created. The Esri shapefile implementation is based on dBase III+ (without memo support).
    – Vince
    Commented Nov 11, 2014 at 17:34
  • @Vince, looking at my old code I see at some point I replaced 4 with 3 in the "write header" code, but I worked off the IV spec and I don't recall any other incompatibilities. Old dBase specs are hard to dig up, I may have used IV because it was what I could find. Yes, memo is not supported. Commented Nov 11, 2014 at 18:15
  • Oh, and the code has been used extensively over close to a decade. Commented Nov 11, 2014 at 18:17
1

As per documentation first byte of DBF file determines its version. If you open any DBF file generated by Esri software it will have first byte set to 0x03 (displayed as ASCII EXT in many hex viewers). First byte set to 3 stands for dBASE III.

First byte in dBASE III file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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