[postgis-devel] OGC TIN of triangles or polygons?

Mateusz Loskot mateusz at loskot.net
Wed Dec 4 07:14:13 PST 2013


On 1 December 2013 21:50, Olivier Courtin <olivier.courtin at oslandia.com> wrote:
> On Nov 28, 2013, at 12:55 PM, Mateusz Loskot wrote:
>> """
>> A Triangle is a polygon with 3 distinct, non-collinear vertices
>> """
>>
>> If a triangle must have exactly 3 points and all points must be distinct,
>> as I interpret what the space says above, why PostGIS generates 4 points?
>>
>> Attempt to parse WKT with 3-point triangles, as OGC specifies:
>>
>> TIN (((0 0, 0 1, 1 0)), ((0 1, 1 1, 1 0)))
>>
>> generates:
>>
>> ERROR:  triangle must have exactly 4 points
>>
>> Is that right?
>
>
>
> Triangle is a surface in OGC SFS 1.2 model.
> And so closing coordinates are required. (cf 6.1.11.1 in SFS 1.2 common part)
>
> So it's imply (as i understand it) 3 coordinates points and 1 more to close it (so 4)

Despite, I can't find in that section anything that would specify 4
points for triangle.

> One other discussion could be, is it really smart to store the closing point for a TRIANGLE ?
> (and not to just use a is_closed flag, in geometry header for instance)
> As it could lead to save significant storage space.

Yes.


>> Is it my misunderstanding or from an implementer point,
>> OGC SFS 1.2.1 is inconsistent in regard to specification of TIN,
>> triangle and polygon and use of those types in the WKT/WKB formats.
>> And, the buggy WKBTIN format in the OGC SFS 1.2.1 should be corrected this way:
>>
>> WKBTIN {
>> byte byteOrder;
>> static uint32 wkbType = 17;
>> uint32 numTriangles;
>> WKBTriangle triangles[numTriangles]
>> }
>
>
> I agree,
> and, as you seen, it was implemented in PostGIS in this way.

I have noticed that and the difference in comparison to the OGC spec is what
makes me ask my questions.

AFAIS from the svn log, Paul committed the TIN support, so I was wondering if he
could shed some light on his decisions why he didn't follow the OGC
spec strictly.

Best regards,
-- 
Mateusz  Łoskot, http://mateusz.loskot.net



More information about the postgis-devel mailing list