View inset.R
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
# Démarrer le package cartography | |
library(cartography) | |
# Charger les données stockées sur le web | |
load((url("http://wukan.ums-riate.fr/bond/bondfiles.RData"))) | |
fdim <- getFigDim(spdf = WorldCountries[WorldCountries$ISO3 %in% | |
c( "RUS","NZL", "ARG"),], | |
width = 750, res = 120, | |
mar = c(0,0,1.2,0)) |
View panamapapers.R
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
# load library | |
library(cartography) | |
# load data | |
load(url("http://wukan.ums-riate.fr/panamapapers/panamapapers.RData")) | |
# get the figures dimensions | |
fd <- getFigDim(spdf = grat, width = 800, | |
res = 120, mar = c(0,0,1.2,0)) |
View cartomix.R
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
library(cartography) | |
library(sp) | |
library(sf) | |
# Load data | |
data(nuts2006) | |
# Save image | |
sizes <- getFigDim(x = nuts0.spdf, width = 700, mar = c(0,0,0,0), res = 100) | |
png('./img/map8.png', width = sizes[1], height = sizes[2], res = 100) |
View trypar.R
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
library(SpatialPosition) | |
load("../LargeSpatialPostition/com.RData") | |
# création d'une grille fine (5km) | |
grid <- CreateGrid(w = com, resolution = 5000) | |
# Les calculs de matrices de distances sont (beaucoup) plus rapides quand les | |
# objets spatiaux sont en WGS84 : |
View msd.R
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
library(cartography) | |
data("nuts2006") | |
# GDP par habitants (en euros) | |
nuts2.df$gdpinh <- 1000000 * nuts2.df$gdppps2008 / nuts2.df$pop2008 | |
boxplot(nuts2.df$gdpinh) | |
hist(nuts2.df$gdpinh) | |
rug(nuts2.df$gdpinh) | |
# Bon d'accord la distribution n'est pas vraiment normale... |
View brexit.R
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
library(sp) | |
library(raster) | |
library(rgeos) | |
## import des données | |
download.file(url = "http://biogeo.ucdavis.edu/data/gadm2.8/rds/GBR_adm2.rds", | |
destfile = file.path(tempdir(), "GBR_adm2.rds")) | |
download.file(url = "http://biogeo.ucdavis.edu/data/gadm2.8/rds/IRL_adm0.rds", | |
file.path(tempdir(),"IRL_adm0.rds")) |
View addresses.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
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
"","location","name","housenumber","street","postcode","city","state","country","osm_key","osm_value","lon","lat","msg" | |
"1","Germany, Augsburg, Berliner Allee 30","Hauptfeuerwache - Berufsfeuerwehr Augsburg","30","Berliner Allee","86153","Augsburg","Bayern","Deutschland","amenity","fire_station",10.9151257435963,48.3738761,NA | |
"2","Germany, Bautzen, Gesundbrunnenring 23","Feuerwache Bautzen","23","Gesundbrunnenring","02625","Bautzen","Sachsen","Deutschland","amenity","fire_station",14.4383893321343,51.1871298,NA | |
"3","Germany, Bielefeld, Stadtholz 18","Feuerwache Ost","18","Am Stadtholz","33609","Bielefeld","Nordrhein-Westfalen","Deutschland","amenity","fire_station",8.5537485,52.0256609,NA | |
"4","Germany, Bochum, Brandwacht 1","Freiwillige Feuerwehr Bochum Brandwacht (LE31)","1","Brandwacht","44894","Bochum","Nordrhein-Westfalen","Deutschland","amenity","fire_station",7.2987397,51.4891521,NA | |
"5","Germany, Bonn, Lievelingsweg 112","Leitstelle Berufsfeuerwehr Bonn","112","Lievelingsweg","53119","Bonn","Nordrhein-W |
View geocode_adressedatagouvfr.R
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
library(httr) | |
adresse <- "8 bd du port" | |
resultraw <- httr::GET(utils::URLencode(paste0('https://api-adresse.data.gouv.fr/search/?q=', adresse))) | |
result <-jsonlite::fromJSON(httr::content(resultraw, "text")) | |
result$features |
View reprop.R
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
legpos <- function(pos, x1, x2, y1, y2, delta1, delta2, legend_xsize, legend_ysize){ | |
# Position | |
if (pos == "bottomleft") { | |
xref <- x1 + delta1 | |
yref <- y1 + delta1 | |
} | |
if (pos == "topleft") { | |
xref <- x1 + delta1 | |
yref <- y2 - 2 * delta1 - legend_ysize | |
} |
View xx.json
This file has been truncated, but you can view the full file.
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
{"map_config":{"projection":"NaturalEarth2","projection_scale":16535.324133151662,"projection_translate":[0,0],"projection_center":[0,0],"projection_rotation":[0,0,0],"zoom_translate":[1126.357282238188,14299.993544027097],"zoom_scale":1.0000000000000002,"div_width":919,"div_height":630,"n_layers":4,"background_color":"rgb(190, 202, 224)","custom_palettes":[],"global_order":["#L_departements_2016_2-2.layer","#L_communes_reg_53.layer","#L_SolairePhotovoltaique_OREGES_point.targeted_layer.layer","#L_Typo_NB_INSTALL_CLASS_2014_SolairePhotovoltaique_OREGES_point_1.layer.no_clip","#text_annotation_0.legend.txt_annot","#text_annotation_0.legend.txt_annot","#text_annotation_0.legend.txt_annot","#text_annotation_0.legend.txt_annot","#legend_root.legend.legend_feature.lgdf_L_Typo_NB_INSTALL_CLASS_2014_SolairePhotovoltaique_OREGES_point_1","#legend_root_symbol.legend.legend_feature.lgdf_L_Typo_NB_INSTALL_CLASS_2014_SolairePhotovoltaique_OREGES_point_1"],"layout_features":{"text_annot":[{"id":"text_annotation_0","conten |
OlderNewer