Skip to content
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

Migrate ign wmts services #166

Merged
merged 12 commits into from
Apr 3, 2024
Merged

Migrate ign wmts services #166

merged 12 commits into from
Apr 3, 2024

Conversation

salahelfarissi
Copy link
Contributor

@salahelfarissi salahelfarissi commented Mar 22, 2024

#165
This PR migrates the ign WMTS services to the new service: https://data.geopf.fr/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities

The new services don't have a categorizing key, like agriculture...
So I removed the apiKey as well as its test.

Edit
The test_callable is actually needed.

Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

Thanks!

@HaudinFlorence could you do a review of this change please?

Comment on lines 182 to 191
def test_callable():
# only testing the callable functionality to override a keyword, as we
# cannot test the actual providers that need an API key
original_key = str(xyz.GeoportailFrance.plan["apikey"])
updated_provider = xyz.GeoportailFrance.plan(apikey="mykey")
assert isinstance(updated_provider, TileProvider)
assert "url" in updated_provider
assert updated_provider["apikey"] == "mykey"
# check that original provider dict is not modified
assert xyz.GeoportailFrance.plan["apikey"] == original_key
Copy link
Member

Choose a reason for hiding this comment

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

This does not necessarily test xyz.GeoportailFrance tiles but the callable functionality of TileProvider object. We need to keep the test, just use different TileProvider in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK.
I will.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All tests passing.

@HaudinFlorence
Copy link
Contributor

HaudinFlorence commented Mar 25, 2024

@martinfleis @salahelfarissi Hello. I will have a look within this week, I started today but it will take me some time to be completely back on tracks on the topics, after almost 2 years. Hoping there is not too much time constraint for the PR to be merged right away.

@martinfleis
Copy link
Member

@HaudinFlorence thanks! There's no rush, it seems that the old URLs are still working. At least according to our CI.

@HaudinFlorence
Copy link
Contributor

@HaudinFlorence thanks! There's no rush, it seems that the old URLs are still working. At least according to our CI.

@martinfleis Thanks for your reply. It is still on my to-do list and will try to have a look in the following days.

@HaudinFlorence
Copy link
Contributor

HaudinFlorence commented Apr 2, 2024

Hello. I have tested the PR and took some time to check that the script _compress_providers.py works properly for the GeoportailFrance data. It seems ok. I am still not very used to usepytest yet so I haven't really checked the tests.

Here are my main comments/remarks (some of them are maybe not directly related to the migration itself but more to some maintenance of GeoportailFrance tilelayers providers:

  • I am wondering if it would not be a good idea to add a test for a GeoportalFrance tilelayer.
  • It is a detail, but the way the name was built from the variant (my proposition initially) leads that the last name never has a capital letter. Maybe this could be a good idea to change this for consistency
  • I have had a look at the gallery to check if the basemaps were rendered with the new provider generated. It seems that some basemaps referred to as broken are not (at least there is something on the map). On the contrary on other maps, there is nothing appearing but I haven't checked if it is due to some broken status or to a focus on a area where there is no data to display.
    Here is the list (that may not be exhaustive) of basemaps that are not broken anymore:
  • GeoportailFrance.Ocsge_Couverture_2002
  • GeoportailFrance.Ocsge_Couverture_2011
  • GeoportailFrance.Ocsge_Couverture_2014
  • GeoportailFrance.Ocsge_Couverture_2016
  • GeoportailFrance.Ocsge_Usage_2002
  • GeoportailFrance.Ocsge_Usage_2011
  • GeoportailFrance.Ocsge_Usage_2014
  • GeoportailFrance.Ocsge_Usage_2016
  • GeoportailFrance.Orthoimagery_Orthophotos_Coast2000
  • GeoportailFrance.Orthoimagery_Orthophotos_Geneve
  • GeoportailFrance.Points_Injection_Biomethane

# Rename for better readability
name_parts = [part.lower().capitalize().replace("-", "_") for part in variant.split(".")]
name = "_".join(name_parts)

Copy link
Contributor

Choose a reason for hiding this comment

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

This name building should maybe be reviewed to enable the last word of the name to have a capital letter. Maybe a special case should be used for acronyms whatever position it has in the name.

@martinfleis
Copy link
Member

I am wondering if it would not be a good idea to add a test for a GeoportalFrance tilelayer.

We have them. All if them are autogenerated. You can see them in the pytest log here: https://github.com/geopandas/xyzservices/actions/runs/8393293189/job/22987943322?pr=166

@HaudinFlorence
Copy link
Contributor

HaudinFlorence commented Apr 2, 2024

I am wondering if it would not be a good idea to add a test for a GeoportalFrance tilelayer.

We have them. All if them are autogenerated. You can see them in the pytest log here: https://github.com/geopandas/xyzservices/actions/runs/8393293189/job/22987943322?pr=166

Ok. Nice. So sorry, you can forget about my comment. As mentionned I did not checked tests in details and am not very familir to python tests. But now I remember that at some point I was running them and we were trying to reduce the number of failing ones when we introduce the GeoportailFrance tile layers.
By the way, having a look back again at the old PR introducing these new tilelayers #126, maybe my comments related to the broken basemaps does not hold considering your comment at that time, that some basemaps were set to broken because their tests were failing even when trying to use relevant tiles.

@salahelfarissi
Copy link
Contributor Author

Should I work on the name build or is it okay for this PR ?

@martinfleis
Copy link
Member

I would try to ensure the names are exactly as they were. It may not be optimal but it is released and some people may expect the exact names.

@HaudinFlorence
Copy link
Contributor

HaudinFlorence commented Apr 3, 2024

I would try to ensure the names are exactly as they were. It may not be optimal but it is released and some people may expect the exact names.

Yes you are right @martinfleis. Changing the name now may be misleading. So I don't have any other comment. The PR seems ok to me. It seems to properly generates the data for the providers for GeoportailFrance basemaps. Thanks for your work @salahelfarissi

@salahelfarissi
Copy link
Contributor Author

These were the modified names (21 rows).
image

Now fixed.
image

Copy link
Member

@martinfleis martinfleis left a comment

Choose a reason for hiding this comment

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

Let's give it a go. Thanks!

@martinfleis martinfleis merged commit 3f418ca into geopandas:main Apr 3, 2024
7 checks passed
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