Query to find just mainland India

I am trying to formulate a query concerning India. In the Amateur Radio world, “India” is actually 3 separate Entities - being India Mainland, Lakshadweep & Andaman and Nicobar Islands. (Why? It just is. The rules on Entity definitions are impenetrable)

When I search for India, I get all 3 Entities returned in the result. I can individually search for “Lakshadweep” & “Andaman and Nicobar Islands” as these are considered states of India. What I can’t seem to do is search for India, but without these 2 states being included.

Any idea how to extract just India?

I wish to do this programatically, so a QGIS or similar solution is not viable.

I created a relation for „Mainland India“.

So you get the requested boundary with this query:

You could search for each of the other states and combine the results.

Yes - working on such a query. There are about 30 of them unfortunately. Will OSM do a dissolve on the result, or do I have to explicitly request it? I don’t want all the state boundaries, just the aggregate of them all.

The Netherlands has oversees area that are part of The Netherlands but there is also a European Netherlands.

I had a look but it looks like there is no such thing for India (yet), the way to find this is to load a way that is part of the border for the country and see which relations it is part of, but do that for a segment Nepal-India, I do not see a relation “Mainland India” (yet).

You can also extract the whole India boundary using overpass and sub areas for Lakshadweep and Andaman,then find the difference programmatically, using python for example

With Andaman there will be a problem:

India boundary uses the maritime border

Andaman state border uses the coastline border!!