How to

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Thu Jan 10 13:28:49 EST 2008


Chip Taylor wrote:
> I know that this is not specifically a mapserver question (or maybe it is)
> but here goes:
> 
> Is there a way to:
> 
> 1. Take one large shapefile (such as uscounties.shp) and split it into
> individual shapefiles based on information in the .dbf file (such as
> individual counties - one per shapefile)?

I think the easiest way to do this might be to use something like 
Geo::Shapelib perl module to read the input shapefile and to generate 
the respective output shapefiles. There are approximately 3300 counties 
in the US.

> 2. How would I send a query to Mapserver to only return a map for a specific
> entity in a shapefile (such as a county from a shapefile that contained all
> US counties - based on the state FIP and County FIP in the dbf)?

QueryByAttribute should be able to do that. It depends if you are trying 
to do this in CGI, mapscript (which flavor?), or a filter on a WFS 
server, or substitution in the mapfile via the CGI to dynamically change 
a FILTER on a layer, etc. Or you could load it into a postGIS database 
and deal with it there. GDAL/OGR might have some additional tools to do 
this that I'm not familiar with.

> It has been a while since I have done any Mapserver development and now I
> have to get back to it.  Your help is greatly appreciated!
> 
> Chip Taylor

Best regards,
  -Steve W



More information about the mapserver-users mailing list