streaming-osm-1.0.0.1: A hand-written streaming byte parser for OpenStreetMap Protobuf data.

Copyright(c) Azavea 2017
LicenseBSD3
MaintainerColin Woodbury <colin@fosskers.ca>
Safe HaskellNone
LanguageHaskell2010

Streaming.Osm.Internal.Parser

Description

 
Synopsis

Documentation

header :: Parser () Source #

Parse a BlobHeader.

advance :: Int -> Parser () Source #

Borrowed from Attoparsec.

blob :: Parser Blob Source #

Called a Blob in the OSM literature.

block :: Parser Block Source #

Called a PrimitiveBlock in the OSM literature.

stringTable :: Parser (Vector ByteString) Source #

The String Table will never be empty, since all Elements have non-geographic metadata (username, etc.) which contain Strings. The result must be a Vector, since we need random access to its contents.

node :: Vector ByteString -> Parser Node Source #

Parse a Node. Uses unsafeIndex to quickly retrieve its tag Strings, assuming that the Node's key/value pairs will always index a legal value in the given String Table.

dense :: Vector ByteString -> Parser [Node] Source #

Parse a DenseNodes in a similar way to node.

denseTags :: Vector ByteString -> [Int] -> [Map ByteString ByteString] Source #

Interpret a list of flattened key-value pairs as Tag metadata Maps.

denseInfo :: [Int] -> Vector ByteString -> Parser [Maybe Info] Source #

Parse a DenseInfo message.

varint :: Parser Int Source #

Parse some Varint, which may be made up of multiple bytes.

packed :: ByteString -> [Int] Source #

Reparse a ByteString as a list of some Varints.

ints :: ByteString -> [Int] Source #

Decode some packed, Z-encoded, delta-encoded Ints.

offset :: Int -> Double Source #

Restore truncated LatLng values to their true Double representation.

toffset :: Int -> Int Source #

Restore truncated timestamps to the number of millis since the 1970 epoch.

booly :: Int -> Maybe Bool Source #

Try to parse a Bool from a bit.