Did you know ... Search Documentation:
Pack space -- prolog/space/space.pl
PublicShow source
 set_space(+Option) is det
 set_space(+IndexName, +Option) is det
This predicate can be used to change the options of a spatial index (or de default index for set_space/1). Some options, like rtree_storage(S) where S is disk or memory only have effect after clearing or bulkloading. Others, take effect immediately on a running index. More documentation will be provided in the near future.
 space_assert(+URI, +Shape, +IndexName) is det
 space_assert(+URI, +Shape) is det
Insert URI with associated Shape in the queue to be inserted into the index with name IndexName or the default index. Indexing happens lazily at the next call of a query or manually by calling space_index/1.
 space_retract(+URI, +Shape, +IndexName) is det
 space_retract(+URI, +Shape) is det
Insert URI with associated Shape in the queue to be removed into the index with name IndexName or the default index. Indexing happens lazily at the next call of a query or manually by calling space_index/1.
 space_index(+IndexName) is det
 space_index is det
Processes all asserts or retracts in the space queue for index IndexName or the default index if no index is specified.
 space_clear(+IndexName) is det
 space_clear is det
Clears index IndexName or the default index if no index is specified, removing all of its contents.
 space_bulkload(:Closure, +IndexName) is det
 space_bulkload(:Closure) is det
 space_bulkload is det
Fast loading of many Shapes into the index IndexName. Closure is called with two additional arguments: URI and Shape, that finds candidate URI-Shape pairs to index in the index IndexName.

space_bulkload/0 defaults to uri_shape/2 for :Closure.

See also
- the uri_shape/2 predicate for an example of a suitable functor.
 space_contains(+Query, ?Cont, +IndexName) is nondet
 space_contains(+Query, ?Cont) is nondet
Containment query. Unifies Cont with shapes contained in Query Shape (or shape of Query URI) according to index IndexName or the default index.
 space_intersects(+Query, ?Inter, +IndexName) is nondet
 space_intersects(+Query, ?Inter) is nondet
Intersection query. Unifies Inter with shapes intersecting with Query Shape (or Shape of Query URI) according to index IndexName or the default index. (intersection subsumes containment)
 space_nearest(+Query, -Near, +IndexName) is nondet
 space_nearest(+Query, -Near) is nondet
Incremental Nearest-Neighbor query. Unifies Near with shapes in order of increasing distance to Query Shape (or Shape of Query URI) according to index IndexName or the default index.
 uri_shape(?URI, ?Shape) is nondet
Finds pairs of URIs and their corresponding Shapes based on WGS84 RDF properties (e.g. wgs84:lat), GeoRSS Simple properties (e.g. georss:polygon), and GeoRSS GML properties (e.g. georss:where).

uri_shape/2 is a dynamic predicate, which means it can be extended. If you use uri_shape/2 in this way, the URI argument has to be a canonical URI, not a QName.

 uri_shape(?URI, ?Shape, +Source) is nondet
Finds pairs of URIs and their corresponding Shapes using RDF that was loaded from a given Source. Unify Shape with the shape present in the spatial index, if none is found there, try to find the shape using rhe rdf database and the builtin conversions. If the builtin conversions fail, try the rdfuri_shape/3 hook provided by the user.

Otherwise, fails silently.

 space_index_all(+IndexName) is det
 space_index_all is det
Loads all URI-Shape pairs found with uri_shape/2 into index IndexName or the default index name.
 shape(+Shape) is det
Checks whether Shape is a valid supported shape.
 space_distance(+Point1, +Point2, -Distance) is det
Calculates the distance between Point1 and Point2 by default using pythagorean distance.
See also
- space_distance_greatcircle/4 for great circle distance.
 space_distance_greatcircle(+Point1, +Point2, -Dist) is det
 space_distance_greatcircle(+Point1, +Point2, -Dist, +Unit) is det
Calculates great circle distance between Point1 and Point2 in the specified Unit, which can take as a value km (kilometers) or nm (nautical miles). By default, nautical miles are used.
 space_nearest(+Query, ?Near, +WithinRange, +IndexName) is nondet
 space_nearest(+Query, ?Near, +WithinRange) is nondet
Incremental Nearest-Neighbor query with a bounded distance scope. Unifies Near with shapes in order of increasing distance to Query Shape (or Shape of Query URI) according to index IndexName or the default index. Fails when no more objects are within the range WithinRange.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 set_space(Arg1, Arg2)
 space_setting(Arg1)
 space_index_all
 space_assert(Arg1, Arg2)
 space_retract(Arg1, Arg2)
 space_index
 space_clear
 space_bulkload(Arg1)
 space_bulkload
 space_contains(Arg1, Arg2)
 space_intersects(Arg1, Arg2)
 space_nearest(Arg1, Arg2)
 space_within_range(Arg1, Arg2, Arg3, Arg4)
 space_within_range(Arg1, Arg2, Arg3)
 space_nearest_bounded(Arg1, Arg2, Arg3, Arg4)
 space_nearest_bounded(Arg1, Arg2, Arg3)
 uri_shape_graph(Arg1, Arg2, Arg3)
 space_distance(Arg1, Arg2, Arg3, Arg4)
 space_distance_pythagorean(Arg1, Arg2, Arg3)
 space_distance_greatcircle(Arg1, Arg2, Arg3, Arg4)
 space_bearing(Arg1, Arg2, Arg3)