This file contains hidden or 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(maptools) | |
library(ggplot2) | |
library(gridExtra) | |
library(scales) | |
library(lubridate) | |
# adapted from http://r.789695.n4.nabble.com/maptools-sunrise-sunset-function-td874148.html | |
ephemeris <- function(lat, lon, date, span=1, tz="UTC") { | |
lon.lat <- matrix(c(lon, lat), nrow=1) |
This file contains hidden or 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
version: "3" | |
services: | |
# mount PEcAn web folder into web server, this allows for | |
# editing code in PHP and immediatly test the new code. | |
web: | |
volumes: | |
- ${HOME}/git/pecan/web:/var/www/html/pecan | |
- ${HOME}/git/pecan/docker/config.docker.php:/var/www/html/pecan/config.php |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
### this works | |
SELECT cartodb_id, ST_GeomFromText(replace(replace(replace(replace(replace(geometry, '<Polygon><outerBoundaryIs><LinearRing><coordinates>', 'Linestring('), '</coordinates></LinearRing></outerBoundaryIs></Polygon>', ')'), ',', '$'), ' ', ','), '$', ' '),4326) geom FROM test_yield_county | |
### the official query | |
delete FROM test_yield_county where geometry = '' | |
with f as (SELECT cartodb_id, ST_GeomFromText(replace(replace(replace(replace(replace(geometry, '<Polygon><outerBoundaryIs><LinearRing><coordinates>', 'Linestring('), '</coordinates></LinearRing></outerBoundaryIs></Polygon>', ')'), ',', '$'), ' ', ','), '$', ' '),4326) geom FROM test_yield_county order by geometry desc) | |
update test_yield_county d | |
set the_geom = ( |