tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

will 3d or nd be supported?

Open khasvictor opened this issue 7 years ago • 6 comments

the rtreebase class seems to be able to handle n-dimensional rtree, while the rtree class only do inserts like:

// Insert inserts item into rtree
func (tr *RTree) Insert(item Item) {
	minX, minY, _, maxX, maxY, _ := item.Rect()
	tr.tr.Insert([2]float64{minX, minY}, [2]float64{maxX, maxY}, item)
}

I wonder if 3d or nd point, bbox, indexing, searching .etc is currently fully supported or on the roadmap?

khasvictor avatar Apr 25 '18 01:04 khasvictor

The base rtree structure can potentially support any number of dimensions. I've done various experiments with supporting 3D geometries, but never settled on anything. Perhaps in the future.

tidwall avatar Apr 26 '18 20:04 tidwall

3D support would be really the killer feature. Especially for projects with UAVs!

The possibility to geofence volumes would be something really cool.

Could potentially make use of https://sfcgal.gitlab.io/SFCGAL

geotom avatar Dec 11 '24 18:12 geotom

Yes, there's support for the Z coordinate in Tile38 today.

Set the position of the UAV to lat/lon coordinate (33,-112) and altitude of 150 meters.

SET fleet uav1 33 -112 150

Create a geofence that is detects a rectangular lat/lon bounding box min=(32,-113) max=(34,-111) and altitude min=100 max=200.

SETHOOK geofence1 endpoint-url INTERSECTS fleet WHERE z 100 200 BOUNDS 32 -113 34 -111

tidwall avatar Dec 11 '24 19:12 tidwall

I saw this already. Did not know how to query by Z. Is it merely an attribute then? I think a real 3d RTree index would be great, to have some real geospatial volume queries, even it is just a cube.

geotom avatar Dec 11 '24 21:12 geotom

Is Tile38 using your BuntDB internally? Because it speaks about a geospatial index for up to 20 dimensions.

geotom avatar Dec 11 '24 21:12 geotom

The Z coordinate is a special field type that can be defined using the FIELD option or by including in a Point type.

Tile38 uses BuntDB for storing the geofence event notifications only, not the internal data structures. Though Tile38 does use the same btree and rtree packages, just in a more direct way.

tidwall avatar Dec 12 '24 11:12 tidwall