Skip to content

Instantly share code, notes, and snippets.

View apollolm's full-sized avatar

Ryan Whitley apollolm

View GitHub Profile
@RyanWhitley To convert polygons to polylines in GRASS:
v.in.ogr dsn=<input>.shp out=chad
v.build.polylines in=chad out=chad2
v.out.ogr type=boundary in=chad2 dsn=grass_chad_lines.shp
Roger Andre
9:58 AM
@RyanWhitley Here's how you can do it to lines:
v.in.ogr dsn=AdminLine2.shp out=chad
v.clean tool=rmdupl in=chad out=chad2 <--new step to remove dupe segments
v.build.polylines in=chad2 out=chad3
@apollolm
apollolm / gist:384b8f5bbaf428535430
Last active August 29, 2015 14:20
MapboxGL Native on OSX
Trying to bulid MapboxGL Native on OSX Yosemite.
Following instructions here: https://github.com/mapbox/mapbox-gl-native
When doing this:
brew install pkg-config boost imagemagick
...response was imagemagick is already installed, but not linked.
@apollolm
apollolm / gist:350c21e54ac8d8129fae
Created December 31, 2014 17:51
Converting DEM (or other raster format) to RAW for import into Unity
gdal_translate -ot UInt16 -scale -of ENVI -outsize 1025 1025 Seattle_16Int.tif seattle_heightmap.raw
-of ENVI means it will write out RAW
This works fine. However, importing this .raw file into Unity produces an Vertically inverted terrain.
I opened with Photoshop CS, then did Image > Flip Vertical.
“Save As” Photoshop RAW. Options were blank, but saving worked.
Loaded into Unity as a terrain setting. Then manually set the Terrain height to 75, which when walking around seems right.
@apollolm
apollolm / gist:87c285b2bff6a9efc591
Created November 18, 2014 00:03
SpatialServer nginx-cache inpsect and purge
On Ubuntu 14 SpatialServer box, here's how to use the nginx-cache-purge and inspect scripts.
cd to nginx-cache-inspector and run:
sudo ./nginx-cache-inspector "india_distance" /var/cache/nginx
@apollolm
apollolm / Seattle-Police-Beats.geojson
Created November 4, 2014 04:49
Seattle Police Beats Map Layer
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@apollolm
apollolm / gist:b70f1c6cddb631232475
Created November 3, 2014 22:50
SpatialServer Nginx Config
# the IP(s) on which your node server is running. I chose port 3100 - 3103.
# pm2 is also running these 4 instances on these ports.
upstream spatialserver {
server 127.0.0.1:3100;
server 127.0.0.1:3101;
server 127.0.0.1:3102;
server 127.0.0.1:3103;
}
@apollolm
apollolm / nginx-ssl-config
Last active January 12, 2023 14:47
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
@apollolm
apollolm / site_javascript.html
Last active August 29, 2015 14:08
Same HTML as site.html, but with Javascript to make the page interactive
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The World of JavaScript</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
.section{
@apollolm
apollolm / site.html
Last active August 29, 2015 14:07
Bare bones html file, no javascript. How boring.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The World of JavaScript</title>
<style>
.section{
margin: 20px 0;
@apollolm
apollolm / map.html
Created October 7, 2014 04:32
A map template for the API workshop
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The Power of APIs</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />