Class 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
    • Constructor Detail

      • Osm4JUtils

        public Osm4JUtils()
    • 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