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

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

Geography.VectorTile.Protobuf

Contents

Description

Most of the details of Protobuf conversion are kept in Geometry.VectorTile.Protobuf.Internal, a module which is not intended to be imported.

A user's main concern here should be the Protobuffable class, and its VectorTile instance. With it, one can do the following:

import Geography.VectorTile.Protobuf

decode bytes >>= fromProtobuf  -- Either Text VectorTile

which in fact is sugared in the top-level module of this library as:

decode bytes >>= tile

Synopsis

Types

class Protobuffable a where Source #

A type which can be converted to and from an underlying Protobuf type, according to the Protobuf type family.

Minimal complete definition

fromProtobuf, toProtobuf

ByteString Encoding / Decoding

decode :: ByteString -> Either Text RawVectorTile Source #

Attempt to decode a ByteString of raw protobuf data into a mid-level representation of a RawVectorTile.

encode :: RawVectorTile -> ByteString Source #

Encode a mid-level representation of a RawVectorTile into raw protobuf data.

decodeIO :: FilePath -> IO (Either Text RawVectorTile) Source #

Given a filename, attempt to decode bytes read from that file.

encodeIO :: RawVectorTile -> FilePath -> IO () Source #

Write a mid-level representation of a RawVectorTile to a file as raw protobuf data.