Package org.goplanit.osm.util
Class OsmPtVersionSchemeUtils
- java.lang.Object
-
- org.goplanit.osm.util.OsmPtVersionSchemeUtils
-
public class OsmPtVersionSchemeUtils extends Object
Utilities regarding the tagging of OSM entities and the various PT version schemes that exist- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description OsmPtVersionSchemeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isCompatibleWith(OsmPtVersionScheme scheme, Map<String,String> tags)
Check if tags contain entries compatible with the provided Pt scheme given that we are verifying an OSM way/node that might reflect a platform, stop, etc.static boolean
isPtv2StopPositionPtv1Stop(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, Map<String,String> tags)
Verify if the passed on OSM node that is assumed to be recognised as a Ptv2 stop_location is in fact also a Ptv1 stop, either a highway=tram_stop or highway=bus_stop.static OsmPtVersionScheme
isPublicTransportBasedInfrastructure(Map<String,String> tags)
Verify if passed in tags reflect transfer based infrastructure that is eligible (and supported) to be parsed by this class, e.g.
-
-
-
Method Detail
-
isCompatibleWith
public static boolean isCompatibleWith(OsmPtVersionScheme scheme, Map<String,String> tags)
Check if tags contain entries compatible with the provided Pt scheme given that we are verifying an OSM way/node that might reflect a platform, stop, etc.- Parameters:
scheme
- to check againsttags
- to verify- Returns:
- true when present, false otherwise
-
isPublicTransportBasedInfrastructure
public static OsmPtVersionScheme isPublicTransportBasedInfrastructure(Map<String,String> tags)
Verify if passed in tags reflect transfer based infrastructure that is eligible (and supported) to be parsed by this class, e.g. tags related to original PT scheme stops ( railway=halt, railway=tram_stop, highway=bus_stop and highway=platform), or the current v2 PT scheme (public_transport=stop_position, platform, station, stop_area)- Parameters:
tags
- to use- Returns:
- which scheme it is compatible with, NONE if none could be found
-
isPtv2StopPositionPtv1Stop
public static boolean isPtv2StopPositionPtv1Stop(de.topobyte.osm4j.core.model.iface.OsmNode osmNode, Map<String,String> tags)
Verify if the passed on OSM node that is assumed to be recognised as a Ptv2 stop_location is in fact also a Ptv1 stop, either a highway=tram_stop or highway=bus_stop. This is effectively wrongly tagged, but does occur due to confusion regarding the tagging schemes. Therefore we identify this situation allowing the parser to change its behaviour and if it is a Patv1 stop, process it as such if deemed necessary- Parameters:
osmNode
- that is classified as Ptv2 stop_locationtags
- of the stop_location- Returns:
- true when also a Ptv1 stop (bus or tram stop), false otherwise
-
-