Making a map that shows a disputed territory can be a tricky business. Nation states vigorously contest maps that appear to portray a boundary that challenges what a border looks like. From the Falkland Islands to Kuril Islands; from Western Sahara to Arunachal Pradesh, disputed territories result in omissions, additions and inaccuracies in maps.
I grew up looking at maps in books printed by the Oxford Press, that came with a disclaimer in blue rubber stamped across them that stated how the map was wrong. This was due to the fact that the maps showed only the parts of Kashmir being administered by India, thereby omitting areas under Chinese and Pakistani control. The Criminal Law Amendment Act, 1961 in India makes it punishable with imprisonment up to 6 months to publish a map that excludes all or parts of Kashmir1.
This creates a lot of trouble for people who make maps for fun or to visualize data. Survey of India does not make it easy to get hold of shape files that represent India’s boundaries, and all the shape files that are available from international sources exclude parts of Kashmir. So, how do we solve this problem?
The North American Cartographic Information Society’s Natural Earth 2 maps has all the disputed territories available for download as shape files. One way to solve the issue on our hands will be to take the shapes relevant to Kashmir from this file and merge it with the rest of India.
We will explore how to perform and an operation like this through QGIS 3.
- Open the disputed areas shape file in QGIS.
- Select all the regions in Kashmir that are seen by India as it’s territories.
- In order to make merging these shapes easier, we will introduce a new attribute on them. Go to
Layer → Open Attribute Table
. - Switch to editing mode in the Attribute Table by clicking the
Toggle editing mode
button. - Click
New column
. - Choose a name for the column. In this example we are using
target
. SelectText (string)
as the Type and choose a number like10
for width. - For all the selected shapes, set the value of
target
to Kashmir. - Use the
Dissolve
tool, found atVector → Geoprocessing tools → Dissolve
to dissolve the shapes in to a single shape file. Choosetarget
as the value fordissolve
field. Save the output to a new shape file. - Install the QGIS plugin
MergeShapes
. Plugins can be installed fromPlugins → Manage and Install Plugins
. - Copy the India shape file from DIVA-GIS and the newly generated Kashmir shape file to a directory.
- Merge these into a single shape using
Vector → MergeShapes → MergeShapes
.
With that we have a shape File for India that closely resembles India’s official version.
Once we have the shape File for Kashmir from step 8
, we could do the merging by converting both shape Files to their corresponding GeoJSON formats and doing simple JavaScript operations on the objects.
Start by converting both shape Files to their GeoJSON representation.
> ogr2ogr -f GeoJSON india.geo.json india.shp > ogr2ogr -f GeoJSON kashmir.geo.json kashmir.shp
Load the two feature collections in to a JavaScript console. I tend to use Chromium’s Developer Tools, but in this example I am using Node.js’ REPL.
kashmir = JSON.parse(fs.readFileSync("./kashmir.geo.json").toString()); india = JSON.parse(fs.readFileSync("./india.geo.json").toString());
Identify the Kashmir feature in the India feature collection.
kin = india.features.filter(function(f) {return f.properties.NAME_1.match("Kashmir");})[0];
Replace it’s coordinates with the unified Kashmir we generated.
kin.geometry.coordinates = kashmir.features[0].geometry.coordinates;
Save it back to a GeoJSON file.
fs.writeFileSync("full_india.geo.json", JSON.stringify(india));
Now the GeoJSON file can be transformed back in to a shape file.
ogr2ogr -f 'ESRI Shapefile' full_india.shp full_india.geo.json
Back to Kashmir and laws. Will this map save one from trouble? I am not sure, but this is an improvement on the omission of territories.
- The Criminal Law Amendment Act, 1961 - Questioning the territorial integrity or frontiers of India in a manner prejudicial to the interests of safety and security of India. [return]
- Natural Earth is a public domain map dataset available at 1:10m, 1:50m, and 1:110 million scales. The data set is available for download here. [return]
- QGIS is a cross-platform free and open source desktop geographic information systems application that provides data viewing, editing, and analysis capabilities. [return]