[OpenLayers-Users] OpenLayers Question: Google Physical Projections and epsg:26915

Richard Duivenvoorde rdmailings at duif.net
Sat Jun 28 16:02:18 EDT 2008


Hi Matthew,
I don't know the OS your running, but there is the commandline util 
cs2cs in the 'proj'-package.
If you install proj in any debian(-derivative) or ms4w/fwtools on 
windows, you can do for example the following to 'cast' one x,y to another:

C:\ms4w>cs2cs +init=epsg:4326 +to +init=epsg:28992
this will wait for a line of input of two points.
So if you follow with:
5.172167 52.245417
it will give:
140313.91       473062.48 -43.21

you can also feed it a list/file with x,y-pairs, or do some formatting:
cs2cs +init=epsg:900913 +to +init=epsg:4326 -f "%.2f"
500738 6859019
4.50    52.32 0.00

Another option is to use the spatial functions of a postgres/postgis db 
if you have that laying around,
eg. tranform from a 4326 point to a 28992 point:
SELECT AsText(Transform(GeomFromText('POINT(5.172167 52.245417)', 4326), 
28992))
or the other way around
SELECT AsText(Transform(GeomFromText('POINT(140313.905612639 
473062.480785896)', 28992), 4326))

HTH,
Regards,
Richard Duivenvoorde

ps, both options above will only work when you have the right epsg codes 
in your proj/postgis configuration

Matthew Pettis wrote:
> Thanks Paul for your response 
> (http://openlayers.org/pipermail/users/2008-June/006474.html).
> 
> Truth is, my bounds are not in spherical mercator (they are in 
> epsg:26915), so i will need to convert them.  If you, in addition, 
> happen to know some examples of casting bounds from one projection to 
> another, I'd appreciate that as well.
> 
> Thanks again,
> Matt
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list