org.openstreetmap.josm.io
Class BoundingBoxDownloader

java.lang.Object
  extended by org.openstreetmap.josm.io.OsmConnection
      extended by org.openstreetmap.josm.io.OsmServerReader
          extended by org.openstreetmap.josm.io.BoundingBoxDownloader

public class BoundingBoxDownloader
extends OsmServerReader


Field Summary
protected  boolean crosses180th
           
protected  double lat1
          The boundings of the desired map data.
protected  double lat2
           
protected  double lon1
           
protected  double lon2
           
 
Fields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, oauthParameters
 
Constructor Summary
BoundingBoxDownloader(Bounds downloadArea)
           
 
Method Summary
private  GpxData downloadRawGps(java.lang.String url, ProgressMonitor progressMonitor)
           
protected  java.lang.String getRequestForBbox(double lon1, double lat1, double lon2, double lat2)
           
 DataSet parseOsm(ProgressMonitor progressMonitor)
          Read the data from the osm server address.
 GpxData parseRawGps(ProgressMonitor progressMonitor)
          Retrieve raw gps waypoints from the server API.
 
Methods inherited from class org.openstreetmap.josm.io.OsmServerReader
getBaseUrl, getInputStream, getInputStreamRaw, isDoAuthenticate, parseOsmBzip2, parseOsmChange, parseOsmChangeBzip2, parseOsmChangeGzip, parseOsmGzip, setDoAuthenticate
 
Methods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuthAuthorizationHeader, cancel, isCanceled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lat1

protected final double lat1
The boundings of the desired map data.


lon1

protected final double lon1

lat2

protected final double lat2

lon2

protected final double lon2

crosses180th

protected final boolean crosses180th
Constructor Detail

BoundingBoxDownloader

public BoundingBoxDownloader(Bounds downloadArea)
Method Detail

downloadRawGps

private GpxData downloadRawGps(java.lang.String url,
                               ProgressMonitor progressMonitor)
                        throws java.io.IOException,
                               OsmTransferException,
                               org.xml.sax.SAXException
Throws:
java.io.IOException
OsmTransferException
org.xml.sax.SAXException

parseRawGps

public GpxData parseRawGps(ProgressMonitor progressMonitor)
                    throws OsmTransferException
Retrieve raw gps waypoints from the server API.

Overrides:
parseRawGps in class OsmServerReader
Returns:
A list of all primitives retrieved. Currently, the list of lists contain only one list, since the server cannot distinguish between ways.
Throws:
OsmTransferException

getRequestForBbox

protected java.lang.String getRequestForBbox(double lon1,
                                             double lat1,
                                             double lon2,
                                             double lat2)

parseOsm

public DataSet parseOsm(ProgressMonitor progressMonitor)
                 throws OsmTransferException
Read the data from the osm server address.

Specified by:
parseOsm in class OsmServerReader
Returns:
A data set containing all data retrieved from that url
Throws:
OsmTransferException


JOSM