**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:UsersrossoAppDataLocalTempprocessing_b34ad6177ba34e0c9caccac6844ce8d219f8b29a97494768ad806acfd1c428b0input.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.
Author Name: Jürgen Fischer (@jef-n)
- description was changed from In continuation of Bug report QGIS 3.2.3 Bonn and GRASS 7. r.texture does not provide any output. #27967,
QGIS 3.4 Madeira and GRASS 7. r.texture does not provide any output. Not in temp, not in user defined folder.
I have tried the function in Windows 10 64bit. On the same systems, QGIS 2.18 provided the outputs fine.
LOG outputs are like this:
Suspicious message «r was unexpected at this time.»
@Algorithm ‘r.texture’ starting…
Input parameters:
{ ‘-a’ : False, ‘-s’ : False, ‘GRASS_REGION_CELLSIZE_PARAMETER’ : 0, ‘GRASS_REGION_PARAMETER’ : None, ‘distance’ : 1, ‘input’ : ‘C:/Users/…/asdf.tif’, ‘method’ : [0], ‘output’ : ‘C:Users…TESTFOLDERqw’, ‘size’ : 3 }
r.external input=»C:Users…asdf.tif» band=1 output=»rast_5bd897a9cae473″ —overwrite -o
g.region n=… s=… e=… w=… res=0.0891700128040893
r.texture input=rast_5bd897a9cae473 method=»asm» size=3 distance=1 output=outputbf78f3ac0afc498ca24722f3e2ee97ec —overwrite
for r in $(g.list type=rast pattern=’outputbf78f3ac0afc498ca24722f3e2ee97ec*’); do
r.out.gdal -m -t input=${r} output=C:Users…TESTFOLDERqw/${r}.tif —overwrite -c createopt=»TFW=YES,COMPRESS=LZW»
done
Starting GRASS GIS…
WARNING: Concurrent mapset locking is not supported on Windows
Executing <C:Users…AppDataLocalTempprocessing_99d8c583f2914262bb9d62de6da82492grassdatagrass_batch_job.cmd> …
C:OSGEO4~1bin>chcp 1252 1>NUL
C:OSGEO4~1bin>r.external input=»C:Users…DesktopQGIS_BARESOIL_2018TESTFOLDERasdf.tif» band=1 output=»rast_5bd897a9cae473″ —overwrite -o
Over-riding projection check
Reading band 1 of 1…
r.external complete. Link to raster map <rast_5bd897a9cae473> created.
C:OSGEO4~1bin>g.region n=… s=… e=… w=… res=0.0891700128040893
C:OSGEO4~1bin>r.texture input=rast_5bd897a9cae473 method=»asm» size=3 distance=1 output=outputbf78f3ac0afc498ca24722f3e2ee97ec —overwrite
Reading raster map…
Calculating Angular Second Moment…
2..5..8..11..14..17..20..23..26..29..32..35..38..41..44..47..50..53..56..59..62..65..68..71..74..77..80..83..86..89..92..95..98..100
r was unexpected at this time.
C:OSGEO41bin>for r in $(g.list type=rast pattern=’outputbf78f3ac0afc498ca24722f3e2ee97ec*’); do
Execution of <C:Users…AppDataLocalTempprocessing_99d8c583f2914262bb9d62de6da82492grassdatagrass_batch_job.cmd> finished.
Cleaning up temporary files…
Press any key to continue . . .
Traceback (most recent call last):
File «C:/OSGEO41/apps/qgis/./python/pluginsprocessingalgsgrass7Grass7Algorithm.py», line 411, in processAlgorithm
Grass7Utils.executeGrass(self.commands, feedback, self.outputCommands)
File «C:/OSGEO41/apps/qgis/./python/pluginsprocessingalgsgrass7Grass7Utils.py», line 399, in executeGrass
startupinfo=si if isWindows() else None
File «C:OSGEO41appsPython37libsubprocess.py», line 756, in init
restore_signals, start_new_session)
File «C:OSGEO4~1appsPython37libsubprocess.py», line 1155, in _execute_child
startupinfo)
OSError: [WinError 87] The parameter is incorrect
Execution failed after 14.01 seconds
Loading resulting layers
Algorithm ‘r.texture’ finished
@
From the history in QGIS 3.4 FAILURE:
@processing.run(«grass7:r.texture», {‘input’:’C:/Users/…/asdf.tif’,’method’:[0],’size’:3,’distance’:1,’-s’:False,’-a’:False,’output’:’C:Users…TESTFOLDERqw’,’GRASS_REGION_PARAMETER’:None,’GRASS_REGION_CELLSIZE_PARAMETER’:0})@
From the history in QGIS 2.18.25 SUCCESS:
processing.runalg(«grass7:r.texture»,»C:/Users/…/asdf.tif»,»asm»,3,1,False,False,»…,…,…,…»,»C:Users…TESTFOLDERqw») to In continuation of Bug report #27967,
QGIS 3.4 Madeira and GRASS 7. r.texture does not provide any output. Not in temp, not in user defined folder.
I have tried the function in Windows 10 64bit. On the same systems, QGIS 2.18 provided the outputs fine.
LOG outputs are like this:
Suspicious message «r was unexpected at this time.»
Algorithm 'r.texture' starting… Input parameters: { '-a' : False, '-s' : False, 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'distance' : 1, 'input' : 'C:/Users/…/asdf.tif', 'method' : [0], 'output' : 'C:\Users\...\TESTFOLDER\qw', 'size' : 3 } r.external input="C:Users...asdf.tif" band=1 output="rast_5bd897a9cae473" --overwrite -o g.region n=… s=… e=… w=… res=0.0891700128040893 r.texture input=rast_5bd897a9cae473 method="asm" size=3 distance=1 output=outputbf78f3ac0afc498ca24722f3e2ee97ec --overwrite for r in $(g.list type=rast pattern='outputbf78f3ac0afc498ca24722f3e2ee97ec*'); do r.out.gdal -m -t input=${r} output=C:Users...TESTFOLDERqw/${r}.tif --overwrite -c createopt="TFW=YES,COMPRESS=LZW" done Starting GRASS GIS... WARNING: Concurrent mapset locking is not supported on Windows Executing ... C:OSGEO4~1bin>chcp 1252 1>NUL C:OSGEO4~1bin>r.external input="C:Users...DesktopQGIS_BARESOIL_2018TESTFOLDERasdf.tif" band=1 output="rast_5bd897a9cae473" --overwrite -o Over-riding projection check Reading band 1 of 1... r.external complete. Link to raster map created. C:OSGEO4~1bin>g.region n=… s=… e=… w=… res=0.0891700128040893 C:OSGEO4~1bin>r.texture input=rast_5bd897a9cae473 method="asm" size=3 distance=1 output=outputbf78f3ac0afc498ca24722f3e2ee97ec --overwrite Reading raster map... Calculating Angular Second Moment... 2..5..8..11..14..17..20..23..26..29..32..35..38..41..44..47..50..53..56..59..62..65..68..71..74..77..80..83..86..89..92..95..98..100 r was unexpected at this time. C:OSGEO4~1bin>for r in $(g.list type=rast pattern='outputbf78f3ac0afc498ca24722f3e2ee97ec*'); do Execution of finished. Cleaning up temporary files... Press any key to continue . . . Traceback (most recent call last): File "C:/OSGEO4~1/apps/qgis/./python/pluginsprocessingalgsgrass7Grass7Algorithm.py", line 411, in processAlgorithm Grass7Utils.executeGrass(self.commands, feedback, self.outputCommands) File "C:/OSGEO4~1/apps/qgis/./python/pluginsprocessingalgsgrass7Grass7Utils.py", line 399, in executeGrass startupinfo=si if isWindows() else None File "C:OSGEO4~1appsPython37libsubprocess.py", line 756, in __init__ restore_signals, start_new_session) File "C:OSGEO4~1appsPython37libsubprocess.py", line 1155, in _execute_child startupinfo) OSError: [WinError 87] The parameter is incorrect Execution failed after 14.01 seconds Loading resulting layers Algorithm 'r.texture' finished
From the history in QGIS 3.4 FAILURE:
processing.run("grass7:r.texture", {'input':'C:/Users/.../asdf.tif','method':[0],'size':3,'distance':1,'-s':False,'-a':False,'output':'C:\Users\...\TESTFOLDER\qw','GRASS_REGION_PARAMETER':None,'GRASS_REGION_CELLSIZE_PARAMETER':0})
From the history in QGIS 2.18.25 SUCCESS:
processing.runalg("grass7:r.texture","C:/Users/.../asdf.tif","asm",3,1,False,False,"...,...,...,...","C:\Users\...\TESTFOLDER\qw")
Форумы GIS-Lab.info
Геоинформационные системы (ГИС) и Дистанционное зондирование Земли
-
OlegPrs
- Интересующийся
- Сообщения: 19
- Зарегистрирован: 05 фев 2019, 05:17
- Репутация: 1
- Откуда: Украина
ERROR 6 in GRASS r.neightbors
Всем привет! Мучаюсь с проблемой в GRASSе, хотел применить фильтр для классифицированного снимка S2 — r.neightbors, причем классификацию проводил в SCP. Начал он мне ругаться
Код: Выделить всё
ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.
Попробовал поменять формат в gdal_translate на Byte и UInt16, не помогло, пустой растр выходит.
-
gamm
- Гуру
- Сообщения: 3822
- Зарегистрирован: 15 окт 2010, 08:33
- Репутация: 996
- Ваше звание: программист
- Откуда: Казань
Re: ERROR 6 in GRASS r.neightbors
Сообщение
gamm » 23 авг 2019, 06:51
все строки скрипта покажите, какой фильтр и на что SetColorTable() напускали, там случаем не результат усреднения после фильтра? Этот фильтр r.neighbors вроде вообще не для классификации
-
OlegPrs
- Интересующийся
- Сообщения: 19
- Зарегистрирован: 05 фев 2019, 05:17
- Репутация: 1
- Откуда: Украина
Re: ERROR 6 in GRASS r.neightbors
Сообщение
OlegPrs » 23 авг 2019, 07:21
Полный лог
Код: Выделить всё
Выполняется алгоритм…
Algorithm 'r.neighbors' starting…
Входные параметры:
{ '-a' : False, '-c' : False, 'GRASS_RASTER_FORMAT_META' : '', 'GRASS_RASTER_FORMAT_OPT' : '', 'GRASS_REGION_CELLSIZE_PARAMETER' : 0, 'GRASS_REGION_PARAMETER' : None, 'gauss' : 0, 'input' : 'C:/Users/BoR/Desktop/Chernobyl/Satellite/S2/EE/MultispecS2/ExtentChEZ/Result/Classification/Result/1MinDist.tif', 'method' : 2, 'output' : 'C:/Users/BoR/AppData/Local/Temp/processing_5f0f4ec965d9431fbc778094203c5ee1/11fada24e7944c1d8715a5c77b283361/output.tif', 'quantile' : '', 'selection' : None, 'size' : 7, 'weight' : '' }
g.proj -c proj4="+proj=utm +zone=35 +datum=WGS84 +units=m +no_defs"
r.external input="C:UsersBoRDesktopChernobylSatelliteS2EEMultispecS2ExtentChEZResultClassificationResult1MinDist.tif" band=1 output="rast_5d5f699786dd02" --overwrite -o
g.region n=5714910.0 s=5661530.0 e=749310.0 w=657260.0 res=10.0
r.neighbors input=rast_5d5f699786dd02 method="mode" size=7 gauss=0 output=outpute7ef6ec9004c4f9abde083980912729e --overwrite
g.region raster=outpute7ef6ec9004c4f9abde083980912729e
r.out.gdal -t -m input="outpute7ef6ec9004c4f9abde083980912729e" output="C:UsersBoRAppDataLocalTempprocessing_5f0f4ec965d9431fbc778094203c5ee111fada24e7944c1d8715a5c77b283361output.tif" format="GTiff" createopt="TFW=YES,COMPRESS=LZW" --overwrite
Starting GRASS GIS...
ПРЕДУПРЕЖДЕНИЕ: Concurrent mapset locking is not supported on Windows
Executing <C:UsersBoRAppDataLocalTempprocessing_5f0f4ec965d9431fbc778094203c5ee1grassdatagrass_batch_job.cmd> ...
C:WindowsSystem32>chcp 1251 1>NUL
C:WindowsSystem32>g.proj -c proj4="+proj=utm +zone=35 +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
C:WindowsSystem32>r.external input="C:UsersBoRDesktopChernobylSatelliteS2EEMultispecS2ExtentChEZResultClassificationResult1MinDist.tif" band=1 output="rast_5d5f699786dd02" --overwrite -o
Over-riding projection check
Reading band 1 of 1...
r.external завершен. Link to raster map <rast_5d5f699786dd02> created.
C:WindowsSystem32>g.region n=5714910.0 s=5661530.0 e=749310.0 w=657260.0 res=10.0
C:WindowsSystem32>r.neighbors input=rast_5d5f699786dd02 method="mode" size=7 gauss=0 output=outpute7ef6ec9004c4f9abde083980912729e --overwrite
0..3..6..9..12..15..18..21..24..27..30..33..36..39..42..45..48..51..54..57..60..63..66..69..72..75..78..81..84..87..90..93..96..99..100
C:WindowsSystem32>g.region raster=outpute7ef6ec9004c4f9abde083980912729e
C:WindowsSystem32>r.out.gdal -t -m input="outpute7ef6ec9004c4f9abde083980912729e" output="C:UsersBoRAppDataLocalTempprocessing_5f0f4ec965d9431fbc778094203c5ee111fada24e7944c1d8715a5c77b283361output.tif" format="GTiff" createopt="TFW=YES,COMPRESS=LZW" --overwrite
ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.
Checking GDAL data type and nodata value...
2..5..8..11..14..17..20..23..26..29..32..35..38..41..44..47..50..53..56..59..62..65..68..71..74..77..80..83..86..89..92..95..98..100
Using GDAL data type <Int32>
Input raster map contains cells with NULL-value (no-data). The value -2147483648 will be used to represent no-data values in the input map. You can specify a nodata value with the nodata option.
Exporting raster data to GTiff format...
2..5..8..11..14..17..20..23..26..29..32..35..38..41..44..47..50..53..56..59..62..65..68..71..74..77..80..83..86..89..92..95..98..100
r.out.gdal завершен. File <C:UsersBoRAppDataLocalTempprocessing_5f0f4ec965d9431fbc778094203c5ee111fada24e7944c1d8715a5c77b283361output.tif> created.
C:WindowsSystem32>exit
Execution of <C:UsersBoRAppDataLocalTempprocessing_5f0f4ec965d9431fbc778094203c5ee1grassdatagrass_batch_job.cmd> finished.
Cleaning up temporary files...
Выполнение завершено за 11.24 сек.
Результаты:
{'output': <QgsProcessingOutputLayerDefinition {'sink':C:/Users/BoR/AppData/Local/Temp/processing_5f0f4ec965d9431fbc778094203c5ee1/11fada24e7944c1d8715a5c77b283361/output.tif, 'createOptions': {'fileEncoding': 'System'}}>}
Загрузить результирующие слои
Алгоритм "r.neighbors" завершен
-
gamm
- Гуру
- Сообщения: 3822
- Зарегистрирован: 15 окт 2010, 08:33
- Репутация: 996
- Ваше звание: программист
- Откуда: Казань
Re: ERROR 6 in GRASS r.neightbors
Сообщение
gamm » 23 авг 2019, 08:22
Судя по всему, r.out.gdal порождает int32, или входной файл не нравится. Посмотрите, какой тип у результата классификации.
-
OlegPrs
- Интересующийся
- Сообщения: 19
- Зарегистрирован: 05 фев 2019, 05:17
- Репутация: 1
- Откуда: Украина
Re: ERROR 6 in GRASS r.neightbors
Сообщение
OlegPrs » 23 авг 2019, 17:12
gamm писал(а): ↑
23 авг 2019, 08:22
Судя по всему, r.out.gdal порождает int32
Видимо так и есть . Подскажите пожалуйста, можно ведь прописать флаг или параметр типа -string=byte? Или же как можно решить данную проблему?
-
gamm
- Гуру
- Сообщения: 3822
- Зарегистрирован: 15 окт 2010, 08:33
- Репутация: 996
- Ваше звание: программист
- Откуда: Казань
Re: ERROR 6 in GRASS r.neightbors
Сообщение
gamm » 23 авг 2019, 18:26
OlegPrs писал(а): ↑
23 авг 2019, 17:12
параметр типа -string=byte
там же написаны варианты (string заменяется конкретным кодом):
type=Byte
type=UInt16
все варианты:
Options: Byte, Int16, UInt16, Int32, UInt32, Float32, Float64, CInt16, CInt32, CFloat32, CFloat64
-
OlegPrs
- Интересующийся
- Сообщения: 19
- Зарегистрирован: 05 фев 2019, 05:17
- Репутация: 1
- Откуда: Украина
Re: ERROR 6 in GRASS r.neightbors
Сообщение
OlegPrs » 23 авг 2019, 20:29
Благодарстаую!
© GIS-Lab и авторы, 2002-2017. При использовании материалов сайта, ссылка на GIS-Lab и авторов обязательна. Содержание материалов — ответственность авторов (подробнее).
Yes, this is the full content. (and By the way this also happens on my QGIS in my work computer with 3.0, I think)
Processing algorithm…
Algorithm ‘v.buffer’ starting…
Input parameters:
{ ‘-c’ : False, ‘-s’ : False, ‘-t’ : False, ‘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’ : », ‘angle’ : 0, ‘cats’ : », ‘column’ : None, ‘distance’ : None, ‘input’ : ‘C:UsersfabioDesktopdatatestdots.shp’, ‘minordistance’ : None, ‘output’ : ‘C:/Users/fabio/Desktop/data/test/a.geojson’, ‘scale’ : 1, ‘tolerance’ : 0.01, ‘type’ : [0,1,4], ‘where’ : » }
g.proj -c proj4=»+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs»
v.in.ogr min_area=0.0001 snap=-1.0 input=»C:UsersfabioDesktopdatatestdots.shp» output=»vector_5b3ef47fec19c4″ —overwrite -o
g.region n=2932787.8891613893 s=2918981.120960044 e=3248209.8586621974 w=3238242.9922359046
v.buffer input=vector_5b3ef47fec19c4 type=»point,line,area» angle=0 scale=1 tolerance=0.01 output=outputd58c1744dc8e40b49f56bbade9db65ba —overwrite
v.out.ogr -c type=»auto» input=»outputd58c1744dc8e40b49f56bbade9db65ba» output=»C:UsersfabioDesktopdatatesta.geojson» format=»GeoJSON» —overwrite
Cleaning up temporary files…
access: No such file or directory
ERROR: LOCATION <C:UsersfabioDesktopWATERMAPnewLocation> not available
Starting GRASS GIS…
WARNING: Concurrent mapset locking is not supported on Windows
Executing <C:UsersfabioAppDataLocalTempprocessing_c30a807a8a3744e2906e6a754a905064grassdatagrass_batch_job.cmd> …
C:PROGRA~1QGIS3~1.2bin>chcp 1252 1>NUL
C:PROGRA~1QGIS3~1.2bin>g.proj -c proj4=»+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +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
C:PROGRA~1QGIS3~1.2bin>v.in.ogr min_area=0.0001 snap=-1.0 input=»C:UsersfabioDesktopdatatestdots.shp» output=»vector_5b3ef47fec19c4″ —overwrite -o
Over-riding projection check
Check if OGR layer <dots> contains polygons…
0..20..40..60..80..100
Creating attribute table for layer <dots>…
Importing 5 features (OGR layer <dots>)…
0..20..40..60..80..100
Building topology for vector map <[email protected]>…
Registering primitives…
5 primitives registered
5 vertices registered
Building areas…
0..20..40..60..80..100
0 areas built
0 isles built
Attaching islands…
Attaching centroids…
20..40..60..80..100
Number of nodes: 0
Number of primitives: 5
Number of points: 5
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
C:PROGRA~1QGIS3~1.2bin>g.region n=2932787.8891613893 s=2918981.120960044 e=3248209.8586621974 w=3238242.9922359046
C:PROGRA~1QGIS3~1.2bin>v.buffer input=vector_5b3ef47fec19c4 type=»point,line,area» angle=0 scale=1 tolerance=0.01 output=outputd58c1744dc8e40b49f56bbade9db65ba —overwrite
ERROR: Select a buffer distance/minordistance/angle or column, but not both.
C:PROGRA~1QGIS3~1.2bin>v.out.ogr -c type=»auto» input=»outputd58c1744dc8e40b49f56bbade9db65ba» output=»C:UsersfabioDesktopdatatesta.geojson» format=»GeoJSON» —overwrite
ERROR: Vector map <outputd58c1744dc8e40b49f56bbade9db65ba> not found
C:PROGRA~1QGIS3~1.2bin>exit
Execution of <C:UsersfabioAppDataLocalTempprocessing_c30a807a8a3744e2906e6a754a905064grassdatagrass_batch_job.cmd> finished.
Cleaning up temporary files…
Press any key to continue . . .
Execution completed in 3.07 seconds
Results:
{‘output’: <QgsProcessingOutputLayerDefinition {‘sink’:C:/Users/fabio/Desktop/data/test/a.geojson, ‘createOptions’: {‘fileEncoding’: ‘System’}}>}
Loading resulting layers
The following layers were not correctly generated.<ul><li>C:/Users/fabio/Desktop/data/test/a.geojson</li></ul>You can check the ‘Log Messages Panel’ in QGIS main window to find more information about the execution of the algorithm.
#3940
new
defect
Reported by: | Owned by: | grass-dev@… | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.3 |
Component: | wxGUI | Version: | git-releasebranch78 |
Keywords: | Error Reading Settings | Cc: | |
CPU: | x86-64 | Platform: | MSWindows |
When starting GRASS 7.8.1 on Windows 10 x64, a message displays in the Console window:
Error: Reading settings from file <C:UsersdnewcombAppDataRoamingGRASS7wx> failed.
Details: not enough values to unpack (expected 2, got 1)
Line:
Previously GRASS 7.6.1 was used on this computer.
Attachments
(1)
- wx
(7.2 KB
) — added by dnewcomb 3 years ago. - wx file as requsted
Download all attachments as:
.zip
Change History
(8)
Component: | Default → wxGUI |
---|
Note:
See TracTickets
for help on using tickets.
Hi there,
I think that the problem might be that your location already has some spatial information, whereas your tutorial says that:
‘setup_grass_environment prepares the GRASS environment by setting
* the projection to that one of the observation sites or to an epsg code provided
* the region to the extent of the DEM.’
I think that it definitely does the first bullet but not the second. When I run your code using a tempdir(), I get the following (below). Note how the DEM is definitely not correct. When I set up my own mapset/location, the code works great.
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] openSTARS_1.0.0 rgrass7_0.1-10 XML_3.98-1.9 data.table_1.10.4-3 sp_1.2-7
loaded via a namespace (and not attached):
[1] igraph_1.1.2 Rcpp_0.12.15 magrittr_1.5 progress_1.1.2 maptools_0.9-2 MASS_7.3-47 bit_1.1-12 lattice_0.20-35
[9] R6_2.2.2 rlang_0.1.6 blob_1.1.0 tools_3.4.3 rgdal_1.2-16 grid_3.4.3 SSN_1.1.12 DBI_0.7
[17] rgeos_0.3-26 assertthat_0.2.0 yaml_2.1.16 bit64_0.9-7 digest_0.6.15 tibble_1.4.2 Matrix_1.2-12 memoise_1.1.0
[25] RSQLite_2.0 compiler_3.4.3 pillar_1.1.0 prettyunits_1.0.2 foreign_0.8-69 pkgconfig_2.0.1
## Initialize
initGRASS(gisBase = «C:/Program Files/GRASS GIS 7.4.0»,
+ home = tempdir(),
+ override = TRUE)
gisdbase C:/Users/brian/AppData/Local/Temp/RtmpovQHFY
location file21f47dab1a4c
mapset file21f429482990
rows 1
columns 1
north 1
south 0
west 0
east 1
nsres 1
ewres 1
projection NA
dem_path <- system.file(«extdata», «nc», «elev_ned_30m.tif», package = «openSTARS»)
sites_path <- system.file(«extdata», «nc», «sites_nc.shp», package = «openSTARS»)
dem_path
[1] «C:/Users/brian/Documents/R/win-library/3.4/openSTARS/extdata/nc/elev_ned_30m.tif»
sites_path
[1] «C:/Users/brian/Documents/R/win-library/3.4/openSTARS/extdata/nc/sites_nc.shp»
setup_grass_environment(dem = dem_path, sites = sites_path)
Setting up GRASS Environment…
WARNING: Concurrent mapset locking is not supported on Windows
Trying to open with OGR…
…succeeded.
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
Error: driver %in% candDrivers is not TRUE
gmeta()
gisdbase C:/Users/brian/AppData/Local/Temp/RtmpovQHFY
location file21f47dab1a4c
mapset PERMANENT
rows 1
columns 1
north 1
south 0
west 0
east 1
nsres 1
ewres 1
projection +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +no_defs +a=6378137
+rf=298.257222101 +towgs84=0,0,0,0,0,0,0 +to_meter=1
import_data(dem = dem_path, sites = sites_path)
Loading DEM into GRASS…
Loading sites into GRASS as sites_o …
No streams available, skipping.
dem <- readRAST(«dem», ignore.stderr = TRUE)
plot(dem, col = terrain.colors(20))
Error in seq.default(zlim[1], zlim[2], length.out = length(col) + 1) :
‘from’ must be a finite number
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
execGRASS(«g.region»,flags=c(«p»,»e»))
projection: 99 (NAD83_HARN_North_Carolina)
zone: 0
datum: nad83harn
ellipsoid: grs80
north: 1
south: 0
west: 0
east: 1
nsres: 1
ewres: 1
rows: 1
cols: 1
cells: 1
north-south extent: 1.000000
east-west extent: 1.000000
dem
Object of class SpatialGridDataFrame
Object of class SpatialGrid
Grid topology:
cellcentre.offset cellsize cells.dim
1 0.5 1 1
2 0.5 1 1
SpatialPoints:
s1 s2
[1,] 0.5 0.5
Coordinate Reference System (CRS) arguments: +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79
+x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101 +towgs84=0,0,0,0,0,0,0 +to_meter=1
Data summary:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA’s
NA NA NA NaN NA NA 1
From: MiKatt [mailto:notifications@github.com]
Sent: February 13, 2018 5:07 AM
To: MiKatt/openSTARS <openSTARS@noreply.github.com>
Cc: Brian Kielstra <b.kielstra@alumni.ubc.ca>; Author <author@noreply.github.com>
Subject: Re: [MiKatt/openSTARS] setup_grass_environment (#4)
Hi, thanks a lot for your feedback!
However, I am not able to reproduce your problem. Can you please give me some more details?
This is what the code and output looks like when I use it:
library(«openSTARS»)
initGRASS(gisBase` = «c:/Program Files/GRASS GIS 7.2.0»,
+ home = tempdir(),
+ gisDbase = «f:/Landau/GRASSDB»,
+ location = «test_tutorial»
+ )
gisdbase f:/Landau/GRASSDB
location test_tutorial
mapset file2398512d4a84
rows 1
columns 1
north 1
south 0
west 0
east 1
nsres 1
ewres 1
projection NA
execGRASS(«g.region»,flags=c(«p»,»e»))
projection: 0 (x,y)
zone: 0
north: 1
south: 0
west: 0
east: 1
nsres: 1
ewres: 1
rows: 1
cols: 1
cells: 1
north-south extent: 1.000000
east-west extent: 1.000000
dem_path <- system.file(«extdata», «nc», «elev_ned_30m.tif», package = «openSTARS»)
sites_path <- system.file(«extdata», «nc», «sites_nc.shp», package = «openSTARS»)
setup_grass_environment(dem = dem_path, sites = sites_path)
Setting up GRASS Environment…
WARNING: Concurrent mapset locking is not supported on Windows
Trying to open with OGR…
…succeeded.
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
execGRASS(«g.region»,flags=c(«p»,»e»))
projection: 99 (NAD83_HARN_North_Carolina)
zone: 0
datum: nad83harn
ellipsoid: grs80
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 30
ewres: 30
rows: 450
cols: 500
cells: 225000
north-south extent: 13500.000000
east-west extent: 15000.000000
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#4 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ANrG3ae8uMwjGgO5AJIoXzf1Iq5wmuaWks5tUV6ogaJpZM4SCv-N>.
I have read somewhere that in ConcurrentHashMap
, the whole map object is not locked and instead a lock is made on a portion of the Map.
Can somebody elaborate when does locking come into the picture?
Is it right that while reading the Map there is no locking involved in it but while updating it only locking is used?
Bohemian♦
403k89 gold badges568 silver badges708 bronze badges
asked May 14, 2012 at 18:37
2
Yes, ConcurrentHashMap
uses a multitude of locks (by default, 16 of them), each lock controls one segment of the hash.
When setting data in a particular segment, the lock for that segment is obtained.
When getting data, a volatile read is used. If the volatile read results in a miss, then the lock for the segment is obtained for a last attempt at a successful read.
Alex R
11k13 gold badges93 silver badges171 bronze badges
answered May 14, 2012 at 18:43
Tim BenderTim Bender
19.9k2 gold badges48 silver badges58 bronze badges
3
Locking is minimized as much as possible while still being thread-safe.
To explain «part of the Map is locked», this means that when updating, only a «1/concurrencyLevel» of the Map (based on a hash of the key) is locked. This means that two updates can still simultaneously execute safely if they each affect separate «buckets», thus minimizing lock contention and so maximizing performance.
More importantly, trust the JDK implementation — you shouldn’t have to worry about implementation details in the JDK (for one thing, it may change from release to release). Rather, just focus on writing your code.
answered May 14, 2012 at 18:41
Bohemian♦Bohemian
403k89 gold badges568 silver badges708 bronze badges
0
ConcurrentHashMap use Reentrant Lock mechanism. ConcurrentHashMap uses segments instead of buckets and when new record get insert lock will get acquire only on segment not the complete list of segments. So here idea makes its clear that multi level lock will get acquire on the same.
As no concurrency level has been set explictity, the ConcurrentHashMap gets divided into 16 segments. And each segment acts as an independent HashMap.
There is no lock applied on read operation in ConcurrentHashMap.
answered Dec 29, 2017 at 10:15
Aman GoelAman Goel
3,2211 gold badge21 silver badges17 bronze badges