protocol
geojson_protocol
GeoJSON (RFC 7946) parser, generator, and validator protocol.
logtalk_load(geojson(loader))staticPublic predicates
parse/2
Parses a GeoJSON document from the given source (file(Path), stream(Stream), codes(List), chars(List), or atom(Atom)) into a native GeoJSON term.
staticparse(Source,Term)parse(++compound,--term) - one_or_errorSource is a variable:instantiation_errorSource is neither a variable nor a valid source:domain_error(geojson_source,Source)domain_error(geojson,Document)generate/2
Generates GeoJSON content using the representation specified in the first argument (file(Path), stream(Stream), codes(List), chars(List), or atom(Atom)) from a native GeoJSON term.
staticgenerate(Sink,Term)generate(+compound,++term) - one_or_errorSink is a variable:instantiation_errorSink is neither a variable nor a valid sink:domain_error(geojson_sink,Sink)Term is not a valid GeoJSON term:domain_error(geojson,Term)validate/1
True iff the argument is a valid native GeoJSON term according to RFC 7946.
staticvalidate(Term)validate(@term) - zero_or_onevalidate/2
Validates a native GeoJSON term returning a list of reason terms whose final argument is the failing path.
staticvalidate(Term,Errors)validate(@term,-list(compound)) - one_or_error
invalid_geojson_term(Path): The term is not any supported GeoJSON geometry, feature, or feature collection representation.
invalid_geometry(Path): A geometry member is neither a valid geometry term nor
@nullwhere@nullis allowed.invalid_properties(Path): A feature properties member is neither
@nullnor a valid JSON object term in the selected representation.invalid_options(Path): The options argument is not a list.
option_not_allowed(Name, Path): An option with the given name is not allowed for the enclosing GeoJSON term.
duplicate_option(Name, Path): The same option name occurs more than once in the options list.
unknown_option(Option, Path): An option term is not recognized as one of the supported options.
invalid_bbox(Path): A bounding box is not a list of four or six numbers.
bbox_longitude_out_of_range(Path): A bounding box longitude value lies outside the RFC 7946 range
[-180,180].bbox_latitude_out_of_range(Path): A bounding box latitude value lies outside the RFC 7946 range
[-90,90].bbox_latitude_order(Path): The south latitude value is greater than the north latitude value in a bounding box.
bbox_altitude_order(Path): The minimum altitude value is greater than the maximum altitude value in a three-dimensional bounding box.
bbox_dimension_mismatch(Actual, Expected, Path): A bounding box length does not match the dimensionality required by the represented geometry, feature, or collection.
invalid_id(Path): A feature identifier is neither a number nor a valid string term in the selected representation.
invalid_foreign_members(Path): Foreign members are not represented as a valid pair list or embedded JSON object term, or contain an invalid pair term.
prohibited_member(Key, Path): A prohibited foreign member name such as
crswas used.reserved_foreign_member(Key, Path): A reserved GeoJSON member name was used as a foreign member key.
invalid_position(Path): A position is not a list of at least two numeric coordinates.
position_longitude_out_of_range(Path): A position longitude value lies outside the RFC 7946 range
[-180,180].position_latitude_out_of_range(Path): A position latitude value lies outside the RFC 7946 range
[-90,90].invalid_json_object_pair(Path): A JSON object member is not represented using a supported key-value pair term.
invalid_json_key(Path): A JSON object key is not a valid string term in the selected representation.
duplicate_json_object_key(Key, Path): The same JSON object key occurs more than once in the same object.
invalid_json_value(Path): A JSON value is not a number, boolean, null, valid string term, array, or object term.
insufficient_positions(MinimumLength, Path): A coordinate array contains fewer positions than required for the enclosing geometry.
invalid_position_array(Path): A coordinate array expected to contain positions is not a list of valid positions.
inconsistent_position_dimension(Path): Positions in the same coordinate array do not all have the same dimensionality.
invalid_line_string_array(Path): A MultiLineString coordinate array is not a valid list of line string coordinate arrays.
invalid_polygon(Path): A polygon coordinate structure is invalid, for example because it is not a non-empty list of linear rings.
ring_not_closed(Path): A linear ring does not repeat its first position as its last position.
invalid_multi_polygon(Path): A MultiPolygon coordinate array is not a valid list of polygon coordinate arrays.
invalid_geometry_collection(Path): A GeometryCollection geometries member is not a list.
invalid_feature_collection(Path): A FeatureCollection features member is not a list.
invalid_feature(Path): A value inside a FeatureCollection is not a valid feature term.
json_to_geojson/2
Converts a JSON term, as returned by the json library, into a native GeoJSON term.
staticjson_to_geojson(JSON,GeoJSON)json_to_geojson(+term,-term) - one_or_errorJSON is a variable:instantiation_errorJSON is not a valid GeoJSON JSON term:domain_error(geojson,JSON)geojson_to_json/2
Converts a native GeoJSON term into a JSON term suitable for the json library.
staticgeojson_to_json(GeoJSON,JSON)geojson_to_json(+term,-term) - one_or_errorGeoJSON is a variable:instantiation_errorGeoJSON is not a valid GeoJSON term:domain_error(geojson,GeoJSON)Protected predicates
(none)
Private predicates
(none)
Operators
(none)
See also