iandees / planet-notes-dump

A utility to dump OpenStreetMap notes from the database into an XML file for bulk use.
MIT License
10 stars 5 forks source link

Fix indentation #5

Open Zverik opened 10 years ago

Zverik commented 10 years ago

<node> tags should be indented, like in .osc and other osm files. E.g.

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="planet-notes-dump">
  <note lat="42.2923896" date_created="2013-05-03T18:20:53Z" lon="-73.3349419" id="1322" date_closed="2013-05-25T06:16:28Z">
    <comments>
      <comment date="2013-05-03T18:20:53Z" action="opened">Location is slightly wrong. </comment>
      <comment date="2013-05-25T06:16:28Z" action="closed" uid="67236" user="jfire"></comment>
    </comments>
  </note>
</osm>

(right now <note> is on the same level as <osm>)

iandees commented 10 years ago

This isn't very easy to fix because of how I'm serializing one <note> element at a time instead of building the whole tree in-memory and then outputting it. Since it's mostly cosmetic, I'm going to let it go for now.

Zverik commented 10 years ago

Can you simply add spaces to etree.tostring() result with a regexp?

iandees commented 10 years ago

I could, but this isn't really meant to be read by humans, so the extra complexity isn't really worth it.