[R-sig-Geo] bug in raster::stackApply when raster not in memory

2016-11-11 Thread Bastien.Ferland-Raymond
Dear list, I think I've found a bug with the stackApply() function of the raster package. The bug was already pointed out at : http://r-sig-geo.2731867.n2.nabble.com/raster-stackApply-problems-td7589291.html It says that it was fixed, however I think it wasn't 100% fixed. I've experienced th

[R-sig-Geo] Problem with using multicore resample in Raster package

2015-02-27 Thread Bastien.Ferland-Raymond
Dear all, I wrote a code last year that was running well. I've retried the same code this month and it's not working anymore. The problem arise from using cluster to do resampling in the raster package on multiple threads. I've tried on two computers, both have the problem. Here is a reprod

[R-sig-Geo] using the raster package to calculate knn results from yaImpute

2013-10-29 Thread Bastien.Ferland-Raymond
Dear List, I've been working on a way to make knn forest maps from satellite imagery and I'm using both the raster package (to prepare my data) and the yaImpute package (to do the knn). The problem is that the yaImpute package requires data frames as inputs and I have rasters. So I have to do:

[R-sig-Geo] as.data.frame excluding NA in raster package

2013-10-10 Thread Bastien.Ferland-Raymond
Dear R Geoer, This is more a request than a question as I already succeeded at doing what I wanted to do. However, I'm open to suggestion to do it better, but I really think is would be a nice feature to add the the as.data.frame() function in the raster package. I've been using the as.data.fr

Re: [R-sig-Geo] remove points less than certain distance

2013-04-29 Thread Bastien.Ferland-Raymond
Hello, I looked at your problem and I can't understand it. What are your trying to do? It's not clear. Are you trying to find the points that are at less than 200m from ALL other points? Or at 200m of AT LEAST one other point? You have a distance matrix here, which is n*n, you can difficul

Re: [R-sig-Geo] closest points between 2 polygons

2013-04-18 Thread Bastien.Ferland-Raymond
Hello, I don't have a clear solution for your problem, but I'll try to give you ideas to where to look that may help you. If I understand well your problem, the difficulty comes from the fact that you have two POLYGONS and that you are looking for the COORDINATES. You could transform your pol

[R-sig-Geo] Problem with update gdistance 1.1-3

2012-11-29 Thread Bastien.Ferland-Raymond
Hello, I want to expose a problem I am now facing with the gdistance package and the geoCorrection() function. I have a code I haven't been using since March, and now, after updating R to 2.15.2 and the package gdistance to 1.1-3 from 1.1-2, the geoCorrection() function doesn't work. It simpl

[R-sig-Geo] RE : RE : determining suitable lakes for landing

2012-07-31 Thread Bastien.Ferland-Raymond
So, I've applied Barry's approach to one of my test territory. Barry nicely qualified is approach as brute-force, so I've made my computer sweat a little. I've tried 2 iterations per polygon. It was surprisingly not that hard. First, ~90% of my lakes were remove through simple Pythagorean

[R-sig-Geo] RE : determining suitable lakes for landing

2012-07-30 Thread Bastien.Ferland-Raymond
Thanks Barry for your interest in my problem. It is indeed an interesting problem at the same time as a complex one. I've tried your code and it works for two lakes so far. It's seems like a very good base for what I want to do. I'll modify it a little to speed it up. First by removing the

[R-sig-Geo] determining suitable lakes for landing

2012-07-30 Thread Bastien.Ferland-Raymond
Dear R gurus, I'm facing a challenge that I have a good feeling you could help me with. So far I'm stuck right at the beginning so I don't have any example to show you. Here is what I'm trying to do: I have a polygon shape of lakes for which I have to be able to automatically determine if th

[R-sig-Geo] RE : cost distance buffer?

2012-05-28 Thread Bastien.Ferland-Raymond
Thank you both for your answer. gridDistance seems to do the trick for me. I haven't seen anything in gdistance that could help me but I could be wrong. As for GRASS, I'll have to get into it one day. This thing looks powerful, but it's pretty much just a name for me so far... Bastien

[R-sig-Geo] cost distance buffer?

2012-05-28 Thread Bastien.Ferland-Raymond
Hello R people I want to create a buffer around shapelines that would go around obstacle like shown in that figure: https://www.dropbox.com/s/8qhkj6atkfllzky/unreachable_buffer.jpg Here is the idea: I have field teams that cannot walk more than 1.5 km away from a road. I need to know what par

[R-sig-Geo] RE : Problem with writeOGR and overwrite_layer=T

2012-05-14 Thread Bastien.Ferland-Raymond
Thanks Roger for your response, I'm happy that the problem is now known, however I'm afraid I won't be able to help much with it, I'm no programmer just a user. Hopefully somebody out there will be able to put your explanations to good use and provide a long term solution. Thanks again, Bast

[R-sig-Geo] Problem with writeOGR and overwrite_layer=T

2012-05-14 Thread Bastien.Ferland-Raymond
Dear list, I have to produce shapefile for a coworker which uses ArcGIS and I've hit a problem with the writeOGR function from the rgdal package. Here is an example: ### > library(rgdal) Loading required package: sp Geospatial Data Abstraction Library extensions to R successfully loaded Loaded

[R-sig-Geo] RE : trouble importing a .img file from ArcMap 10

2012-05-01 Thread Bastien.Ferland-Raymond
Hello Megan, Personally, I import my .img files with the package Raster. Try: Elev <- stack("file_name.img") Than you can see the result with: Str(Elev) And something like: Plot(Elev) See: http://cran.r-project.org/web/packages/raster/raster.pdf For more details Bastien Ferland-Raymond,

[R-sig-Geo] RE : dist2Line with mtm projection

2012-04-18 Thread Bastien.Ferland-Raymond
Hello German, The technique you propose is unorthodox, but it works perfectly! Very fast and easy, it's exactly what I needed. Thanks! Bastien -Message d'origine- De : geotux_tux...@linuxmail.org [mailto:geotux_tux...@linuxmail.org] Envoyé : 18 avril 2012 13:24 À : Ferland-Raymond, B

[R-sig-Geo] dist2Line with mtm projection

2012-04-18 Thread Bastien.Ferland-Raymond
Dear R people, I have a code that was using the function dist2Line() from the geosphere package. The function worked find and did exactly what I was looking for which is to find the distance between a point (from a SpatialPointDataFrame object) and a line (from a SpatialLinesDataFrame object)

Re: [R-sig-Geo] Conversion of a SpatialPolygonsDataFrame into a ESRI file

2012-03-21 Thread Bastien.Ferland-Raymond
I Cristina, I personally had success with the writeOGR of the rgdal package to export shape to ESRI. I initially had the same error as you, which is not being able to get the dbf to display the data properly. As Joona said, the problem was related to the field names. In my case, if I recall

Re: [R-sig-Geo] problems in shortestPath()?

2012-03-08 Thread Bastien.Ferland-Raymond
Hello Melanie, It's really hard to tell what your problem is with no error message or reproducible example. However here some info that may help and some trick to help you figure out the problem First, gdistance build a transition matrix from a CONDUCTANCE matrix which is not a COST matrix li

Re: [R-sig-Geo] speed problem with %over% function

2012-02-29 Thread Bastien.Ferland-Raymond
Thanks to Francis and Edzer for their responses. I been working on my problem for the last 2 days and I managed to get some very interesting information. I also prepared a reproducible example so people can try it. I've found 3 functions that do the thing I want: 1) %over% 2) overlay() (which

[R-sig-Geo] speed problem with %over% function

2012-02-27 Thread Bastien.Ferland-Raymond
Dear geo-list, I'm just starting using R and the rgdal package to manage and create some shapes and I am hitting some speed issues while using the %over% function. R is significantly slower than ArcGIS. Here is what I'm doing (I've shorten the code to make it easier to follow, I don't expect i

[R-sig-Geo] RE : problem exporting map including both google map image and shape polygon

2011-10-27 Thread Bastien.Ferland-Raymond
Hello all, Thank for the quick answer, I feel a little bad, the answer was pretty simple, I had to change : png(filename = "map.png",width=500, height=640 ) with png(filename = "map.png",width=500, height=640, bg ="transparent") It's pretty easy and was written in the help file... Even if I

[R-sig-Geo] problem exporting map including both google map image and shape polygon

2011-10-27 Thread Bastien.Ferland-Raymond
Dear R list, I have a problem I've been working on for a while now and I'll try to explain it clearly. It's highly visual and it would be easier to just import images, however I'm not sure I can do that on the list so I'll try to explain it well. Here is what I'm trying to do: 1) import a sat