Skip to content

Instantly share code, notes, and snippets.

View rbanick's full-sized avatar

Robert Banick rbanick

  • Arbol
  • Ciudad de México, México
View GitHub Profile
@andrewharvey
andrewharvey / inplace-mbtiles2osmand.sh
Last active January 13, 2023 16:39
In-place conversion of an mbtiles SQLite3 database into an osmand offline tiles SQLite3 database.
#!/bin/sh
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring
# rights to this work.
# http://creativecommons.org/publicdomain/zero/1.0/
SCRIPT_DIR=`dirname $0`
if [ -e $1 ] ; then
@cquest
cquest / hillshade-transparent-overlay.md
Last active July 5, 2022 06:30
transparent hillshade cooking guide using gdal

Ingredients

  • a decent DEM
  • gdal
  • some computer

compute grayscale hillshade using gdaldem

gdaldem hillshade -compute_edges your_dem_file hillshade.tif

color-ramp to compute transparency (alpha channel)

In another bowl, prepare the following shade.ramp file:

@dalekunce
dalekunce / osm_extract_workflow.md
Last active September 15, 2019 15:14
workflow for cutting part of an osm file

Quick workflow to setup and cut an osm file with a polygon file

##install osmconvert

wget -O - http://m.m.i24.cc/osmconvert.c | cc -x c - -lz -O3 -o osmconvert

##move it to bin folder

cp osmconvert /usr/local/bin/osmconvert
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“newer:"2016-07-14T19:01:00Z" and building=*”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “newer:"2016-07-14T19:01:00Z" and building=*”
node(newer:"2016-07-14T19:01:00Z")["building"]({{bbox}});
# Table Population: The Facebook population data, inputted by CSV. Points
# Table tzadmin: Tanzania administration boundaries. Polygons
# Table fb_pop: The sum of population for a given admin feature ID
# Table tzadmin_fbpop: The joined table that sums the sum of population and geographic features.
#Generate the table with the right values
CREATE TABLE population
(
gid serial NOT NULL,
the_geom geometry,