Skip to content

Instantly share code, notes, and snippets.

View IReese's full-sized avatar

Ian Reese IReese

  • Land Information New Zealand (LINZ)
  • Wellington, New Zealand
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map background-color="#2a383e" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
<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>
#!/bin/bash
xmlfile=/gebco_template.xml
base_file=$1
export_dir=
export_png=
export_xml=
#!/bin/bash
FILE_IN=
file_name=$( basename $FILE_IN | sed 's/.tif//' )
output_dir=
div
function gdal_extent_gdalwarp_te() {
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)
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 = {
{
"type": "Polygon",
"coordinates": [
[
[
177.4832659,
-37.617147
],
[
177.5549797,
{
"type": "Polygon",
"coordinates": [
[
[-180.0000, 90.0000],
[-180.0000, -90.0000],
[180.0000, -90.0000],
[180.0000, 90.0000],
[-180.0000, 90.0000]
]
#!/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 )
#!/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
#!/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://' )