| Copyright | (c) Azavea, 2016 |
|---|---|
| License | Apache 2 |
| Maintainer | Colin Woodbury <cwoodbury@azavea.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Geography.VectorTile.Geometry
Description
- class Geometry g where
- type Point = (Int, Int)
- newtype LineString = LineString {}
- data Polygon = Polygon {}
- area :: Polygon -> Float
- surveyor :: Vector Point -> Float
- distance :: Point -> Point -> Float
- data Command
- commands :: [Word32] -> Either Text [Command]
- uncommands :: [Command] -> [Word32]
- zig :: Int -> Word32
- unzig :: Word32 -> Int
Geometries
Types
class Geometry g where Source #
Any classical type considered a GIS "geometry". These must be able
to convert between an encodable list of Commands.
Minimal complete definition
Methods
fromCommands :: [Command] -> Either Text (Vector g) Source #
toCommands :: Vector g -> [Command] Source #
Instances
| Geometry Polygon Source # | A valid An Exterior Ring, followed by 0 or more Interior Rings. Any Ring must have a Performs no sanity checks for malformed Interior Rings. |
| Geometry LineString Source # | A valid A |
| Geometry Point Source # | A valid |
type Point = (Int, Int) Source #
Points in space. Using "Record Pattern Synonyms" here allows us to treat
Point like a normal ADT, while its implementation remains an unboxed
(Int,Int).
newtype LineString Source #
Constructors
| LineString | |
Instances
| Eq LineString Source # | |
| Show LineString Source # | |
| Generic LineString Source # | |
| NFData LineString Source # | |
| Geometry LineString Source # | A valid A |
| Geom LineString Source # | |
| type Rep LineString Source # | |
A polygon aware of its interior rings.
Instances
| Eq Polygon Source # | |
| Show Polygon Source # | |
| Generic Polygon Source # | |
| NFData Polygon Source # | |
| Geometry Polygon Source # | A valid An Exterior Ring, followed by 0 or more Interior Rings. Any Ring must have a Performs no sanity checks for malformed Interior Rings. |
| Geom Polygon Source # | |
| type Rep Polygon Source # | |
Operations
area :: Polygon -> Float Source #
The area of a Polygon is the difference between the areas of its
outer ring and inner rings.
Commands
The possible commands, and the values they hold.
commands :: [Word32] -> Either Text [Command] Source #
Attempt to parse a list of Command/Parameter integers, as defined here:
https://github.com/mapbox/vector-tile-spec/tree/master/2.1#43-geometry-encoding
uncommands :: [Command] -> [Word32] Source #
Convert a list of parsed Commands back into their original Command
and Z-encoded Parameter integer forms.