Skip to content

Commit

Permalink
address #53 (comment)
Browse files Browse the repository at this point in the history
Signed-off-by: Edzer Pebesma <edzer.pebesma@uni-muenster.de>
  • Loading branch information
edzer committed Nov 7, 2016
1 parent c9d00b6 commit 6996b05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,24 +256,24 @@ st_list = function(dsn, options = character(0), do_count = FALSE) {

guess_driver = function(dsn) {
ext_map <- matrix (c(
"bna", "BNA",
"csv", "CSV",
"e00", "AVCE00",
"geojson","GeoJSON",
"gml", "GML",
"gpkg", "GPKG",
"gps", "GPSBabel",
"gtm", "GPSTrackMaker",
"gxt", "Geoconcept",
"jml", "JML",
"map", "WAsP",
"nc", "netCDF",
"osm", "OSM", # NO WRITE
"pbf", "OSM", # NO WRITE
"shp", "ESRI Shapefile",
"bna", "BNA",
"csv", "CSV",
"gml", "GML",
"jml", "JML",
"ods", "ODS",
"xlsx", "XLSX",
"vdv", "VDV"
"osm", "OSM",
"pbf", "OSM",
"shp", "ESRI Shapefile",
"vdv", "VDV",
"xlsx", "XLSX"
),
ncol = 2, byrow = TRUE)
drv = ext_map[,2]
Expand All @@ -286,6 +286,6 @@ guess_driver = function(dsn) {
if (is.na(i))
stop(paste("guess_driver:", drv, "not available in supported drivers, see `st_drivers()'"))
if (! drivers[i, "write"])
warning(paste("guess_driver", drv, "is available but reports it will not allow writing"))
stop(paste("Driver", drv, "has no write capability, see `st_drivers()'"))
drv
}
4 changes: 2 additions & 2 deletions tests/gdal_geom.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ LINESTRING(1 3, 2 4)
[1] 1
>
> st_length(st_polygon(list(rbind(c(0,0), c(1,0), c(1,1), c(0,1), c(0,0)))))
[1] NA
[1] 0
>
> st_area(st_multilinestring(list(rbind(c(0,0),c(0,1)))))
[1] 0
Expand All @@ -348,4 +348,4 @@ MULTILINESTRING((0 0, 0.5 0.5), (0.5 0.5, 1 1),...
>
> proc.time()
user system elapsed
0.680 0.276 0.648
0.700 0.248 0.657

0 comments on commit 6996b05

Please sign in to comment.