OsmQc / mtl2osm

Scripts pour la conversion des données ouvertes de la Ville de Montréal pour importation dans OpenStreetMap
9 stars 5 forks source link

Patch for Turin address data import #18

Open musuruan opened 9 years ago

musuruan commented 9 years ago

Hi, I'm using csv2osm to prepare the Turin address data import.

At present, csv2osm fails because:

Therefore I created the following patch to fix these issues: https://dl.dropboxusercontent.com/u/12575912/torino.diff

I hope you can merge it.

guillaumep commented 9 years ago

@musuruan Hello Andrea, I am really glad to see the csv2osm script being used outside the Montreal community.

Thanks for your patch. I'll definitively be looking into it shortly. I want to create a new GitHub project for csv2osm, and I'll integrate the changes then.

A few points regarding the code:

def generate_node_xml(row, args, translator):
    if args.ignore_rows_missing_coordinates:
        if args.longitude_field not in row or args.latitude_field not in row:
            return None

And handle the None in the main loop:

node_xml = generate_node_xml(row, args, translator)
if node_xml:
    output.write(node_xml)
guillaumep commented 9 years ago

@musuruan In all cases, do you have a sample file that can be used to reproduce the issues you have?

musuruan commented 9 years ago

Hi Guillaume, I just moved the "\n" character because I didn't want empty line in the output osm file. I didn't do any performance check.

It is fine for me if you have a command line switch to ignore missing coordinates.

You can find here the script I used with csv2osm: https://dl.dropboxusercontent.com/u/12575912/torino.py

It is not yet ready for import. Anyway it works. At the beginning of the file you can read where to download the source csv file.