[R-sig-Geo] write.sn2gwt and lost region.id

Roger Bivand Roger.Bivand at nhh.no
Sun Nov 1 11:20:04 CET 2009


On Fri, 30 Oct 2009, pota0011 at umn.edu wrote:

> I'm mostly working with classic GeoDa. It uses the legacy GWT format when 
> creating/opening GWT files with Rec_Num 1,..N IDs. However, write.sn2gwt 
> always uses the new format with the "shpfile" and "ind" fields, even though 
> it doesn't pass region.ids. So it seems to me that one has to edit the header 
> file to the old format by deleting everything by the number of IDs, before 
> classic GeoDa can read the file. It would be great if write.sn2gwt could 
> either pass the region.ids or alternatively have an option for creating the 
> GWT file in legacy format. At least that's how I'm understanding things; let 
> me know if there is something I'm missing.

OK, I understand. Please try pre-release spdep_0.4.51 from R-forge:

install.packages("spdep", repos="http://R-Forge.R-project.org")

once you see that version number on:

https://r-forge.r-project.org/R/?group_id=182

at the foot of the page, and last change something like today. Let me know 
if it solves your problem - added legacy= argument; you could set 
legacy=TRUE to only get the number of observations on the first line.

Hope this helps,

Roger

PS. The release will also have impacts components for spatial lag and 
spatial Durbin models, for each power of the weights matrix, for those 
users who might need this kind of detail.

>
> Thanks, on:
> John
>
> On Oct 30 2009, Roger Bivand wrote:
>
>> On Fri, 29 Oct 2009, pota0011 at umn.edu wrote:
>> 
>>> Hi,
>>> I wanted to confirm that there is still no straightforward way to pass 
>>> region.id values to a GWT file when using write.sn2gwt, as this post from 
>>> two
>>> years ago suggests:
>>> http://www.mail-archive.com/r-sig-geo@stat.math.ethz.ch/msg02209.html
>>> 
>>> GeoDa needs the particular region.id values to, for example, make 
>>> histograms
>>> from weight files. It seems that these are passed fine for GAL files with
>>> write.nb.gal, but not GWT files. Does anyone know of a work-around?
>> 
>> I'll try to implement this - which version of GeoDa and/or OpenGeoDa are 
>> you using? I think the revision works for classic GeoDa, but OpenGeoDa 
>> cannot open GWT files that it itself has created when the IDs are not 1, 
>> ..., N.
>> 
>> Best wishes,
>> 
>> Roger
>> 
>>> 
>>> Thanks,
>>> John
>>> 
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>> 
>> 
>> 
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list