Package org.goplanit.osm.util
Class Osm4JUtils
- java.lang.Object
-
- org.goplanit.osm.util.Osm4JUtils
-
public class Osm4JUtils extends Object
Utiilities regarding the use of the OSM4J reader that provides us with raw stream of OSM entities to parse- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static StringOSM_PBF_EXTENSIONosm PBF extension stringstatic StringOSM_XML_EXTENSIONosm XML extension string
-
Constructor Summary
Constructors Constructor Description Osm4JUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static de.topobyte.osm4j.core.access.OsmReadercreateOsm4jReader(File inputFile)Depending on the format create either an OSM or PBF reader based on local file specified by pathstatic de.topobyte.osm4j.core.access.OsmReadercreateOsm4jReader(URL inputSource)Depending on the format create either an OSM or PBF readerstatic Comparator<? super de.topobyte.osm4j.core.model.iface.OsmEntity>createOsmEntityComparator()Create a comparator for osm entities absed on their id.static de.topobyte.osm4j.core.model.iface.EntityTypegetEntityType(de.topobyte.osm4j.core.model.iface.OsmEntity entity)Collect entity type based on the entity
-
-
-
Field Detail
-
OSM_XML_EXTENSION
public static final String OSM_XML_EXTENSION
osm XML extension string- See Also:
- Constant Field Values
-
OSM_PBF_EXTENSION
public static final String OSM_PBF_EXTENSION
osm PBF extension string- See Also:
- Constant Field Values
-
-
Method Detail
-
createOsm4jReader
public static de.topobyte.osm4j.core.access.OsmReader createOsm4jReader(File inputFile)
Depending on the format create either an OSM or PBF reader based on local file specified by path- Parameters:
inputFile- data source to create reader for- Returns:
- osmReader created, null if not possible
-
createOsm4jReader
public static de.topobyte.osm4j.core.access.OsmReader createOsm4jReader(URL inputSource)
Depending on the format create either an OSM or PBF reader- Parameters:
inputSource- data source to create reader for- Returns:
- osmReader created, null if not possible
-
createOsmEntityComparator
public static Comparator<? super de.topobyte.osm4j.core.model.iface.OsmEntity> createOsmEntityComparator()
Create a comparator for osm entities absed on their id. Can only be used within each entittypes as across entity types the ids are NOT unique- Returns:
- entity type based comaprator
-
getEntityType
public static de.topobyte.osm4j.core.model.iface.EntityType getEntityType(de.topobyte.osm4j.core.model.iface.OsmEntity entity)
Collect entity type based on the entity- Parameters:
entity- to check- Returns:
- type extracted
-
-