[R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread GodinA
Dear list, I am working with spatstat and am trying to define my owin: spatial region (observation window). I have a set of marked planar point patterns generated from random samplings in different strata. Unfortunately I don't have any GIS file with all the information for each of my strata. I

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread Agustin Lobo
Aurelie, If all you need is defining the region, perhaps the easiest is guessing the coordinates from the grid of your jpg file. Alternatively, you can georeference the jpg to make a companion world file that would let you use your map as an spatial object. You can use qgis for that. Agus

[R-sig-Geo] Counting points within polygons

2011-10-18 Thread Agustin Lobo
Hi! Given a Sp Points DF and an Sp Polygons DF, I want to add a field of number of points for each polygon to the Sp Pol. DF table. This is what I'm doing (using objects from the help page for sp::overlay() (meuse is the Sp Points DF and srdf the Sp Pol. DF) delme3 - overlay(meuse,srdf) delme3

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread Marcelino de la Cruz
Hi Aurelie, You should tell us more about your data to help you efficiently. What (database, etc) are you sampling? what are the different strata? how are the random samples selected? Cheers, Marcelino At 15:36 18/10/2011, GodinA wrote: Dear list, I am working with spatstat and am

Re: [R-sig-Geo] Counting points within polygons

2011-10-18 Thread Mathieu Rajerison
Hi, The latter method seems good to me. I haven't found any other alternative for this purpose. 2011/10/18 Agustin Lobo alobolis...@gmail.com Hi! Given a Sp Points DF and an Sp Polygons DF, I want to add a field of number of points for each polygon to the Sp Pol. DF table. This is what I'm

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread GodinA
Marcelino, My dataset is coming from annual bottom-trawl surveys in waters off Newfoundland and Labrador Region, Canada. I am looking at habitat selection (relationship to depth temperature), geographic distribution, and abundance of skate species in the region in 2009. The survey use a

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread GodinA
Thank you Agus, I'll look at qgis. - Aurelie Cosandey-Godin Ph.D. Student, Department of Biology, Dalhousie University Industrial Graduate Fellow, WWF-Canada Email: god...@dal.ca | Web: wormlab.biology.dal.ca -- View this message in context:

Re: [R-sig-Geo] Counting points within polygons

2011-10-18 Thread Agustin Lobo
Actually, neither alternative works if there are polygons with no points, as those are not kept in the output of overlay and just binding tp the table of srdf is not possible. The second alternative looks easier for a join, but a problems comes from the fact that the output data.frame of delme4 -

Re: [R-sig-Geo] Counting points within polygons

2011-10-18 Thread Edzer Pebesma
Agus, Have you looked into over, which is supposed to replace overlay? require(sp) vignette(over) On 10/18/2011 05:06 PM, Agustin Lobo wrote: Actually, neither alternative works if there are polygons with no points, as those are not kept in the output of overlay and just binding tp the table

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread Marcelino de la Cruz
Aurelie, with this information, I'm afraid that your data cannot be considered as marked point partterns because your points are not the result of a stochastic point process but instead are selected (although hazaphartdly) for sampling pourposes. Others may correct me but I would find

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread GodinA
Hummm... Thank you Marcelino, I agree with you, this dataset isn't a clear stochastic point process per se, however I'm wondering if I can still treat it as such, acknowledging the limitations. Would love hearing people comments. I will look at the dismo package. On a slightly different note,

Re: [R-sig-Geo] Counting points within polygons

2011-10-18 Thread Agustin Lobo
I'm afraid I do not understand well the help page. It seems to me that what I need is x = SpatialPointsDataFrame, y = SpatialPolygons equal to the previous method, except that an argument fn=xxx is allowed, e.g. fn = mean which will then report a data.frame with the mean values of the x points

Re: [R-sig-Geo] Counting points within polygons

2011-10-18 Thread Maria Zwart
Hi, There is an easy way to do this, but it is outside R. I use GME (geospatial modelling environment). It can also run R commands however. The function in that program you are looking for is: countpntsinpolys More information on: http://www.spatialecology.com/gme/gmecommands.htm Best, Mieke

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread Brad Nesom
sorry for the offlist reply... with the use of qgis, here is a similar problem (georeferencing image) found on the qgis user forum. there are several messages in this thread. hopefully you will find some direction here. http://lists.osgeo.org/pipermail/qgis-user/2011-October/013911.html On Tue,

Re: [R-sig-Geo] Extracting GIS file - best approach?

2011-10-18 Thread Aurelie C.Godin
Thank you Brad! Will definitely look into this Qgis mailing list! Cheers, ~Aurelie - Aurelie Cosandey-Godin Ph.D. Student, Department of Biology, Dalhousie University Industrial Graduate Fellow, WWF-Canada Email: god...@dal.ca | Web: wormlab.biology.dal.ca -- View this message in context:

[R-sig-Geo] Missing data for GWR analysis in spgwr

2011-10-18 Thread Jin Minming
Dear all, I try to use GWR analysis in spgwr package.  Some data for depedent variable is missing in this polygon dataset. I have tried to use SAR or CAR method and they works well. But when I use GWR in spgwr package, I got an error message, new data matrix rows mismatch This is because GWR in

[R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Zia Ahmed
I am trying to calculating 95th percentile within polygons from a of set realizations - something like zonal statistics. How do I calculate 95 th percentile for each polygon over all realizations. Thanks Zia For example: data(meuse) data(meuse.grid) coordinates(meuse) - ~x+y

Re: [R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Edzer Pebesma
Zia, You may want to rethink the question. Each realization has a 95 percentile within a particular polygon. Over the set of realizations of some aggregated value for a polygon, you can take a 95 percentile. These are two different things. The first is a spatial aggregation, the second an

Re: [R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Zia Ahmed
Your are correct. Now, what I am going to do: first calculate 95th percentile of all realizations at prediction grid and then calculate the mean for each polygon. Is it possible to calculated weighted mean of the this 95th percentile? weight may be area of polygon or any value, for

Re: [R-sig-Geo] [rgeos] A gIntersection operation causes RStudio to crash

2011-10-18 Thread Colin Rundel
Hi Mathieu, I'm not sure why RStudio is crashing on you with that input, on my apple laptop with R 2.13.2 I get the following error when I run your sample code: Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, rgeos_intersection) : TopologyException: no outgoing dirEdge found at 898287

Re: [R-sig-Geo] Calculating 95th percentile within polygons

2011-10-18 Thread Edzer Pebesma
On 10/18/2011 11:45 PM, Zia Ahmed wrote: Your are correct. Now, what I am going to do: first calculate 95th percentile of all realizations at prediction grid and then calculate the mean for each polygon. this implies you end up with one single value per polygon. Call it A. Is it possible