Skip to content

Instantly share code, notes, and snippets.

View mdiener21's full-sized avatar

Michael Diener mdiener21

View GitHub Profile
@mdiener21
mdiener21 / gdbList2csv.py
Last active August 29, 2015 14:06
Write a list of personal geodatabase feature classes to a CSV file
import csv, arcpy
from arcpy import env
# set path using raw string to personal geodatabase
env.workspace = r"c:\users\mdiener\documents\mypersonalgeodatabase.gdb"
# create a python list of all datasets in personal geodatabase
datasetList = arcpy.ListDatasets('*','Feature')
# open a file for writing.
@mdiener21
mdiener21 / install-apache-ant-win7
Last active January 29, 2016 00:23
install apache24 and ant windows 7
#download apache binaries: http://www.apachelounge.com/download/
#http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.10-win32-VC11.zip
#unzip to a location you have permissions on your machine
#go in to folder to install apache and start it
cd c:\Apache24\conf
# edit file httpd.conf
# change all directory paths to cd c:\Apache24\
#install apache
@mdiener21
mdiener21 / geoserver_sld_variable_sub
Created July 3, 2014 21:23
Geoserver SLD variable substitution attribute based color assignment in wms call URL . Simpley add &env=a:000066;b:6666ff to the end of your wms call and you will have dynamically changed the zone "a" color to 000066 and zone "b" color to 6666ff
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" version="1.0.0">
<NamedLayer>
<Name>Study Zones</Name>
<UserStyle>
<Name>Study Zones</Name>
<Title>Default zone style</Title>
<Abstract>Study Zone style</Abstract>
<FeatureTypeStyle>
<Name>Study Zones</Name>
@mdiener21
mdiener21 / create osm routes
Created May 16, 2014 07:03
create spatialite routing data using openstreetmap
#* original post here http://blog.mikeasoft.com/2010/09/24/local-map-rendering-and-route-finding-with-libchamplain-spatialite-and-open-street-map/
Importing OSM data into spatialite
spatialite_osm -o mydownloadeddata.osm -d myNewDB.sqlite -T roads -m
Generating a routing table
spatialite_network -d myNewDB.sqlite -T roads -g geometry -c cost -t node_to -f node_from -n name --oneway-fromto oneway_fromto --oneway-tofrom oneway_tofrom -o roads_net_data