This file contains hidden or 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
const csvWriter = require('csv-write-stream') | |
const shapefile = require("shapefile"); | |
const cover = require('@mapbox/tile-cover'); | |
const fs = require('fs'); | |
async function main() { | |
const shp = await shapefile.read('~/nz-imagery-surveys_wgs.shp'); | |
//console.log(shp) |
This file contains hidden or 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
var shapefile = require("shapefile"); | |
const cover = require('@mapbox/tile-cover'); | |
const fs = require('fs'); | |
async function main() { | |
const shp = await shapefile.read("~lds-nz-imagery-surveys-SHP/nz-imagery-surveys_wgs.shp") | |
console.log(shp) | |
var limits = { |
This file contains hidden or 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
{ | |
"type": "Polygon", | |
"coordinates": [ | |
[ | |
[ | |
177.4832659, | |
-37.617147 | |
], | |
[ | |
177.5549797, |
This file contains hidden or 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
{ | |
"type": "Polygon", | |
"coordinates": [ | |
[ | |
[-180.0000, 90.0000], | |
[-180.0000, -90.0000], | |
[180.0000, -90.0000], | |
[180.0000, 90.0000], | |
[-180.0000, 90.0000] | |
] |
This file contains hidden or 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
#!/bin/bash | |
A_json=./world_all_test.json | |
B_json=./gizzy_full_extent_test.json | |
#extract coord for world poly | |
Aulx=$( jq .coordinates[0][0][0] $A_json ) | |
Auly=$( jq .coordinates[0][0][1] $A_json ) |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE Map[]> | |
<Map background-color="#2a383e" srs="PROJECTION_STRING"> | |
<Style comp-op="color-dodge" filter-mode="first" name="gebco2019webmercator2"> | |
<Rule> | |
<RasterSymbolizer default-color="rgba(0, 0, 0, 0)" default-mode="linear" scaling="bilinear"> | |
<stop color="#222222" value="0" /> | |
<stop color="#ebebeb" value="255" /> | |
</RasterSymbolizer> |
This file contains hidden or 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
#!/bin/bash | |
#Run script from within package directory. Be sure XML file is stored in this directory. | |
#Download data here | |
#wget https://www.bodc.ac.uk/data/open_download/gebco/GEBCO_15SEC/zip/ | |
#unzip GEBCO_2019.zip | |
#gdal_translate -of GTiff GEBCO_2019/GEBCO_2019.nc GEBCO_2019.tif | |
#gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 GEBCO_2019.tif GEBCO_2019_webmer.tif |
This file contains hidden or 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
#!/bin/bash | |
FILE_IN=$1 | |
function gdal_get_proj() { | |
PROJ4=$(gdalinfo -nomd $1 |\ | |
grep "EXTENSION" |\ | |
sed 's/EXTENSION//g' |\ | |
sed 's/PROJ4//g' |\ |
This file contains hidden or 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
#!/bin/bash | |
FILE_IN=$1 | |
file_name=$( basename $FILE_IN | sed 's/.tif//' ) | |
function gdal_extent_gdalwarp_te() { | |
if [ -z "$1" ]; then | |
echo "Missing arguments. Syntax:" | |
echo " gdal_extent <input_raster>" |
This file contains hidden or 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
#!/bin/bash | |
FILE_IN=$1 | |
TILE_NUM=$2 | |
file_name=$( basename $FILE_IN | sed 's/.tif//' ) | |
function tiff_dims() { | |
EXTENT=$(tiffinfo "$1" | grep 'Image Width:' | sed 's/Image Width://' | sed 's/Image Length://' ) |
NewerOlder