Comments (6)
Hm, I'm not sure - 10 is, yes, what it's supposed to be, but it's odd that this wouldn't cause other behavior than just shorter fields.
from dbf.
The file i am trying to generate.... which is used in an old clipper based
accounting program uses 10 character headers.
On Jul 10, 2014 4:36 PM, "Tom MacWright" [email protected] wrote:
Hm, I'm not sure - 10 is, yes, what it's supposed to be, but it's odd that this
wouldn't cause other behavior
https://github.com/mapbox/dbf/blob/master/src/structure.js#L48-L50 than
just shorter fields.—
Reply to this email directly or view it on GitHub
#11 (comment).
from dbf.
@tmcw the reason it doesn't change behavior is twofold: ArrayBuffers are zero-filled by default and the other operations use the correct offsets, so it's leaving null characters in the trailing bytes of the name. Increasing the number of characters should not have any adverse effects.
from dbf.
Same issue. Any update?
from dbf.
Hello,
You can override the 8 character limit by changing the f.name.splice(0.8) to (0,10):
field_meta.forEach(function(f, i) { // field name f.name.split('').slice(0, 8).forEach(function(c, x) { view.setInt8(32 + i * 32 + x, c.charCodeAt(0)); }); // field type view.setInt8(32 + i * 32 + 11, f.type.charCodeAt(0)); // field length view.setInt8(32 + i * 32 + 16, f.size); if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3); });
to
field_meta.forEach(function(f, i) { // field name f.name.split('').slice(0, 10).forEach(function(c, x) { view.setInt8(32 + i * 32 + x, c.charCodeAt(0)); }); // field type view.setInt8(32 + i * 32 + 11, f.type.charCodeAt(0)); // field length view.setInt8(32 + i * 32 + 16, f.size); if (f.type == 'N') view.setInt8(32 + i * 32 + 17, 3); });
from dbf.
Happy to report this is finally merged in (#33)! Hopefully we can publish an updated npm package soon
from dbf.
Related Issues (20)
- Shapefile export-import workflow HOT 4
- Fallback if column has only null
- Append data to existing file HOT 1
- Save numbers as floats, not integers HOT 1
- Date support HOT 19
- Chinese character messe... HOT 2
- offset not defined, throws error in 'use strict' mode HOT 1
- web demo? HOT 1
- Last Modified Date in Header off by 1 HOT 3
- save on browser HOT 2
- 'offset' is not defined HOT 7
- chinese character HOT 2
- New maintainer
- I'm open to maintaining this project
- Open to maintaining HOT 7
- QGIS only sees the First Row in the DBF file HOT 3
- solve structure problem HOT 1
- 我靠 HOT 1
- 'offset' is not defined HOT 2
- Awaiting for new version in npm package HOT 1
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 dbf.