Check if different points are contained in boundary of an xyz file.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have an xyz file that defines a coastal bathymetry. The xyz file consists only of negative numbers representing water depths. It was originally sampled (almost) regularly, so that it almost fits on a regular grid. However, I don't have that semi-grid file. There are also holes or rather islands in the shape defined. Now I want to check if a given point lies within this bathymetry, or if it is outside the boundary or on an 'island'. The point does not come from the xyz file, but may lie between those points in the file. Just a yes or no as to wether it is in. I can't do a contour because many boundary points have different depth values. Can anyone help me with a way to essentially 'color' the area where I have data, and then see if a given (x,y) point would be in that colored area? Plotting it to check is easy, but there are millions of points to handle. Thanks for any suggestions.
0 Commenti
Risposte (1)
Chad Greene
il 26 Apr 2016
Modificato: Chad Greene
il 26 Apr 2016
You can use xyz2grid to get the xyz data into a gridded format, then use inpolygon with a land area outline to determine which points are inside or outside the land area. The inpolygon function does not require a gridded dataset, but if your interest is in plotting the bathymetry with pcolor, surf, imagesc, or contour, you'll need the data in a complete grid.
0 Commenti
Vedere anche
Categorie
Scopri di più su Oceanography and Hydrology in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!