API
Functions
#
GeoInterface.area
— Method
area(geom) -> Number
Return the area of geom
in its 2d coordinate system. Note that this is only valid for AbstractSurfaceTrait
s.
#
GeoInterface.asbinary
— Method
asbinary(geom) -> WKB
Convert geom
into Well Known Binary (WKB) representation, such as 000000000140000000000000004010000000000000
.
#
GeoInterface.astext
— Method
astext(geom) -> WKT
Convert geom
into Well Known Text (WKT) representation, such as POINT (30 10)
.
#
GeoInterface.boundary
— Method
boundary(geom) -> Curve
Return the boundary of geom
. Note that this is only valid for AbstractSurfaceTrait
s.
#
GeoInterface.boundingpolygons
— Method
boundingpolygons(geom, i) -> AbstractMultiPolygon
Returns the collection of polygons in this surface that bounds the i
th patch in the given geom
.
#
GeoInterface.buffer
— Method
buffer(geom, distance) -> AbstractGeometry
Returns a geometric object that represents a buffer of the given geom
with distance
.
#
GeoInterface.centroid
— Method
centroid(geom) -> Point
The mathematical centroid for this Surface as a Point. The result is not guaranteed to be on this Surface. Note that this is only valid for AbstractSurfaceTrait
s.
#
GeoInterface.convert
— Method
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.
#
GeoInterface.convexhull
— Method
convexhull(geom) -> AbstractCurve
Returns a geometric object that represents the convex hull of the given geom
.
#
GeoInterface.coordinates
— Method
coordinates(geom) -> Vector
Return (an iterator of) point coordinates. Ensures backwards compatibility with GeoInterface version 0.
#
GeoInterface.coordnames
— Method
coordnames(geom) -> Tuple{Symbol}
Return the names of coordinate dimensions (such for (:X,:Y,:Z)) for the geometry.
#
GeoInterface.crs
— Method
crs(geom) -> T <: GeoFormatTypes.CoordinateReferenceSystemFormat
Retrieve Coordinate Reference System for given geom. In SF this is defined as SRID
.
#
GeoInterface.difference
— Method
difference(a, b) -> AbstractGeometry
Returns a geometric object that represents the Point set difference of a
with b
#
GeoInterface.disjoint
— Method
disjoint(a, b) -> Bool
Returns whether a
and b
are disjoint. Inverse of intersects
.
#
GeoInterface.distance
— Method
distance(a, b) -> Number
Returns the shortest distance between a
with b
.
#
GeoInterface.endpoint
— Method
endpoint(geom) -> Point
Return the last point in the geom
. Note that this is only valid for AbstractCurveTrait
s.
#
GeoInterface.extent
— Method
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
.
#
GeoInterface.geometry
— Method
GeoInterface.geometry(feat) => geom
Retrieve the geometry of feat
. It is expected that isgeometry(geom) === true
. Ensures backwards compatibility with GeoInterface version 0.
#
GeoInterface.geometrycolumns
— Method
GeoInterface.geometrycolumns(featurecollection) => (:geometry,)
Retrieve the geometrycolumn(s) of featurecollection
; the fields (or columns in a table) which contain geometries that support GeoInterface.
#
GeoInterface.geomtrait
— Method
GeoInterface.geomtrait(geom) => T <: AbstractGeometry
Returns the geometry type, such as PolygonTrait
or PointTrait
.
#
GeoInterface.getcoord
— Method
getcoord(geom, i) -> Number
Return the i
th coordinate for a given geom
. A coordinate isa Real
. Note that this is only valid for individual AbstractPointTrait
s.
#
GeoInterface.getcoord
— Method
getcoord(geom) -> iterator
#
GeoInterface.getexterior
— Method
getexterior(geom) -> Curve
Returns the exterior ring of a Polygon as a AbstractCurve
. Note that this is only valid for AbstractPolygonTrait
s.
#
GeoInterface.getfeature
— Method
GeoInterface.getfeature(collection) => [feature, ...]
Retrieve the features of collection
as some iterable of features. It is expected that isfeature(feature) === true
.
#
GeoInterface.getgeom
— Method
getgeom(geom, i::Integer) -> AbstractGeometry
Returns the i
th geometry for the given geom
.
#
GeoInterface.getgeom
— Method
getgeom(geom) -> iterator
Returns an iterator over all geometry components in geom
.
#
GeoInterface.gethole
— Method
gethole(geom, i::Integer) -> Curve
Returns the i
th interior ring for this given geom
. Note that this is only valid for AbstractPolygonTrait
s.
#
GeoInterface.gethole
— Method
gethole(geom) -> iterator
Returns an iterator over all holes in geom
. Note that this is only valid for AbstractPolygonTrait
s.
#
GeoInterface.getlinestring
— Method
getlinestring(geom, i::Integer) -> AbstractCurve
Returns the i
th linestring for the given geom
. Note that this is only valid for AbstractMultiLineStringTrait
s.
#
GeoInterface.getlinestring
— Method
getlinestring(geom) -> iterator
Returns an iterator over all linestrings in a geometry. Note that this is only valid for AbstractMultiLineStringTrait
s.
#
GeoInterface.getpatch
— Method
getpatch(geom, i::Integer) -> AbstractPolygon
Returns the i
th patch for the given geom
. Note that this is only valid for AbstractPolyhedralSurfaceTrait
s.
#
GeoInterface.getpatch
— Method
getpatch(geom) -> iterator
Returns an iterator over all patches in geom
. Note that this is only valid for AbstractPolyhedralSurfaceTrait
s.
#
GeoInterface.getpoint
— Method
getpoint(geom, i::Integer) -> Point
Return the i
th Point in given geom
. Note that this is only valid for AbstractCurveTrait
s and AbstractMultiPointTrait
s.
#
GeoInterface.getpoint
— Method
getpoint(geom) -> iterator
Returns an iterator over all points in geom
.
#
GeoInterface.getpolygon
— Method
getpolygon(geom, i::Integer) -> AbstractCurve
Returns the i
th polygon for the given geom
. Note that this is only valid for AbstractMultiPolygonTrait
s.
#
GeoInterface.getpolygon
— Method
getpolygon(geom) -> iterator
Returns an iterator over all polygons in a geometry. Note that this is only valid for AbstractMultiPolygonTrait
s.
#
GeoInterface.getring
— Method
getring(geom, i::Integer) -> AbstractCurve
A specific ring i
in a polygon or multipolygon (exterior and holes). Note that this is only valid for AbstractPolygonTrait
s and AbstractMultiPolygonTrait
s.
#
GeoInterface.getring
— Method
getring(geom) -> iterator
Returns an iterator over all rings in geom
. Note that this is only valid for AbstractPolygonTrait
s and AbstractMultiPolygonTrait
s in single-argument form.
#
GeoInterface.intersection
— Method
intersection(a, b) -> AbstractGeometry
Returns a geometric object that represents the Point set intersection of a
with b
#
GeoInterface.isclosed
— Method
isclosed(geom) -> Bool
Return whether the geom
is closed, i.e. whether the startpoint
is the same as the endpoint
. Note that this is only valid for AbstractCurveTrait
s.
#
GeoInterface.isfeature
— Method
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.
#
GeoInterface.isfeaturecollection
— Method
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.
#
GeoInterface.isgeometry
— Method
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.
#
GeoInterface.ismeasured
— Method
ismeasured(geom) -> Bool
Return whether the given geom
has a :M coordinate.
#
GeoInterface.isring
— Method
isring(geom) -> Bool
Return whether the geom
is a ring, i.e. whether the geom
isclosed
and issimple
. Note that this is only valid for AbstractCurveTrait
s.
#
GeoInterface.issimple
— Method
issimple(geom) -> Bool
Return true
when the geometry is simple, i.e. doesn’t cross or touch itself.
#
GeoInterface.length
— Method
length(geom) -> Number
Return the length of geom
in its 2d coordinate system. Note that this is only valid for AbstractCurveTrait
s.
#
GeoInterface.m
— Method
m(geom) -> Number
Return the :M (measured) coordinate of the given geom
. Note that this is only valid for AbstractPointTrait
s.
For length 4 Tuple
and Vector
points, the fouth value is returned.
Length 3 Tuple
and Vector
points can not represent measured points, and will throw an ArgumentError
.
#
GeoInterface.ncoord
— Method
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.
#
GeoInterface.nfeature
— Method
GeoInterface.nfeature(collection)
Retrieve the number of features in a feature collection.
#
GeoInterface.ngeom
— Method
ngeom(geom) -> Integer
Returns the number of geometries for the given geom
.
#
GeoInterface.nhole
— Method
nhole(geom) -> Integer
Returns the number of holes for this given geom
. Note that this is only valid for AbstractPolygonTrait
s.
#
GeoInterface.nlinestring
— Method
nlinestring(geom) -> Integer
Returns the number of curves for the given geom
. Note that this is only valid for AbstractMultiLineStringTrait
s.
#
GeoInterface.npatch
— Method
npatch(geom)
Returns the number of patches for the given geom
. Note that this is only valid for AbstractPolyhedralSurfaceTrait
s.
#
GeoInterface.npoint
— Method
npoint(geom) -> Int
Return the number of points in given geom
. Note that this is only valid for AbstractCurveTrait
s and AbstractMultiPointTrait
s.
#
GeoInterface.npolygon
— Method
npolygon(geom) -> Integer
Returns the number of polygons for the given geom
. Note that this is only valid for AbstractMultiPolygonTrait
s.
#
GeoInterface.nring
— Method
nring(geom) -> Integer
Return the number of rings in given geom
. Note that this is only valid for AbstractPolygonTrait
s and AbstractMultiPolygonTrait
s
#
GeoInterface.overlaps
— Method
overlaps(a, b) -> Bool
Returns whether a
and b
overlap. Also called covers
in DE-9IM.
#
GeoInterface.pointonsurface
— Method
pointonsurface(geom) -> Point
A Point guaranteed to be on this geometry (as opposed to centroid
). Note that this is only valid for AbstractSurfaceTrait
s.
#
GeoInterface.properties
— Method
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.
#
GeoInterface.relate
— Method
relate(a, b, relationmatrix::String) -> Bool
Returns whether a
and b
relate, based on the provided relation matrix.
#
GeoInterface.startpoint
— Method
startpoint(geom) -> Point
Return the first point in the geom
. Note that this is only valid for AbstractCurveTrait
s.
#
GeoInterface.subtrait
— Method
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
#
GeoInterface.symdifference
— Method
symdifference(a, b) -> AbstractGeometry
Returns a geometric object that represents the Point set symmetric difference of a
with b
.
#
GeoInterface.testfeature
— Method
testfeature(feature)
Test whether the required interface for your feature
has been implemented correctly.
#
GeoInterface.testfeaturecollection
— Method
testfeaturecollection(featurecollection)
Test whether the required interface for your featurecollection
has been implemented correctly.
#
GeoInterface.testgeometry
— Method
testgeometry(geom)
Test whether the required interface for your geom
has been implemented correctly.
#
GeoInterface.trait
— Method
GeoInterface.trait(geom) => T <: AbstractGeometry
Returns the object type, such as FeatureTrait
. For all isgeometry
objects trait
is the same as geomtrait(obj)
, e.g. PointTrait
.
#
GeoInterface.union
— Method
union(a, b) -> AbstractGeometry
Returns a geometric object that represents the Point set union of a
with b
#
GeoInterface.x
— Method
x(geom) -> Number
Return the :X coordinate of the given geom
. Note that this is only valid for AbstractPointTrait
s.
For Tuple
and Vector
points, the first value is returned.
#
GeoInterface.y
— Method
y(geom) -> Number
Return the :Y coordinate of the given geom
. Note that this is only valid for AbstractPointTrait
s.
For Tuple
and Vector
points, the second value is returned.
#
GeoInterface.z
— Method
z(geom) -> Number
Return the :Z coordinate of the given geom
. Note that this is only valid for AbstractPointTrait
s.
For length 3 Tuple
and Vector
points, the third value is returned.
Types
#
GeoInterface.AbstractCurvePolygonTrait
— Type
An AbstractCurvePolygonTrait type for all curved polygons.
#
GeoInterface.AbstractCurveTrait
— Type
An AbstractCurveTrait type for all curves.
#
GeoInterface.AbstractFeatureCollectionTrait
— Type
An AbstractFeatureCollectionTrait for all feature collections
#
GeoInterface.AbstractFeatureTrait
— Type
An AbstractFeatureTrait for all features
#
GeoInterface.AbstractGeometryCollectionTrait
— Type
An AbstractGeometryCollectionTrait type for all geometrycollections.
#
GeoInterface.AbstractGeometryTrait
— Type
An AbstractGeometryTrait type for all geometries.
#
GeoInterface.AbstractLineStringTrait
— Type
An AbstractLineString type for all linestrings.
#
GeoInterface.AbstractMultiCurveTrait
— Type
An AbstractMultiCurveTrait type for all multicurves.
#
GeoInterface.AbstractMultiLineStringTrait
— Type
An AbstractMultiLineStringTrait type for all multilinestrings.
#
GeoInterface.AbstractMultiPointTrait
— Type
An AbstractMultiPointTrait type for all multipoints.
#
GeoInterface.AbstractMultiPolygonTrait
— Type
An AbstractMultiPolygonTrait type for all multipolygons.
#
GeoInterface.AbstractMultiSurfaceTrait
— Type
An AbstractMultiSurfaceTrait type for all multisurfaces.
#
GeoInterface.AbstractPointTrait
— Type
An AbstractPointTrait for all points.
#
GeoInterface.AbstractPolygonTrait
— Type
An AbstractPolygonTrait type for all polygons.
#
GeoInterface.AbstractPolyhedralSurfaceTrait
— Type
An AbstractPolyhedralSurfaceTrait type for all polyhedralsurfaces.
#
GeoInterface.AbstractSurfaceTrait
— Type
An AbstractSurfaceTrait type for all surfaces.
#
GeoInterface.AbstractTrait
— Type
An AbstractTrait type for all geometries, features and feature collections.
#
GeoInterface.CircularStringTrait
— Type
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.
#
GeoInterface.CompoundCurveTrait
— Type
A CompoundCurveTrait is a curve that combines straight LineStringTrait
s and curved CircularStringTrait
s.
#
GeoInterface.CurvePolygonTrait
— Type
An AbstractCurvePolygonTrait
that can contain either circular or straight curves as rings.
#
GeoInterface.FeatureCollectionTrait
— Type
A FeatureCollectionTrait holds objects of FeatureTrait
and an extent
#
GeoInterface.FeatureTrait
— Type
A FeatureTrait holds geometries
, properties
and an extent
#
GeoInterface.GeometryCollectionTrait
— Type
A GeometryCollection is a collection of Geometry
s.
#
GeoInterface.HexagonTrait
— Type
A PolygonTrait
with six vertices.
#
GeoInterface.LineStringTrait
— Type
A LineStringTrait is a collection of straight lines between its PointTrait
s.
#
GeoInterface.LineTrait
— Type
A LineTrait is LineStringTrait
with just two points.
#
GeoInterface.LinearRingTrait
— Type
A LinearRingTrait is a LineStringTrait
with the same begin and endpoint.
#
GeoInterface.MultiCurveTrait
— Type
A MultiCurveTrait is a collection of CircularStringTrait
s.
#
GeoInterface.MultiLineStringTrait
— Type
A MultiLineStringTrait is a collection of LineStringTrait
s.
#
GeoInterface.MultiPointTrait
— Type
A MultiPointTrait is a collection of PointTrait
s.
#
GeoInterface.MultiPolygonTrait
— Type
A MultiPolygonTrait is a collection of PolygonTrait
s.
#
GeoInterface.MultiSurfaceTrait
— Type
A MultiSurfaceTrait is a collection of AbstractSurfaceTrait
s.
#
GeoInterface.PentagonTrait
— Type
A PolygonTrait
with five vertices.
#
GeoInterface.PointTrait
— Type
A single point.
#
GeoInterface.PolygonTrait
— Type
An AbstractSurfaceTrait
with straight rings either as exterior or interior(s).
#
GeoInterface.PolyhedralSurfaceTrait
— Type
A PolyhedralSurfaceTrait is a connected surface consisting of PolygonTrait
s.
#
GeoInterface.QuadTrait
— Type
A PolygonTrait
with four vertices.
#
GeoInterface.RectangleTrait
— Type
A PolygonTrait
that is rectangular and could be described by the minimum and maximum vertices.
#
GeoInterface.TINTrait
— Type
A TINTrait is a PolyhedralSurfaceTrait
consisting of TriangleTrait
s.
#
GeoInterface.TriangleTrait
— Type
A PolygonTrait
that is triangular.