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

Tom Price tom_price at yahoo.com
Tue Oct 22 16:08:52 EDT 2002


I'm working with the county boundary files for all states and
possessions and county subdivisions for New England states. That's a
total of 62 shape files.

As a general rule, one state is featured and portions of adjacent
states are shown if needed. So, a state may need to appear slightly
different depending upon whether it is featured or not. And, only one
or two shape files would be in use at any given time. 

These are the ones from Census and are apparently unprojected. I
understand the efficiency concerns with on-the-fly projection but I'm
still not clear how to proceed. Can this be accomplished outside of
ArcView?

Thanks for your help.

Tom

--- TCHaddad <TCHaddad at cshore.com> wrote:
> 
> the next question is : are you reprojecting all your files in advance
> (outside of mapserver), or are you reprojecting each on the fly when
> they are requested by users (the latter sounds slow, but i don't know
> how many files you have).
> 
> if you are doing the first then you should reproject the lot and then
> extract the extents in the same manner as you did when the files were
> unprojected. 
> 
> i've never implemented the latter, but folks with better mapscript
> skills should be able to help.
> 
> how many shapefiles are you talking about (1 for every state?).
> 
> ---------- Original Message ----------------------------------
> From: Tom Price <tom_price at yahoo.com>
> Date: Tue, 22 Oct 2002 11:50:31 -0700 (PDT)
> 
> >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/
> >


__________________________________________________
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