Crate geo_types[][src]

The geo-types library provides geospatial primitive types for the GeoRust ecosystem.

In most cases, you will only need to use this crate if you’re a crate author and want compatibility with other GeoRust crates. Otherwise, the geo crate re-exports these types and provides geospatial algorithms.

Types

Semantics

The geospatial types provided here aim to adhere to the OpenGIS Simple feature access standards. Thus, the types here are inter-operable with other implementations of the standards: JTS, GEOS, etc.

Features

The following optional Cargo features are available:

  • approx: Allows geometry types to be checked for approximate equality with approx
  • arbitrary: Allows geometry types to be created from unstructured input with arbitrary
  • serde: Allows geometry types to be serialized and deserialized with Serde
  • use-rstar: Allows geometry types to be inserted into rstar R*-trees

Macros

line_string

Creates a LineString containing the given coordinates.

point

Creates a Point from the given coordinates.

polygon

Creates a Polygon containing the given coordinates.

Structs

Coordinate

A lightweight struct used to store coordinates on the 2-dimensional Cartesian plane.

GeometryCollection

A collection of Geometry types.

InvalidRectCoordinatesErrorDeprecated
Line

A line segment made up of exactly two Coordinates.

LineString

An ordered collection of two or more Coordinates, representing a path between locations.

MultiLineString

A collection of LineStrings. Can be created from a Vec of LineStrings or from an Iterator which yields LineStrings. Iterating over this object yields the component LineStrings.

MultiPoint

A collection of Points. Can be created from a Vec of Points, or from an Iterator which yields Points. Iterating over this object yields the component Points.

MultiPolygon

A collection of Polygons. Can be created from a Vec of Polygons, or from an Iterator which yields Polygons. Iterating over this object yields the component Polygons.

Point

A single point in 2D space.

PointsIter

A Point iterator returned by the points_iter method

Polygon

A bounded two-dimensional area.

Rect

An axis-aligned bounded 2D rectangle whose area is defined by minimum and maximum Coordinates.

Triangle

A bounded 2D area whose three vertices are defined by Coordinates. The semantics and validity are that of the equivalent Polygon; in addition, the three vertices must not be collinear and they must be distinct.

Enums

Error
Geometry

An enum representing any possible geometry type.

Traits

CoordFloat
CoordNum

The type of an x or y value of a point/coordinate.

CoordinateTypeDeprecated