gis-tools-ts - v0.6.0
    Preparing search index...

    Class OSMFileReader

    OSM File Reader

    Parses OSM PBF files Implements the FeatureIterator interface

    import { OSMFileReader } from 'gis-tools-ts/file';

    const reader = new OSMFileReader('./data.osm.pbf');

    // pull out the header
    const header = reader.getHeader();

    // read the features
    for (const feature of reader) {
    console.log(feature);
    }

    // close the reader when done
    reader.close();

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    addBBox: boolean

    If set to true, add a bbox property to each feature

    User defined options to apply when reading the OSM file

    removeEmptyNodes: boolean

    if true, remove nodes that have no tags [Default = true]

    skipNodes: boolean

    If set to true, nodes will be skipped

    skipRelations: boolean

    If set to true, relations will be skipped

    skipWays: boolean

    If set to true, ways will be skipped

    tagFilter?: TagFilter

    If provided, filters of the

    upgradeWaysToAreas: boolean

    If set to true, ways will be converted to areas if they are closed. NOTE: They are upgraded anyways if the tag "area" is set to "yes". [Default = false]

    Methods

    • Close out the data which will cleanup any temporary files if they exist

      Returns void

    • Parameters

      • id: number

        The id of the node to retrieve

      Returns Promise<
          | undefined
          | VectorFeature<
              OSMMetadata,
              Properties,
              OSMProperties,
              VectorPointGeometry,
          >,
      >

      • The node