Class Addresses
java.lang.Object
org.openstreetmap.josm.data.validation.Test
org.openstreetmap.josm.data.validation.tests.Addresses
- All Implemented Interfaces:
OsmPrimitiveVisitor
Performs validation tests on addresses (addr:housenumber) and associatedStreet relations.
- Since:
- 5644
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.validation.Test
Test.TagTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprivate final JCheckBoxprotected static final intprivate static final Stringprotected static final intprotected static final intprivate booleanprivate Map<String,Collection<OsmPrimitive>> protected static final DoublePropertyprotected static final DoublePropertyprotected static final intprotected static final intprotected static final Stringprotected static final intprivate static final BooleanPropertyprivate static final StringFields inherited from class org.openstreetmap.josm.data.validation.Test
checkBeforeUpload, checkEnabled, description, enabled, errors, IN_DOWNLOADED_AREA, IN_DOWNLOADED_AREA_STRICT, isBeforeUpload, name, partialSelection, progressMonitor, stopwatch, testBeforeUpload -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAllow the tester to manage its own preferencesprotected voidcheckDistance(OsmPrimitive house, Collection<Way> street) protected TestErrorChecks for house numbers for which the street is unknown.private voidCheck if an associatedStreet Relation is obsolete.private voidadds the OsmPrimitive to the address map if it complies to the restrictionsvoidendTest()Notification of the end of the test.expandHouseNumber(String houseNumber) Split addr:housenumber on , and ; (common separators)remove obsolete relation.(package private) static doublereturns rough distance between two OsmPrimitives(package private) static booleanprotected voidinitAddressMap(OsmPrimitive primitive) booleanReturns true if the given error can be fixed automaticallyprivate static booleanisInWarnCountry(RelationMember m, String[] countryCodes) (package private) static booleanbooleanok()Called when the used submits the preferencesvoidstartTest(ProgressMonitor progressMonitor) Start the test using a given progress monitorvoidVisiting call for points.voidVisiting call for relations.voidVisiting call for lines.Methods inherited from class org.openstreetmap.josm.data.validation.Test
clear, deletePrimitivesIfNeeded, getErrors, getName, getSource, initialize, isBuilding, isCanceled, isPrimitiveUsable, isResidentialArea, removeIrrelevantErrors, setBeforeUpload, setPartialSelection, setShowElements, testBeforeUpload, visit
-
Field Details
-
HOUSE_NUMBER_WITHOUT_STREET
- See Also:
-
DUPLICATE_HOUSE_NUMBER
- See Also:
-
MULTIPLE_STREET_NAMES
- See Also:
-
MULTIPLE_STREET_RELATIONS
- See Also:
-
HOUSE_NUMBER_TOO_FAR
- See Also:
-
OBSOLETE_RELATION
- See Also:
-
MAX_DUPLICATE_DISTANCE
-
MAX_STREET_DISTANCE
-
ADDR_HOUSE_NUMBER
- See Also:
-
ADDR_INTERPOLATION
- See Also:
-
ADDR_NEIGHBOURHOOD
- See Also:
-
ADDR_PLACE
- See Also:
-
ADDR_STREET
- See Also:
-
ADDR_SUBURB
- See Also:
-
ADDR_CITY
- See Also:
-
ADDR_UNIT
- See Also:
-
ADDR_FLATS
- See Also:
-
ADDR_HOUSE_NAME
- See Also:
-
ADDR_POSTCODE
- See Also:
-
ASSOCIATED_STREET
- See Also:
-
NAME_TAG
- See Also:
-
HOUSE
- See Also:
-
STREET
- See Also:
-
PREF_INCLUDE_BLDG_POI
-
checkboxIncludeBldgPOI
-
includeBldgAndPOI
-
knownAddresses
-
ignoredAddresses
-
-
Constructor Details
-
Addresses
public Addresses()Constructor
-
-
Method Details
-
getAndCheckAssociatedStreets
-
checkHouseNumbersWithoutStreet
Checks for house numbers for which the street is unknown.- Parameters:
p- primitive to test- Returns:
- error found, or null
-
isPOI
-
hasAddress
-
collectAddress
adds the OsmPrimitive to the address map if it complies to the restrictions- Parameters:
p- OsmPrimitive that has an address
-
initAddressMap
-
startTest
Description copied from class:TestStart the test using a given progress monitor -
endTest
Description copied from class:TestNotification of the end of the test. The tester may perform additional actions and destroy the used structures.If you override this method, don't forget to cleanup
progressMonitor(most overrides callsuper.endTest()to do this). -
checkForDuplicate
-
getSimplifiedAddresses
-
expandHouseNumber
Split addr:housenumber on , and ; (common separators)- Parameters:
houseNumber- The housenumber to be split- Returns:
- A list of addr:housenumber equivalents
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for points.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
n- The node to inspect.
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for lines.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
w- The way to inspect.
-
visit
Description copied from interface:OsmPrimitiveVisitorVisiting call for relations.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Overrides:
visitin classTest- Parameters:
r- The relation to inspect.
-
getDistance
returns rough distance between two OsmPrimitives- Parameters:
a- primitive ab- primitive b- Returns:
- distance of center of bounding boxes in meters
-
checkDistance
-
checkIfObsolete
Check if an associatedStreet Relation is obsolete. This test marks only those relations which are complete and don't contain any information which isn't also tagged on the members. The strategy is to avoid any false positive.- Parameters:
r- the relation
-
isInWarnCountry
-
fixError
remove obsolete relation. -
isFixable
Description copied from class:TestReturns true if the given error can be fixed automatically -
addGui
Description copied from class:TestAllow the tester to manage its own preferences -
ok
Description copied from class:TestCalled when the used submits the preferences
-