GithubHelp home page GithubHelp logo

Comments (6)

micahcochran avatar micahcochran commented on July 28, 2024 1

In DBF the 11th byte is a zero (00h) value, for null termination. It is probably the way to make seem to be somewhat like C null terminated strings. You might be able to use fscanf to read it in, which almost nobody would do today. Remember, dBase is a DOS format with design decision made back in the 1980s.

It is not a bug, its a feature! 😄

ESRI's ArcGIS software has aliases for field, which I assume is just in the map .MXD file for display to the end user.

from pyshp.

GeospatialPython avatar GeospatialPython commented on July 28, 2024

The Dbf format limits fields to 10 characters. There are some derivative
formats that try to work around this limitation, but nearly all GIS
software truncates Dbf files to 10.

Some GIS software will handle longer fields with different database
formats. But shapefiles have a hard limit.

  • Joel

On Monday, June 30, 2014, kuno [email protected] wrote:

I am new to shapefile, I saw in this line of code
https://github.com/GeospatialPython/pyshp/blob/master/shapefile.py#L744

That you limited the lenght of the field to 10 at most, can you explain
why?


Reply to this email directly or view it on GitHub
#2.

Joel Lawhead, PMP
E-mail: [email protected]
Web: GeospatialPython.com http://geospatialpython.com/
Twitter: @SpatialPython

from pyshp.

kuno avatar kuno commented on July 28, 2024

ok, very helpful.

Thanks.

from pyshp.

jinz2014 avatar jinz2014 commented on July 28, 2024

Dear Author,

In the dbf file format https://en.wikipedia.org/wiki/.dbf, the size of the field name is 11 bytes, not 10 bytes. Could it be fixed if it is a bug ?

Database field descriptor bytes

0-10 11 bytes Field name in ASCII (zero-filled)

Thank you for reading and reply.

from pyshp.

eldang avatar eldang commented on July 28, 2024

@jinz2014 the shapefile article spells out that the maximum length of a field name is only 10 characters. I don't know what the 11th byte is used for, but it's existence doesn't allow shapefiles to have 11 character field names.

It may be possible to hack something that lets people use longer field names within pyshp, but this stack exchange thread makes clear why that would be a bad idea.

from pyshp.

jinz2014 avatar jinz2014 commented on July 28, 2024

Thank you for your answer.

From: Eldan Goldenberg [mailto:[email protected]]
Sent: Wednesday, March 23, 2016 3:27 PM
To: GeospatialPython/pyshp
Cc: JIN, ZHEMING
Subject: Re: [pyshp] Why limited the length of field to 10? (#2)

@jinz2014https://github.com/jinz2014 the shapefile articlehttps://en.wikipedia.org/wiki/Shapefile#Data_storage spells out that the maximum length of a field name is only 10 characters. I don't know what the 11th byte is used for, but it's existence doesn't allow shapefiles to have 11 character field names.

It may be possible to hack something that lets people use longer field names within pyshp, but this stack exchange threadhttps://gis.stackexchange.com/questions/15784/how-to-bypass-10-character-limit-of-field-name-in-shapefiles makes clear why that would be a bad idea.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-200530729

from pyshp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.