I have the Spanish provinces polygons in a JSON file. For one province, the schema looks like this:
{
"geometry":
{
"type": "MultiPolygon",
"coordinates":
[[[
[-7702,-4944],
[-7678,-4979],
[...,...],
[-5967,-4077],
[-5982,-4097]
]]]
},
"type": "Feature",
"properties":
{
"labelrank": 20,
"code_hasc": "ES.CN",
...
"type": "Comunidad Autónoma",
"id": "ES.CN"
}
}
I would like to move the vertices of some provinces as described in the image below. The reason for that is that the visualization looks terrible if I project as it is defined in the JSON (half of the map is just empty space).
Using mapshaper.org I was able to identify the coordinates where I should send the most northern vertex. From here it just a matter of addition to each vertex in all polygons. Before I create a script in Python to do that, I would like to ask the community if there is a software or tool that allows me to select all desired vertices and move them to the desired position, something like moving a selection of nodes using Adobe Illustrator or AutoCad.
Ian Turton kindly recommended using QGis for that purpose. The use of the tool is quite straightforward for doing this kind of batch polygon displacements:
Attributes toolbar
,
click on "Select features" Vector Toolbar
, click on "Toogle editing" Advanced Digitizing Toolbar
. Right click on any toolbar and select "Advanced Digitizing Toolbar" under Toolbars Because I just wanted the new polygon coordinates for the Canary Islands, I exported the features as GeoJson and replaced accordingly.