[OSM-dev] Bounding Box Filter w/Osmium
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. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] Python XML Parser on Windows
Thanks. I'm aware of PyOsmium, which appears to work on Windows but not without installing a number of additional packages related to the libosmium. I may go that route in the absence of easier alternatives, but installation of libosmium doesn't seem very straightforward on Windows. Or perhaps the problem is the documentation doesn't provide much information on how to install on Windows short of building from source, which is a nonstarter for most users. What I'm really hoping for is an isolated Python solution that can be installed via a simple pip command. Have I misunderstood something about PyOsmium and libosmium? On Wed, Aug 7, 2019 at 1:03 AM Jochen Topf wrote: > On Wed, Aug 07, 2019 at 08:30:07AM +0100, Sarah Hoffmann wrote: > > On Wed, Aug 07, 2019 at 07:16:07AM +0200, Jochen Topf wrote: > > > Hi! > > > > > > PyOsmium https://osmcode.org/pyosmium/ should work on Windows. > > > > Just stay away from bz2 compressed xml. That's known to be > > broken on Windows. Uncompressed xml should be fine though. > > Or, even better, use the PBF file format which should be much faster > than XML. > > 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
[OSM-dev] Python XML Parser on Windows
I'm sort of resurrecting an old thread I started last year. I find Martijn's Overpass Python library to be very useful for small queries but I frequently run into usage limits. I'd like to query an XML download directly to save bandwidth and reduce consumption of Overpass resources, but I can't find any suitable Python libraries that are WIndows-ready. Is there something I'm missing? Has anyone else found a solution that works? By way of example, Geoff Boeing's excellent osmnx package appears to use a home-grown OSM parser due to lack of a cross-platform option. https://github.com/gboeing/osmnx/blob/eebbca0ed1d59a6dfe07c90493d54c0beab45145/osmnx/utils.py#L1181 Thanks for any help ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
[OSM-dev] OSM->PostGIS Python tool?
I'm researching options for a Python-based tool that uses OSM data. From what I can gather there's no native Python library for OSM imports to a PostGIS database. (Yes, imposm is developed in Python but there's no documentation I can find on how to use it as a Python library--it appears to be intended as a command line tool). This seems odd to me since there's such a large community of OSM users. I feel like I'm missing something. Are there other viable Python libraries I'm not aware of? (Viable = large-ish user base and history of bugfixing.) Is there documentation for using imposm within Python that I've overlooked? Bonus points for: - Windows compatibility - No external (i.e. non-Python) libraries needed Thanks for any help! ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
Re: [OSM-dev] How does osm2pgsql handle multiple matches of same key?
> > > If you want a column for parking:lane:right and parking:lane:left, add > both to your style file. > > Ah, thanks. Should have caught that from addr:housename in the default style file. I had made it more complicated in my mind than it needed to be. Looks like that will work for my purposes. ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev
[OSM-dev] How does osm2pgsql handle multiple matches of same key?
It's not clear to me how osm2pgsql handles multiple values for the same key on an OSM feature. For example, imagine I have a way with the following tags: parking:lane:right=perpendicular parking:lane:left=parallel 1. How does the "parking" column reflect this after the import assuming that my style file has an entry for parking? 2. Is there a way to define styles that separate these? (i.e. one column for parking:lane:right and another column for parking:lane:left? My understanding of hstore is that it will suffer from the same problem--if there's a duplicate entry for the same key it takes the first and ignores the others. If this is not the case I'll investigate using that for my purposes. Thanks, Spencer Gardner ___ dev mailing list dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/dev