Subject: [ggl] WKT empty
From: Barend Gehrels (Barend.Gehrels)
Date: 2009-06-13 15:43:39
>> Wouldn't it be better to let the user define how an empty coordinate
>> should be represented? After all, GGL is already very traits-driven.
>> So maybe having set_empty() / is_empty() functions in the point traits
>> could do the trick? The user can then define it as a NaN, or have a
>> dedicated boolean in his point, or anything else...
> This seems to be very reasonable solution.
> We could provide some guidelines for OGC-oriented users how to
> instrument their point types with support of this feature.
I agree that traits are the best option / the only option we have.
But... actually I don't understand the use for an empty point. The WKT
"POINT EMPTY" cannot be the only reason to build all this. We don't have
algorithms which require empty points, or which deliver empty points. We
didn't discuss this ever before.
As soon as we have empty points, we have to take care of them in all
algorithms... The distance of two empty points (or one of them) would
deliver a NULL-value. It will change everything.
The following statement in PostGIS:
select Astext(GeomFromText('POINT EMPTY'))
delivers an empty geometry collection... So an empty point is converted
to a geometry collection with zero elements. This makes sense to me.
However, we cannot do it. In the template world, reading a point from a
WKT, we have to deliver a point.
MySQL answers just "NULL" on the same query, this makes also sense, for
Finally, SQL Server 2008 answers on this similar query:
select geometry::STGeomFromText('POINT EMPTY', 0).STAsText()
the answer "POINT EMPTY", which is what you would expect. If you ask for
the X-value you get really a NULL value back. But we cannot do that.
So I propose to handle a POINT EMPTY WKT by delivering a POINT(0 0)
-------------- next part --------------
An HTML attachment was scrubbed...
Geometry list run by mateusz at loskot.net