public class OsmXmlSegmenter
extends java.lang.Object
Special Java command-line parameters can be defined with the -D option to alter the operation of this class. These are:
| Modifier and Type | Class and Description |
|---|---|
static class |
OsmXmlSegmenter.TileDownloadStatistics
Structure of statistics reported by the downloadTileFile() method.
|
| Constructor and Description |
|---|
OsmXmlSegmenter() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
checkDiskSpace(java.lang.String rootTilePath,
long filesize)
Check if sufficient disk space is available to import the OSM file.
|
static boolean |
downloadTileFile(java.lang.String hostIpAddress,
java.io.File tileDir,
int bLat,
int bLon,
java.lang.String suffix,
StatusListener pd,
OsmXmlSegmenter.TileDownloadStatistics statistics,
boolean refreshExisting,
VisibleCtls recordFilter)
Download one tile file (ways or nodes) from a specific tile directory.
|
static void |
loadPrecompiledTiles(ChangeSet copiedServerChangeSet,
boolean showProgressDialog,
GuiIfc.TileDownloadParams tileDownloadParams)
Download already-imported tiles from the program author's website and store them in the
local tile directory.
|
void |
parseXml(NonshareableCountingBufferedDataInputStream bzippedXmlStream,
long inputStreamLength,
java.lang.String filename,
java.lang.String rootTilePath,
double leftLongitude,
double rightLongitude,
double topLatitude,
double bottomLongitude,
boolean useFixMe,
StatusListener listener)
Parse a a compressed XML file into YAAC's version of OpenStreetMap tiles.
|
public java.lang.String checkDiskSpace(java.lang.String rootTilePath,
long filesize)
rootTilePath - String directory path where the tiles files are to be storedfilesize - long byte-count size of the OSM file to read (to estimate resulting tile size)public void parseXml(NonshareableCountingBufferedDataInputStream bzippedXmlStream, long inputStreamLength, java.lang.String filename, java.lang.String rootTilePath, double leftLongitude, double rightLongitude, double topLatitude, double bottomLongitude, boolean useFixMe, StatusListener listener) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
bzippedXmlStream - NonshareableCountingBufferedDataInputStream reading a BZIP2-compressed XML fileinputStreamLength - number of bytes in the compressed file (used to control the progress indicator)filename - name of the file containing the OSM datarootTilePath - String pathname of the configured tile directoryleftLongitude - left longitude bounding box value in degrees EastrightLongitude - right longitude bounding box value in degrees EasttopLatitude - top latitude bounding box value in degrees NorthbottomLongitude - bottom latitude bounding box value in degrees NorthuseFixMe - boolean true if FIXME-tagged elements of the OSM data are to be includedlistener - StatusListener to receive progress report of the importjava.io.IOException - if the input file cannot be read or any of the output files cannot be writtenjavax.xml.parsers.ParserConfigurationException - if the Java runtime's XML parser cannot handle its configuration parametersorg.xml.sax.SAXException - if the XML parser cannot decodepublic static void loadPrecompiledTiles(ChangeSet copiedServerChangeSet, boolean showProgressDialog, GuiIfc.TileDownloadParams tileDownloadParams)
copiedServerChangeSet - the ChangeSet already downloaded from the tile webserver to let the user decide whether to update or notshowProgressDialog - boolean true if a progress dialog should be launched to show the progress of this;
should normally be true, but the configuration wizard sets it to false to not confuse
the neophyte user while they are still configuring their installationtileDownloadParams - GuiIfc.TileDownloadParams structure identifying which tiles and records therein should be downloadedpublic static boolean downloadTileFile(java.lang.String hostIpAddress,
java.io.File tileDir,
int bLat,
int bLon,
java.lang.String suffix,
StatusListener pd,
OsmXmlSegmenter.TileDownloadStatistics statistics,
boolean refreshExisting,
VisibleCtls recordFilter)
throws java.io.IOException
hostIpAddress - String of numeric IP address of webserver (to avoid repeated lookups)tileDir - root directory of the tile hierarchybLat - latitude of tile (degrees only)bLon - longitude of tile (degrees only)suffix - file suffix ".ways" or ".nodes"pd - StatusListener to receive progress reports (or null if progress is not to be reported)statistics - TileDownloadStatistics object to accumulate statisticsrefreshExisting - if boolean true, skip downloading tiles that did not exist previouslyrecordFilter - VisibleEnum struct specifying which WayTypes and AmemityTypes should be accepted, or null to accept everything @return boolean true if a tile was downloaded, false if new tile does not existjava.io.IOException - if data cannot be transferred for some reason