|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.yaac.osm.OsmXmlSegmenter
public class OsmXmlSegmenter
This class parses an OpenStreetMaps compressed XML file into a series of one-degree "square" tiles of map data, stored in a compact binary format suitable for efficient and fast rendering.
Special Java command-line parameters can be defined with the -D option to alter the operation of this class. These are:
Constructor Summary | |
---|---|
OsmXmlSegmenter()
|
Method Summary | |
---|---|
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,
long[] numBytesTransferred,
long[] totalTransferTime,
boolean refreshExisting)
Download one tile file (ways or nodes) from a specific tile directory. |
static void |
loadPrecompiledTiles(double radius,
double lat,
double lon,
ChangeSet copiedServerChangeSet,
boolean showProgressDialog,
boolean refreshExisting)
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OsmXmlSegmenter()
Method Detail |
---|
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 import
java.io.IOException
- if the input file cannot be read or any of the output files cannot be written
javax.xml.parsers.ParserConfigurationException
- if the Java runtime's XML parser cannot handle its configuration parameters
org.xml.sax.SAXException
- if the XML parser cannot decodepublic static void loadPrecompiledTiles(double radius, double lat, double lon, ChangeSet copiedServerChangeSet, boolean showProgressDialog, boolean refreshExisting)
radius
- radius in kilometers around the center point to be downloadedlat
- center point latitude in degrees Northlon
- center point longitude in degrees EastcopiedServerChangeSet
- 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 installationrefreshExisting
- if boolean true, ignore the radius, lat, and lon parameters, and just refresh
every tile currently existing in the local tiledir with the version from the
webserverpublic static boolean downloadTileFile(java.lang.String hostIpAddress, java.io.File tileDir, int bLat, int bLon, java.lang.String suffix, StatusListener pd, long[] numBytesTransferred, long[] totalTransferTime, boolean refreshExisting) 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)numBytesTransferred
- OUT parameter to accumulate the number of data bytes transferredtotalTransferTime
- OUT parameter to accumulate the time spent transferring data (in milliseconds)refreshExisting
- if boolean true, skip downloading tiles that did not exist previously
java.io.IOException
- if data cannot be transferred for some reason
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |