Re: [R-sig-Geo] Problem Raster Overlay

2013-05-23 Thread Lionel Hertzog
Dear Mohgli, The function crop in the raster package is probably what you are looking for. Happy Mapping, Lionel Le 24/05/2013 00:55, mohglim...@gmail.com a écrit : > Dear all > > I am plotting a raster dataset derived through a netCDF file and want to > overlay with a shapfile. Although I spec

Re: [R-sig-Geo] Bug in writeOGR MSSQLSpatial driver?

2013-05-23 Thread cmundy
Thanks Roger This didn't quite work > row.names(polyunion90df) <- "" # one for each row Error in spChFIDs(SP, x) : lengths differ But this did, row.names(polyunion90df) <- as.character(1:nrow(polyunion90df)) I suspect part of the problem was my use of an ID variable for the FID that includes n

Re: [R-sig-Geo] fit.variogram.reml

2013-05-23 Thread Paulo Justiniano Ribeiro Jr
I'm unsure the REML's in gstat and geoR reffer to the same method. In the former the REML is based on the sample variogram whereas for the latter the REML is applied to the assumed (Gaussian) distribution of the data, in a modification of the original likelihood function. Paulo Justiniano Ribei

[R-sig-Geo] Problem Raster Overlay

2013-05-23 Thread mohglimoor
Dear all I am plotting a raster dataset derived through a netCDF file and want to overlay with a shapfile. Although I specify the extent of the raster xmin=-180 to xmax=180 it puts the x values to 0 to 360. When I then do the overlay with a shapefile the shapefiles are shifted since the has an ext

[R-sig-Geo] raster/ncdf4 error: too many open files

2013-05-23 Thread Zack Holden
Dear list, I am extracting data from thousands of NetCDF files, using the raster library to read in each file as follows: nclist <- list.files(nc.dir) for(iFile in 1:length(nclist)) { r <- raster(nclist[iFile], varname = "myvar") # extract data here } # end loop. I reach the file handler

Re: [R-sig-Geo] fit.variogram.reml

2013-05-23 Thread Edzer Pebesma
Saman, package geoR contains functions for (RE)ML fitting that also fit the range parameter. Please note that in your output below the nugget is negative, which can't be the case -- one could argue that this is a software error. On 05/23/2013 10:02 PM, Saman Monfared wrote: > Hi, > In gstat and

[R-sig-Geo] fit.variogram.reml

2013-05-23 Thread Saman Monfared
Hi, In gstat and package the fit.variogram.reml function provided for RMLE method to estimation of variogram parameters. This function only estimate nugget and sill and range parameter is fix. for example: v.rml<-fit.variogram.reml(rate~1,data,model =vgm(20,"Sph",95241.99,0)) v.rml model

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread Tom Philippi
Apologies for the mis-send above. To clarify and summarize: there may be 3 steps You need to define the coordinate system of your UTM data via proj4string: proj4string(cap.coords.sp) <- CRS("") The string in CRS defines whaat your GPS used: it might be as minimal as "+proj=longlat

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread Tom Philippi
Chris-- To clarify and summarize: You need to define the coordinate system of your UTM data via proj4string: proj4string(cap.coords.sp) <- CRS("") On Thu, May 23, 2013 at 12:30 PM, Edzer Pebesma < edzer.pebe...@uni-muenster.de> wrote: > > > On 05/23/2013 07:08 PM, Chris Waigl wrote: > > >

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread Edzer Pebesma
On 05/23/2013 07:08 PM, Chris Waigl wrote: > >> >> Hi Roger- Getting closer to fixing the problem. You were correct with the >> proj4string differing. The fish capture coordinates are "NA" and the Basins >> are "+proj=longlat +ellps=WGS84." So now I am trying to convert the points. >> Here is th

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread Chris Waigl
> > Hi Roger- Getting closer to fixing the problem. You were correct with the > proj4string differing. The fish capture coordinates are "NA" and the Basins > are "+proj=longlat +ellps=WGS84." So now I am trying to convert the points. > Here is the code I input: > > cap.coords.sp<-spTransform(cap

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread karengrace84
Hi Roger- Getting closer to fixing the problem. You were correct with the proj4string differing. The fish capture coordinates are "NA" and the Basins are "+proj=longlat +ellps=WGS84." So now I am trying to convert the points. Here is the code I input: cap.coords.sp<-spTransform(cap.coords.sp,CRS("

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread Roger Bivand
On Thu, 23 May 2013, Zack Holden wrote: Karen, you could try converting your polygons to raster using rasterize() in the raster library, and then use the extract() function to retrieve the cell values corresponding to your XY locations. I've used this workaround for similar problems in the past.

Re: [R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread Zack Holden
Karen, you could try converting your polygons to raster using rasterize() in the raster library, and then use the extract() function to retrieve the cell values corresponding to your XY locations. I've used this workaround for similar problems in the past. Zack On Thu, May 23, 2013 at 9:00 AM,

[R-sig-Geo] point.in.polygon() or over() help?

2013-05-23 Thread karengrace84
I am new to mapping with R and having some trouble. Here is what I am trying to accomplish. I am looking at fish tagging data. I have gps coordinates of where each fish was tagged and released, and I have a map of 10 coastal basins of the state of Louisiana. I am trying to determine which basin eac

Re: [R-sig-Geo] Bug in writeOGR MSSQLSpatial driver?

2013-05-23 Thread Roger Bivand
On Thu, 23 May 2013, cmundy wrote: Hi All, Trying to run a well used script over the last few days has shown up an error when writing a SpatialPolygonDataFrame to SQL SERVER using writeOGR. This script worked 4 weeks ago, so I assume it is do with updates in the latest version of rgdal. This

[R-sig-Geo] Bug in writeOGR MSSQLSpatial driver?

2013-05-23 Thread cmundy
Hi All, Trying to run a well used script over the last few days has shown up an error when writing a SpatialPolygonDataFrame to SQL SERVER using writeOGR. This script worked 4 weeks ago, so I assume it is do with updates in the latest version of rgdal. The write attempt creates a new table in SQL

Re: [R-sig-Geo] spTransform error

2013-05-23 Thread Agustin Lobo
Ross, On Thu, May 23, 2013 at 9:39 AM, Ross Ahmed wrote: > Just an update from me. I've tried following the installation guidelines > here, but following this, spTrasform is still giving the same error: > https://sites.google.com/site/eospansite/rspatial_gis/rgdalmac Actually that page is very

Re: [R-sig-Geo] spTransform error

2013-05-23 Thread Roger Bivand
On Thu, 23 May 2013, Ross Ahmed wrote: Just an update from me. I've tried following the installation guidelines here, but following this, spTrasform is still giving the same error: https://sites.google.com/site/eospansite/rspatial_gis/rgdalmac As Agus notes at the head of the page (he wrote i

Re: [R-sig-Geo] spTransform error

2013-05-23 Thread Ross Ahmed
Just an update from me. I've tried following the installation guidelines here, but following this, spTrasform is still giving the same error: https://sites.google.com/site/eospansite/rspatial_gis/rgdalmac In addition, I've posted on r-sig-mac for help on how to solve the problem, but have not h