Thanks Henrik for the updated code! As I explained in the post, the boundary data can be very complex, and I tried to address these subtleties in my code.
Look at the case of India:
CountryData[Entity["Country", "India"],
"FullCoordinates"] // Dimensions
Let us try your code on India and Pakistan, and find the indexes wrt to India
fbIN = Flatten[
CountryData[Entity["Country", "India"], "FullCoordinates"], 1];
fbPAK = Flatten[
CountryData[Entity["Country", "Pakistan"], "FullCoordinates"], 1];
isctn = Intersection[fbIN, fbPAK];
index = FindClusters@
Sort[Flatten[
Position[fbIN, #] & /@
isctn]];(*partitioning the point index list into connected \
parts*)DynamicGeoGraphics[{Thick,
GeoPath[GeoPosition /@ fbIN[[#]]] & /@ index}, ImageSize -> Large,
Frame -> True]
Note the ziczac feature on the left corner of the India-Pakistan border (close to the sea).
Also, as I said before, the result of your code is very sensitive to the country wrt which you find the indexes. For example, let's find indexes wrt to Pakisan:
fbIN = Flatten[
CountryData[Entity["Country", "India"], "FullCoordinates"], 1];
fbPAK = Flatten[
CountryData[Entity["Country", "Pakistan"], "FullCoordinates"], 1];
isctn = Intersection[fbIN, fbPAK];
index = FindClusters@
Sort[Flatten[
Position[fbPAK, #] & /@
isctn]];(*partitioning the point index list into connected \
parts*)DynamicGeoGraphics[{Thick,
GeoPath[GeoPosition /@ fbIN[[#]]] & /@ index}, ImageSize -> Large,
Frame -> True]