[mapserver-users] Goto state for a projected shape file

Tom Price tom_price at yahoo.com
Tue Oct 22 11:50:31 PDT 2002


I'm new to this and trying to keep things as simple as possible. But
without projection, the maps are distorted enough that they are
objectionable. 

These are Tiger files and some of the Census documentation suggests
that Albers Equal-Area Conic might be adequate. So, hopefully, just
one. But, certainly the parameters to the projection would need to
differ.

It's still not clear how I would proceed with this conversion. Is it
done with the ms_newprojectionobj method on the shapefile object?

Thanks for your help!

Tom


--- TCHaddad <TCHaddad at cshore.com> wrote:
> 
> you need to convert your unprojected extents into projected values in
> your database and then use these projected values in your goto
> feature.
> 
> are you using different projections for every state?
> 
> ---------- Original Message ----------------------------------
> From: Tom Price <tom_price at yahoo.com>
> Date: Tue, 22 Oct 2002 08:27:03 -0700 (PDT)
> 
> >I'm a newbie to PHP Mapscript and I'm trying to implement a "goto
> >state" feature which would maximize any US state to the dimensions
> of
> >the image. In in earlier post, it was suggested that I spin through
> the
> >shape file to determine the min/max extents. I did that including
> >saving the dimensions on a database. That works fine but some of the
> >states are distorted enough to require projection and, once
> projected,
> >I find that these extents are no longer valid.
> >
> >What am I missing?
> >
> >TIA
> >
> >Tom Price
> >
> >	$shapef = ms_newShapefileObj($mapdata.$baseshape,-1);
> >	$minx=$miny=+1E30;
> >	$maxx=$maxy=-1E30;
> >	for ($i=0;$i<$shapef->numshapes;$i++) {
> >		$extent = $shapef->getExtent($i);
> >		$minx=min($minx,$extent->minx);
> >		$miny=min($miny,$extent->miny);
> >		$maxx=max($maxx,$extent->maxx);
> >		$maxy=max($maxy,$extent->maxy);
> >	}
> >	$map->setextent($minx,$miny,$maxx,$maxy);
> >
> >
> >
> >__________________________________________________
> >Do you Yahoo!?
> >Y! Web Hosting - Let the expert host your web site
> >http://webhosting.yahoo.com/
> >


__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/



More information about the MapServer-users mailing list