MorbZ / OsmPoisPbf

Extracts all POIs from an OpenStreetMap file (.pbf) and outputs these in a comma seperated file.
171 stars 51 forks source link

Feature undesired tags #13

Closed boldtrn closed 7 years ago

boldtrn commented 8 years ago

This PR intents to fix #8. It provides the ability to add a command line argument, that filters certain tag=value combinations.

For example when using the latest monaco.osm.pbf extract from GeoFabrik and using the following undesired tags filter: -undesiredTags name=Monte-Carlo,name=Castelleretto the POI file gets reduced by 5 POIs that have one of the given names.

The implementation might not be highly efficient, but this should only matter for anyone that wants to use this feature, still it should not be too bad. I tried to keep the impact for users that don't need the feature minimal.

Let me know what you think, and if I should improve anything?

MorbZ commented 8 years ago

Thanks, but what if I just want to filter on the key and not on value? Or I want to filter opening_hours=closed only on shops? I think it would be better to let the filter-file deal with it. If you could put:

opening_hours= 
  =closed SKIP
  =off SKIP

in it closed POIs would be skipped. You could also influence the order and just use it for certain tags. For example if you want to skip shops with closed opening hours but not amenities (bad example) you could use:

shop=
  opening_hours= 
    =closed SKIP
    =off SKIP
  =supermarket 1

amenity=
  =bench 2

which is equal to:

amenity=
  =bench 2

opening_hours= 
  =closed SKIP
  =off SKIP

shop=
  =supermarket 1

So by skipping all POIs that match the "SKIP" category this would be more flexible and cleaner than having a fixed list of tags=values. There's probably a better word than "SKIP" but you get the idea.

boldtrn commented 8 years ago

Thanks, but what if I just want to filter on the key and not on value? Or I want to filter opening_hours=closed only on shops? I think it would be better to let the filter-file deal with it

Yes, you are right, I had the same thoughts.

To be honest, I only need it like that, therefore I created only that. I might be able to extend this in some weeks, but I am hitting several busy weeks and won't be able to implement this in the near future.