| Copyright | (C) 2014-2021 HS-GeoJSON Project |
|---|---|
| License | BSD-style (see the file LICENSE.md) |
| Maintainer | Andrew Newman |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Geospatial
Description
Refer to the GeoJSON Spec http://www.geojson.org/geojson-spec.html
Synopsis
- type Latitude = Double
- type Longitude = Double
- type Easting = Double
- type Northing = Double
- type Altitude = Double
- data FeatureID
- data GeoPositionWithoutCRS
- data GeoPosition
- newtype GeoPoint = GeoPoint {}
- retrieveXY :: GeoPositionWithoutCRS -> PointXY
- data PointXY = PointXY {}
- data PointXYZ = PointXYZ {}
- data PointXYZM = PointXYZM {}
- newtype GeoMultiPoint = GeoMultiPoint {}
- splitGeoMultiPoint :: GeoMultiPoint -> Seq GeoPoint
- mergeGeoPoints :: Seq GeoPoint -> GeoMultiPoint
- newtype GeoPolygon = GeoPolygon {}
- newtype GeoMultiPolygon = GeoMultiPolygon {}
- splitGeoMultiPolygon :: GeoMultiPolygon -> Seq GeoPolygon
- mergeGeoPolygons :: Seq GeoPolygon -> GeoMultiPolygon
- newtype GeoLine = GeoLine {}
- newtype GeoMultiLine = GeoMultiLine {}
- splitGeoMultiLine :: GeoMultiLine -> Seq GeoLine
- mergeGeoLines :: Seq GeoLine -> GeoMultiLine
- data GeospatialGeometry
- type Name = Text
- type Code = Int
- type Href = Text
- type FormatString = Text
- type ProjectionType = Text
- data CRSObject
- data BoundingBoxWithoutCRS
- data GeoFeature a = GeoFeature {}
- reWrapGeometry :: GeoFeature a -> GeospatialGeometry -> GeoFeature a
- data GeoFeatureCollection a = GeoFeatureCollection {}
- stripCRSFromPosition :: GeoPosition -> GeoPositionWithoutCRS
- defaultCRS :: CRSObject
- unGeoPoint :: Iso' GeoPoint GeoPositionWithoutCRS
- unGeoMultiPoint :: Iso' GeoMultiPoint (Seq GeoPositionWithoutCRS)
- unGeoPolygon :: Iso' GeoPolygon (Seq (LinearRing GeoPositionWithoutCRS))
- unGeoLine :: Iso' GeoLine (LineString GeoPositionWithoutCRS)
- unGeoMultiLine :: Iso' GeoMultiLine (Seq (LineString GeoPositionWithoutCRS))
- unGeoMultiPolygon :: Iso' GeoMultiPolygon (Seq (Seq (LinearRing GeoPositionWithoutCRS)))
- bbox :: forall a f. Functor f => (Maybe BoundingBoxWithoutCRS -> f (Maybe BoundingBoxWithoutCRS)) -> GeoFeature a -> f (GeoFeature a)
- geometry :: forall a f. Functor f => (GeospatialGeometry -> f GeospatialGeometry) -> GeoFeature a -> f (GeoFeature a)
- properties :: forall a1 a2 f. Functor f => (a1 -> f a2) -> GeoFeature a1 -> f (GeoFeature a2)
- featureId :: forall a f. Functor f => (Maybe FeatureID -> f (Maybe FeatureID)) -> GeoFeature a -> f (GeoFeature a)
- boundingbox :: forall a f. Functor f => (Maybe BoundingBoxWithoutCRS -> f (Maybe BoundingBoxWithoutCRS)) -> GeoFeatureCollection a -> f (GeoFeatureCollection a)
- geofeatures :: forall a1 a2 f. Functor f => (Seq (GeoFeature a1) -> f (Seq (GeoFeature a2))) -> GeoFeatureCollection a1 -> f (GeoFeatureCollection a2)
- class HasGeoPositionWithoutCRS c where
- _NoGeometry :: Prism' GeospatialGeometry ()
- _Point :: Prism' GeospatialGeometry GeoPoint
- _MultiPoint :: Prism' GeospatialGeometry GeoMultiPoint
- _Polygon :: Prism' GeospatialGeometry GeoPolygon
- _MultiPolygon :: Prism' GeospatialGeometry GeoMultiPolygon
- _Line :: Prism' GeospatialGeometry GeoLine
- _MultiLine :: Prism' GeospatialGeometry GeoMultiLine
- _Collection :: Prism' GeospatialGeometry (Seq GeospatialGeometry)
- _NoCRS :: Prism' CRSObject ()
- _NamedCRS :: Prism' CRSObject Name
- _EPSG :: Prism' CRSObject Code
- _LinkedCRS :: Prism' CRSObject (Href, FormatString)
Types
Constructors
| FeatureIDText Text | |
| FeatureIDNumber Int |
Instances
data GeoPositionWithoutCRS Source #
Constructors
| GeoEmpty | |
| GeoPointXY PointXY | |
| GeoPointXYZ PointXYZ | |
| GeoPointXYZM PointXYZM |
Instances
| FromJSON GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods parseJSON :: Value -> Parser GeoPositionWithoutCRS # parseJSONList :: Value -> Parser [GeoPositionWithoutCRS] # | |||||
| ToJSON GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods toJSON :: GeoPositionWithoutCRS -> Value # toEncoding :: GeoPositionWithoutCRS -> Encoding # toJSONList :: [GeoPositionWithoutCRS] -> Value # toEncodingList :: [GeoPositionWithoutCRS] -> Encoding # omitField :: GeoPositionWithoutCRS -> Bool # | |||||
| NFData GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods rnf :: GeoPositionWithoutCRS -> () # | |||||
| HasGeoPositionWithoutCRS GeoPositionWithoutCRS Source # | |||||
| Generic GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Associated Types
Methods from :: GeoPositionWithoutCRS -> Rep GeoPositionWithoutCRS x # to :: Rep GeoPositionWithoutCRS x -> GeoPositionWithoutCRS # | |||||
| Show GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods showsPrec :: Int -> GeoPositionWithoutCRS -> ShowS # show :: GeoPositionWithoutCRS -> String # showList :: [GeoPositionWithoutCRS] -> ShowS # | |||||
| Eq GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods (==) :: GeoPositionWithoutCRS -> GeoPositionWithoutCRS -> Bool # (/=) :: GeoPositionWithoutCRS -> GeoPositionWithoutCRS -> Bool # | |||||
| type Rep GeoPositionWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes type Rep GeoPositionWithoutCRS = D1 ('MetaData "GeoPositionWithoutCRS" "Data.Geospatial.Internal.BasicTypes" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) ((C1 ('MetaCons "GeoEmpty" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GeoPointXY" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXY))) :+: (C1 ('MetaCons "GeoPointXYZ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXYZ)) :+: C1 ('MetaCons "GeoPointXYZM" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXYZM)))) | |||||
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)
Constructors
| GeoPoint | |
Fields | |
Instances
| FromJSON GeoPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPoint | |||||
| ToJSON GeoPoint Source # | |||||
| NFData GeoPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPoint | |||||
| Generic GeoPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPoint Associated Types
| |||||
| Show GeoPoint Source # | |||||
| Eq GeoPoint Source # | |||||
| type Rep GeoPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPoint type Rep GeoPoint = D1 ('MetaData "GeoPoint" "Data.Geospatial.Internal.Geometry.GeoPoint" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'True) (C1 ('MetaCons "GeoPoint" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unGeoPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoPositionWithoutCRS))) | |||||
(GeoPositionWithoutCRS is a catch all for indeterminate CRSs and for expression of positions
before a CRS has been determined
Instances
| NFData PointXY Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes | |||||
| Generic PointXY Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Associated Types
| |||||
| Show PointXY Source # | |||||
| Eq PointXY Source # | |||||
| type Rep PointXY Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes type Rep PointXY = D1 ('MetaData "PointXY" "Data.Geospatial.Internal.BasicTypes" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) (C1 ('MetaCons "PointXY" 'PrefixI 'True) (S1 ('MetaSel ('Just "_xyX") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_xyY") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double))) | |||||
Instances
| NFData PointXYZ Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes | |||||
| Generic PointXYZ Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Associated Types
| |||||
| Show PointXYZ Source # | |||||
| Eq PointXYZ Source # | |||||
| type Rep PointXYZ Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes type Rep PointXYZ = D1 ('MetaData "PointXYZ" "Data.Geospatial.Internal.BasicTypes" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) (C1 ('MetaCons "PointXYZ" 'PrefixI 'True) (S1 ('MetaSel ('Just "_xyzX") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Just "_xyzY") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_xyzZ") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))) | |||||
Instances
| NFData PointXYZM Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes | |||||
| Generic PointXYZM Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Associated Types
| |||||
| Show PointXYZM Source # | |||||
| Eq PointXYZM Source # | |||||
| type Rep PointXYZM Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes type Rep PointXYZM = D1 ('MetaData "PointXYZM" "Data.Geospatial.Internal.BasicTypes" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) (C1 ('MetaCons "PointXYZM" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_xyzmX") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_xyzmY") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "_xyzmZ") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_xyzmM") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))) | |||||
newtype GeoMultiPoint Source #
Constructors
| GeoMultiPoint | |
Fields | |
Instances
| FromJSON GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint Methods parseJSON :: Value -> Parser GeoMultiPoint # parseJSONList :: Value -> Parser [GeoMultiPoint] # | |||||
| ToJSON GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint Methods toJSON :: GeoMultiPoint -> Value # toEncoding :: GeoMultiPoint -> Encoding # toJSONList :: [GeoMultiPoint] -> Value # toEncodingList :: [GeoMultiPoint] -> Encoding # omitField :: GeoMultiPoint -> Bool # | |||||
| NFData GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint Methods rnf :: GeoMultiPoint -> () # | |||||
| Generic GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint Associated Types
| |||||
| Show GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint Methods showsPrec :: Int -> GeoMultiPoint -> ShowS # show :: GeoMultiPoint -> String # showList :: [GeoMultiPoint] -> ShowS # | |||||
| Eq GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint Methods (==) :: GeoMultiPoint -> GeoMultiPoint -> Bool # (/=) :: GeoMultiPoint -> GeoMultiPoint -> Bool # | |||||
| type Rep GeoMultiPoint Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPoint type Rep GeoMultiPoint = D1 ('MetaData "GeoMultiPoint" "Data.Geospatial.Internal.Geometry.GeoMultiPoint" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'True) (C1 ('MetaCons "GeoMultiPoint" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unGeoMultiPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq GeoPositionWithoutCRS)))) | |||||
splitGeoMultiPoint :: GeoMultiPoint -> Seq GeoPoint Source #
Split GeoMultiPoint coordinates into multiple GeoPoints
mergeGeoPoints :: Seq GeoPoint -> GeoMultiPoint Source #
Merge multiple GeoPoints into one GeoMultiPoint
newtype GeoPolygon Source #
Constructors
| GeoPolygon | |
Fields | |
Instances
| FromJSON GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon | |||||
| ToJSON GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon Methods toJSON :: GeoPolygon -> Value # toEncoding :: GeoPolygon -> Encoding # toJSONList :: [GeoPolygon] -> Value # toEncodingList :: [GeoPolygon] -> Encoding # omitField :: GeoPolygon -> Bool # | |||||
| NFData GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon Methods rnf :: GeoPolygon -> () # | |||||
| Generic GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon Associated Types
| |||||
| Show GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon Methods showsPrec :: Int -> GeoPolygon -> ShowS # show :: GeoPolygon -> String # showList :: [GeoPolygon] -> ShowS # | |||||
| Eq GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon | |||||
| type Rep GeoPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoPolygon type Rep GeoPolygon = D1 ('MetaData "GeoPolygon" "Data.Geospatial.Internal.Geometry.GeoPolygon" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'True) (C1 ('MetaCons "GeoPolygon" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unGeoPolygon") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq (LinearRing GeoPositionWithoutCRS))))) | |||||
newtype GeoMultiPolygon Source #
Constructors
| GeoMultiPolygon | |
Fields | |
Instances
| FromJSON GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon Methods parseJSON :: Value -> Parser GeoMultiPolygon # parseJSONList :: Value -> Parser [GeoMultiPolygon] # | |||||
| ToJSON GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon Methods toJSON :: GeoMultiPolygon -> Value # toEncoding :: GeoMultiPolygon -> Encoding # toJSONList :: [GeoMultiPolygon] -> Value # toEncodingList :: [GeoMultiPolygon] -> Encoding # omitField :: GeoMultiPolygon -> Bool # | |||||
| NFData GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon Methods rnf :: GeoMultiPolygon -> () # | |||||
| Generic GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon Associated Types
Methods from :: GeoMultiPolygon -> Rep GeoMultiPolygon x # to :: Rep GeoMultiPolygon x -> GeoMultiPolygon # | |||||
| Show GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon Methods showsPrec :: Int -> GeoMultiPolygon -> ShowS # show :: GeoMultiPolygon -> String # showList :: [GeoMultiPolygon] -> ShowS # | |||||
| Eq GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon Methods (==) :: GeoMultiPolygon -> GeoMultiPolygon -> Bool # (/=) :: GeoMultiPolygon -> GeoMultiPolygon -> Bool # | |||||
| type Rep GeoMultiPolygon Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiPolygon type Rep GeoMultiPolygon = D1 ('MetaData "GeoMultiPolygon" "Data.Geospatial.Internal.Geometry.GeoMultiPolygon" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'True) (C1 ('MetaCons "GeoMultiPolygon" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unGeoMultiPolygon") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq (Seq (LinearRing GeoPositionWithoutCRS)))))) | |||||
splitGeoMultiPolygon :: GeoMultiPolygon -> Seq GeoPolygon Source #
Split GeoMultiPolygon coordinates into multiple GeoPolygons
mergeGeoPolygons :: Seq GeoPolygon -> GeoMultiPolygon Source #
Merge multiple GeoPolygons into one GeoMultiPolygon
Constructors
| GeoLine | |
Fields | |
Instances
| FromJSON GeoLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoLine | |||||
| ToJSON GeoLine Source # | |||||
| NFData GeoLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoLine | |||||
| Generic GeoLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoLine Associated Types
| |||||
| Show GeoLine Source # | |||||
| Eq GeoLine Source # | |||||
| type Rep GeoLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoLine type Rep GeoLine = D1 ('MetaData "GeoLine" "Data.Geospatial.Internal.Geometry.GeoLine" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'True) (C1 ('MetaCons "GeoLine" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unGeoLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (LineString GeoPositionWithoutCRS)))) | |||||
newtype GeoMultiLine Source #
Constructors
| GeoMultiLine | |
Fields | |
Instances
| FromJSON GeoMultiLine Source # | |||||
| ToJSON GeoMultiLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiLine Methods toJSON :: GeoMultiLine -> Value # toEncoding :: GeoMultiLine -> Encoding # toJSONList :: [GeoMultiLine] -> Value # toEncodingList :: [GeoMultiLine] -> Encoding # omitField :: GeoMultiLine -> Bool # | |||||
| NFData GeoMultiLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiLine Methods rnf :: GeoMultiLine -> () # | |||||
| Generic GeoMultiLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiLine Associated Types
| |||||
| Show GeoMultiLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiLine Methods showsPrec :: Int -> GeoMultiLine -> ShowS # show :: GeoMultiLine -> String # showList :: [GeoMultiLine] -> ShowS # | |||||
| Eq GeoMultiLine Source # | |||||
| type Rep GeoMultiLine Source # | |||||
Defined in Data.Geospatial.Internal.Geometry.GeoMultiLine type Rep GeoMultiLine = D1 ('MetaData "GeoMultiLine" "Data.Geospatial.Internal.Geometry.GeoMultiLine" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'True) (C1 ('MetaCons "GeoMultiLine" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unGeoMultiLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq (LineString GeoPositionWithoutCRS))))) | |||||
splitGeoMultiLine :: GeoMultiLine -> Seq GeoLine Source #
Split GeoMultiLine coordinates into multiple GeoLines
mergeGeoLines :: Seq GeoLine -> GeoMultiLine Source #
Merge multiple GeoLines into one GeoMultiLine
data GeospatialGeometry Source #
See section 2.1 Geometry Objects in the GeoJSON Spec.
Constructors
| NoGeometry | |
| Point GeoPoint | |
| MultiPoint GeoMultiPoint | |
| Polygon GeoPolygon | |
| MultiPolygon GeoMultiPolygon | |
| Line GeoLine | |
| MultiLine GeoMultiLine | |
| Collection (Seq GeospatialGeometry) |
Instances
| FromJSON GeospatialGeometry Source # | decodes Geometry Objects from GeoJSON Aeson doesnt decode "null" into | ||||
Defined in Data.Geospatial.Internal.Geometry Methods parseJSON :: Value -> Parser GeospatialGeometry # parseJSONList :: Value -> Parser [GeospatialGeometry] # | |||||
| ToJSON GeospatialGeometry Source # | encodes Geometry Objects to GeoJSON | ||||
Defined in Data.Geospatial.Internal.Geometry Methods toJSON :: GeospatialGeometry -> Value # toEncoding :: GeospatialGeometry -> Encoding # toJSONList :: [GeospatialGeometry] -> Value # toEncodingList :: [GeospatialGeometry] -> Encoding # omitField :: GeospatialGeometry -> Bool # | |||||
| NFData GeospatialGeometry Source # | |||||
Defined in Data.Geospatial.Internal.Geometry Methods rnf :: GeospatialGeometry -> () # | |||||
| Generic GeospatialGeometry Source # | |||||
Defined in Data.Geospatial.Internal.Geometry Associated Types
Methods from :: GeospatialGeometry -> Rep GeospatialGeometry x # to :: Rep GeospatialGeometry x -> GeospatialGeometry # | |||||
| Show GeospatialGeometry Source # | |||||
Defined in Data.Geospatial.Internal.Geometry Methods showsPrec :: Int -> GeospatialGeometry -> ShowS # show :: GeospatialGeometry -> String # showList :: [GeospatialGeometry] -> ShowS # | |||||
| Eq GeospatialGeometry Source # | |||||
Defined in Data.Geospatial.Internal.Geometry Methods (==) :: GeospatialGeometry -> GeospatialGeometry -> Bool # (/=) :: GeospatialGeometry -> GeospatialGeometry -> Bool # | |||||
| type Rep GeospatialGeometry Source # | |||||
Defined in Data.Geospatial.Internal.Geometry type Rep GeospatialGeometry = D1 ('MetaData "GeospatialGeometry" "Data.Geospatial.Internal.Geometry" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) (((C1 ('MetaCons "NoGeometry" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Point" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoPoint))) :+: (C1 ('MetaCons "MultiPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoMultiPoint)) :+: C1 ('MetaCons "Polygon" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoPolygon)))) :+: ((C1 ('MetaCons "MultiPolygon" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoMultiPolygon)) :+: C1 ('MetaCons "Line" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoLine))) :+: (C1 ('MetaCons "MultiLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeoMultiLine)) :+: C1 ('MetaCons "Collection" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Seq GeospatialGeometry)))))) | |||||
type FormatString = Text Source #
type ProjectionType = Text 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
data BoundingBoxWithoutCRS 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.
Constructors
| BoundingBoxWithoutCRSXY PointXY PointXY | |
| BoundingBoxWithoutCRSXYZ PointXYZ PointXYZ | |
| BoundingBoxWithoutCRSXYZM PointXYZM PointXYZM |
Instances
| FromJSON BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods parseJSON :: Value -> Parser BoundingBoxWithoutCRS # parseJSONList :: Value -> Parser [BoundingBoxWithoutCRS] # | |||||
| ToJSON BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods toJSON :: BoundingBoxWithoutCRS -> Value # toEncoding :: BoundingBoxWithoutCRS -> Encoding # toJSONList :: [BoundingBoxWithoutCRS] -> Value # toEncodingList :: [BoundingBoxWithoutCRS] -> Encoding # omitField :: BoundingBoxWithoutCRS -> Bool # | |||||
| NFData BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods rnf :: BoundingBoxWithoutCRS -> () # | |||||
| Generic BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Associated Types
Methods from :: BoundingBoxWithoutCRS -> Rep BoundingBoxWithoutCRS x # to :: Rep BoundingBoxWithoutCRS x -> BoundingBoxWithoutCRS # | |||||
| Show BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods showsPrec :: Int -> BoundingBoxWithoutCRS -> ShowS # show :: BoundingBoxWithoutCRS -> String # showList :: [BoundingBoxWithoutCRS] -> ShowS # | |||||
| Eq BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes Methods (==) :: BoundingBoxWithoutCRS -> BoundingBoxWithoutCRS -> Bool # (/=) :: BoundingBoxWithoutCRS -> BoundingBoxWithoutCRS -> Bool # | |||||
| type Rep BoundingBoxWithoutCRS Source # | |||||
Defined in Data.Geospatial.Internal.BasicTypes type Rep BoundingBoxWithoutCRS = D1 ('MetaData "BoundingBoxWithoutCRS" "Data.Geospatial.Internal.BasicTypes" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) (C1 ('MetaCons "BoundingBoxWithoutCRSXY" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXY) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXY)) :+: (C1 ('MetaCons "BoundingBoxWithoutCRSXYZ" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXYZ) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXYZ)) :+: C1 ('MetaCons "BoundingBoxWithoutCRSXYZM" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXYZM) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PointXYZM)))) | |||||
data GeoFeature a Source #
See Section 2.2 Feature Objects of the GeoJSON spec. Parameterised on the property type
Constructors
| GeoFeature | |
Fields | |
Instances
| FromJSON a => FromJSON (GeoFeature a) Source # | Decodes Feature objects from GeoJSON | ||||
Defined in Data.Geospatial.Internal.GeoFeature Methods parseJSON :: Value -> Parser (GeoFeature a) # parseJSONList :: Value -> Parser [GeoFeature a] # omittedField :: Maybe (GeoFeature a) # | |||||
| ToJSON a => ToJSON (GeoFeature a) Source # | Encodes Feature objects to GeoJSON | ||||
Defined in Data.Geospatial.Internal.GeoFeature Methods toJSON :: GeoFeature a -> Value # toEncoding :: GeoFeature a -> Encoding # toJSONList :: [GeoFeature a] -> Value # toEncodingList :: [GeoFeature a] -> Encoding # omitField :: GeoFeature a -> Bool # | |||||
| NFData a => NFData (GeoFeature a) Source # | |||||
Defined in Data.Geospatial.Internal.GeoFeature Methods rnf :: GeoFeature a -> () # | |||||
| Generic (GeoFeature a) Source # | |||||
Defined in Data.Geospatial.Internal.GeoFeature Associated Types
| |||||
| Show a => Show (GeoFeature a) Source # | |||||
Defined in Data.Geospatial.Internal.GeoFeature Methods showsPrec :: Int -> GeoFeature a -> ShowS # show :: GeoFeature a -> String # showList :: [GeoFeature a] -> ShowS # | |||||
| Eq a => Eq (GeoFeature a) Source # | |||||
Defined in Data.Geospatial.Internal.GeoFeature | |||||
| type Rep (GeoFeature a) Source # | |||||
Defined in Data.Geospatial.Internal.GeoFeature type Rep (GeoFeature a) = D1 ('MetaData "GeoFeature" "Data.Geospatial.Internal.GeoFeature" "geojson-4.1.3-39qWD6AMpW6DepGCjU1BIw" 'False) (C1 ('MetaCons "GeoFeature" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_bbox") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe BoundingBoxWithoutCRS)) :*: S1 ('MetaSel ('Just "_geometry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GeospatialGeometry)) :*: (S1 ('MetaSel ('Just "_properties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "_featureId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FeatureID))))) | |||||
reWrapGeometry :: GeoFeature a -> GeospatialGeometry -> GeoFeature a Source #
data GeoFeatureCollection a Source #
See Section 2.3 Feature Collection Objects of the GeoJSON spec
Constructors
| GeoFeatureCollection | |
Fields | |
Instances
| FromJSON a => FromJSON (GeoFeatureCollection a) Source # | Decode FeatureCollection objects from GeoJSON |
Defined in Data.Geospatial.Internal.GeoFeatureCollection Methods parseJSON :: Value -> Parser (GeoFeatureCollection a) # parseJSONList :: Value -> Parser [GeoFeatureCollection a] # omittedField :: Maybe (GeoFeatureCollection a) # | |
| ToJSON a => ToJSON (GeoFeatureCollection a) Source # | Encode FeatureCollection objects to GeoJSON |
Defined in Data.Geospatial.Internal.GeoFeatureCollection Methods toJSON :: GeoFeatureCollection a -> Value # toEncoding :: GeoFeatureCollection a -> Encoding # toJSONList :: [GeoFeatureCollection a] -> Value # toEncodingList :: [GeoFeatureCollection a] -> Encoding # omitField :: GeoFeatureCollection a -> Bool # | |
| Show a => Show (GeoFeatureCollection a) Source # | |
Defined in Data.Geospatial.Internal.GeoFeatureCollection Methods showsPrec :: Int -> GeoFeatureCollection a -> ShowS # show :: GeoFeatureCollection a -> String # showList :: [GeoFeatureCollection a] -> ShowS # | |
| Eq a => Eq (GeoFeatureCollection a) Source # | |
Defined in Data.Geospatial.Internal.GeoFeatureCollection Methods (==) :: GeoFeatureCollection a -> GeoFeatureCollection a -> Bool # (/=) :: GeoFeatureCollection a -> GeoFeatureCollection a -> Bool # | |
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
bbox :: forall a f. Functor f => (Maybe BoundingBoxWithoutCRS -> f (Maybe BoundingBoxWithoutCRS)) -> GeoFeature a -> f (GeoFeature a) Source #
geometry :: forall a f. Functor f => (GeospatialGeometry -> f GeospatialGeometry) -> GeoFeature a -> f (GeoFeature a) Source #
properties :: forall a1 a2 f. Functor f => (a1 -> f a2) -> GeoFeature a1 -> f (GeoFeature a2) Source #
featureId :: forall a f. Functor f => (Maybe FeatureID -> f (Maybe FeatureID)) -> GeoFeature a -> f (GeoFeature a) Source #
boundingbox :: forall a f. Functor f => (Maybe BoundingBoxWithoutCRS -> f (Maybe BoundingBoxWithoutCRS)) -> GeoFeatureCollection a -> f (GeoFeatureCollection a) Source #
geofeatures :: forall a1 a2 f. Functor f => (Seq (GeoFeature a1) -> f (Seq (GeoFeature a2))) -> GeoFeatureCollection a1 -> f (GeoFeatureCollection a2) Source #
Prisms
BasicTypes
class HasGeoPositionWithoutCRS c where Source #
Methods
geoPositionWithoutCRS :: Lens' c GeoPositionWithoutCRS Source #
Instances
Geometry
CRS
_LinkedCRS :: Prism' CRSObject (Href, FormatString) Source #