anvaka / extract-osm-roads

A simple utility to fetch a city graph from OSM
https://github.com/anvaka/ngraph.path.demo
22 stars 6 forks source link

JSON parser error #4

Closed AmirHKiani98 closed 3 years ago

AmirHKiani98 commented 3 years ago

Hi there, I've got an error. after running node 1.save-roads-graph.js data/bellevue.json an error occurs which is:


Error: Invalid JSON (Unexpected "ÿ" at position 0 in state STOP)
    at Parser.proto.charError (file_address\node_modules\jsonparse\jsonparse.js:90:16)
    at Parser.proto.write (file_address\node_modules\jsonparse\jsonparse.js:154:23)
    at Stream.<anonymous> (file_address\node_modules\JSONStream\index.js:23:12)
    at Stream.stream.write (file_address\node_modules\through\index.js:26:11)
    at ReadStream.ondata (internal/streams/readable.js:745:22)
    at ReadStream.emit (events.js:376:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at ReadStream.Readable.push (internal/streams/readable.js:223:10)
    at internal/fs/streams.js:186:14

how can I overcome this error?

AmirHKiani98 commented 3 years ago

I solved it with copy and pasting the json file into another json file. I do not know why, but somehow the renderer could not render the json file after exporting the city json file. My guess is that it's because of memory problem.