This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<osm version="0.6" generator="CGImap 0.0.2"> | |
<bounds minlat="54.0889580" minlon="12.2487570" maxlat="54.0913900" maxlon="12.2524800"/> | |
<node id="298884269" lat="54.0901746" lon="12.2482632" user="SvenHRO" uid="46882" visible="true" version="1" changeset="676636" timestamp="2008-09-21T21:37:45Z"/> | |
<node id="261728686" lat="54.0906309" lon="12.2441924" user="PikoWinter" uid="36744" visible="true" version="1" changeset="323878" timestamp="2008-05-03T13:39:23Z"/> | |
<node id="1831881213" version="1" changeset="12370172" lat="54.0900666" lon="12.2539381" user="lafkor" uid="75625" visible="true" timestamp="2012-07-20T09:43:19Z"> | |
<tag k="name" v="Neu Broderstorf"/> | |
<tag k="traffic_sign" v="city_limit"/> | |
</node> | |
<node id="298884272" lat="54.0901447" lon="12.2516513" user="SvenHRO" uid="46882" visible="true" version="1" changeset="676636" timestamp="2008-09-21T21:37:45Z"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from xml.dom import minidom | |
from osgeo import ogr | |
import os, sys | |
abs_file_path = "<path_to_planet_osm_file>/planet.osm"; | |
xmldoc = minidom.parse(abs_file_path) | |
json_list = list() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from xml.dom import minidom | |
from osgeo import ogr | |
import os | |
from lxml.etree import tostring | |
# OSM data of Dar Es Salam can be downloaded from http://overpass.osm.rambler.ru/cgi/xapi_meta?*[bbox=39.0640,-7.1170,39.5269,-6.5767] | |
path_org = "<path to osm file>/planet.osm" | |
path_final = "<path to osm file>/planet_nodes.osm" | |
xmldoc = minidom.parse(path_org) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.dom import minidom | |
from osgeo import ogr | |
import os, re | |
proj_dir = os.getcwd() | |
rel_file_path = "initial_osmfile.osm"; | |
abs_file_path = os.path.join(proj_dir, rel_file_path) | |
xmldoc = minidom.parse(abs_file_path) | |
node = xmldoc.getElementsByTagName("node") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree as et | |
from bz2file import BZ2File | |
from lxml.etree import tostring | |
path = "<path-to-osm.bz2-dir>/planet.osm.bz2" | |
path_nodes = "<path-to-osm.bz2-dir>/planet_nodes.osm" | |
str = ''; | |
with BZ2File(path) as xml_file: | |
with open(path_nodes, 'w') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from xml.dom import minidom | |
def coord(way_id): | |
abs_file_path = "/Users/zia/Documents/Test/osm_road_length_data/itu_maslak.osm"; | |
xmldoc = minidom.parse(abs_file_path) | |
way = xmldoc.getElementsByTagName("way") | |
def node_coord(node_id): | |
node = xmldoc.getElementsByTagName("node") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from xml.dom import minidom | |
def coord(way_id): | |
abs_file_path = "/Users/zia/Documents/Test/osm_road_length_data/itu_maslak.osm"; | |
xmldoc = minidom.parse(abs_file_path) | |
way = xmldoc.getElementsByTagName("way") | |
def node_coord(node_id): | |
node = xmldoc.getElementsByTagName("node") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
from xml.dom import minidom | |
from osgeo import ogr | |
import os, sys | |
abs_file_path = "<path_to_planet_osm_file>/planet.osm"; | |
xmldoc = minidom.parse(abs_file_path) | |
json_list = list() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/config.hpp> | |
#include <iostream> | |
#include <fstream> | |
#include <boost/graph/graph_traits.hpp> | |
#include <boost/graph/adjacency_list.hpp> | |
#include <boost/graph/dijkstra_shortest_paths.hpp> | |
#include <boost/property_map/property_map.hpp> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/graph/adjacency_list.hpp> | |
#include <boost/graph/depth_first_search.hpp> | |
#include <boost/range/irange.hpp> | |
#include <boost/pending/indirect_cmp.hpp> | |
#include <iostream> | |
template < typename TimeMap > class dfs_time_visitor:public boost::default_dfs_visitor { | |
typedef typename boost::property_traits < TimeMap >::value_type T; | |
public: |