[postgis-devel] ST_AsBinary(geography) ?

Sandro Santilli strk at keybit.net
Wed Jan 11 08:21:41 PST 2012


On Wed, Jan 11, 2012 at 07:31:49AM -0800, Paul Ramsey wrote:
> On Wed, Jan 11, 2012 at 4:42 AM, Sandro Santilli <strk at keybit.net> wrote:
> > While looking at qgis sources it stroke me that
> > geography and geometry are threated differently:
> >
> >  ST_AsBinary(<geometry>, <endian_spec>) and
> >  ST_AsBinary(<geography>)
> >
> > So went looking and found ST_AsBinary(<geography>, <endian_spec>)
> > doesn't exist. Is there any reason why ST_AsBinary(<geography>)
> > doesn't implicitly cast geography to geometry ?
> >
> > In other words: is there a special WKB for geography ?
> 
> And special WKT... we come here to an uncompleted compatibility change
> 
> AsText(geometry) and AsBinary(geometry) return what they always did
> "OGC strict" results, which means tossing away higher dimensionality.
> AsText(geography) and AsBinary(geography) return ISO SQL/MM results,
> which means higher dimensions, type tokens that include the dimensions
> (eg 'POINT Z') and WKB with funny offsets to indicate dimensions (eg
> 1001 for POINT Z).
> 
> There's probably tickets outstanding that say "convert geometry to
> return ISO formatted text and wkb in the system.
> 
> I think at this point everyone is bloodyminded enough to say "just do
> it, do it!", but that wasn't so earlier.

I did it, I did it !

Before writing this mail. And so I dropped the custom definition 
and was dreaming to rely on an implicit cast where I got red-lighted.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list