Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining projection #29

Closed
sephib opened this issue Feb 1, 2017 · 5 comments
Closed

Defining projection #29

sephib opened this issue Feb 1, 2017 · 5 comments

Comments

@sephib
Copy link
Contributor

sephib commented Feb 1, 2017

Firstly please let me say that this is a great project!

Problem description (what did you do, what did you expect to happen, and what actually happened)

Trying to use the project functionality with a different datum.
currently the default is NAD83
{'datum': 'NAD83', 'ellps': 'GRS80', 'proj': 'utm', 'units': 'm', 'wktext': True, 'zone': 36}
I would like to project to a EPSG:32636 projection

Trying to run

places_prj = ox.project_gdf(places_il,  32636)
places_prj = ox.project_gdf(places_il,  '32636')
places_prj = ox.project_gdf(places_il,  'epsg:32636')

places_prj.crs always returns
{'init': 'epsg:4326'}

any ideas? any suggestion ?
should I try and extend osmnx/projection.py ? if so how would you do so?

What operating system, architecture, Python version, and OSMnx version are you using?

running on Win10

Complete list of your environment's packages and their versions (for example, run conda list or pip list then paste the output below)

python 3.5

bleach (1.5.0)
click (6.7)
click-plugins (1.0.3)
cligj (0.4.0)
colorama (0.3.7)
cycler (0.10.0)
decorator (4.0.11)
descartes (1.1.0)
entrypoints (0.2.2)
Fiona (1.7.1)
folium (0.2.1)
GDAL (2.1.2)
geopandas (0.2.1)
geopy (1.11.0)
html5lib (0.9999999)
imageio (1.6)
ipykernel (4.5.2)
ipython (5.1.0)
ipython-genutils (0.1.0)
ipywidgets (5.2.2)
Jinja2 (2.9.4)
jsonschema (2.5.1)
jupyter (1.0.0)
jupyter-client (4.4.0)
jupyter-console (5.0.0)
jupyter-core (4.2.1)
MarkupSafe (0.23)
matplotlib (2.0.0)
mistune (0.7.3)
moviepy (0.2.2.11)
munch (2.1.0)
nbconvert (5.1.1)
nbformat (4.2.0)
networkx (1.11)
notebook (4.3.1)
numpy (1.11.3)
olefile (0.44)
osmnx (0.2.2)
pandas (0.19.2)
pandocfilters (1.4.1)
pickleshare (0.7.4)
Pillow (4.0.0)
pip (9.0.1)
prompt-toolkit (1.0.9)
Pygments (2.1.3)
pyparsing (2.1.10)
pyproj (1.9.5.1)
python-dateutil (2.6.0)
pytz (2016.10)
pyzmq (16.0.2)
qtconsole (4.2.1)
requests (2.13.0)
Rtree (0.8.3)
setuptools (32.3.1)
Shapely (1.5.17)
simplegeneric (0.8.1)
simplekml (1.3.0)
six (1.10.0)
testpath (0.3)
tornado (4.4.2)
tqdm (4.11.0)
traitlets (4.3.1)
wcwidth (0.1.7)
wheel (0.30.0a0)
widgetsnbextension (1.2.6)
win-unicode-console (0.5)

@gboeing
Copy link
Owner

gboeing commented Feb 1, 2017

If you look at the documentation for project_gdf() you'll see the function projects a GeoDataFrame to UTM (with the zone calculated based on the GeoDataFrame's centroid) or back to lat-lng.

If might be useful to modify osmnx/projection.py to have project_gdf() take a new argument crs with default value None. If it's None, then the function behaves as it currently does. If it's not None then the function passes this crs into the geopandas projection function.

That said, in the meantime you can take your GeoDataFrame places_il and project it with geopandas to any CRS that you'd like.

@sephib
Copy link
Contributor Author

sephib commented Feb 2, 2017

Thx - Will update

@gboeing
Copy link
Owner

gboeing commented Feb 8, 2017

Thanks. Feel free to issue a PR if you make these modifications.

@gboeing
Copy link
Owner

gboeing commented Feb 17, 2017

Resolved by dd38c57

@gboeing gboeing closed this as completed Feb 17, 2017
@gboeing
Copy link
Owner

gboeing commented Feb 17, 2017

Documentation of the new projection abilities is available here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants