-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Artsdatabanken/updates
download and transform has been converted from sh to js and updated t…
- Loading branch information
Showing
13 changed files
with
4,857 additions
and
3,078 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const { archive } = require("lastejobb"); | ||
const { archive } = require("@artsdatabanken/lastejobb"); | ||
|
||
archive.unzip("kommune_geometri.zip"); | ||
archive.unzip("fylke_geometri.zip"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { dops } = require("@artsdatabanken/lastejobb"); | ||
|
||
main(); | ||
|
||
function main(){ | ||
// start container / image | ||
var n = dops.start_ogr_containerNImage(dops.create_container_name('simplify')); | ||
//simplify fylke | ||
dops.exec_docker(n, "ogr2ogr -nln polygons -f GeoJSON -simplify 1 /tmp/fylke_25833.geojson /tmp/fylke.geojson"); | ||
//simplify kommune | ||
dops.exec_docker(n, "ogr2ogr -nln polygons -f GeoJSON -simplify 1 /tmp/kommune_25833.geojson /tmp/kommune.geojson"); | ||
dops.clean_container(n); // dispose of container when finished | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
const execSync = require("child_process").execSync; | ||
const { dops } = require("@artsdatabanken/lastejobb"); | ||
|
||
reproject("fylke_25833.geojson", "fylke_4326.geojson"); | ||
reproject("kommune_25833.geojson", "kommune_4326.geojson"); | ||
try{ | ||
|
||
var n = dops.start_ogr_containerNImage(dops.create_container_name('reproject')); | ||
|
||
reproj_w_docker(n, "fylke_25833.geojson", "fylke_4326.geojson"); | ||
reproj_w_docker(n, "kommune_25833.geojson", "kommune_4326.geojson"); | ||
dops.clean_container(n); | ||
}catch(e){ | ||
console.error(e); | ||
console.error(e.stack); | ||
} | ||
|
||
function reproject(src, target, epsg = "EPSG:4326") { | ||
execSync( | ||
`ogr2ogr -nln polygons -f GeoJSON -t_srs ${epsg} temp/${target} temp/${src}` | ||
); | ||
function reproj_w_docker(dc_cont_name, src, target, epsg = "EPSG:25833"){ | ||
var cmd = `ogr2ogr -f GeoJSON -t_srs ${epsg} tmp/${target} tmp/${src}` | ||
dops.exec_docker(dc_cont_name, cmd); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { dops } = require("@artsdatabanken/lastejobb"); | ||
|
||
main(); | ||
|
||
function main() { | ||
console.log("punkt oppslag"); | ||
let srcFolder = 'build'; | ||
var n = dops.start_gdal(dops.create_container_name('punktOppslag'), srcFolder); | ||
let cmd = `gdal_rasterize -a autorkode -tr 100 100 /tmp/kommune_25833.geojson /tmp/kommune.tif` | ||
dops.exec_docker(n, cmd); | ||
dops.clean_container(n); | ||
} | ||
|
||
|
||
/* from 20_punkt_oppslag.sh | ||
#!/bin/bash | ||
set -e | ||
gdal_rasterize() { | ||
echo gdal_rasterize $@ | ||
docker run --rm -v /home:/home osgeo/gdal:alpine-normal-latest gdal_rasterize $@ | ||
} | ||
gdal_rasterize -a autorkode -tr 100 100 $PWD/build/kommune_25833.geojson $PWD/build/kommune.tif */ |
This file was deleted.
Oops, something went wrong.