how to fill a polyLineZ shape ?

Topics: General Topics
Mar 26, 2007 at 11:36 AM
Hi,

I have a shapeFile with polyLine shapes. Is it possible to fill them with a colour ?
I tried with something like style.Fill = Brushes.Aquamarine; but that doesn't work.
I think it's only possible with polygons shapes, but I'm not sure
Mar 26, 2007 at 12:51 PM
Polylines aren't closed polygons, so I doubt you'd be able to fill them with SharpMap. If it possible for you to pre-process the data to convert from polyline to polygon before using it? It's a fairly easy task in MapInfo, although I don't know how to do it in Arc.
Mar 27, 2007 at 12:25 PM
I'm not sure I can convert the shapesFiles. Some shapes are open and some others "seems" to be closed
Coordinator
Mar 27, 2007 at 2:20 PM
dylanparry is right - if the shapefile has only linestring features in it, these are not treated as closed figures, and are not filled in the same way that polygons are.

If you are adventurous, you could try using v2.0 of SharpMap, which has read/write capability for shapefiles, and write a simple program which reads each feature from the current shapefile and writes it to a new one as a polygon.