public interface GeospatialIndexConnection extends AutoCloseable
All lengths and distances are given in DEGREES. Conversions to other uses of measurement can be
performed using DistanceUnit.
| Modifier and Type | Method and Description |
|---|---|
void |
add(Feature theShape)
Add the shape to the spatial index.
|
void |
add(Iterable<Feature> theShapes)
Add the shapes to the spatial index.
|
void |
begin()
Start a transaction
|
void |
clear()
Clear all the features from the index
|
void |
close()
Close the connection to the index.
|
void |
commit()
Commit the transaction
|
double |
distance(org.locationtech.spatial4j.shape.Point thePoint,
org.locationtech.spatial4j.shape.Point theOther)
Calculate the distance between the points
|
Optional<Feature> |
get(long theId)
Get the shape from the index that has the given id
|
Iterator<Feature> |
iterator()
Return an iterator over all features in the spatial index
|
Iterator<Feature> |
nearby(org.locationtech.spatial4j.shape.Point theLocation,
double theRadius)
Return all shapes within a radius of a given location
|
long |
nearbySize(org.locationtech.spatial4j.shape.Point theLocation,
double theRadius)
Return the (approximate) number of shapes within a radius of a given location
|
void |
prepare()
Prepare the transaction for commit
|
void |
remove(Feature theShape)
Remove the feature from the index
|
void |
remove(Iterable<Feature> theShape)
Remove all of the features from the index
|
void |
rollback()
Rollback the current transaction
|
long |
size()
Return the number of spatial structures stored within the index
|
void |
update(Feature theShape)
Update the data about a shape with the same ID.
|
Iterator<Feature> |
within(org.locationtech.spatial4j.shape.Shape theBox)
Return all the features within the given shape
|
long |
withinSize(org.locationtech.spatial4j.shape.Shape theBox)
Return the (approximate) number of features within the given shape
|
void close()
throws GeoException
close in interface AutoCloseableGeoException - if there was an error closing the indexlong size() throws GeoException
GeoException - if there was an error while retrieving the size of the indexdouble distance(org.locationtech.spatial4j.shape.Point thePoint,
org.locationtech.spatial4j.shape.Point theOther)
throws GeoException
thePoint - the pointtheOther - the other pointGeoException - if there was an error while calculating the distanceIterator<Feature> within(org.locationtech.spatial4j.shape.Shape theBox) throws GeoException
theBox - the containing shapeGeoException - if there was an error while retrieving the child featureslong withinSize(org.locationtech.spatial4j.shape.Shape theBox)
throws GeoException
theBox - the containing shapeGeoException - if there was an error while retrieving the child featuresIterator<Feature> nearby(org.locationtech.spatial4j.shape.Point theLocation, double theRadius) throws GeoException
theLocation - the locationtheRadius - radius around the locationGeoExceptionlong nearbySize(org.locationtech.spatial4j.shape.Point theLocation,
double theRadius)
throws GeoException
theLocation - the locationtheRadius - radius around the locationGeoExceptionOptional<Feature> get(long theId) throws GeoException
theId - the id of the shape to retrieveGeoException - if there is an error getting the shapevoid add(Feature theShape) throws GeoException
theShape - the shape to addGeoException - if there was an error while adding the shape to the indexvoid add(Iterable<Feature> theShapes) throws GeoException
theShapes - the shapes to addGeoException - if there was an error adding the shapes to the indexvoid update(Feature theShape) throws GeoException
theShape - the shape to addGeoException - if there was an error while adding the shape to the indexvoid clear()
throws GeoException
GeoException - if there was an error clearing the indexvoid remove(Feature theShape) throws GeoException
theShape - the feature to removeGeoException - if there was an error while removingvoid remove(Iterable<Feature> theShape) throws GeoException
theShape - the features to removeGeoException - if there was an error during removalvoid begin()
throws GeoException
GeoException - if there was an error while starting the transactionvoid prepare()
throws GeoException
GeoException - if there was an error while preparingvoid commit()
throws GeoException
GeoException - if there is an error while committingvoid rollback()
throws GeoException
GeoException - if there is an error while rolling backIterator<Feature> iterator() throws GeoException
GeoExceptionCopyright © 2010-2016 Stardog Union. All Rights Reserved.