geocore library

Geospatial data (geometry, features, meta) and parsers (WKT, GeoJSON).

Exports Coords, Position, TransformPosition, CreatePosition, Box and Projection from package:geobase/coordinates.dart.

Exports also Geom, CoordinateContent, SimpleGeometryContent, GeometryContent, GeometryBinaryFormat, FeatureContent, PropertyContent, ContentDecoder, ContentEncoder, BinaryFormat, TextWriterFormat, DefaultFormat, WktLikeFormat, GeoJSON, WKT and WKB from package:geobase/vector.dart.

Usage: import package:geocore/geocore.dart

Classes

Bounded
A base interface for classes that know their bounds.
BoundedSeries<E extends Bounded>
A base interface for a series (list) of bounded items of type E.
Bounds<T extends Point<num>>
A base interface for bounds (aka a bounding box in 2D).
BoundsBase<T extends Point<num>>
An immutable bounds with min and max points for limits.
Box
A base interface for axis-aligned bounding boxes with min & max coordinates.
CastingPointFactory<T extends Point<num>>
A PointFactory that casts points created by _wrapped to the type T.
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.
CoordinateFactory<T extends Bounded>
An interface to create Bounded instances of the type T.
DefaultFormat
The "default" text format for coordinate and geometry objects.
Feature<T extends Geometry>
A feature is a geospatial entity with id, properties and geometry.
FeatureCollection<E extends Feature<Geometry>>
A feature collection with a series of features.
FeatureWritable
An interface defining the capability to write feature objects.
GeoBounds<T extends GeoPoint>
An immutable geographic bounds with min and max points for limits.
GeoFactory
A factory to create geospatial geometries and features from source data.
GeoFactoryBase<PointType extends Point<num>>
A base implementation of GeoFactory with point and feature factories.
GeoJSON
The GeoJSON text format for coordinate, geometry and feature objects.
GeoJsonFactory<PointType extends Point<num>>
A geospatial object factory capable of parsing GeoJSON data from json.
Geometry
A base interface for geometry classes.
GeometryCollection<E extends Geometry>
A geometry collection.
GeoPoint
A geographic position with longitude, latitude and optional elevation.
GeoPoint2
An immutable geographic position with longitude and latitude.
GeoPoint2m
An immutable geographic position with longitude, latitude and m (measure).
GeoPoint3
An immutable geographic position with longitude, latitude and elevation.
GeoPoint3m
An immutable geographic position with longitude, latitude, elev and m.
GeoPointWrapper<T extends GeoPoint>
A geographic position with wrapping a GeoPoint instance.
LineString<T extends Point<num>>
A line string containing a chain of points.
MultiLineString<T extends Point<num>>
A multi line string geometry.
MultiPoint<E extends Point<num>>
A multi point geometry.
MultiPolygon<T extends Point<num>>
A multi polygon geometry.
Point<C extends num>
Point is a read-only position with x, y, z and m coordinates.
Point2
An immutable point with X and Y as num values.
Point2i
An immutable point with X and Y as integer values.
Point2m
An immutable point with X, Y and M as num values.
Point3
An immutable point with X, Y and Z as num values.
Point3i
An immutable point with X, Y and Z as integer values.
Point3m
An immutable point with X, Y, Z and M as num values.
PointFactory<T extends Point<num>>
An interface to create Point instances of the type T.
PointSeries<E extends Point<num>>
A base interface for a series of points with getters to access point items.
PointWrapper<T extends Point<C>, C extends num>
A point with getters to access the wrapped point.
Polygon<T extends Point<num>>
A polygon with an exterior and optional interior boundaries.
Position
A base interface for geospatial positions.
ProjectedPoint<C extends num>
A read-only projected (or cartesian) point with x, y, z and m.
Range
A range defining a set of items on a collection.
SimpleGeometryContent
An interface to write simple geometry data to format encoders and object builders.
TextWriterFormat<Content extends Object>
An interface to access text format encoders (writers) for Content.
WKB
The Well-known binary (WKB) format, see geometry for accessing the format.
WKT
The WKT text format for coordinate and geometry objects.
WktFactory<PointType extends Point<num>>
A geospatial object factory capable of parsing WKT geometries from text.
WktLikeFormat
The WKT (like) text format for coordinate and geometry objects.

Enums

Coords
An enum for coordinate types (by spatial dimension and whether is measured).
Geom
An enum for geometry types.
LineStringType
The type for the line string.

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 obejcts to format encoders and object builders.
GeometryContent
An interface to write geometry data to format encoders and object builders.
PointSeriesMixin<E extends Point<num>>
A partial implementation of PointSeries as a mixin.
Projection
A mixin defining an interface for (geospatial) projections.
PropertyContent
An interface to write properties to format encoders and object builders.

Extensions

GeoJSONExtension on GeoJSON
GeoJSON format extensions providing access to GeoJSON parsers via format.
WKTExtension on WKT
WKT format extensions providing access to WKT parsers via format.

Constants

geographicPoints → const PointFactory<GeoPoint>
A constant factory for geographic GeoPoint objects without M coordinate.
projectedPoints → const PointFactory<ProjectedPoint<num>>
A constant factory for ProjectedPoint objects without M coordinate.
wktGeographic → const WktFactory<GeoPoint>
The default WKT factory instace assuming geographic CRS80 coordinates.
wktProjected → const WktFactory<Point<num>>
The default WKT factory instace assuming cartesian or projected coordinates.

Functions

anyPoints({bool expectGeographic = true}) PointFactory<Point<num>>
Returns a factory for cartesian and geographic Point objects without M.
anyPointsWithM({bool expectGeographic = true, required bool expectM}) PointFactory<Point<num>>
Returns a factory for cartesian and geographic Point objects allowing M.
geographicPointsWithM({required bool expectM}) PointFactory<GeoPoint>
Returns a factory for geographic GeoPoint objects allowing M coordinate.
geoJson<T extends Point<num>>(PointFactory<T> point, {CreateBounds<T>? bounds, CreateFeature? feature}) GeoJsonFactory<T>
A GeoJSON factory using point factory to create any points of T.
geoJsonGeographic<T extends GeoPoint>(PointFactory<T> point, {CreateBounds<T>? bounds, CreateFeature? feature}) GeoJsonFactory<T>
A GeoJSON factory using point factory to create geographic points of T.
geoJsonProjected<T extends ProjectedPoint<num>>(PointFactory<T> point, {CreateBounds<T>? bounds, CreateFeature? feature}) GeoJsonFactory<T>
A GeoJSON factory using point factory to create cartesian points of T.
projectedPointsWithM({required bool expectM}) PointFactory<ProjectedPoint<num>>
Returns a factory for ProjectedPoint objects allowing M coordinate.
rotatePosition2D(num radians, {num? cx, num? cy}) TransformPosition
Returns a function to rotate positions by the radians around the origin.
scalePosition<C extends num>({C? sx, C? sy, C? sz, C? sm}) TransformPosition
Returns a function to scale positions by scale factors for each axis.
scalePositionBy<C extends num>(C scale) TransformPosition
Returns a function to scale positions by the scale factor.
translatePosition<C extends num>({C? dx, C? dy, C? dz, C? dm}) TransformPosition
Returns a function to translate positions by delta values of each axis.
wkt<T extends Point<num>>(PointFactory<T> point, [PointFactory<T>? pointWithM]) WktFactory<T>
Creates a WKT factory instace using the point factory.

Typedefs

CreateBounds<T extends Point<num>> = Bounds<T> Function(Iterable<num> coords, {required PointFactory<T> pointFactory})
A function to parse bounds from coords and using pointFactory.
CreateFeature = Feature<T> Function<T extends Geometry>({Bounds<Point<num>>? bounds, T? geometry, Object? id, Map<String, Object?>? jsonObject, Map<String, Object?>? properties})
A function to create a feature of id, properties, geometry + bounds.
CreatePosition<T extends Position> = T Function({num? m, required num x, required num y, num? z})
Creates a new position of T from x and y, and optional z and m.
ParseCoords = Iterable<num> Function(String text)
A function to parse coordinate values from text.
ParseCoordsInt = Iterable<int> Function(String text)
A function to parse coordinate values as integers from text.
ParseCoordsList = Iterable<Iterable<num>> Function(String text)
A function to parse a list of coordinate values from text.
ParseCoordsListList = Iterable<Iterable<Iterable<num>>> Function(String text)
A function to parse a list of a list of coordinate values from text.
ParseCoordsListListList = Iterable<Iterable<Iterable<Iterable<num>>>> Function(String text)
A function to parse a list of a list of a list of coordinates from text.
TransformPosition = T Function<T extends Position>(T source)
A function to transform the source position of T to a position of T.