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

feature request #7

Open
m0ose opened this issue Jun 10, 2013 · 3 comments
Open

feature request #7

m0ose opened this issue Jun 10, 2013 · 3 comments

Comments

@m0ose
Copy link

m0ose commented Jun 10, 2013

It would be cool to add the ability to load the projection info from a .prj file (and convert it into something openlayers/leaflet can use like EPSG:4326" ).
In my experience most shapefiles come in some obscure projection, so this could be very usefull.

@MrJoeClarke
Copy link

I agree that reading .prj files would be very useful - and probably relatively easy to implement due to the text-based structure of the files. I guess the difficulty is mapping the name or characteristics of the projection in the prj file to the EPSG code (or manually define the projection from the contents of that file). I don't know how much prj file structure varies though - looking at a couple, it seems to vary quite a lot!

@m0ose
Copy link
Author

m0ose commented Jun 13, 2013

It does seem like a very daunting task, which is probably why no one has
done it yet in javascript( i think). The only open source software that I
can think of is GDAL. I looked through the code and found that the data
directory is full of csv files. I bet those files contain most of the
important information, but i'm not sure which ones.

This is some stuff I found after peeking into the folder.

gcs.csv: is probably global coordinate system definitions
gdal_datum.csv : datum?
elipsoid.csv: might represent the spheroid
*
*

-----------------This is from wikipedia,
http://en.wikipedia.org/wiki/Shapefile ------------------------------

New WKT format example:
*
GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]]]
*
*
*
The information contained in the .prj file specifies the:
*
*

Name of Geographic coordinate system or Map projection

Datum (geodesy)

Spheroid

Prime meridian

Units used

*

In conclusion, This looks like a very difficult problem, and I don't envy
anyone who attempts it. It might be the job for some professional
geographers, however It would also be incredibly useful.
*
*
*Cody Smith
*

Cody Smith

On Thu, Jun 13, 2013 at 2:04 AM, MrJoeClarke [email protected]:

I agree that reading .prj files would be very useful - and probably
relatively easy to implement due to the text-based structure of the files.
I guess the difficulty is mapping the name or characteristics of the
projection in the prj file to the EPSG code (or manually define the
projection from the contents of that file). I don't know how much prj file
structure varies though - looking at a couple, it seems to vary quite a lot!


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-19377572
.

@wavded
Copy link
Owner

wavded commented Aug 26, 2013

PROJ4 has been implemented pretty well in JavaScript although a PRJ file isn't in that format. You'd have to do that translation. I've typically used http://spatialreference.org/ to get the proper PROJ4. I imagine you could make a wrapper to pull down the definition if available and use it with OL or Leaflet.

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

3 participants