georust / wkt

Rust read/write support for well-known text (WKT)

Home Page:https://crates.io/crates/wkt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output `TRIANGLE` type?

michaelkirk opened this issue · comments

I'm not sure if we should support this, but I wanted to at least gather some facts for documentation.

postgis supports it:

SELECT ST_AsText('TRIANGLE((0 0,0 1,1 1,0 0 ))');
          st_astext          
-----------------------------
 TRIANGLE((0 0,0 1,1 1,0 0))
(1 row)

JTS does not support it

reader.read("TRIANGLE((0 0,0 1,1 1,0 0 ))");
> org.locationtech.jts.io.ParseException: Unknown geometry type: TRIANGLE (line 1)

Nor does GEOS

     message: `ParseException: Unknown type: 'TRIANGLE'`

It's part of the spec (OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 1: Common architecture, p14, p26), and also part of WKB, so I'm not against it, but I wonder why JTS and GEOS don't support it.

GEOS usually follows JTS, and it's curious that PostGIS uses GEOS, but supports TRIANGLE.

We could just ask JTS?