[mapserver-users] on the fly projection modifications

Stephen Lime steve.lime at dnr.state.mn.us
Mon Aug 27 12:57:04 PDT 2001


It can be done. You need to use lat/lon coordinates to move between different
projections. No biggie in your case. You can change the output projection using
the "map_projection" parameter and you set it's value to a comma delimited
string of proj options. For example:

  "proj=lcc,lat_0=49n,lon_0=95w,lat_1=49n,lat_2=77n"

anything spit out at that point will be in that new coordinate system. One caveat might
be that you should set the new projection BEFORE passing the extent but I'm not
positive about that.

Steve

Stephen Lime
Internet Applications Analyst

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

>>> "Kralidis, Tom" <Tom.Kralidis at CCRS.NRCan.gc.ca> 08/27/01 02:31PM >>>
Hi,

Anyone have any experience / suggestions on how to change projection params
on the fly within a MapServer web app?

i.e. An existing .map file:

MAP
 NAME CAN
 EXTENT -180 -90 180 90
 UNITS DD
 TRANSPARENT ON
 SIZE 500 300
 WEB
  TEMPLATE  map.htm
  IMAGEPATH /home/httpd/html/img_cache/
  IMAGEURL  "/img_cache/"
  LOG       process_log
 END
 LAYER
  NAME   world_at_night
  TYPE   RASTER
  STATUS DEFAULT
  DATA   ../firemapping/world_stable_lights.tif
 END
END

..then, in the web app, the user wishes to change projections to:

PROJECTION
  "proj=lcc"
  "lat_0=49n"
  "lon_0=95w"
  "lat_1=49n"
  "lat_2=77n"
END

...how can one set this up via GET or POST.  I'd like to have the page
refresh with coords in LCC, as per this example.

Thanks

..Tom

=================================
Tom Kralidis
Systems Scientist
Canada Centre for Remote Sensing
Tel: (613) 947-1828
http://www.ccrs.nrcan.gc.ca/ 
=================================




More information about the MapServer-users mailing list