Mapfile and shape
Pietro Giannini
pgiannini at BYTEWISE.IT
Thu Apr 5 07:02:45 PDT 2007
Hi Giacomo,
> is possibile to force Mapserver
>
(through Mapfile) to read informations about color and patterns from
> DBF file?
Directly, for the moment I think no.
Take
a look to
http://mapserver.gis.umn.edu/docs/reference/mapfile/layer/?searchterm=styleitem
you can find the layer's property STYLEITEM, experimental and OGR only,
wich is the name of the field containing style info's. No info about the
format, etc.
Look also to how-to
http://mapserver.gis.umn.edu/docs/reference/vector_data/mapinfo/?searchterm=styleitem
is an how-to to read mapinfo files.
With STYLEITEM=AUTO in the
layer you can preserve the style information of the mapinfo layer.
You can of course define in the layer a number of classes equal to
the number of styles you want, each class with its STYLE, and in the class
EXPRESSION (http://mapserver.gis.umn.edu/docs/howto/msexpressions) you can
define the value of the field (defined in CLASSITEM property) for
style definition of single feature.
e.g. :
if you have a .shp of
buildings and use of each building is defined in the field 'TYPE' with the
keywords 'PUBLIC', 'PRIVATE', 'AIRPORT'... your layer in the .map file can
appear like:
#
LAYER
NAME edifici
DATA edifici
TYPE POLYGON
CLASSITEM 'TYPE'
CLASS
EXPRESSION 'PUBLIC'
STYLE
COLOR 223 184 230
OUTLINECOLOR 80 80 80
END # of style
END # of class
CLASS
EXPRESSION 'PRIVATE'
STYLE
COLOR 199
141 235
OUTLINECOLOR
80 80 80
END # of style
END # of class
CLASS
EXPRESSION 'AIRPORT'
STYLE
COLOR 172 102 237
OUTLINECOLOR 80 80 80
END # of style
END # of class
CLASS
...
END # of class
END #of
layer
#
ciao
Pietro
--
Pietro
Giannini
Bytewise srl - Area GIS
41°50'38.58"N
12°29'13.39"E
On Gio, 5 Aprile 2007 11:52
am, Giacomo Sacchetti wrote:
> Dear All,
>
> I've
posted a question two weeks ago, but I haven't received any
>
response. So, I'll try to explain better my situation.
> I've
"converted" a DWG file in several SHP file. Every layer of
the
> DWG is "well formed": this means that every layer
have only one type
> of entity (points, lines, ...). I've created
a tool for this type of
> convertions.
> My problem is to
assign pattern and color to the shape files.
> I've thinked to
insert informations about color and pattern in the DBF
>
associated to every SHP files: is possibile to force Mapserver
>
(through Mapfile) to read informations about color and patterns from
> DBF file?
>
> Thanks in advance
>
> GS
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070405/69530814/attachment.htm>
More information about the MapServer-users
mailing list