Changes between Version 28 and Version 29 of Cookbook gdal


Ignore:
Timestamp:
Jan 29, 2010 12:53:32 PM (15 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cookbook gdal

    v28 v29  
    8181{{{ 
    8282require(rgdal) 
    83 readOGR(dsn=PG:"host=locahost user=postgres dbname=CCM password=postgres port=5433",layer="riversegments") 
     83readOGR(dsn="PG:host=locahost user=postgres dbname=CCM password=postgres port=5433",layer="riversegments") 
    8484}}} 
    85 However the R invariably returns an absolutely not helpful code 
     85However the R invariably returns an absolutely not helpful code, and the same with R2.10 or R2.10.1 
    8686{{{ 
    8787> require(rgdal) 
     
    113113               datasource_name [layer [layer ...]] 
    114114}}} 
    115 There does not seem to be any problem and also nothing is returned ... oh fuck 
     115There does not seem to be any problem and also nothing is returned ...  
     116The next example for writing 
     117{{{ 
     118library(rgdal) 
     119writeOGR(meuse[1:10,], "PG:dbname=postgis", "meuse3", "PostgreSQL") 
     120}}} 
     121returns 
     122{{{ 
     123Erreur dans writeOGR(meuse[1:10, ], "PG:dbname=postgis", "meuse3", "PostgreSQL") :  
     124  No such driver: PostgreSQL 
     125}}} 
     126All examples which do not imply postgres work 
     127{{{ 
     128logo <- system.file("pictures/logo.jpg", package="rgdal")[1] 
     129x <- new("GDALReadOnlyDataset", logo) 
     130x 
     131getDriverLongName(getDriver(x)) 
     132displayDataset(x) 
     133ogrDrivers() 
     134dsn <- system.file("vectors", package = "rgdal")[1] 
     135ogrInfo(dsn=dsn, layer="cities") 
     136cities <- readOGR(dsn=dsn, layer="cities") 
     137summary(cities) 
     138ogrInfo(dsn=dsn, layer="kiritimati_primary_roads") 
     139kiritimati_primary_roads <- readOGR(dsn=dsn, layer="kiritimati_primary_roads") 
     140summary(kiritimati_primary_roads) 
     141ogrInfo(dsn=dsn, layer="scot_BNG") 
     142scot_BNG <- readOGR(dsn=dsn, layer="scot_BNG") 
     143summary(scot_BNG) 
     144if ("GML" %in% ogrDrivers()$name) { 
     145        dsn <- system.file("vectors/airports.gml", package = "rgdal")[1] 
     146        airports <- try(readOGR(dsn=dsn, layer="airports")) 
     147        if (class(airports) != "try-error") summary(airports) 
     148} 
     149dsn <- system.file("vectors/ps_cant_31.MIF", package = "rgdal")[1] 
     150ogrInfo(dsn=dsn, layer="ps_cant_31") 
     151ps_cant_31 <- readOGR(dsn=dsn, layer="ps_cant_31") 
     152summary(ps_cant_31) 
     153dsn <- system.file("vectors/Up.tab", package = "rgdal")[1] 
     154ogrInfo(dsn=dsn, layer="Up") 
     155Up <- readOGR(dsn=dsn, layer="Up") 
     156summary(Up) 
     157dsn <- system.file("vectors/test_trk2.gpx", package = "rgdal")[1] 
     158test_trk2 <- try(readOGR(dsn=dsn, layer="tracks")) 
     159if (class(test_trk2) != "try-error") summary(test_trk2) 
     160test_trk2pts <- try(readOGR(dsn=dsn, layer="track_points")) 
     161if (class(test_trk2pts) != "try-error") summary(test_trk2pts) 
     162dsn <- system.file("vectors", package = "rgdal")[1] 
     163ogrInfo(dsn=dsn, layer="trin_inca_pl03") 
     164birds <- readOGR(dsn=dsn, layer="trin_inca_pl03") 
     165summary(birds) 
     166}}} 
     167mmmh ... and PostgreSQL in not listed in ogrDrivers() 
     168{{{ 
     169ogrDrivers() 
     170}}} 
    116171 
    117172