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

Last change on this file since 6930 was 6650, checked in by simon04, 10 years ago

see #9414 see #9542 - MapCSS validator: handle BOM in config files

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