Some quick and dirty PostGIS:
Get the longest line for your polygons
create table test.tatortlongestline as
select st_longestline(t.geom, t.geom) as geom, t.tatort
from indata.tatort as t
where lanskod = '01';
Some quick and dirty PostGIS:
Get the longest line for your polygons
create table test.tatortlongestline as
select st_longestline(t.geom, t.geom) as geom, t.tatort
from indata.tatort as t
where lanskod = '01';
{ | |
"location": { "lat": 0, "lng": 0 }, | |
"data": [ | |
{ "date": "2018-08-31", "cloudy_pct": 23, "B1": 3645, "B2 (etc...)": 4324, "NDVI": 0.4 }, | |
{ "date": "2018-08-25", "cloudy_pct": 21, "B1": 3445, "B2 (etc...)": 4384, "NDVI": 0.3 }, | |
"etc..." | |
] | |
} |
I hereby claim:
To claim this, I am signing this object:
(( "DEM" - zerolevel) * -1 ) * ((( "DEM" - zerolevel) * -1) > 0) |
#!/bin/bash | |
# Johnnie Hård | |
# https://synvinkel.org | |
geojson=".geojson" | |
# These are set by calling the script with arguments e.g: | |
# ./shpfolder2geojson.sh MyShapefileDirectory MyGeojsonDirectory | |
inputdirectory=$1 |
<h1>Hello World!</h1> | |
lkjdfkjfd |
Stegen jag tog, hade inget vidare syfta än att få upp ett fungerande exempel.
Ladda ner vägkartan stockholm från lantmäteriets öppna data ftp (vem fan har en ftp 2017?)
Konvertera samtliga *.shp till *.geojson. Använd convertall.sh
. Kom ihåg att lägga till -s_srs EPSG:3006 -t_srs EPSG:4326 för att reprojicera till wgs84 i samma veva.
Slå ihop alla *.geojson som ska vara med som lager i *.mbtiles filen med cat *.geojson > vagk_01_wgs84.geojson
Använd Tippecanoe för att konvertera vagk_01_wgs84.geojson
till mbtiles.
function graphicsToImage(graphics){ | |
var img = createImage(graphics.width, graphics.height); | |
img.loadPixels(); | |
graphics.loadPixels(); | |
for(var x = 0; x < img.width; x++){ | |
for(var y = 0; y < img.height; y++){ | |
idx = 4 * (y * img.width + x); | |
img.pixels[idx] = graphics.pixels[idx]; | |
img.pixels[idx+1] = graphics.pixels[idx+1]; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
<title>tourMap</title> | |
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> | |
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-providers/1.1.15/leaflet-providers.min.js"></script> |
''' | |
Author: Johnnie Hård, johnnie.hard@gmail.com | |
Purpose: Batch process all files in a directory with gospatial | |
''' | |
import os, subprocess | |
# Set input/output directories | |
# cwd = the directory where the script gets called. | |
cwd = os.getcwd() |