Skip to content

Instantly share code, notes, and snippets.

@mtreg
Created February 13, 2018 00:25
Show Gist options
  • Save mtreg/44fc7a437b4aeffd74c44937f3651acd to your computer and use it in GitHub Desktop.
Save mtreg/44fc7a437b4aeffd74c44937f3651acd to your computer and use it in GitHub Desktop.
Troubleshooting rmapzen with NYC Geosearch
#############
#Windows
#############
devtools::install_github("tarakc02/rmapzen", ref = "devel")
library(rmapzen)
options(RMAPZEN_SEARCH_HOST = "http://geosearch.planninglabs.nyc")
Sys.setenv("MAPZEN_KEY" = NA)
mz_search("1220 Fifth Ave, New York, NY")
# Error in curl::curl_fetch_memory(url, handle = handle) :
# Timeout was reached: Resolving timed out after 10000 milliseconds
#> sessionInfo()
# R version 3.4.3 (2017-11-30)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
#
# Matrix products: default
#
# locale:
# [1] LC_COLLATE=English_United States.1252
# [2] LC_CTYPE=English_United States.1252
# [3] LC_MONETARY=English_United States.1252
# [4] LC_NUMERIC=C
# [5] LC_TIME=English_United States.1252
#
# attached base packages:
# [1] stats graphics grDevices utils
# [5] datasets methods base
#
# other attached packages:
# [1] rmapzen_0.3.3.9001
#
# loaded via a namespace (and not attached):
# [1] Rcpp_0.12.15 class_7.3-14
# [3] sf_0.6-0 assertthat_0.2.0
# [5] grid_3.4.3 R6_2.2.2
# [7] DBI_0.7 magrittr_1.5
# [9] e1071_1.6-8 units_0.5-1
# [11] pillar_1.1.0 httr_1.3.1
# [13] rlang_0.1.6 curl_3.1
# [15] tools_3.4.3 udunits2_0.13
# [17] compiler_3.4.3 classInt_0.1-24
#############
##Ubuntu VM
#############
devtools::install_github("tarakc02/rmapzen", ref = "devel")
library(rmapzen)
options(RMAPZEN_SEARCH_HOST = "http://geosearch.planninglabs.nyc")
Sys.setenv("MAPZEN_KEY" = NA)
mz_search("1220 Fifth Ave, New York, NY")
# Error in curl::curl_fetch_memory(url, handle = handle) :
# Timeout was reached: Connection timed out after 10000 milliseconds
# > sessionInfo()
# R version 3.4.0 (2017-04-21)
# Platform: x86_64-pc-linux-gnu (64-bit)
# Running under: Ubuntu 16.04.2 LTS
#
# Matrix products: default
# BLAS: /usr/lib/libblas/libblas.so.3.6.0
# LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
#
# locale:
# [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
# [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
# [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods base
#
# other attached packages:
# [1] rmapzen_0.3.3.9001
#
# loaded via a namespace (and not attached):
# [1] httr_1.3.1 compiler_3.4.0 R6_2.2.2 magrittr_1.5 class_7.3-14 assertthat_0.2.0 DBI_0.7
# [8] tools_3.4.0 units_0.5-1 curl_3.1 Rcpp_0.12.15 udunits2_0.13 grid_3.4.0 e1071_1.6-8
# [15] classInt_0.1-24 sf_0.6-1
@tarakc02
Copy link

Don't include the "http" in the hostname, so use this:

options(RMAPZEN_SEARCH_HOST = "geosearch.planninglabs.nyc")

instead of this:

options(RMAPZEN_SEARCH_HOST = "http://geosearch.planninglabs.nyc")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment