Skip to content

Instantly share code, notes, and snippets.

@rich-iannone
rich-iannone / subset.POSIXct.R
Last active April 8, 2022 08:48
Several examples in R on creating subsets of data via a POSIXct time object.
# Create a simple data frame for testing
df <- data.frame(POSIXtime = seq(as.POSIXct('2013-08-02 12:00'),
as.POSIXct('2013-08-06 05:00'), len = 45),
x = seq(45))
# The Subset Examples
#
# All data on 2013-08-06
sub.1 <- subset(df, format(POSIXtime,'%d')=='06')
@Zverik
Zverik / SingleTile.js
Last active July 4, 2018 12:41
A layer for single-tile WMS layers. Displays a layer as a big picture, updates it on pan and zoom. This is a hack, made for an internal project; still waiting for https://github.com/Leaflet/Leaflet/issues/558 to be solved nicely. Example: L.singleTile('http://irs.gis-lab.info/').setParams({layers: 'landsat'}).addTo(map); (won't work, because tha…
/*
* L.SingleTile uses L.ImageOverlay to display a single-tile WMS layer.
* url parameter must accept WMS-style width, height and bbox.
*/
L.SingleTile = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',