public final class OsmUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FALSE_VALUE
A value that should be used to indicate false
|
private static java.util.Set<java.lang.String> |
FALSE_VALUES |
static java.lang.String |
falseval
Discouraged synonym for
FALSE_VALUE |
static java.lang.String |
REVERSE_VALUE
A value that should be used to indicate that a property applies reversed on the way
|
private static java.util.Set<java.lang.String> |
REVERSE_VALUES |
static java.lang.String |
reverseval
Discouraged synonym for
REVERSE_VALUE |
static java.lang.String |
TRUE_VALUE
A value that should be used to indicate true
|
private static java.util.Set<java.lang.String> |
TRUE_VALUES |
static java.lang.String |
trueval
Discouraged synonym for
TRUE_VALUE |
Modifier | Constructor and Description |
---|---|
private |
OsmUtils() |
Modifier and Type | Method and Description |
---|---|
static OsmPrimitive |
createPrimitive(java.lang.String assertion)
Creates a new OSM primitive around (0,0) according to the given assertion.
|
static OsmPrimitive |
createPrimitive(java.lang.String assertion,
LatLon around,
boolean enforceLocation)
Creates a new OSM primitive according to the given assertion.
|
static java.lang.String |
getLayer(IPrimitive w)
Returns the layer value of primitive (null for layer 0).
|
static java.lang.String |
getNamedOsmBoolean(java.lang.String value)
Normalizes the OSM boolean value
|
static java.lang.Boolean |
getOsmBoolean(java.lang.String value)
Converts a string to a boolean value
|
static boolean |
isFalse(java.lang.String value)
Check if a tag value represents a boolean false value
|
static boolean |
isOsmCollectionEditable(java.util.Collection<? extends IPrimitive> collection)
Determines if the given collection contains primitives, and that none of them belong to a locked layer.
|
static boolean |
isReversed(java.lang.String value)
Check if the value is a value indicating that a property applies reversed.
|
static boolean |
isTrue(java.lang.String value)
Check if a tag value represents a boolean true value
|
private static Node |
newNode(LatLon around) |
private static Relation |
newRelation(LatLon around,
boolean enforceLocation) |
private static Way |
newWay(LatLon around,
boolean enforceLocation) |
static java.util.stream.Stream<java.lang.String> |
splitMultipleValues(java.lang.String value)
Splits a tag value by semi-colon value separator.
|
private static final java.util.Set<java.lang.String> TRUE_VALUES
private static final java.util.Set<java.lang.String> FALSE_VALUES
private static final java.util.Set<java.lang.String> REVERSE_VALUES
public static final java.lang.String TRUE_VALUE
public static final java.lang.String FALSE_VALUE
public static final java.lang.String REVERSE_VALUE
public static final java.lang.String trueval
TRUE_VALUE
public static final java.lang.String falseval
FALSE_VALUE
public static final java.lang.String reverseval
REVERSE_VALUE
private OsmUtils()
public static java.lang.Boolean getOsmBoolean(java.lang.String value)
value
- The string to convertBoolean.TRUE
if that string represents a true value,
Boolean.FALSE
if it represents a false value,
null
otherwise.public static java.lang.String getNamedOsmBoolean(java.lang.String value)
value
- The tag valueTRUE_VALUE
,
FALSE_VALUE
public static boolean isReversed(java.lang.String value)
value
- The value to checkpublic static boolean isTrue(java.lang.String value)
value
- The value to checkpublic static boolean isFalse(java.lang.String value)
value
- The value to checkpublic static OsmPrimitive createPrimitive(java.lang.String assertion)
assertion
- The assertion describing OSM primitive (ex: "way name=Foo railway=rail")java.lang.IllegalArgumentException
- if assertion is null or if the primitive type cannot be deduced from itpublic static OsmPrimitive createPrimitive(java.lang.String assertion, LatLon around, boolean enforceLocation)
assertion
- The assertion describing OSM primitive (ex: "way name=Foo railway=rail")around
- the coordinate at which the primitive will be locatedenforceLocation
- if true
, ways and relations will not be empty to force a physical locationjava.lang.IllegalArgumentException
- if assertion is null or if the primitive type cannot be deduced from itprivate static Relation newRelation(LatLon around, boolean enforceLocation)
public static java.lang.String getLayer(IPrimitive w)
w
- OSM primitivepublic static boolean isOsmCollectionEditable(java.util.Collection<? extends IPrimitive> collection)
collection
- collection of OSM primitivestrue
if the given collection is not empty and does not contain any primitive in a locked layer.public static java.util.stream.Stream<java.lang.String> splitMultipleValues(java.lang.String value)
value
- the value to separate