[mapserver-users] Examples using projection?

Stephen Lime steve.lime at dnr.state.mn.us
Mon Jul 23 12:23:02 PDT 2001


Here's how it works. Extents are taken to be in the projection defined for
the map. There's no way to recompute the extent because there's no
way for the software to know what projection it might be in. Hence the
assumption. When you do a setProjection you also need to provide
extents in the new projection. How are you projecting from old extent to 
new? Doing just the corners will not work. In 3.5 projection support has 
been rolled into mapscript. All spatial objects (i.e. shapeObj, rectObj,...) 
have a project method. You can also define new projections using something
like $proj = new projectionObj(string); and can use it in the above mentioned
methods.

Steve

Stephen Lime
Internet Applications Analyst

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

>>> "Mike Neuman" <mcn at engarde.com> 07/23/01 12:57AM >>>
  I'm trying to draw individual states, but am having serious problems
getting the projection to make any sense. Does anyone have examples I can
look at?

  As an example of my problems, I draw the state of Minnesota. It looks
really elongated (since most people are used to seeing it as LCC). So, I do:
  $map->setProjection("proj=lcc,lat_0=33,lat_1=45,lon_0=-93");

  This works, and I get an LCC projection of Minnesota, but only if I redo
the extents using the PROJ.4 program. Even then, a good portion of the
bottom of the state is lopped off.

  By playing with the numbers, I discover I can set minx=-1 maxx=1, and the
miny and maxy to some value gotten from PROJ4 (+ or - some error so I don't
lose the bottom of the state). This doesn't seem right.

  Since Mapserver automatically recomputes ALL layers (and drawn points) in
the new projection, why can't it recompute extents? Or does it, and I'm
missing something?

  Thanks!

-Mike





More information about the MapServer-users mailing list