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 sentinel 2 sceneid parser for single-digit UTM zones #34

Merged
merged 3 commits into from
Dec 1, 2020

Conversation

kylebarron
Copy link
Member

With sceneids in the sentinel-cogs bucket, scene ids for single-digit UTM zones don't have a leading 0, e.g. S2B_2CMA_20181002_0_L2A, which fails with the current regex.

@kylebarron kylebarron changed the title Fix sentinel 2 sceneid for single-digit UTM zones Fix sentinel 2 sceneid parser for single-digit UTM zones Dec 1, 2020
@kylebarron
Copy link
Member Author

Should I change the "old style" regex here too?

@vincentsarago
Copy link
Member

@kylebarron looking at the ESA specification it seems to me the tile id should always be in form of [0-9]{2}[A-Z]{3} to be 5 characters long, that's why my regex WAS WRONG ;-)

I'm ok changing this but we have to 🤞 for the format of the scene id to stay as it is cc @matthewhanson

@@ -48,14 +48,14 @@ def s2_sceneid_parser(sceneid: str) -> Dict:
)

elif re.match(
"^S2[AB]_[0-9]{2}[A-Z]{3}_[0-9]{8}_[0-9]_L[0-2][A-C]$", sceneid
"^S2[AB]_[0-9]{1,2}[A-Z]{3}_[0-9]{8}_[0-9]_L[0-2][A-C]$", sceneid
Copy link
Member

Choose a reason for hiding this comment

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

I guess it's ok to change the old style scene id too. Can you do it @kylebarron. would also be nice to add entry in changelog

@vincentsarago vincentsarago merged commit b135d9e into master Dec 1, 2020
@vincentsarago vincentsarago deleted the kyle/s2-parser-utm branch December 1, 2020 20:43
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