Skip to content

Commit

Permalink
round scale to next 1000. inlclude placeholder 'Subthema' in layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
wilhelmberg committed Mar 11, 2014
1 parent ae7526b commit bef911e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#VoGIS-Raumplanung Plot

QGIS PlugIn to create plots from cadastral data.
QGIS PlugIn to create plots of cadastral data.

Works with 2.0 and 2.2.
Tested with 2.0 and 2.2.

[Demo output.](/settings-and-output/out.pdf)

Expand All @@ -26,7 +26,7 @@ Data/settings needed:
* writeable path to save cached community names
* ortho/satellite image
* shapefiles with cadastral data
* composer layouts
* [composer layouts](#layouts)

##Releases
[Download latest release](https://github.com/BergWerkGIS/VoGIS-Raumplanung/releases).
Expand Down
2 changes: 1 addition & 1 deletion VoGISRaumplanungPlot/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[general]
name=VoGIS Raumplanung
description=Create Plots from VoGIS Data.
version=0.1.1
version=0.1.2
qgisMinimumVersion=2.0
qgisMaximumVersion=2.99
author=BergWerk GIS
Expand Down
2 changes: 1 addition & 1 deletion VoGISRaumplanungPlot/resources_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Resource object code
#
# Created: Mo. Mär 3 16:02:47 2014
# Created: Di. Mär 11 11:12:25 2014
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
Expand Down
2 changes: 1 addition & 1 deletion VoGISRaumplanungPlot/ui_vogisraumplanungplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'ui_vogisraumplanungplot.ui'
#
# Created: Mon Mar 3 16:02:47 2014
# Created: Tue Mar 11 11:12:25 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
Expand Down
2 changes: 1 addition & 1 deletion VoGISRaumplanungPlot/ui_vogisraumplanungplotsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'ui_vogisraumplanungplotsettings.ui'
#
# Created: Mon Mar 3 16:02:47 2014
# Created: Tue Mar 11 11:12:25 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
Expand Down
16 changes: 10 additions & 6 deletions VoGISRaumplanungPlot/vrpcomposer/vrpprintcomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def export_all_features(self):
if VRP_DEBUG is True: QgsMessageLog.logMessage(u'bbox old:{0}'.format(compmap.extent().toString()), DLG_CAPTION)
compmap.setNewExtent(new_ext)
if VRP_DEBUG is True: QgsMessageLog.logMessage(u'bbox new:{0}'.format(compmap.extent().toString()), DLG_CAPTION)
#round up to next 100
compmap.setNewScale(math.ceil((compmap.scale()/100.0)) * 100.0)
#round up to next 1000
compmap.setNewScale(math.ceil((compmap.scale()/1000.0)) * 1000.0)
if VRP_DEBUG is True: QgsMessageLog.logMessage(u'bbox new (after scale):{0}'.format(compmap.extent().toString()), DLG_CAPTION)

#add ORTHO after new extent -> performance
Expand Down Expand Up @@ -223,7 +223,7 @@ def export_all_features(self):
if cntr > 0:
printer.newPage()
self.__reorder_layers()
self.__update_composer_items(thema.name, layers=layers)
self.__update_composer_items(thema.name, subthema=sub_thema.name, layers=layers)
composition.renderPage(pdf_painter, 0)
QgsMapLayerRegistry.instance().removeMapLayers([lyr.id() for lyr in layers])
cntr += 1
Expand All @@ -243,7 +243,7 @@ def export_all_features(self):
str_flaechen += u'{0}{1} ({2:.2f}m²)'.format(comma, gnr, stats[0].flaeche)
idx += 1
lbls = self.__get_items(QgsComposerLabel, self.comp_textinfo)
self.__update_composer_items('', lbls, str_flaechen)
self.__update_composer_items('', labels=lbls, gnrflaeche=str_flaechen)
html = tabelle.text()
html += u'<table>'
#gnrcnt = 0
Expand Down Expand Up @@ -379,7 +379,7 @@ def __get_thema_by_layername(self, lyrname):
return subthema
return None

def __update_composer_items(self, oberthema, labels=None, gnrflaeche=None, layers=None):
def __update_composer_items(self, oberthema, subthema=None, labels=None, gnrflaeche=None, layers=None):
if labels is None:
labels = self.comp_lbl
for leg in self.comp_leg:
Expand Down Expand Up @@ -407,6 +407,8 @@ def __update_composer_items(self, oberthema, labels=None, gnrflaeche=None, layer
for lbl in labels:
txt = lbl[1].replace('[Gemeindename]', self.gem_name)
txt = txt.replace('[Oberthema]', oberthema)
if not subthema is None:
txt = txt.replace('[Subthema]', subthema)
txt = txt.replace('[GNR]', ', '.join(self.gnrs))
if not gnrflaeche is None:
txt = txt.replace('[GNRFLAECHE]', gnrflaeche)
Expand Down Expand Up @@ -564,8 +566,10 @@ def __read_template(self, textinfo=False):
filename = self.template_qpt
if VRP_DEBUG is True: QgsMessageLog.logMessage(u'reading template: {0}'.format(filename), DLG_CAPTION)
xml_file = QFile(filename)
#if xml_file.exists() is False:
# return u'\nTemplate ist nicht vorhanden!\n\n{0}'.format(self.template_qpt), None
if xml_file.open(QIODevice.ReadOnly) is False:
return u'Konnte Template nicht öffnen!\n{0}'.format(self.template_qpt), None
return u'\nKonnte Template nicht öffnen!\n\n{0}\n\n{1}: {2}'.format(filename, xml_file.error(), xml_file.errorString()), None
xml_doc = QDomDocument('mydoc')
xml_doc.setContent(xml_file)
return None, xml_doc
4 changes: 2 additions & 2 deletions plugins.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<plugins>
<pyqgis_plugin name="VoGIS Raumplanung" version="0.1.1">
<pyqgis_plugin name="VoGIS Raumplanung" version="0.1.2">
<description><![CDATA[Create Plots from VoGIS Data.]]></description>
<version>0.1.1</version>
<version>0.1.2</version>
<qgis_minimum_version>2.0.0</qgis_minimum_version>
<qgis_maximum_version>2.99.0</qgis_maximum_version>
<homepage>https://github.com/BergWerkGIS/VoGIS-Raumplanung/</homepage>
Expand Down
Binary file modified vogisraumplanungplot.zip
Binary file not shown.

0 comments on commit bef911e

Please sign in to comment.