[mapserver-users] getExtent / setExtent problems

Puneet Kishor pkishor at GeoAnalytics.com
Mon Jul 30 13:38:19 EDT 2001


figured it out... I was using the wrong $row_id... 

I haven't yet figured out how to get back the shape index for getExtent, so
I added a row_id to the parcel.dbf, and used row_id as the shape index.

well, the first row is actually the header row, so the first row with any
data in it is actually the second row. I was getting the wrong row offset...
adding 1 to the row_id solved the problem.

Anyone, any idea how I can retrieve the row_id for a shape.dbf without
actually having to add that as a field?

--

a house-keeping question --

I find that the messages I post to the mapserver list take several hours to
appear in my email... 5-8 hours delay. Does the mapserver listserver not
broadcast the posted emails immediately? Seems not, so, is it not possible
to do so? 

Is it possible to migrate to a web-based forums so we can access the forums
(and not just the archives) from anywhere? I use Cold Fusion driven forums a
lot (Macromedia's CF support forums are on the web), and the Forums software
is open source, although it does require a CF server (I might be able to
convince my company to host 'em). There are other cgi-driven forums as well.

Any thoughts from the listkeepers and other listusers? 

--


pk/

--
Puneet Kishor 
pkishor at geoanalytics.com
www.geoanalytics.com

GeoAnalyics, Inc.
1716 Fordem Ave
Madison WI 53704


> -----Original Message-----
> From: Daniel Morissette [mailto:morissette at dmsolutions.ca]
> Sent: Monday, July 30, 2001 10:25 AM
> To: Puneet Kishor
> Cc: mapserver-users
> Subject: Re: [mapserver-users] getExtent / setExtent problems
> 
> 
> Puneet Kishor wrote:
> > 
> > I am trying to getExtent of a shape that I have retrieved 
> using its index.
> > 
> >         $shapeExtObj = $shapeFileObj->getExtent($row_id);
> >         $minx = $shapeExtObj->minx;
> >         $miny = $shapeExtObj->miny;
> >         $maxx = $shapeExtObj->maxx;
> >         $maxy = $shapeExtObj->maxy;
> > 
> >         $border = 1000;
> > 
> >         $minx = $minx - $border;
> >         $miny = $miny - $border;
> >         $maxx = $maxx + $border;
> >         $maxy = $maxy + $border;
> > 
> >         $mapObj->setExtent( $minx, $miny, $maxx, $maxy);
> > 
> > except, the resulting map extent of the map is slightly 
> off-center... if my
> > logic above is correct, the chosen shape should be exactly 
> centered on the
> > resulting image, with a border of 1000 feet (map coords are 
> in feet) around
> > it. Except, the chosen shape appears in the bottom left 
> corner of the image.
> > 
> > What is the obviously obvious that I am doing wrong?
> > 
> 
> It's so obvious that I can't see it either! :)
> 
> The PHP mapObj.setExtent() method calls msAdjustExtent() 
> internally and
> this will adjust the extents you've specified to fit the 
> output image's
> width/height ratio.  msAdjustExtent() should keep the extent you've
> specified centered on the image, so I don't understand why 
> that doesn't
> work for you.
> 
> Perhaps you could try to print the values of 
> $mapObj->extent->minx, etc.
> before and after the call to SetExtent and that may give some clues on
> what the problem is.
> 
> > --
> > 
> > Oh... nudderthing... I am unable to query the dbf files on 
> my *nix box using
> > PHP... says dbase_open() etc. are not copacetic. Could that 
> be because the
> > PHP install does not have a dbase module compiled in it? I 
> thought that was
> > automatically included. What gives here?
> > 
> 
> No, dbase support is not included by default in PHP.  On Unix you have
> to specify --with-dbase when you configure PHP, and on Windows I think
> PHP comes with a PHP_DBASE.DLL that you can load using dl().
> 
> -- 
> ------------------------------------------------------------
>  Daniel Morissette               morissette at dmsolutions.ca
>  DM Solutions Group              http://www.dmsolutions.ca/
> ------------------------------------------------------------
>   Don't put for tomorrow what you can do today, because if 
>       you enjoy it today you can do it again tomorrow.
> 



More information about the mapserver-users mailing list