[mapserver-users] Projection of objects in mapscript

Stephen Lime steve.lime at dnr.state.mn.us
Thu May 17 11:24:35 EDT 2001


The projection methods are intended (for the moment) to work off the projectionObj's
attached to map and layer objects. I will add a generic projection object to mapscript
so you can do something like:

  my $proj = new projectionObj("+init=epsg:11111");

but for now you have to use projection objects with maps and layers. So you can do
something like:

  $status = $point.project($layer->projection, $map->projection);
  die "Projection failed." if $status != $mapscript::MS_SUCCESS;

Note that you have setProjection methods available for both map and layer objects.

Steve

Stephen Lime
Internet Applications Analyst

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Thorsten Fischer <thfischer at mapmedia.de> 05/17/01 06:10AM >>>

Dear list,

browsing through mapscript.i after updating it from CVS let me come across a
new method in several objects, including for example pointObj. The method is
called 'project', which appears to be a gift from heaven for me at the moment.


But I can't figure out how to use it. It says, in the pointObj for example:

int project (projectionObj *in, projectionObj *out)


My questions are Java related:

1. How do I create a projectionObj?

2. How do I use this method, and what does it return, e.g. I want to project a
single geographic coordinate to UTM/zone 32?


I expected something like this pseudo-code:

myPoint.project (<old projection def>, <UTM zone 32 definition goes here>);

and the new coordinates being saved in myPoint, though it would be nice if it
would return a new object without touching the original one. So how do I create
a projectionObj to use all of this?


Thanks in advance,


Thorsten

-- 

Thorsten Fischer          thfischer at mapmedia.de 

---------------------------------------------------------
MapMedia - Kartographie und raumbezogene Informationssysteme
Am Borsigturm 42
13507 Berlin
Deutschland
http://www.mapmedia.de tel: +49 (0)30 43032102
---------------------------------------------------------






More information about the mapserver-users mailing list