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/qgis@8582 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jun 3, 2008
1 parent c89f755 commit 783d5d0581c21ddf45c35f51d42d170f383a12c6
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 783d5d0

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