2010-06-04 00:31:48 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-10-06 13:10:25 +02:00
|
|
|
|
|
|
|
"""
|
|
|
|
***************************************************************************
|
|
|
|
dialogSRS.py
|
|
|
|
---------------------
|
|
|
|
Date : June 2010
|
|
|
|
Copyright : (C) 2010 by Giuseppe Sucameli
|
|
|
|
Email : brush dot tyler at gmail dot com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************
|
|
|
|
"""
|
|
|
|
|
|
|
|
__author__ = 'Giuseppe Sucameli'
|
|
|
|
__date__ = 'June 2010'
|
|
|
|
__copyright__ = '(C) 2010, Giuseppe Sucameli'
|
|
|
|
# This will get replaced with a git SHA1 when you do a git archive
|
|
|
|
__revision__ = '$Format:%H$'
|
|
|
|
|
2010-06-04 00:31:48 +00:00
|
|
|
from PyQt4.QtCore import *
|
|
|
|
from PyQt4.QtGui import *
|
|
|
|
from qgis.core import *
|
|
|
|
from qgis.gui import *
|
|
|
|
|
|
|
|
class GdalToolsSRSDialog(QDialog):
|
2012-02-01 13:01:22 +01:00
|
|
|
def __init__(self, title, parent=None):
|
2012-01-26 00:54:56 +01:00
|
|
|
QDialog.__init__(self, parent)
|
2010-06-04 00:31:48 +00:00
|
|
|
self.setWindowTitle( title )
|
|
|
|
|
|
|
|
layout = QVBoxLayout()
|
|
|
|
self.selector = QgsProjectionSelector(self)
|
|
|
|
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close)
|
|
|
|
|
|
|
|
layout.addWidget(self.selector)
|
|
|
|
layout.addWidget(buttonBox)
|
|
|
|
self.setLayout(layout)
|
|
|
|
|
|
|
|
self.connect(buttonBox, SIGNAL("accepted()"), self.accept)
|
|
|
|
self.connect(buttonBox, SIGNAL("rejected()"), self.reject)
|
|
|
|
|
2013-01-04 23:02:44 +01:00
|
|
|
def authid(self):
|
2013-01-08 10:40:40 +01:00
|
|
|
return str(self.selector.selectedAuthId())
|
2010-06-04 00:31:48 +00:00
|
|
|
|
|
|
|
def proj4string(self):
|
|
|
|
return self.selector.selectedProj4String()
|
|
|
|
|
|
|
|
def getProjection(self):
|
2013-06-14 15:32:44 -03:00
|
|
|
if self.authid().upper().startswith("EPSG:"):
|
2013-01-04 23:02:44 +01:00
|
|
|
return self.authid()
|
2010-06-04 00:31:48 +00:00
|
|
|
|
2013-06-14 15:32:44 -03:00
|
|
|
if self.selector.selectedProj4String():
|
2010-06-04 00:31:48 +00:00
|
|
|
return self.proj4string()
|
|
|
|
|
2013-06-04 09:28:43 +10:00
|
|
|
return ''
|