[mapserver-users] setting projection based on zoom

Jensen, Hannah ERDC-CRREL-NH Hannah.Jensen at erdc.usace.army.mil
Fri Sep 28 11:48:06 EDT 2001


Hi, Steve.  I am still wrestling with this problem and wondered if you had
any further suggestions.  Once I figured out that lat/long could be used to
specify mapext, I thought I could find the lat/long coordinates of the zoom
box based on the geographic extent of the image (minlat, minlon, etc).  Not
so!  I couldn't seem to convert with much accuracy, which I guess shouldn't
have been surprising.  I guess there's no way around interfacing with PROJ
somehow.  I saw an old posting on the web about a PROJ perl module, which I
was hoping would be able to spit out the lat/long points for the zoom box.
Is there a better way?  If the PROJ perl module is the way to go, can you
send it to me?  

Any suggestions are much appreciated!!  Thanks!



Cheers,
Hannah


-----Original Message-----
From: Stephen Lime [mailto:steve.lime at dnr.state.mn.us]
Sent: Tuesday, September 25, 2001 4:26 PM
To: Hannah.Jensen at erdc.usace.army.mil; mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] setting projection based on zoom


Here's why. The extent is projected when it is read from the CGI data, so it
is 
converted using the existing projection information it has at that time.
Setting
the projection afterwords has no effect but to screw things up. This is
fixable.
Hannah, would you be so kind as to add this to bugzilla?

Thanks- Steve

Stephen Lime
Data & Applications Manager

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

>>> "Jensen, Hannah ERDC-CRREL-NH" <Hannah.Jensen at erdc.usace.army.mil>
09/25/01 03:09PM >>>
 
Proof that you should leave your desk once in awhile -- someone down the
hall saw my post and walked over to give me the answer.  Thanks, Joel!

Anyway, if mapext is specified in lat/long, it works properly.  Only caveat
is that the projection must be specified FIRST in the URL.  So this works:

http://myserver/cgi-bin/mapserv34g?mode=browse&map=..%2Fhtml%2Fusamap%2Ftige

r.map&map_projection=proj=utm,zone=19&mapext=-78.12+40.14+-63.19+49.23

but this doesn't:

http://myserver/cgi-bin/mapserv34g?mode=browse&map=..%2Fhtml%2Fusamap%2Ftige

r.map&mapext=-78.12+40.14+63.19+49.23&map_projection=proj=utm,zone=19

Strange but true...



-----Original Message-----
From: Jensen, Hannah ERDC-CRREL-NH
To: 'mapserver-users at lists.gis.umn.edu' 
Sent: 9/25/01 3:17 PM
Subject: [mapserver-users] setting projection based on zoom

 
Hi, all.  I would like to be able to change projections based on how far
the
user is zoomed in.  For example, if they start out looking at the US in
Lambert Azimuthal Equal Area but zoom in on Alaska, the map should
display
the zoomed in area in UTM zone 6.  I'm hoping to be able to do this with
CGI
variables, but maybe that's not possible.  If I pass in the projection
parameters and the map extent (in the new projection units) like so:

http://myserver/cgi-bin/mapserv34g?map=../html/usamap/tiger.map&mode=bro 
wse&
map_projection=proj=utm,zone=6&mapext=415087+7115646+546659+7214763

it works fine.  But since I don't know the map extent in the new
projection
before conversion, what variables should I pass to properly define the
map
extent?  Can I somehow tell it to calculate the new extent based on the
old
one?  Is there a better way to do this?  Thanks in advance for any
info/advice...



Cheers,
Hannah



More information about the mapserver-users mailing list