[Openstreetmap] Re: [Openstreetmap-dev] OSM's Schema - moving it forwards.

David Cantrell david at cantrell.org.uk
Wed Nov 30 16:35:27 GMT 2005


On Wed, Nov 30, 2005 at 11:49:07AM +0100, Tommy Persson wrote:
> > But for most problems CSV *is* enough! Since the underlying data layer
> > is usually an RDBMS, why shoe-horn your data into into a tree if it's
> > gonna end up as tables and columns? You could preach to me about layers
> Even if the data is flat it is better to have it in a format where you
> from a data file can see what the fields are called.
>    <wpt lat="58" lon="15"/>

What's a "wpt"?  Which directions are positive, which are negative?
Knowing what the fields are called is nowhere near as helpful as you
seem to think!

> is muck better than
>    58,16

Well, aside from needing a large complicated library to parse it, and
using 20+ characters where five would do the job.

> As I see it one of the most important thing with XML is that property
> plus that problem with quoting and such things are solved.  In CSV
> there is always trouble when you have a comma in the data and a lot of
> program that claims to handle CVS cannot handle it.

But an awful lot of CSV libraries *can*.  In fact I imagine most do,
it's just shitty hand-rolled CSV parsers written by fourteen year old
Linux weenies that don't.  Now compare to the bug-ridden crapware that
is XML parsers.

By the way, I consider "being hard to use", "having to read the manual"
and "taking too much memory" to be serious bugs in something as simple
as reading a file of data.

> Yes, things can be overused.  But before XML or SGML the situation was
> much worse with respect to different format and exhange of data.

Simply not true.  Nowadays, you need both a huge XML parser and a ton of
logic to *understand* the data and un-mangle it from a tree into a
useful structure.  Previously you had a small problem-specific parser and
*perhaps* a small chunk of code to transmogrify the data into something
convenient for your program.

Your computer doesn't know what a wpt, a lat or a lon is.  And once it
has executed a zillion instructions and wasted a few megabytes
untangling that mess, it'll end up with an array, just like what a CSV
parser would have spat out.  In the mean time, my program that used CSV
will have done the job, gone to the pub and will be chatting up your bird.

-- 
David Cantrell | Reality Engineer, Ministry of Information

  All principles of gravity are negated by fear
                                            -- Cartoon Law V




More information about the talk mailing list