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

Fix masking error for complex multipolygon cutlines with holes #393 #493

Merged
merged 3 commits into from
Apr 14, 2022
Merged

Fix masking error for complex multipolygon cutlines with holes #393 #493

merged 3 commits into from
Apr 14, 2022

Conversation

Fernigithub
Copy link
Contributor

Hi there!
In reference to #393

Testing


from urllib.request import urlopen
import json
from rio_tiler_pds.sentinel.aws import S2JP2Reader
from matplotlib.pyplot import imshow
import os
os.environ['AWS_REQUEST_PAYER'] = 'requester'


url = 'https://lambdatentor.s3.amazonaws.com/Polygon_with_holes.json'
response = urlopen(url)
data_json = json.loads(response.read())
feature = data_json['features'][0]
scene = 'S2A_L2A_20220315_20HKH_0'
with S2JP2Reader(scene) as sentinel:
    img , mask = sentinel.feature(feature, expression="B08")

imshow(img[0])



url = "https://lambdatentor.s3.amazonaws.com/multipoligono.geojson"
response = urlopen(url)
data_json = json.loads(response.read())
feature = data_json['features'][0]
scene = 'S2B_L1C_20220406_20HQF_0'
with S2JP2Reader(scene) as sentinel:
    img , mask = sentinel.feature(feature, expression="B08")

imshow(img[0])

Hugs!
Fernando

@vincentsarago
Copy link
Member

thanks a lot @Fernigithub, I did some cleanup and I'll merge once the CI ✅

@vincentsarago vincentsarago merged commit 3a76998 into cogeotiff:master Apr 14, 2022
@Fernigithub Fernigithub deleted the Fix-Masking-error-for-complex-multipolygon-cutlines-with-holes-#393 branch April 14, 2022 17:41
@Fernigithub
Copy link
Contributor Author

Your welcome @vincentsarago!, Great job! 💪

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.

2 participants