Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not returning osm file in Mac #46

Open
Tracked by #3
toton6868 opened this issue Jul 17, 2019 · 1 comment
Open
Tracked by #3

Not returning osm file in Mac #46

toton6868 opened this issue Jul 17, 2019 · 1 comment

Comments

@toton6868
Copy link

toton6868 commented Jul 17, 2019

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?

@roelderickx
Copy link
Collaborator

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants