Skip to content
Permalink
Browse files

Split edge layer into "edge" and "edge label"

Mind you: you may need to re-run cmake as a filename changed
  • Loading branch information
Sandro Santilli
Sandro Santilli committed Nov 8, 2012
1 parent 81f99d6 commit 8414ff909d4d8095118a989cba42c69dbdf12148
@@ -124,8 +124,16 @@ def run(item, action, mainwindow):

# edge
uri.setDataSource(toponame, 'edge_data', 'geom', '', 'edge_id')
layer = QgsVectorLayer(uri.uri(), u'%s.edges' % toponame, provider)
layer.loadNamedStyle(os.path.join(template_dir, 'edge_style.qml'))
layer = QgsVectorLayer(uri.uri(), u'%s.edge' % toponame, provider)
layer.loadNamedStyle(os.path.join(template_dir, 'edge.qml'))
registry.addMapLayer(layer)
legend.setLayerVisible(layer, False)
legend.moveLayer(layer, group)

# edge labels
uri.setDataSource(toponame, 'edge_data', 'geom', '', 'edge_id')
layer = QgsVectorLayer(uri.uri(), u'%s.edge label' % toponame, provider)
layer.loadNamedStyle(os.path.join(template_dir, 'edge_label.qml'))
registry.addMapLayer(layer)
legend.setLayerVisible(layer, False)
legend.moveLayer(layer, group)
@@ -1,5 +1,5 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="1.9.0-Master" minimumScale="-4.65661e-10" maximumScale="1e+08" hasScaleBasedVisibilityFlag="0">
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" hasScaleBasedVisibilityFlag="0">
<transparencyLevelInt>255</transparencyLevelInt>
<renderer-v2 symbollevels="0" type="RuleRenderer">
<rules>
@@ -214,7 +214,7 @@
<property key="labeling/displayAll" value="false"/>
<property key="labeling/dist" value="0"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/enabled" value="false"/>
<property key="labeling/fieldName" value="edge_id"/>
<property key="labeling/fontCapitals" value="0"/>
<property key="labeling/fontFamily" value="AlArabiya"/>
@@ -233,6 +233,8 @@
<property key="labeling/mergeLines" value="false"/>
<property key="labeling/minFeatureSize" value="0"/>
<property key="labeling/multiLineLabels" value="false"/>
<property key="labeling/multilineAlign" value="0"/>
<property key="labeling/multilineHeight" value="1"/>
<property key="labeling/namedStyle" value=""/>
<property key="labeling/obstacle" value="true"/>
<property key="labeling/placement" value="2"/>
@@ -247,12 +249,14 @@
<property key="labeling/textColorG" value="0"/>
<property key="labeling/textColorR" value="0"/>
<property key="labeling/textTransp" value="0"/>
<property key="labeling/upsidedownLabels" value="0"/>
<property key="labeling/wrapChar" value=""/>
<property key="labeling/xOffset" value="0"/>
<property key="labeling/xQuadOffset" value="0"/>
<property key="labeling/yOffset" value="0"/>
<property key="labeling/yQuadOffset" value="0"/>
</customproperties>
<editorlayout>generatedlayout</editorlayout>
<displayfield>edge_id</displayfield>
<label>0</label>
<labelattributes>
@@ -289,5 +293,7 @@
<editform>.</editform>
<editforminit></editforminit>
<annotationform>.</annotationform>
<excludeAttributesWMS/>
<excludeAttributesWFS/>
<attributeactions/>
</qgis>
@@ -0,0 +1,141 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" hasScaleBasedVisibilityFlag="0">
<transparencyLevelInt>255</transparencyLevelInt>
<renderer-v2 symbollevels="0" type="singleSymbol">
<symbols>
<symbol outputUnit="MM" alpha="0" type="line" name="0">
<layer pass="0" class="SimpleLine" locked="0">
<prop k="capstyle" v="square"/>
<prop k="color" v="167,236,159,255"/>
<prop k="customdash" v="5;2"/>
<prop k="joinstyle" v="bevel"/>
<prop k="offset" v="0"/>
<prop k="penstyle" v="solid"/>
<prop k="use_custom_dash" v="0"/>
<prop k="width" v="0.26"/>
</layer>
</symbol>
</symbols>
<rotation field=""/>
<sizescale field="" scalemethod=""/>
</renderer-v2>
<customproperties>
<property key="labeling" value="pal"/>
<property key="labeling/addDirectionSymbol" value="false"/>
<property key="labeling/angleOffset" value="0"/>
<property key="labeling/bufferColorB" value="255"/>
<property key="labeling/bufferColorG" value="255"/>
<property key="labeling/bufferColorR" value="255"/>
<property key="labeling/bufferJoinStyle" value="64"/>
<property key="labeling/bufferNoFill" value="false"/>
<property key="labeling/bufferSize" value="1"/>
<property key="labeling/bufferSizeInMapUnits" value="false"/>
<property key="labeling/bufferTransp" value="0"/>
<property key="labeling/centroidWhole" value="false"/>
<property key="labeling/dataDefinedProperty0" value=""/>
<property key="labeling/dataDefinedProperty1" value=""/>
<property key="labeling/dataDefinedProperty10" value=""/>
<property key="labeling/dataDefinedProperty11" value=""/>
<property key="labeling/dataDefinedProperty12" value=""/>
<property key="labeling/dataDefinedProperty13" value=""/>
<property key="labeling/dataDefinedProperty14" value=""/>
<property key="labeling/dataDefinedProperty15" value=""/>
<property key="labeling/dataDefinedProperty16" value=""/>
<property key="labeling/dataDefinedProperty17" value=""/>
<property key="labeling/dataDefinedProperty18" value=""/>
<property key="labeling/dataDefinedProperty19" 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=""/>
<property key="labeling/decimals" value="0"/>
<property key="labeling/displayAll" value="false"/>
<property key="labeling/dist" value="0"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/fieldName" value="edge_id"/>
<property key="labeling/fontCapitals" value="0"/>
<property key="labeling/fontFamily" value="AlArabiya"/>
<property key="labeling/fontItalic" value="false"/>
<property key="labeling/fontLetterSpacing" value="0"/>
<property key="labeling/fontSize" value="8"/>
<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/fontWordSpacing" value="0"/>
<property key="labeling/formatNumbers" value="false"/>
<property key="labeling/isExpression" value="false"/>
<property key="labeling/labelOffsetInMapUnits" value="true"/>
<property key="labeling/labelPerPart" value="false"/>
<property key="labeling/mergeLines" value="false"/>
<property key="labeling/minFeatureSize" value="0"/>
<property key="labeling/multiLineLabels" value="false"/>
<property key="labeling/multilineAlign" value="0"/>
<property key="labeling/multilineHeight" value="1"/>
<property key="labeling/namedStyle" value=""/>
<property key="labeling/obstacle" value="true"/>
<property key="labeling/placement" value="2"/>
<property key="labeling/placementFlags" value="9"/>
<property key="labeling/plussign" value="true"/>
<property key="labeling/preserveRotation" value="true"/>
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
<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/textTransp" value="0"/>
<property key="labeling/upsidedownLabels" value="0"/>
<property key="labeling/wrapChar" value=""/>
<property key="labeling/xOffset" value="0"/>
<property key="labeling/xQuadOffset" value="0"/>
<property key="labeling/yOffset" value="0"/>
<property key="labeling/yQuadOffset" value="0"/>
</customproperties>
<editorlayout>generatedlayout</editorlayout>
<displayfield>edge_id</displayfield>
<label>0</label>
<labelattributes>
<label fieldname="" text="Label"/>
<family fieldname="" name="Sans"/>
<size fieldname="" units="pt" value="12"/>
<bold fieldname="" on="0"/>
<italic fieldname="" on="0"/>
<underline fieldname="" on="0"/>
<strikeout fieldname="" on="0"/>
<color fieldname="" red="0" blue="0" green="0"/>
<x fieldname=""/>
<y fieldname=""/>
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
<angle fieldname="" value="0" auto="0"/>
<alignment fieldname="" value="center"/>
<buffercolor fieldname="" red="255" blue="255" green="255"/>
<buffersize fieldname="" units="pt" value="1"/>
<bufferenabled fieldname="" on=""/>
<multilineenabled fieldname="" on=""/>
<selectedonly on=""/>
</labelattributes>
<edittypes>
<edittype type="0" name="abs_next_left_edge"/>
<edittype type="0" name="abs_next_right_edge"/>
<edittype type="0" name="edge_id"/>
<edittype type="0" name="end_node"/>
<edittype type="0" name="left_face"/>
<edittype type="0" name="next_left_edge"/>
<edittype type="0" name="next_right_edge"/>
<edittype type="0" name="right_face"/>
<edittype type="0" name="start_node"/>
</edittypes>
<editform>.</editform>
<editforminit></editforminit>
<annotationform>.</annotationform>
<excludeAttributesWMS/>
<excludeAttributesWFS/>
<attributeactions/>
</qgis>

0 comments on commit 8414ff9

Please sign in to comment.
You can’t perform that action at this time.