[postgis-devel] About BOXES

Chris Hodgson chodgson at refractions.net
Fri Nov 25 13:56:45 PST 2011


Been following this ... just going to chime in on one thing here - I 
like these representations, but I don't like the SRID at the back. 
Should really match the EWKT with it in the front, IMHO.

To resolve the parsing issue, could we keep box2d as a non-srid'd box 
type, and slip in casts between it and the new BBOX type?

AND/OR, accept input of boxes without the "SRID=####" (as SRID 0 or 
whatever we agreed on) and ALSO output text for boxes that have the null 
srid without the "SRID=####". This still wouldn't be entirely consistent 
with EWKT but seems like a more acceptable compromise for backward 
compatibility with old box2d parsing code - especially since putting the 
;SRID=#### on the end doesn't actually guarantee any backward compatibility.

If the WKT for the new BBOX type, with a null srid, was still

BOX (4 6,57 40)

Then we could return it from st_extent and be closer to completely removing box2d...

Chris

On 11-11-25 01:37 PM, Paul Ramsey wrote:
> I prefer this one, and with optional spacing (as in the SQL/MM parser)
> so that we could have
>
> BOX (4 6,57 40);SRID=4326
> BOX Z (4 6 0,57 40 0);SRID=4326
> BOX M (4 6 0,57 40 0);SRID=4326
> BOX ZM (4 6 0 0,57 40 0 0);SRID=4326
>
> Now, you sure about putting the SRID at the back, unlike the geometry WKT?
>
>> Meaning parsers for ST_3DExtent are more likely to fail.
> It's so new, I'm guessing we can afford this risk.
>
>> Among all of this, I don't get your "re-define box2d" idea.
> The problem with ST_Extent() returning a box2d was that it was a
> float-backed type, so the coordinates were rounded out and not exact.
> box3d_extent was a hack to avoid the rounding while retaining a
> box2d-style text representation. Since box2d is no longer used as an
> index key, it can be redefined to be double-backed, and st_extent
> could return box2d again. But it looks like we can get most of what we
> need with your proposal above, the only downside being that the text
> representation of the 'bbox' type will be 'BOX()' and not 'BBOX()'.
>
> P.
>
>
>> --strk;
>>
>>   ()   Free GIS&  Flash consultant/developer
>>   /\   http://strk.keybit.net/services.html
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel




More information about the postgis-devel mailing list