API · GeoInterface.jl (original) (raw)

Functions

[GeoInterface._get_dataapi_metadata](#GeoInterface.%5Fget%5Fdataapi%5Fmetadata-Union{Tuple{GeomType}, Tuple{GeomType, Any, Any}} where GeomType) — Method

Internal function.

Extended help

_get_dataapi_metadata(geom, key, default)

Get metadata associated with key key from some object, geom, that has DataAPI.jl metadata support.

If the object does not have metadata support, or the key does not exist, return default.

source

GeoInterface.area — Method

area(geom) -> Number

Return the area of geom in its 2d coordinate system. Note that this is only valid for AbstractSurfaceTraits.

source

GeoInterface.asbinary — Method

asbinary(geom) -> WKB

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

source

GeoInterface.astext — Method

astext(geom) -> WKT

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

source

GeoInterface.bbox — Method

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.boundary — Method

boundary(geom) -> Curve

Return the boundary of geom. Note that this is only valid for AbstractSurfaceTraits.

source

[GeoInterface.boundingpolygons](#GeoInterface.boundingpolygons-Tuple{Any, Any}) — Method

boundingpolygons(geom, i) -> AbstractMultiPolygon

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

source

[GeoInterface.buffer](#GeoInterface.buffer-Tuple{Any, Any}) — Method

buffer(geom, distance) -> AbstractGeometry

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

source

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 AbstractSurfaceTraits.

source

[GeoInterface.contains](#GeoInterface.contains-Tuple{Any, Any}) — Method

contains(a, b) -> Bool

Returns whether a contains b. The order of arguments is important. Equivalent to [within](#GeoInterface.within-Tuple{Any, Any}) with reversed arguments.

source

[GeoInterface.convert](#GeoInterface.convert-Tuple{Any, Any}) — 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.

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

source

GeoInterface.convexhull — Method

convexhull(geom) -> AbstractCurve

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

source

GeoInterface.coordinates — Method

coordinates(geom) -> Vector

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

source

GeoInterface.coordnames — Method

coordnames(geom) -> Tuple{Symbol}

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

source

[GeoInterface.crosses](#GeoInterface.crosses-Tuple{Any, Any}) — Method

crosses(a, b) -> Bool

Returns whether a and b cross.

source

GeoInterface.crs — Method

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

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

source

GeoInterface.crstrait — Method

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.difference](#GeoInterface.difference-Tuple{Any, Any}) — Method

difference(a, b) -> AbstractGeometry

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

source

[GeoInterface.disjoint](#GeoInterface.disjoint-Tuple{Any, Any}) — Method

disjoint(a, b) -> Bool

Returns whether a and b are disjoint. Inverse of [intersects](#GeoInterface.intersects-Tuple{Any, Any}).

source

[GeoInterface.distance](#GeoInterface.distance-Tuple{Any, Any}) — Method

distance(a, b) -> Number

Returns the shortest distance between a with b.

source

GeoInterface.endpoint — Method

endpoint(geom) -> Point

Return the last point in the geom. Note that this is only valid for AbstractCurveTraits.

source

[GeoInterface.equals](#GeoInterface.equals-Tuple{Any, Any}) — Method

equals(a, b) -> Bool

Returns whether a and b are equal. Equivalent to ([within](#GeoInterface.within-Tuple{Any, Any}) && [contains](#GeoInterface.contains-Tuple{Any, Any})).

source

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.

source

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.

source

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.

This is always a Tuple of Symbols.

source

GeoInterface.geomtrait — Method

GeoInterface.geomtrait(geom) => T <: AbstractGeometry

Returns the geometry type, such as PolygonTrait or PointTrait.

source

[GeoInterface.getcoord](#GeoInterface.getcoord-Tuple{Any, Integer}) — Method

getcoord(geom, i) -> Number

Return the ith coordinate for a given geom. A coordinate isa Real. Note that this is only valid for individual AbstractPointTraits.

source

GeoInterface.getcoord — Method

getcoord(geom) -> iterator

source

GeoInterface.getexterior — Method

getexterior(geom) -> Curve

Returns the exterior ring of a Polygon as a AbstractCurve. Note that this is only valid for AbstractPolygonTraits.

source

GeoInterface.getfeature — Method

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

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

source

[GeoInterface.getgeom](#GeoInterface.getgeom-Tuple{Any, Integer}) — Method

getgeom(geom, i::Integer) -> AbstractGeometry

Returns the ith geometry for the given geom.

source

GeoInterface.getgeom — Method

getgeom(geom) -> iterator

Returns an iterator over all geometry components in geom.

source

[GeoInterface.gethole](#GeoInterface.gethole-Tuple{Any, Integer}) — Method

gethole(geom, i::Integer) -> Curve

Returns the ith interior ring for this given geom. Note that this is only valid for AbstractPolygonTraits.

source

GeoInterface.gethole — Method

gethole(geom) -> iterator

Returns an iterator over all holes in geom. Note that this is only valid for AbstractPolygonTraits.

source

[GeoInterface.getlinestring](#GeoInterface.getlinestring-Tuple{Any, Integer}) — Method

getlinestring(geom, i::Integer) -> AbstractCurve

Returns the ith linestring for the given geom. Note that this is only valid for AbstractMultiLineStringTraits.

source

GeoInterface.getlinestring — Method

getlinestring(geom) -> iterator

Returns an iterator over all linestrings in a geometry. Note that this is only valid for AbstractMultiLineStringTraits.

source

[GeoInterface.getpatch](#GeoInterface.getpatch-Tuple{Any, Integer}) — Method

getpatch(geom, i::Integer) -> AbstractPolygon

Returns the ith patch for the given geom. Note that this is only valid for AbstractPolyhedralSurfaceTraits.

source

GeoInterface.getpatch — Method

getpatch(geom) -> iterator

Returns an iterator over all patches in geom. Note that this is only valid for AbstractPolyhedralSurfaceTraits.

source

[GeoInterface.getpoint](#GeoInterface.getpoint-Tuple{Any, Integer}) — Method

getpoint(geom, i::Integer) -> Point

Return the ith Point in given geom. Note that this is only valid for AbstractCurveTraits and AbstractMultiPointTraits.

source

GeoInterface.getpoint — Method

getpoint(geom) -> iterator

Returns an iterator over all points in geom.

source

[GeoInterface.getpolygon](#GeoInterface.getpolygon-Tuple{Any, Integer}) — Method

getpolygon(geom, i::Integer) -> AbstractCurve

Returns the ith polygon for the given geom. Note that this is only valid for AbstractMultiPolygonTraits.

source

GeoInterface.getpolygon — Method

getpolygon(geom) -> iterator

Returns an iterator over all polygons in a geometry. Note that this is only valid for AbstractMultiPolygonTraits.

source

[GeoInterface.getring](#GeoInterface.getring-Tuple{Any, Integer}) — 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 AbstractPolygonTraits and AbstractMultiPolygonTraits.

source

GeoInterface.getring — Method

getring(geom) -> iterator

Returns an iterator over all rings in geom. Note that this is only valid for AbstractPolygonTraits and AbstractMultiPolygonTraits in single-argument form.

source

[GeoInterface.intersection](#GeoInterface.intersection-Tuple{Any, Any}) — Method

intersection(a, b) -> AbstractGeometry

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

source

[GeoInterface.intersects](#GeoInterface.intersects-Tuple{Any, Any}) — Method

intersects(a, b) -> Bool

Returns whether a and b intersect. Inverse of [disjoint](#GeoInterface.disjoint-Tuple{Any, Any}).

source

GeoInterface.is3d — Method

is3d(geom) -> Bool

Return whether the given geom has a :Z coordinate.

source

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 AbstractCurveTraits.

source

GeoInterface.isempty — Method

isempty(geom) -> Bool

Return true when the geometry is empty.

source

[GeoInterface.isfeature](#GeoInterface.isfeature-Tuple{T} where T) — 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.

source

[GeoInterface.isfeaturecollection](#GeoInterface.isfeaturecollection-Tuple{T} where T) — 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.

source

[GeoInterface.isgeometry](#GeoInterface.isgeometry-Tuple{T} where T) — 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.

source

GeoInterface.ismeasured — Method

ismeasured(geom) -> Bool

Return whether the given geom has a :M coordinate.

source

[GeoInterface.israster](#GeoInterface.israster-Tuple{T} where T) — Method

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.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 AbstractCurveTraits.

source

GeoInterface.issimple — Method

issimple(geom) -> Bool

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

source

GeoInterface.length — Method

length(geom) -> Number

Return the length of geom in its 2d coordinate system. Note that this is only valid for AbstractCurveTraits.

source

GeoInterface.m — Method

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.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.

source

GeoInterface.nfeature — Method

GeoInterface.nfeature(collection)

Retrieve the number of features in a feature collection.

source

GeoInterface.ngeom — Method

ngeom(geom) -> Integer

Returns the number of geometries for the given geom.

source

GeoInterface.nhole — Method

nhole(geom) -> Integer

Returns the number of holes for this given geom. Note that this is only valid for AbstractPolygonTraits.

source

GeoInterface.nlinestring — Method

nlinestring(geom) -> Integer

Returns the number of curves for the given geom. Note that this is only valid for AbstractMultiLineStringTraits.

source

GeoInterface.npatch — Method

npatch(geom)

Returns the number of patches for the given geom. Note that this is only valid for AbstractPolyhedralSurfaceTraits.

source

GeoInterface.npoint — Method

npoint(geom) -> Int

Return the number of points in given geom. Note that this is only valid for AbstractCurveTraits and AbstractMultiPointTraits.

source

GeoInterface.npolygon — Method

npolygon(geom) -> Integer

Returns the number of polygons for the given geom. Note that this is only valid for AbstractMultiPolygonTraits.

source

GeoInterface.nring — Method

nring(geom) -> Integer

Return the number of rings in given geom. Note that this is only valid for AbstractPolygonTraits and AbstractMultiPolygonTraits

source

[GeoInterface.overlaps](#GeoInterface.overlaps-Tuple{Any, Any}) — Method

overlaps(a, b) -> Bool

Returns whether a and b overlap. Also called covers in DE-9IM.

source

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 AbstractSurfaceTraits.

source

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.

source

[GeoInterface.relate](#GeoInterface.relate-Tuple{Any, Any, Any}) — Method

relate(a, b, relationmatrix::String) -> Bool

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

source

GeoInterface.startpoint — Method

startpoint(geom) -> Point

Return the first point in the geom. Note that this is only valid for AbstractCurveTraits.

source

GeoInterface.subtrait — Method

subtrait(t::AbstractGeometryTrait)

Gets the expected, possible abstract, (sub)trait for subgeometries (retrieved with [getgeom](#GeoInterface.getgeom-Tuple{Any, Integer})) 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.symdifference](#GeoInterface.symdifference-Tuple{Any, Any}) — Method

symdifference(a, b) -> AbstractGeometry

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

source

GeoInterface.testfeature — Method

testfeature(feature)

Test whether the required interface for your feature has been implemented correctly.

source

GeoInterface.testfeaturecollection — Method

testfeaturecollection(featurecollection)

Test whether the required interface for your featurecollection has been implemented correctly.

source

GeoInterface.testgeometry — Method

testgeometry(geom)

Test whether the required interface for your geom has been implemented correctly.

source

GeoInterface.testraster — Method

testraster(raster)

Test whether the required interface for your raster has been implemented correctly.

source

[GeoInterface.touches](#GeoInterface.touches-Tuple{Any, Any}) — Method

touches(a, b) -> Bool

Returns whether a and b touch.

source

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.

source

[GeoInterface.union](#GeoInterface.union-Tuple{Any, Any}) — Method

union(a, b) -> AbstractGeometry

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

source

[GeoInterface.within](#GeoInterface.within-Tuple{Any, Any}) — Method

within(a, b) -> Bool

Returns whether a is within b. The order of arguments is important. Equivalent to [contains](#GeoInterface.contains-Tuple{Any, Any}) with reversed arguments.

source

GeoInterface.x — Method

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.y — Method

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.z — Method

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.AbstractCRSTrait — Type

Supertype for all coordinate reference system traits

source

GeoInterface.AbstractCurvePolygonTrait — Type

An AbstractCurvePolygonTrait type for all curved polygons.

source

GeoInterface.AbstractCurveTrait — Type

An AbstractCurveTrait type for all curves.

source

GeoInterface.AbstractFeatureCollectionTrait — Type

An AbstractFeatureCollectionTrait for all feature collections

source

GeoInterface.AbstractFeatureTrait — Type

An AbstractFeatureTrait for all features

source

GeoInterface.AbstractGeographicTrait — Type

An AbstractGeographicTrait for all geographic coordinate reference systems

source

GeoInterface.AbstractGeometryCollectionTrait — Type

An AbstractGeometryCollectionTrait type for all geometrycollections.

source

GeoInterface.AbstractGeometryTrait — Type

An AbstractGeometryTrait type for all geometries.

source

GeoInterface.AbstractLineStringTrait — Type

An AbstractLineString type for all linestrings.

source

GeoInterface.AbstractMultiCurveTrait — Type

An AbstractMultiCurveTrait type for all multicurves.

source

GeoInterface.AbstractMultiLineStringTrait — Type

An AbstractMultiLineStringTrait type for all multilinestrings.

source

GeoInterface.AbstractMultiPointTrait — Type

An AbstractMultiPointTrait type for all multipoints.

source

GeoInterface.AbstractMultiPolygonTrait — Type

An AbstractMultiPolygonTrait type for all multipolygons.

source

GeoInterface.AbstractMultiSurfaceTrait — Type

An AbstractMultiSurfaceTrait type for all multisurfaces.

source

GeoInterface.AbstractPointTrait — Type

An AbstractPointTrait for all points.

source

GeoInterface.AbstractPolygonTrait — Type

An AbstractPolygonTrait type for all polygons.

source

GeoInterface.AbstractPolyhedralSurfaceTrait — Type

An AbstractPolyhedralSurfaceTrait type for all polyhedralsurfaces.

source

GeoInterface.AbstractProjectedTrait — Type

An AbstractProjectedTrait for all projected coordinate reference systems

source

GeoInterface.AbstractRasterTrait — Type

An AbstractRasterTrait for all rasters

source

GeoInterface.AbstractSurfaceTrait — Type

An AbstractSurfaceTrait type for all surfaces.

source

GeoInterface.AbstractTrait — Type

An AbstractTrait type for all geometries, features and feature collections.

source

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.

source

GeoInterface.CompoundCurveTrait — Type

A CompoundCurveTrait is a curve that combines straight LineStringTraits and curved CircularStringTraits.

source

GeoInterface.CurvePolygonTrait — Type

An AbstractCurvePolygonTrait that can contain either circular or straight curves as rings.

source

GeoInterface.FeatureCollectionTrait — Type

A FeatureCollectionTrait holds objects of FeatureTrait

source

GeoInterface.FeatureTrait — Type

A FeatureTrait holds geometries, properties and an extent

source

GeoInterface.GeographicTrait — Type

An GeographicTrait for all geographic coordinate reference systems

source

GeoInterface.GeometryCollectionTrait — Type

A GeometryCollection is a collection of Geometrys.

source

GeoInterface.HexagonTrait — Type

A PolygonTrait with six vertices.

source

GeoInterface.LineStringTrait — Type

A LineStringTrait is a collection of straight lines between its PointTraits.

source

GeoInterface.LineTrait — Type

A LineTrait is LineStringTrait with just two points.

source

GeoInterface.LinearRingTrait — Type

A LinearRingTrait is a LineStringTrait with the same begin and endpoint.

source

GeoInterface.MultiCurveTrait — Type

A MultiCurveTrait is a collection of CircularStringTraits.

source

GeoInterface.MultiLineStringTrait — Type

A MultiLineStringTrait is a collection of LineStringTraits.

source

GeoInterface.MultiPointTrait — Type

A MultiPointTrait is a collection of PointTraits.

source

GeoInterface.MultiPolygonTrait — Type

A MultiPolygonTrait is a collection of PolygonTraits.

source

GeoInterface.MultiSurfaceTrait — Type

A MultiSurfaceTrait is a collection of AbstractSurfaceTraits.

source

GeoInterface.PentagonTrait — Type

A PolygonTrait with five vertices.

source

GeoInterface.PointTrait — Type

A single point.

source

GeoInterface.PolygonTrait — Type

An AbstractSurfaceTrait with straight rings either as exterior or interior(s).

source

GeoInterface.PolyhedralSurfaceTrait — Type

A PolyhedralSurfaceTrait is a connected surface consisting of PolygonTraits.

source

GeoInterface.ProjectedTrait — Type

An ProjectedTrait for all projected coordinate reference systems

source

GeoInterface.QuadTrait — Type

A PolygonTrait with four vertices.

source

GeoInterface.RectangleTrait — Type

A PolygonTrait that is rectangular and could be described by the minimum and maximum vertices.

source

GeoInterface.TINTrait — Type

A TINTrait is a PolyhedralSurfaceTrait consisting of TriangleTraits.

source

GeoInterface.TriangleTrait — Type

A PolygonTrait that is triangular.

source

GeoInterface.UnknownTrait — Type

An UnknownTrait for all unknown (assumed projected) coordinate reference systems

source

Index