-
Notifications
You must be signed in to change notification settings - Fork 9
Set reasonable default area definitions #1
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
Conversation
Nearly all users will need a sensible definition for if an object is an area or not. This adapts the OpenStreetMap Carto definitions, as updated in the Flex PR. If a user desires their own definitions, they can always override the defaults.
|
Thinking about, an alternative way to do this would be to have a new type of function with add_proc, |
In conjunction with osm2pgsql-dev/osm2pgsql-themepark#1 this makes area code common, reducing what we need to maintain specific to this style.
|
See pnorman/spirit@f80ec01 for an example of the simplification this allows for users, and ensuring that most users will get it right instead of trying to incorrectly implement their own area rules. |
|
I always thought having such a list of all "area tags" was important but I am questioning myself now. The shortbread implementation for Themepark doesn't need that list. It simply does the checks for the different keys/tags in the There is also the problem of handling conflicting tags. What happens if one tag says this is an area and another says this is a line? If we force one result, we might break something. Maybe somebody built an allotment on a dam or so. :-) In any case I think we need a faster implementation of the area check. It will be called a lot! We should be able to do, at most, two hash lookups for each tag, one for the key, one for the value. If we have nested hashes, the first for looking up the key can result in We can still have a nicer config to define the keys/tags in any we like and build the fast lookup table from there on startup. |
|
I have thought about this some more and I don't think this should be part of the Themepark core. You only really need that list if you want to write some generic code, that creates line and polygon geometries for a bunch of data without looking at the tags in detail. For instance this code here from the commit you mentioned: What is the So I think we should put that code instead into some generic place, where it can be accessed from if needed, maybe the |
Because we know the object has an area tag, it's effectively checking for |
|
But that's a pretty expensive call to just check for |
|
I have created an alternative PR #3. We already had a function to check polygon tags in the "basic" topic. It extends this function. I am not sure whether this is the best place for the function, but if not we can move it somewhere else after we have figured out whether the functionality is the right one. |
Nearly all users will need a sensible definition for if an object is an area or not. This adapts the OpenStreetMap Carto definitions, as updated in the Flex PR. If a user desires their own definitions, they can always override the defaults.