Changing projection to match a dataset

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing projection to match a dataset

jonathanbyrn
Hi,
I am new to openlayers and I have a pretty basic but fundamental question on how to handle different projections. I have a datasat that I want to serve through an openlayers webpage. The problem is that the data is stored in an irish Grid format:
http://spatialreference.org/ref/epsg/29902/

I was hoping that changing the projection to EPSG:29902 would automagically fix everything but it ended up throwing an error:
Uncaught TypeError: Cannot read property 'R' of undefined

some further reading showed that only projections EPSG:4326 and EPSG:900913 came with openlayers:
http://dev.openlayers.org/apidocs/files/OpenLayers/Projection-js.html

I am now at the point where I am going to start using pro4js to convert my coordinates. So here are my current options:

1: convert the coordinate system of the basemap to the irish grid
2: take the inputs from the user in EPSG4326 and convert them to irish grid
3: convert the whole dataset to EPSG4326

I know there is no correct answer but is there a best practice when mixing grid systems? Any help would be greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Changing projection to match a dataset

Robert Sanson-2
Hi Jonathan

The best approach is generally to set the map projection to be that of any raster base map, as rasters are much harder to re-project on-the-fly. If you are using an OpenStreet map or Google base map, then you will be forced to use that (Spherical Mercator) projection.

How are you loading your Irish grid data? Do you have Mapserver / Geoserver, or are you loading something like a GeoJSON or WKT file? If you are using a Web server like Mapserver or Geoserver, then the map server should be able to reproject your Irish grid data to be that of the base map. If you are loading a vector file directly into OpenLayers, then OpenLayers can re-project it to the projection of the base map using proj4js.

Regards,

Robert

-----Original Message-----
From: Users [mailto:[hidden email]] On Behalf Of jonathanbyrn
Sent: Wednesday, 14 October 2015 8:36 p.m.
To: [hidden email]
Subject: [OpenLayers-Users] Changing projection to match a dataset

Hi,
I am new to openlayers and I have a pretty basic but fundamental question on how to handle different projections. I have a datasat that I want to serve through an openlayers webpage. The problem is that the data is stored in an irish Grid format:
http://spatialreference.org/ref/epsg/29902/

I was hoping that changing the projection to EPSG:29902 would automagically fix everything but it ended up throwing an error:
Uncaught TypeError: Cannot read property 'R' of undefined

some further reading showed that only projections EPSG:4326 and EPSG:900913 came with openlayers:
http://dev.openlayers.org/apidocs/files/OpenLayers/Projection-js.html

I am now at the point where I am going to start using pro4js to convert my coordinates. So here are my current options:

1: convert the coordinate system of the basemap to the irish grid
2: take the inputs from the user in EPSG4326 and convert them to irish grid
3: convert the whole dataset to EPSG4326

I know there is no correct answer but is there a best practice when mixing grid systems? Any help would be greatly appreciated.




--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Changing-projection-to-match-a-dataset-tp5229956.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

Re: Changing projection to match a dataset

jonathanbyrn
Hi Robert,
Thanks for getting back to me. I am basing my project on MATHAN:
https://github.com/tudelft3d/matahn

It takes the box drawn on the layer and uses that information to pull a point cloud from a database. If I use EPS:4236 then I will have to transform the user coordinates before I pull the info from the database, but as this is only 4 coordinates that is not too bad. I plan on using this for other projects so I will start reading up on mapservers. Thanks for your help!