{ "info": { "author": "Jacob Wasserman", "author_email": "jwasserman@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "osmgraph\n========\n\nCreate [networkx](https://networkx.github.io/) graphs from OpenStreetMap (OSM)\ndata. `osmgraph` uses\n[imposm-parser](https://github.com/omniscale/imposm-parser) for parsing\nOpenStreetMap XML (including bz2) and PBF\nfiles and [osmqa-parser](https://github.com/mapkin/osmqa-parser) for parsing\n[OSM QA tiles](http://osmlab.github.io/osm-qa-tiles/).\n\n\nUsage\n-----\n\n```\n>>> import osmgraph\n>>> g = osmgraph.parse_file(filename)\n```\n\n\nGraph Structure\n---------------\n`osmgraph` parses OSM data to create a networkx [directed graph](https://networkx.readthedocs.org/en/stable/reference/classes.digraph.html). OSM nodes correspond directly to the nodes in the directed graph. The OSM tags become attributes of the node. Additionally `osmgraph` adds a `coordinate` attribute containing the (lon, lat) tuple of the node's coordinates.\n\nFor example:\n```\n>>> g = osmgraph.parse_file('boston_massachusetts.osm.bz2')\n```\n\nGiven the following XML node:\n```\n \n \n \n```\n\n```\n>>> g.node[665539692]\n{'coordinate': (-71.0207486, 42.3971185), 'railway': 'level_crossing'}\n```\n\nSimilarly, the nodes comprising an OSM way form the graph's edges. The way's attributes are duplicated across the edges. For example, given the following XML way:\n```\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n```\n\n```\n>>> g[61448456][1102764005]\n{'attribution': 'Office of Geographic and Environmental Information (MassGIS)',\n 'condition': 'fair',\n 'highway': 'primary',\n 'massgis:way_id': '134349',\n 'name': 'North Washington Street',\n 'oneway': 'yes',\n 'source': 'massgis_import_v0.1_20071008193615',\n 'width': '30.2'}\n```\n\nWays that are not oneway roads will have edges in both directions.\n\nSee Also\n--------\n* [networkx](https://networkx.github.io)\n* [OSM QA Tiles](https://osmlab.github.io/osm-qa-tiles/)\n* [imposm.parser](https://github.com/omniscale/imposm-paser)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mapkin/osmgraph", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "osmgraph", "package_url": "https://pypi.org/project/osmgraph/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/osmgraph/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mapkin/osmgraph" }, "release_url": "https://pypi.org/project/osmgraph/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Create networkx graphs from OpenStreetMap data", "version": "0.0.1" }, "last_serial": 1939764, "releases": { "0.0.1": [] }, "urls": [] }