-
Notifications
You must be signed in to change notification settings - Fork 928
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
Label administrative boundaries by real-world designation #5493
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,9 +101,13 @@ def search_osm_nominatim | |
if klass == "boundary" && type == "administrative" | ||
rank = (place.attributes["address_rank"].to_i + 1) / 2 | ||
prefix_name = t "geocoder.search_osm_nominatim.admin_levels.level#{rank}", :default => prefix_name | ||
border_type = false | ||
place_type = false | ||
place.elements["extratags"].elements.each("tag") do |extratag| | ||
prefix_name = t "geocoder.search_osm_nominatim.prefix.place.#{extratag.attributes['value']}", :default => prefix_name if extratag.attributes["key"] == "linked_place" || extratag.attributes["key"] == "place" | ||
border_type = t "geocoder.search_osm_nominatim.border_types.#{extratag.attributes['value']}", :default => prefix_name if extratag.attributes["key"] == "border_type" | ||
place_type = t "geocoder.search_osm_nominatim.prefix.place.#{extratag.attributes['value']}", :default => prefix_name if extratag.attributes["key"] == "linked_place" || extratag.attributes["key"] == "place" | ||
Comment on lines
+107
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good catch. I originally had two loops that set |
||
end | ||
prefix_name = place_type || border_type || prefix_name | ||
end | ||
prefix = t ".prefix_format", :name => prefix_name | ||
object_type = place.attributes["osm_type"] | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1489,16 +1489,43 @@ en: | |||||||||||||||||||||
weir: "Weir" | ||||||||||||||||||||||
"yes": "Waterway" | ||||||||||||||||||||||
admin_levels: | ||||||||||||||||||||||
level2: "Country Boundary" | ||||||||||||||||||||||
level3: "Region Boundary" | ||||||||||||||||||||||
level4: "State Boundary" | ||||||||||||||||||||||
level5: "Region Boundary" | ||||||||||||||||||||||
level6: "County Boundary" | ||||||||||||||||||||||
level7: "Municipality Boundary" | ||||||||||||||||||||||
level8: "City Boundary" | ||||||||||||||||||||||
level9: "Village Boundary" | ||||||||||||||||||||||
level10: "Suburb Boundary" | ||||||||||||||||||||||
level11: "Neighbourhood Boundary" | ||||||||||||||||||||||
level2: "International Boundary" | ||||||||||||||||||||||
level3: "Administrative Boundary (Level 3)" | ||||||||||||||||||||||
level4: "Administrative Boundary (Level 4)" | ||||||||||||||||||||||
level5: "Administrative Boundary (Level 5)" | ||||||||||||||||||||||
level6: "Administrative Boundary (Level 6)" | ||||||||||||||||||||||
level7: "Administrative Boundary (Level 7)" | ||||||||||||||||||||||
level8: "Administrative Boundary (Level 8)" | ||||||||||||||||||||||
level9: "Administrative Boundary (Level 9)" | ||||||||||||||||||||||
level10: "Administrative Boundary (Level 10)" | ||||||||||||||||||||||
level11: "Administrative Boundary (Level 11)" | ||||||||||||||||||||||
Comment on lines
+1493
to
+1501
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that other boundary types don’t say “Boundary”. For example, Another option would be to drop the level suffix, since @tomhughes doesn’t seem enamored with including this information. To the extent that this introduces ambiguity in the search results, the solution would be to tag boundaries with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Those are constructed here: openstreetmap-website/app/assets/javascripts/index/query.js Lines 91 to 100 in 5d76ec0
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about using icons in search/query result lists, like on changeset/element pages. For administrative boundaries it could be something like a square with a border similar to the boundary line rendered on the map, maybe with a number inside for the level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a bad idea overall, though the numbers probably aren’t as intuitive for many mappers as designations coming from either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Numbers tell how relatively big/important the area is, something that may not be clear otherwise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would the number be clearer than the locally common word for the type of boundary? Mappers who specialize in boundaries would know the local |
||||||||||||||||||||||
border_types: | ||||||||||||||||||||||
arrondissement: "Arrondissement Boundary" | ||||||||||||||||||||||
borough: "Borough Boundary" | ||||||||||||||||||||||
cercle: "Cercle Boundary" | ||||||||||||||||||||||
city: "City Boundary" | ||||||||||||||||||||||
comarca: "Comarca Boundary" | ||||||||||||||||||||||
county: "County Boundary" | ||||||||||||||||||||||
departement: "Departmental Boundary" | ||||||||||||||||||||||
department: "Departmental Boundary" | ||||||||||||||||||||||
district: "District Boundary" | ||||||||||||||||||||||
distrito: "District Boundary" | ||||||||||||||||||||||
freguesia: "Freguesia Boundary" | ||||||||||||||||||||||
local_authority: "Local Authority Boundary" | ||||||||||||||||||||||
municipality: "Municipal Boundary" | ||||||||||||||||||||||
municipi: "Municipal Boundary" | ||||||||||||||||||||||
município: "Municipal Boundary" | ||||||||||||||||||||||
nation: "International Boundary" | ||||||||||||||||||||||
national: "International Boundary" | ||||||||||||||||||||||
neighbourhood: "Neighborhood Boundary" | ||||||||||||||||||||||
parish: "Parish Boundary" | ||||||||||||||||||||||
province: "Provincial Boundary" | ||||||||||||||||||||||
região: "Regional Boundary" | ||||||||||||||||||||||
region: "Regional Boundary" | ||||||||||||||||||||||
state: "State Boundary" | ||||||||||||||||||||||
town: "Town Boundary" | ||||||||||||||||||||||
township: "Township Boundary" | ||||||||||||||||||||||
village: "Village Boundary" | ||||||||||||||||||||||
results: | ||||||||||||||||||||||
no_results: "No results found" | ||||||||||||||||||||||
more_results: "More results" | ||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
nil
would be a better initial value here given they are going to be strings if any match is found.