Skip to content

Commit

Permalink
Split node layer into "node" and "node label"
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Santilli committed Nov 8, 2012
1 parent e65fff8 commit b5a12d3
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 20 deletions.
Expand Up @@ -114,6 +114,14 @@ def run(item, action, mainwindow):
legend.setLayerVisible(layer, False)
legend.moveLayer(layer, group)

# node labels
uri.setDataSource(toponame, 'node', 'geom', '', 'node_id')
layer = QgsVectorLayer(uri.uri(), u'%s.node label' % toponame, provider)
layer.loadNamedStyle(os.path.join(template_dir, 'node_label.qml'))
registry.addMapLayer(layer)
legend.setLayerVisible(layer, False)
legend.moveLayer(layer, group)

# edge
uri.setDataSource(toponame, 'edge_data', 'geom', '', 'edge_id')
layer = QgsVectorLayer(uri.uri(), u'%s.edges' % toponame, provider)
Expand Down
Expand Up @@ -55,7 +55,7 @@
<property key="labeling/dataDefinedProperty9" value=""/>
<property key="labeling/decimals" value="0"/>
<property key="labeling/displayAll" value="false"/>
<property key="labeling/dist" value="3"/>
<property key="labeling/dist" value="7"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/fieldName" value="left_face"/>
Expand All @@ -76,26 +76,30 @@
<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="2"/>
<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/priority" value="3"/>
<property key="labeling/scaleMax" value="0"/>
<property key="labeling/scaleMin" value="0"/>
<property key="labeling/textColorB" value="0"/>
<property key="labeling/textColorG" value="170"/>
<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>
Expand Down
@@ -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" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
<transparencyLevelInt>0</transparencyLevelInt>
<singlesymbol>
<symbol>
Expand Down Expand Up @@ -55,7 +55,7 @@
<property key="labeling/dataDefinedProperty9" value=""/>
<property key="labeling/decimals" value="0"/>
<property key="labeling/displayAll" value="false"/>
<property key="labeling/dist" value="4"/>
<property key="labeling/dist" value="7"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/fieldName" value="right_face"/>
Expand All @@ -76,26 +76,30 @@
<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="4"/>
<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/priority" value="3"/>
<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="170"/>
<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>
Expand Down
@@ -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" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
<transparencyLevelInt>0</transparencyLevelInt>
<singlesymbol>
<symbol>
Expand Down Expand Up @@ -55,10 +55,10 @@
<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/dist" value="3"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/fieldName" value="next_left_edge"/>
<property key="labeling/fieldName" value="next_left_edge || '->'"/>
<property key="labeling/fontCapitals" value="0"/>
<property key="labeling/fontFamily" value="Sans"/>
<property key="labeling/fontItalic" value="false"/>
Expand All @@ -70,32 +70,36 @@
<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/isExpression" value="true"/>
<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/placementFlags" value="2"/>
<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/priority" value="2"/>
<property key="labeling/scaleMax" value="0"/>
<property key="labeling/scaleMin" value="0"/>
<property key="labeling/textColorB" value="0"/>
<property key="labeling/textColorG" value="170"/>
<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>
Expand Down
@@ -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" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
<transparencyLevelInt>0</transparencyLevelInt>
<singlesymbol>
<symbol>
Expand Down Expand Up @@ -55,47 +55,51 @@
<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/dist" value="3"/>
<property key="labeling/distInMapUnits" value="false"/>
<property key="labeling/enabled" value="true"/>
<property key="labeling/fieldName" value="next_right_edge"/>
<property key="labeling/fieldName" value="'&lt;-' || next_right_edge"/>
<property key="labeling/fontCapitals" value="0"/>
<property key="labeling/fontFamily" value="Sans"/>
<property key="labeling/fontItalic" value="false"/>
<property key="labeling/fontLetterSpacing" value="0"/>
<property key="labeling/fontSize" value="6"/>
<property key="labeling/fontSize" value="7"/>
<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/isExpression" value="true"/>
<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/placementFlags" value="4"/>
<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/priority" value="3"/>
<property key="labeling/scaleMax" value="0"/>
<property key="labeling/scaleMin" value="0"/>
<property key="labeling/textColorB" value="0"/>
<property key="labeling/textColorG" value="85"/>
<property key="labeling/textColorG" value="0"/>
<property key="labeling/textColorR" value="170"/>
<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>
Expand Down
Expand Up @@ -57,7 +57,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="node_id"/>
<property key="labeling/fontCapitals" value="0"/>
<property key="labeling/fontFamily" value="Sans"/>
Expand All @@ -76,6 +76,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="1"/>
Expand All @@ -90,12 +92,14 @@
<property key="labeling/textColorG" value="41"/>
<property key="labeling/textColorR" value="14"/>
<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>node_id</displayfield>
<label>0</label>
<labelattributes>
Expand Down Expand Up @@ -125,5 +129,7 @@
<editform>../../../../../../../../../src/qgis/plugins/db_manager/db_manager/db_plugins/postgis/plugins/qgis_topoview</editform>
<editforminit></editforminit>
<annotationform>../../../../../../../../../src/qgis/plugins/db_manager/db_manager/db_plugins/postgis/plugins/qgis_topoview</annotationform>
<excludeAttributesWMS/>
<excludeAttributesWFS/>
<attributeactions/>
</qgis>

0 comments on commit b5a12d3

Please sign in to comment.