Locations belonging to no country

Bir Tawil: an area that is on land but not belonging to any country

$BirTawil=$loc=GeoPosition[{21.87,33.74}]

GeoNearest["Country",$loc,2]
GeoDistance[$loc,%]//Normal

GeoNearest["Ocean",$loc]
GeoDistance[$loc,First[%]]

GeoGraphics[{GeoMarker[$loc]},GeoRangePadding->Quantity[1000,"Kilometers"]]

Find all such locations

?GeoPosition

locs=Join@@Table[GeoPosition[{lat,lon}],{lat,-90,90,1},{lon,-180,180,1}]

GeoDistance[#,First@GeoNearest["Country",#]]&/@locs[[;;2]]

GeoDistance[#,First@GeoNearest["Ocean",#,1]]&/@locs[[;;2]]

(GeoDistance[#,First@GeoNearest["Ocean",#,1]]>Quantity[0.,"Miles"])&/@locs[[;;2]]

FactorInteger[65341]

batches=Partition[locs,181];

batchesSample=Partition[RandomSample[locs,20],2];

data=Monitor[
Table[
Table[
{loc,GeoDistance[loc,First@GeoNearest["Ocean",loc]]>Quantity[0.,"Miles"]&&GeoDistance[loc,First@GeoNearest["Country",loc]]>Quantity[0.,"Miles"]},
{loc,batches[[i]]}
],
{i,Length[batches]}
],
i
]

Export[FileNameJoin[{NotebookDirectory[],"locations_belonging_to_no_country_data_1.m"}],data]

data1=Join@@data;

data1//Length

Export[FileNameJoin[{NotebookDirectory[],"locations_belonging_to_no_country_data_1.m"}],data1]

data2=Cases[data1,{_,True}]

Export[FileNameJoin[{NotebookDirectory[],"locations_belonging_to_no_country_data_land_locations_not_belonging_to_any_country.m"}],data2]

$landLocationsNotInAnyCountry=data2[[All,1]];

$landLocationsNotInAnyCountry//Length
$landLocationsNotInAnyCountry//RandomChoice

Map of land locations  not  belonging  to any country

?GeoMarker

?Disk

GeoGraphics[GeoMarker[#,Graphics[{Opacity[.8],Red,Tooltip[Disk[{0,0},0.1],#]}]]&/@$landLocationsNotInAnyCountry,(*GeoCenter->pos,*)GeoRange->"World",ImageSize->3000]

loc=GeoPosition[{66,-23}];
GeoNearest["Country",loc]
GeoDistance[loc,%]//Normal
GeoNearest["Ocean",loc]
GeoDistance[loc,%]//Normal

GeoGraphics[{GeoMarker[loc]},GeoRangePadding->Quantity[10,"Kilometers"]]

Conclusion: most places found above is false positives including river exits into oceans, Caspian Sea.

$landLocationsNotInAnyCountry//Length

$landLocationsNotInAnyCountry[[1]]

data3=Composition[
With[{ocean=GeoNearest["Ocean",#]},{#,ocean,GeoDistance[#,ocean]}]&/@#&,
(*RandomSample[#,10]&,*)
Cases[#,Except[GeoPosition[{-90|90,_}]]]&
][$landLocationsNotInAnyCountry];

data4=Composition[
Reverse,
SortBy[#,Last]&,
Select[#,#[[3,1]]>Quantity[50.,"Miles"]&]&,
Cases[#,{_,Except[{(Entity["Black Sea", Entity["Ocean","BlackSea"], "Entity[\"Ocean\", \"BlackSea\"]", "ocean"])}],_}]&
][data3];

GeoGraphics[GeoMarker[#,Graphics[{Opacity[.8],Red,Tooltip[Disk[{0,0},0.1],#]}]]&/@data4[[All,1]],(*GeoCenter->pos,*)GeoRange->"World",ImageSize->3000]

loc=GeoPosition[{-82,-71}];
GeoNearest["Country",loc]
GeoDistance[loc,%]//Normal
GeoNearest["Ocean",loc]
GeoDistance[loc,%]//Normal

GeoGraphics[{GeoMarker[loc]},GeoRangePadding->Quantity[200,"Kilometers"]]