Skip to content

Instantly share code, notes, and snippets.

View patdevinwilson's full-sized avatar
🏠
🌎

Patrick Wilson patdevinwilson

🏠
🌎
View GitHub Profile
@magirtopcu
magirtopcu / mnc mcc sql
Created March 23, 2017 08:21
Mobile carriers codes ( mnc , mcc ) create and insert sql. Converted from https://github.com/pbakondy/mcc-mnc-list
CREATE TABLE `carriers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(13) CHARACTER SET utf8 DEFAULT NULL,
`countryName` varchar(56) CHARACTER SET utf8 DEFAULT NULL,
`countryCode` varchar(14) CHARACTER SET utf8 DEFAULT NULL,
`mcc` int(11) DEFAULT NULL,
`mnc` varchar(9) CHARACTER SET utf8 DEFAULT NULL,
`brand` varchar(48) CHARACTER SET utf8 DEFAULT NULL,
`operator` varchar(75) CHARACTER SET utf8 DEFAULT NULL,
`status` varchar(21) CHARACTER SET utf8 DEFAULT NULL,
@patdevinwilson
patdevinwilson / gist:3947862
Created October 24, 2012 18:23
Generating Centroids From planet_osm_polygon buildings
## Creates osm-florida database and initializes postgis
osm2pgsql -c -d osm-florida florida.osm.bz2 -H localhost -P 5432 -U postgres
## Adds a new point geometry column in WGS_84
SELECT AddGeometryColumn ('public','planet_osm_polygon', 'geom', '4326', 'POINT', 2)
## Populates the new 'geom' column with centroids of planet_osm_polygon in WGS84
UPDATE planet_osm_polygon set geom = st_transform(st_centroid(way), 4326)
Building GDAL 1.9 with MDB (PGeo) support on OS X Lion
- Download and install the "Java for Mac OS X 10.7 Update 1 Developer Package" from https://developer.apple.com/downloads/index.action
- Download jackcess-1.2.6.jar from http://sourceforge.net/projects/jackcess/files/jackcess/1.2.6/jackcess-1.2.6.jar/download
- Download http://mdb-sqlite.googlecode.com/files/mdb-sqlite-1.0.2.tar.bz2 to get commons-lang-2.4.jar and commons-logging-1.1.1.jar. They will go alongside jackcess in the $CLASSPATH after it builds.
- In the GDAL source root, edit the configure.in and replace it with https://gist.github.com/1975654
@oeon
oeon / bulk-shp2pgsql
Created February 17, 2011 00:22
batch upload folder of shapefiles which are all in same .prj to PostGIS database
#!/bin/bash
FILES=$(ls *.shp | sed 's/\..\{3\}$//');
for FILE in $FILES
do
shp2pgsql -s 4326 -I -k ${FILE} gis.${FILE} | psql -d HSIP
done