Changeset 1677 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2009-06-17T10:04:22+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r1612 r1677 46 46 out.println("<?xml version='1.0' encoding='UTF-8'?>"); 47 47 out.println("<gpx version=\"1.1\" creator=\"JOSM GPX export\" xmlns=\"http://www.topografix.com/GPX/1/1\"\n" + 48 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" +49 48 " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" + 49 " xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\">"); 50 50 indent = " "; 51 51 writeMetaData(); … … 60 60 // FIXME this loop is evil, because it does not assure the 61 61 // correct element order specified by the xml schema. 62 // for now it works, but future extension could get very complex and unmaintainable 62 // for now it works, but future extension could get very complex and unmaintainable 63 63 for (Map.Entry<String, Object> ent : attr.entrySet()) { 64 64 String k = ent.getKey(); … … 76 76 Map<String, Object> attr = data.attr; 77 77 openln("metadata"); 78 78 79 79 // write the description 80 80 if (attr.containsKey(GpxData.META_DESC)) simpleTag("desc", (String)attr.get(GpxData.META_DESC)); 81 81 82 82 // write the author details 83 if (attr.containsKey(GpxData.META_AUTHOR_NAME) 83 if (attr.containsKey(GpxData.META_AUTHOR_NAME) 84 84 || attr.containsKey(GpxData.META_AUTHOR_EMAIL)) { 85 85 openln("author"); … … 99 99 100 100 // write the copyright details 101 if(attr.containsKey(GpxData.META_COPYRIGHT_LICENSE) 101 if(attr.containsKey(GpxData.META_COPYRIGHT_LICENSE) 102 102 || attr.containsKey(GpxData.META_COPYRIGHT_YEAR)) { 103 103 openAtt("copyright", "author=\""+ attr.get(GpxData.META_COPYRIGHT_AUTHOR) +"\""); … … 110 110 closeln("copyright"); 111 111 } 112 112 113 113 // write links 114 114 if(attr.containsKey(GpxData.META_LINKS)) { … … 117 117 } 118 118 } 119 120 // write keywords 119 120 // write keywords 121 121 if (attr.containsKey(GpxData.META_KEYWORDS)) simpleTag("keywords", (String)attr.get(GpxData.META_KEYWORDS)); 122 122 -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r1670 r1677 55 55 /** 56 56 * replies the {@see OsmApi} for a given server URL 57 * 57 * 58 58 * @param serverUrl the server URL 59 59 * @return the OsmApi 60 60 * @throws IllegalArgumentException thrown, if serverUrl is null 61 * 61 * 62 62 */ 63 63 static public OsmApi getOsmApi(String serverUrl) { … … 71 71 /** 72 72 * replies the {@see OsmApi} for the URL given by the preference <code>osm-server.url</code> 73 * 73 * 74 74 * @return the OsmApi 75 75 * @exception IllegalStateException thrown, if the preference <code>osm-server.url</code> is not set 76 * 76 * 77 77 */ 78 78 static public OsmApi getOsmApi() { … … 125 125 /** 126 126 * creates an OSM api for a specific server URL 127 * 127 * 128 128 * @param serverUrl the server URL. Must not be null 129 129 * @exception IllegalArgumentException thrown, if serverUrl is null … … 466 466 * notifies any listeners about the current state of this API. Currently just 467 467 * displays the message in the global progress dialog, see {@see Main#pleaseWaitDlg} 468 * 468 * 469 469 * @param message a status message. 470 470 */ … … 476 476 * notifies any listeners about the current about a relative progress. Currently just 477 477 * increments the progress monitor in the in the global progress dialog, see {@see Main#pleaseWaitDlg} 478 * 478 * 479 479 * @param int the delta 480 480 */ -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r1604 r1677 158 158 throw new SAXException(tr("Unknown version")); 159 159 String v = atts.getValue("version"); 160 if (v == null) 160 if (v == null) 161 161 throw new SAXException(tr("Version number missing from OSM data")); 162 if (!(v.equals("0.5") || v.equals("0.6"))) 162 if (!(v.equals("0.5") || v.equals("0.6"))) 163 163 throw new SAXException(tr("Unknown version: {0}", v)); 164 164 // save generator attribute for later use when creating DataSource objects 165 165 generator = atts.getValue("generator"); 166 166 ds.version = v; 167 167 168 168 } else if (qName.equals("bounds")) { 169 169 // new style bounds. … … 234 234 value = atts.getValue("role"); 235 235 emd.relationMember.role = value; 236 236 237 237 if (emd.id == 0) 238 238 throw new SAXException(tr("Incomplete <member> specification with ref=0")); … … 285 285 current.user = User.get(user); 286 286 } 287 288 // uid attribute added in 0.6 API 287 288 // uid attribute added in 0.6 API 289 289 String uid = atts.getValue("uid"); 290 290 if (uid != null) { … … 484 484 485 485 Main.pleaseWaitDlg.currentAction.setText(tr("Prepare OSM data...")); 486 Main.pleaseWaitDlg.setIndeterminate(true); 486 Main.pleaseWaitDlg.setIndeterminate(true); 487 487 488 488 // System.out.println("Parser finished: Tags " + tagsN + " Nodes " + nodesN + " Ways " + waysN + … … 506 506 507 507 // System.out.println("Data loaded!"); 508 Main.pleaseWaitDlg.setIndeterminate(false); 509 Main.pleaseWaitDlg.progress.setValue(0); 508 Main.pleaseWaitDlg.setIndeterminate(false); 509 Main.pleaseWaitDlg.progress.setValue(0); 510 510 511 511 return osm; -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r1670 r1677 62 62 /** 63 63 * retrieves the most recent changeset comment from the preferences 64 * 64 * 65 65 * @return the most recent changeset comment 66 66 */ … … 77 77 /** 78 78 * Send the dataset to the server. 79 * 79 * 80 80 * @param apiVersion version of the data set 81 81 * @param primitives list of objects to send -
trunk/src/org/openstreetmap/josm/io/XmlWriter.java
r1523 r1677 13 13 14 14 protected PrintWriter out; 15 15 16 16 public XmlWriter(PrintWriter out) { 17 17 this.out = out; 18 18 } 19 19 20 20 /** 21 21 * Encode the given string in XML1.0 format.
Note:
See TracChangeset
for help on using the changeset viewer.