Skip to content

Instantly share code, notes, and snippets.

View FrieseWoudloper's full-sized avatar

Willy Tadema FrieseWoudloper

View GitHub Profile
esri2sf <- function(url, outFields=c("*"), where="1=1", token='') {
library(httr)
library(jsonlite)
library(sf)
library(dplyr)
layerInfo <- jsonlite::fromJSON(
httr::content(
httr::POST(
url,
query=list(f="json", token=token),
@FrieseWoudloper
FrieseWoudloper / StackOverflow.RMD
Last active September 17, 2018 20:00
Example to illustrate difference in request paging between WFS and ESRI hosted feature service in sf package in R
---
title: "`sf` only supports request paging for ESRI's hosted feature service, not for WFS"
author: "Willy Tadema"
date: "16 september 2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
@FrieseWoudloper
FrieseWoudloper / basic_example.R
Last active September 26, 2018 16:04
Voorbeeld van het gebruik van de BRT Achtergrondkaart in Leaflet in combinatie met Shiny
library(shiny)
library(leaflet)
ui <- fluidPage(
leafletOutput("mymap", width = "600px")
)
server <- function(input, output, session) {
output$mymap <- renderLeaflet({
https://opendata.cbs.nl/ODataApi/odata/84314NED/$metadata
https://opendata.cbs.nl/ODataApi/odata/84314NED/UntypedDataSet?$top=5
https://opendata.cbs.nl/ODataApi/odata/84314NED/UntypedDataSet/$count
https://opendata.cbs.nl/ODataFeed/odata/84314NED/UntypedDataSet?$skip=10000
https://opendata.cbs.nl/ODataFeed/odata/84314NED/UntypedDataSet?$format=json&skip=10000
@FrieseWoudloper
FrieseWoudloper / index.html
Created December 19, 2018 12:11
ESRI JSON in Leaflet
//set the options
var center = new L.LatLng(42.3584308,-71.0597732);
var zoom = 8;
var url= "http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png";
var options={
subdomains:["otile1","otile2",/*"otile3",*/"otile4"],//we'd usually use all 4 but something is up with #3 at the moment
attribution:"Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
};
//create the tiles
var tiles = new L.TileLayer(url,options);
#! <?xml version="1.0" encoding="UTF-8" ?>
#! <WORKSPACE
# Command-line to run this workspace:
# "C:\Program Files\FME\fme.exe" C:\Users\willy\OneDrive\Bureaublad\well_formed_ReportDataXML.fmw
#
#! ATTR_TYPE_ENCODING="SDF"
#! BEGIN_PYTHON=""
#! BEGIN_TCL=""
#! CATEGORY=""
#! DESCRIPTION=""
#! <?xml version="1.0" encoding="UTF-8" ?>
#! <WORKSPACE
# Command-line to run this workspace:
# "C:\Program Files\FME\fme.exe" C:\Users\willy\OneDrive\Bureaublad\opendata_arcgis_api.fmw
#
#! ATTR_TYPE_ENCODING="SDF"
#! BEGIN_PYTHON=""
#! BEGIN_TCL=""
#! CATEGORY=""
#! DESCRIPTION=""
#! <?xml version="1.0" encoding="UTF-8" ?>
#! <WORKSPACE
#
#
# Command-line to run this workspace:
#
#
# E:\FME2017\fme.exe C:\Users\Willy\Desktop\prototype.fmw
# --SourceDataset_XML "C:\Users\Willy\Desktop\test.xml"
#
#! <?xml version="1.0" encoding="UTF-8" ?>
#! <WORKSPACE
#
#
# Command-line to run this workspace:
#
#
# E:\FME2017\fme.exe C:\Users\Willy\Desktop\prototype.fmw
# --SourceDataset_XML "C:\Users\Willy\Desktop\test.xml"
#
#! <?xml version="1.0" encoding="UTF-8" ?>
#! <WORKSPACE
#
#
# Command-line to run this workspace:
#
#
# E:\FME2017\fme.exe C:\Users\Willy\Desktop\prototype.fmw
# --SourceDataset_XML "C:\Users\Willy\Desktop\test.xml"
#