[OSM-dev] OSM->PostGIS Python tool?

Martijn van Exel m at rtijn.org
Fri Dec 21 16:45:35 UTC 2018


I've done numerous Python based projects around OSM data, but I usually treat the data loading as a separate process outside of my applications.

For bulk loading OSM data into PostGIS I would recommend osmosis if you want a lossless representation with optional direct access to geometry. osmosis can also be used to keep your image of OSM up-to-date. Note that initial loading of the entire OSM planet takes quite some time (more than a day last time I did it).

If you just require access to small chunks of data at any given time (city level or smaller) you can ingest the data on-demand using the Overpass server, for which I maintain a python interface. Overpass also allows you to target very specific subsets of OSM data. Depending on your use case that may be a preferred option.
 Martijn van Exel
 m at rtijn.org

On Fri, Dec 21, 2018, at 06:16, Spencer Gardner wrote:
> 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 at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20181221/b8a891a3/attachment.html>

More information about the dev mailing list