protocol
geohash_protocol
Geohash predicates protocol.
logtalk_load(geohash(loader))staticPublic predicates
valid_geohash/1
True when the argument is a non-empty geohash atom using the standard geohash base-32 alphabet 0123456789bcdefghjkmnpqrstuvwxyz.
staticvalid_geohash(Geohash)valid_geohash(+atom) - zero_or_oneencode/3
Encodes a geographic coordinate represented as geographic(Latitude,Longitude) into a geohash atom with the given precision in characters. Longitude is canonicalized to the [-180.0,180.0[ range, so 180.0 is treated as -180.0.
staticencode(Coordinate,Precision,Geohash)encode(+compound,+positive_integer,-atom) - zero_or_onedecode/2
Decodes a geohash atom into the center geographic coordinate of the represented cell.
staticdecode(Geohash,Coordinate)decode(+atom,-compound) - zero_or_onebounding_box/2
Decodes a geohash atom into its geographic bounding box represented as bbox(geographic(MinLatitude,MinLongitude),geographic(MaxLatitude,MaxLongitude)).
staticbounding_box(Geohash,BoundingBox)bounding_box(+atom,-compound) - zero_or_oneprecision/3
Returns the maximum latitude and longitude errors in degrees for geohashes of the given precision in characters.
staticprecision(Precision,LatitudeError,LongitudeError)precision(+positive_integer,-float,-float) - zero_or_onecell_dimensions/3
Returns the latitude and longitude spans in degrees of a geohash cell for the given precision in characters.
staticcell_dimensions(Precision,LatitudeSpan,LongitudeSpan)cell_dimensions(+positive_integer,-float,-float) - zero_or_oneadjacent/3
Returns the adjacent geohash in the given direction. Supported directions are north, south, east, west, north_east, north_west, south_east, and south_west. Eastward and westward adjacency wraps across the antimeridian using the same longitude canonicalization as encode/3. Northward and southward adjacency fails when there is no neighboring cell beyond the poles.
staticadjacent(Geohash,Direction,AdjacentGeohash)adjacent(+atom,+atom,-atom) - zero_or_oneneighbors/2
Returns the available neighboring geohashes as Direction-Geohash pairs in clockwise order starting at north.
staticneighbors(Geohash,Neighbors)neighbors(+atom,-list(compound)) - zero_or_onecovering/3
Returns the list of geohashes at the given precision whose cells cover a geographic bounding box represented as bbox(geographic(MinLatitude,MinLongitude),geographic(MaxLatitude,MaxLongitude)). Degenerate point bounding boxes and exact cell-aligned boundaries are accepted. Antimeridian-crossing bounding boxes are accepted.
staticcovering(BoundingBox,Precision,Geohashes)covering(+compound,+positive_integer,-list(atom)) - zero_or_onecovering/4
Returns a geohash cover for a geographic bounding box. CoverSpec is either precision(Precision) for a fixed-depth cover or max_precision(MaxPrecision) for an adaptive mixed-depth cover. Options may include compact(Boolean) and min_precision(PositiveInteger).
staticcovering(BoundingBox,CoverSpec,Geohashes,Options)covering(+compound,+compound,-list(atom),++list(compound)) - zero_or_onecompress/2
Compresses a list of geohashes by replacing complete sibling sets with their parent prefix while preserving the covered area.
staticcompress(Geohashes,CompressedGeohashes)compress(+list(atom),-list(atom)) - zero_or_oneparent/2
Returns the immediate parent prefix of a geohash. Fails for precision-1 geohashes.
staticparent(Geohash,Parent)parent(+atom,-atom) - zero_or_onechildren/2
Returns the 32 child geohashes of a geohash in standard geohash base-32 order.
staticchildren(Geohash,Children)children(+atom,-list(atom)) - zero_or_onecommon_prefix/3
Returns the longest common geohash prefix shared by two geohashes. The prefix may be the empty atom when the geohashes share no leading characters.
staticcommon_prefix(Geohash1,Geohash2,Prefix)common_prefix(+atom,+atom,-atom) - zero_or_oneencode_int/3
Encodes a geographic coordinate into an integer geohash representation at the given precision in characters.
staticencode_int(Coordinate,Precision,HashInteger)encode_int(+compound,+positive_integer,-integer) - zero_or_onedecode_int/3
Decodes an integer geohash representation at the given precision into the center geographic coordinate of the represented cell.
staticdecode_int(HashInteger,Precision,Coordinate)decode_int(+integer,+positive_integer,-compound) - zero_or_onebounding_box_int/3
Decodes an integer geohash representation at the given precision into its geographic bounding box.
staticbounding_box_int(HashInteger,Precision,BoundingBox)bounding_box_int(+integer,+positive_integer,-compound) - zero_or_oneadjacent_int/4
Returns the adjacent integer geohash at the same precision in the given direction.
staticadjacent_int(HashInteger,Precision,Direction,AdjacentHashInteger)adjacent_int(+integer,+positive_integer,+atom,-integer) - zero_or_oneneighbors_int/3
Returns the available neighboring integer geohashes as Direction-HashInteger pairs in clockwise order starting at north.
staticneighbors_int(HashInteger,Precision,Neighbors)neighbors_int(+integer,+positive_integer,-list(compound)) - zero_or_onegeohash_to_int/2
Converts a geohash atom to its packed integer representation using five bits per character.
staticgeohash_to_int(Geohash,HashInteger)geohash_to_int(+atom,-integer) - zero_or_oneint_to_geohash/3
Converts a packed integer geohash representation and an explicit precision in characters to a geohash atom.
staticint_to_geohash(HashInteger,Precision,Geohash)int_to_geohash(+integer,+positive_integer,-atom) - zero_or_oneencode_bits/3
Encodes a geographic coordinate into an integer geohash representation using the given bit precision.
staticencode_bits(Coordinate,Bits,HashInteger)encode_bits(+compound,+positive_integer,-integer) - zero_or_onedecode_bits/3
Decodes an integer geohash representation at the given bit precision into the center geographic coordinate of the represented cell.
staticdecode_bits(HashInteger,Bits,Coordinate)decode_bits(+integer,+positive_integer,-compound) - zero_or_onebounding_box_bits/3
Decodes an integer geohash representation at the given bit precision into its geographic bounding box.
staticbounding_box_bits(HashInteger,Bits,BoundingBox)bounding_box_bits(+integer,+positive_integer,-compound) - zero_or_oneadjacent_bits/4
Returns the adjacent integer geohash at the same bit precision in the given direction.
staticadjacent_bits(HashInteger,Bits,Direction,AdjacentHashInteger)adjacent_bits(+integer,+positive_integer,+atom,-integer) - zero_or_oneneighbors_bits/3
Returns the available neighboring integer geohashes as Direction-HashInteger pairs in clockwise order starting at north for the given bit precision.
staticneighbors_bits(HashInteger,Bits,Neighbors)neighbors_bits(+integer,+positive_integer,-list(compound)) - zero_or_oneexpand/2
Returns the geohash followed by its available neighbors in clockwise order starting at north.
staticexpand(Geohash,ExpandedGeohashes)expand(+atom,-list(atom)) - zero_or_oneexpand_int/3
Returns the integer geohash followed by its available neighboring integer geohashes in clockwise order starting at north.
staticexpand_int(HashInteger,Precision,ExpandedHashes)expand_int(+integer,+positive_integer,-list(integer)) - zero_or_onepolygon_covering/4
Returns a geohash cover for a polygon represented as a list of geographic coordinates. CoverSpec is either precision(Precision) for a fixed-depth cover or max_precision(MaxPrecision) for an adaptive mixed-depth cover. Options may include compact(Boolean) and min_precision(PositiveInteger). Antimeridian-crossing polygons are not supported.
staticpolygon_covering(Polygon,CoverSpec,Geohashes,Options)polygon_covering(+list(compound),+compound,-list(atom),++list(compound)) - zero_or_onepolyline_covering/4
Returns a geohash cover for a polyline represented as a list of two or more geographic coordinates. CoverSpec is either precision(Precision) for a fixed-depth cover or max_precision(MaxPrecision) for an adaptive mixed-depth cover. Options may include compact(Boolean), min_precision(PositiveInteger), and buffer(Distance) where the buffer distance is given in kilometers. Antimeridian-crossing polylines are not supported.
staticpolyline_covering(Polyline,CoverSpec,Geohashes,Options)polyline_covering(+list(compound),+compound,-list(atom),++list(compound)) - zero_or_oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)
See also