[mapserver-users] Looking for suggestions...

Puneet Kishor pkishor at GeoAnalytics.com
Tue Aug 27 16:44:00 EDT 2002


Chris,


> -----Original Message-----
> From: Williams, Chris D. [mailto:WILLIC10 at mail.northgrum.com]
> Sent: Tuesday, August 27, 2002 3:06 PM
> To: 'Puneet Kishor'
> Subject: RE: [mapserver-users] Looking for suggestions...
> 
> 
> Hi Puneet.  Any idea what would cause my map not to zoom in correctly?
> Everytime I try, it just stays the same or it moves the 
> center of the image.


Assuming you are using Perl/Mapscript... and you are starting off of the
base code that Steve Lime wrote in mapquakes.pl, zoom in or out will happen
only if the zoomfactor is something other than 1. For example, I do it like
so...

my $zoomfactor = 2;
if ($method eq "zi") {
	$zoomamt = $zoomfactor;
} elsif ($method eq "zo") {
	$zoomamt = 1 / $zoomfactor;
} elsif ($method eq "pan") {
	$zoomamt = 1;
}

Now I can use the $zoomamt to do the actual calculations. Seems like you are
doing nothing but panning.


> Still trying to get the perl scripts to work right.  I am on 
> Solaris with
> limited access right so running that perl script is haded 
> that it should be.
> 

well, yeah. you will at least need the rights to be able to write, chmod,
connect to web server, etc. But the fact that you can do any means that you
probably have all the rights you need.

Give mapquakes.pl a good deal of studying. It is a really well written
script... it does so much so concisely. Once you understand it fully you can
easily build off of it.

pk/

I am cc-ing this message to the list so other perl folks (and most all of
them are much better than I am) can offer their wisdom where needed.




> Thanks!
> Chris
> 
> -----Original Message-----
> From: Puneet Kishor [mailto:pkishor at geoanalytics.com]
> Sent: Tuesday, August 27, 2002 2:13 PM
> To: Williams, Chris D.; mapserver-users at lists.gis.umn.edu
> Subject: RE: [mapserver-users] Looking for suggestions...
> 
> 
> 
> 
> > -----Original Message-----
> > From: Williams, Chris D. [mailto:WILLIC10 at mail.northgrum.com]
> > Sent: Tuesday, August 27, 2002 12:10 PM
> > To: 'Steve Lime'; mapserver-users at lists.gis.umn.edu
> > Subject: RE: [mapserver-users] Looking for suggestions...
> > 
> > 
> > Thanks for the help...here are some followup...
> > 
> > 1)  I am new to shapefiles...how do you check the extents of 
> > a shapefile?
> 
> You could use Arcview if you have it.
> 
> Else, if you are on a *nix box and have compiled Mapscript, 
> you could use
> the shpinfo.pl script to get all manner of info on the 
> shapefile. You could
> easily modify that script to only spit out the extent, if you 
> so want. And
> you might also find a thusly modified script somewhere in the message
> archives... one of the many Perl wonks on this list had 
> already done that
> for someone else.
> 
> 
> > 2)  What I would like to do is have the user select a 
> > bounding box and click
> > a button that will fill in some form fields with the lat/lon 
> > based on the
> > that area.
> > 
> 
> this would require Javascript. When you select any box on the 
> screen you are
> capturing screen coordinates. First step would be to 
> transform those coords
> to the geographic coords of your preference. Inserting those 
> coords in the
> form fields would then be trivial.
> 
> Hth,
> 
> pk/
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > Thanks again!
> > Chris
> > 
> > -----Original Message-----
> > From: Steve Lime [mailto:steve.lime at dnr.state.mn.us]
> > Sent: Tuesday, August 27, 2002 11:48 AM
> > To: mapserver-users at lists.gis.umn.edu; Williams, Chris D.
> > Subject: Re: [mapserver-users] Looking for suggestions...
> > 
> > 
> > Hi Chris:
> > 
> > 1) That extent certainly covers the globe, but whether it's 
> > appropriate
> > depends on you
> > shapefiles. Check their extents to be sure.
> > 
> > 2) You'd only define a projection if you are displaying a map in a
> > different projection than
> > your data. If everything is in lat/lon and you don't want to 
> > display in
> > an alternative projection
> > then there's no need to define it. 
> > 
> > 3) Depends, but in most cases yes. You'll have to be more 
> specific on
> > what you want to do.
> > 
> > 4) The DNR site is back up, gremlins... jbox is an updated 
> version of
> > mapplet in which method
> > names and so forth have been standardized/sync'd with a 
> DHTML version.
> > I wanted to use the
> > same javascript base for either a Java or DHTML front end. That
> > necessitated some changes
> > to the applet, albeit minor ones.
> > 
> > Steve
> > 
> > >>> "Williams, Chris D." <WILLIC10 at mail.northgrum.com> 
> > 08/27/02 09:34AM
> > >>>
> > Hello all.  I have been playing around with MapServer for the 
> > past week
> > and
> > having some problems trying to understand how all the parts 
> fit.  Here
> > is
> > what I am trying to do.
> > 
> > I have a single shape file that contains an outline of the 
> > world.  What
> > I am
> > trying to do is use mapplet and create a query screen that 
> I am get a
> > decimal lat/lon from.  I have been able to hack apart the 
> itasca demo
> > using
> > my .map file and my shape file with mapplet.  The problem I 
> am running
> > into
> > now is the zooming function doesn't seem to work right.  
> All it wants
> > to do
> > is pan and not really zoom.  Here are some of the questions 
> I have...
> > 
> > 1)  What should I be defining the EXTENT value as?  I 
> > currently have it
> > set
> > to -180.0 -90.0 180.0 90.0.  Is this right?
> > 2)  Do I need to use the projection latlong?  I would think 
> so since I
> > want
> > to get lat/lon points from the image.  When I added the 
> > PROJECTION item
> > to
> > my .map file, I get an error from the mapserv cgi saying: Projection
> > library
> > eror: major axis or radius = 0 or not given.
> > 3)  Is there a way to take the pixal position and convert 
> it to a lat
> > long
> > point?
> > 4)  I have also looked at the Landview on the
> > http://www.dnr.state.mn.us 
> > website.  Would using the jbox class be better than 
> mapplet?  I tried
> > accessing the webpage today and it seems like none of the maps are
> > working.
> > 
> > 
> > I have attached the .map file and the .html files.  The shape file I
> > am
> > using can be found at http://www.vdstech.com/download/world.zip.
> > 
> > Thanks!
> > Chris
> > 
> 



More information about the mapserver-users mailing list