Skip to content
Permalink
Browse files

Applied patch from Stefanie Tellex for simpler retreival of coords fr…

…om QgsPoint

Thanks!


git-svn-id: http://svn.osgeo.org/qgis/trunk@8582 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jun 3, 2008
1 parent 35f10e1 commit 97f3618345c640aeb855361f793365abd1d29860
Showing with 19 additions and 0 deletions.
  1. +19 −0 python/core/qgspoint.sip
@@ -82,6 +82,25 @@ public:
sipRes = PyString_FromString(str.toLocal8Bit().data());
%End

int __len__();
%MethodCode
sipRes = 2;
%End


SIP_PYOBJECT __getitem__(int);
%MethodCode
if (a0 == 0) {
sipRes = Py_BuildValue("d",sipCpp->x());
} else if (a0 == 1) {
sipRes = Py_BuildValue("d",sipCpp->y());
} else {
QString msg = QString("Bad index: %1").arg(a0);
PyErr_SetString(PyExc_IndexError, msg.toAscii().constData());
}
%End



}; // class QgsPOint

0 comments on commit 97f3618

Please sign in to comment.
You can’t perform that action at this time.