pnorman/ogr2osm

Not returning osm file in Mac

toton6868 opened this issue · 1 comments

I have cloned the project in Mac. write a translation file which is as follows. Note that my shapefile column names are almost identical to osm tags.

def filterTags(attrs):
    if not attrs:
        return
    tags = {}

    if 'name' in attrs:
        tags['name'] = attrs['name'].strip()
    if 'oneway' in attrs:
        tags['oneway'] = attrs['oneway'].strip()
    if 'osm_id' in attrs:
        tags['osm_id'] = attrs['osm_id'].strip()
    if 'fclass' in attrs:
        tags['highway'] = attrs['fclass'].strip()
    if 'ref' in attrs:
        tags['ref'] = attrs['ref'].strip()
    if 'maxspeed' in attrs:
        tags['maxspeed'] = attrs['maxspeed'].strip()
    if 'layer' in attrs:
        tags['layer'] = attrs['layer'].strip()
    if 'bridge' in attrs:
        tags['bridge'] = attrs['bridge'].strip()
    if 'tunnel' in attrs:
        tags['tunnel'] = attrs['tunnel'].strip()
    if 'road_type' in attrs:
        tags['rnh:roadtype'] = attrs['road_type'].strip()
            
    tags['source'] = 'OWN Data'

    return tags

Now I am using the following command but its not returning any output osm file.

./ogr2osm.py -t translations/road_translation.py -o roads.osm -f -v --no-upload-false --never-download --never-upload Road/Road.shp

Where am I doing wrong?

Do you see any error messages? Does it look like the error in issue #9 or #24?

If yes, what do you want to do when attrs is None? Do you want to skip the feature (see the workaround in #24) or do you want to add the feature without tags (return an empty dictionary in stead of None when attrs is None)?