Comments (6)
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.
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#L744That 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.
ok, very helpful.
Thanks.
from pyshp.
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.
@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.
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)
- ValueError when reading shapefile from ZIP archive HOT 3
- logging should use named logger rather than root logger HOT 1
- Document the reason for first field always being a DeletionFlag HOT 2
- "README: Testing" section seems out of date HOT 1
- add/modify test routine for running pytest / ship test file with installation HOT 2
- pyshp 2.3 closing bytesio objects with Writer HOT 5
- Add read geojson capability HOT 1
- Support for getting encoding from .cpg files HOT 2
- Enhance combination with shapely HOT 2
- Why was Writer.save() removed? HOT 1
- How to modify the shape value HOT 1
- struct.error: unpack requires a buffer of 32 bytes HOT 2
- How to get the field name for data? HOT 1
- Inconsistent bounding box filtering HOT 1
- check if polygon is closed fails HOT 1
- Build marked as failing. Tests are not running in CI. Github /actions/setup-python no longer supports Python 2.7. HOT 1
- PyShp's own Example from README.md fails under Doctest with Python 2.7. .__geo_interface__ = behaves differently in Python 2? HOT 1
- Doc test in README.md fails due to undefined variable HOT 1
- Run tests on Python 3.10 and higher versions (as well as 2.7, 3.5, ..., 3.9)
- Interest in I/O methods interfacing geopandas objects? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyshp.