geojson-1.3.3: A thin GeoJSON Layer above the aeson library

Copyright(C) 2014-2018 HS-GeoJSON Project
LicenseBSD-style (see the file LICENSE.md)
MaintainerAndrew Newman
Safe HaskellNone
LanguageHaskell2010

Data.Geospatial

Contents

Description

Synopsis

Types

type GeoPositionWithoutCRS = [Double] Source #

(GeoPositionWithoutCRS is a catch all for indeterminate CRSs and for expression of positions before a CRS has been determined

data GeoPosition Source #

see Section 2.1.1 Position in the GeoJSON Spec, I make the assumption here that the only position types we will use will involve easting or northing (+ve or -ve Altitude) or lon or lat (+ve or -ve Altitude)

splitGeoMultiPoint :: GeoMultiPoint -> [GeoPoint] Source #

Split GeoMultiPoint coordinates into multiple GeoPoints

mergeGeoPoints :: [GeoPoint] -> GeoMultiPoint Source #

Merge multiple GeoPoints into one GeoMultiPoint

splitGeoMultiPolygon :: GeoMultiPolygon -> [GeoPolygon] Source #

Split GeoMultiPolygon coordinates into multiple GeoPolygons

mergeGeoPolygons :: [GeoPolygon] -> GeoMultiPolygon Source #

Merge multiple GeoPolygons into one GeoMultiPolygon

splitGeoMultiLine :: GeoMultiLine -> [GeoLine] Source #

Split GeoMultiLine coordinates into multiple GeoLines

mergeGeoLines :: [GeoLine] -> GeoMultiLine Source #

Merge multiple GeoLines into one GeoMultiLine

type Name = Text Source #

type Code = Int Source #

type Href = Text Source #

data CRSObject Source #

See Section 3 Coordinate Reference System Objects in the GeoJSON Spec NoCRS is required because no crs attribute in a GeoJSON feature is NOT the same thing as a null crs attribute. no crs value implies the default CRS, while a null CRS means you cannot assume a CRS, null will mapped to NoCRS while a non-existent attribute will be mapped to a Nothing Maybe value

Instances
Eq CRSObject Source # 
Instance details

Defined in Data.Geospatial.Internal.CRS

Show CRSObject Source # 
Instance details

Defined in Data.Geospatial.Internal.CRS

ToJSON CRSObject Source #

encode CRS Objects to GeoJSON

Instance details

Defined in Data.Geospatial.Internal.CRS

FromJSON CRSObject Source #

decode CRS Objects from GeoJSON

Aeson doesnt decode "null" to Null unfortunately

Instance details

Defined in Data.Geospatial.Internal.CRS

type BoundingBoxWithoutCRS = [Double] Source #

See Section 4 Bounding Boxes of the GeoJSON spec, The length of the list/array must be 2*n where n is the dimensionality of the position type for the CRS with min values first followed by the max values, wich both the min/max sets following the same axis order as the CRS, e.g for WGS84: minLongitude, minLatitude, maxLongitude, maxLatitude The spec mentions that it can be part of a geometry object too but doesnt give an example, This implementation will ignore bboxes on Geometry objects, they can be added if required.

data GeoFeature a Source #

See Section 2.2 Feature Objects of the GeoJSON spec. Parameterised on the property type

Instances
Eq a => Eq (GeoFeature a) Source # 
Instance details

Defined in Data.Geospatial.Internal.GeoFeature

Methods

(==) :: GeoFeature a -> GeoFeature a -> Bool #

(/=) :: GeoFeature a -> GeoFeature a -> Bool #

Show a => Show (GeoFeature a) Source # 
Instance details

Defined in Data.Geospatial.Internal.GeoFeature

ToJSON a => ToJSON (GeoFeature a) Source #

Encodes Feature objects to GeoJSON

Instance details

Defined in Data.Geospatial.Internal.GeoFeature

FromJSON a => FromJSON (GeoFeature a) Source #

Decodes Feature objects from GeoJSON

Instance details

Defined in Data.Geospatial.Internal.GeoFeature

Functions

stripCRSFromPosition :: GeoPosition -> GeoPositionWithoutCRS Source #

the GeoPosition is a bit special in that when you convert it to GeoJSON, it will lose the CRS info attached to it and cannot be read back in from the GeoJSON. Hence it is ineligible for the FromJSON type class, so this function will strip it down to a GeoPositionWithoutCRS, which is eligible

defaultCRS :: CRSObject Source #

The default CRS according to Section 3 Coordinate Reference System Objects is WGS84 which I believe, from http://spatialreference.org/ref/epsg/4326/ which translates to this in JSON: http://spatialreference.org/ref/epsg/4326/json/) is represented thus:

Lenses

Geometry Lenses

Feature Lenses

properties :: forall a a. Lens (GeoFeature a) (GeoFeature a) a a Source #

Prisms

Geometry

CRS