Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Fairhurst systemed

View GitHub Profile
@systemed
systemed / osm_centos7.sh
Created Jan 30, 2020
Installing OSM rendering stack on CentOS 7
View osm_centos7.sh
# Install OSM rendering stack on CentOS 7
# Richard Fairhurst, January 2020
yum -y install epel-release
# Postgres/GDAL
rpm -Uvh https://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm
yum -y install postgresql94-server postgresql94-devel postgis24_94 postgis24_94-docs postgis24_94-utils gdal30 gdal30-devel
# GCC
@systemed
systemed / style_profiler.rb
Last active Dec 15, 2019
Profile Mapnik styles
View style_profiler.rb
# Mapnik style profiler
# ruby style_profiler.rb /usr/local/share/maps/style/stylesheet.xml coloured_relief,hillshade,relief,combined_relief 8.1948 46.8982 8.4502 47.0753
require '/usr/local/share/ruby/ffi-mapnik/lib/ffi-mapnik.rb'
require 'nokogiri'
require 'proj4'
require 'benchmark'
xml_fn = ARGV[0]
@systemed
systemed / merge_mapnik.rb
Created Dec 15, 2019
Composite all hillshade layers into a single GeoTIFF
View merge_mapnik.rb
# Combine all hillshade layers into a single GeoTIFF
# Requires gdalcopyproj.py (which uses GDAL Python bindings)
require '/usr/local/share/ruby/ffi-mapnik/lib/ffi-mapnik.rb'
require 'nokogiri'
Mapnik.register_datasources("/usr/local/lib/mapnik/input")
Mapnik.register_fonts("/usr/local/share/maps/style/fonts")
@systemed
systemed / vector_tile_schema.md
Last active Oct 10, 2019
Vector tiles schema notes
View vector_tile_schema.md

Likely schema

place           <- place
boundary        <- boundary
route           <- route
structure       <- power, man_made, barrier, emergency, amenity=[bench, post_box, telephone…], advertising, military, playground
poi             <- shop, tourism, historic, office, amenity=[other], healthcare, craft
transport       <- highway, railway, aerialway, traffic_sign*, public_transport, amenity=bus_station
indoor          <- indoor*, entrance*
@systemed
systemed / gist:be2d6bb242d2fa497b5d93dcafe85f0c
Last active Sep 11, 2020
Routing algorithm implementations
View gist:be2d6bb242d2fa497b5d93dcafe85f0c
(Dijkstra and plain A* are generally not included here as there are thousands of
implementations, though I've made an exception for rare Ruby and Crystal versions,
and for Thor, Mapzen's enhanced A*. )
A* Ruby https://github.com/georgian-se/shortest-path
A* Crystal https://github.com/petoem/a-star.cr
A* (bidirectional with shortcuts) C++ https://github.com/valhalla/valhalla
NBA* JS https://github.com/anvaka/ngraph.path
NBA* Java https://github.com/coderodde/GraphSearchPal
NBA* Java https://github.com/coderodde/FunkyPathfinding
You can’t perform that action at this time.