[Qgis-user] Open Metadata and Show Specific Information
Suryo Miles
suryomiles666 at gmail.com
Tue Mar 11 15:49:32 PDT 2014
I try make plugin to open and read metadata (.xml) and show information
inside metadata like map scale, map fiture and bounding box and auto fill
it to QLineEdit
This code i use to open metadata
cariButton = self.ui.btnCari
QtCore.QObject.connect(cariButton, QtCore.SIGNAL('clicked()'),self.cari)
def cari(self, event=None):
#open dialog
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '*.xml')
self.ui.lineFile.setText(filename)
#panggil isi data
self.isiDataFile(filename)
def isiDataFile(self, nmfile):
#buka dengan open mode baca
teksFile = open(nmfile, 'r').read()
self.ui.textFile.setText(teksFile)
but metadata have a complicated structure, like the line that have
information about scale
<gmd:scaleDenominator><gmd:MD_RepresentativeFraction><gmd:denominator>**<gco:Integer>100000</gco:Interger>**</gmd:scaleDenominator></gmd:MD_RepresentativeFraction></gmd:denominator>
it is possible to just take scale number (100000) and auto fill it in
QLineEdit when metadata has opened?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140312/8f6c38fb/attachment.html>
More information about the Qgis-user
mailing list