API

Functions

GeoInterface.asbinaryMethod
asbinary(geom) -> WKB

Convert geom into Well Known Binary (WKB) representation, such as 000000000140000000000000004010000000000000.

source
GeoInterface.astextMethod
astext(geom) -> WKT

Convert geom into Well Known Text (WKT) representation, such as POINT (30 10).

source
GeoInterface.bboxMethod
bbox(geom) -> T <: Extents.Extent

Alias for extent, for compatibility with GeoJSON and the Python geointerface. Ensures backwards compatibility with GeoInterface version 0.

source
GeoInterface.boundingpolygonsMethod
boundingpolygons(geom, i) -> AbstractMultiPolygon

Returns the collection of polygons in this surface that bounds the ith patch in the given geom.

source
GeoInterface.bufferMethod
buffer(geom, distance) -> AbstractGeometry

Returns a geometric object that represents a buffer of the given geom with distance.

source
GeoInterface.containsMethod
contains(a, b) -> Bool

Returns whether a contains b. The order of arguments is important. Equivalent to within with reversed arguments.

source
GeoInterface.convertMethod
convert(type::CustomGeom, geom)
convert(module::Module, geom)

Create a CustomGeom from any geom that implements the GeoInterface.

Can also convert to a Module, which finds the corresponding geom type for the trait using the modules geointerface_traittype method.

convert(T::Type) or convert(m::Module) return curried versions of that function, just like ==.

source
GeoInterface.convexhullMethod
convexhull(geom) -> AbstractCurve

Returns a geometric object that represents the convex hull of the given geom.

source
GeoInterface.coordinatesMethod
coordinates(geom) -> Vector

Return (an iterator of) point coordinates. Ensures backwards compatibility with GeoInterface version 0.

source
GeoInterface.coordnamesMethod
coordnames(geom) -> Tuple{Symbol}

Return the names of coordinate dimensions (such for (:X,:Y,:Z)) for the geometry.

source
GeoInterface.crsMethod
crs(geom) -> T <: GeoFormatTypes.CoordinateReferenceSystemFormat

Retrieve Coordinate Reference System for given geom. In SF this is defined as SRID.

source
GeoInterface.crstraitMethod
crstrait(geom) -> AbstractCRSTrait

Retrieves the type of the Coordinate Reference System for the given geom. Defaults to retrieving from crs(geom) and to UnknownTrait if not implemented.

source
GeoInterface.differenceMethod
difference(a, b) -> AbstractGeometry

Returns a geometric object that represents the Point set difference of a with b

source
GeoInterface.extentMethod
extent(obj; fallback=true) -> T <: Extents.Extent

Retrieve the extent (bounding box) for given geom or feature. In SF this is defined as envelope.

Extents.extent(obj) will be called if extent(trait(obj), obj), is not defined so it may be preferable to define Extents.extent directly.

When fallback is true, and the obj does not have an extent, an extent is calculated from the coordinates of all geometries in obj.

source
GeoInterface.geometryMethod
GeoInterface.geometry(feat) => geom

Retrieve the geometry of feat. It is expected that isgeometry(geom) === true. Ensures backwards compatibility with GeoInterface version 0.

source
GeoInterface.geometrycolumnsMethod
GeoInterface.geometrycolumns(featurecollection) => (:geometry,)

Retrieve the geometrycolumn(s) of featurecollection; the fields (or columns in a table) which contain geometries that support GeoInterface.

source
GeoInterface.getfeatureMethod
GeoInterface.getfeature(collection) => [feature, ...]

Retrieve the features of collection as some iterable of features. It is expected that isfeature(feature) === true.

source
GeoInterface.intersectionMethod
intersection(a, b) -> AbstractGeometry

Returns a geometric object that represents the Point set intersection of a with b

source
GeoInterface.isfeatureMethod
GeoInterface.isfeature(x) => Bool

Check if an object x is a feature and thus implicitly supports some GeoInterface methods. A feature is a combination of a geometry and properties, not unlike a row in a table. It is recommended that for users implementing MyType, they define only isfeature(::Type{MyType}). isfeature(::MyType) will then automatically delegate to this method.

Ensures backwards compatibility with GeoInterface version 0.

source
GeoInterface.isfeaturecollectionMethod
GeoInterface.isfeaturecollection(x) => Bool

Check if an object x is a collection of features and thus implicitly supports some GeoInterface methods. A feature collection is a collection of features, and may also contain metatdata for the whole collection, like an Extent.

It is recommended that for users implementing MyType, they define only isfeaturecollection(::Type{MyType}). isfeaturecollection(::MyType) will then automatically delegate to this method.

source
GeoInterface.isgeometryMethod
GeoInterface.isgeometry(x) => Bool

Check if an object x is a geometry and thus implicitly supports GeoInterface methods. It is recommended that for users implementing MyType, they define only isgeometry(::Type{MyType}). isgeometry(::MyType) will then automatically delegate to this method.

source
GeoInterface.israsterMethod
GeoInterface.israster(x) => Bool

Check if an object x is a raster and thus implicitly supports some GeoInterface methods. A raster requires the crs and extent methods to be defined.

It is recommended that for users implementing MyType, they define only israster(::Type{MyType}). israster(::MyType) will then automatically delegate to this method.

source
GeoInterface.issimpleMethod
issimple(geom) -> Bool

Return true when the geometry is simple, i.e. doesn't cross or touch itself.

source
GeoInterface.mMethod
m(geom) -> Number

Return the :M (measured) coordinate of the given geom. Note that this is only valid for AbstractPointTraits.

For length 4 Tuple and Vector points, the fourth value is returned.

Length 3 Tuple and Vector points can not represent measured points, and will throw an ArgumentError.

source
GeoInterface.ncoordMethod
ncoord(geom) -> Integer

Return the number of coordinate dimensions (such as 3 for X,Y,Z) for the geometry. Note that SF distinguishes between dimensions, spatial dimensions and topological dimensions, which we do not.

source
GeoInterface.propertiesMethod
GeoInterface.properties(feat) => properties

Retrieve the properties of feat. This can be any Iterable that behaves like an AbstractRow. Ensures backwards compatibility with GeoInterface version 0.

source
GeoInterface.relateMethod
relate(a, b, relationmatrix::String) -> Bool

Returns whether a and b relate, based on the provided relation matrix.

source
GeoInterface.subtraitMethod
subtrait(t::AbstractGeometryTrait)

Gets the expected, possible abstract, (sub)trait for subgeometries (retrieved with getgeom) of trait t. This follows the Type hierarchy of Simple Features.

Examples

julia> GeoInterface.subtrait(LineStringTrait())
AbstractPointTrait
julia> GeoInterface.subtrait(PolygonTrait())  # Any of LineStringTrait, LineTrait, LinearRingTrait
AbstractLineStringTrait
# `nothing` is returned when there's no subtrait or when it's not known beforehand
julia> isnothing(GeoInterface.subtrait(PointTrait()))
true
julia> isnothing(GeoInterface.subtrait(GeometryCollectionTrait()))
true
source
GeoInterface.symdifferenceMethod
symdifference(a, b) -> AbstractGeometry

Returns a geometric object that represents the Point set symmetric difference of a with b.

source
GeoInterface.unionMethod
union(a, b) -> AbstractGeometry

Returns a geometric object that represents the Point set union of a with b

source
GeoInterface.withinMethod
within(a, b) -> Bool

Returns whether a is within b. The order of arguments is important. Equivalent to contains with reversed arguments.

source
GeoInterface.xMethod
x(geom) -> Number

Return the :X coordinate of the given geom. Note that this is only valid for AbstractPointTraits.

For Tuple and Vector points, the first value is returned.

source
GeoInterface.yMethod
y(geom) -> Number

Return the :Y coordinate of the given geom. Note that this is only valid for AbstractPointTraits.

For Tuple and Vector points, the second value is returned.

source
GeoInterface.zMethod
z(geom) -> Number

Return the :Z coordinate of the given geom. Note that this is only valid for AbstractPointTraits.

For length 3 Tuple and Vector points, the third value is returned.

source

Types

GeoInterface.CircularStringTraitType

A CircularStringTrait is a curve, with an odd number of points. A single segment consists of three points, where the first and last are the beginning and end, while the second is halfway the curve.

source

Index