Skip to content

Instantly share code, notes, and snippets.

@cule
cule / Lidar_walkthrough.md
Created January 13, 2021 08:16 — forked from YKCzoli/Lidar_walkthrough.md
Lidar_walkthrough

Processing LiDAR to extract building heights

Walk through

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

@cule
cule / postgisOSM-LAS.md
Created January 13, 2021 08:16 — forked from patriciogonzalezvivo/postgisOSM-LAS.md
Loading OSM and LIDar to PostGIS
@cule
cule / _.md
Created September 13, 2020 14:59 — forked from elsherbini/_.md
SO dcjs stacked bar chart
@cule
cule / india_historical_map.R
Created August 17, 2020 02:32 — forked from tylermorganwall/india_historical_map.R
Historical Map of India with 3D elevation
library(raster)
library(rayshader)
#Load QGIS georeference image (see https://www.qgistutorials.com/en/docs/3/georeferencing_basics.html)
testindia = raster::stack("1870_southern-india_modified.tif")
#Set bounding box for final map (cut off edges without data, introduced via reprojection)
india_bb = raster::extent(c(68,92,1,20))
cropped_india = raster::crop(testindia, india_bb)
#Convert to RGB array
import os
import sys
import argparse
from carto.auth import APIKeyAuthClient
from carto.maps import NamedMapManager
parser = argparse.ArgumentParser(description=(
'Example of CopySQLClient usage to stream data from NEXRAD Level 2'
<!DOCTYPE qgis_style>
<qgis_style version="2">
<symbols>
<symbol alpha="1" force_rhr="0" clip_to_extent="1" type="fill" name="pencilish">
<layer class="MarkerLine" pass="0" locked="0" enabled="1">
<prop k="average_angle_length" v="4"/>
<prop k="average_angle_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="average_angle_unit" v="MM"/>
<prop k="interval" v="0.02"/>
<prop k="interval_map_unit_scale" v="3x:0,0,0,0,0,0"/>
@cule
cule / README.md
Last active August 29, 2015 14:21 — forked from tmcw/README.md
@cule
cule / ideas.md
Last active August 29, 2015 14:18 — forked from springmeyer/ideas.md

Pulling data from remote Postgresql can be really slow. Many people try this, once.

That said, here is a mini guide of things to think about if you are pulling remote data.

Big ideas

  • If network between you and the remote data is slow, try running TileMill on a remote machine. For example, if your data is on Amazon's network, short of running TileMill on the same machine, at least running TileMill on another AWS machine would be faster. This is because network access within Amazon's cloud is going to be reliably faster than between AWS and the outside. Here is a guide for how to run TileMill from the command line on an Ubuntu Server (with no desktop) that works with AWS: http://www.mapbox.com/tilemill/docs/guides/ubuntu-service/. For details on setting up an AWS instance see https://gist.github.com/springmeyer/b0bbcd976378cf3e4e44 and for details for how to automate this see https://github.com/miccolis/aws-tilemill.

  • Debug locally to make sure you know how fast data should show up in a normal situa