edge problems in shp

Frank Warmerdam fwarmerdam at GMAIL.COM
Mon Feb 14 08:53:54 PST 2005


On Mon, 14 Feb 2005 17:37:23 +0100, Yogid <yogid at o2.pl> wrote:
> Of course, no problem!
> Best view was on buldings.
> http://superstar.gb.net.pl/~yogi/map/
> budynki-areas.shp  - with that problem (wintopo)
> budynki-areas1.shp - without that problem (openev)
>
> Daniel D.

Daniel,

Looking at the file, I see the polygons are not closed.  That is, the
last point is not equal to the first.

eg.
 Shape:0 (Polygon)  nVertices=12, nParts=1
  Bounds:(    8776.875,    5300.625, 0, 0)
      to (    8917.625,    5414.125, 0, 0)
     (    8796.875,    5334.375, 0, 0) Ring
     (    8776.875,    5371.625, 0, 0)
     (    8810.125,    5414.125, 0, 0)
     (    8858.875,    5380.875, 0, 0)
     (    8873.375,    5399.625, 0, 0)
     (    8917.625,    5347.875, 0, 0)
     (    8867.625,    5300.625, 0, 0)
     (    8851.125,    5315.625, 0, 0)
     (    8836.625,    5324.375, 0, 0)
     (    8825.875,    5330.125, 0, 0)
     (    8817.375,    5332.125, 0, 0)
     (    8808.375,    5333.625, 0, 0)

After digging around in OpenEV for a while, I see the code
in it for saving to shapefiles ensures that polygons get closed.
The rendering code doesn't require them to be pre-closed so
it looked ok there.

It seems that MapServer does require polygons from shapefiles
to be closed and doesn't make any effort to correct if that is not
the case.  You might want to file a bug against MapServer to
fixup this case.

I would also encourage you to contact the wintopo authors and
encourage them to write their shapefiles with closed polygons.
I plan to fixup the distribution Shapelib to enforce this requirement
in the not-to-distant-future.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the MapServer-users mailing list