Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Edzer J. Pebesma
Barry Rowlingson wrote: >Wouter Buytaert wrote: > > > >>The resulting R function doesn't seem very complicated. I'm a newbie >>though, so all recommendations welcome: >> >>topidx <- function(map) { >> >>if(!(class(map) == "SpatialGridDataFrame")) >> printf("Map should be of SpatialGridData

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Tim Keitt
On Tue, 2006-03-07 at 17:39 +, Barry Rowlingson wrote: > Tim Keitt wrote: > > > That's a rather odd aspect of S methods > > one of many :) > > I think this stems from the S3 way that what other languages call > "methods of objects", R has as global namespace functions. In Python for >

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Barry Rowlingson
Tim Keitt wrote: > That's a rather odd aspect of S methods one of many :) >-- even if you only want to call > the function for a single class, you have to create a generic function. > In cases where I'm not wanting polymorphic behavior (the function really > only makes sense for a single clas

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Tim Keitt
On Tue, 2006-03-07 at 16:24 +, Barry Rowlingson wrote: > Wouter Buytaert wrote: > > > The resulting R function doesn't seem very complicated. I'm a newbie > > though, so all recommendations welcome: > > > > topidx <- function(map) { > > > > if(!(class(map) == "SpatialGridDataFrame")) > >

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Barry Rowlingson
Wouter Buytaert wrote: > The resulting R function doesn't seem very complicated. I'm a newbie > though, so all recommendations welcome: > > topidx <- function(map) { > > if(!(class(map) == "SpatialGridDataFrame")) > printf("Map should be of SpatialGridDataFrame class") > Recommendation

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Wouter Buytaert
Thanks for the info! Learning the .Call interface is certainly no problem of course. I just thought about going with .C() because: - the "writing R extensions" manual says you should consider .C before using .Call - it is easy to pass the map values as a double vector, and only a few addition

[R-sig-Geo] R: Adding some data as colors to world map

2006-03-07 Thread Millo Giovanni
Dear Gregor, here's my contribution: http://arcdata.esri.com/data_downloader/DataDownloader?part=10200&stack= back ESRI lets you zoom on the world map and download the relevant shapefiles. I have used them and it works just fine for country boundaries. There is Slovenija too (the maps look post-

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Roger Bivand
On Tue, 7 Mar 2006, Edzer J. Pebesma wrote: > Wouter, if you want to use the .C interface, you need to pass > the maps as simple vectors. I would pass one with the map > values, and one with the topology. Below is some example > code how to get them. An R function should be used to do > the coerci

Re: [R-sig-Geo] C API for sp classes?

2006-03-07 Thread Edzer J. Pebesma
Wouter, if you want to use the .C interface, you need to pass the maps as simple vectors. I would pass one with the map values, and one with the topology. Below is some example code how to get them. An R function should be used to do the coercion to double arrays, and wrap the .C call. Please note

[R-sig-Geo] C API for sp classes?

2006-03-07 Thread Wouter Buytaert
Hi, I want to write some R functions for calculating hydrological catchment characteristics from a DEM (topographic index, overland flow delay function etc.). Looks like using a DEM with SpatialGridDataFrame class as an input is a good idea. Then what is the best way to extract the data matr

Re: [R-sig-Geo] Adding some data as colors to world map

2006-03-07 Thread Miha Staut
> > There are plenty of sources of > > border maps, but getting something matching the borders you need may > > require a bit of googling (usually looking for a vector representation). > > Yes, my country is missing ;) > > > Does anybody have recommended websites for current European national

Re: [R-sig-Geo] help on "non-square" problem when using write.asciigrid

2006-03-07 Thread Roger Bivand
On Tue, 7 Mar 2006, Edzer J. Pebesma wrote: > Yong Li wrote: > > >Dear Friends, > > > >Can anybody help me for the subject? > >When I tried to use write.asciigrid to export a spatialgrid to esri > >ascii grid, I always failed because of the message "non-square grid > >is not support" even I kne

Re: [R-sig-Geo] Adding some data as colors to world map

2006-03-07 Thread Roger Bivand
On Mon, 6 Mar 2006, Gregor Gorjanc wrote: > Roger Bivand wrote: > > On Mon, 6 Mar 2006, Gregor Gorjanc wrote: > > > > > >>Hello! > >> > >>I am a total newbie to map handling, but a keen R user. I have some > >>estimates by numbers per country (in names, such as Germany, France, > >>...) and woul