Skip to content

Instantly share code, notes, and snippets.

View bmoregeo's full-sized avatar

Christopher Fricke bmoregeo

View GitHub Profile
@bmoregeo
bmoregeo / csv2shp.py
Created October 15, 2014 13:50
Batch convert CSV to Shapefile with arcpy
import arcpy
import os
def csv2shp(csv_file, field_x, field_y, shape_file):
"""
Convert a CSV file with x/y fields into a Shapefile
"""
table_view = 'csv_file_as_view'
layer = 'xy_event_layer'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmoregeo
bmoregeo / php_mysql_extent
Created September 3, 2013 23:29
Query MYSQL based on extent
//Get Coordinates From Javascript Call
$latMin = $_GET["c1"];
$lonMin = $_GET["c2"];
$latMax = $_GET["c3"];
$lonMax = $_GET["c4"];
//Gather Coordinates Into a MySQL Polygon Geometry Type
$bounds = "GeomFromText('POLYGON((".$lonMin." ".$latMin.",".$lonMin."," .$latMax.",".$lonMax." ".$latMax.",".$lonMax." ".$latMin.",".$lonMin." ".$latMin."))')";
//Database Fields