I have global point data of marine species along the coast. I would like to measure the distance between the two closest points but this distance needs to be measured in the sea and not on the land mass. Attach is an image that may explain my point. I am using ArcGIS 10.6.
The following may help. Derive a raster where land contains a NoData value (eg, reclassify). Below, the white area has a raster cell value of "NoData" and this represents land. The yellow point is the origin (or source) feature.
Use the Path Distance tool to derive distance radiating from this origin point. Note how it curves around the NoData cells.
Then use the Cost Back Link tool to derive a backlink surface. This uses the same origin point.
Finally, run the Cost Path as Polyline tool to derive the path that will provide the distance value. Use the second point, your destination, as the feature destination data. The feature class's attribute table will contain the distance value.
You may have to set Environments>ProcessingExtent to ensure your whole area is processed while using the various tools.