PostGIS topology operator | equivalent GraphQL operator |
---|---|
ST_Contains |
_st_contains |
ST_Crosses |
_st_crosses |
ST_Equals |
_st_equals |
ST_Intersects |
_st_intersects |
ST_Overlaps |
_st_overlaps |
ST_Touches |
_st_touches |
ST_Within |
_st_within |
ST_DWithin |
_st_d_within |
import logging | |
import urllib.request | |
import boto3 | |
from settings import OBJECT_STORAGE_KEY, OBJECT_STORAGE_SECRET, OBJECT_STORAGE_REGION, OBJECT_STORAGE_BUCKET | |
logger = logging.getLogger(__name__) | |
s3config = { | |
"region_name": OBJECT_STORAGE_REGION, | |
"endpoint_url": "https://{}.digitaloceanspaces.com".format(OBJECT_STORAGE_REGION), |
# An example to get the remaining rate limit using the Github GraphQL API. | |
import requests | |
headers = {"Authorization": "Bearer YOUR API KEY"} | |
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section. | |
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) | |
if request.status_code == 200: |
Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.
Download the latest Raspbian Jessie Light
image. Earlier versions of Raspbian won't work.
Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.
license: mit |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>WaterHex</title> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script> | |
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' /> |
This tutorial is partialy based on Yuriy’s Czoli article ‘Processing LiDAR to extract building heights’.
- Install Postgres, PostGIS and OSM-PostGIS tools
brew install postgis
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
Detailed walk through of building extraction using postgis
First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] (http://wiki.openstreetmap.org/wiki/Downloading_data) for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.
LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (http://earthobservatory.nasa.gov/blogs/ele