Changeset 27692 in osm for applications/editors/josm/plugins/mirrored_download/src
- Timestamp:
- 2012-02-02T18:51:49+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/mirrored_download/src/mirrored_download
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/BoundingBoxDownloader2.java
r27679 r27692 14 14 import org.openstreetmap.josm.data.gpx.GpxData; 15 15 import org.openstreetmap.josm.data.osm.DataSet; 16 import org.openstreetmap.josm.data.osm.DataSource; 16 17 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 17 18 import org.xml.sax.SAXException; … … 19 20 public class BoundingBoxDownloader2 extends BoundingBoxDownloader { 20 21 22 /** 23 * The boundings of the desired map data. 24 */ 25 private final double lat1; 26 private final double lon1; 27 private final double lat2; 28 private final double lon2; 29 private final boolean crosses180th; 30 21 31 public BoundingBoxDownloader2(Bounds downloadArea) { 22 32 super(downloadArea); 33 34 this.lat1 = downloadArea.getMin().lat(); 35 this.lon1 = downloadArea.getMin().lon(); 36 this.lat2 = downloadArea.getMax().lat(); 37 this.lon2 = downloadArea.getMax().lon(); 38 this.crosses180th = downloadArea.crosses180thMeridian(); 23 39 } 24 40 25 protected InputStream getInputStream(String urlStr, ProgressMonitor progressMonitor) throws OsmTransferException { 41 protected InputStream getInputStream(String urlStr, ProgressMonitor progressMonitor) 42 throws OsmTransferException { 43 26 44 try { 27 45 OsmApi.getOsmApi().initialize(progressMonitor); … … 33 51 } 34 52 53 public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException { 54 55 DataSet ds = super.parseOsm(progressMonitor); 56 57 System.out.println(ds.dataSources.toString()); 58 if (ds != null && ds.dataSources.size() == 0) 59 { 60 if (crosses180th) 61 { 62 Bounds bounds = new Bounds(lat1, lon1, lat2, 180.0); 63 DataSource src = new DataSource(bounds, MirroredDownloadPlugin.getDownloadUrl()); 64 ds.dataSources.add(src); 65 66 bounds = new Bounds(lat1, -180.0, lat2, lon2); 67 src = new DataSource(bounds, MirroredDownloadPlugin.getDownloadUrl()); 68 ds.dataSources.add(src); 69 } 70 else 71 { 72 Bounds bounds = new Bounds(lat1, lon1, lat2, lon2); 73 DataSource src = new DataSource(bounds, MirroredDownloadPlugin.getDownloadUrl()); 74 ds.dataSources.add(src); 75 } 76 } 77 System.out.println(ds.dataSources.toString()); 78 79 return ds; 80 } 35 81 } -
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java
r27691 r27692 97 97 98 98 cbSelectUrl = new JComboBox(); 99 cbSelectUrl.setEditable( false);99 cbSelectUrl.setEditable(true); 100 100 101 101 cbSelectUrl.addItem("http://overpass.osm.rambler.ru/cgi/xapi?");
Note:
See TracChangeset
for help on using the changeset viewer.