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

Why can't parse 3857? #39

Closed
wsf1990 opened this issue Jun 15, 2019 · 4 comments
Closed

Why can't parse 3857? #39

wsf1990 opened this issue Jun 15, 2019 · 4 comments

Comments

@wsf1990
Copy link

wsf1990 commented Jun 15, 2019

Why can't our package parse 3857?
Use this code:

parse.from_epsg_code(3857)

This will return None

@micahcochran
Copy link
Contributor

EPSG:3857 isn't on the website spatiatreference.org, which is where from_epsg_code() gets its epsg code information.

spatialrefence.org hasn't been updated since 2013 per it's homepage. There's probably a better source for EPSG codes.

@wsf1990
Copy link
Author

wsf1990 commented Jun 16, 2019

If this how can I parse the 3857 crs?

@micahcochran
Copy link
Contributor

epsg.io seems like it would be a good replacement for spatialreference.org. (Patch?)

You could directly feed a string such as this OGC WKT version of 3857:

PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],AUTHORITY["EPSG","3857"]]

and use pycrs.parse.from_ogc_wkt(ogc_wkt)

Or you could load the file from epsg.io: https://epsg.io/3857.wkt
and use pycrs.load.from_url("https://epsg.io/3857.wkt")

@wsf1990
Copy link
Author

wsf1990 commented Jun 16, 2019

Thanks!

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

No branches or pull requests

2 participants