source: josm/trunk/src/org/openstreetmap/josm/io/OsmReader.java@ 12413

Last change on this file since 12413 was 12138, checked in by Don-vip, 7 years ago

improve unit tests of OsmReader

  • Property svn:eol-style set to native
File size: 26.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.io.IOException;
7import java.io.InputStream;
8import java.io.InputStreamReader;
9import java.text.MessageFormat;
10import java.util.ArrayList;
11import java.util.Collection;
12import java.util.List;
13import java.util.Objects;
14import java.util.regex.Matcher;
15import java.util.regex.Pattern;
16
17import javax.xml.stream.Location;
18import javax.xml.stream.XMLInputFactory;
19import javax.xml.stream.XMLStreamConstants;
20import javax.xml.stream.XMLStreamException;
21import javax.xml.stream.XMLStreamReader;
22
23import org.openstreetmap.josm.Main;
24import org.openstreetmap.josm.data.Bounds;
25import org.openstreetmap.josm.data.DataSource;
26import org.openstreetmap.josm.data.coor.LatLon;
27import org.openstreetmap.josm.data.osm.AbstractPrimitive;
28import org.openstreetmap.josm.data.osm.Changeset;
29import org.openstreetmap.josm.data.osm.DataSet;
30import org.openstreetmap.josm.data.osm.DataSet.UploadPolicy;
31import org.openstreetmap.josm.data.osm.Node;
32import org.openstreetmap.josm.data.osm.NodeData;
33import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
34import org.openstreetmap.josm.data.osm.PrimitiveData;
35import org.openstreetmap.josm.data.osm.Relation;
36import org.openstreetmap.josm.data.osm.RelationData;
37import org.openstreetmap.josm.data.osm.RelationMemberData;
38import org.openstreetmap.josm.data.osm.Tagged;
39import org.openstreetmap.josm.data.osm.User;
40import org.openstreetmap.josm.data.osm.Way;
41import org.openstreetmap.josm.data.osm.WayData;
42import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
43import org.openstreetmap.josm.gui.progress.ProgressMonitor;
44import org.openstreetmap.josm.tools.CheckParameterUtil;
45import org.openstreetmap.josm.tools.Utils;
46import org.openstreetmap.josm.tools.date.DateUtils;
47
48/**
49 * Parser for the Osm Api. Read from an input stream and construct a dataset out of it.
50 *
51 * For each xml element, there is a dedicated method.
52 * The XMLStreamReader cursor points to the start of the element, when the method is
53 * entered, and it must point to the end of the same element, when it is exited.
54 */
55public class OsmReader extends AbstractReader {
56
57 protected XMLStreamReader parser;
58
59 protected boolean cancel;
60
61 /** Used by plugins to register themselves as data postprocessors. */
62 private static volatile List<OsmServerReadPostprocessor> postprocessors;
63
64 /** Register a new postprocessor.
65 * @param pp postprocessor
66 * @see #deregisterPostprocessor
67 */
68 public static void registerPostprocessor(OsmServerReadPostprocessor pp) {
69 if (postprocessors == null) {
70 postprocessors = new ArrayList<>();
71 }
72 postprocessors.add(pp);
73 }
74
75 /**
76 * Deregister a postprocessor previously registered with {@link #registerPostprocessor}.
77 * @param pp postprocessor
78 * @see #registerPostprocessor
79 */
80 public static void deregisterPostprocessor(OsmServerReadPostprocessor pp) {
81 if (postprocessors != null) {
82 postprocessors.remove(pp);
83 }
84 }
85
86 /**
87 * constructor (for private and subclasses use only)
88 *
89 * @see #parseDataSet(InputStream, ProgressMonitor)
90 */
91 protected OsmReader() {
92 // Restricts visibility
93 }
94
95 protected void setParser(XMLStreamReader parser) {
96 this.parser = parser;
97 }
98
99 protected void throwException(String msg, Throwable th) throws XMLStreamException {
100 throw new XmlStreamParsingException(msg, parser.getLocation(), th);
101 }
102
103 protected void throwException(String msg) throws XMLStreamException {
104 throw new XmlStreamParsingException(msg, parser.getLocation());
105 }
106
107 protected void parse() throws XMLStreamException {
108 int event = parser.getEventType();
109 while (true) {
110 if (event == XMLStreamConstants.START_ELEMENT) {
111 parseRoot();
112 } else if (event == XMLStreamConstants.END_ELEMENT)
113 return;
114 if (parser.hasNext()) {
115 event = parser.next();
116 } else {
117 break;
118 }
119 }
120 parser.close();
121 }
122
123 protected void parseRoot() throws XMLStreamException {
124 if ("osm".equals(parser.getLocalName())) {
125 parseOsm();
126 } else {
127 parseUnknown();
128 }
129 }
130
131 private void parseOsm() throws XMLStreamException {
132 String v = parser.getAttributeValue(null, "version");
133 if (v == null) {
134 throwException(tr("Missing mandatory attribute ''{0}''.", "version"));
135 }
136 if (!"0.6".equals(v)) {
137 throwException(tr("Unsupported version: {0}", v));
138 }
139 ds.setVersion(v);
140 String upload = parser.getAttributeValue(null, "upload");
141 if (upload != null) {
142 for (UploadPolicy policy : UploadPolicy.values()) {
143 if (policy.getXmlFlag().equalsIgnoreCase(upload)) {
144 ds.setUploadPolicy(policy);
145 break;
146 }
147 }
148 }
149 String generator = parser.getAttributeValue(null, "generator");
150 Long uploadChangesetId = null;
151 if (parser.getAttributeValue(null, "upload-changeset") != null) {
152 uploadChangesetId = getLong("upload-changeset");
153 }
154 while (true) {
155 int event = parser.next();
156
157 if (cancel) {
158 cancel = false;
159 throw new OsmParsingCanceledException(tr("Reading was canceled"), parser.getLocation());
160 }
161
162 if (event == XMLStreamConstants.START_ELEMENT) {
163 switch (parser.getLocalName()) {
164 case "bounds":
165 parseBounds(generator);
166 break;
167 case "node":
168 parseNode();
169 break;
170 case "way":
171 parseWay();
172 break;
173 case "relation":
174 parseRelation();
175 break;
176 case "changeset":
177 parseChangeset(uploadChangesetId);
178 break;
179 default:
180 parseUnknown();
181 }
182 } else if (event == XMLStreamConstants.END_ELEMENT)
183 return;
184 }
185 }
186
187 private void parseBounds(String generator) throws XMLStreamException {
188 String minlon = parser.getAttributeValue(null, "minlon");
189 String minlat = parser.getAttributeValue(null, "minlat");
190 String maxlon = parser.getAttributeValue(null, "maxlon");
191 String maxlat = parser.getAttributeValue(null, "maxlat");
192 String origin = parser.getAttributeValue(null, "origin");
193 if (minlon != null && maxlon != null && minlat != null && maxlat != null) {
194 if (origin == null) {
195 origin = generator;
196 }
197 Bounds bounds = new Bounds(
198 Double.parseDouble(minlat), Double.parseDouble(minlon),
199 Double.parseDouble(maxlat), Double.parseDouble(maxlon));
200 if (bounds.isOutOfTheWorld()) {
201 Bounds copy = new Bounds(bounds);
202 bounds.normalize();
203 Main.info("Bbox " + copy + " is out of the world, normalized to " + bounds);
204 }
205 DataSource src = new DataSource(bounds, origin);
206 ds.addDataSource(src);
207 } else {
208 throwException(tr("Missing mandatory attributes on element ''bounds''. " +
209 "Got minlon=''{0}'',minlat=''{1}'',maxlon=''{2}'',maxlat=''{3}'', origin=''{4}''.",
210 minlon, minlat, maxlon, maxlat, origin
211 ));
212 }
213 jumpToEnd();
214 }
215
216 protected Node parseNode() throws XMLStreamException {
217 NodeData nd = new NodeData();
218 String lat = parser.getAttributeValue(null, "lat");
219 String lon = parser.getAttributeValue(null, "lon");
220 LatLon ll = null;
221 if (lat != null && lon != null) {
222 try {
223 ll = new LatLon(Double.parseDouble(lat), Double.parseDouble(lon));
224 nd.setCoor(ll);
225 } catch (NumberFormatException e) {
226 Main.trace(e);
227 }
228 }
229 readCommon(nd);
230 if (lat != null && lon != null && (ll == null || !ll.isValid())) {
231 throwException(tr("Illegal value for attributes ''lat'', ''lon'' on node with ID {0}. Got ''{1}'', ''{2}''.",
232 Long.toString(nd.getId()), lat, lon));
233 }
234 Node n = new Node(nd.getId(), nd.getVersion());
235 n.setVisible(nd.isVisible());
236 n.load(nd);
237 externalIdMap.put(nd.getPrimitiveId(), n);
238 while (true) {
239 int event = parser.next();
240 if (event == XMLStreamConstants.START_ELEMENT) {
241 if ("tag".equals(parser.getLocalName())) {
242 parseTag(n);
243 } else {
244 parseUnknown();
245 }
246 } else if (event == XMLStreamConstants.END_ELEMENT)
247 return n;
248 }
249 }
250
251 protected Way parseWay() throws XMLStreamException {
252 WayData wd = new WayData();
253 readCommon(wd);
254 Way w = new Way(wd.getId(), wd.getVersion());
255 w.setVisible(wd.isVisible());
256 w.load(wd);
257 externalIdMap.put(wd.getPrimitiveId(), w);
258
259 Collection<Long> nodeIds = new ArrayList<>();
260 while (true) {
261 int event = parser.next();
262 if (event == XMLStreamConstants.START_ELEMENT) {
263 switch (parser.getLocalName()) {
264 case "nd":
265 nodeIds.add(parseWayNode(w));
266 break;
267 case "tag":
268 parseTag(w);
269 break;
270 default:
271 parseUnknown();
272 }
273 } else if (event == XMLStreamConstants.END_ELEMENT) {
274 break;
275 }
276 }
277 if (w.isDeleted() && !nodeIds.isEmpty()) {
278 Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
279 nodeIds = new ArrayList<>();
280 }
281 ways.put(wd.getUniqueId(), nodeIds);
282 return w;
283 }
284
285 private long parseWayNode(Way w) throws XMLStreamException {
286 if (parser.getAttributeValue(null, "ref") == null) {
287 throwException(
288 tr("Missing mandatory attribute ''{0}'' on <nd> of way {1}.", "ref", w.getUniqueId())
289 );
290 }
291 long id = getLong("ref");
292 if (id == 0) {
293 throwException(
294 tr("Illegal value of attribute ''ref'' of element <nd>. Got {0}.", id)
295 );
296 }
297 jumpToEnd();
298 return id;
299 }
300
301 protected Relation parseRelation() throws XMLStreamException {
302 RelationData rd = new RelationData();
303 readCommon(rd);
304 Relation r = new Relation(rd.getId(), rd.getVersion());
305 r.setVisible(rd.isVisible());
306 r.load(rd);
307 externalIdMap.put(rd.getPrimitiveId(), r);
308
309 Collection<RelationMemberData> members = new ArrayList<>();
310 while (true) {
311 int event = parser.next();
312 if (event == XMLStreamConstants.START_ELEMENT) {
313 switch (parser.getLocalName()) {
314 case "member":
315 members.add(parseRelationMember(r));
316 break;
317 case "tag":
318 parseTag(r);
319 break;
320 default:
321 parseUnknown();
322 }
323 } else if (event == XMLStreamConstants.END_ELEMENT) {
324 break;
325 }
326 }
327 if (r.isDeleted() && !members.isEmpty()) {
328 Main.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
329 members = new ArrayList<>();
330 }
331 relations.put(rd.getUniqueId(), members);
332 return r;
333 }
334
335 private RelationMemberData parseRelationMember(Relation r) throws XMLStreamException {
336 OsmPrimitiveType type = null;
337 long id = 0;
338 String value = parser.getAttributeValue(null, "ref");
339 if (value == null) {
340 throwException(tr("Missing attribute ''ref'' on member in relation {0}.", r.getUniqueId()));
341 }
342 try {
343 id = Long.parseLong(value);
344 } catch (NumberFormatException e) {
345 throwException(tr("Illegal value for attribute ''ref'' on member in relation {0}. Got {1}", Long.toString(r.getUniqueId()),
346 value), e);
347 }
348 value = parser.getAttributeValue(null, "type");
349 if (value == null) {
350 throwException(tr("Missing attribute ''type'' on member {0} in relation {1}.", Long.toString(id), Long.toString(r.getUniqueId())));
351 }
352 try {
353 type = OsmPrimitiveType.fromApiTypeName(value);
354 } catch (IllegalArgumentException e) {
355 throwException(tr("Illegal value for attribute ''type'' on member {0} in relation {1}. Got {2}.",
356 Long.toString(id), Long.toString(r.getUniqueId()), value), e);
357 }
358 String role = parser.getAttributeValue(null, "role");
359
360 if (id == 0) {
361 throwException(tr("Incomplete <member> specification with ref=0"));
362 }
363 jumpToEnd();
364 return new RelationMemberData(role, type, id);
365 }
366
367 private void parseChangeset(Long uploadChangesetId) throws XMLStreamException {
368
369 Long id = null;
370 if (parser.getAttributeValue(null, "id") != null) {
371 id = getLong("id");
372 }
373 // Read changeset info if neither upload-changeset nor id are set, or if they are both set to the same value
374 if (Objects.equals(id, uploadChangesetId)) {
375 uploadChangeset = new Changeset(id != null ? id.intValue() : 0);
376 while (true) {
377 int event = parser.next();
378 if (event == XMLStreamConstants.START_ELEMENT) {
379 if ("tag".equals(parser.getLocalName())) {
380 parseTag(uploadChangeset);
381 } else {
382 parseUnknown();
383 }
384 } else if (event == XMLStreamConstants.END_ELEMENT)
385 return;
386 }
387 } else {
388 jumpToEnd(false);
389 }
390 }
391
392 private void parseTag(Tagged t) throws XMLStreamException {
393 String key = parser.getAttributeValue(null, "k");
394 String value = parser.getAttributeValue(null, "v");
395 if (key == null || value == null) {
396 throwException(tr("Missing key or value attribute in tag."));
397 } else if (Utils.isStripEmpty(key) && t instanceof AbstractPrimitive) {
398 // #14199: Empty keys as ignored by AbstractPrimitive#put, but it causes problems to fix existing data
399 // Drop the tag on import, but flag the primitive as modified
400 ((AbstractPrimitive) t).setModified(true);
401 } else {
402 t.put(key.intern(), value.intern());
403 }
404 jumpToEnd();
405 }
406
407 protected void parseUnknown(boolean printWarning) throws XMLStreamException {
408 final String element = parser.getLocalName();
409 if (printWarning && ("note".equals(element) || "meta".equals(element))) {
410 // we know that Overpass API returns those elements
411 Main.debug(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
412 } else if (printWarning) {
413 Main.info(tr("Undefined element ''{0}'' found in input stream. Skipping.", element));
414 }
415 while (true) {
416 int event = parser.next();
417 if (event == XMLStreamConstants.START_ELEMENT) {
418 parseUnknown(false); /* no more warning for inner elements */
419 } else if (event == XMLStreamConstants.END_ELEMENT)
420 return;
421 }
422 }
423
424 protected void parseUnknown() throws XMLStreamException {
425 parseUnknown(true);
426 }
427
428 /**
429 * When cursor is at the start of an element, moves it to the end tag of that element.
430 * Nested content is skipped.
431 *
432 * This is basically the same code as parseUnknown(), except for the warnings, which
433 * are displayed for inner elements and not at top level.
434 * @param printWarning if {@code true}, a warning message will be printed if an unknown element is met
435 * @throws XMLStreamException if there is an error processing the underlying XML source
436 */
437 private void jumpToEnd(boolean printWarning) throws XMLStreamException {
438 while (true) {
439 int event = parser.next();
440 if (event == XMLStreamConstants.START_ELEMENT) {
441 parseUnknown(printWarning);
442 } else if (event == XMLStreamConstants.END_ELEMENT)
443 return;
444 }
445 }
446
447 private void jumpToEnd() throws XMLStreamException {
448 jumpToEnd(true);
449 }
450
451 private User createUser(String uid, String name) throws XMLStreamException {
452 if (uid == null) {
453 if (name == null)
454 return null;
455 return User.createLocalUser(name);
456 }
457 try {
458 long id = Long.parseLong(uid);
459 return User.createOsmUser(id, name);
460 } catch (NumberFormatException e) {
461 throwException(MessageFormat.format("Illegal value for attribute ''uid''. Got ''{0}''.", uid), e);
462 }
463 return null;
464 }
465
466 /**
467 * Read out the common attributes and put them into current OsmPrimitive.
468 * @param current primitive to update
469 * @throws XMLStreamException if there is an error processing the underlying XML source
470 */
471 private void readCommon(PrimitiveData current) throws XMLStreamException {
472 current.setId(getLong("id"));
473 if (current.getUniqueId() == 0) {
474 throwException(tr("Illegal object with ID=0."));
475 }
476
477 String time = parser.getAttributeValue(null, "timestamp");
478 if (time != null && !time.isEmpty()) {
479 current.setRawTimestamp((int) (DateUtils.tsFromString(time)/1000));
480 }
481
482 String user = parser.getAttributeValue(null, "user");
483 String uid = parser.getAttributeValue(null, "uid");
484 current.setUser(createUser(uid, user));
485
486 String visible = parser.getAttributeValue(null, "visible");
487 if (visible != null) {
488 current.setVisible(Boolean.parseBoolean(visible));
489 }
490
491 String versionString = parser.getAttributeValue(null, "version");
492 int version = 0;
493 if (versionString != null) {
494 try {
495 version = Integer.parseInt(versionString);
496 } catch (NumberFormatException e) {
497 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.",
498 Long.toString(current.getUniqueId()), versionString), e);
499 }
500 switch (ds.getVersion()) {
501 case "0.6":
502 if (version <= 0 && !current.isNew()) {
503 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.",
504 Long.toString(current.getUniqueId()), versionString));
505 } else if (version < 0 && current.isNew()) {
506 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.",
507 current.getUniqueId(), version, 0, "0.6"));
508 version = 0;
509 }
510 break;
511 default:
512 // should not happen. API version has been checked before
513 throwException(tr("Unknown or unsupported API version. Got {0}.", ds.getVersion()));
514 }
515 } else {
516 // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6
517 if (!current.isNew() && ds.getVersion() != null && "0.6".equals(ds.getVersion())) {
518 throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.getUniqueId())));
519 }
520 }
521 current.setVersion(version);
522
523 String action = parser.getAttributeValue(null, "action");
524 if (action == null) {
525 // do nothing
526 } else if ("delete".equals(action)) {
527 current.setDeleted(true);
528 current.setModified(current.isVisible());
529 } else if ("modify".equals(action)) {
530 current.setModified(true);
531 }
532
533 String v = parser.getAttributeValue(null, "changeset");
534 if (v == null) {
535 current.setChangesetId(0);
536 } else {
537 try {
538 current.setChangesetId(Integer.parseInt(v));
539 } catch (IllegalArgumentException e) {
540 Main.debug(e.getMessage());
541 if (current.isNew()) {
542 // for a new primitive we just log a warning
543 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
544 v, current.getUniqueId()));
545 current.setChangesetId(0);
546 } else {
547 // for an existing primitive this is a problem
548 throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v), e);
549 }
550 } catch (IllegalStateException e) {
551 // thrown for positive changeset id on new primitives
552 Main.debug(e);
553 Main.info(e.getMessage());
554 current.setChangesetId(0);
555 }
556 if (current.getChangesetId() <= 0) {
557 if (current.isNew()) {
558 // for a new primitive we just log a warning
559 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.",
560 v, current.getUniqueId()));
561 current.setChangesetId(0);
562 } else {
563 // for an existing primitive this is a problem
564 throwException(tr("Illegal value for attribute ''changeset''. Got {0}.", v));
565 }
566 }
567 }
568 }
569
570 private long getLong(String name) throws XMLStreamException {
571 String value = parser.getAttributeValue(null, name);
572 if (value == null) {
573 throwException(tr("Missing required attribute ''{0}''.", name));
574 }
575 try {
576 return Long.parseLong(value);
577 } catch (NumberFormatException e) {
578 throwException(tr("Illegal long value for attribute ''{0}''. Got ''{1}''.", name, value), e);
579 }
580 return 0; // should not happen
581 }
582
583 /**
584 * Exception thrown after user cancelation.
585 */
586 private static final class OsmParsingCanceledException extends XmlStreamParsingException implements ImportCancelException {
587 /**
588 * Constructs a new {@code OsmParsingCanceledException}.
589 * @param msg The error message
590 * @param location The parser location
591 */
592 OsmParsingCanceledException(String msg, Location location) {
593 super(msg, location);
594 }
595 }
596
597 @Override
598 protected DataSet doParseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
599 if (progressMonitor == null) {
600 progressMonitor = NullProgressMonitor.INSTANCE;
601 }
602 ProgressMonitor.CancelListener cancelListener = () -> cancel = true;
603 progressMonitor.addCancelListener(cancelListener);
604 CheckParameterUtil.ensureParameterNotNull(source, "source");
605 try {
606 progressMonitor.beginTask(tr("Prepare OSM data...", 2));
607 progressMonitor.indeterminateSubTask(tr("Parsing OSM data..."));
608
609 try (InputStreamReader ir = UTFInputStreamReader.create(source)) {
610 XMLInputFactory factory = XMLInputFactory.newInstance();
611 // do not try to load external entities
612 factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
613 factory.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
614 setParser(factory.createXMLStreamReader(ir));
615 parse();
616 }
617 progressMonitor.worked(1);
618
619 progressMonitor.indeterminateSubTask(tr("Preparing data set..."));
620 prepareDataSet();
621 progressMonitor.worked(1);
622
623 // iterate over registered postprocessors and give them each a chance
624 // to modify the dataset we have just loaded.
625 if (postprocessors != null) {
626 for (OsmServerReadPostprocessor pp : postprocessors) {
627 pp.postprocessDataSet(getDataSet(), progressMonitor);
628 }
629 }
630 return getDataSet();
631 } catch (IllegalDataException e) {
632 throw e;
633 } catch (XmlStreamParsingException e) {
634 throw new IllegalDataException(e.getMessage(), e);
635 } catch (XMLStreamException e) {
636 String msg = e.getMessage();
637 Pattern p = Pattern.compile("Message: (.+)");
638 Matcher m = p.matcher(msg);
639 if (m.find()) {
640 msg = m.group(1);
641 }
642 if (e.getLocation() != null)
643 throw new IllegalDataException(tr("Line {0} column {1}: ",
644 e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()) + msg, e);
645 else
646 throw new IllegalDataException(msg, e);
647 } catch (IOException e) {
648 throw new IllegalDataException(e);
649 } finally {
650 progressMonitor.finishTask();
651 progressMonitor.removeCancelListener(cancelListener);
652 }
653 }
654
655 /**
656 * Parse the given input source and return the dataset.
657 *
658 * @param source the source input stream. Must not be null.
659 * @param progressMonitor the progress monitor. If null, {@link NullProgressMonitor#INSTANCE} is assumed
660 *
661 * @return the dataset with the parsed data
662 * @throws IllegalDataException if an error was found while parsing the data from the source
663 * @throws IllegalArgumentException if source is null
664 */
665 public static DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
666 return new OsmReader().doParseDataSet(source, progressMonitor);
667 }
668}
Note: See TracBrowser for help on using the repository browser.