imposm-parser icon indicating copy to clipboard operation
imposm-parser copied to clipboard

Add parsing of version and user data

Open jarus opened this issue 12 years ago • 10 comments

This pull request implements parsing of version and user data from XML source.

jarus avatar Jun 20 '13 07:06 jarus

Thanks for providing a patch for #6. Unfortunately this is a backwards incompatible change. Can you update it so that it only parses and passes the metadata when the parser was called with with_metadata=True? I would also suggest to create a namedtuple for the metadata (including user_name and user_id): http://docs.python.org/2/library/collections.html#collections.namedtuple

olt avatar Jun 20 '13 07:06 olt

To use a namedtuple looks much better than a normal tuple. Thanks for your suggestion.

jarus avatar Jun 20 '13 08:06 jarus

The parser could also convert the timestamp to a datetime object. I would say there is no performance issue:

$ python -m timeit -s 'from datetime import datetime' 'datetime.strptime("2013-06-04T14:35:21Z", "%Y-%m-%dT%H:%M:%SZ")'
10000 loops, best of 3: 23.8 usec per loop

jarus avatar Jun 20 '13 09:06 jarus

"only" 23.8usec, but for each node, way and relation. For Germany alone just parsing the datetime would take ~30min. I would leave it out, maybe add it as code snippet in the documentation. If you really need it in the code, make sure it is only called when with_metadata is true.

olt avatar Jun 20 '13 09:06 olt

Okay, additional 30min for a datetime object is a little bit to high.

jarus avatar Jun 20 '13 10:06 jarus

Any news on this patch? This would be very helpful to me.

For the record- I agree with not turning the timestamp metadata into a datetime object, since this can easily be done by the programmer (perhaps include an example to illustrate how).

The data I need is the version of the object, and the changeset.

emacsen avatar Aug 22 '13 15:08 emacsen

It would be nice that the with_metadata kwarg would be also supported by the pdb parser.

In my eyes the implementation for the osm file is complete and works well.

jarus avatar Aug 23 '13 17:08 jarus

I'll take a look and see what I can do. My git-foo is not so strong as to easily know how to grab this request and merge it into my branch before working on it

emacsen avatar Aug 23 '13 22:08 emacsen

Was this part released?

sabas avatar Aug 29 '14 20:08 sabas

No it wasn't released yet. The main point was that the pdb parser doesn't support the extraction of meta data which provide this patch for osm files.

On 29.08.2014, at 22:07, sabas [email protected] wrote:

Was this part released?

— Reply to this email directly or view it on GitHub.

jarus avatar Aug 29 '14 22:08 jarus