0

Using QGIS 3.4.3 I'm trying to carry out a simple v.transform task shifting x and y

enter image description here

But I'm receiving the following errors - and output shapefile is empty.

Processing algorithm… Algorithm 'v.transform' starting… Input parameters: { 'GRASS_MIN_AREA_PARAMETER' : 0.0001, 'GRASS_OUTPUT_TYPE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'GRASS_SNAP_TOLERANCE_PARAMETER' : -1, 'GRASS_VECTOR_DSCO' : '', 'GRASS_VECTOR_LCO' : '', 'columns' : '', 'input' : QgsProcessingFeatureSourceDefinition('RoadFinal_ce6c469a_bd38_4498_9c33_4ebd2334b9c4', True), 'output' : 'D:/Arma/QGIS/Roads/new/test.shp', 'xscale' : 1, 'xshift' : -2119.310423, 'yscale' : 1, 'yshift' : -8526.938256, 'zrotation' : 0, 'zscale' : 1, 'zshift' : 0 }

g.proj -c proj4="+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs" v.in.ogr min_area=0.0001 snap=-1.0 input="C:\Users\rosso\AppData\Local\Temp\processing_b34ad6177ba34e0c9caccac6844ce8d2\19f8b29a97494768ad806acfd1c428b0\input.shp" output="vector_5c462f6262e243" --overwrite -o g.region n=29811.368806123734 s=8526.93825612031 e=238436.91262336614 w=202119.31042263084 v.transform input=vector_5c462f6262e243 xshift=-2119.310423 yshift=-8526.938256 zshift=0 xscale=1 yscale=1 zscale=1 zrotation=0 output=output6ea89d308d8740d8ae5b354f70942c1e
--overwrite v.out.ogr -c type="auto" input="output6ea89d308d8740d8ae5b354f70942c1e" output="D:\Arma\QGIS\Roads\new\test.shp" format="ESRI_Shapefile"
--overwrite Starting GRASS GIS...
**WARNING: Concurrent mapset locking is not supported on Windows** Executing <C:\Users\rosso\AppData\Local\Temp\processing_b34ad6177ba34e0c9caccac6844ce8d2\grassdata\grass_batch_job.cmd> ... F:\OSGEO4~1\bin>chcp 1252 1>NUL F:\OSGEO4~1\bin>g.proj -c proj4="+proj=utm +zone=31 +datum=WGS84 +units=m +no_defs" Default region was updated to the new projection, but if you have multiple mapsets `g.region -d` should be run in each to update the region from the default Projection information updated F:\OSGEO4~1\bin>v.in.ogr min_area=0.0001 snap=-1.0 input="C:\Users\rosso\AppData\Local\Temp\processing_b34ad6177ba34e0c9caccac6844ce8d2\19f8b29a97494768ad806acfd1c428b0\input.shp" output="vector_5c462f6262e243" --overwrite -o DBMI-SQLite driver error: Error in sqlite3_prepare(): near "ORDER": syntax error Over-riding projection check Check if OGR layer <input> contains polygons...
0..2..4..6..8..10..12..14..16..18..20..22..24..26..28..30..32..34..36..38..40..42..44..46..48..50..52..54..56..58..60..62..64..66..68..70..72..74..76..78..80..82..84..86..88..90..92..94..96..98..100 Creating attribute table for layer <input>... DBMI-SQLite driver error: Error in sqlite3_prepare(): near "ORDER": syntax error
**ERROR: Unable to create table: 'create table vector_5c462f6262e243 (cat integer, ID integer, ORDER integer)'** F:\OSGEO4~1\bin>g.region n=29811.368806123734 s=8526.93825612031 e=238436.91262336614 w=202119.31042263084 F:\OSGEO4~1\bin>v.transform input=vector_5c462f6262e243 xshift=-2119.310423 yshift=-8526.938256 zshift=0 xscale=1 yscale=1 zscale=1 zrotation=0 output=output6ea89d308d8740d8ae5b354f70942c1e --overwrite DBMI-SQLite driver error: Error in sqlite3_prepare(): select * from vector_5c462f6262e243 where 0 = 1 no such table: vector_5c462f6262e243
**WARNING: Coor file of vector map <vector_5c462f6262e243@PERMANENT> is larger than it should be (18 bytes excess)** Transforming features... Copying attributes... DBMI-SQLite driver error: Error in sqlite3_prepare(): select * from vector_5c462f6262e243 where 0 = 1 no such table: vector_5c462f6262e243
**WARNING: Unable to open select cursor: 'select * from vector_5c462f6262e243 where 0 = 1' WARNING: Unable to copy table <output6ea89d308d8740d8ae5b354f70942c1e> WARNING: Unable to copy table <vector_5c462f6262e243> for layer 1 from <vector_5c462f6262e243@PERMANENT> to <output6ea89d308d8740d8ae5b354f70942c1e> WARNING: Failed to copy attribute table to output map Building topology for vector map** <output6ea89d308d8740d8ae5b354f70942c1e@PERMANENT>... Registering primitives... 0 primitives registered 0 vertices registered Building areas... 100 0 areas built 0 isles built Attaching islands... Attaching centroids... Number of nodes: 0 Number of primitives: 0 Number of points: 0 Number of lines: 0 Number of boundaries: 0 Number of centroids: 0 Number of areas: 0 Number of isles: 0 v.transform complete. F:\OSGEO4~1\bin>v.out.ogr -c type="auto" input="output6ea89d308d8740d8ae5b354f70942c1e" output="D:\Arma\QGIS\Roads\new\test.shp" format="ESRI_Shapefile"
--overwrite
**WARNING: Unable to determine input map's vector feature type(s).** DBMI-SQLite driver error: Error in sqlite3_prepare(): select * from output6ea89d308d8740d8ae5b354f70942c1e where oid < 0 no such table: output6ea89d308d8740d8ae5b354f70942c1e
**ERROR: Unable to describe table <output6ea89d308d8740d8ae5b354f70942c1e>** DBMI-SQLite driver error: Error in sqlite3_prepare(): select * from output6ea89d308d8740d8ae5b354f70942c1e where oid < 0 no such table: output6ea89d308d8740d8ae5b354f70942c1e F:\OSGEO4~1\bin>exit Execution of <C:\Users\rosso\AppData\Local\Temp\processing_b34ad6177ba34e0c9caccac6844ce8d2\grassdata\grass_batch_job.cmd> finished. Cleaning up temporary files... Press any key to continue . . . Execution completed in 1.38 seconds Results: {'output': <QgsProcessingOutputLayerDefinition {'sink':D:/Arma/QGIS/Roads/new/test.shp, 'createOptions': {'fileEncoding': 'System'}}>}

Loading resulting layers Algorithm 'v.transform' finished
  • Thanks you so much for the level of detail in your response. It got me thinking that I might need to copy the features out of source shapefile into a fresh new shapefile - so that I can set a UTM CRS. then carry out v.transform on that. – Rossoe Jan 22 at 2:07
  • An alternative option would be to use the qgis processing tool "translate", which does the same thing but works directly with QGIS layers, so no issues with conversion to GRASS formats. – ndawson Jan 22 at 9:56
  • I think translate is only available for raster – Rossoe Jan 23 at 20:24
  • No - it's available for vector. Processing Toolbox, Vector Geometry, Translate. – ndawson Jan 23 at 23:17
  • Please don't add "thank you" as an answer. Instead, accept the answer that you found most helpful. - From Review – BERA Apr 29 at 6:56
1

**WARNING: Concurrent mapset locking is not supported on Windows** is not an error, is a warning.

All GRASS algorithms that are run from QGIS in Windows return that warning. But algorithms alone do not try to lock the mapset concurrently, so you should not worry about that.


In your case, the error is being generated by SQLite, which is the GRASS default database engine:

v.in.ogr min_area=0.0001 snap=-1.0 input="C:\Users\rosso\AppData\Local\Temp\processing_b34ad6177ba34e0c9caccac6844ce8d2\19f8b29a97494768ad806acfd1c428b0\input.shp" output="vector_5c462f6262e243" --overwrite -o

returns
DBMI-SQLite driver error: Error in sqlite3_prepare(): near "ORDER": syntax error
and
Creating attribute table for layer <input>... DBMI-SQLite driver error: Error in sqlite3_prepare(): near "ORDER": syntax error
and
**ERROR: Unable to create table: 'create table vector_5c462f6262e243 (cat integer, ID integer, ORDER integer)'**

v.in.ogr is trying to import the shapefile to a GRASS layer, but can't read nor write the table. This is because there seems to be a column called "ORDER", since ORDER is a restricted term in SQL, which causes a syntax error.

From there, all the commands that the algorithm runs are failing, which is to be expected because the layer table could not be written.

Therefore, if you have a column in the table of your shapefile with a name restricted by SQL, changing the name of that column would be the solution.

If that were not the case, feel free to comment on this answer and we will continue to find a solution to the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.