<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Dear devs,</p>
<p>The function getLocationProj returns an spproj-compliant PROJ.4
string of projection information (using internally <i>g.proj -jf</i>).
However, when writing a vector layer to the grass database using
the writeVECT function, it (expects the projection information in
the format returned by <i>g.proj -g</i> (checking the code, this
is because it uses v.in.ogr I guess).<br>
</p>
For example, if running R from within a grass session with the NC
location: I have a vector layer "klatifolia" in latlong which I
project it to match the projection of the NC location. Next, I write
it to the grass database using writeVECT:<br>
<br>
proj <- getLocationProj()<br>
KLnew <- spTransform(KL, proj)<br>
writeVECT(SDF=KLnew[,c(1,2,5)], vname="KLatifolia", driver="SQLite")<br>
<br>
This results in an error telling that the projection of dataset does
not appear to match current location.<br>
<p> Location PROJ_INFO is:<br>
name: Lambert Conformal Conic<br>
proj: lcc<br>
datum: nad83<br>
a: 6378137.0<br>
es: 0.006694380022900787<br>
lat_1: 36.16666666666666<br>
lat_2: 34.33333333333334<br>
lat_0: 33.75<br>
lon_0: -79<br>
x_0: 609601.22<br>
y_0: 0<br>
no_defs: defined<br>
<br>
Dataset PROJ_INFO is:<br>
name: unnamed<br>
ellps: grs80<br>
proj: lcc<br>
lat_1: 36.16666666666666<br>
lat_2: 34.33333333333334<br>
lat_0: 33.75<br>
lon_0: -79<br>
x_0: 609601.22<br>
y_0: 0<br>
towgs84: 0,0,0,0,0,0,0<br>
no_defs: defined<br>
<br>
ERROR: datum<br>
</p>
I can obviously run writeVECT with v.in.ogr_flags="o", but is there
a way that writeVECT can check against the spproj-compliant proj.4
string? Or is this something that should be dealt with at the
v.in.ogr side?<br>
<br>
Best wishes,<br>
<br>
Paulo<br>
<br>
<br>
sessionInfo()<br>
R version 3.4.4 (2018-03-15)<br>
Platform: x86_64-pc-linux-gnu (64-bit)<br>
Running under: Ubuntu 18.04.1 LTS<br>
<br>
Matrix products: default<br>
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1<br>
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1<br>
<br>
locale:<br>
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=en_US.UTF-8 <br>
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8 <br>
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
LC_ADDRESS=C <br>
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=C <br>
<br>
attached base packages:<br>
[1] stats graphics grDevices utils datasets methods
base <br>
<br>
other attached packages:<br>
[1] ggplot2_3.0.0 mapr_0.4.0 raster_2.6-7 rgrass7_0.1-11
XML_3.98-1.12 maptools_0.9-3<br>
[7] sp_1.3-1 rgbif_1.0.2 <br>
<br>
<br>
<br>
<br>
<br>
<br>
<p><br>
</p>
<p><br>
</p>
</body>
</html>