[Qgis-developer] Development needed: Georeferencer plugin
Sebastian Schmitz
sebastian.schmitz at wheregroup.com
Tue May 22 06:19:31 EDT 2007
Hi,
is that based on latest SVN or based on qgis 0.8 release?
Cheers
Sebastian
Oleg Gusev schrieb:
> Am Dienstag, 22. Mai 2007 10:12 schrieb Sebastian Schmitz:
>
>> In the georeferencer plugin dialogue, instead of having a pop up box to
>> type in coordinates users want to use the mouse to pick the coordinates
>> from the main map window and attribute them to the same point in the not
>> yet georeferenced image.
>>
>
> Hi Sebastian,
>
> i've already done it in a quick-and-dirty way by hooking the
> right mouse click on a canvas widget.
> Maybe somebody can do it better by creating
> a MapTool instead. The georeferencer widget needs a lot
> of modifications to be usable anyway.
> SVN diff is attached.
>
> Oleg.
>
> ------------------------------------------------------------------------
>
> Index: src/plugins/georeferencer/mapcoordsdialog.cpp
> ===================================================================
> --- src/plugins/georeferencer/mapcoordsdialog.cpp (Revision 6894)
> +++ src/plugins/georeferencer/mapcoordsdialog.cpp (Arbeitskopie)
> @@ -32,3 +32,9 @@
> {
> reject();
> }
> +
> +void MapCoordsDialog::setXY(QgsPoint & xy)
> +{
> + leXCoord->insert(QString::number(xy.x(),'f',7));
> + leYCoord->insert(QString::number(xy.y(),'f',7));
> +}
> Index: src/plugins/georeferencer/mapcoordsdialog.h
> ===================================================================
> --- src/plugins/georeferencer/mapcoordsdialog.h (Revision 6894)
> +++ src/plugins/georeferencer/mapcoordsdialog.h (Arbeitskopie)
> @@ -30,6 +30,8 @@
> void on_buttonOk_clicked();
> void on_buttonCancel_clicked();
>
> + void setXY(QgsPoint &);
> +
> private:
>
> QgsPoint mPixelCoords;
> Index: src/plugins/georeferencer/qgspointdialog.cpp
> ===================================================================
> --- src/plugins/georeferencer/qgspointdialog.cpp (Revision 6894)
> +++ src/plugins/georeferencer/qgspointdialog.cpp (Arbeitskopie)
> @@ -443,6 +446,7 @@
> MapCoordsDialog* mcd = new MapCoordsDialog(pixelCoords, this);
> connect(mcd, SIGNAL(pointAdded(const QgsPoint&, const QgsPoint&)),
> this, SLOT(addPoint(const QgsPoint&, const QgsPoint&)));
> + connect(mIface->getMapCanvas(),SIGNAL(sendXY(QgsPoint&)),mcd,SLOT(setXY(QgsPoint&)));
> mcd->show();
> }
>
> Index: src/gui/qgsmapcanvas.cpp
> ===================================================================
> --- src/gui/qgsmapcanvas.cpp (Revision 6894)
> +++ src/gui/qgsmapcanvas.cpp (Arbeitskopie)
> @@ -636,6 +636,13 @@
> mCanvasProperties->mouseButtonDown = true;
> mCanvasProperties->rubberStartPoint = e->pos();
>
> + if (e->button() == Qt::RightButton )
> + {
> + QPoint xy = e->pos();
> + QgsPoint coord = getCoordinateTransform()->toMapCoordinates(xy);
> + emit sendXY(coord);
> + }
> +
> } // mousePressEvent
>
>
> Index: src/gui/qgsmapcanvas.h
> ===================================================================
> --- src/gui/qgsmapcanvas.h (Revision 6894)
> +++ src/gui/qgsmapcanvas.h (Arbeitskopie)
> @@ -275,6 +275,7 @@
> void setProgress(int,int);
> /** emits current mouse position */
> void xyCoordinates(QgsPoint & p);
> + void sendXY(QgsPoint & p);
>
> //! Emitted when the scale of the map changes
> void scaleChanged(double);
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>
--
---------------------------------------
WhereGroup GmbH & Co. KG
Siemensstraße 8
53121 Bonn
-------------------------------
Fon: +49 (0)228 / 90 90 38 - 24
Fax: +49 (0)228 / 90 90 38 - 11
-------------------------------
mailto:sebastian.schmitz at wheregroup.com
http://www.wheregroup.com
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Arnulf Christl, Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885
---------------------------------------
More information about the Qgis-developer
mailing list