Public Member Functions | |
void | loadOSM (File file) |
boolean | WGS84toUTM (double[] result, double longitude, double latitude, boolean calculateZone, double longitudeMiddle, boolean highPrecision) |
Static Public Member Functions | |
static OSMLoader | getInstance () |
A class including functionality to import streets from the OpenStreetMap project. Implemented as Singleton.
|
inlinestatic |
Gets the single instance of OSM_Loader.
|
inline |
Function to load in an OSM map in OSM Protocol version 0.5. See the protocol specifications the other wiki entries and the source annotations for details. This functions expects an already downloaded file from a bounding box link like http://api.openstreetmap.org/api/0.5/map?bbox=11.54,48.14,11.543,48.145 or created by Osmosis as an input.
The parsing code assumes that all nodes are declared before the first way comes (which is so in all currently known OSM files).
Notes:
file | the file to import |
|
inline |
Convert a WGS84 coordinate to the Universal Transverse Mercator coordinate system.
result | an array which can be used to store the results. The array must consist of at least two elements. The x coordinate will be stored in result[0] , the y coordinate in result[1] (both have meters as scale) |
latitude | the latitude in the WGS84 system |
longitude | the longitude in the WGS84 system |
calculateZone | true if the zone should be calculated, false if you want to set your own longitudeOrigin |
longitudeMiddle | used to set your own longitude as the middle of the UTM zone (only used if calculateZone=false !). Note that using this gives results which are not conforming to UTM anymore.If you have multiple locations in normally different UTM zones you can use this to get correct distances between all locations. The value for this variable should be the same for all your locations and it should also be near your other locations (ideally the one in the middle of all). |
highPrecision | If some higher order terms for calculation should be used. Setting to true needs more performance but gives more precision in the sub-millimeter-range.Normally setting to false should be fine! |
true
if calculation succeeded, else false
(error in your input!)