Class OsmElementProcessor

All Implemented Interfaces:
ElementProcessor

public class OsmElementProcessor extends SourceElementProcessor
Provides an element processor implementation for an osm element.
  • Constructor Details

    • OsmElementProcessor

      public OsmElementProcessor(BaseElementProcessor parentProcessor, org.openstreetmap.osmosis.core.task.v0_6.Sink sink, boolean enableDateParsing, boolean validateVersion)
      Creates a new instance (coordinates are required).
      Parameters:
      parentProcessor - The parent of this element processor.
      sink - The sink for receiving processed data.
      enableDateParsing - If true, dates will be parsed from xml data, else the current date will be used thus saving parsing time.
      validateVersion - If true, a version attribute will be checked and validated.
    • OsmElementProcessor

      public OsmElementProcessor(BaseElementProcessor parentProcessor, org.openstreetmap.osmosis.core.task.v0_6.Sink sink, boolean enableDateParsing, boolean validateVersion, boolean coordinatesRequired)
      Creates a new instance.
      Parameters:
      parentProcessor - The parent of this element processor.
      sink - The sink for receiving processed data.
      enableDateParsing - If true, dates will be parsed from xml data, else the current date will be used thus saving parsing time.
      validateVersion - If true, a version attribute will be checked and validated.
      coordinatesRequired - If true, nodes without lat and lon attributes set will cause an exception.
  • Method Details

    • begin

      public void begin(Attributes attributes)
      Initialises the element processor with attributes for a new element to be processed.
      Parameters:
      attributes - The attributes of the new element.
    • getChild

      public ElementProcessor getChild(String uri, String localName, String qName)
      Retrieves the appropriate child element processor for the newly encountered nested element.
      Specified by:
      getChild in interface ElementProcessor
      Overrides:
      getChild in class BaseElementProcessor
      Parameters:
      uri - The element uri.
      localName - The element localName.
      qName - The element qName.
      Returns:
      The appropriate element processor for the nested element.
    • end

      public void end()
      Finalises processing for the element processor, this is called when the end of an element is reached.