Skip to content

Instantly share code, notes, and snippets.

@luipir
luipir / gist:fcbc318304944962dfec
Last active August 29, 2015 14:11
mutual exclusivity in QgsFeatureRequest
myVector = iface.activeLayer() # alaska.shp in qgis_sample_data
# iteration getting only selected features
rect = QgsRectangle( 1223070.695, 2293653.357 , 9046974.211, 4184988.662)
request = QgsFeatureRequest()
request.setSubsetOfAttributes([0, 2])
request.setFilterExpression('"AREA_MI" > 1000')
request.setFilterRect( rect )
#0 0x00007ffff4e97fca in QgsVectorLayerJoinBuffer::clone (this=0x0) at /home/ginetto/PROGRAMMING/QGIS-2.0-master/src/core/qgsvectorlayerjoinbuffer.cpp:385
#1 0x00007ffff4e8ca70 in QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource (this=0x1255b70, layer=0x1253dd0) at /home/ginetto/PROGRAMMING/QGIS-2.0-master/src/core/qgsvectorlayerfeatureiterator.cpp:30
#2 0x00007ffff4e669be in QgsVectorLayer::getFeatures (this=0x1253dd0, request=...) at /home/ginetto/PROGRAMMING/QGIS-2.0-master/src/core/qgsvectorlayer.cpp:946
#3 0x00007ffff6049b65 in meth_QgsVectorLayer_getFeatures (sipSelf=<QgsVectorLayer at remote 0xfdb560>, sipArgs=(), sipKwds=0x0)
at /home/ginetto/PROGRAMMING/QGIS-2.0-master/build/python/core/sip_corepart2.cpp:143806
#4 0x00000000004aa4de in call_function (oparg=<optimized out>, pp_stack=0x7fffffffddf0) at ../Python/ceval.c:4021
#5 PyEval_EvalFrameEx (f=f@entry=Frame 0x99ce70, for file __main__.py, line 58, in <module> (), throwflag=throwflag@entry=0) at ../Python/ceval.c:2666
#6 0x00000
@luipir
luipir / gist:7b873111a5802c21c138
Created November 23, 2015 08:53
Compilation error appeared only first make
[ 35%] Building CXX object src/gui/CMakeFiles/qgis_gui.dir/raster/qgsrasterminmaxwidget.cpp.o
[ 35%] Building CXX object src/analysis/CMakeFiles/qgis_analysis.dir/vector/qgszonalstatistics.cpp.o
In file included from /mnt/data/PROGRAMMING/QGIS-2.0-master/src/gui/raster/qgsrasterminmaxwidget.cpp:22:0:
/mnt/data/PROGRAMMING/QGIS-2.0-master/src/gui/raster/qgsrasterminmaxwidget.h:21:42: fatal error: ui_qgsrasterminmaxwidgetbase.h: No such file or directory
compilation terminated.
src/gui/CMakeFiles/qgis_gui.dir/build.make:1398: recipe for target 'src/gui/CMakeFiles/qgis_gui.dir/raster/qgsrasterminmaxwidget.cpp.o' failed
make[2]: *** [src/gui/CMakeFiles/qgis_gui.dir/raster/qgsrasterminmaxwidget.cpp.o] Error 1
CMakeFiles/Makefile2:1322: recipe for target 'src/gui/CMakeFiles/qgis_gui.dir/all' failed
make[1]: *** [src/gui/CMakeFiles/qgis_gui.dir/all] Error 2
[ 35%] Building CXX object src/analysis/CMakeFiles/qgis_analysis.dir/vector/qgsoverlayanalyzer.cpp.o
@luipir
luipir / gist:dac9f2b67bb051e47767
Created November 23, 2015 08:58
Test compilation error on testqgsfontutils.cpp
Building CXX object tests/src/core/CMakeFiles/qgis_graduatedsymbolrenderertest.dir/testqgsgraduatedsymbolrenderer.cpp.o
Building CXX object tests/src/core/CMakeFiles/qgis_histogramtest.dir/testqgshistogram.cpp.o
/mnt/data/PROGRAMMING/QGIS-2.0-master/tests/src/core/testqgsfontutils.cpp:151:32: fatal error: testqgsfontutils.moc: No such file or directory
compilation terminated.
tests/src/core/CMakeFiles/qgis_fontutils.dir/build.make:54: recipe for target 'tests/src/core/CMakeFiles/qgis_fontutils.dir/testqgsfontutils.cpp.o' failed
make[2]: *** [tests/src/core/CMakeFiles/qgis_fontutils.dir/testqgsfontutils.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 82%] Building CXX object tests/src/core/CMakeFiles/qgis_histogramtest.dir/qgscompositionchecker.cpp.o
CMakeFiles/Makefile2:12117: recipe for target 'tests/src/core/CMakeFiles/qgis_fontutils.dir/all' failed
make[1]: *** [tests/src/core/CMakeFiles/qgis_fontutils.dir/all] Error 2
@luipir
luipir / gist:5964556
Created July 10, 2013 08:46
symbols size truncated
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>airports</se:Name>
<UserStyle>
<se:Name>airports</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Single symbol</se:Name>
<se:PointSymbolizer>
@luipir
luipir / gist:6001021
Created July 15, 2013 15:49
SLD file to test .MAP generation related to alpha channel bug solution
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>singlemarker_testdata</se:Name>
<UserStyle>
<se:Name>singlemarker_testdata</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Single symbol</se:Name>
<se:PointSymbolizer>
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>OGRGeoJSON</se:Name>
<UserStyle>
<se:Name>OGRGeoJSON</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>Single symbol</se:Name>
<se:PolygonSymbolizer>
@luipir
luipir / gist:6414192
Created September 2, 2013 15:37
GEOS crash qgis-master
src/providers/ogr/qgsogrfeatureiterator.cpp: 72: (QgsOgrFeatureIterator) Setting spatial filter using POLYGON((-189.00000000 -127.47355885, -189.00000000 155.19310781, 189.00000000 155.19310781, 189.00000000 -127.47355885, -189.00000000 -127.47355885))
src/providers/ogr/qgsogrfeatureiterator.cpp: 140: (nextFeature) Feature is null
src/core/qgsvectorlayer.cpp: 481: (drawRendererV2) Total features processed 3153
src/core/qgsmaprenderer.cpp: 558: (render) Layer rendered without issues
src/core/qgsmaprenderer.cpp: 625: (render) Done rendering map layers
src/core/qgsvectorlayer.cpp: 328: (drawLabels) Starting draw of labels: countries_simpl20130902172735705
src/core/qgsmaprenderer.cpp: 692: (render) Rendering completed in (seconds): 0.19
[New Thread 0x7fff74b9b700 (LWP 22552)]
src/providers/ogr/qgsogrprovider.cpp: 2142: (crs) Entering.
src/core/qgscoordinatereferencesystem.cpp: 428: (createFromWkt) wkt: GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EP
@luipir
luipir / valgrind log
Created September 3, 2013 14:44
QGIS execution core launched with valgrind Applying LWGEOM algorithm (thorough LWGEOM Provider added to Processing) to a simple shape file
src/core/qgsmaplayer.cpp: 115: (name) returning name 'test_lwgeom'
src/core/qgsscalecalculator.cpp: 48: (mapUnits) Map units returned as 2
src/core/qgsscalecalculator.cpp: 48: (mapUnits) Map units returned as 2
src/core/qgsscalecalculator.cpp: 48: (mapUnits) Map units returned as 2
src/core/qgsscalecalculator.cpp: 48: (mapUnits) Map units returned as 2
src/providers/ogr/qgsogrprovider.cpp: 2142: (crs) Entering.
src/core/qgscoordinatereferencesystem.cpp: 428: (createFromWkt) wkt: GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]
src/core/qgscoordinatereferencesystem.cpp: 449: (createFromWkt) authid recognized as EPSG:4326
src/core/qgscoordinatereferencesystem.cpp: 320: (loadFromDb) load CRS from /tmp/srs.db where lower(auth_name||':'||auth_id) is epsg:4326
src/core/qgscoordinatereferencesystem.cpp: 1361: (o
@luipir
luipir / QGis Master exit log
Created October 25, 2013 08:35
QGis master exits with glibc error
since time, but only now I had time to clean align master code, I have this glic error on exit QGIS master:
*** glibc detected *** /mnt/data/PROGRAMMING/Quantum-GIS-master/build-master/output/bin/qgis: corrupted double-linked list: 0x000000000342d700 ***
in this case log is referred to qgis 5f5cd4c
I attach my compilation parameters... because I think it could be related. Other aligned branches don't present this error.
.
[cut]