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

Should be possible to store swath outlines as shapefiles #90

Open
adybbroe opened this issue Nov 18, 2024 · 6 comments · May be fixed by #93
Open

Should be possible to store swath outlines as shapefiles #90

adybbroe opened this issue Nov 18, 2024 · 6 comments · May be fixed by #93
Assignees
Labels
enhancement PCW Pytroll Contributers Week

Comments

@adybbroe
Copy link
Contributor

Code Sample, a minimal, complete, and verifiable piece of code

# Your code here

Problem description

[this should also explain why the current behaviour is a problem and why the
expected output is a better solution.]

Expected Output

Actual Result, Traceback if applicable

Versions of Python, package at hand and relevant dependencies

Thank you for reporting an issue !

@adybbroe adybbroe self-assigned this Nov 18, 2024
@adybbroe adybbroe added the PCW Pytroll Contributers Week label Nov 18, 2024
@ghiggi
Copy link

ghiggi commented Nov 18, 2024

Hi @adybbroe. This will be very easy to do once I finalize the PR refactoring of area/swath boundary extraction in pyresample (pytroll/pyresample#546).

It will be something like area_def.boundary().to_shapely_polygon() and then you can use fiona to save the polygon on disk in your preferred format.
Note that when writing shapefile to disk, vertices are ordered counterclockwise and polygons wrapping the pole and maybe also the antimeridian can mess up stuffs if I recall correctly) ;)

@adybbroe
Copy link
Contributor Author

Hi @adybbroe. This will be very easy to do once I finalize the PR refactoring of area/swath boundary extraction in pyresample (pytroll/pyresample#546).

It will be something like area_def.boundary().to_shapely_polygon() and then you can use fiona to save the polygon on disk in your preferred format. Note that when writing shapefile to disk, vertices are ordered counterclockwise and polygons wrapping the pole and maybe also the antimeridian can mess up stuffs if I recall correctly) ;)

Nice! Good to know. I did a hack in pytroll-schedule a couple of months ago to make shapefiles. Just as a proof-of-concept. So, will revisit that, and then re-use your new functionality when ready!

@mraspaud
Copy link
Member

A naive question here: why not have this functionality in pyorbital?

@adybbroe
Copy link
Contributor Author

Good question @mraspaud !
What I am currently adding is just a script that reads the XML generated schedule and creates shapefiles of swath outlines for each planned pass in the schedule. So, the script in a way fits in this package. But perhaps the creation of shapes should be done in pyorbital. I will consider this...

@ghiggi
Copy link

ghiggi commented Nov 21, 2024

FYI I will not be able to do any PR this week. I got other tasks to complete this week ... and I guess that before end of January I will not be able to complete the boundary refactoring. Sorry ...

@adybbroe
Copy link
Contributor Author

FYI I will not be able to do any PR this week. I got other tasks to complete this week ... and I guess that before end of January I will not be able to complete the boundary refactoring. Sorry ...

That's (work) life. But thanks. We will take from there then.

@adybbroe adybbroe linked a pull request Nov 23, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PCW Pytroll Contributers Week
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants