<div dir="ltr"><div><div><div><div><div><div><div>Hello again, <br><br></div>I come back to this thread beacuse the issue was solved for readVECT, but I now realize (when trying to write vectors back into GRASS after some processing in R) that writeVECT shows the same problem, i.e. the only driver working is ESRI Shapefile (all smooth, no errors), but driver = "SQLite" throws the same error as reported for readVECT at the begining of this thread. Would it be possible to fix also writeVECT?<br><br></div>Here an example:<br><br>> library(rgrass7)<br>Loading required package: sp<br>Loading required package: XML<br>GRASS GIS interface loaded with GRASS version: GRASS 7.3.svn (2017)<br>and location: eu_laea</div><div><br></div><div></div><div>> bbox <- readVECT("bbox_greece", driver = "SQLite")<br>WARNING: No attribute table found -> using only category numbers as attributes<br>Exporting 1 area (may take some time)...<br> 100%<br>v.out.ogr complete. 1 feature (Polygon type) written to <bbox_greece><br>(SQLite format).<br>OGR data source with driver: SQLite <br>...<br>WARNING: No attribute table found -> using only category numbers as attributes<br>Exporting 1 area (may take some time)...<br> 100%<br>v.out.ogr complete. 1 feature (Polygon type) written to <bbox_greece><br>(SQLite format).<br><br>> writeVECT(bbox, "bbox_from_R", driver = "SQLite")<br>Error: driver %in% candDrivers is not TRUE<br><br>> writeVECT(bbox, "bbox_from_R", driver = "ESRI Shapefile")<br></div>... all goes fine...<br><br></div>Sorry for bothersome and thanks much in advance!<br><br></div>best, <br></div>Vero<br><br></div>ps: sessionInfo() and ogrDrivers() are the same as before.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-11 15:03 GMT+02:00 Roger Bivand <span dir="ltr"><<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, thanks, will revise at next release.<div class="HOEnZb"><div class="h5"><br>
<br>
Roger<br>
<br>
On Wed, 11 Oct 2017, Markus Metz wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Roger,<br>
<br>
On Wed, Oct 11, 2017 at 2:36 PM, Roger Bivand <<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dear Markus,<br>
<br>
I can't see how to get the same strings out without conditioning,<br>
</blockquote>
<br>
with<br>
<br>
ogrDGRASSs <- gsub(" ", "_", trimws(sapply(strsplit(ogrDGRA<wbr>SS, " [(]"),<br>
"[", 1)))<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
because for v.in.ogr -f and GDAL >= 2.0, GRASS < 7.3 presents for example:<br>
<br>
GML (rw): GML<br>
SQLite (rw): SQLite<br>
ESRI Shapefile (rw): ESRI Shapefile<br>
GeoJSON (rw): GeoJSON<br>
<br>
(readOGR used the string following ":" )<br>
</blockquote>
<br>
The structure of the output of r.in.gdal -f and v.in.ogr -f is<br>
<br>
<short name> (<read/write flags>): <description><br>
<br>
readOGR must use the string preceding "(". Anything following ":" is a<br>
description which can change any time. Before GDAL 2.0, there was nothing<br>
else but the short name for OGR drivers, therefore the short name was used<br>
as description.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
and >= 7.3:<br>
<br>
GML (rw+): Geography Markup Language (GML)<br>
SQLite (rw+): SQLite / Spatialite<br>
ESRI Shapefile (rw+): ESRI Shapefile<br>
GeoJSON (rw+): GeoJSON<br>
<br>
where the string after ":" is different.<br>
</blockquote>
<br>
the string before the read/write flags, i.e. before "(" is identical.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If we can depend on all GRASS < 7.3 having the same short name position,<br>
</blockquote>
yes, I could avoid conditioning by changing the string processing to suit<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
= 7.3 and apply it to all previous; I chose not to modify the string<br>
</blockquote>
processing for < 7.3 to avoid any problems I can't readily check.<br>
<br>
For all versions of GRASS 7 and all versions of GDAL, the short name<br>
position has been and continues to be the first position. For v.in.ogr -f,<br>
the short name may also appear after ":", but only if there is no long name.<br>
<br>
Best regards,<br>
<br>
Markus<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best wishes,<br>
<br>
Roger<br>
<br>
<br>
On Wed, 11 Oct 2017, Markus Metz wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Roger,<br>
<br>
On Wed, Oct 11, 2017 at 1:41 PM, Roger Bivand <<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>><br>
</blockquote></blockquote>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
New version submitted to CRAN; until then:<br>
<br>
install.packages("rgrass7", repos="<a href="http://R-Forge.R-project.org" rel="noreferrer" target="_blank">http://R-Forge.R-projec<wbr>t.org</a>")<br>
<br>
should pick up the latest version; #3425 closed. Please report back<br>
</blockquote>
<br>
whether this works ... (conditioning on GRASS version to create<br>
</blockquote></blockquote>
comparable<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
driver name strings).<br>
<br>
I don't think there is a need to condition on the GRASS version, see my<br>
suggestion in #3425<br>
<br>
Markus M<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Roger<br>
<br>
<br>
On Wed, 11 Oct 2017, Roger Bivand wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for trying to contribute. The GH site is not the rgrass7<br>
</blockquote></blockquote>
<br>
development site - that is SVN on R-forge (GH is a very preliminary trial<br>
site for using sf vector representation in R, and maybe raster raster<br>
representation (or forthcoming stars), instead of sp classes).<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
GRAS 7.2.2 works OK with the current logic checks; I can reproduce the<br>
</blockquote></blockquote>
<br>
issue in 7.3 (latest); there is a change in vector/v.in.ogr/main.c<br>
returning the DriverLongName for GDAL >= 2.0; in GRASS 7.2.2, there is no<br>
such change. Could the GRASS developer responsible for this obvious<br>
regression provide an additional flag in v.in.ogr (and v.external,<br>
v.out.ogr) to permit backwards compatibility? See line 387, needs to<br>
</blockquote></blockquote>
change<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
#if GDAL_VERSION_NUM >= 2000000<br>
<br>
to add a !backwards_compatible test too.<br>
<br>
I'll hold off trying to fix this in rgrass7 because it is a regression.<br>
</blockquote></blockquote>
<br>
I can add the backwards_compatibility=TRUE flag to readVECT() once it is<br>
exposed.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
This is:<br>
<br>
<a href="https://trac.osgeo.org/grass/ticket/3425" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/t<wbr>icket/3425</a><br>
<br>
Roger<br>
<br>
On Tue, 10 Oct 2017, Ahmadou Dicko wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In the readVECT function, internally v.in.ogr is used to list the<br>
</blockquote></blockquote></blockquote>
<br>
supported<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
vector format and it is compared the format available using rgdal (or<br>
</blockquote></blockquote></blockquote>
<br>
sf).<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
However, using v.external instead of v.in.ogr fix this single problem<br>
because of the way the output is different (in form).<br>
For example, if you use v.in.ogr you will have to compare<br>
</blockquote>
<br>
<br>
SQLite_/_Spatialite<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
(GRASS) to SQLite (R) and they are not the same.<br>
<br>
I tried to send a PR, let me know if it works<br>
<br>
<a href="https://github.com/rsbivand/rgrass7/pull/1" rel="noreferrer" target="_blank">https://github.com/rsbivand/rg<wbr>rass7/pull/1</a><br>
<br>
Best,<br>
<br>
On Tue, Oct 10, 2017 at 9:29 PM, Helmut Kudrnovsky <<a href="mailto:hellik@web.de" target="_blank">hellik@web.de</a>><br>
</blockquote></blockquote></blockquote>
<br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Gesendet: Dienstag, 10. Oktober 2017 um 23:24 Uhr<br>
Von: "Ahmadou Dicko" <<a href="mailto:dicko.ahmadou@gmail.com" target="_blank">dicko.ahmadou@gmail.com</a>><br>
An: "Helmut Kudrnovsky" <<a href="mailto:hellik@web.de" target="_blank">hellik@web.de</a>><br>
Cc: "Roger Bivand" <<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>>, "<br>
</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>
<a href="mailto:grass-stats@lists.osgeo.org" target="_blank">grass-stats@lists.osgeo.org</a>"<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="mailto:grass-stats@lists.osgeo.org" target="_blank">grass-stats@lists.osgeo.org</a>><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Betreff: Re: [GRASS-stats] rgrass7 - SQLite and GML drivers not<br>
</blockquote></blockquote></blockquote></blockquote></blockquote>
<br>
working<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
for readVECT<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
Hi everyone,<br>
<br>
I think that using v.external -f (instead of v.in.ogr -f) can fix<br>
</blockquote></blockquote></blockquote></blockquote></blockquote></blockquote></blockquote>
this<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
issue (didn't try yet)<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
<br>
execGRASS("v.external", flags = "f", intern = TRUE)<br>
[1] "ARCGEN"         "AVCBin"         "AVCE00"<br>
[4] "AeronavFAA"     "AmigoCloud"     "BNA"<br>
[7] "CAD"            "CSV"            "CSW"<br>
[10] "Carto"          "Cloudant"       "CouchDB"<br>
[13] "DGN"            "DXF"            "EDIGEO"<br>
[16] "ESRI_Shapefile" "ElasticSearch"  "GFT"<br>
[19] "GML"            "GPKG"           "GPSBabel"<br>
[22] "GPSTrackMaker"  "GPX"            "GeoJSON"<br>
[25] "GeoRSS"         "Geoconcept"     "Geomedia"<br>
[28] "HTF"            "HTTP"           "Idrisi"<br>
[31] "JML"            "JPEG2000"       "KML"<br>
[34] "MSSQLSpatial"   "MapInfo_File"   "Memory"<br>
[37] "MySQL"          "ODBC"           "ODS"<br>
[40] "OGR_GMT"        "OGR_GRASS"      "OGR_PDS"<br>
[43] "OGR_SDTS"       "OGR_VRT"        "OSM"<br>
[46] "OpenAir"        "OpenFileGDB"    "PCIDSK"<br>
[49] "PDF"            "PGDUMP"         "PGeo"<br>
[52] "PLSCENES"       "PostgreSQL"     "REC"<br>
</blockquote>
<br>
<br>
<br>
in a quick check, there is no difference in available formats.<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
--<br>
Roger Bivand<br>
Department of Economics, Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: <a href="tel:%2B47%2055%2095%2093%2055" value="+4755959355" target="_blank">+47 55 95 93 55</a>; e-mail: <a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a><br>
Editor-in-Chief of The R Journal,<br>
</blockquote></blockquote></blockquote>
<a href="https://journal.r-project.org/index.html" rel="noreferrer" target="_blank">https://journal.r-project.org/<wbr>index.html</a><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://orcid.org/0000-0003-2392-6140" rel="noreferrer" target="_blank">http://orcid.org/0000-0003-239<wbr>2-6140</a><br>
<a href="https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en" rel="noreferrer" target="_blank">https://scholar.google.no/cita<wbr>tions?user=AWeghB0AAAAJ&hl=en</a><br>
______________________________<wbr>_________________<br>
grass-stats mailing list<br>
<a href="mailto:grass-stats@lists.osgeo.org" target="_blank">grass-stats@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-stats" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/grass-stats</a><br>
</blockquote>
<br>
<br>
</blockquote>
<br>
--<br>
Roger Bivand<br>
Department of Economics, Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: <a href="tel:%2B47%2055%2095%2093%2055" value="+4755959355" target="_blank">+47 55 95 93 55</a>; e-mail: <a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a><br>
Editor-in-Chief of The R Journal, <a href="https://journal.r-project.org/index.html" rel="noreferrer" target="_blank">https://journal.r-project.org/<wbr>index.html</a><br>
<a href="http://orcid.org/0000-0003-2392-6140" rel="noreferrer" target="_blank">http://orcid.org/0000-0003-239<wbr>2-6140</a><br>
<a href="https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en" rel="noreferrer" target="_blank">https://scholar.google.no/cita<wbr>tions?user=AWeghB0AAAAJ&hl=en</a><br>
</blockquote>
<br>
</blockquote>
<br>
-- <br>
Roger Bivand<br>
Department of Economics, Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: <a href="tel:%2B47%2055%2095%2093%2055" value="+4755959355" target="_blank">+47 55 95 93 55</a>; e-mail: <a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a><br>
Editor-in-Chief of The R Journal, <a href="https://journal.r-project.org/index.html" rel="noreferrer" target="_blank">https://journal.r-project.org/<wbr>index.html</a><br>
<a href="http://orcid.org/0000-0003-2392-6140" rel="noreferrer" target="_blank">http://orcid.org/0000-0003-239<wbr>2-6140</a><br>
<a href="https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en" rel="noreferrer" target="_blank">https://scholar.google.no/cita<wbr>tions?user=AWeghB0AAAAJ&hl=en</a><br>
______________________________<wbr>_________________<br>
grass-stats mailing list<br>
<a href="mailto:grass-stats@lists.osgeo.org" target="_blank">grass-stats@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-stats" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/grass-stats</a></div></div></blockquote></div><br></div>