* added geographic data to burgs CSV export
* fixed projection problems in export
added cell -> geojson export
added a QGIS example style
* adding routes data
* adding river data
* added PHP script to add random details to cells.
This commit is contained in:
Tom 2019-09-08 11:00:14 +02:00 committed by Azgaar
parent e743735e57
commit 263c2d6a3c
12 changed files with 857 additions and 199 deletions

View file

@ -252,7 +252,7 @@ function editBurgs() {
}
function downloadBurgsData() {
let data = "Id,Burg,State,Culture,Population,Capital,Port\n"; // headers
let data = "Id,Burg,State,Culture,Population,Capital,Port,Longitude,Latitude,Elevation\n"; // headers
const valid = pack.burgs.filter(b => b.i && !b.removed); // all valid burgs
valid.forEach(b => {
@ -262,7 +262,12 @@ function editBurgs() {
data += pack.cultures[b.culture].name + ",";
data += rn(b.population * populationRate.value * urbanization.value) + ",";
data += b.capital ? "capital," : ",";
data += b.port ? "port\n" : "\n";
data += b.port ? "port," : ",";
// add geography data
data += mapCoordinates.lonW + (b.x / graphWidth) * mapCoordinates.lonT + ",";
data += mapCoordinates.latN - (b.y / graphHeight) * mapCoordinates.latT + ","; // this is inverted in QGIS otherwise
data += parseInt(getFriendlyHeight(pack.cells.h[b.cell])) + "\n";
});
const dataBlob = new Blob([data], {type: "text/plain"});
@ -315,7 +320,7 @@ function editBurgs() {
}
});
}
fileReader.readAsText(fileToLoad, "UTF-8");
}
@ -339,4 +344,3 @@ function editBurgs() {
}
}