[Mapserver-users] Merge of shapefiles
Christopher R. Thorne
thorne at dmsolutions.ca
Fri Oct 31 07:29:22 PST 2003
Johan Antonsson wrote:
> Thanks!
>
> Does this mean I only need one mapfile for all my shape files?
>
This is correct, in fact these 50x50 shapes could be placed in one
layer. and if you plane to produce the tile index shape file, where in
the layer object you would use
TILEINDEX -> to define the path to the tile index.
TILEITEM -> the item in the tile index shape file that holds the paths
to each individual shape file or directory.
Example 1
MAP
SHAPEPATH "C:/mapdata/"
LAYER
DATA "land.shp"
TILEINDEX "Tiledir/land_tile.shp"
TILEITEM "Location"
.
.
.
END
END
In the Tile dbf item "location" for the tile being selected ->
"data/county24/"
Since the LAYER->DATA object is present the path to the selected file
will be:
SHAPEPATH + "data/county24/" + DATA == "C:/mapdata/data/county24/land.shp"
Example 2
MAP
SHAPEPATH "C:/mapdata/"
LAYER
TILEINDEX "Tiledir/land_tile.shp"
TILEITEM "Location"
.
.
.
END
END
In the Tile dbf item "location" for the tile being selected ->
"data/mapsheet24.shp
The resulting path would be:
SHAPEPATH + "data/mapsheet24.shp" == "C:/mapdata/data/mapsheet24.shp"
> Is there a good tutorial for the tiles feature?
tile4ms -> utility is pretty straight forward, the most difficult part
is how you wish to organize your data and then producing the shape file
list.
The following commands are required to produce a tileindex shapefile:
cd/data
find TIGER2K/name us_land.shp -print > TIGER2K/list.txt
tile4ms TIGER2K/list.txt TIGER2K/county -tile-path-only
This will produce county.shp using the extents of all us_land.shp files
in the directory.
SHPTREE Utility
Another Utility that is very useful, for all individual shape file is
the Shptree utility. This utility produces a quad tree index file
(*.qix) for the shape file specified. This should be implemented on each
individual file on top of the tile indexing of the whole data set. This
will make your mapserver application really snappy!
eg. shptree mapsheet24.shp NL 0
--
Christopher R. Thorne
GIS Specialist,
DM Solutions Group Inc.
http://www.dmsolutions.ca
email: thorne at dmsolutions.ca
Phone: (613) 565-5056 ext.22
Fax : (613) 565-0925
------------------------------
More information about the MapServer-users
mailing list