GithubHelp home page GithubHelp logo

Comments (2)

mhkeller avatar mhkeller commented on July 17, 2024

I should have looked at the open issues before banging my head against this... This one is probably beyond me but I'll share what I found.

In the shapefile that I was using to test, the last item to come out as value in read_dbf is <Buffer 1a>, the unhelpful unicode 26.

Doing something foolish like return value && value.toString().trim().charCodeAt(0) !== 26 does lead to the desired json output — but it seems like the problem is further upstream and should be solved in a better way. If you have any suggestions on why that last buffer is coming out at all, I can look into it more.

from shapefile.

mbostock avatar mbostock commented on July 17, 2024

According to the dBASE documentation:

The end of the file is marked by a single byte, with the end-of-file marker, an OEM code page character value of 26 (0x1A).

I’ll change the code to check if the first byte of the record buffer is 0x1a, and if so, treat that as the end of the file.

from shapefile.

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.