geobase library

Geospatial data, geometry, geodesy, projections, tiling schemes and vector data.

Key features:

  • position, bounding box and positions series (with coordinate arrays)
  • geographic (longitude-latitude) and projected positions and bounding boxes
  • ellipsoidal (vincenty) and spherical (great circle, rhumb line) geodesy tools, with UTM and MGRS coordinate conversions
  • geometric functions for cartesian calculations
  • simple geometries (point, line string, polygon, multi point, multi line string, multi polygon, geometry collection)
  • features (with id, properties and geometry) and feature collections
  • temporal data structures (instant, interval) and spatial extents
  • vector data formats supported (GeoJSON, WKT, WKB)
  • coordinate projections (web mercator + based on the external proj4dart library)
  • tiling schemes and tile matrix sets (web mercator, global geodetic)
  • common codes, constants, functions, presentation helpers and reference systems related to geospatial applications

Usage: import package:geobase/geobase.dart

Classes

Aligned
An aligned point within a geospatial box or tile.
Bounded
A positionable object with position data (directly or within child objects) and methods to resolve bounding boxes.
Box
A base class for axis-aligned bounding boxes with min & max coordinates.
ContentDecoder
An interface to decode content from a text or binary format.
ContentEncoder<Content extends Object>
An interface to encode Content into a text or binary format.
CoordRefSys
Metadata about a coordinate reference system (CRS) identified and specified by id.
CoordRefSysResolver
An abstract class for resolving coordinate reference system information.
Datum
A geodetic datum with a reference ellipsoid and datum transformation parameters.
DefaultFormat
The "default" text format for coordinate and geometry objects.
DistancedPosition<T extends Position>
An object containing position that is within distance from something.
Dms
A default implementation for DmsFormat abstract base class, that defines methods for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing values.
DmsFormat
A base class for formatters with methods for parsing and formatting degrees/minutes/seconds on latitude, longitude and bearing values.
Ellipsoid
A reference ellipsoid with ellipsoidal parameters (a, b and f).
Ellipsoidal
The base class for calculations related to the Earth surface modeled by ellipsoidal reference frames with geographic position (latitude, longitude) as an origin.
EllipsoidalVincenty
Distances & bearings between points, and destination points given start points & initial bearings, calculated on an ellipsoidal earth model using ‘direct and inverse solutions of geodesics on the ellipsoid’ devised by Thaddeus Vincenty.
Feature<T extends Geometry>
A feature is a geospatial entity with id, properties and geometry.
FeatureBuilder<T extends FeatureObject, E extends Geometry>
A builder to create geospatial feature objects of T from FeatureContent.
FeatureCollection<E extends Feature<Geometry>>
A feature collection contains an array of Feature items.
FeatureObject
A common base interface for geospatial feature objects (Feature and FeatureCollection).
GeoBox
A geographic bounding box with west, south, east and north values.
Geocentric
The base class for calculations related to the Earth surface modeled by ellipsoidal reference frames with geocentric cartesian position (X, Y, Z) as an origin.
GeodeticArcSegment
A geodetic (geographic) arc segment between the origin position and the destination position along a geodesic.
GeoExtent
A geospatial extent with spatial and optional temporal parts.
Geographic
A geographic position with longitude, latitude and optional elevation and m.
GeographicBearing
A direction (bearing) in degrees clockwise from north at a specific geographic position (origin).
GeoJSON
The GeoJSON text format for coordinate, geometry and feature objects.
GeoJsonConf
Optional configuration parameters for formatting (and parsing) GeoJSON.
GeoJSONL
The newline-delimited GeoJSON (or "GeoJSON Text Sequences") text format for feature objects.
Geometry
A base interface for geometry classes.
GeometryBuilder<T extends Geometry, E extends Geometry>
A builder to create geometry objects of T from GeometryContent.
GeometryCollection<E extends Geometry>
A geometry collection with geometries.
GeoTileMatrixSet
A tile matrix set with conversions between tiles and geographic positions.
GlobalGeodeticQuad
"Global Geodetic Quad" tile matrix set ("World CRS84 Quad" for WGS 84).
HistoricalEllipsoids
Some historical geodetic ellipsoids defined as static constants.
Instant
An instant with a timestamp.
Interval
An interval between optional start and end instants.
LineString
A line string geometry with a chain of positions.
Mgrs
Military Grid Reference System (MGRS/NATO) grid references, with methods to parse references, and to convert between MGRS references and UTM coordinates.
MgrsGridSquare
The 100km grid square (or the 100,000-meter square identifier) as a part of the grid zone in MGRS/NATO grid references.
MgrsGridZone
A grid zone as a polygon of 6° × 8° in MGRS/NATO grid references.
MultiLineString
A multi line string with an array of line strings (each with a chain of positions).
MultiPoint
A multi point geometry with an array of points (each with a position).
MultiPolygon
A multi polygon with an array of polygons (each with an array of rings).
Point
A point geometry with a position.
Polygon
A polygon geometry with one exterior and 0 to N interior rings.
Position
A base class for geospatial positions.
Positionable
A positionable object contains data structures for (geospatial) position data, directly or within child objects.
PositionScheme
A position scheme encapsulates position and bounding box factories for certain type of position data.
PositionSeries
A fixed-length (and random-access) view to a series of positions.
ProjBox
A bounding box with minX, minY, maxX and maxY coordinates.
Projected
A projected position with x, y, and optional z and m coordinates.
Scalable
A scalable object at the zoom level (a positive number).
Scalable2i
Scalable x, y coordinates at the zoom level.
ScaledConverter
A coordinate converter between geospatial positions and scaled coordinates.
SimpleGeometry
A base interface for "simple" geometry classes.
SimpleGeometryContent
An interface to write simple geometry data to format encoders and object builders.
SpatialExtent<T extends Box>
An extent with 1 to N bounding boxes in defined coordinate reference system.
SphericalGreatCircle
Latitude/longitude points on a spherical model earth, and methods for calculating distances, bearings, destinations, etc on (orthodromic) great-circle paths.
SphericalGreatCircleLineString
Calculations for line strings (as an iterable of geographic positions) on a spherical model earth (great-circle paths).
SphericalRhumbLine
Latitude/longitude points on a spherical model earth, and methods for calculating distances, bearings, destinations, etc on (loxodromic) rhumb lines.
Temporal
A base class for temporal objects like instants and intervals.
TemporalExtent
An extent with 1 to N intervals in defined temporal coordinate reference system.
TemporalRefSys
Metadata about a temporal coordinate reference system (TRS) identified and specified by id.
TemporalRefSysResolver
An abstract class for resolving temporal coordinate reference system information.
TextReaderFormat<Content extends Object>
An interface to access text format decoders (readers) for Content.
TextWriterFormat<Content extends Object>
An interface to access text format encoders (writers) for Content.
TileMatrixSet
A tiling scheme represented as a set of tile matrices (grids).
Utm
UTM coordinates, with functions to parse them and convert them to geographic points.
UtmMeta<T extends Object>
Metadata (convergence and scale) as a result from UTM calculations related to position.
UtmZone
The UTM zone represented by the lonZone number and hemisphere.
ValuePositionable
A positionable object that has (geospatial) coordinate values directly available.
WebMercatorQuad
"Web Mercator Quad" tile matrix set.
WGS84
Projections for the WGS 84 geographic coordinate system.
WKB
The Well-known binary (WKB) format, see geometry for the standard WKB and geometryExtended for the Extended WKB (EWKB).
WKT
The WKT text format for coordinate and geometry objects.
WktLikeFormat
The WKT (like) text format for coordinate and geometry objects.

Enums

AngleUnit
An enumeration of angle units.
AngularVelocityUnit
An enumeration of angular velocity units.
AreaUnit
An enumeration of area units.
AxisOrder
The axis order of coordinate values in position and point representations.
CanvasOrigin
The position of the origin in a canvas or a grid.
CardinalPrecision
The precision for cardinal directions (compass point).
CoordRefSysType
An enumeration of common coordinate reference system (CRS) types.
Coords
An enum for coordinate types (by spatial dimension and whether is measured).
Dimensionality
An enum for dimensionality or topological dimension in the context of geospatial applications.
DmsType
An enum for common representation of geographic positions by coordinates (using degrees, minutes and seconds as components).
Geom
An enum for geometry types.
GeoRepresentation
An enum for spatial representations that can be used to code logic when need to choose some options based on a representation.
Hemisphere
An enum representing the hemispheres of the Earth.
LengthUnit
An enumeration of length (distance) units.
SpeedUnit
An enumeration of speed units.
TimeUnit
An enumeration of time units (representing values of time duration or intervals).
WkbFlavor
The flavor (or a variation) of the Well-known binary (WKB) specification.

Mixins

BinaryFormat<Content extends Object>
A mixin to access binary format encoders and decoders for Content
CoordinateContent
An interface to write coordinate data to format encoders and object builders.
FeatureContent
An interface to write geospatial feature objects to format encoders and object builders.
GeometryContent
An interface to write geometry data to format encoders and object builders.
Projection
A mixin defining an interface for (geospatial) projections.
ProjectionAdapter
A projection adapter bundles forward and inverse projections.
TextFormat<Content extends Object>
A mixin to access text format encoders and decoders for Content.

Extensions

BoxArrayExtension on Iterable<Box?>
A helper extension on Iterable<Box?>.
CartesianArealExtension on Iterable<PositionSeries>
An extension of cartesian functions for areal geometries represented by an iterable of position series objects each representing a linear ring in a polygon geometry).
CoordinateArrayExtension on List<double>
A helper extension on List<double> to handle coordinate values.
DoubleAngleExtension on double
An extension on double with basic degrees and radians utility methods.
EllipsoidalExtension on Geographic
An extension of the Geographic class providing calculations related to the Earth surface modeled by ellipsoidal reference frames (or datums).
EllipsoidalVincentyExtension on Geographic
An extension for easier access to EllipsoidalVincenty.
GeographicDoubleAngleExtension on double
An extension on double with basic degrees and radians utility methods ( (for geographic coordinate reference systems).
PositionArrayExtension on Iterable<Position>
A helper extension on Iterable<Position>.
SphericalGreatCircleExtension on Geographic
An extension for easier access to SphericalGreatCircle.
SphericalGreatCircleIterableExtension on Iterable<Geographic>
An extension for easier access to SphericalGreatCircleLineString for iterables of geographic positions.
SphericalGreatCirclePositionSeriesExtension on PositionSeries
An extension for easier access to SphericalGreatCircleLineString for series of positions.
SphericalRhumbLineExtension on Geographic
An extension for easier access to SphericalRhumbLine.
UnitConversionExtension on num
An extension on double with conversion methods for angle, angular velocity, area, length, speed and time units.

Constants

defaultEpsilon → const double
The default epsilon value 1.0e-9 used as a tolerance in equals2D, equals3D and similar methods in this package.
doublePrecisionEpsilon → const double
The maximum relative precision of double numbers (IEEE 754).
earthCircumferenceWgs84 → const double
The earth circumference in meters (from earth equatorial radius by WGS 84).
earthRadiusWgs84 → const double
The earth equatorial radius in meters as specified by WGS 84.
maxLatitude → const double
The maximum value for the geographic latitude.
maxLatitudeUTM → const double
The maximum value for the geographic latitude inside the Universal Transverse Mercator (UTM) projection coverage.
maxLatitudeWebMercator → const double
The maximum value for the geographic latitude inside the Web Mercator projection coverage.
maxLongitude → const double
The maximum value for the geographic longitude.
minLatitude → const double
The minimum value for the geographic latitude.
minLatitudeUTM → const double
The minimum value for the geographic latitude inside the Universal Transverse Mercator (UTM) projection coverage.
minLatitudeWebMercator → const double
The minimum value for the geographic latitude inside the Web Mercator projection coverage.
minLongitude → const double
The minimum value for the geographic longitude.
screenPPIbyOGC → const double
OGC defines a screen pixel of 0.28 mm that approximates to 90.7 ppi.

Typedefs

AddGeometry<T extends Geometry> = void Function(T geometry, {String? name})
A function to add geometry to some collection with an optional name.
CreateBox<T extends Box> = T Function({double? maxM, required double maxX, required double maxY, double? maxZ, double? minM, required double minX, required double minY, double? minZ})
Creates a new bounding box from minX, minY, maxX and maxY values.
CreatePosition<T extends Position> = T Function({double? m, required double x, required double y, double? z})
Creates a new position of T from x and y, and optional z and m.
ExpandPosition = Iterable<T> Function<T extends Position>(Position source, {required CreatePosition<T> to})
A function to expand the source position to an iterable of zero or more positions of T using to as a factory.
TransformPosition = T Function<T extends Position>(Position source, {required CreatePosition<T> to})
A function to transform the source position to a position of T using to as a factory.
WriteFeatures = void Function(FeatureContent output)
A function to write geospatial feature objects to output.
WriteGeometries = void Function(GeometryContent output)
A function to write geometry data to output.
WriteSimpleGeometries = void Function(SimpleGeometryContent output)
A function to write simple geometry data to output.