[mapserver-users] [Q] Relation of .shp, .dbf, and .gif | .tif files

Thorsten Fischer frosch at cs.tu-berlin.de
Fri Jun 15 13:35:28 PDT 2001


On Fri, 15 Jun 2001, Roderick A. Anderson wrote:

> This is probably way below the level of support people on this list are
> providing but I got to ask.

To help you get this thing up and running, there is no level too low
;-)

> 1) A .shp file of the greater Spokane Washington area including points
>    for the sites, lines for the major roads, points for known 'things'
>    in the area, and possibly polygons for boundries or area
>    features.

You will need a single shapefile for every of these features.

> 
> 2) A .dbf file with the information on the sites (I'd prefer using
>    PostgreSQL if possible).

Yes, every shapefile is accompanied by a .shx index file and a .dbf
data file. Please note that a .dbf _must_ be present to have
mapserver working. I asked to have this fact removed in future
version of mapserver, but i do not know if it disappeared already.

The .shx index file is used internally to speed up access to the
shapes' features.

Connecting to a database is not yet part of mapserver I believe.
You will have to use the mapscript interface when trying to 
use database data, which will force you to do programming in
perl, php, java or whatever language is you liking.
 
Please note that when using programs like ArcView to create shapefiles,
all these files get created automagically.

> 3) Several smaller scale .shp files with more road and street
>    information centered around the public access sites or the center of
>    several sites.

Not necessarily at smaller scale, depending on what you mean by that. As
long as the coordinate system is the same, you
can mix your files together as is your liking, no matter if they cover
some larger or smaller area. You can tell MapServer
to display certain data on certain scales only, so you can make sure
that - just to have an example - you do not display a layer
with all of the phone booths in a state when you have a picture
of the whole state.

> 	Does Mapserver create a graphic based on the .shp file and
>         friends?

Yes, it does. It generate .gif or .png, depending on the version
of the GD image llibrary compiled in.

> 	What file holds the text for features for the map?

This is done via the .dbf files. You name the table columns in
the mapserver config file via a CLASSITEM to filter them and a
LABELITEM to get data displayed.

> 	What file holds the feature display attributes, color, line 
> 	type, line thickness(?), font, etc.  (I think the .map file.)

You define symbols in a symbol file with the suffix .sym. For lines,
you define a symbol which resembles a dot, and in the .map declare
thickness, color etc.  Fonts are listed in a fontlist file, which
defines aliases to the actual .ttf files (when using truetype), and 
these aliases are then used in the .map file.

> 	Can all my data fit in one .shp file (instead of several) and I
> 	select the layers to be displayed and a portion of the whole
> 	area in the .shp file?

Most probably not. A single shape file can only hold data of a certain
type: points _or_ lines _or_ polygons. And: be assured - you just
have to believe that - that you do not want to have it another way.

> 
> 
> Thanks for any answers or pointers to answers,

You're welcome.

You might want to read the documentation on the mapserver website
and dig your way through the example package ms_demo.tar.gz.



thorsten

--

thorsten fischer
thfischer (at) mapmedia (dot) de






More information about the MapServer-users mailing list