MATLAB Answers

Determine if a point is over land or water

19 views (last 30 days)
Mike D.
Mike D. on 21 Aug 2021
Commented: KSSV on 24 Aug 2021
Given a point (latitude, longitude), is there a function or easy way to determine if the point is over land or over water?
I could download coastline data from NOAA and determine if a point falls inside a polygon, but I'd rather not develop an algorithm myself if it already exists.

Sign in to comment.

Accepted Answer

KSSV on 21 Aug 2021
For a given lon, lat; use interp2 and get the elevation/ bathymetry value, if the value is negative it is depth and lies in the ocean or water and if the value is positive it lies in the land.
Mike D.
Mike D. on 24 Aug 2021
Yes, I can see that both ncdisp and ncinfo tell me all about the structure, what I wanted was the few lines of code that allow me to read the binary file into Matlab variables.

Sign in to comment.

More Answers (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!