[postgis-devel] Recognizing "kind" of geometry

Mateusz Loskot mateusz at loskot.net
Fri Mar 5 14:39:21 PST 2010


strk wrote:
> Guys,
> it hits my attention that a common need when dealing
> with geometry values is knowing if it is formed by
> POINTS, LINES or POLYGONS.
> Also, I belive it's often useful to know if it's
> EMPTY, or formed by a mix of the above 4 types.
> [...] 
> Do other see a need for such a function ?
> Values it could return, taking the well-known ones
> from JTS/GEOS literacy, are:
> 
>  PUNTUAL
>  LINEAL
>  AREAL
>  MIXED
>  EMPTY
> 
> Having such function you could finally attach
> an "is AREAL" constraint to your tables rather
> than the current "is MULTIPOLYGON" one often requiring
> the use of ST_Multi() against topological functions...
> 
> Also, you could distinguish a collection of polygons
> (say, returned from ST_Polygonize) from a collection
> of mixed-types.

I'm having troubles finding what's the actual rationale
of this proposal. Let's put the issues of accurately
determining EMPTY'ness of geometry on a side.
Where is problem in determining if a GEOMERYCOLLECTION
is mixed or homogeneous?

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



More information about the postgis-devel mailing list