[OpenLayers-Users] Retrieving different coordinates

Mike Adair madair at dmsolutions.ca
Mon Dec 10 09:07:17 EST 2007


The SVN for proj4js currently lives at: 
https://svn.codehaus.org/mapbuilder/cscs, but I've just updated my 
sandbox with the latest version of this library at 
http://svn.openlayers.org/sandbox/madair.

To use this is OpenLayers,  you need to:
1. include the OpenLayers.Projection class in your OL build (also in the 
madair sandbox)
2. include the Proj4js code in your application
3. set proj4js constants for
Proj4js.libPath = 'pointer to where Proj4js is loaded from' - there 
should be a 'defs' subdirectory from this location which may hold proj4 
projection  definitions (see the proj4js/defs directory in the sandbox)
Proj4js.proxyScript = 'pointer to proxy script' - this can just point to 
the OL proxy script, for looking up proj4js definitions automatically 
via an AJAX call
4. create proj4js (really OL.Projection objects) objects for you source 
and destination coordinate systems
5. call OpenLayers.Projection.transform(source, dest, point);

I think that should do it.  Note that not all projection classes have 
been tested and verified to be bug free yet, but a UTM one like 32632 
should work.

Mike


Hufjan wrote:
> Hello Bart,
> I experimented with my map trying to get coordinates for EPSG:4326 
> from my EPSG:32632.Map. What I did is changing the request from
>
> http://localhost:8080/geoserver/wms?bbox=277023.0864899452,5233434.01524883,923881.7291952965,6106592.061342626&styles=&Format=application/openlayers&request=GetMap&layers=topp:Deutschland&width=457&height=550&srs=EPSG:32632 
>
>
> to
>
> http://localhost:8080/geoserver/wms?bbox=*5.508,47.117,15.619,55.104*&styles=&Format=application/openlayers&request=GetMap&layers=topp:Deutschland&width=457&height=550&srs=EPSG:4326
>
> Then I get my coordinates in Lat/Lon.
> But: I didn't want to convert my 'mappicture'. It should remain in the 
> same UTM-projection I rectified it to. So my result is just a half 
> step forward.
> Coordinates fine, map declined :-(
>
> I discussed this theme in the Geoserver-List as well. There I was told 
> about the proj4j-library - especially about Mike Adair sandbox 
> (http://trac.openlayers.org/browser/sandbox/madair/lib).
> This is meant to reproject coordinates from UTM (for all SRS handeling 
> UTM?) to EPSG:4326.
> But I was was only told where to find it. So far nobody seems to have 
> experience with it neither knows if it's working. I also didn't find 
> any tutorials how to deal with it.
>
> Do you ever met this problem?
>
> Best regards,
> cuxland
>
> Bart van den Eijnden (OSGIS) schrieb:
>> Geoserver can reproject the GeoTiff for you to EPSG:4326. This is what OL
>> uses by default.
>>
>> So just look at the examples/wms.html and add your Geoserver URL in there.
>>
>> What do you mean with retrieve coordinates? Maybe the MousePosition Control
>> is what you are looking for. Add that Control to your Map and you'll see the
>> coordinates on mouse over.
>>
>> Best regards,
>> Bart
>>
>> --
>> Bart van den Eijnden
>> OSGIS, Open Source GIS
>> http://www.osgis.nl
>>
>>
>> --------- Oorspronkelijk bericht --------
>> Van: Janes Huff <hufjan at web.de>
>> Naar: openlayers users <users at openlayers.org>
>> Onderwerp: [OpenLayers-Users] Retrieving different coordinates
>> Datum: 29/11/07 10:51
>>
>>   
>>> Hello,
>>> I must introduce myself as a Newbie that searched a week inside this 
>>> list getting more and more confused.
>>>
>>> I'm simply looking to an answer for this question:
>>>
>>> I loaded a GeoTIFF to Geoserver (UTM32N/WGS84 = SRS:32632). Is it now 
>>> possible to retrieve geographic coordinates (Lat/Lon/WGS84; SRS:4326) via
>>> OpenLayers??
>>>
>>> Just a hint where to find more information would be very helpful.
>>>
>>> Exhausted (from searching) greetings,
>>> cuxland
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>>>     
>>
>>
>>
>>
>>   
>
>
> -- 
> +------------------------------------------------
> | Dipl.-Geogr. Janes Huff
> | Wilhelmshavener Str. 30
> | 10551 Berlin
> |
> | Tel.: +49(0)30 - 44 70 47 96
> | Mobil: +49(0)176 - 23 43 30 99
> | Fax: +49(0)1212-5-113-83-519
> |
> | Homepage: www.radinformix.de
> | 
> | Skype: hufjan
> | ICQ: 430988829
> | Yahoo: cuxland
> +------------------------------------------------ 
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   



More information about the Users mailing list