The document provides an overview of geospatial data in R. It discusses the history and evolution of spatial data handling in R, from early packages like maps to modern spatial data types and operations. These include classes for points, lines, polygons and rasters, as well as functions for manipulation and analysis of spatial data, such as overlaying points on rasters and extracting values. The document also covers coordinate reference systems and reprojecting data between different spatial projections.
Slide show for the webinar on "Spatial Data Science with R" organized for the GeoDevelopers.org community. The video of the webinar and all the related materials including source code and sample data can be downloaded from this link: http://amsantac.co/blog/en/2016/08/07/spatial-data-science-r.html
In this webinar I talked about Data Science in the context of its application to spatial data and explained how we can use the R language for the analysis of geographic information within the different stages of a data science workflow, from the import and processing of spatial data to visualization and publication of results.
Finding Meaning in Points, Areas and Surfaces: Spatial Analysis in RRevolution Analytics
Everything happens somewhere and spatial analysis attempts to use location as an explanatory variable. Such analysis is made complex by the very many ways we habitually record spatial location, the complexity of spatial data structures, and the wide variety of possible domain-driven questions we might ask. One option is to develop and use software for specific types of spatial data, another is to use a purpose-built geographical information system (GIS), but determined work by R enthusiasts has resulted in a multiplicity of packages in the R environment that can also be used.
Search with Polygons: Another Approach to Solr Geospatial Searchlucenerevolution
Presented by Andrew Urquhart | Raytheon - See conference video - http://www.lucidimagination.com/devzone/events/conferences/lucene-revolution-2012
After investigating the Lucene Spatial Playground approach to Solr geospatial search, Raytheon determined that the Lucene Spatial Playground was not evolving in a direction that would meet their needs. In particular, they required the ability to search for documents within a geospatial polygon and also desired a solution that would not require special handling at any point on the Earth specifically including the poles and the 180-degree East/West longitude meridian. Taking these requirements, they implemented a Solr/Lucene geospatial search capability that maps latitude/longitude points onto a spherical Earth and then operates in three-dimensional Cartesian space. Using the geohash algorithm modified to produce Long indices, Raytheon indexes the approximate locations of points as numeric values. This approach enables index lookup using Trie structures with numeric range queries. Come hear about their approach to Solr Geospacial Search.
Workshop - Hadoop + R by CARLOS GIL BELLOSTA at Big Data Spain 2013Big Data Spain
The workshop will illustrate a number of techniques for data modelling that help us extend our small data capabilities to the world of big data: sampling, resampling, parallelization where possible, etc. We will leverage the functional architecture of R and its statistical analysis prowess in small data environments using the mapreduce technique embedded in Hadoop to tackle large data analysis problems. Particular attention will be paid to the ubiquitous --but non-scalable-- logistic regression technique and its big data alternatives.
Slide show for the webinar on "Spatial Data Science with R" organized for the GeoDevelopers.org community. The video of the webinar and all the related materials including source code and sample data can be downloaded from this link: http://amsantac.co/blog/en/2016/08/07/spatial-data-science-r.html
In this webinar I talked about Data Science in the context of its application to spatial data and explained how we can use the R language for the analysis of geographic information within the different stages of a data science workflow, from the import and processing of spatial data to visualization and publication of results.
Finding Meaning in Points, Areas and Surfaces: Spatial Analysis in RRevolution Analytics
Everything happens somewhere and spatial analysis attempts to use location as an explanatory variable. Such analysis is made complex by the very many ways we habitually record spatial location, the complexity of spatial data structures, and the wide variety of possible domain-driven questions we might ask. One option is to develop and use software for specific types of spatial data, another is to use a purpose-built geographical information system (GIS), but determined work by R enthusiasts has resulted in a multiplicity of packages in the R environment that can also be used.
Search with Polygons: Another Approach to Solr Geospatial Searchlucenerevolution
Presented by Andrew Urquhart | Raytheon - See conference video - http://www.lucidimagination.com/devzone/events/conferences/lucene-revolution-2012
After investigating the Lucene Spatial Playground approach to Solr geospatial search, Raytheon determined that the Lucene Spatial Playground was not evolving in a direction that would meet their needs. In particular, they required the ability to search for documents within a geospatial polygon and also desired a solution that would not require special handling at any point on the Earth specifically including the poles and the 180-degree East/West longitude meridian. Taking these requirements, they implemented a Solr/Lucene geospatial search capability that maps latitude/longitude points onto a spherical Earth and then operates in three-dimensional Cartesian space. Using the geohash algorithm modified to produce Long indices, Raytheon indexes the approximate locations of points as numeric values. This approach enables index lookup using Trie structures with numeric range queries. Come hear about their approach to Solr Geospacial Search.
Workshop - Hadoop + R by CARLOS GIL BELLOSTA at Big Data Spain 2013Big Data Spain
The workshop will illustrate a number of techniques for data modelling that help us extend our small data capabilities to the world of big data: sampling, resampling, parallelization where possible, etc. We will leverage the functional architecture of R and its statistical analysis prowess in small data environments using the mapreduce technique embedded in Hadoop to tackle large data analysis problems. Particular attention will be paid to the ubiquitous --but non-scalable-- logistic regression technique and its big data alternatives.
A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16)Menlo Systems GmbH
DASH is a realization of the PGAS (partitioned global address space) model in the form of a C++ template library without the need for a custom PGAS (pre-)compiler.
We present the DASH NArray concept, a multidimensional array abstraction designed as an underlying container for stenciland dense numerical applications.
After introducing fundamental programming concepts used in DASH, we explain how these have been extended by multidimensional capabilities in the NArray abstraction.
Focusing on matrix-matrix multiplication in a case study, we then discuss an implementation of the SUMMA algorithm for dense matrix multiplication to demonstrate how the DASH NArray facilitates portable efficiency and simplifies the design of efficient algorithms due to its explicit support for locality-based operations.
Finally, we evaluate the performance of the SUMMA algorithm based on the NArray abstraction against established implementations of DGEMM and PDGEMM.
In combination with mechanisms for automatic optimization of logical process topology and domain decomposition, our implementation yields highly competitive results without manual tuning, significantly outperforming Intel MKL and PLASMA in node-level use cases as well as ScaLAPACK in highly distributed scenarios.
Hashing has witnessed an increase in popularity over the
past few years due to the promise of compact encoding and fast query
time. In order to be effective hashing methods must maximally preserve
the similarity between the data points in the underlying binary representation.
The current best performing hashing techniques have utilised
supervision. In this paper we propose a two-step iterative scheme, Graph
Regularised Hashing (GRH), for incrementally adjusting the positioning
of the hashing hypersurfaces to better conform to the supervisory signal:
in the first step the binary bits are regularised using a data similarity
graph so that similar data points receive similar bits. In the second
step the regularised hashcodes form targets for a set of binary classifiers
which shift the position of each hypersurface so as to separate opposite
bits with maximum margin. GRH exhibits superior retrieval accuracy to
competing hashing methods.
Visualization of multidimensional multi factorial big data is not large data, big data is complex data.We are trainnig decipher this complexcity data Visualization.
Data Visualization packages of R software lattice and ggplot 2.
Graphical Data-Mining Analysis With R Software
DASH: A C++ PGAS Library for Distributed Data Structures and Parallel Algorit...Menlo Systems GmbH
We present DASH, a C++ template library that offers distributed data structures and parallel algorithms and implements a compiler-free PGAS (partitioned global address space) approach.
DASH offers many productivity and performance features such as global-view data structures, efficient support for the owner-computes model, flexible multidimensional data distribution schemes and inter-operability with STL (standard template library) algorithms. DASH also features a flexible representation of the parallel target machine and allows the exploitation of several hierarchically organized levels of locality through a concept of Teams. We evaluate DASH on a number of benchmark applications and we port a scientific proxy application using the MPI two-sided model to DASH.
We find that DASH offers excellent productivity and performance and demonstrate scalability up to 9800 cores.
Here we describe how to "think" mapreduce not just "code" mapreduce. We solve some interesting problems using mapreduce (e.g. how to compute similarity between all pair of documents on the web, how to do k-means clustering using map-reduce, and how to find cliques in a graph using map-reduce). These solutions are simple, elegant, and open up new ways for people to actually use mapreduce more than just simple number crunching.
Learning to Project and Binarise for Hashing-based Approximate Nearest Neighb...Sean Moran
In this paper we focus on improving the effectiveness of hashing-based approximate nearest neighbour search. Generating similarity preserving hashcodes for images has been shown to be an effective and efficient method for searching through large datasets. Hashcode generation generally involves two steps: bucketing the input feature space with a set of hyperplanes, followed by quantising the projection of the data-points onto the normal vectors to those hyperplanes. This procedure results in the makeup of the hashcodes depending on the positions of the data-points with respect to the hyperplanes in the feature space, allowing a degree of locality to be encoded into the hashcodes. In this paper we study the effect of learning both the hyperplanes and the thresholds as part of the same model. Most previous research either learn the hyperplanes assuming a fixed set of thresholds, or vice-versa. In our experiments over two standard image datasets we find statistically significant increases in retrieval effectiveness versus a host of state-of-the-art data-dependent and independent hashing models.
This introduction to the popular ggplot2 R graphics package will show you how to create a wide variety of graphical displays in R. Data sets and additional workshop materials available at http://projects.iq.harvard.edu/rtc/event/r-graphics
Using R to Visualize Spatial Data: R as GIS - Guy LansleyGuy Lansley
This talk demonstrates some of the benefits of using R to visualize spatial data efficiently and clearly.
It was originally presented by Guy Lansley (UCL and the Consumer Data Research Centre) to the GIS for Social Data and Crisis Mapping Workshop at the University of Kent.
Learn how to get started making Leaflet maps through R statistical software. Sounds crazy? Maybe. But the R package leafletR allows people familiar with R, but maybe not so much with HTML and Javascript coding, to make a basic Leaflet map (interactive, slipping web map) quickly with minimal knowledge of other programming languages.
Example code posted here: https://github.com/MicheleTobias/RCode
A Multidimensional Distributed Array Abstraction for PGAS (HPCC'16)Menlo Systems GmbH
DASH is a realization of the PGAS (partitioned global address space) model in the form of a C++ template library without the need for a custom PGAS (pre-)compiler.
We present the DASH NArray concept, a multidimensional array abstraction designed as an underlying container for stenciland dense numerical applications.
After introducing fundamental programming concepts used in DASH, we explain how these have been extended by multidimensional capabilities in the NArray abstraction.
Focusing on matrix-matrix multiplication in a case study, we then discuss an implementation of the SUMMA algorithm for dense matrix multiplication to demonstrate how the DASH NArray facilitates portable efficiency and simplifies the design of efficient algorithms due to its explicit support for locality-based operations.
Finally, we evaluate the performance of the SUMMA algorithm based on the NArray abstraction against established implementations of DGEMM and PDGEMM.
In combination with mechanisms for automatic optimization of logical process topology and domain decomposition, our implementation yields highly competitive results without manual tuning, significantly outperforming Intel MKL and PLASMA in node-level use cases as well as ScaLAPACK in highly distributed scenarios.
Hashing has witnessed an increase in popularity over the
past few years due to the promise of compact encoding and fast query
time. In order to be effective hashing methods must maximally preserve
the similarity between the data points in the underlying binary representation.
The current best performing hashing techniques have utilised
supervision. In this paper we propose a two-step iterative scheme, Graph
Regularised Hashing (GRH), for incrementally adjusting the positioning
of the hashing hypersurfaces to better conform to the supervisory signal:
in the first step the binary bits are regularised using a data similarity
graph so that similar data points receive similar bits. In the second
step the regularised hashcodes form targets for a set of binary classifiers
which shift the position of each hypersurface so as to separate opposite
bits with maximum margin. GRH exhibits superior retrieval accuracy to
competing hashing methods.
Visualization of multidimensional multi factorial big data is not large data, big data is complex data.We are trainnig decipher this complexcity data Visualization.
Data Visualization packages of R software lattice and ggplot 2.
Graphical Data-Mining Analysis With R Software
DASH: A C++ PGAS Library for Distributed Data Structures and Parallel Algorit...Menlo Systems GmbH
We present DASH, a C++ template library that offers distributed data structures and parallel algorithms and implements a compiler-free PGAS (partitioned global address space) approach.
DASH offers many productivity and performance features such as global-view data structures, efficient support for the owner-computes model, flexible multidimensional data distribution schemes and inter-operability with STL (standard template library) algorithms. DASH also features a flexible representation of the parallel target machine and allows the exploitation of several hierarchically organized levels of locality through a concept of Teams. We evaluate DASH on a number of benchmark applications and we port a scientific proxy application using the MPI two-sided model to DASH.
We find that DASH offers excellent productivity and performance and demonstrate scalability up to 9800 cores.
Here we describe how to "think" mapreduce not just "code" mapreduce. We solve some interesting problems using mapreduce (e.g. how to compute similarity between all pair of documents on the web, how to do k-means clustering using map-reduce, and how to find cliques in a graph using map-reduce). These solutions are simple, elegant, and open up new ways for people to actually use mapreduce more than just simple number crunching.
Learning to Project and Binarise for Hashing-based Approximate Nearest Neighb...Sean Moran
In this paper we focus on improving the effectiveness of hashing-based approximate nearest neighbour search. Generating similarity preserving hashcodes for images has been shown to be an effective and efficient method for searching through large datasets. Hashcode generation generally involves two steps: bucketing the input feature space with a set of hyperplanes, followed by quantising the projection of the data-points onto the normal vectors to those hyperplanes. This procedure results in the makeup of the hashcodes depending on the positions of the data-points with respect to the hyperplanes in the feature space, allowing a degree of locality to be encoded into the hashcodes. In this paper we study the effect of learning both the hyperplanes and the thresholds as part of the same model. Most previous research either learn the hyperplanes assuming a fixed set of thresholds, or vice-versa. In our experiments over two standard image datasets we find statistically significant increases in retrieval effectiveness versus a host of state-of-the-art data-dependent and independent hashing models.
This introduction to the popular ggplot2 R graphics package will show you how to create a wide variety of graphical displays in R. Data sets and additional workshop materials available at http://projects.iq.harvard.edu/rtc/event/r-graphics
Using R to Visualize Spatial Data: R as GIS - Guy LansleyGuy Lansley
This talk demonstrates some of the benefits of using R to visualize spatial data efficiently and clearly.
It was originally presented by Guy Lansley (UCL and the Consumer Data Research Centre) to the GIS for Social Data and Crisis Mapping Workshop at the University of Kent.
Learn how to get started making Leaflet maps through R statistical software. Sounds crazy? Maybe. But the R package leafletR allows people familiar with R, but maybe not so much with HTML and Javascript coding, to make a basic Leaflet map (interactive, slipping web map) quickly with minimal knowledge of other programming languages.
Example code posted here: https://github.com/MicheleTobias/RCode
Is it harder to find a taxi when it is raining? Wilfried Hoge
Using open data to answer the question if it is harder to find a taxi, when it is raining. Live demo of analyzing taxi data with DashDB, R, and Bluemix.
Presented on data2day conference.
Modeling Count-based Raster Data with ArcGIS and RAzavea
This presentation outlines the conceptual framework for building regression models of event counts where the unit of analysis is small. It explains how ArcGIS for Desktop can be used to build raster data sets that are modeled as generalized linear models within the open source R package.
FOSS4G North America 2016
Sometimes your map needs a little extra polish. In this talk, I will outline my workflow for bringing maps from QGIS into Inkscape and exporting to commonly used formats to produces a finished professional-quality map. It will include "do's" and "don'ts" to help you develop your own workflow and avoid common pitfalls, as well as some features unique to Inkscape such as filters.
Linking Socio-economic and Demographic Characteristics to Twitter Topics - Gu...Guy Lansley
Social media data is now widely considered a viable source for market and social research. Everyday Twitter’s users generate large quantities of data through Tweet messages which express the users’ thoughts and opinions, and may also describe their activity, plans and location. In its raw form, textual data at this volume is hard to process and understand, however, it is possible to model the Tweets into a small number of topics using generative probabilistic algorithms. This paper aims to research how the content of Tweets may vary by socio-economics and demographic characteristics using Tweets from Inner London sourced from the Twitter application programming interface.
Earlier research has successfully allocated over 1 million geo-located Tweets from Inner London in 2013 into a hierarchical classification of 20 groups and 100 subgroups created using a latent dirichlet allocation algorithm. The 20 groups consist of distinctive topics and uses of language, and they all demonstrate unique spatial and temporal patterns across Inner London. The next stage of the analysis explores how the Twitter classification varies across the residential geography of Inner London. Assuming that most Tweets sourced from residential buildings are likely to be sourced by residents, the classification can be compared to socio-economic and other demographic characteristics from open data sources. In addition, some characteristics such as gender and ethnicity can also be inferred from the names of Twitter users.
As part of the GSP’s capacity development and improvement programme, FAO/GSP have organised a one week training in Izmir, Turkey. The main goal of the training was to increase the capacity of Turkey on digital soil mapping, new approaches on data collection, data processing and modelling of soil organic carbon. This 5 day training is titled ‘’Training on Digital Soil Organic Carbon Mapping’’ was held in IARTC - International Agricultural Research and Education Center in Menemen, Izmir on 20-25 August, 2017.
2024.03.22 - Mike Heddes - Introduction to Hyperdimensional Computing.pdfAdvanced-Concepts-Team
Presentation in Science Coffee of the Advanced Concepts Team of the European Space Agency.
Date: 22.03.2024
Speaker: Mike Heddes (University of California, Irvine)
Topic: Introduction to Hyperdimensional Computing
Abstract:
Hyperdimensional computing (HD), also known as vector symbolic architectures (VSA), is a computing framework capable of forming compositional distributed representations. HD/VSA forms a "concept space" by exploiting the geometry and algebra of high-dimensional spaces. The central idea is to represent information with randomly generated vectors, called hypervectors. Together with a set of operations on these hypervectors, HD/VSA can represent compositional structures, which, in turn, enables features such as reasoning by analogy and cognitive computing. In this introductory talk, I will introduce the high-dimensional spaces and the fundamental operations on hypervectors. I will then cover applications of HD/VSA such as reasoning by analogy and graph classification.
statistical computation using R- an intro..Kamarudheen KV
This presentation deals with some basics of R language. It is very useful for benners in R. It describes the basics in a very easy manner, so those who are not familiar with R it would be very helpful.
The goal of this workshop is to introduce fundamental capabilities of R as a tool for performing data analysis. Here, we learn about the most comprehensive statistical analysis language R, to get a basic idea how to analyze real-word data, extract patterns from data and find causality.
These are my slides from a presentation to the Chicago R User Group on Oct 3, 2012. It covers how to use R and Gephi to visualize a map of influence in the history of philosophy.
More detail is available on the Design & Analytics Blog.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Geospatial Data in R
1. Geospatial Data in R
Geospatial Data
in R
And Beyond!
Barry Rowlingson
b.rowlingson@lancaster.ac.uk
School of Health and Medicine,
Lancaster University
3. Before R
The S Language (Chambers, Becker, Wilks)
Born 1976
Released 1984
Reborn 1988 (The New S Language)
S-Plus
Commercialised version, 1988
Image from amazon.com
13. Vector data - the sp classes
2004 : A Geospatial Odyssey
More than just polygons!
Classes for points, lines, grids of points and
polygons.
Geometry + Data for each feature
Bivand, Pebesma, Gomez-Rubio
“Simple Features” OGC spec
14. Create Points
coords = cbind(x, y)
# create SpatialPoints
sp = SpatialPoints(coords)
# create a SpatialPointsDataFrame
spdf = SpatialPointsDataFrame(coords, data)
spdf = SpatialPointsDataFrame(sp, data)
# promote an ordinary data frame
coordinates(data) = cbind(x, y)
coordinates(data) = ~lon + lat
# and demote back to data frame
data = as.data.frame(data)
15. Point Features
SpatialPointsDataFrame
ID coordinate Name Pop
1 (x,y) Alphaville 12000
2 (x,y) Betaton 45255
3 (x,y) Gamma CIty 5345
4 (x,y) Delta VIllage 7745
5 (x,y) Epsilondon 77514
16. Manipulation
Treat like a
data frame...
BigTowns = Towns[Towns$pop>10000,]
SmallTowns = Towns[Towns$pop<5000,]
BigTowns = subset(Towns,pop>10000) ...almost (this fails)
BigSmall = rbind(BigTowns,SmallTowns)
Retrieve coords and data
xy = coordinates(Towns)
TownData = Towns@data
TownData = as.data.frame(Towns)
17. Create Line Objects
A Line is a single chain of points
L1 = Line(cbind(x1,y1))
L2 = Line(cbind(x2,y2))
L3 = Line(cbind(x3,y3))
18. Create Lines Objects
A Lines is a list of chains with an ID
Ls1 = Lines(list(L1),ID=”a”)
Ls2 = Lines(list(L2,L3),id=”b”)
20. Create SpatialLinesDataFrame
A SpatialLinesDataFrame is a SpatialLines with a matching Data Frame
SLDF = SpatialLinesDataFrame(
SL12,
data.frame(
Z=c(“road”,”river”),
row.names=c(“a”,”b”)
)
)
21. Line Features
SpatialLinesDataFrame
ID coordinate Name Quality
1 (x,y;x,y;x,y;...) River Alpha Good
2 (x,y;x,y;x,y;...) Bravo Beck Good
3 (x,y;x,y;x,y;...) Charlie River Fair
4 (x,y;x,y;...) Delta Drains Poor
(x,y;x,y;...)(...)
5 (x,y;x,y;x,y;) Echo Stream Good
23. Single Ring Feature
Make sure your coordinates connect:
c1 = cbind(x1,y1)
r1 = rbind(c1,c1[1,])
A Polygon is a single ring
P1 = Polygon(r1)
A Polygons is a list of Polygon objects with an ID
Ps1 = Polygons(list(P1,ID=”a”))
24. Double Ring Feature
Make sure your coordinates connect:
c2a = cbind(x2a,y2a)
r2a = rbind(c2a,c2a[1,])
c2b = cbind(x2b,y2b)
r2b = rbind(c2b,c2b[1,])
Make two single rings:
P2a = Polygon(r2a)
P2b = Polygon(r2b)
Make a Polygons object with two rings
Ps2 = Polygons(list(P2a,P2b),ID=”b”))
25. Feature with hole
hc = cbind(xh,yh)
rh = rbind(hc,hc[1,])
Make a holey Polygon:
H1 = Polygon(rh, hole=TRUE)
Make a Polygons object with two rings, one the hole
Ps3 = Polygons(list(P3,H1),ID=”c”))
27. And back again
For ring j of feature i:
> SPDF@polygons[[i]]@Polygons[[j]]@coords
x y
[1,] 42.53623 76.85066
[2,] 42.57308 76.79820
[3,] 43.05132 74.56176
...
28. Polygon Features
SpatialPolygonsDataFrame
ID coordinates Name Pop.
1 (x,y;x,y;x,y;...) Alphashire 12365
2 (x,y;x,y;x,y;...) Bravoshire 45366
3 (x,y;x,y;x,y;...) County Charlie 78725
4 (x,y;x,y;...) Delta District 77439
(x,y;x,y;...)(...)
5 (x,y;x,y;x,y;) Echoville 34545
29. Coordinate Systems
Because the Earth
isn't flat
But small parts of it
are near enough
So lots of coordinate
systems exist
Anything Spatial*
can have one
30. CRS and proj4string
without:
sp = SpatialPoints(coords)
at construction time:
sp = SpatialPoints(
coords,
proj4string = CRS(”+init=epsg:4326”)
)
After the event:
proj4string(sp) = CRS(”+init=epsg:4326”)
31. And for Spatial*DataFrames
spdf = SpatialPointsDataFrame(
sp,
data,
proj4string=CRS(”+init=epsg:4326”)
)
proj4string(spdf)=CRS(”+init=epsg:4326”)
32. What are these proj4strings?
International standard codes for coordinate
reference systems
+init=epsg:4326 lat-long, GPS
+init=epsg:27700 UK Grid
+init=epsg:900913 “google”
+init=epsg:3857 Spherical Mercator
+proj=utm +zone=19 +north
Search spatialreference.org for UTM zones
33. Transform Spatial* Objects
Assigning a CRS doesn't change the numbers
So assigning the wrong CRS really messes things
up
Convert from one to another with spTransform
If sp is SpatialPoints from my GPS:
proj4string(sp)=CRS(”+init=epsg:4326”)
And to put on a UK National Grid map:
spUK = spTransform(sp,CRS(”+init=epsg:27700”))
34. Raster Data – regular grids
Satellite Imagery
Photography
Radar Height
Other Sensors
Count Data
Animals in quadrats
Modelled Values
Climate Data
Interpolations
35. Rasters in R - history
The image function
Works on a matrix
X and Y vectors
define position