public abstract class BinaryParser extends Objectimplements BlockReaderAdapter
| Modifier and Type | Field and Description |
|---|---|
protected int |
date_granularity
|
protected int |
granularity
|
static Date |
NODATE
|
| Constructor and Description |
|---|
BinaryParser()
|
| Modifier and Type | Method and Description |
|---|---|
protected Date |
getDate(Osmformat
Take a Info protocol buffer containing a date and convert it into a java Date object
|
protected String |
getStringById(int id)
Get a string based on the index used.
|
protected long |
getTimestamp(Osmformat
|
void |
handleBlock(FileBlock
Called with the data in the block.
|
protected abstract void |
parse(Osmformat
Parse a header message.
|
void |
parse(Osmformat
Parse a Primitive block (containing a string table, other paramaters, and PrimitiveGroups
|
protected abstract void |
parseDense(Osmformat
Parse a DenseNode protocol buffer and send the resulting nodes to a sink.
|
double |
parseLat(long degree)
Convert a latitude value stored in a protobuf into a double, compensating for granularity and latitude offset
|
double |
parseLon(long degree)
Convert a longitude value stored in a protobuf into a double, compensating for granularity and longitude offset
|
protected abstract void |
parseNodes(List
Parse a list of Node protocol buffers and send the resulting nodes to a sink.
|
protected abstract void |
parseRelations(List
Parse a list of Relation protocol buffers and send the resulting relations to a sink.
|
protected abstract void |
parseWays(List
Parse a list of Way protocol buffers and send the resulting ways to a sink.
|
boolean |
skipBlock(FileBlockPosition
Does the reader understand this block? Does it want the data in it? A reference contains the metadata about a block and can saved --- or stored ---- for future random access.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompleteprotected int granularity
protected int date_granularity
public static final DateNODATE
protected DategetDate(Osmformat .Info info)
protected long getTimestamp(Osmformat.Info info)
protected StringgetStringById(int id)
id -
public void handleBlock(FileBlockmessage) throws IOException
BlockReaderAdapter
handleBlock in interface
BlockReaderAdapter
IOException
public boolean skipBlock(FileBlockPositionblock)
BlockReaderAdapter
public double parseLat(long degree)
public double parseLon(long degree)
public void parse(Osmformat.PrimitiveBlock block) throws IOException
IOException
protected abstract void parseRelations(List<Osmformat .Relation > rels) throws IOException
IOException
protected abstract void parseDense(Osmformat.DenseNodes nodes) throws IOException
IOException
protected abstract void parseNodes(List<Osmformat .Node > nodes) throws IOException
IOException -
protected abstract void parseWays(List<Osmformat .Way > ways) throws IOException
IOException
protected abstract void parse(Osmformat.HeaderBlock header) throws IOException
IOException