Replies: 1 comment 2 replies
-
This is SOOOO interesting For some reason the pydantic model is altered by the import ![]() See how the The type is defined https://github.com/developmentseed/morecantile/blob/4.3.0/morecantile/models.py#L49 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'll preface my comment by saying that the behavior I describe below does not occur in v5+ so it doesn't seem to be a critical issue. I'm just reporting something odd that I don't fully understand.
I've stumbled upon unusual behavior that appears to result from the interaction between
morecantile
and the datadog-api-client library. TLDR;tms.tiles(...)
returns tiles outside the supplied bounds when modules fromdatadog-api-client
are imported beforemorecantile
.We're running the following versions:
We're still running 4.3.0 because we have not migrated our project to Pydantic v2 yet.
Example code:
The above code produces a FeatureCollection containing tiles beginning at
![Screenshot 2023-12-07 at 10 25 23](https://private-user-images.githubusercontent.com/19274445/288805960-bd148bcf-0cb7-449a-99af-e22d51be4a87.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3MzgwOTUsIm5iZiI6MTcxODczNzc5NSwicGF0aCI6Ii8xOTI3NDQ0NS8yODg4MDU5NjAtYmQxNDhiY2YtMGNiNy00NDlhLTk5YWYtZTIyZDUxYmU0YTg3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE4VDE5MDk1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlMGM4MGRjOTE4MGVlOGI4MWMxNjNjODJmMDI2NjcyMjVlNDA1ODgxODYyMjg0YWNiYTgyMmMwNDE4MWU0YmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.AJNvLGOiU71Qjw6zxTyWI7KRYDC9_IygLQmwQURUZek)
x=0
rather than only the tiles that intersectfeat
(shown in red near San Antonio):If I move the
![Screenshot 2023-12-07 at 10 26 50](https://private-user-images.githubusercontent.com/19274445/288806350-f673f436-ba9e-4460-98fc-0c345c68ab14.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg3MzgwOTUsIm5iZiI6MTcxODczNzc5NSwicGF0aCI6Ii8xOTI3NDQ0NS8yODg4MDYzNTAtZjY3M2Y0MzYtYmE5ZS00NDYwLTk4ZmMtMGMzNDVjNjhhYjE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE4VDE5MDk1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEyNGVkNGY5ZjMyMDg3NTgxYTEwMjg4ZDc5YTdiMTI1NTdkYmY1YTUxYzUyMmU2MjM4YzY1NWIzMGQyMDcwNDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.abR5SpvvjHcp_Qw8lWhl_aMBqKQ-00EmszibOtKOidk)
morecantile
import before thedatadog-api-client
import or comment out the line importing modules fromdatadog_api_client.v2
, only the tiles that intersectfeat
are returned as expected:Any idea why this happens? I first encountered this in our project repo and verified with a fresh venv with only the libraries required to run the snippet above.
Beta Was this translation helpful? Give feedback.
All reactions