You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "qleroy (via GitHub)" <gi...@apache.org> on 2024/02/02 16:47:57 UTC
[PR] Move Overseas department and regions closer to France mainland [superset]
qleroy opened a new pull request, #26995:
URL: https://github.com/apache/superset/pull/26995
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
feat(maps): add drom closer to mainland France
### SUMMARY
The notebook repositions the overseas departments and regions of France (DROM) closer to mainland.
The file france.geojson is generated from the notebook.
<!--- Describe the change below, including rationale and design decisions -->
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before (only France metropolitan departments):
<img width="850" alt="france_before" src="https://github.com/apache/superset/assets/9881262/97b1e707-c86b-4d7c-8027-23cf84f2448a">
After (DROM included):
<img width="851" alt="france_after" src="https://github.com/apache/superset/assets/9881262/88a0fbfe-9818-4467-adfd-ac2c6013264a">
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
Execute the notebook to observe that France DROM are effectively moved closer to mainland so that it can be display in a single map.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "qleroy (via GitHub)" <gi...@apache.org>.
qleroy commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1927385752
@rusackas I did the follow up here #27014
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] Move Overseas department and regions closer to France mainland [superset]
Posted by "qleroy (via GitHub)" <gi...@apache.org>.
qleroy commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1924276191
I also fixed two metropolitan names (errors natural earth data),
that were fixed by hand in the superset repo so a re-run of the notebook would have overwritten the fix.
- Seien-et-Marne => Seine-et-Marne
- Haute-Rhin => Haut-Rhin
```python
def replace_name(df, old, new):
if old in list(df.name):
index = df[df.name == old].index[0]
df.at[index, 'name'] = new
replace_name(france, 'Seien-et-Marne', 'Seine-et-Marne')
replace_name(france, 'Haute-Rhin', 'Haut-Rhin')
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #26995:
URL: https://github.com/apache/superset/pull/26995
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1925034134
> @rusackas do I include this in this PR or in a separate one ?
A separate one would be ideal, I think :) Then after I see how you sorted that out, maybe one of us can do the same for the Italy Regions... then there will be no exceptions!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1924306764
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/26995?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`db79c37`)](https://app.codecov.io/gh/apache/superset/commit/db79c37707ea08166fc7b664823ff51f439ce1e6?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 67.20% compared to head [(`866eb9a`)](https://app.codecov.io/gh/apache/superset/pull/26995?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 67.20%.
> Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #26995 +/- ##
=======================================
Coverage 67.20% 67.20%
=======================================
Files 1899 1899
Lines 74346 74346
Branches 8263 8263
=======================================
Hits 49963 49963
Misses 22334 22334
Partials 2049 2049
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/26995/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/26995/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.93% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/26995?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "ThomasG77 (via GitHub)" <gi...@apache.org>.
ThomasG77 commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-2027794328
FYI, similar recipe using mapshaper (pure CLI approach) https://gist.github.com/ThomasG77/e20c52a39c581bab6a9e42e87d15b9e2 (in French, can translate if needed).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1924280443
This is awesome! So happy we're fixing maps the _right_ way now!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] Move Overseas department and regions closer to France mainland [superset]
Posted by "qleroy (via GitHub)" <gi...@apache.org>.
qleroy commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1924267354
The relevant bit of code because there is no diff for notebook on github
```python
france_copy = france.copy()
reposition(france_copy, france.name=='Guadeloupe', 57.4, 25.4, 1.5, 1.5)
reposition(france_copy, france.name=='Martinique', 58.4, 27.1, 1.5, 1.5)
reposition(france_copy, france.name=='Guyane française', 52, 37.7, 0.35, 0.35)
reposition(france_copy, france.name=='La Réunion', -55, 62.8, 1.5, 1.5)
reposition(france_copy, france.name=='Mayotte', -43, 54.3, 1.5, 1.5)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(maps): Move Overseas department and regions closer to France mainland [superset]
Posted by "qleroy (via GitHub)" <gi...@apache.org>.
qleroy commented on PR #26995:
URL: https://github.com/apache/superset/pull/26995#issuecomment-1924440317
With the [geopandas dissolve](https://geopandas.org/en/stable/docs/user_guide/aggregation_with_dissolve.html) function,
I can get the France regions from the France departments !,
bypassing the resort to external sources like IGN like it was done in #25676 and #26848
@rusackas do I include this in this PR or in a separate one ?
<img width="451" alt="Screenshot 2024-02-02 at 19 11 01" src="https://github.com/apache/superset/assets/9881262/184bba5d-2aaa-4395-a752-9df26ebaa410">
```python
france_regions = france.copy()
# source : https://www.iso.org/obp/ui/#iso:code:3166:FR
dep_to_reg = {
"FR-01": "FR-ARA",
"FR-02": "FR-HDF",
"FR-03": "FR-ARA",
"FR-04": "FR-PAC",
"FR-05": "FR-PAC",
"FR-06": "FR-PAC",
"FR-07": "FR-ARA",
"FR-08": "FR-GES",
"FR-09": "FR-OCC",
"FR-10": "FR-GES",
"FR-11": "FR-OCC",
"FR-12": "FR-OCC",
"FR-13": "FR-PAC",
"FR-14": "FR-NOR",
"FR-15": "FR-ARA",
"FR-16": "FR-NAQ",
"FR-17": "FR-NAQ",
"FR-18": "FR-CVL",
"FR-19": "FR-NAQ",
"FR-21": "FR-BFC",
"FR-22": "FR-BRE",
"FR-23": "FR-NAQ",
"FR-24": "FR-NAQ",
"FR-25": "FR-BFC",
"FR-26": "FR-ARA",
"FR-27": "FR-NOR",
"FR-28": "FR-CVL",
"FR-29": "FR-BRE",
"FR-2A": "FR-20R",
"FR-2B": "FR-20R",
"FR-30": "FR-OCC",
"FR-31": "FR-OCC",
"FR-32": "FR-OCC",
"FR-33": "FR-NAQ",
"FR-34": "FR-OCC",
"FR-35": "FR-BRE",
"FR-36": "FR-CVL",
"FR-37": "FR-CVL",
"FR-38": "FR-ARA",
"FR-39": "FR-BFC",
"FR-40": "FR-NAQ",
"FR-41": "FR-CVL",
"FR-42": "FR-ARA",
"FR-43": "FR-ARA",
"FR-44": "FR-PDL",
"FR-45": "FR-CVL",
"FR-46": "FR-OCC",
"FR-47": "FR-NAQ",
"FR-48": "FR-OCC",
"FR-49": "FR-PDL",
"FR-50": "FR-NOR",
"FR-51": "FR-GES",
"FR-52": "FR-GES",
"FR-53": "FR-PDL",
"FR-54": "FR-GES",
"FR-55": "FR-GES",
"FR-56": "FR-BRE",
"FR-57": "FR-GES",
"FR-58": "FR-BFC",
"FR-59": "FR-HDF",
"FR-60": "FR-HDF",
"FR-61": "FR-NOR",
"FR-62": "FR-HDF",
"FR-63": "FR-ARA",
"FR-64": "FR-NAQ",
"FR-65": "FR-OCC",
"FR-66": "FR-OCC",
"FR-67": "FR-GES",
"FR-68": "FR-GES",
"FR-69": "FR-ARA",
"FR-70": "FR-BFC",
"FR-71": "FR-BFC",
"FR-72": "FR-PDL",
"FR-73": "FR-ARA",
"FR-74": "FR-ARA",
"FR-75": "FR-IDF",
"FR-76": "FR-NOR",
"FR-77": "FR-IDF",
"FR-78": "FR-IDF",
"FR-79": "FR-NAQ",
"FR-80": "FR-HDF",
"FR-81": "FR-OCC",
"FR-82": "FR-OCC",
"FR-83": "FR-PAC",
"FR-84": "FR-PAC",
"FR-85": "FR-PDL",
"FR-86": "FR-NAQ",
"FR-87": "FR-NAQ",
"FR-88": "FR-GES",
"FR-89": "FR-BFC",
"FR-90": "FR-BFC",
"FR-91": "FR-IDF",
"FR-92": "FR-IDF",
"FR-93": "FR-IDF",
"FR-94": "FR-IDF",
"FR-95": "FR-IDF",
"FR-GF": "FR-GF",
"FR-MQ": "FR-MQ",
"FR-GP": "FR-GP",
"FR-RE": "FR-RE",
"FR-YT": "FR-YT",
}
france_regions['iso_3166_2_fr'] = france_regions['iso_3166_2'].apply(lambda x: dep_to_reg[x])
reposition(france_regions, france.name=='Guadeloupe', 57.4, 25.4, 1.5, 1.5)
reposition(france_regions, france.name=='Martinique', 58.4, 27.1, 1.5, 1.5)
reposition(france_regions, france.name=='Guyane française', 52, 37.7, 0.35, 0.35)
reposition(france_regions, france.name=='La Réunion', -55, 62.8, 1.5, 1.5)
reposition(france_regions, france.name=='Mayotte', -43, 54.3, 1.5, 1.5)
france_regions.dissolve(by='iso_3166_2_fr').plot()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org