spatial query crossing anti-meridian #512
-
Anyone have a good way to deal with spatial queries spanning either side of 180 deg longitude? Does the api except geographic coordinates in 0-360 deg longitude? If yes, just planning on adding some logic to my code to switch to 360 if subset spans 180. Update: the api does not except lon > 180: "Invalid longitude value (must be between -180 and 180, inclusive)" so we have to do something messy like break into two polygons either side of 180 and query separately? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @ihowat! icepyx does accept geographic coordinates, but they need to be submitted with an argument that lets icepyx know you're intentionally doing so (versus accidentally submitting your coordinates in the wrong order, which makes it hard to detect this case automatically). The history of this limitation is that it's imposed by CMR/NSIDC, so while we have logic to do the 0-360 to -180-180 conversion for users, it doesn't happen automatically. Simply adding |
Beta Was this translation helpful? Give feedback.
-
ok, thanks Jessica. Sorry if I missed that in the docs
…On Fri, Feb 23, 2024 at 10:10 AM Jessica Scheick ***@***.***> wrote:
Hello @ihowat <https://github.com/ihowat>! icepyx does accept geographic
coordinates, but they need to be submitted with an argument that lets
icepyx know you're intentionally doing so (versus accidentally submitting
your coordinates in the wrong order, which makes it hard to detect this
case automatically). The history of this limitation is that it's imposed by
CMR/NSIDC, so while we have logic to do the 0-360 to -180-180 conversion
for users, it doesn't happen automatically.
Simply adding xdateline=True to your Query input (e.g. region =
ipx.Query("ATL03", spatial_extent=my_bounding_box, date_range=my_dates,
xdateline=True)) should do the trick. If this DOESN'T work or gives you
unexpected output, please do share your inputs so we can debug and fix it
(because it means something's not behaving as expected!).
—
Reply to this email directly, view it on GitHub
<#512 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADTGCJPJ3EKZNAMSN2XJEDLYVCWORAVCNFSM6AAAAABDTQCC7GVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DKNRZGQ4DA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hello @ihowat! icepyx does accept geographic coordinates, but they need to be submitted with an argument that lets icepyx know you're intentionally doing so (versus accidentally submitting your coordinates in the wrong order, which makes it hard to detect this case automatically). The history of this limitation is that it's imposed by CMR/NSIDC, so while we have logic to do the 0-360 to -180-180 conversion for users, it doesn't happen automatically.
Simply adding
xdateline=True
to your Query input (e.g.region = ipx.Query("ATL03", spatial_extent=my_bounding_box, date_range=my_dates, xdateline=True)
) should do the trick. If this DOESN'T work or gives you unexpected output, please do share …