[mapserver-users] multiple shapefiles in single layer

Stephen Woodbridge woodbri at swoodbridge.com
Thu Apr 4 17:55:52 PST 2002



Dan Keith wrote:
> 
> Hi,
> 
> I have a few more questions re: tiling.
> 
> The tile4ms utility doesn't support the specification of the TILEITEM
> parameter (i.e., it is always LOCATION), nor does it allow the
> merging of a tile index into an existing tileindex file.

Yup, this is correct.

> I presume that the only way to create a multicolumn tile index (thus
> allowing the use of multiple TILEITEMs from within the .map file) is
> to write a separate program (e.g., using Perl's XBase module) to
> aggregate multiple tileindex files into a single .dbf file. Is this
> the correct way?

Yes you could do this. I do a variation on this for Census data because
it is organized in directories by county and each county has a full set
of layers. So what I do is make the tileindex index the directories and
then in my mapfile I use the tileindex and DATA roads or DATA rivers.
There is an option that if I remember correctly is not well documented
or I missed it that intedexes the directories instead of the files as
records in the tileindex. I wrote some code to munge the indexes before
I found the option to do it for me. (the programmers curse - if you
can't find it, don't read the manual, just write some code :)

> What are the advantages to creating such a multicolumn tileindex, vs
> using separate tileindex file for each logical dataset? Is it more
> efficient?

I'm not sure I can help much here, but I would think it would depend on
the data and how it is organized spatially.

> Also, is it better to create a spatial index from the individual
> shapefiles in a tileindex, or is it better (or even possible) to
> create a spatial index from the composite tileindex?

It is most effiecnt if ALL .shp files have a shptree index, otherwise
mapserver falls back to a full scan of the file.

-Steve W.

> Thanks
> 
> At 11:26 PM -0600 4/3/02, Steve Lime wrote:
> >There is a mechanism in the MapServer that already supports this -
> >tiling. Basically you create an index shapefile that contains boundaries
> >for the various shapefiles in the layers (in you case counties). The
> >index shapefile then references the individual shapefiles as an
> >attribute. The default attribute is 'location' but you can call it what
> >ever you'd like to (then use TILEITEM parameter) and can even use a
> >single tile index for multiple layers (e.g. you have roads and lakes
> >tiled by county). Support for query of tiled data is supported in
> >version 3.5+. See the documentation (and perhaps the wiki) for more
> >details.
> >
> >Steve
> >
> >Stephen Lime
> >Data & Applications Manager
> >
> >Minnesota DNR
> >500 Lafayette Road
> >St. Paul, MN 55155
> >651-297-2937
> >>>>  Joe Bussell <joe at otsys.com> 04/03/02 20:21 PM >>>
> >Greetings,
> >     I am attempting to combine multiple shapefiles (data from different
> >counties) into single layers.  How can I do this without declaring
> >multiple layers which must be handled seperately in the mapfile?  Is
> >there a standard method which will preserve the ability to querry
> >the data?  The mapfile syntax does not seem to allow multiple data tags
> >for a given display layer.  This leads me to wonder if there are tools
> >which can merge shapefiles into a larger superset.  Is anyone aware of
> >such a tool?
> >
> >Joe Bussell
> >On Time Systems
> 
> --
> Dan "Bud" Keith - bud at otsys.com



More information about the MapServer-users mailing list