I have been supplied with a matrix of bathymetry (water depth) data. The matrix represents an evenly spaced grid of depths, and is in .csv format.
The matrix has some 'screened out' areas which have value -9999. The -9999 points need to be identified and turned into some kind of feature to be used later. The majority will be in clusters inside the grid - large areas of screened out data containing many (>1000) adjacent points. However...
- It could be that some or all of the outer edge values of the grid have value -9999.
- It is possible that there are lone points/lines of points which have value -9999.
- There are likely to be areas of -9999 surrounding regions of 'good' (not -9999) data - polygons within polygons.
My task: Identify each separate area (or point) of -9999 value within the csv file, and produce a separate polygon/point for each one. The polygons would be the outer/inner boundaries of the -9999 area
The next steps involve placing items on the map, avoiding the -9999 features.
I created my own function to identify the -9999 values and create polygons, but it has some issues, and I am sure there must be pre-built libraries which can do this better than I.
Can anybody advise a way to approach this, and perhaps give some useful library/function recommendations? I am beginning to doubt whether polygons/features are the way to do this, but that approach does seem to have some nice advantages if it can work.
Thank you!