Changeset 210 in josm for src/org/openstreetmap/josm/io
- Timestamp:
- 2007-04-04T13:21:40+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r204 r210 49 49 break; 50 50 // Use only track points, since the server mix everything together 51 Collection<Collection<GpsPoint>> allWays = new RawGpsReader(in).trackData; 51 Collection<Collection<GpsPoint>> allWays = new RawGpsReader(in, null).trackData; 52 52 53 53 boolean foundSomething = false; … … 70 70 if (cancel) 71 71 return null; 72 throw e;72 throw new SAXException("Illegal characters within the HTTP-header response", e); 73 73 } catch (IOException e) { 74 74 if (cancel) -
src/org/openstreetmap/josm/io/RawGpsReader.java
r200 r210 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.io.File; 5 6 import java.io.IOException; 6 7 import java.io.InputStream; … … 15 16 import org.openstreetmap.josm.gui.layer.RawGpsLayer.GpsPoint; 16 17 import org.openstreetmap.josm.gui.layer.markerlayer.Marker; 18 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerProducers; 17 19 import org.xml.sax.Attributes; 18 20 import org.xml.sax.SAXException; … … 26 28 */ 27 29 public class RawGpsReader { 30 31 /** 32 * The relative path when constructing markers from wpt-tags. Passed to 33 * {@link MarkerProducers#createMarker(LatLon, java.util.Map, String)} 34 */ 35 private File relativeMarkerPath; 28 36 29 37 /** … … 90 98 currentTagValues.clear(); 91 99 } else if (qName.equals("wpt")) { 92 markerData.add(Marker.createMarker(currentLatLon, currentTagValues)); 100 markerData.add(Marker.createMarker(currentLatLon, currentTagValues, relativeMarkerPath)); 93 101 currentTagValues.clear(); 94 102 } else if (qName.equals("trkseg") || qName.equals("trk") || qName.equals("gpx")) { … … 107 115 } 108 116 109 110 117 /** 111 * Parse the input stream and store the result in trackData and markerData 118 * Parse the input stream and store the result in trackData and markerData 119 * 120 * @param relativeMarkerPath The directory to use as relative path for all <wpt> 121 * marker tags. Maybe <code>null</code>, in which case no relative urls are constructed for the markers. 112 122 */ 113 public RawGpsReader(InputStream source) throws SAXException, IOException { 123 public RawGpsReader(InputStream source, File relativeMarkerPath) throws SAXException, IOException { 124 this.relativeMarkerPath = relativeMarkerPath; 114 125 Parser parser = new Parser(); 115 126 parser.parse(new InputStreamReader(source, "UTF-8"));
Note:
See TracChangeset
for help on using the changeset viewer.