please review my assumption about segmentize and bbox

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

please review my assumption about segmentize and bbox

Sandro Santilli-4
Doing topology loading tests I found time is spent to update
the bounding box of faces whenever their edges are split.
Following the train of thougths I arrived at asking myself:

Is it possible that adding vertices in a segment could ever change
the segment bounding box ?

My answer is NO.

Could you please review and confirm ?

If my answer is correct, not only we can speed up topology loading,
but also (for example) the ST_Segmentize function, which is currently
*dropping* a cached BBOX value to be on the safe side (ie: to not
answer that question).

Math proofs welcome :)

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Darafei "Komяpa" Praliaskouski
ST_Extent('SRID=4326;LINESTRING(-73 40, 53 27)'::geography::geometry) = BOX(-73 27,53 40)
ST_Extent(ST_Segmentize('SRID=4326;LINESTRING(-73 40, 53 27)'::geography,100)::geometry) = BOX(-73 27,53 56.2529232769426)


In planar geometry your assumption should be valid, though.

сб, 12 нояб. 2016 г. в 14:12, Sandro Santilli <[hidden email]>:
Doing topology loading tests I found time is spent to update
the bounding box of faces whenever their edges are split.
Following the train of thougths I arrived at asking myself:

Is it possible that adding vertices in a segment could ever change
the segment bounding box ?

My answer is NO.

Could you please review and confirm ?

If my answer is correct, not only we can speed up topology loading,
but also (for example) the ST_Segmentize function, which is currently
*dropping* a cached BBOX value to be on the safe side (ie: to not
answer that question).

Math proofs welcome :)

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Sandro Santilli-4
On Sat, Nov 12, 2016 at 11:19:29AM +0000, Darafei "Komяpa" Praliaskouski wrote:
> ST_Extent('SRID=4326;LINESTRING(-73 40, 53 27)'::geography::geometry) = BOX(-73
> 27,53 40)
> ST_Extent(ST_Segmentize('SRID=4326;LINESTRING(-73 40, 53
> 27)'::geography,100)::geometry) = BOX(-73 27,53 56.2529232769426)
>
> In planar geometry your assumption should be valid, though.

Thanks, for topology only planar is considered, but good point
about ST_Segmentize (ie: cannot just let lwline_segmentize take
the assumption).

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Sandro Santilli-4
In reply to this post by Sandro Santilli-4
On Sat, Nov 12, 2016 at 12:12:27PM +0100, Sandro Santilli wrote:

> Is it possible that adding vertices in a segment could ever change
> the segment bounding box ?
>
> My answer is NO.

Someone made me notice I didn't specify that the added vertex
would be ON the segment, or as close as possible within the limits
of representability, which is why a drift is expected and raises
the question of the bbox...

(my answer is still no).

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Stephen Woodbridge
In reply to this post by Sandro Santilli-4
On 11/12/2016 6:12 AM, Sandro Santilli wrote:

> Doing topology loading tests I found time is spent to update
> the bounding box of faces whenever their edges are split.
> Following the train of thougths I arrived at asking myself:
>
> Is it possible that adding vertices in a segment could ever change
> the segment bounding box ?
>
> My answer is NO.
>
> Could you please review and confirm ?
>
> If my answer is correct, not only we can speed up topology loading,
> but also (for example) the ST_Segmentize function, which is currently
> *dropping* a cached BBOX value to be on the safe side (ie: to not
> answer that question).
>
> Math proofs welcome :)

What about curved geometries? like arc segments. Is the BBOX defined
based on the true arc BBOX or the segmentized arc BBOX, if the later
then changing the segmentation of an arc could in theory change hte BBOX.

-Steve


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Sandro Santilli-4
On Sat, Nov 12, 2016 at 09:25:58AM -0500, Stephen Woodbridge wrote:

> What about curved geometries? like arc segments. Is the BBOX defined based
> on the true arc BBOX or the segmentized arc BBOX, if the later then changing
> the segmentation of an arc could in theory change hte BBOX.

Yep, this is similar to the point raised by Darafei (geography).
To be honest I don't know how BBOX is computed for curves though.

Once again though, topology does not support curves (nor geographies).

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Paul Ramsey
For both curves and for geography the bounding box/volume is calculated to take in the whole arc, even if the furthest extent of the arc does not happen to have any vertices on it. So, if you density the arc/great-circle, the box should not need to be re-calculated, since any new vertices will be added into the existing arc.

On Sat, Nov 12, 2016 at 6:35 AM, Sandro Santilli <[hidden email]> wrote:
On Sat, Nov 12, 2016 at 09:25:58AM -0500, Stephen Woodbridge wrote:

> What about curved geometries? like arc segments. Is the BBOX defined based
> on the true arc BBOX or the segmentized arc BBOX, if the later then changing
> the segmentation of an arc could in theory change hte BBOX.

Yep, this is similar to the point raised by Darafei (geography).
To be honest I don't know how BBOX is computed for curves though.

Once again though, topology does not support curves (nor geographies).

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel


_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: please review my assumption about segmentize and bbox

Stephen Woodbridge
Thanks, that is good to know.
-Steve

On 11/12/2016 8:24 PM, Paul Ramsey wrote:

> For both curves and for geography the bounding box/volume is calculated
> to take in the whole arc, even if the furthest extent of the arc does
> not happen to have any vertices on it. So, if you density the
> arc/great-circle, the box should not need to be re-calculated, since any
> new vertices will be added into the existing arc.
>
> On Sat, Nov 12, 2016 at 6:35 AM, Sandro Santilli <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Sat, Nov 12, 2016 at 09:25:58AM -0500, Stephen Woodbridge wrote:
>
>     > What about curved geometries? like arc segments. Is the BBOX defined based
>     > on the true arc BBOX or the segmentized arc BBOX, if the later then changing
>     > the segmentation of an arc could in theory change hte BBOX.
>
>     Yep, this is similar to the point raised by Darafei (geography).
>     To be honest I don't know how BBOX is computed for curves though.
>
>     Once again though, topology does not support curves (nor geographies).
>
>     --strk;
>     _______________________________________________
>     postgis-devel mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.osgeo.org/mailman/listinfo/postgis-devel
>     <http://lists.osgeo.org/mailman/listinfo/postgis-devel>
>
>
>
>
> _______________________________________________
> postgis-devel mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/postgis-devel
>


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel