[R-sig-Geo] geoJSON and leaflet
Benjamin Pauget
benj@m|n@p@uget @end|ng |rom te@or@@|r
Tue Jul 9 13:48:38 CEST 2019
Hi,
I’m writting because I have some trouble with a geoJSON file and a leaflet.
I’m trying to display polygon on a leaflet map, but nothing append ☹
I have no error message.
Do you have some advice/ideas?
Best regards
Here is my code :
library(leaflet)
library(jsonlite)
url <- "http://www.georisques.gouv.fr/api/v1/sis?rayon=1000&latlon=4.854899%2C%2045.763079&page=1&page_size=10"
geojson <- jsonlite::fromJSON(url)
leaflet() %>%
addTiles()%>%
setView(lng = 4.854899, lat = 45.763079, zoom = 14) %>%
addMarkers(lng = 4.872536, lat = 45.758321)%>%
addGeoJSON(geojson) # doesn’t work by using geojson$data or geojson$data$geom
Benjamin PAUGET
Responsable R&D
[cid:image005.png using 01D4F3BB.3531D840]
+33 (0)1 81 94 13 70
+33 (0)6 47 01 85 92
Le Visium
22 Av Aristide Briand
94110 ARCUEIL
https://tesora.fr/
Linkedin<https://www.linkedin.com/company/tesora-france>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20190709/a4a0b819/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5152 bytes
Desc: image001.png
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20190709/a4a0b819/attachment.png>
More information about the R-sig-Geo
mailing list