Upload
francois-guillem
View
310
Download
1
Embed Size (px)
DESCRIPTION
Comment et où récupérer des données spatiales dans R, les décrire et les analyser ? Slides présentés lors du 7ème meetup R Addicts Paris par Alejandro Lara-Ramirez, Consultant chez BIwhere et Kevin Parra, étudiant en Master d’Économétrie-Statistiques à la Toulouse School of Economics et Junior Consultant chez BIwhere.
Citation preview
Les outils
cartographiques et en
Statistique spatiale sur R
Alejandro LARA-RAMIREZ
Kevin PARRA
Martin GUBRI
18 juin 2014
2
2
GroupeDavantia
DATA :
LES
SOURCES
4
4
GADM : Global Administrative Areas
Téléchargement par code:load(url("http://biogeo.ucdavis.edu/data/gadm2/R/FRA_adm5.RData"))
5
5
OSM : Open Street Map
Téléchargement par code (pour Ile-de-France):download.file("http://download.geofabrik.de/europe/france/ile-de-france-
latest.shp.zip", "parisosm.zip")
REPRÉSENTATIONS
CARTOGRAPHIQUES :
DES
EXEMPLES
7
7
Représentation Statique : PLOT
Fond cartographique OSM
8
8
Représentation Statique : PLOT
Fond cartographique OSM
9
9
Représentation Statique : PLOT
Fond cartographique OSM
10
10
Représentation Statique : PLOT
Fond cartographique OSM
11
11
Représentation Statique : PLOT
Fond cartographique OSM
12
12
Représentation Statique : PLOT
Fond cartographique OSM
13
13
Représentation Statique : PLOT
SpatialPointsDataFrame
SpatialLinesDataFrame
SpatialPolygonsDataFrame
Les objets spatiaux
14
14
Représentation Statique : PLOT
SpatialPointsDataFrame
cible<-geocode("25 Rue du Petit Musc 75004 Paris",output="latlon")
scible<-SpatialPointsDataFrame(coords=cible, data=cible, proj4string =
CRS("+proj=longlat +ellps=WGS84"))
SpatialPointsDataFramepaquet sp
PLACES
• @data (data.frame)
o $osm_id
o $name
o $type : locality, city, village,
hamlet, town, municipality,
suburb, island, etc
o $population
• @coords.nrs
• @coords
• @bbox (bounding box)
• @proj4string (projection)
15
15
Représentation Statique : PLOT
SpatialLinesDataFrameSpatialLinesDataFrame
paquet sp
ROADS
• @data (data.frame)
o $osm_id
o $name
o $ref
o $type : motorway, primary,
secondary, tertiary,
residential, pedestrian,
cycleway, service, path, etc.
o $oneway
o $bridge
o $tunnel
o $maxspeed
• @lines (classe Lines : liste
d'objets Line définis comme un
ensemble de points reliés non
fermés)
• @bbox (bounding box)
• @proj4string (projection)
16
16
Représentation Statique : PLOT
SpatialPolygonsDataFrameSpatialPolygonsDataFrame
paquet sp
NATURAL
• @data (data.frame)
o $osm_id
o $name
o $type : riverbank, park,
water, forest
• @polygons (classe Polygons :
liste d'objets Polygon définis
comme un ensemble de points
reliés et fermés (premier =
dernier))
• @bbox (bounding box)
• @proj4string (projection)
17
17
Représentation Statique : PLOT
Génération de SpatialPointsDataFrame La fonction pave [pgirmess]
18
18
Représentation Statique : PLOT
Génération de SpatialPointsDataFrame La fonction pave [pgirmess]
19
19
Représentation Statique : PLOT
Lien parmi SpatialPolygonsDataFrame, SpatialLinesDataFrame etSpatialPointsDataFrame
Lien parmi les objets spatiaux La fonction over [sp]
20
20
Représentation Statique : GGMAP
Fond cartographique googlemaps.
21
21
Représentation Statique : GGMAP
Fond cartographique googlemaps hybrid.
22
22
Représentation Statique : GGMAP
Fond cartographique statmen toner.
23
23
Représentation Dynamique : PLOTKML
24
24
Représentation Dynamique : RMAPS
Packages leafletR, rMaps et rCharts.
25
25
Représentation Dynamique : RMAPS
Packages leafletR, rMaps et rCharts.
26
26
Représentation Dynamique : RMAPS
Packages leafletR, rMaps et rCharts.
STATISTIQUES :
MÉTHODES
SPATIALES
28
28
STRUCTURE DE VOISINAGE
Structure de voisinage du type queen. Fonction: poly2nb (spdep).
29
29
STRUCTURE DE VOISINAGE
Structure de voisinage du type plus proche voisin 1. Fonction: knn2nb (spdep).
30
30
STRUCTURE DE VOISINAGE
Structure de voisinage du type plus proche voisin 1. Fonction: knn2nb (spdep).
31
31
ENVIRONNEMENT SOURCE
Variable cible : somme des points d’intérêt OSM par maille géographique
32
32
APPLICATION SKATER METHOD
L’algorithme de minimum spanning tree.
33
33
Contrainte critère nb groupes : 6 mailles.
APPLICATION SKATER METHOD
34
34
Contrainte critère nb groupes : 16 mailles.
APPLICATION SKATER METHOD
35
35
Contrainte critère variable quantitative : au moins 19 points d’intérêt.
APPLICATION SKATER METHOD
36
36
Contrainte critère variable quantitative : au moins 300 points d’intérêt.
APPLICATION SKATER METHOD
37
37
Contrainte critère variable quantitative : au moins 400 points d’intérêt.
APPLICATION SKATER METHOD
38
38
APPLICATION DES MODELES SPATIAUX
Modèle linéaire gaussien versus Linéaire Autorégressive Gaussien.
Structure de voisinage
du type queen.