Changeset 34 in josm for src/org/openstreetmap/josm/io/OsmServerReader.java
- Timestamp:
- 2005-12-22T23:54:50+01:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/io/OsmServerReader.java
r31 r34 10 10 11 11 import org.jdom.JDOMException; 12 import org.openstreetmap.josm.Main; 12 13 import org.openstreetmap.josm.data.GeoPoint; 13 14 import org.openstreetmap.josm.data.osm.DataSet; … … 21 22 22 23 /** 23 * The url stringof the desired map data.24 * The boundings of the desired map data. 24 25 */ 25 private String urlStr;26 26 private final double lat1; 27 27 private final double lon1; … … 32 32 * Construct the reader and store the information for attaching 33 33 */ 34 public OsmServerReader(String server, 35 double lat1, double lon1, double lat2, double lon2) { 34 public OsmServerReader(double lat1, double lon1, double lat2, double lon2) { 36 35 this.lon2 = lon2; 37 36 this.lat2 = lat2; 38 37 this.lon1 = lon1; 39 38 this.lat1 = lat1; 40 urlStr = server.endsWith("/") ? server : server+"/";41 39 } 42 40 … … 49 47 */ 50 48 public Collection<Collection<GeoPoint>> parseRawGps() throws IOException, JDOMException { 51 String url = urlStr+"trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page=";49 String url = Main.pref.osmDataServer+"/trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page="; 52 50 Collection<Collection<GeoPoint>> data = new LinkedList<Collection<GeoPoint>>(); 53 51 Collection<GeoPoint> list = new LinkedList<GeoPoint>(); … … 80 78 */ 81 79 public DataSet parseOsm() throws JDOMException, IOException { 82 Reader r = getReader( urlStr+"map?bbox="+lon1+","+lat1+","+lon2+","+lat2);80 Reader r = getReader(Main.pref.osmDataServer+"/map?bbox="+lon1+","+lat1+","+lon2+","+lat2); 83 81 if (r == null) 84 82 return null; … … 95 93 private Reader getReader(String urlStr) throws IOException { 96 94 initAuthentication(); 95 System.out.println(urlStr); 97 96 URL url = new URL(urlStr); 98 97 HttpURLConnection con = (HttpURLConnection)url.openConnection();
Note:
See TracChangeset
for help on using the changeset viewer.
