You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have an application where I would like to call is_land multiple times and for many coordinates, in the order of millions. Is there a way to speed up this process, instead of having to call is_land with one coordinate at the time. This is simply too slow for my application
I doubt it. Not without taking advantage of some spatial indexing code such
that geopandas or (I think) shapely can take advantage of if explicitly set.
Btw, in case you aren't aware, basemap is considered deprecated, and you
should move off of it, moving towards packages like cartopy.
On Wed, May 29, 2019 at 2:33 PM jakobloeg ***@***.***> wrote:
Hello, I have an application where I would like to call is_land multiple
times and for many coordinates, in the order of millions. Is there a way to
speed up this process, instead of having to call is_land with one
coordinate at the time. This is simply too slow for my application
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#462?email_source=notifications&email_token=AACHF6FNHLKA47Y7PQD6I5DPX3D7JA5CNFSM4HQQKKNKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GWR2QWA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACHF6GYQJH6UWHV2UKZT6TPX3D7JANCNFSM4HQQKKNA>
.
I use a similar function for my own purposes, and it is way faster than the normal is_land. However, the maskoceans function from my current version of basemap (1.0.8) cannot return correct values in the neighbourhood of latitudes equal to ±90° or longitudes equal to ±180°. This seems to happen when you request a coordinate that is outside the limits from the underlying GSHHG maps. However, Basemap.is_land is capable of handling such cases. I should report it at some point.
Activity
WeatherGod commentedon May 29, 2019
molinav commentedon Jun 14, 2019
You can create a vectorized version of
is_landwith the help ofmaskoceans:and use it e.g. as follows:
I use a similar function for my own purposes, and it is way faster than the normal
is_land. However, themaskoceansfunction from my current version ofbasemap(1.0.8) cannot return correct values in the neighbourhood of latitudes equal to ±90° or longitudes equal to ±180°. This seems to happen when you request a coordinate that is outside the limits from the underlying GSHHG maps. However,Basemap.is_landis capable of handling such cases. I should report it at some point.