vectortiles-1.2.0.1: GIS Vector Tiles, as defined by Mapbox.

Copyright(c) Azavea 2016
LicenseApache 2
MaintainerColin Woodbury <cwoodbury@azavea.com>
Safe HaskellNone
LanguageHaskell2010

Geography.VectorTile.Geometry

Contents

Description

 

Synopsis

Geometries

Types

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).

x :: (Int, Int) -> Int Source #

y :: (Int, Int) -> Int Source #

newtype LineString Source #

newtype compiles away to expose only the Vector of unboxed Points at runtime.

Constructors

LineString 

Fields

Instances

Eq LineString Source # 
Show LineString Source # 
Generic LineString Source # 

Associated Types

type Rep LineString :: * -> * #

NFData LineString Source # 

Methods

rnf :: LineString -> () #

ProtobufGeom LineString Source #

A valid RawFeature of linestrings must contain pairs of:

A MoveTo with a count of 1, followed by one LineTo command with a count greater than 0.

type Rep LineString Source # 
type Rep LineString = D1 (MetaData "LineString" "Geography.VectorTile.Geometry" "vectortiles-1.2.0.1-F6RPPjOPOz91TZHyloDVZH" True) (C1 (MetaCons "LineString" PrefixI True) (S1 (MetaSel (Just Symbol "lsPoints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Point))))

data Polygon Source #

A polygon aware of its interior rings.

Constructors

Polygon 

Instances

Eq Polygon Source # 

Methods

(==) :: Polygon -> Polygon -> Bool #

(/=) :: Polygon -> Polygon -> Bool #

Show Polygon Source # 
Generic Polygon Source # 

Associated Types

type Rep Polygon :: * -> * #

Methods

from :: Polygon -> Rep Polygon x #

to :: Rep Polygon x -> Polygon #

NFData Polygon Source # 

Methods

rnf :: Polygon -> () #

ProtobufGeom Polygon Source #

A valid RawFeature of polygons must contain at least one sequence of:

An Exterior Ring, followed by 0 or more Interior Rings.

Any Ring must have a MoveTo with a count of 1, a single LineTo with a count of at least 2, and a single ClosePath command.

Performs no sanity checks for malformed Interior Rings.

type Rep Polygon Source # 
type Rep Polygon = D1 (MetaData "Polygon" "Geography.VectorTile.Geometry" "vectortiles-1.2.0.1-F6RPPjOPOz91TZHyloDVZH" False) (C1 (MetaCons "Polygon" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "polyPoints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Point))) (S1 (MetaSel (Just Symbol "inner") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Polygon)))))

Operations

area :: Polygon -> Float Source #

The area of a Polygon is the difference between the areas of its outer ring and inner rings.

surveyor :: Vector Point -> Float Source #

The surveyor's formula for calculating the area of a Polygon. If the value reported here is negative, then the Polygon should be considered an Interior Ring.

Assumption: The Vector given has at least 4 Points.

distance :: Point -> Point -> Float Source #

Euclidean distance.