Changeset 8846 in josm for trunk/src/org/openstreetmap/josm/io/OsmWriter.java
- Timestamp:
- 2015-10-10T01:40:42+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r8565 r8846 185 185 if (n.getCoor() != null) { 186 186 out.print(" lat='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lat())+ 187 "' lon='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lon())+ "'");187 "' lon='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lon())+'\''); 188 188 } 189 189 addTags(n, "node", true); … … 226 226 public void visit(Changeset cs) { 227 227 out.print(" <changeset "); 228 out.print(" id='"+cs.getId()+ "'");228 out.print(" id='"+cs.getId()+'\''); 229 229 if (cs.getUser() != null) { 230 out.print(" user='"+cs.getUser().getName() + "'");231 out.print(" uid='"+cs.getUser().getId() + "'");230 out.print(" user='"+cs.getUser().getName() +'\''); 231 out.print(" uid='"+cs.getUser().getId() +'\''); 232 232 } 233 233 if (cs.getCreatedAt() != null) { 234 out.print(" created_at='"+DateUtils.fromDate(cs.getCreatedAt()) + "'");234 out.print(" created_at='"+DateUtils.fromDate(cs.getCreatedAt()) +'\''); 235 235 } 236 236 if (cs.getClosedAt() != null) { 237 out.print(" closed_at='"+DateUtils.fromDate(cs.getClosedAt()) + "'");238 } 239 out.print(" open='"+ (cs.isOpen() ? "true" : "false") + "'");237 out.print(" closed_at='"+DateUtils.fromDate(cs.getClosedAt()) +'\''); 238 } 239 out.print(" open='"+ (cs.isOpen() ? "true" : "false") +'\''); 240 240 if (cs.getMin() != null) { 241 out.print(" min_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) + "'");242 out.print(" min_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) + "'");241 out.print(" min_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 242 out.print(" min_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 243 243 } 244 244 if (cs.getMax() != null) { 245 out.print(" max_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) + "'");246 out.print(" max_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) + "'");245 out.print(" max_lon='"+ cs.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 246 out.print(" max_lat='"+ cs.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES) +'\''); 247 247 } 248 248 out.println(">"); … … 268 268 "' v='"+XmlWriter.encode(e.getValue())+ "' />"); 269 269 } 270 out.println(" </" + tagname + ">");270 out.println(" </" + tagname + '>'); 271 271 } else if (tagOpen) { 272 272 out.println(" />"); 273 273 } else { 274 out.println(" </" + tagname + ">");274 out.println(" </" + tagname + '>'); 275 275 } 276 276 } … … 283 283 out.print(" <"+tagname); 284 284 if (osm.getUniqueId() != 0) { 285 out.print(" id='"+ osm.getUniqueId()+ "'");285 out.print(" id='"+ osm.getUniqueId()+'\''); 286 286 } else 287 287 throw new IllegalStateException(tr("Unexpected id 0 for osm primitive found")); … … 295 295 } 296 296 if (action != null) { 297 out.print(" action='"+action+ "'");297 out.print(" action='"+action+'\''); 298 298 } 299 299 } 300 300 if (!osm.isTimestampEmpty()) { 301 out.print(" timestamp='"+DateUtils.fromTimestamp(osm.getRawTimestamp())+ "'");301 out.print(" timestamp='"+DateUtils.fromTimestamp(osm.getRawTimestamp())+'\''); 302 302 } 303 303 // user and visible added with 0.4 API 304 304 if (osm.getUser() != null) { 305 305 if (osm.getUser().isLocalUser()) { 306 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+ "'");306 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+'\''); 307 307 } else if (osm.getUser().isOsmUser()) { 308 308 // uid added with 0.6 309 out.print(" uid='"+ osm.getUser().getId()+ "'");310 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+ "'");309 out.print(" uid='"+ osm.getUser().getId()+'\''); 310 out.print(" user='"+XmlWriter.encode(osm.getUser().getName())+'\''); 311 311 } 312 312 } 313 out.print(" visible='"+osm.isVisible()+ "'");313 out.print(" visible='"+osm.isVisible()+'\''); 314 314 } 315 315 if (osm.getVersion() != 0) { 316 out.print(" version='"+osm.getVersion()+ "'");316 out.print(" version='"+osm.getVersion()+'\''); 317 317 } 318 318 if (this.changeset != null && this.changeset.getId() != 0) { 319 out.print(" changeset='"+this.changeset.getId()+ "'");319 out.print(" changeset='"+this.changeset.getId()+'\''); 320 320 } else if (osm.getChangesetId() > 0 && !osm.isNew()) { 321 out.print(" changeset='"+osm.getChangesetId()+ "'");321 out.print(" changeset='"+osm.getChangesetId()+'\''); 322 322 } 323 323 }
Note:
See TracChangeset
for help on using the changeset viewer.
