This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for file in `find . -name "*.env"`; do | |
# we want the name without the '.env' bit | |
base=`basename $file .env` | |
echo $base | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure Postgres | |
# | |
# create a postgres database for the records | |
createdb sailwx | |
# make the new database PostGIS compatible (here, against Postgres 8.4) | |
git clone https://github.com/straup/postgis-tools | |
cd postgis-tools | |
sh ./createdb-8.4.sh sailwx sailwx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkRaster <- function(raster) { | |
if (raster@nrows * raster@ncols == 220106) { | |
message <- paste("Raster size checks out for layer:", raster@layernames, sep="") | |
} | |
else { | |
message <- paste( "invalid raster dimensions; nrows:", raster@nrows, " ncols:", raster@ncols, sep="") | |
} | |
print(message) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgdal) | |
behrmann.crs <- CRS('+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs') | |
# define a known point in Behrmann projection | |
point <- SpatialPoints(cbind(0, 7284713.234), behrmann.crs) | |
# try reprojecting point back to WGS84 | |
spTransform(point, CRS('+init=epsg:4326')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# distance_from_shore.py: compute true distance between points | |
# and closest geometry. | |
# shaun walbridge, 2012.05.15 | |
# TODO: no indexing used currently, could stand if performance needs | |
# improving (currently runs in ~1.5hr for 13k points) | |
from geopy import distance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fine scale inner block | |
outFocalStatistics = FocalStatistics(Bathy, NbrAnnulus(FineInnerRadius, FineOuterRadius, "CELL"), "MEAN") | |
outRaster = Int(Plus(Minus(Bathy, outFocalStatistics), 0.5)) | |
# broad scale inner block | |
outFocalStatistics = FocalStatistics(Bathy, NbrAnnulus(BroadInnerRadius, BroadOuterRadius, "CELL"), "MEAN") | |
outRaster = Int(Plus(Minus(Bathy, outFocalStatistics), 0.5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Anderson: | |
http://gis.stackexchange.com/users/5330/awesomo | |
Chico: | |
http://gis.stackexchange.com/users/2749/boyle300 | |
Nevada City: | |
http://gis.stackexchange.com/users/357/brianpeasley | |
Sacramento: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def updateParameters(self, parameters): | |
validator = getattr(self, 'ToolValidator', None) | |
# parameter names | |
cols = ['bathy', 'inner', 'outer', 'scale_factor', 'output'] | |
outer_radius = parameters[cols.index('outer')].valueAsText | |
bathy = parameters[cols.index('bathy')].valueAsText | |
if outer_radius is not None and bathy is not None: | |
raster_desc = arcpy.Describe(bathy) | |
# get the cellsize of the input raster; assume same in X & Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pulled from http://resources.arcgis.com/en/help/main/10.1/00qn/pdf/ArcGIS10_Acknowledgements.pdf | |
7-Zip 9.2 | |
ASP.NET AJAX Control Toolkit 1.0.10920.0 | |
ASP.NET AJAX JavaScript library 1.0 | |
ASP.NET MVC 2 | |
Alphaworks ICU 2.2 | |
Ant 1.6.5 | |
Apache log4cxx | |
Apache AXIS 1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arcpy | |
arcpy.CheckOutExtension("spatial") | |
raster = arcpy.Raster("c:\\workspace\\input_raster") | |
range = raster.maximum - raster.minimum | |
bins = 256 | |
bin_size = (range) / bins | |
# now we know the bin width, can multiply that by the OBJECTID for the lower bound of each | |
lower_bin_value = [bin_size * i for i in range(bins)] |
OlderNewer