Skip to content

Removal of unneeded dispute lua and additional country support#2068

Merged
jeffdefacto merged 18 commits into
masterfrom
additional_country_support
May 3, 2022
Merged

Removal of unneeded dispute lua and additional country support#2068
jeffdefacto merged 18 commits into
masterfrom
additional_country_support

Conversation

@jeffdefacto

@jeffdefacto jeffdefacto commented Apr 20, 2022

Copy link
Copy Markdown
Contributor

This pulls out some of the lua changes for specific disputes that are no longer necessary as we are not displaying them at this time.

Additionally, 25 dependencies were missing from the map due to a lack of place tag and/or a value of place that is not country. These lua additions change these place nodes to place=country when matching the dependency's iso code.

Lastly, ne_id and ne:brk_id_a3 tags will get pushed to dispute ways to aid in creating a dispute_id.

@jeffdefacto jeffdefacto marked this pull request as ready for review April 20, 2022 19:15
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
@tgrigsby-sc

Copy link
Copy Markdown
Contributor

this all makes sense to me, but I can't vouch for completeness, so I'm going to lean on @nvkelso for a proper review

Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua Outdated
end
-- French Guiana
if object.tags.place == 'state' and object.tags['ISO3166-1'] == 'GF' then
output_hstore['place'] = 'country'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an odd one, it's an overseas region of France (like Alaska and Hawaii), but also gets it's own ISO code.

My preference is to be true to the data and mark it place = region... and if you want to add POV overrides for ISO and all the other countries we're tracking to be country then that's OK.

The full set are (src):

  • French Guiana
  • Guadeloupe
  • Martinique
  • Mayotte
  • Réunion

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed them to region

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We keep bouncing back and forth on this one... I left new comments farther down.)

Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua
Comment thread osm2pgsql.lua Outdated

@nvkelso nvkelso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see one last round of comment about French overseas regions.

Comment thread osm2pgsql.lua Outdated
output_hstore['place'] = 'region'
output_hstore['disputed_by'] = 'CN;RU;IN;GR;CY'
end
-- Turn off Abkhazia label for most countries

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update comment:

-- Show Abkhazia label as region for more countries

Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua Outdated
Comment thread osm2pgsql.lua Outdated
output_hstore['place:RU'] = 'country'
end
-- Turn off South Ossetia label for most countries
-- Show South Ossetia label as region for most countries

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Match comment to what code does:

-- Hide South Ossetia label for most countries

Comment thread osm2pgsql.lua
output_hstore['place:US'] = 'region'
output_hstore['place:VN'] = 'region'
output_hstore['place'] = 'unrecognized'
output_hstore['place:RU'] = 'country'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rounding problems, is a map unit more like region or country?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to do this way for now, but we should revisit once we add kind_detail for these.

Comment thread osm2pgsql.lua
output_hstore['place'] = 'country'
end
-- Heard Island and McDonald Islands
if object.tags.place == 'territory' and object.tags['ISO3166-1'] == 'HM' then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a new one to me

Comment thread osm2pgsql.lua Outdated
-- Recast various French overseas departments as region
-- Réunion
if object.tags.place == 'state' and object.tags['ISO3166-1'] == 'RE' then
output_hstore['place'] = 'region'

@nvkelso nvkelso Apr 28, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will result in no label drawn a particular style, unless you also add the some/full set of place:XX codes as country (or you set the min_zoom value to be better than 3.7). This is also because they aren't listed in the NE country table (only map unit tables).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EG:

output_hstore['place:AR'] = 'country'
output_hstore['place:BD'] = 'country'
output_hstore['place:BR'] = 'country'
output_hstore['place:CN'] = 'country'
output_hstore['place:DE'] = 'country'
output_hstore['place:EG'] = 'country'
output_hstore['place:GB'] = 'country'
output_hstore['place:GR'] = 'country'
output_hstore['place:ID'] = 'country'
output_hstore['place:IL'] = 'country'
output_hstore['place:IN'] = 'country'
output_hstore['place:IT'] = 'country'
output_hstore['place:JP'] = 'country'
output_hstore['place:KO'] = 'country'
output_hstore['place:MA'] = 'country'
output_hstore['place:NL'] = 'country'
output_hstore['place:NP'] = 'country'
output_hstore['place:PK'] = 'country'
output_hstore['place:PL'] = 'country'
output_hstore['place:PS'] = 'country'
output_hstore['place:PT'] = 'country'
output_hstore['place:RU'] = 'country'
output_hstore['place:SA'] = 'country'
output_hstore['place:SE'] = 'country'
output_hstore['place:TR'] = 'country'
output_hstore['place:TW'] = 'country'
output_hstore['place:UA'] = 'country'
output_hstore['place:VN'] = 'country'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's still do this now...

It's also related to work in #2077.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's continue this in #2077... and reset to "place" = "country" here and for all 5.

Comment thread osm2pgsql.lua Outdated
end
-- Martinique
if object.tags.place == 'state' and object.tags['ISO3166-1'] == 'MQ' then
output_hstore['place'] = 'region'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread osm2pgsql.lua Outdated
end
-- Mayotte
if object.tags.place == 'state' and object.tags['ISO3166-1'] == 'YT' then
output_hstore['place'] = 'region'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread osm2pgsql.lua Outdated
end
-- Guadeloupe
if object.tags.place == 'state' and object.tags['ISO3166-1'] == 'GP' then
output_hstore['place'] = 'region'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread osm2pgsql.lua Outdated
end
-- French Guiana
if object.tags.place == 'state' and object.tags['ISO3166-1'] == 'GF' then
output_hstore['place'] = 'region'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Comment thread yaml/places.yaml Outdated
kind: region
kind_detail: province
table: osm
- filter: {name: true, place: unrecognized}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering consolidating this into the existing section above

- filter: {name: true, place: country}

As

- filter: {name: true, place: [country,unrecognized]}

With

  kind: unrecognized

Changing to

 kind: {col: place}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Around line 141

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. even simpler

Comment thread osm2pgsql.lua Outdated
end
-- New Caledonia
if object.tags.place == 'archipelago' and object.tags['ISO3166-1'] == 'NF' then
output_hstore['place'] = 'region'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New Caledonia should be country as it's a dependency of France

@nvkelso nvkelso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-- Turn off Kosovo country label for CN;RU;IN;GR

Also add here NP, BR, PS, MA, AR, VN, ID, UA

-- Hide Kosovo region labels for several POVs including China and Russia

Also add here NP, BR, PS, MA, AR, VN, ID, UA

Comment thread osm2pgsql.lua Outdated
output_hstore['place'] = 'unrecognized'
output_hstore['place:RU'] = 'country'
end
-- Turn off Nagorno-Karabakh label for most countries

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Change the name here to Artsakh (Nagorno-Karabakh) as that's the new name but not in common circulation so still put the old name in the parenthetical.

@nvkelso nvkelso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

@jeffdefacto

Copy link
Copy Markdown
Contributor Author

@nvkelso I believe all the comments have been addressed now.

@nvkelso nvkelso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@jeffdefacto jeffdefacto merged commit 66740a3 into master May 3, 2022
@jeffdefacto jeffdefacto deleted the additional_country_support branch May 3, 2022 21:44
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

Successfully merging this pull request may close these issues.

3 participants