Copyright | (C) 2016 Markus Barenhoff |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Markus Barenhoff <mbarenh@alios.org> |
Stability | provisional |
Portability | FunctionalDependencies, TypeFamilies, GADTs RankNTypes |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
- data Position t
- _Position :: BaseType t => Iso' (t, t) (Position t)
- data Point
- _Point :: Iso' (Position t) (GeoJSON Point t)
- data MultiPoint
- _MultiPoint :: Iso' [Position t] (GeoJSON MultiPoint t)
- data LineString
- _LineString :: Prism' [Position t] (GeoJSON LineString t)
- data LinearRing
- _LinearRing :: BaseType t => Prism' (GeoJSON LineString t) (GeoJSON LinearRing t)
- closeLineString :: BaseType t => GeoJSON LineString t -> Maybe (GeoJSON LinearRing t)
- data MultiLineString
- _MultiLineString :: Iso' [GeoJSON LineString t] (GeoJSON MultiLineString t)
- data Polygon
- _Polygon :: Iso' [GeoJSON LinearRing t] (GeoJSON Polygon t)
- data MultiPolygon
- _MultiPolygon :: Iso' [GeoJSON Polygon t] (GeoJSON MultiPolygon t)
- data Collection
- _GeometryCollection :: Iso' (GeometryCollection t) (GeoJSON Collection t)
- data GeometryCollection t
- newCollection :: GeoJSONObject a => GeoJSON a t -> GeometryCollection t
- insert :: GeoJSONObject a => GeometryCollection t -> GeoJSON a t -> GeometryCollection t
- class BaseType t => HasFlatCoordinates a t | a -> t where
- flatCoordinates :: Getter a [Position t]
- type BoundingBox t = (Position t, Position t)
- boundingBox :: HasFlatCoordinates a t => Getter a (BoundingBox t)
- data GeoJSON a t
- type BaseType t = (Eq t, Ord t, Num t, Show t, FromJSON t, ToJSON t, Val t)
- class Typeable a => GeoJSONObject a
GeoJSON Objects
Position
Data type to hold a basic xy latlon value. . see also: http://geojson.org/geojson-spec.html#positions
Point
MultiPoint
data MultiPoint Source
_MultiPoint :: Iso' [Position t] (GeoJSON MultiPoint t) Source
convert from/to MultiPoint
Line String
data LineString Source
_LineString :: Prism' [Position t] (GeoJSON LineString t) Source
convert from/to LineString
. Must have 2 or more elements.
Linear Ring
data LinearRing Source
_LinearRing :: BaseType t => Prism' (GeoJSON LineString t) (GeoJSON LinearRing t) Source
a closed (first elemet == last element) LineString
. Must have
at least 4 elements.
closeLineString :: BaseType t => GeoJSON LineString t -> Maybe (GeoJSON LinearRing t) Source
create LinearRing
from LineString
by closing it.
MultiLineString
data MultiLineString Source
_MultiLineString :: Iso' [GeoJSON LineString t] (GeoJSON MultiLineString t) Source
convert from/to MultiLineString
Polygon
MultiPolygon
data MultiPolygon Source
_MultiPolygon :: Iso' [GeoJSON Polygon t] (GeoJSON MultiPolygon t) Source
convert from/to MultiPolygon
Collection
data Collection Source
_GeometryCollection :: Iso' (GeometryCollection t) (GeoJSON Collection t) Source
convert from/to GeometryCollection
Geometry Collection
data GeometryCollection t Source
a collection of GeoJSONObject
.
BaseType t => Eq (GeometryCollection t) Source | |
BaseType t => Show (GeometryCollection t) Source | |
BaseType t => ToJSON (GeometryCollection t) Source | |
BaseType t => FromJSON (GeometryCollection t) Source | |
BaseType t => Val (GeometryCollection t) Source |
newCollection :: GeoJSONObject a => GeoJSON a t -> GeometryCollection t Source
create a new GeometryCollection
with initial element
insert :: GeoJSONObject a => GeometryCollection t -> GeoJSON a t -> GeometryCollection t Source
insert a GeoJSONObject
into GeometryCollection
Support types
Bounding Box
class BaseType t => HasFlatCoordinates a t | a -> t where Source
Represents datatypes which hold one or more Position
objects.
flatCoordinates :: Getter a [Position t] Source
BaseType t => HasFlatCoordinates (Position t) t Source | |
(GeoJSONObject a, BaseType t) => HasFlatCoordinates (GeoJSON a t) t Source | |
BaseType t => HasFlatCoordinates (FeatureCollection v t) t Source | |
BaseType t => HasFlatCoordinates (Feature v a t) t Source |
type BoundingBox t = (Position t, Position t) Source
A bounding box is represented by a top-left/bottom-right
Position
pair.
boundingBox :: HasFlatCoordinates a t => Getter a (BoundingBox t) Source
calculate the bounding box of the the given object.
Base Types
the base type of all GeoJSON object. see also GeoJSONObject
(GeoJSONObject a, BaseType t) => Eq (GeoJSON a t) Source | |
(GeoJSONObject a, BaseType t) => Show (GeoJSON a t) Source | |
(GeoJSONObject a, BaseType t) => ToJSON (GeoJSON a t) Source | |
(GeoJSONObject a, BaseType t) => FromJSON (GeoJSON a t) Source | |
(GeoJSONObject a, BaseType t) => Val (GeoJSON a t) Source | |
(GeoJSONObject a, BaseType t) => HasFlatCoordinates (GeoJSON a t) t Source |
type BaseType t = (Eq t, Ord t, Num t, Show t, FromJSON t, ToJSON t, Val t) Source
type constraint for the base numeric type used in Position
class Typeable a => GeoJSONObject a Source
common type clas of all GeoJSON
objects
parseGeoJSON, castBson, flatCoordinatesGeoJSON