Bug report #5704

Issues with rule based rendering and copy and paste style / qml files

Added by James Stott over 12 years ago. Updated almost 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:15229

Description

If I copy and paste the style from one layer to another, I get an error stating 'nextFeature() without select()' and the polygons disappear from the map. Whenever I pan or zoom on the map, another error is added to the log messages screen under the postgis tab.

If I save the project and then remove the section shown below from the project in Notepad++, when I reopen the project the polygons display and no errors.

The data is coming from a query that was loaded using the DB Manager plugins SQL window. The base data lives in a PostGIS database.

<customproperties>
<property key="labeling" value="pal"/>
<property key="labeling/addDirectionSymbol" value="false"/>
<property key="labeling/bufferColorB" value="255"/>
<property key="labeling/bufferColorG" value="255"/>
<property key="labeling/bufferColorR" value="255"/>
<property key="labeling/bufferSize" value="1"/>
<property key="labeling/dataDefinedProperty0" value=""/>
<property key="labeling/dataDefinedProperty1" value=""/>
<property key="labeling/dataDefinedProperty10" value="16"/>
<property key="labeling/dataDefinedProperty11" value=""/>
<property key="labeling/dataDefinedProperty12" value=""/>
<property key="labeling/dataDefinedProperty13" value=""/>
<property key="labeling/dataDefinedProperty14" value=""/>
<property key="labeling/dataDefinedProperty2" value=""/>
<property key="labeling/dataDefinedProperty3" value=""/>
<property key="labeling/dataDefinedProperty4" value=""/>
<property key="labeling/dataDefinedProperty5" value=""/>
<property key="labeling/dataDefinedProperty6" value=""/>
<property key="labeling/dataDefinedProperty7" value=""/>
<property key="labeling/dataDefinedProperty8" value=""/>
<property key="labeling/dataDefinedProperty9" value="15"/>
<property key="labeling/decimals" value="0"/>
<property key="labeling/dist" value="0"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/fieldName" value="number"/>
<property key="labeling/fontFamily" value="MS Shell Dlg 2"/>
<property key="labeling/fontItalic" value="false"/>
<property key="labeling/fontSize" value="8.25"/>
<property key="labeling/fontSizeInMapUnits" value="false"/>
<property key="labeling/fontStrikeout" value="false"/>
<property key="labeling/fontUnderline" value="false"/>
<property key="labeling/fontWeight" value="50"/>
<property key="labeling/formatNumbers" value="false"/>
<property key="labeling/isExpression" value="false"/>
<property key="labeling/labelPerPart" value="false"/>
<property key="labeling/mergeLines" value="false"/>
<property key="labeling/minFeatureSize" value="0"/>
<property key="labeling/obstacle" value="true"/>
<property key="labeling/placement" value="1"/>
<property key="labeling/placementFlags" value="0"/>
<property key="labeling/plussign" value="true"/>
<property key="labeling/priority" value="5"/>
<property key="labeling/scaleMax" value="0"/>
<property key="labeling/scaleMin" value="0"/>
<property key="labeling/textColorB" value="0"/>
<property key="labeling/textColorG" value="0"/>
<property key="labeling/textColorR" value="0"/>
<property key="labeling/wrapChar" value=""/>

Not_working_layer_style.txt Magnifier (11.2 KB) James Stott, 2012-06-06 02:19 AM

Working_layer_style.txt Magnifier (11.2 KB) James Stott, 2012-06-06 02:19 AM

History

#1 Updated by Hugo Mercier over 12 years ago

Could you, for the two layers, copy the style and paste it in a text file and attach these files here, please ?

#2 Updated by James Stott over 12 years ago

The files look exactly the same. The only way I can get the layer that doesnt work to show and get rid of the error messages is to edit the project file manually and then delete the lines shown in my original post.

#3 Updated by Nathan Woodrow over 12 years ago

Would be good to get this fixed before 1.8 release.

#4 Updated by Hugo Mercier over 12 years ago

I confirm the two files are exactly the same (md5sum are the same).

I tried to import your style on some data, and it works fine.

The part that you were forced to remove belongs to the "old-style" labeling properties (in the Layer menu). But I cannot see where the problem is. The copy/paste style code just calls readSymbology() an writeSymbology() and these two functions correclty process "old style" labelings.

I cannot reproduce. Any chance that the problem comes from your data ? Could we have access to a part of them ?

#5 Updated by Paolo Cavallini about 12 years ago

  • Target version set to Version 2.0.0

#6 Updated by Jürgen Fischer over 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#7 Updated by Médéric RIBREUX almost 9 years ago

  • Status changed from Open to Feedback

Hello,

could we close this bug ? Are you still affected by it, because I can't reproduce it ?

#8 Updated by Médéric RIBREUX almost 9 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Hello, bug triage...

well, as there is no feedback and based on the fact that I cannot reproduce it, I declare that this bug is closed !

Also available in: Atom PDF