Re: [R-sig-Geo] questions on RasterStack/Brick

2010-09-21 Thread Nikhil Kaza
) br - addLayer(br,k) } return(br) } Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Sep 21, 2010, at 3:49 AM, Martin wrote: Dear all, I have some questions concerning stacks and bricks from the raster

Re: [R-sig-Geo] mass importing rasters

2010-09-12 Thread Nikhil Kaza
haven't tried this. but some variant of this should work for (f in dir()){ assign(f, readGDAL(f)) } Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Sep 12, 2010, at 4:29 PM, Martin Brandt wrote: a simple question: how can I

Re: [R-sig-Geo] mass importing rasters

2010-09-12 Thread Nikhil Kaza
This is neat! On Sep 12, 2010, at 5:18 PM, Robert J. Hijmans wrote: You have not said what type of objects you want, but here's one option: library(raster) s - stack(list.files(pattern='*.tif')) Robert On Sun, Sep 12, 2010 at 10:29 PM, Martin Brandt martin_bra...@gmx.net wrote: a

Re: [R-sig-Geo] splitting a map into areas by number of addresses

2010-08-26 Thread Nikhil Kaza
Look at knearneigh in spdep Once you figured out the neighbours, you may be able to an algorithm to efficiently partition the dataset. Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 26, 2010, at 8:50 AM, Sven Schmiedel

Re: [R-sig-Geo] SpatialGridDataFrame to SpatialPixelDataFrame

2010-08-25 Thread Nikhil Kaza
You have a typo. It is SpatialPixelsDataFrame. note the s Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 25, 2010, at 4:43 AM, Dorothea Lemke wrote: Dear list, I have problems to coerce a SpatialGridDataFrame object

Re: [R-sig-Geo] Choosing the right nb2listw-style

2010-08-23 Thread Nikhil Kaza
, the correct use of weights really depends on the assumptions and structure of the spatial process. Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 23, 2010, at 8:59 AM, Breitbach, Nils wrote: Dear Roger, dear Community, thanks

Re: [R-sig-Geo] Moran's I based on ZIP Code data

2010-08-20 Thread Nikhil Kaza
big file and then construct the poly list. you may run into memory issues for this operation, depending on your set up. Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 20, 2010, at 1:06 PM, Sharon O'Donnell wrote: Check out

Re: [R-sig-Geo] Error using gpclib fuctions

2010-08-19 Thread Nikhil Kaza
Just issue the command once in the session. gpclibPermit() Alternatively, you could wait for the rgeos package. Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 19, 2010, at 7:12 AM, Breitbach, Nils wrote: Dear Community

Re: [R-sig-Geo] subsetting a SpatialGridDataFrame image.SpatialGridDataFrame

2010-08-13 Thread Nikhil Kaza
image(meuse.grid) image(meuse.grid[20:70, 10:70, dist], add = TRUE, col = bpy.colors()) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 13, 2010, at 8:10 AM, Patrick Giraudoux wrote: Hi, I am trying to subset a SpatialGridDataFrame

[R-sig-Geo] plot overlay two spatialpolygons.

2010-08-04 Thread Nikhil Kaza
(rrt, seq(0,1,1/7)) cols - grey((length(brks):2)/length(brks)) dens - (2:length(brks))*3 plot(nc, density=dens[findInterval(rrt, brks, all.inside=TRUE)]) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com [[alternative HTML version

Re: [R-sig-Geo] Determine angle between polyline segments

2010-07-30 Thread Nikhil Kaza
(shapes/fylk-val.shp, package=maptools)[1], proj4string=CRS(+proj=utm +zone=33 +datum=WGS84)) a - coordinates(xx) sl - lapply(a, slopes) ag - lapply(sl, angles) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jul 30, 2010, at 3:33

Re: [R-sig-Geo] Reading Multi Polygon Shapefiles

2010-06-30 Thread Nikhil Kaza
try readOGR in rgdal package. If you are using a mac, installing rgdal is slightly more complicated. http://www.kyngchaos.com/software:frameworks Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jun 30, 2010, at 5:44 AM, Mario

Re: [R-sig-Geo] polygonValues (raster): Very slow

2010-06-30 Thread Nikhil Kaza
parallelization by breaking up the polygon files multiple parts and then assembling them back, but if you really need the accurate proportion of cell area of a cell that falls across two polygons, this strategy wont work. http://starspan.projects.atlas.ca.gov/doku/doku.php Nikhil Kaza Asst

Re: [R-sig-Geo] polygonValues (raster): Very slow

2010-06-30 Thread Nikhil Kaza
I second that you should reconsider weights argument and zonal statistics are much faster. In case you wanted starspan download here it is http://projects.atlas.ca.gov/frs/?group_id=48 Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l

Re: [R-sig-Geo] Combining multiple polylines into a single polyline

2010-06-17 Thread Nikhil Kaza
Not a R solution. But does v.generalize in grass help? http://grass.osgeo.org/wiki/V.generalize_tutorial Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Jun 12, 2010, at 8:05 PM, Don MacQueen wrote: I have an input shapefile

Re: [R-sig-Geo] How to extract coordinates values from a shapefile?

2010-06-09 Thread Nikhil Kaza
Look at this. Not sure if this is indeed what you want or if you actually have to unproject them. http://www.mail-archive.com/r-sig-geo@stat.math.ethz.ch/msg04715.html require(ggplot2) fortify(br) Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l

Re: [R-sig-Geo] Wheight matrices

2010-04-28 Thread Nikhil Kaza
Take a look at this document http://geodacenter.asu.edu/system/files/spdepintro.pdf The standard steps are require(maptools) readShapepoly require(spdep) poly2nb nb2listw or nb2mat Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com

[R-sig-Geo] spdep and rgdal

2010-04-12 Thread nikhil kaza
I am using theR -2.11 prerelase on windows 7 x64. I want to bring to attention couple of issues to the list in case they have not been reported. I understand that the R version is unstable, nevertheless here it is. library(rgdal) -- Error in registerS3method(Info[i, 1], Info[i, 2], Info[i, 3],

Re: [R-sig-Geo] spdep and rgdal

2010-04-12 Thread Nikhil Kaza
Roger, Happy to report that methods issue is resolved in the R 2.11 beta version. spam is still an issue but I presume once Reinhard fixes it by Apr 22, it should be fine. Thanks Nikhil On Apr 12, 2010, at 3:43 PM, Roger Bivand wrote: On Mon, 12 Apr 2010, nikhil kaza wrote: I am

Re: [R-sig-Geo] Inverse distance weights and spatial error model

2010-02-22 Thread Nikhil Kaza
Your question would be better answered on r-sig-Geo list. Nevertheless, here is the solution neigh.dist - nbdists(neigh.nb, coords, longlat=TRUE) inverse - lapply(neigh.dist, function(x) (1/(x^2))) Now instead use, neigh.listw - nb2listw(neigh.dist, glist=inverse,

[R-sig-Geo] Neighborhood weights spam matrix

2010-02-18 Thread Nikhil Kaza
Hello, I am not sure if this is the right forum to ask as this is mostly a sparse matrix question, nevertheless here it is. I am using R - 2.10.1 and spdep 0.4-54 on Windows Vista I have a large shapefile for which I need to create a neighborhood matrix file, I used the following command

Re: [R-sig-Geo] Neighborhood weights spam matrix

2010-02-18 Thread nikhil kaza
Many thanks! I forgot about the row standardisation. I will subset the nb class and then create the weights matrix. Nikhil On Thu, Feb 18, 2010 at 8:36 AM, Roger Bivand roger.biv...@nhh.no wrote: On Thu, 18 Feb 2010, Nikhil Kaza wrote: Hello, I am not sure if this is the right forum

Re: [R-sig-Geo] convert points into SHP polygons

2009-11-28 Thread Nikhil Kaza
Look at this website. http://www.carsonfarmer.com/?p=455 On 27 Nov 2009, at 11:03PM, rusers.sh wrote: Dear Robert, My method to generate the Voronoi tessellation maybe not better, You can show me you method to get it. What i want to get is the the class of SpatialPolygons(sp) based on