Skip to content

Commit b5a12d3

Browse files
author
Sandro Santilli
committed
Split node layer into "node" and "node label"
1 parent e65fff8 commit b5a12d3

File tree

7 files changed

+185
-20
lines changed

7 files changed

+185
-20
lines changed

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/__init__.py

+8
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ def run(item, action, mainwindow):
114114
legend.setLayerVisible(layer, False)
115115
legend.moveLayer(layer, group)
116116

117+
# node labels
118+
uri.setDataSource(toponame, 'node', 'geom', '', 'node_id')
119+
layer = QgsVectorLayer(uri.uri(), u'%s.node label' % toponame, provider)
120+
layer.loadNamedStyle(os.path.join(template_dir, 'node_label.qml'))
121+
registry.addMapLayer(layer)
122+
legend.setLayerVisible(layer, False)
123+
legend.moveLayer(layer, group)
124+
117125
# edge
118126
uri.setDataSource(toponame, 'edge_data', 'geom', '', 'edge_id')
119127
layer = QgsVectorLayer(uri.uri(), u'%s.edges' % toponame, provider)

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/templates/face_left.qml

+6-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<property key="labeling/dataDefinedProperty9" value=""/>
5656
<property key="labeling/decimals" value="0"/>
5757
<property key="labeling/displayAll" value="false"/>
58-
<property key="labeling/dist" value="3"/>
58+
<property key="labeling/dist" value="7"/>
5959
<property key="labeling/distInMapUnits" value="false"/>
6060
<property key="labeling/enabled" value="true"/>
6161
<property key="labeling/fieldName" value="left_face"/>
@@ -76,26 +76,30 @@
7676
<property key="labeling/mergeLines" value="false"/>
7777
<property key="labeling/minFeatureSize" value="0"/>
7878
<property key="labeling/multiLineLabels" value="false"/>
79+
<property key="labeling/multilineAlign" value="0"/>
80+
<property key="labeling/multilineHeight" value="1"/>
7981
<property key="labeling/namedStyle" value=""/>
8082
<property key="labeling/obstacle" value="true"/>
8183
<property key="labeling/placement" value="2"/>
8284
<property key="labeling/placementFlags" value="2"/>
8385
<property key="labeling/plussign" value="true"/>
8486
<property key="labeling/preserveRotation" value="true"/>
8587
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
86-
<property key="labeling/priority" value="5"/>
88+
<property key="labeling/priority" value="3"/>
8789
<property key="labeling/scaleMax" value="0"/>
8890
<property key="labeling/scaleMin" value="0"/>
8991
<property key="labeling/textColorB" value="0"/>
9092
<property key="labeling/textColorG" value="170"/>
9193
<property key="labeling/textColorR" value="0"/>
9294
<property key="labeling/textTransp" value="0"/>
95+
<property key="labeling/upsidedownLabels" value="0"/>
9396
<property key="labeling/wrapChar" value=""/>
9497
<property key="labeling/xOffset" value="0"/>
9598
<property key="labeling/xQuadOffset" value="0"/>
9699
<property key="labeling/yOffset" value="0"/>
97100
<property key="labeling/yQuadOffset" value="0"/>
98101
</customproperties>
102+
<editorlayout>generatedlayout</editorlayout>
99103
<displayfield>edge_id</displayfield>
100104
<label>0</label>
101105
<labelattributes>

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/templates/face_right.qml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
2-
<qgis version="1.9.0-Master" minimumScale="-4.65661e-10" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
2+
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
33
<transparencyLevelInt>0</transparencyLevelInt>
44
<singlesymbol>
55
<symbol>
@@ -55,7 +55,7 @@
5555
<property key="labeling/dataDefinedProperty9" value=""/>
5656
<property key="labeling/decimals" value="0"/>
5757
<property key="labeling/displayAll" value="false"/>
58-
<property key="labeling/dist" value="4"/>
58+
<property key="labeling/dist" value="7"/>
5959
<property key="labeling/distInMapUnits" value="false"/>
6060
<property key="labeling/enabled" value="true"/>
6161
<property key="labeling/fieldName" value="right_face"/>
@@ -76,26 +76,30 @@
7676
<property key="labeling/mergeLines" value="false"/>
7777
<property key="labeling/minFeatureSize" value="0"/>
7878
<property key="labeling/multiLineLabels" value="false"/>
79+
<property key="labeling/multilineAlign" value="0"/>
80+
<property key="labeling/multilineHeight" value="1"/>
7981
<property key="labeling/namedStyle" value=""/>
8082
<property key="labeling/obstacle" value="true"/>
8183
<property key="labeling/placement" value="2"/>
8284
<property key="labeling/placementFlags" value="4"/>
8385
<property key="labeling/plussign" value="true"/>
8486
<property key="labeling/preserveRotation" value="true"/>
8587
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
86-
<property key="labeling/priority" value="5"/>
88+
<property key="labeling/priority" value="3"/>
8789
<property key="labeling/scaleMax" value="0"/>
8890
<property key="labeling/scaleMin" value="0"/>
8991
<property key="labeling/textColorB" value="0"/>
9092
<property key="labeling/textColorG" value="0"/>
9193
<property key="labeling/textColorR" value="170"/>
9294
<property key="labeling/textTransp" value="0"/>
95+
<property key="labeling/upsidedownLabels" value="0"/>
9396
<property key="labeling/wrapChar" value=""/>
9497
<property key="labeling/xOffset" value="0"/>
9598
<property key="labeling/xQuadOffset" value="0"/>
9699
<property key="labeling/yOffset" value="0"/>
97100
<property key="labeling/yQuadOffset" value="0"/>
98101
</customproperties>
102+
<editorlayout>generatedlayout</editorlayout>
99103
<displayfield>edge_id</displayfield>
100104
<label>0</label>
101105
<labelattributes>

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/templates/next_left.qml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
2-
<qgis version="1.9.0-Master" minimumScale="-4.65661e-10" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
2+
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
33
<transparencyLevelInt>0</transparencyLevelInt>
44
<singlesymbol>
55
<symbol>
@@ -55,10 +55,10 @@
5555
<property key="labeling/dataDefinedProperty9" value=""/>
5656
<property key="labeling/decimals" value="0"/>
5757
<property key="labeling/displayAll" value="false"/>
58-
<property key="labeling/dist" value="0"/>
58+
<property key="labeling/dist" value="3"/>
5959
<property key="labeling/distInMapUnits" value="false"/>
6060
<property key="labeling/enabled" value="true"/>
61-
<property key="labeling/fieldName" value="next_left_edge"/>
61+
<property key="labeling/fieldName" value="next_left_edge || '->'"/>
6262
<property key="labeling/fontCapitals" value="0"/>
6363
<property key="labeling/fontFamily" value="Sans"/>
6464
<property key="labeling/fontItalic" value="false"/>
@@ -70,32 +70,36 @@
7070
<property key="labeling/fontWeight" value="50"/>
7171
<property key="labeling/fontWordSpacing" value="0"/>
7272
<property key="labeling/formatNumbers" value="false"/>
73-
<property key="labeling/isExpression" value="false"/>
73+
<property key="labeling/isExpression" value="true"/>
7474
<property key="labeling/labelOffsetInMapUnits" value="true"/>
7575
<property key="labeling/labelPerPart" value="false"/>
7676
<property key="labeling/mergeLines" value="false"/>
7777
<property key="labeling/minFeatureSize" value="0"/>
7878
<property key="labeling/multiLineLabels" value="false"/>
79+
<property key="labeling/multilineAlign" value="0"/>
80+
<property key="labeling/multilineHeight" value="1"/>
7981
<property key="labeling/namedStyle" value=""/>
8082
<property key="labeling/obstacle" value="true"/>
8183
<property key="labeling/placement" value="2"/>
82-
<property key="labeling/placementFlags" value="9"/>
84+
<property key="labeling/placementFlags" value="2"/>
8385
<property key="labeling/plussign" value="true"/>
8486
<property key="labeling/preserveRotation" value="true"/>
8587
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
86-
<property key="labeling/priority" value="5"/>
88+
<property key="labeling/priority" value="2"/>
8789
<property key="labeling/scaleMax" value="0"/>
8890
<property key="labeling/scaleMin" value="0"/>
8991
<property key="labeling/textColorB" value="0"/>
9092
<property key="labeling/textColorG" value="170"/>
9193
<property key="labeling/textColorR" value="0"/>
9294
<property key="labeling/textTransp" value="0"/>
95+
<property key="labeling/upsidedownLabels" value="0"/>
9396
<property key="labeling/wrapChar" value=""/>
9497
<property key="labeling/xOffset" value="0"/>
9598
<property key="labeling/xQuadOffset" value="0"/>
9699
<property key="labeling/yOffset" value="0"/>
97100
<property key="labeling/yQuadOffset" value="0"/>
98101
</customproperties>
102+
<editorlayout>generatedlayout</editorlayout>
99103
<displayfield>edge_id</displayfield>
100104
<label>0</label>
101105
<labelattributes>

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/templates/next_right.qml

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
2-
<qgis version="1.9.0-Master" minimumScale="-4.65661e-10" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
2+
<qgis version="1.9.0-Master" minimumScale="0" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
33
<transparencyLevelInt>0</transparencyLevelInt>
44
<singlesymbol>
55
<symbol>
@@ -55,47 +55,51 @@
5555
<property key="labeling/dataDefinedProperty9" value=""/>
5656
<property key="labeling/decimals" value="0"/>
5757
<property key="labeling/displayAll" value="false"/>
58-
<property key="labeling/dist" value="0"/>
58+
<property key="labeling/dist" value="3"/>
5959
<property key="labeling/distInMapUnits" value="false"/>
6060
<property key="labeling/enabled" value="true"/>
61-
<property key="labeling/fieldName" value="next_right_edge"/>
61+
<property key="labeling/fieldName" value="'&lt;-' || next_right_edge"/>
6262
<property key="labeling/fontCapitals" value="0"/>
6363
<property key="labeling/fontFamily" value="Sans"/>
6464
<property key="labeling/fontItalic" value="false"/>
6565
<property key="labeling/fontLetterSpacing" value="0"/>
66-
<property key="labeling/fontSize" value="6"/>
66+
<property key="labeling/fontSize" value="7"/>
6767
<property key="labeling/fontSizeInMapUnits" value="false"/>
6868
<property key="labeling/fontStrikeout" value="false"/>
6969
<property key="labeling/fontUnderline" value="false"/>
7070
<property key="labeling/fontWeight" value="50"/>
7171
<property key="labeling/fontWordSpacing" value="0"/>
7272
<property key="labeling/formatNumbers" value="false"/>
73-
<property key="labeling/isExpression" value="false"/>
73+
<property key="labeling/isExpression" value="true"/>
7474
<property key="labeling/labelOffsetInMapUnits" value="true"/>
7575
<property key="labeling/labelPerPart" value="false"/>
7676
<property key="labeling/mergeLines" value="false"/>
7777
<property key="labeling/minFeatureSize" value="0"/>
7878
<property key="labeling/multiLineLabels" value="false"/>
79+
<property key="labeling/multilineAlign" value="0"/>
80+
<property key="labeling/multilineHeight" value="1"/>
7981
<property key="labeling/namedStyle" value=""/>
8082
<property key="labeling/obstacle" value="true"/>
8183
<property key="labeling/placement" value="2"/>
82-
<property key="labeling/placementFlags" value="9"/>
84+
<property key="labeling/placementFlags" value="4"/>
8385
<property key="labeling/plussign" value="true"/>
8486
<property key="labeling/preserveRotation" value="true"/>
8587
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
86-
<property key="labeling/priority" value="5"/>
88+
<property key="labeling/priority" value="3"/>
8789
<property key="labeling/scaleMax" value="0"/>
8890
<property key="labeling/scaleMin" value="0"/>
8991
<property key="labeling/textColorB" value="0"/>
90-
<property key="labeling/textColorG" value="85"/>
92+
<property key="labeling/textColorG" value="0"/>
9193
<property key="labeling/textColorR" value="170"/>
9294
<property key="labeling/textTransp" value="0"/>
95+
<property key="labeling/upsidedownLabels" value="0"/>
9396
<property key="labeling/wrapChar" value=""/>
9497
<property key="labeling/xOffset" value="0"/>
9598
<property key="labeling/xQuadOffset" value="0"/>
9699
<property key="labeling/yOffset" value="0"/>
97100
<property key="labeling/yQuadOffset" value="0"/>
98101
</customproperties>
102+
<editorlayout>generatedlayout</editorlayout>
99103
<displayfield>edge_id</displayfield>
100104
<label>0</label>
101105
<labelattributes>

python/plugins/db_manager/db_plugins/postgis/plugins/qgis_topoview/templates/node.qml

+7-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<property key="labeling/displayAll" value="false"/>
5858
<property key="labeling/dist" value="0"/>
5959
<property key="labeling/distInMapUnits" value="false"/>
60-
<property key="labeling/enabled" value="true"/>
60+
<property key="labeling/enabled" value="false"/>
6161
<property key="labeling/fieldName" value="node_id"/>
6262
<property key="labeling/fontCapitals" value="0"/>
6363
<property key="labeling/fontFamily" value="Sans"/>
@@ -76,6 +76,8 @@
7676
<property key="labeling/mergeLines" value="false"/>
7777
<property key="labeling/minFeatureSize" value="0"/>
7878
<property key="labeling/multiLineLabels" value="false"/>
79+
<property key="labeling/multilineAlign" value="0"/>
80+
<property key="labeling/multilineHeight" value="1"/>
7981
<property key="labeling/namedStyle" value=""/>
8082
<property key="labeling/obstacle" value="true"/>
8183
<property key="labeling/placement" value="1"/>
@@ -90,12 +92,14 @@
9092
<property key="labeling/textColorG" value="41"/>
9193
<property key="labeling/textColorR" value="14"/>
9294
<property key="labeling/textTransp" value="0"/>
95+
<property key="labeling/upsidedownLabels" value="0"/>
9396
<property key="labeling/wrapChar" value=""/>
9497
<property key="labeling/xOffset" value="0"/>
9598
<property key="labeling/xQuadOffset" value="0"/>
9699
<property key="labeling/yOffset" value="0"/>
97100
<property key="labeling/yQuadOffset" value="0"/>
98101
</customproperties>
102+
<editorlayout>generatedlayout</editorlayout>
99103
<displayfield>node_id</displayfield>
100104
<label>0</label>
101105
<labelattributes>
@@ -125,5 +129,7 @@
125129
<editform>../../../../../../../../../src/qgis/plugins/db_manager/db_manager/db_plugins/postgis/plugins/qgis_topoview</editform>
126130
<editforminit></editforminit>
127131
<annotationform>../../../../../../../../../src/qgis/plugins/db_manager/db_manager/db_plugins/postgis/plugins/qgis_topoview</annotationform>
132+
<excludeAttributesWMS/>
133+
<excludeAttributesWFS/>
128134
<attributeactions/>
129135
</qgis>

0 commit comments

Comments
 (0)