[OSM-talk] Re: [OSM-dev] MassGIS dataset
Nick Whitelegg
Nick.Whitelegg at solent.ac.uk
Fri Jun 9 09:46:49 BST 2006
Sent by: dev-bounces at openstreetmap.org
To: "Christopher Schmidt" <crschmidt at crschmidt.net>
cc: Dev Openstreetmap <dev at openstreetmap.org>
Subject: Re: [OSM-talk] Re: [OSM-dev] MassGIS dataset
On 08/06/06, Christopher Schmidt <crschmidt at crschmidt.net> wrote:
>> On Thu, Jun 08, 2006 at 08:02:23AM +0100, SteveC wrote:
>> > There's a slightly quicker route - someone could write a version of
.> > ox.rb to just print xml rather than create a big DOM (and escape any
tag
>> > data).
>>
>> A Python version of this looks like:
>> http://crschmidt.net/projects/openstreetmap/ox.py
>>
>> The bottom shows how it would be used. (Although obviously with
>> completely ridiculous values :))
>>
>> If someone can point me to the code that calls ox.rb, I can rewrite the
>> caller in Python too? Alternatively, someone can rewrite what I have in
>> ruby?
>
>> Note that the major difference here is that instead of calling 'to_s'
at
>> the end, you have to call finish(), which prints the final </osm>.
>>
>> Are things like this helpful? Should they go to dev@ instead of talk@?
>>
>Yes, and yes :)
Chris,
Looked at your code and (while I have not coded in Python before) it
appears to be storing the nodes, segments and ways as data objects. For a
script optimised for planet.osm generation, what we really need is
something which simply queries the database and writes the XML direct to
standard output, no data storage at all as that is what, I believe, was
causing the memory issues.
I started a Ruby version late last night but will not be able to return to
it until about 2100 BST today so if you want to complete yours in the
meantime, fine :-)
Nick
More information about the dev
mailing list