-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'file_to_geojson' - error when reading from 'special' url #83
Comments
thanks for the issue @patperu - will have a look |
what version of library('geojsonio')
url <- 'http://odn.comune.prato.it/geonetwork/srv/en/resources.get?uuid=f7077224-bf61-4b1e-904b-f3668ef80859&fname=WIFI_COPERTURA.zip&access=private'
out <- file_to_geojson(input=url, method='web', output='wifi-free-web')
substring(readLines("wifi-free-web.geojson"), 1, 75)
#> [1] "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"ID" |
I've not seen the error |
Hmm, ok.
Ciao |
yeah, that makes sense that it's a problem with reading from the url Have you tried using |
Hello @sckott , |
thanks for update |
@patperu did you get this sorted out? |
Hello @sckott url <- 'http://odn.comune.prato.it/geonetwork/srv/en/resources.get?uuid=f7077224-bf61-4b1e-904b-f3668ef80859&fname=WIFI_COPERTURA.zip&access=private'
download.file(url, destfile = "WIFI_COPERTURA.zip") doesn't create a valid zip-file. But this works: library('httr')
library('geojsonio')
t_ok <- content(GET('http://www.covimo.de/wifi/WIFI_COPERTURA.zip'))
t_fail <- content(GET('http://odn.comune.prato.it/geonetwork/srv/en/resources.get?uuid=f7077224-bf61-4b1e-904b-f3668ef80859&fname=WIFI_COPERTURA.zip&access=private'))
identical(t_ok, t_fail)
#[1] TRUE
outfile <- file("WIFI_COPERTURA.zip", "wb")
writeBin(t_fail, outfile, raw())
close(outfile)
file_to_geojson("WIFI_COPERTURA.zip", method='web', output='WIFI_COPERTURA')
substring(readLines("WIFI_COPERTURA.geojson"), 1, 75)
# [1] "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"ID" |
thanks @patperu I'll have a look |
@patperu try reinstalling i tested on my windows VM, try it on your windows machine. I think it should work now. let me know |
great, glad it works |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Hello @sckott,
I want to convert a shpfile (as zip) to geojson, the input comes from an url.
But the generated geojson is not valid, it contains this:
If I use the same file from a different location, everything looks good (well, not really.. but this will be another issue 😉 )
Ciao
Patrick
The text was updated successfully, but these errors were encountered: