[postgis-devel] Recognizing "kind" of geometry

Mateusz Loskot mateusz at loskot.net
Sat Mar 6 08:17:02 PST 2010


strk wrote:
> On Sat, Mar 06, 2010 at 12:08:42AM +0000, Mateusz Loskot wrote:
>> strk wrote:
>>> On Fri, Mar 05, 2010 at 10:39:21PM +0000, Mateusz Loskot wrote:
>>>
>>>> Where is problem in determining if a GEOMERYCOLLECTION
>>>> is mixed or homogeneous?
>>> A collection of areas or points or lines can be rendered
>>> as a single layer on a map using a consistent symbology.
>> Sure and I still can't see what's missing in current model.
> 
> A MIXED spec is missing:
>  ST_Dimension returns *max* dimension of component geometries.

Clients can quickly iterate over collection
and collect dimensions of all geometries.

> An EMPTY spec is missing:
>  ST_isEmpty('GEOMETRYCOLLECTION(GEOMETRYCOLLECTION EMPTY)') 
> return false (could be a bug)

I've mentioned I don't comment the EMPTY issues as these
are mostly caused by the incompleteness of the OGC specification.
As we've discussed on #postgis, this problem is much more complex
than it seems and I doubt additional tags will solve it.

Regarding the EMPTY, to make clients life easier, the OGC spec
should make it possible for implementations to assure
substitution principle for the two standard encoding formats:
WKT and WKB. Currently, IMHO, OGC spec is completely broken
regarding this because depending on the format used to transfer
geometries, processing can give different results.

Shortly, for any valid geometry, OGC should make it possible
to guarantee the following is geometrically true,

AsText(g1) == AsBinary(g1)

POINT EMPTY is a valid geometry.
AsBinary('POINT EMPTY') gives different results in different
implementations, like MULTIPOINT or GEOMETRYCOLLECTION
or even POINT(0 0) !

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org



More information about the postgis-devel mailing list