On Fri, Aug 16, 2019 at 06:18:16PM -0700, Spencer Gardner wrote:
> I'm working with pyOsmium for parsing OSM and things are working pretty
> well. One problem I'm having is that I need to be able to apply a bounding
> box filter to handle cases where an unnecessarily large extract is used.
> (For example, a user downloads the extract for their entire country but is
> only working within a single city).
> 
> I can't find this addressed in the Osmium documentation. Does this
> functionality exist? If not, are there clever ways to achieve this? At the
> moment I've created a shapely feature representing the bounding box and am
> comparing nodes and ways for an intersection. This is highly inefficient
> and I'm sure there's a better way. Thanks for any advice.

I recommend using the osmium tool, specifically the "extract" command (see
https://docs.osmcode.org/osmium/latest/osmium-extract.html ) on the data
first. This is written in C++ and well optimized. After that use
PyOsmium to work on the details.

Jochen
-- 
Jochen Topf  joc...@remote.org  https://www.jochentopf.com/  +49-351-31778688

_______________________________________________
dev mailing list
dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/dev

Reply via email to