[GRASS-dev] [GRASS GIS] #3425: regression in v.in.ogr -f 7.3 7 Oct (possibly earlier)

GRASS GIS trac at osgeo.org
Wed Oct 11 05:07:18 PDT 2017


#3425: regression in v.in.ogr -f 7.3 7 Oct (possibly earlier)
--------------------------+-------------------------
  Reporter:  rsbivand     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  closed
  Priority:  major        |  Milestone:
 Component:  Vector       |    Version:  svn-trunk
Resolution:  fixed        |   Keywords:
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by mmetz):

 Replying to [comment:5 rsbivand]:
 > Regression resolved with revision 61:
 >
 > {{{
 >     gv <- unname(read.dcf(textConnection(gsub("=", ":",
 >       execGRASS("g.version", flags="g", intern=TRUE))))[1,1])
 >     if (gv < "7.3") {
 >       ogrDGRASSs <- gsub(" ", "_", sapply(strsplit(ogrDGRASS, ": "),
 "[", 2))
 >     } else {
 >       strs <- sapply(strsplit(ogrDGRASS, ": "), "[", 1)
 >       ogrDGRASSs <- gsub(" ", "_", gsub(" $", "",
 >         substring(strs, 2, nchar(strs)-5)))
 >     }
 > }}}

 Why not
 {{{
       ogrDGRASSs <- gsub(" ", "_", trimws(sapply(strsplit(ogrDGRASS, "
 [(]"), "[", 1)))
 }}}

 which works with all versions?

 This would also work with `r.in.gdal -f`. The outputs of `r.in.gdal -f`
 and `v.in.ogr -f` already have the same structure (also in GRASS 7.2),
 independent of the GDAL version used.

 Starting with GDAL 2.0, the outputs of `gdalinfo --formats` and `ogrinfo
 --formats` also have the same structure.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3425#comment:7>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list