geojson-types-0.1.3: GeoJSON data types including JSON/BSON conversion.

Copyright(C) 2016 Markus Barenhoff
LicenseBSD-style (see the file LICENSE)
MaintainerMarkus Barenhoff <mbarenh@alios.org>
Stabilityprovisional
PortabilityFunctionalDependencies, TypeFamilies, GADTs RankNTypes
Safe HaskellTrustworthy
LanguageHaskell2010

Data.GeoJSON.Objects

Contents

Description

 

Synopsis

GeoJSON Objects

Position

data Position t Source

Data type to hold a basic xy latlon value. . see also: http://geojson.org/geojson-spec.html#positions

_Position :: BaseType t => Iso' (t, t) (Position t) Source

Iso from/to Position

Point

_Point :: Iso' (Position t) (GeoJSON Point t) Source

convert from/to Point

MultiPoint

Line String

_LineString :: Prism' [Position t] (GeoJSON LineString t) Source

convert from/to LineString. Must have 2 or more elements.

Linear Ring

_LinearRing :: BaseType t => Prism' (GeoJSON LineString t) (GeoJSON LinearRing t) Source

a closed (first elemet == last element) LineString. Must have at least 4 elements.

MultiLineString

Polygon

MultiPolygon

Collection

Geometry Collection

newCollection :: GeoJSONObject a => GeoJSON a t -> GeometryCollection t Source

create a new GeometryCollection with initial element

Support types

Bounding Box

class BaseType t => HasFlatCoordinates a t | a -> t where Source

Represents datatypes which hold one or more Position objects.

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

data GeoJSON a t Source

the base type of all GeoJSON object. see also GeoJSONObject

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