Re: [R-sig-Geo] help
Shouldn't this line be xlist <- nb2listw(neighbours,glist = NULL,style = "W",zero.policy =TRUE) instead of xlist <- nb2listw(neighbours,glist = NULL,style = "W",zero.policy =TRU) ? On Wed, Apr 4, 2018 at 9:44 PM, Yalemzewod Gelawwrote: > I am a new student to R learning for spatial analysis. I was hoping > someone could help me with the > error message I keep getting when I try to convert the neighbour data to a > listw object use the nb2listw() function. > > plot(xw_nbq, coords,add=TRUE,col="red")> summary(xw_nbq) > > > Neighbour list object: > Number of regions: 140 > Number of nonzero links: 680 > Percentage nonzero weights: 3.469388 > Average number of links: 4.857143 > 2 regions with no links: > 3 138 > Link number distribution: > > 0 1 2 3 4 5 6 7 8 9 > 2 6 4 16 32 35 17 13 13 2 > 6 least connected regions: > 11 32 57 117 124 137 with 1 link > 2 most connected regions: > 28 71 with 9 links > > when I try to run nb2listw, i got repated error following the below error > message. > > xlist <- nb2listw(neighbours,glist = NULL,style = "W",zero.policy =TRU) > > summary.listw(xlist) > Error in summary.listw(xlist) : regions with no neighbours found, use > zero.policy=TRUE > > I wonder if someone advises me how to fix the error message from my > working directory > > > > *Regards, * > > Yalem > > ___ > R-sig-Geo mailing list > R-sig-Geo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] How to “smooth” a raster map
You mean re sample? On Jun 28, 2015, at 4:25 PM, Thiago V. dos Santos thi_vel...@yahoo.com.br wrote: Dear all, I am trying to create a map from raster data. The file came from a crop model, with resolution of 0.5 degree. Even when I disaggregate it (i.e. increase spatial resolution), the map looks really pixelated. I am trying to make it look better. My current code produces this image: http://i.stack.imgur.com/WssPy.png where I would like to smooth the data, by supressing the pixelated look. Some other visualization programs do this automatically, so I guess it should not be hard to reproduce using R. For example, this is the same file plotted using Panoply: http://i.stack.imgur.com/jXYI7.png It doesn't look absolutely smooth, but at least it doesn't have the pixelated look neither. How to achieve a similar result in R? This is the code to reproduce my problem: -- library(RCurl) library(rasterVis) # Go to temp dir and download file - approx. 1.7M old - setwd(tempdir()) # download raster and shapefile download.file('https://dl.dropboxusercontent.com/u/27700634/yield.nc', 'yield.nc', method='curl') download.file('https://dl.dropboxusercontent.com/u/27700634/southern.zip', 'southern.zip', method='curl') unzip('southern.zip', exdir='.') # load southern Brazil shapefile mapaSHP - shapefile('southern.shp') # load brick b - brick('yield.nc', level=16) # create color scheme mycols - rasterTheme(region=colorRampPalette(brewer.pal(9,'Greens'))(100)) # use second brick layer to plot map levelplot(b[[2]], margin = FALSE, main = Rice yield in tons/ha, par.settings = mycols) + layer(sp.lines(mapaSHP, lwd=0.8, col='darkgray')) # return to your old dir setwd(old) -- Thanks in advance for any input, -- Thiago V. dos Santos PhD student Land and Atmospheric Science University of Minnesota http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm Phone: (612) 323 9898 ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Help with latlong to UTM conversion when UTM zones are different
A number of field folks prefer UTM because -it matches legacy paper USGS quad map series traditionally used for field navigation -units are in meters and can be used to gauge field distances from a coordinate readout On Mar 27, 2015, at 10:48 AM, Michael Sumner mdsum...@gmail.com wrote: There is no good natural reason to use UTM, it mistifies me why our community tolerates this bizarre default. I always use a local equal-area projection unless some other compromise dictates a different choice. Cheers, Mike On Fri, 27 Mar 2015 21:28 Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: If you have lat-long data that crosses two UTM zones then its generally okay to just pick *one* and transform all the points to that. Use the one that has the most points in. Basically use the UTM zones as guidelines to pick one UTM zone coordinate system. Unless your data spans several zones and you want quite high accuracy of distance measurements. Some points bleeding over into an adjacent zone are no problem. All projections are approximations to the earth's spheroid, so points that are within a single UTM zone have some distortion in their distance or angle relationships. Transforming points that are within an adjacent UTM zone is just an extension of that distortion. You can compute the precise distance error if you want for the furthest points by comparing with the geodesic distance. Alternatively you might find there is a coordinate system that spans your dataset nicely - often when a country or an island or a region crosses UTM zones there is an official coordinate system defined that is used by the authorities there. Also alternatively, there's nothing to stop you defining a transverse mercator system based on the centre of your data. Barry On Fri, Mar 27, 2015 at 7:44 AM, moses selebatso selebat...@yahoo.co.uk wrote: Hello I have animal movement data that I have converted from Lat/Long to UTM, unfortunately the data falls in two UTM zones (34S and 35S). For some reason R cannot display both of them in the same window (the 35S data is way off the expected location). The question is how do I convert the data such that R can correctly read it? Moses SELEBATSO (+267) 318 5219 (H) (+267) 716 393 70 (C) (+267) 738 393 70 (C [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] 3D KDE to Triangular Irregular Network
Thanks a lot Michael that was very helpful. It seems like you might be able to make a TIN from one of the contour levels, say 75% or something. I'm not really sure how to get to those isosurface vertex coordinates for a given contour level. Is that possible in R. -Original Message- From: r-sig-geo-boun...@r-project.org [mailto:r-sig-geo-boun...@r-project.org] On Behalf Of Michael Sumner Sent: Friday, April 12, 2013 2:06 PM To: Duff, Andrew A (DFW) Cc: r-sig-geo@r-project.org Subject: Re: [R-sig-Geo] 3D KDE to Triangular Irregular Network A TIN cannot represent that data structure, the plot shows multiple surfaces that wrap around in 3D. (A TIN cannot do that). The plot is made by contouring (isosurfaces) from a 3D array. You can represent the array in NetCDF, and maybe your GIS can read that. Otherwise you could do the same as here but create a 2D raster for every slice in the 3rd dimension and reconstruct over there. Bare bones using raster to NetCDF: library(raster) r - brick(UD$estimate, xmn = min(UD$eval.points[[1]]), xmx = max(UD$eval.points[[1]]), ymn = min(UD$eval.points[[2]]), ymx = max(UD$eval.points[[2]])) ## Plot each 3D slice plot(r) ## write to NetCDF, you need ncdf or ncdf4 package writeRaster(r, file.nc) See ?writeRaster for further options to add descriptors to the file, and you will likely need to worry about the orientation when making the raster object. On Sat, Apr 13, 2013 at 4:29 AM, Duff, Andrew A (DFW) andrew.d...@dfw.wa.gov wrote: I am interested in being able to export the results of a 3 dimensional kernel density estimate from the ks package in R to a format that could be viewed in 3D GIS application such as ESRI's ArcScene or ArcGlobe. I want to example the use of airspace in relation to terrain features. A TIN seems to be the most logical geospatial data structure that would support taking the 3D kde output into GIS. Does anybody have any ideas on how to get from a 3D kde output in ks to a tin. A self-contained sample of generating the kde is below. ###sample library(ks) df - data.frame(x=sample(1:200, 10), y=sample(1:200, 10), z=sample(1:500, 10)) Hpi1 - Hpi(x = df) UD - kde(x=df, H=Hpi1) plot(UD) Thanks in advance. [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo -- Michael Sumner Hobart, Australia e-mail: mdsum...@gmail.com [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] TWS Spatial Ecology and Telemetry Awards
Good Afternoon, The Wildlife Society Spatial Ecology and Telemetry working group offers some awards each year to people who have created a GIS or Telemetry-related tool, document, software program or service that has made a significant difference to our profession. There is no money involved; it is just a way to say thank you to people who have made a difference to us in conducting spatial analysis. The awards can be given for both commercial and non-commercial products. Recipients of the awards get certificates of appreciation, plus get mentioned in The Wildlife Professional and our newsletter. Do you know of a person or product that you would like to nominate for one of these awards? I know some of you have depended heavily on some R tools for spatial analysis, for example. If those tools really helped you out, maybe you could nominate the people who wrote the packages. It means a lot to the people who created the tools, plus it gives a little more exposure for the tools they wrote. If you would like to nominate someone, please send their name and a short description of why you think they deserve the award to either Jeff Jenness (jeffj AT jennessent.com) or James Sheppard (spatialecologist AT gmail.com). The TWS Spatial Ecology and Telemetry working group awards committee will select three recipients, and we expect to make our final selection by the end of May. Andy Andrew Duff, M.S., Certified Wildlife Biologist Acting Wildlife Data Systems Lead Biological Data Systems, Wildlife Science Division Washington Dept. of Fish and Wildlife [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo