omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
711 stars 156 forks source link

Add a simple way to stop the PBF parser #162

Closed rubenv closed 5 years ago

rubenv commented 6 years ago

I'm using the PBF parser in osmtopo and there's currently no way to stop the parser in case of a user abort.

This change seems like the least invasive way to make this possible, but I'm happy to write it differently if desired.

rubenv commented 6 years ago

Also: no unit test added, since I'm not really sure how we can test this. Apologies for that.

rubenv commented 6 years ago

@olt Any chance you can give this a look?

olt commented 5 years ago

Sorry for the silence.

Imposm is a command line tool and should not be used as a library as there is no guarantee for a stable API. So I'm hesitant to add user requests.

However, the parser is now available at https://github.com/omniscale/go-osm This API should be stable (at least in terms of Semantic Versioning).

Here is the documentation of the (slightly changed) parser API: https://godoc.org/github.com/omniscale/go-osm/parser/pbf#example-package

The go-osm Branch already uses github.com/omniscale/go-osm for parsing: https://github.com/omniscale/imposm3/tree/go-osm

Please provide feedback in the go-osm repository.