geometalab / osmaxx

OpenStreetMap Arbitrary Excerpt Export - Get the OpenStreetMap data you want in the file format you need
http://osmaxx.hsr.ch/
MIT License
26 stars 3 forks source link

Feature/#831 slugify pbf name #837

Closed das-g closed 7 years ago

das-g commented 7 years ago

fixes #831

hixi commented 7 years ago

_name_prefix isn't sluggified in this pull request, is this being handled in a separate pull-request or is it just missing here?

das-g commented 7 years ago

_name_prefix isn't sluggified in this pull request, is this being handled in a separate pull-request or is it just missing here?

Neither: If I'm not mistaken, it was already sufficiently slugified before this PR. This PR just makes the PBF export use it, instead of the bare area_name.

We already expect _name_prefix to be, well, a valid partial file name. (Otherwise, exporting excerpts with a / in their name would fail for other formats, too.) And indeed, produce_pbf(...) seems to be only called from Conversion._create_pbf(...), which (as Conversion._conversion_process(...)) is called only from Conversion.start_format_extraction(...) which (outside of tests) seems to only be called from converter.convert(), which initializes the conversion with its filename_prefix argument.

converter.convert() itself is (outside of tests) only called by itself (with the same arguments, except for use_worker) and by Job.start_conversion(...) it seems, the latter passing Job._filename_prefix() as the filename_prefix which slugifies the excerpt name as well as some other components it puts into the string it returns.

hixi commented 7 years ago

:+1: