public class OSMRecordBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.List<OSMFilter> |
filters |
private com.vividsolutions.jts.geom.GeometryFactory |
geometryFactory |
java.util.List<OSMRelation> |
incompleteRelations |
OSMIndex |
nodeIndex |
OSMIndex |
relationIndex |
OSMIndex |
wayIndex |
Constructor and Description |
---|
OSMRecordBuilder(java.util.List<OSMFilter> tagFilters) |
Modifier and Type | Method and Description |
---|---|
OSMRecord |
createOSMRecord(OSMNode n)
Constructs an OSMRecord object from a parsed OSM node.
|
OSMRecord |
createOSMRecord(OSMRelation r)
Constructs an OSMRecord object from a parsed OSM relation.
|
OSMRecord |
createOSMRecord(OSMWay w)
Constructs an OSMRecord object from a parsed OSM way.
|
private static java.lang.String |
getCategory(java.util.Map<java.lang.String,java.lang.String> tags)
Assign a category to a OSM feature (node, way, or relation) based on its tags.
|
private static java.lang.String |
getCategoryRecursive(OSMFilter filter,
java.util.Map<java.lang.String,java.lang.String> tags,
java.lang.String key)
Recursively search in the classification hierarchy to match the given tag (key).
|
private int |
rearrangeRings(com.vividsolutions.jts.geom.LineString[] ways,
int numWays,
com.vividsolutions.jts.geom.LinearRing[] rings,
int numRings)
Examines all OSM way objects and checks whether they can construct a new ring (closed polyline) or update an existing one.
|
public static java.util.List<OSMFilter> filters
private com.vividsolutions.jts.geom.GeometryFactory geometryFactory
public OSMIndex nodeIndex
public OSMIndex wayIndex
public OSMIndex relationIndex
public java.util.List<OSMRelation> incompleteRelations
public OSMRecordBuilder(java.util.List<OSMFilter> tagFilters)
private static java.lang.String getCategory(java.util.Map<java.lang.String,java.lang.String> tags)
tags
- Key-value pairs for OSM tags and their respective values for a given feature.private static java.lang.String getCategoryRecursive(OSMFilter filter, java.util.Map<java.lang.String,java.lang.String> tags, java.lang.String key)
filter
- Correspondence of OSM tags into categories.tags
- Key-value pairs for OSM tags and their respective values for a given feature.key
- Tag at any level in the classification hierarchy.public OSMRecord createOSMRecord(OSMNode n)
n
- A parsed OSM node.public OSMRecord createOSMRecord(OSMWay w)
w
- A parsed OSM way.private int rearrangeRings(com.vividsolutions.jts.geom.LineString[] ways, int numWays, com.vividsolutions.jts.geom.LinearRing[] rings, int numRings)
ways
- Array of all the OSM ways identified in the feature.numWays
- Number of OSM ways identified.rings
- Array of all linear rings identified in the feature.numRings
- Number of linear rings identified.public OSMRecord createOSMRecord(OSMRelation r)
r
- A parsed OSM relation.