pelias / polylines

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

hardcoded osm path #266

Open stefanocudini opened 2 years ago

stefanocudini commented 2 years ago

hi

here de module https://github.com/pelias/polylines/blob/master/docker_extract.sh#L9

it does not use the pelias.json configuration as it should but uses a hardcoded path, this breaks the operation in case the configuration is not the standard one

and however I think that the pelias.json file is the only place to read the paths

missinglink commented 2 years ago

Sure thing, could you please open a pull request?

The docker image should have the jq binary installed which can be used to extract the imports.openstreetmap.datapath variable from pelias.json

While you're there could you please fix the bash redirection code? It's 2>&1 all over that file, I think it should be >&2 since the intent was to write to stderr

missinglink commented 2 years ago

We have adopted a convention over the years of using /code and /data in our docker images.

It seems that we always mount the config at /code/pelias.json but if someone decided to mount it in a different place then there's no way we can figure out where it is on disk.

So it's kind of just shifting the convention of using /data to using /code, maybe not really solving the problem?

orangejulius commented 2 years ago

Yeah, this little script has always been a little confusing.

One thing that's helpful is we do have a PELIAS_CONFIG environment variable that is read by the pelias-config module itself.

It's a bit messier than calling jq, but maybe we want to do something like this instead:


OSM_DATA_PATH=$(node -e "console.log(require('pelias-config').generate().imports.osm.datapath) );"

Also note that the Polylines datapath is hardcoded in here several times, we might want to handle it the same way.