An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20140709/0dc76482/attachment.pl>
reading a feature class
5 messages · Roger Bivand, Michael Sumner, Frede Aakmann Tøgersen +1 more
The reason is that Joseph Bechara's post included a jpeg image at 16KB, and an HTML component breaking the list requirement to post in plain text only. Multiple copies of his logo then clog up the system. The real answer to is problem is that ogrDrivers() will show that he does not have the driver (certainly not in the CRAN binaries). GDB is a proprietary format that can be used if you builds GDAL/OGR against ESRI binaries, not otherwise (certainly for Personal GDB, and effectively for File GDB). The data must be saved from ArcGIS in an open format. Hope this clarifies, Roger
On Wed, 9 Jul 2014, Frede Aakmann T?gersen wrote:
From: Frede Aakmann T??gersen Sent: 9. juli 2014 15:12 To: 'JOSEPH BECHARA'; 'Michael Sumner' Cc: 'RsigGeo' Subject: FW: [R-sig-Geo] reading a feature class Hi I am getting some information like this from the list: Your mail to 'R-sig-Geo' with the subject RE: [R-sig-Geo] reading a feature class Is being held until the list moderator can review it for approval. The reason it is being held: Message body is too big: 76484 bytes with a limit of 50 KB Either the message will get posted to the list, or you will receive notification of the moderator's decision. If you would like to cancel this posting, please visit the following URL:
https://stat.ethz.ch/mailman/confirm/r-sig-geo/5859051c379864eae2b43f7c1fcf9c94159715a0 Cutting and resending: Hi Well both Michael and I are just guessing because of lack of information. I cannot really help you before I can try to read your file on my system (both windows and linux) before I can be of any use to help you. I suppose that Michael expressed the same. One thing that comes to my mind is that reading vector formats into R requires lots of physical memory. If your computer do not have that it is probably swapping to hard disk (hence working along for ever). Can you check that? If so you might as well kill the process and think on other approaches. Yes, other software may handle this more efficient than R. Yours sincerely / Med venlig hilsen Frede Aakmann T??gersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 frtog at vestas.com<mailto:frtog at vestas.com> http://www.vestas.com<http://www.vestas.com/> Company reg. name: Vestas Wind Systems A/Sas well This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice<http://www.vestas.com/legal/notice> If you have received this e-mail in error please contact the sender. From: JOSEPH BECHARA [mailto:jbechara at lri-lb.org] Sent: 9. juli 2014 14:44 To: 'Michael Sumner' Cc: Frede Aakmann T??gersen; 'RsigGeo' Subject: RE: [R-sig-Geo] reading a feature class I tried your suggestion and it is working. I got the below message but it have been running for almost 1 h and didn???t close the ring yet. bb<-readOGR(dsn="All_poly.gdb",layer="All_lays1") OGR data source with driver: OpenFileGDB Source: "All_poly.gdb", layer: "All_lays1" with 9067252 features and 5 fields Feature type: wkbMultiPolygon with 2 dimensions JOSEPH BECHARA Wildfire Management Component Coordinator Ashrafieh 1020 Building, 8th floor, Mathaf, Beirut, Lebanon Tel.: +961 (1) 426630-1-2 Fax: +961 (1) 426631 Mail: jbechara at lri-lb.org<mailto:jbejjani at lri-lb.org> www.lri-lb.org<http://www.lri-lb.org/> From: Michael Sumner [mailto:mdsumner at gmail.com] Sent: Wednesday, July 09, 2014 2:00 PM To: Joseph Bechara Cc: Frede Aakmann T??gersen; RsigGeo Subject: RE: [R-sig-Geo] reading a feature class dd is the layer name/s, so literally I meant to use it to find what "All_lays1" really should be. (I have no experience with this format thankfully). So see for yourself what ogrListLayers reports, then the dsn for readOGR is the same, but it also wants a layer name as the second arg. (I probably need to find one of these "geodatabases" things and try for myself before I can help.) dsn is the data source (the mothership) layer is the one or more layer-thingys in that ship (shapefiles have just one layer, hence the most available example breaks the more general mould) Clear? See ?readOGR for examples On 9 Jul 2014 19:59, "JOSEPH BECHARA" <jbechara at lri-lb.org<mailto:jbechara at lri-lb.org>> wrote: Hi Michael, It worked partially. I still have an error message dd<-ogrListLayers(dsn="C:/sophie/Allpoints/All_poly.gdb") bb<-readOGR(dsn=dd,layer="All_lays1") Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv) : Cannot open file In addition: Warning messages: 1: In if (nchar(dsn) == 0) stop("empty name") : the condition has length > 1 and only the first element will be used 2: In if (nchar(dsn) == 0) stop("empty name") : the condition has length > 1 and only the first element will be used JOSEPH BECHARA Wildfire Management Component Coordinator Ashrafieh 1020 Building, 8th floor, Mathaf, Beirut, Lebanon Tel.: +961 (1) 426630-1-2 Fax: +961 (1) 426631<tel:%2B961%20%281%29%20426631> Mail: jbechara at lri-lb.org<mailto:jbejjani at lri-lb.org> www.lri-lb.org<http://www.lri-lb.org/> [[alternative HTML version deleted]]
Roger Bivand Department of Economics, Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 91 00 e-mail: Roger.Bivand at nhh.no
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20140710/5dda6bc4/attachment.pl>
Hi Michael
Thanks for the information about gdal drivers. The version I had on my windows box was:
rgdal: version: 0.8-16, (SVN revision 498)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.10.1, released 2013/08/26
Which did not have the GDB driver. An update.packages(oldPkgs = "rgdal") didn't give me the GDAL 1.11.0 version. I had to remove.packages("rgdal") and then install.packages("rgdal").
Yours sincerely / Med venlig hilsen
Frede Aakmann T?gersen
Specialist, M.Sc., Ph.D.
Plant Performance & Modeling
Technology & Service Solutions
T +45 9730 5135
M +45 2547 6050
frtog at vestas.com
http://www.vestas.com
Company reg. name: Vestas Wind Systems A/S
This e-mail is subject to our e-mail disclaimer statement.
Please refer to www.vestas.com/legal/notice
If you have received this e-mail in error please contact the sender.
From: Michael Sumner [mailto:mdsumner at gmail.com]
Sent: 10. juli 2014 02:17
To: Roger Bivand
Cc: Joseph Bechara; Frede Aakmann T?gersen; RsigGeo
Subject: Re: [R-sig-Geo] reading a feature class
On 10 Jul 2014 03:24, "Roger Bivand" <Roger.Bivand at nhh.no> wrote:
The reason is that Joseph Bechara's post included a jpeg image at 16KB, and an HTML component breaking the list requirement to post in plain text only. Multiple copies of his logo then clog up the system. The real answer to is problem is that ogrDrivers() will show that he does not have the driver (certainly not in the CRAN binaries). GDB is a proprietary format that can be used if you builds GDAL/OGR against ESRI binaries, not otherwise (certainly for Personal GDB, and effectively for File GDB). The data must be saved from ArcGIS in an open format. Hope this clarifies, Roger ? GDB has been reverse engineered and is included in the Windows binary on CRAN, as well as by default in source installs.? http://erouault.blogspot.com.au/2013/10/filegdb-format-reverse-engineered.html http://www.gdal.org/drv_openfilegdb.html (Unless I'm still missing something).? Platform: x86_64-w64-mingw32/x64 (64-bit) ...
library(rgdal)
Loading required package: sp
rgdal: version: 0.8-16, (SVN revision 498)
...Loaded GDAL runtime: GDAL 1.11.0, released 2014/04/16
...GDAL does not use iconv for recoding strings.
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
library(rgdal)
subset(ogrDrivers(), grepl("GDB", name))
? ? ? ? ? name write
29 OpenFileGDB FALSE
ogrListLayers("/path/to/folderworld.gdb")
[1] "cities" ? ? ? ? ? ? "latitude_longitude" "countries" ? ? ? ??
[4] "continents" ??
Cheers, Mike.?
On Wed, 9 Jul 2014, Frede Aakmann T?gersen wrote:
From: Frede Aakmann T??gersen Sent: 9. juli 2014 15:12 To: 'JOSEPH BECHARA'; 'Michael Sumner' Cc: 'RsigGeo' Subject: FW: [R-sig-Geo] reading a feature class Hi I am getting some information like this from the list: Your mail to 'R-sig-Geo' with the subject ? ?RE: [R-sig-Geo] reading a feature class Is being held until the list moderator can review it for approval. The reason it is being held: ? ?Message body is too big: 76484 bytes with a limit of 50 KB Either the message will get posted to the list, or you will receive notification of the moderator's decision. ?If you would like to cancel this posting, please visit the following URL: ? ?https://stat.ethz.ch/mailman/confirm/r-sig-geo/5859051c379864eae2b43f7c1fcf9c94159715a0 Cutting and resending: Hi Well both Michael and I are just guessing because of lack of information. I cannot really help you before I can try to read your file on my system (both windows and linux) before I can be of any use to help you. I suppose that Michael expressed the same. One thing that comes to my mind is that reading vector formats into R requires lots of physical memory. If your computer do not have that it is probably swapping to hard disk (hence working along for ever). Can you check that? If so you might as well kill the process and think on other approaches. Yes, other software may handle this more efficient than R. Yours sincerely / Med venlig hilsen Frede Aakmann T??gersen Specialist, M.Sc., Ph.D. Plant Performance & Modeling Technology & Service Solutions T +45 9730 5135 M +45 2547 6050 frtog at vestas.com<mailto:frtog at vestas.com> http://www.vestas.com<http://www.vestas.com/> Company reg. name: Vestas Wind Systems A/Sas well This e-mail is subject to our e-mail disclaimer statement. Please refer to www.vestas.com/legal/notice<http://www.vestas.com/legal/notice> If you have received this e-mail in error please contact the sender. From: JOSEPH BECHARA [mailto:jbechara at lri-lb.org] Sent: 9. juli 2014 14:44 To: 'Michael Sumner' Cc: Frede Aakmann T??gersen; 'RsigGeo' Subject: RE: [R-sig-Geo] reading a feature class I tried your suggestion and it is working. ?I got the below message but it have been running for almost 1 h and didn???t close the ring yet. bb<-readOGR(dsn="All_poly.gdb",layer="All_lays1") OGR data source with driver: OpenFileGDB Source: "All_poly.gdb", layer: "All_lays1" with 9067252 features and 5 fields Feature type: wkbMultiPolygon with 2 dimensions JOSEPH BECHARA Wildfire Management Component Coordinator Ashrafieh 1020 Building, 8th floor, Mathaf, Beirut, Lebanon Tel.: +961 (1) 426630-1-2 Fax: +961 (1) 426631 Mail: jbechara at lri-lb.org<mailto:jbejjani at lri-lb.org> www.lri-lb.org<http://www.lri-lb.org/> From: Michael Sumner [mailto:mdsumner at gmail.com] Sent: Wednesday, July 09, 2014 2:00 PM To: Joseph Bechara Cc: Frede Aakmann T??gersen; RsigGeo Subject: RE: [R-sig-Geo] reading a feature class dd is the layer name/s, so literally I meant to use it to find what "All_lays1" really should be. (I have no experience with this format thankfully). So see for yourself what ogrListLayers reports, then the dsn for readOGR is the same, but it also wants a layer name as the second arg. (I probably need to find one of these "geodatabases" things and try for myself before I can help.) dsn is the data source (the mothership) layer is the one or more layer-thingys in that ship (shapefiles have just one layer, hence the most available example breaks the more general mould) Clear? See ?readOGR for examples
On 9 Jul 2014 19:59, "JOSEPH BECHARA" <jbechara at lri-lb.org<mailto:jbechara at lri-lb.org>> wrote:
Hi Michael,
It worked partially.
I still have an error message
dd<-ogrListLayers(dsn="C:/sophie/Allpoints/All_poly.gdb")
bb<-readOGR(dsn=dd,layer="All_lays1")
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv) :
?Cannot open file
In addition: Warning messages:
1: In if (nchar(dsn) == 0) stop("empty name") :
?the condition has length > 1 and only the first element will be used
2: In if (nchar(dsn) == 0) stop("empty name") :
?the condition has length > 1 and only the first element will be used
JOSEPH BECHARA
Wildfire Management Component Coordinator
Ashrafieh 1020 Building, 8th floor, Mathaf, Beirut, Lebanon
Tel.: +961 (1) 426630-1-2
Fax: +961 (1) 426631<tel:%2B961%20%281%29%20426631>
Mail: jbechara at lri-lb.org<mailto:jbejjani at lri-lb.org>
www.lri-lb.org<http://www.lri-lb.org/>
? ? ? ? [[alternative HTML version deleted]]
Roger Bivand Department of Economics, Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 91 00 e-mail: Roger.Bivand at nhh.no
20 days later
Hi folks, I'm trying to modify an R code for plotting x,y spatial data in 3D bivariate distribution using R; I modified a code from here: http://stackoverflow.com/questions/19949435/3d-plot-of-bivariate-distribution-using-r-or-matlab I would like to obtain the same results coming from the code suggested by r2evans user but with distributions separated by groups, possibly with semi-transparent color. I have problems in: 1) plotting the histograms on y axis; I just cannot "translate" the procedure for x in the y axis 2) putting all histograms perfectly superimposed and not shifted one from each other here below the modified r2evans's code with a stand alone reprodicible example. thanks in advance for your suggestions best paolo library(rgl) bvn<-matrix(rnorm(900,0,0.1),ncol=3) group<-factor(rep(1:3,each=100)) xmaxlist<-NULL ymaxlist<-NULL zmaxlist<-NULL hxlist<-NULL hxslist<-NULL hylist<-NULL hyslist<-NULL for(i in 1: nlevels(group)){ hxi<- hist(bvn[,2][as.numeric(group)==i], plot=FALSE) hxsi <- hxi$density / sum(hxi$density) hyi <- hist(bvn[,1][as.numeric(group)==i], plot=FALSE) hysi <- hyi$density / sum(hyi$density) ## [xy]max: so that there's no overlap in the adjoining corner xmaxi <- tail(hxi$breaks, n=1) + diff(tail(hxi$breaks, n=2)) ymaxi <- tail(hyi$breaks, n=1) + diff(tail(hyi$breaks, n=2)) zmaxi <- max(hxsi, hysi) hxlist<-c(hxlist,list(hxi)) hxslist<-c(hxslist,list(hxsi)) hylist<-c(hylist,list(hyi)) hyslist<-c(hyslist,list(hysi)) xmaxlist<-c(xmaxlist,list(xmaxi)) ymaxlist<-c(ymaxlist,list(ymaxi)) zmaxlist<-c(zmaxlist,list(zmaxi)) } for(i in 1:length(zmaxlist)){ for (ii in seq_along(hxlist[[i]]$counts)) { quads3d(hxlist[[i]]$breaks[ii]*c(.9,.9,.1,.1) + hxlist[[i]]$breaks[ii+1]*c(.1,.1,.9,.9), rep(ymaxlist[[i]], 4), hxslist[[i]][ii]*c(0,1,1,0), color=i,alpha=0.5,add=T) } } plot3d(bvn[,2], bvn[,1], 0, zlim=c(0, max(unlist(zmaxlist))), radius=0.02,axes=FALSE,col=as.numeric(group),type="s",add=T)