Hello,
My name is Dai. I started to use cartagen, and I'm searching for a method
that I can convert .osm file from OpenStreetMap (this for example:
http://downloads.cloudmade.com/asia/eastern_asia/japan/kanagawa/kanagawa.osm.bz2).
I tried xml2json from https://github.com/hay/xml2json but no luck, I can
not get the output file due to some memory error. Could you help me out
with my problem? Thanks in advance :D
Br, Dai
Hi,
Yes, my file is about 220MB, and the memory error is:
======
Traceback (most recent call last):
File "./xml2json.py", line 197, in <module>
main()
File "./xml2json.py", line 185, in main
out = xml2json(input, strip = 0)
File "./xml2json.py", line 147, in xml2json
return elem2json(elem,strip=strip)
File "./xml2json.py", line 127, in elem2json
return simplejson.dumps(elem_to_internal(elem,strip=strip))
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line
261, in dumps
return _default_encoder.encode(obj)
File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 214,
in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python2.7/dist-packages/simplejson/encoder.py", line 282,
in iterencode
return _iterencode(o, 0)
MemoryError
======
This only happens with large file, I successfully converted small file,
but if I put it in cartagen and edit the setup following the guide, it
won't work, nothing is rendered in browser (My command like this:
./xml2json.py -t xml2json test.osm -o test.json). Do you know why?
Br, Dai