pelias / polylines

Pelias import pipeline for polyline (road network) data.
MIT License
18 stars 25 forks source link

Unable to import polylines #155

Closed n3ziniuka5 closed 6 years ago

n3ziniuka5 commented 6 years ago

When I try to import polylines using npm start I get this:

> pelias-polyline@0.0.0-development start /home/geocoding/importers/polylines
> node --max_old_space_size=4096 bin/cli.js --config --db

2018-03-18T22:21:00.139Z - info: [wof-pip-service:master] starting with layers neighbourhood,borough,locality,localadmin,county,macrocounty,macroregion,region,dependency,country,empire,continent,marinearea,ocean
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)
buffer.js:597
  throw new TypeError('Unknown encoding: ' + encoding);
  ^

TypeError: Unknown encoding: 
    at stringSlice (buffer.js:597:9)
    at Buffer.toString (buffer.js:633:10)
    at CSVStream.write (/home/geocoding/importers/polylines/node_modules/csv-stream/index.js:59:34)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2042:12)

In pelias.json I there is:

"polyline": {
  "datapath": "/mnt/geocoding-data/20180301/polyline",
  "files": ["planet.polylines"]
},

and output of head /mnt/geocoding-data/20180301/polyline/planet.polylines is:

mznq}AqjlcKfFz}@tBhYnI~_@vRdjBp@pO_@lFgFpMmB~DuDnVAzengen
{}lq}AewdcKyQ~HAzengen
{|rurAuit~TvFaN_@kFiT}NFrazione Frascole
s}fkaBi_mqHx@eFFkDg@uDwVmc@aD}Fk@yKw@mOaDaGmLoS}HmOkRk^o@gEcAoEaPa^kCwBuCX}NuABorculolaan
ghcdxAmkyjNlBsIh@cHq@sVOmFkBIkg@rJwFjABalmsträssli
qecdxAg~zjNn@sCbByRBalmsträssli
_h_uxAgvf{Ns@lEq@jEoAt\Ij`@b@dIxA|[V|KGdZsDnfBw@fd@Uh\NvZf@pKt@pHzAhDvDhBzJ`DStegenhalde
exbrcBtj`tBp_@kyC??b@eSG}N_@mGBrereton Hill
lls]zotztCwZ}g@k\gj@oRu[mRs[eRi[qTu^cX_d@m[{h@wQuZ_DkFDe las Chuquiraguas
soe_~A{wuuG{S_GoDo@yIaB{P_Ds[oHy@U}Cw@aG{AaTw@Ruelle Rénaux

The polylines file was created with the OSM PBF tool. I am using the production branch.

orangejulius commented 6 years ago

Oops, this error is fixed in a newer version of one of the dependencies of this package. I just merged the change updating that dependency, and so if you run git pull it should work. Let me know.

Connects https://github.com/pelias/whosonfirst/pull/304 Connects https://github.com/pelias/pelias/issues/612

n3ziniuka5 commented 6 years ago

That fixed it, thanks.