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

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

Geography.VectorTile.VectorTile

Contents

Description

High-level types for representing Vector Tiles.

Synopsis

Types

newtype VectorTile Source #

A high-level representation of a Vector Tile. At its simplest, a tile is just a list of Layers.

There is potential to implement _layers as a Map, with its String-based name as a key.

Constructors

VectorTile 

Fields

Instances

Eq VectorTile Source # 
Show VectorTile Source # 
Generic VectorTile Source # 

Associated Types

type Rep VectorTile :: * -> * #

NFData VectorTile Source # 

Methods

rnf :: VectorTile -> () #

type Rep VectorTile Source # 
type Rep VectorTile = D1 (MetaData "VectorTile" "Geography.VectorTile.VectorTile" "vectortiles-1.1.0-2KEkSyh5MAfGuRGC2gwnp0" True) (C1 (MetaCons "VectorTile" PrefixI True) (S1 (MetaSel (Just Symbol "_layers") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector Layer))))

data Layer Source #

A layer, which could contain any number of Features of any Geometry type. This codec only respects the canonical three Geometry types, and we split them here explicitely to allow for more fine-grained access to each type.

Constructors

Layer 

Fields

data Feature g Source #

A geographic feature. Features are a set of geometries that share some common theme:

  • Points: schools, gas station locations, etc.
  • LineStrings: Roads, power lines, rivers, etc.
  • Polygons: Buildings, water bodies, etc.

Where, for instance, all school locations may be stored as a single Feature, and no Point within that Feature would represent anything else.

Note: Each Geometry type and their Multi* counterpart are considered the same thing, as a Vector of that Geometry.

Constructors

Feature 

Fields

Instances

Eq g => Eq (Feature g) Source # 

Methods

(==) :: Feature g -> Feature g -> Bool #

(/=) :: Feature g -> Feature g -> Bool #

Show g => Show (Feature g) Source # 

Methods

showsPrec :: Int -> Feature g -> ShowS #

show :: Feature g -> String #

showList :: [Feature g] -> ShowS #

Generic (Feature g) Source # 

Associated Types

type Rep (Feature g) :: * -> * #

Methods

from :: Feature g -> Rep (Feature g) x #

to :: Rep (Feature g) x -> Feature g #

NFData g => NFData (Feature g) Source # 

Methods

rnf :: Feature g -> () #

type Rep (Feature g) Source # 
type Rep (Feature g) = D1 (MetaData "Feature" "Geography.VectorTile.VectorTile" "vectortiles-1.1.0-2KEkSyh5MAfGuRGC2gwnp0" False) (C1 (MetaCons "Feature" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_featureId") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int)) ((:*:) (S1 (MetaSel (Just Symbol "_metadata") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Map Text Val))) (S1 (MetaSel (Just Symbol "_geometries") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Vector g))))))

data Val Source #

Legal Metadata Value types. Note that S64 are Z-encoded automatically by the underlying Data.ProtocolBuffers library.

Lenses

This section can be safely ignored if one isn't concerned with lenses. Otherwise, see the following for a good primer on Haskell lenses: http://hackage.haskell.org/package/lens-tutorial-1.0.1/docs/Control-Lens-Tutorial.html

These lenses are written in a generic way to avoid taking a dependency on one of the lens libraries.

layers :: Functor f => (Vector Layer -> f (Vector Layer)) -> VectorTile -> f VectorTile Source #

Lens' VectorTile (Vector Layer)

version :: Functor f => (Int -> f Int) -> Layer -> f Layer Source #

Lens' Layer Int

name :: Functor f => (Text -> f Text) -> Layer -> f Layer Source #

Lens' Layer Text

points :: Functor f => (Vector (Feature Point) -> f (Vector (Feature Point))) -> Layer -> f Layer Source #

Lens' Layer (Vector (Feature Point))

linestrings :: Functor f => (Vector (Feature LineString) -> f (Vector (Feature LineString))) -> Layer -> f Layer Source #

Lens' Layer (Vector (Feature LineString)))

polygons :: Functor f => (Vector (Feature Polygon) -> f (Vector (Feature Polygon))) -> Layer -> f Layer Source #

Lens' Layer (Vector (Feature Polygon)))

extent :: Functor f => (Int -> f Int) -> Layer -> f Layer Source #

Lens' Layer Int

featureId :: Functor f => (Int -> f Int) -> Feature g -> f (Feature g) Source #

Lens' (Feature g) Int

metadata :: Functor f => (Map Text Val -> f (Map Text Val)) -> Feature g -> f (Feature g) Source #

Lens' (Feature g) (Map Text Val)

geometries :: Functor f => (Vector g -> f (Vector g)) -> Feature g -> f (Feature g) Source #

Lens' (Feature g) (Vector g)