[postgis-users] [postgis-devel] Oddity in _ST_Expand(geography) ?

Pavan Deolasee pavan.deolasee at gmail.com
Mon Jul 23 00:41:25 PDT 2018


Hi Darafei,

On Sat, Jul 14, 2018 at 3:53 AM, Darafei "Komяpa" Praliaskouski <
me at komzpa.net> wrote:

> Hi Pavan,
>
> вт, 10 июл. 2018 г. в 12:48, Pavan Deolasee <pavan.deolasee at gmail.com>:
>
>>
>> On Tue, Jul 10, 2018 at 12:22 PM, Darafei "Komяpa" Praliaskouski <
>> me at komzpa.net> wrote:
>>
>>>
>>> What you can try is to short-circuit ST_Expand to ST_Buffer for now.
>>> It's more expensive computationally, but for most practical use cases the
>>> box it produces should be similar to that of ST_Expand, and serialized
>>> geometry should produce the same box on both sides of serialization.
>>>
>>>
>>
>> Thanks for the tip. That seems to do the trick. Apart from the
>> performance impact, can this cause any regression? FWIW PostGIS regression
>> tests does not show any new failure, but anything specific I should test?
>> With regard to performance impact, could it be material? And if so, in what
>> circumstances?
>>
>
> I've created a ticket for your issue so we can do something about it.
> https://trac.osgeo.org/postgis/ticket/4122#ticket
>
> Please check if everything's right in it.
>


Yes, it looks alright.


>
> You said you're willing to write a patch. An approach I see now would be
> is to take box3d->geometry code from here:
>
> https://github.com/postgis/postgis/blob/587badb8cca5b59f734c1a0d689024
> f0287bc47b/postgis/lwgeom_box3d.c#L183
>
> Then, replace the POLYGON, LINESTRING and so on generation with generation
> of MULTIPOINT with just points. In geography lines are curvy, so
> unfortunately drawing a 3D shape with only endpoints will be too wavy to be
> correct.
> Transform box coords to normal using cart2geog just like here:
>
> https://github.com/postgis/postgis/blob/fce3e121f3726aabfe8cfc6e4d98f3
> 1c6713c0f4/liblwgeom/g_serialized.c#L275
>
> All this new code should go to a function here:
>  https://github.com/postgis/postgis/blob/f1f6de48cd205e620e56aca8157080
> d7a34a6888/postgis/geography_measurement.c#L479
>
> A PR can be sent on github, https://github.com/postgis/postgis - or post
> a patch in any convenient format.
>


Ok, thanks for the pointers. I will work on this, but the priority has gone
down a bit for me thanks to the workaround you proposed above, which is
working fine for the XL user.

Thanks,
Pavan

-- 
 Pavan Deolasee                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180723/31548d85/attachment.html>


More information about the postgis-users mailing list