[postgis-devel] Minimum number of points in a POLYGON ring?

Paul Ramsey pramsey at cleverelephant.ca
Thu Sep 18 18:00:04 PDT 2008


I'm quite worried about increasing the barriers to getting data into
PostGIS. I think we should let in anything at all, and declare it's
validity later. Effort should be spent on tools to (a) find bad data
and (b) make bad data better. IMO

P

On Thu, Sep 18, 2008 at 9:03 AM, Kevin Neufeld <kneufeld at refractions.net> wrote:
> My my readings, according to OGC, the number of points is vague, but the
> ruleset is specific.  A Polygon is made up of a set of LinearRings
> (following a set of rules about how they relate to eachother).  A LinearRing
> is a LineString that is both closed (startpoint ~= endpoint) and simple
> (does not self-intersect).  This implies that a linear ring must be made up
> of at least 4 points (3 distinct points) to avoid self-intersection.
>
> So the parser check should probably be increased the check to 4, but making
> sure the endpoints are equal (thus 3 distinct points).
>
> Does that help?
> -- Kevin
>
> Mark Cave-Ayland wrote:
>>
>> Hi there,
>>
>> Having just been working on the parser again, I've just wanted to verify
>> we are currently doing the check for the minimum number of points in a
>> polygon ring correctly.
>>
>> Currently the parser enforces a minimum of 3 points in a ring - but given
>> that the last point in a ring must be the same as the first point, do we
>> need to increase this to 4? So in other words, is a polygon with no area
>> simple?
>>
>> A bit of googling shows Informix believes the minimum number of points in
>> a polygon should be 4 (see USE31 in
>> http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.spatial.doc/spat310.htm),
>> but that doesn't distinguish between whether that is for the whole polygon
>> or just an individual ring. Can anyone clarify this with the OGC spec?
>>
>>
>> Many thanks,
>>
>> Mark.
>>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



More information about the postgis-devel mailing list