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
<?php | |
# This is a fragment, needs to be integrated | |
# This doesn't send the sender's information - uses the system's email | |
# parameters to customize, perhaps in a function | |
$to_name = "MJ Watson"; | |
$to_email = "[email protected]"; | |
#$from_name = "P Parker"; | |
#$from_email = "[email protected]; | |
$subject = "test email"; |
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
# Functions to convert a longitude to the UTM zone and EPSG code | |
# Get the UTM zone for a given longitude | |
long2UTM <- function(long) {(floor((long + 180)/6) %% 60) + 1 } | |
# get the EPSG code (int) for a given longitude and hemisphere | |
UTMzone2EPSG <- function(utmzone, hemisphere) { | |
if( tolower(hemisphere) %in% c("north", "n") ) { | |
if( utmzone < 10 ) { epsg = '3260' } else { epsg = '326' } | |
} else if( tolower(hemisphere) %in% c("south", "s") ) { |
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
# Decode Google encoding lat,long point series | |
# Based on JavaScript code by Mapbox on Github: https://github.com/mapbox/polyline/blob/master/src/polyline.js | |
# Google algorithm: http://code.google.com/apis/maps/documentation/polylinealgorithm.html | |
decode_google_path <- function( point_string ) { | |
# break string into individual characters | |
chars <- strsplit(point_string, '')[[1]] | |