title: Setting up PostGIS with Dokku date: 2017-09-22 00:00:00 Z tags:
- GIS
- PostGIS
- Dokku layout: post author: Johnnie Hård subtitle: Note to self on how to set up a PostGIS datbase on a Dokku host.
| events { | |
| worker_connections 4096; ## Default: 1024 | |
| } | |
| http { | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| #root /var/www/html; |
| const todoMachine = Machine({ | |
| id: 'todoMachine', | |
| initial: 'fetch', | |
| context: { | |
| todos: null | |
| }, | |
| states: { | |
| idle: { | |
| on: { | |
| FETCH: 'fetch', |
| { | |
| "uuid": "72e679a0-1a59-11ea-b338-d7ffcbd7b692", | |
| "jobState": "complete", | |
| "clientUrl": "https://<url-här>", | |
| "result": { | |
| "type": "Feature", | |
| "geometry": { | |
| "type": "Polygon", | |
| "coordinates": ["...koordinater"] | |
| }, |
| #!/bin/bash | |
| find $1 -name "*.$2" -print0 | xargs -0 ls >> files.txt |
title: Setting up PostGIS with Dokku date: 2017-09-22 00:00:00 Z tags:
The mongo service need to have exposed ports as per the documentation.
Then, on the Dokku server run
dokku mongo:info <name>
take note of the internal ip of the Mongo server, exposed ports and the Mongo URI.
Then run
| FROM python:3.6-slim-stretch | |
| ADD requirements.txt /tmp/requirements.txt | |
| RUN apt-get update && \ | |
| apt-get install -y \ | |
| build-essential \ | |
| make \ | |
| gcc \ | |
| locales \ |
I had a large dataset in postgis and wanted to avoid the hassle of first exporting it to a several GB geojson file before tiling it with Tippecanoe.
ogr2ogr -f GeoJSON /dev/stdout \
PG:"host=localhost dbname=postgres user=postgres password=thepassword" \
-sql "select * from a, roi where a.geom && roi.geom" \
| docker run -i -v ${PWD}:/data tippecanoe:latest tippecanoe \
--output=/data/yourtiles.mbtiles
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <title>SANKEY Experiment</title> | |
| <style> | |
| .node rect { | |
| cursor: move; | |
| fill-opacity: .9; | |
| shape-rendering: crispEdges; | |
| } |
| import { render, html } from 'lit-html' | |
| class MyElement extends HTMLElement { | |
| constructor(){ | |
| super() | |
| this.state = { | |
| loading: true | |
| } | |
| } |