spatialindex with point geometry

43 views
Skip to first unread message

Antonio Valanzano

unread,
Oct 10, 2022, 3:50:56 AM10/10/22
to SpatiaLite Users
I am following the Cookbook 5.0 examples and for recipe#15 there is a comment
about the bounding box which is used for the spatial search

"  --  the BoundingBox is a square 1000 meters around the Populated-Place (width/height 2000 meters)"

I haven't found in the public documentation of Spatialite any reference to this default value of 1000 meters for the bounding box of a single point.

Could someone give me indications about this value ?


Antonio


mj10777

unread,
Oct 10, 2022, 4:32:42 AM10/10/22
to SpatiaLite Users
On Monday, 10 October 2022 at 09:50:56 UTC+2 anva...@gmail.com wrote:
I am following the Cookbook 5.0 examples and for recipe#15 there is a comment
about the bounding box which is used for the spatial search

"  --  the BoundingBox is a square 1000 meters around the Populated-Place (width/height 2000 meters)"

I haven't found in the public documentation of Spatialite any reference to this default value of 1000 meters for the bounding box of a single point.
Nor will you, because it a comment within the used SQL:

  SELECT ROWID FROM SpatialIndex WHERE
  (


   -- the BoundingBox is a square 1000 meters around the Populated-Place (width/height 2000 meters)

   (f_table_name = 'populated_places') AND
    -- create a circle geometry [which is in meters] that is 1000 meters around the Populated-Place
   (search_frame = ST_Buffer(pp1.geometry,1000))
  ) 



Could someone give me indications about this value ?

It is the result of the ST_Buffer command used in the SQL statement:
search_frame = ST_Buffer(pp1.geometry,1000)
 
Mark



Antonio


Antonio Valanzano

unread,
Oct 10, 2022, 5:17:21 AM10/10/22
to SpatiaLite Users
Mark
thanks for the fast reply.

The position of the comment within the SQL was a bit confusing.
In order to make the sequence of operations clearer, it could be better to write
..
(f_table_name = 'populated_places')
AND
-- create a circle geometry [which is in meters] that is 1000 meters around the Populated-Place
-- the BoundingBox, which derives from this circle geometry,  is a square 1000 meters around the Populated-Place (width/height 2000 meters)
 (search_frame = ST_Buffer(pp1.geometry,1000))
..

In any case thanks for your contribution to the Spatialite project.

Antonio



mj10777

unread,
Oct 10, 2022, 5:28:00 AM10/10/22
to SpatiaLite Users
On Monday, 10 October 2022 at 11:17:21 UTC+2 anva...@gmail.com wrote:
Mark
thanks for the fast reply.

The position of the comment within the SQL was a bit confusing.
The placement of the comment was for the following reason: the BoundingBox of whatever geometry is set in search_frame will always be used by the internal logic of spatialite. The second comment shows that a circle is being created for search_frame, but that the internal logic will only use the BoundingBox of that circle.

Mark
Reply all
Reply to author
Forward
0 new messages