Skip to content

Instantly share code, notes, and snippets.

View alotau's full-sized avatar

Joseph Rios alotau

View GitHub Profile
@alotau
alotau / Create "circles" in PostGIS for QGIS
Created June 20, 2017 15:21
Needed to create circles of varying radii from point-distance data in PostGIS table
# Assumptions:
# 1. You have a table (sample) with a Geography column (loc).
# 2. That column contains only points (not a hard reqmt).
# 3. You have a double precision column representing radius.
# 4. That radius is in METERS (otherwise need to convert something somewhere).
# Found it easiest to create a new table rather than
# a view for use within QGIS.
CREATE TABLE sample_buffers AS
SELECT ST_Buffer(sample.loc,sample.radius_meters)
@alotau
alotau / D1X3.geojson
Last active September 20, 2016 15:53
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alotau
alotau / sqlite and double quotes
Created March 28, 2015 00:20
A quick note about text elements going into sqlite databases wherein some of the test is in double quotes, but not all of it. Specifically, when the text in double quotes to start the text, you care going to have issues.
Just a note on double quotes in sqlite.
I have a workflow where I parse some data and generate an input file for a sqlite DB. Within sqlite I do the following:
sqlite> .separator |
sqlite> .import my_data_file.txt my_table
I was getting errors for some lines like the following:
my_data_file.txt:2389: unescaped " character