Postal Address Database from OpenStreetMaps

Among other things, the OpenStreetMap database allows storing actual postal service addresses for locations, buildings, and other structures in the database. As of build#205 of YAAC, the OSM Importer is capable of extracting this additional information and storing it in an SQL database separate from the .ways and .nodes files used to render the street map layer of the YAAC maps, thereby not impacting the map rendering performance of YAAC while still making this information available to other parts of YAAC through the Postal Address DB plugin.

Once the postal address database connection is configured, imports of OpenStreetMap database snapshots will also extract all postal address information and write it to the database in a structure searchable by the Postal Address DB plugin. The database can also be queried to locate postal addresses on the YAAC map windows.

Because the entry of postal address data in OpenStreetMap is not consistent, there is a command-line tool included in the plugin JAR file that attempts to normalize the local database's postal address data to always include the ISO3166 country code in every address record; this tool should be run upon completion of an OSM import. This tool is presently limited to Postgres databases on systems where the Postgres JDBC driver .jar file is installed in the directory /usr/share/java; this limitation may be removed in a future build of the plugin. The author of YAAC will always run this tool before providing the exported postal address data for download by other YAAC users.

To invoke the command-line tool, issue the command:

java -classpath addressdb.jar:YAACMain.jar -Xmx4000m org.ka2ddo.yaac.osm.util.FillInEmptyAddressDbFields jdbc:postgresql://localhost/postal

where "postal" is the example name of the database for the postal address data (it can be named something else).