Created
July 13, 2015 20:46
-
-
Save fscottfoti/ddc7c7ad3b0f6c337ac5 to your computer and use it in GitHub Desktop.
Change CRS of Pandana network
This file contains 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 pyproj | |
import pandas as pd | |
s = pd.HDFStore('osm_bayarea.h5', "r") | |
s2 = pd.HDFStore('osm_bayarea4326.h5', "w") | |
s2["edges"] = s["edges"] | |
po = s["nodes"] | |
print po.describe() | |
x_name = "x" | |
y_name = "y" | |
p1 = pyproj.Proj('+init=epsg:%d' % 3740) | |
p2 = pyproj.Proj('+init=epsg:%d' % 4326) | |
x2, y2 = pyproj.transform(p1, p2, | |
po[x_name].values, | |
po[y_name].values) | |
po[x_name], po[y_name] = x2, y2 | |
print po.describe() | |
s2["nodes"] = po |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment