<div dir="ltr">Hi <span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Darafei,</span><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 14, 2018 at 3:53 AM, Darafei "Komяpa" Praliaskouski <span dir="ltr"><<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Pavan,<br><br><div class="gmail_quote"><span class=""><div dir="ltr">вт, 10 июл. 2018 г. в 12:48, Pavan Deolasee <<a href="mailto:pavan.deolasee@gmail.com" target="_blank">pavan.deolasee@gmail.com</a>>:<br></div></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><span class=""><div class="gmail_quote">On Tue, Jul 10, 2018 at 12:22 PM, Darafei "Komяpa" Praliaskouski <span dir="ltr"><<a href="mailto:me@komzpa.net" target="_blank">me@komzpa.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><div><br></div></span><div>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.</div><div> </div></div></div></blockquote></div><br clear="all"></span></div></div><span class=""><div dir="ltr"><div class="gmail_extra"><div>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?</div></div></div></span></blockquote><div><br></div><div>I've created a ticket for your issue so we can do something about it. <br><a href="https://trac.osgeo.org/postgis/ticket/4122#ticket" target="_blank">https://trac.osgeo.org/<wbr>postgis/ticket/4122#ticket</a> <br><br>Please check if everything's right in it. </div></div></div></blockquote><div><br></div><div><br></div><div>Yes, it looks alright.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br>You said you're willing to write a patch. An approach I see now would be is to take box3d->geometry code from here:</div><div><br></div><div><a href="https://github.com/postgis/postgis/blob/587badb8cca5b59f734c1a0d689024f0287bc47b/postgis/lwgeom_box3d.c#L183" target="_blank">https://github.com/postgis/<wbr>postgis/blob/<wbr>587badb8cca5b59f734c1a0d689024<wbr>f0287bc47b/postgis/lwgeom_<wbr>box3d.c#L183</a> <br></div><div><br></div><div>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.</div><div>Transform box coords to normal using cart2geog just like here:</div><div><br></div><div><a href="https://github.com/postgis/postgis/blob/fce3e121f3726aabfe8cfc6e4d98f31c6713c0f4/liblwgeom/g_serialized.c#L275" target="_blank">https://github.com/postgis/<wbr>postgis/blob/<wbr>fce3e121f3726aabfe8cfc6e4d98f3<wbr>1c6713c0f4/liblwgeom/g_<wbr>serialized.c#L275</a> <br></div><div><br></div><div>All this new code should go to a function here:</div><div> <a href="https://github.com/postgis/postgis/blob/f1f6de48cd205e620e56aca8157080d7a34a6888/postgis/geography_measurement.c#L479" target="_blank">https://github.com/postgis/<wbr>postgis/blob/<wbr>f1f6de48cd205e620e56aca8157080<wbr>d7a34a6888/postgis/geography_<wbr>measurement.c#L479</a> </div><div><br></div><div>A PR can be sent on github, <a href="https://github.com/postgis/postgis" target="_blank">https://github.com/<wbr>postgis/postgis</a> - or post a patch in any convenient format.</div></div></div>
</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div>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.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks,</div><div class="gmail_extra">Pavan<br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"> Pavan Deolasee                   <a href="http://www.2ndQuadrant.com/" target="_blank">http://www.2ndQuadrant.com/</a><br> PostgreSQL Development, 24x7 Support, Training & Services</div></div></div></div>
</div></div>