GeoNode
Geospatial data structure for location-based spatial entity analysis
Learn what it is
GeoNodePackage location
Class Definition
Constructors
Key Methods
Get coordinates
Get entity unique key
Get entity
Example
The example demonstrates using the GeoNode
class to store and query geospatial data.
This example demonstrates how to associate spatial data with entities and efficiently query nearby locations.
Friend class A
Friend
object stores details (ID, name) of a person.GeoNode instances Each
GeoNode<Friend>
links aFriend
to specific geographical coordinates (latitude, longitude).QuadTree The
GeoNode
instances are added to aQuadTree
, which indexes the locations for efficient querying.GeoFence A
GeoFence
is created around a specific location with a radius (2 units).Querying The
QuadTree
is queried forGeoNode
objects within theGeoFence
, returning nearby friends.Display results The nearby friends are printed to the console.
Last updated