Set of Polish administrative borders in geoJson format.
Set of Polish administrative borders in geoJson format.
This set contains separate files for each of the 3 administrative levels (municipalities/gminy, counties/powiaty, voivodships/województwa) and a file for the country borders. The borders for each level are overlaping (the borders of counties, voivodships and the country were generated by dissolving borders of municipalities).
This data was prepared for the project https://atlasnienawisci.pl. Because I did not find such data when I was doing Atlas - I share it, maybe it will make life easier for someone.
The borders were prepared on the basis of the following sources and tools:
The files contain the standard geoJson feature collections. For each element, the properties consist of two elements:
The primary identifier is TERC. The code base (TERC basic) and code syntax are available on the GUS website
The borders provided here are greatly simplified (although the file with the borders of municipalities is still over 3Mb). If you need more precise borders, you can generate them yourself. Below is a description of how I generated provided data:
Example of a script for generating counties boundaries based on municipalities boundaries. Data is connected using TERC code (the code for a municipality begins with the code for the relevant county - see the GUS website for details).
const fs = require('fs');
const dissolve = require('geojson-dissolve');
let dest = 'dissolved.counties.json',// save to
geoData = JSON.parse(fs.readFileSync('municipalities.json')), // lower level borders
tercData = JSON.parse(fs.readFileSync('counties.terc.json')); // list of counties in format [{terc: '0000'},{...}]
let dissvoledShapes = tercData.map(function(row) {
let shapes = geoData.features.filter(function(item) {
return item.properties.JPT_KOD_JE.startsWith(row.Terc);
}),
shape = dissolve(shapes),
feature = {
'type': 'Feature',
'geometry': shape,
'properties': {
'terc': row.Terc,
'name': row.nazwa,
}
};
return feature;
});
let geoCollection = {'type':'FeatureCollection', 'features': dissvoledShapes};
fs.writeFile(dest, JSON.stringify(geoCollection), function(err) {
if(err) {
return console.log(err);
}
});