[Shapelib] How to pick up each segment in a polygon?

Mateusz Loskot mateusz at loskot.net
Sat Dec 29 07:28:03 PST 2007


Sam wrote:
> Hi, Frank & Folks,
> 
> Is there any difference about Points list between ShapeFormat in ESRI
> and ShapeLib?

What you mean as points list?
What structure of Shapelib API are you referring to?

> In the shape file specification, the startpoint of each part(or each
> ring) seems to be twice in Points list.

It does not seem, it must repeated, as said on page 9:

"the first and the last vertex of a ring MUST be the same"

> What about ShapeObject->nVertices in Shapelib?

What do you mean as ShapeObject? There is no such structure.
I suppose you refer to SHPObject and SHPObject::nVertices member.

> Is it the same order as ESRI?
> Namely, do nVertices in ShapeLib equal to NumPoints in ESRI?

Yes, nVertices object stores number of all points extracted directly
from Shapefile
at position of 36th byte, as said in the specification.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Shapelib mailing list