Code Monkey home page Code Monkey logo

scripting4geo's People

Contributors

greatemerald avatar janverbesselt avatar johanez avatar loicdtx avatar mvansluijs avatar steefdam avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scripting4geo's Issues

Extracting data from Belgium height raster fails

In https://github.com/GeoScripting-WUR/Scripting4Geo/blob/gh-pages/index.Rmd#demo-integrated-analysis-chain-from-download-to-analysis this line:

out <- extract(bel, Sint, df = TRUE, sp = TRUE)

fails with this error:

Error in SpatialPointsDataFrame(y, v[, -1, drop = FALSE]) : 
  row.names of data and dimnames of coords do not match
In addition: Warning message:
In SpatialPointsDataFrame(y, v[, -1, drop = FALSE]) :
  forming a SpatialPointsDataFrame based on maching IDs, not on record order. Use match.ID = FALSE to match on record order
Error in SpatialPointsDataFrame(y, v[, -1, drop = FALSE]) : 
  row.names of data and dimnames of coords do not match

I tested it on the VM (R 3.2.3) as well as my own machine (R 3.3.0) and the error is the same.

This is a rather strange issue, considering that sp=FALSE works.

Better handling of download.file?

On the VM, download.file() doesn't run properly without method="curl" or method="wget" (the help file suggests the former). Of course, it's also platform-dependent; I'm not sure if curl is available on Windows. Maybe checking for the platform each time would be a solution... Or perhaps making use of another package for downloading files.

Add note on the fact that this is a demo lesson

Some students were confounded when seeing the code in this lesson, as it's not explained and quite complicated. It should be clearly stated that it involves raster and vector manipulation that is explained in upcoming lessons, and that they are not yet supposed to know exactly how and why this code works.

download.file() failing on Windows

Andrei said that the problem why download.file() would always fail on Windows is because it assumes text and not binary. So the solution is to always explicitly set mode to be wb. We should do that for all downloads, then.

Add Leaflet output to the page itself

Looks like regular rmarkdown, when generating the HTML file, includes the entirety of htmlwidgets and Leaflet JavaScript libraries, and the output file is about 1 MiB in size. knitrBootstrap on the other hand does not, the output is ~25 KiB. The framework for the map is generated, but there are no libraries to actually act upon the HTML objects placed at the spot we want to have the map.

Just including Leaflet is also not enough, and htmlwidgets don't seem to have a hosted version, so just editing the output file doesn't seem to be an option.

The shiny example is included using an iframe, perhaps as a workaround the leaflet map can also be included as an iframe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.