GeoNode
Geospatial data structure for location-based spatial entity analysis
Learn what it is
GeoNodePackage location
com.fractalworks.streams.processors.geospatial.structuresClass Definition
class GeoNode<T extends ReferenceData> implements Coordinates, ReferenceDataConstructors
// Default constructor
public GeoNode()
// Create a node with location details and add entity later
public GeoNode(double latitude, double longitude)
// Create a node with location details and a reference data type
public GeoNode(double latitude, double longitude, T entity)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
Friendobject stores details (ID, name) of a person.GeoNode instances Each
GeoNode<Friend>links aFriendto specific geographical coordinates (latitude, longitude).QuadTree The
GeoNodeinstances are added to aQuadTree, which indexes the locations for efficient querying.GeoFence A
GeoFenceis created around a specific location with a radius (2 units).Querying The
QuadTreeis queried forGeoNodeobjects within theGeoFence, returning nearby friends.Display results The nearby friends are printed to the console.
Last updated
Was this helpful?