[GRASS-dev] [GRASS GIS] #670: add support for alternative coordinates

#670: add support for alternative coordinates
-------------------------+--------------------------------------------------
Reporter: timmie | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: wxGUI | Version: svn-develbranch6
Keywords: | Platform: Linux
      Cpu: x86-32 |
-------------------------+--------------------------------------------------
When working in a projected location (e.g.) it would be nice to see also
the geographic coordinates in the status bar of the map window as
additional information.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by hamish):

  * milestone: 6.4.0 => 6.5.0

Comment:

i.e. you want a new entry in the status-bar pulldown list to display
Lat/Lon coords.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/670#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

Replying to [comment:1 hamish]:
> i.e. you want a new entry in the status-bar pulldown list to display
Lat/Lon coords.

Yes.
Or if I am in a lat/lon location to see also UTM.

Imagine working with different programs or paperpaps about the same area.
This would ease comparison.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by martinl):

  * keywords: => map display, preferences, workspace

Comment:

I can imagine new option in GUI preferences or probably better in
workspace to show coordinates in defined projection (epgs, proj string).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by cmbarton):

I don't know if there is a GRASS module to translate an xy coordinate pair
into another projection. Does g.proj do this? m.proj?

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

Replying to [comment:4 cmbarton]:
> I don't know if there is a GRASS module to translate an xy coordinate
pair into another projection. Does g.proj do this? m.proj?

{{{
m.proj
}}}

does this.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Changes (by martinl):

* cc: grass-dev@lists.osgeo.org (added)
  * owner: grass-dev@lists.osgeo.org => martinl
  * status: new => assigned

Comment:

Replying to [comment:3 martinl]:
> I can imagine new option in GUI preferences or probably better in
workspace to show coordinates in defined projection (epgs, proj string).

Try r38143 (devbr6) or r38145 (trunk) {{{GUI preferences -> Display ->
Projection statusbar setting}}}.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

> GUI preferences -> Display -> Projection statusbar setting.
Martin, thanks.
But it doesn't seem to work.
I tried it on UTM projection with EPSG 4326.
But the status bar show still metric coordinates instead of WGS84 lat/lon

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

Replying to [comment:7 timmie]:
> > GUI preferences -> Display -> Projection statusbar setting.
> Martin, thanks.
> But it doesn't seem to work.
> I tried it on UTM projection with EPSG 4326.
> But the status bar show still metric coordinates instead of WGS84
lat/lon

The required field is proj4 string not the EPSG code. So you can

  * directly write proj4 code
  * or load epsg code (takes quite long time) and choose the code

Then press 'Apply' or 'Save' to get it working.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

- it loads like: +proj=utm +zone=24 +south +ellps=aust_SA +units=m
+no_defs <>
         which doesn't work unless modified to +proj=utm +zone=24 +south
+ellps=aust_SA +units=m +no_defs
     - this works very well => great plus!
     - for not leading to mislead coordinates comparisions it would be
great to show the EPSG number in the status bar
     - please make a switch in the status bar to either native coodinates
of the location or the projection defined in the Config
     - does it check whether the projections comply?
     - please documents that: one needs to input the EPSG number and then
press load code
     - pelase enable to display the coordinates in decimal numbers: -f
'%.8f'

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by hamish):

Replying to [comment:9 timmie]:
> - it loads like: +proj=utm +zone=24 +south +ellps=aust_SA +units=m
+no_defs <>
> which doesn't work unless modified to +proj=utm +zone=24 +south
+ellps=aust_SA +units=m +no_defs

"+no_defs" might also be removed, I am not really sure if it does anything
anymore. You may study Gerald's comments on the PROJ.4 list as to its
original purpose:
http://search.gmane.org/?query=no_defs&author=gerald&group=gmane.comp.gis.proj-4.devel&sort=date

> - pelase enable to display the coordinates in decimal numbers: -f
'%.8f'

FWIW in the tcltk gis.m GUI, D.DDD, DM.MMM, or DMS.SSS format in the map
display's status bar is now controlled by "dms_format" variable in
mapcanvas.tcl.
{{{
# FIXME: make this settable from the UI or use GRASS_DMS_FORMAT enviro
var
         # DMS format: 0 is ddd.dddddd, 1 is ddd:mm.mmmm', 2 is
ddd:mm'ss.sss"
         set dms_format 2
}}}

not sure if that variable should idealy be a g.gisenv GRASS variable or a
shell environment variable.

I only went to %.6f for D.DDDDDD there because this is a GUI and it is not
very approrpiate to claim millimeter ground precision from a screen
pixel+mouse click. Similar just to %.3f for planimetric locations.

also, if using Swig, G_format_northing() etc can now accept projection
type of -1 to force decimal output.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/670#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

Replying to [comment:9 timmie]:
> - please make a switch in the status bar to either native coodinates
of the location or the projection defined in the Config

Done in r38258.

> - does it check whether the projections comply?

I don't understand what you are asking for.

> - please documents that: one needs to input the EPSG number and then
press load code

I would leave this for native speaker in the best case.

> - pelase enable to display the coordinates in decimal numbers: -f
'%.8f'

I guess you are speaking about latlong locations.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

Replying to [comment:9 timmie]:
> - for not leading to mislead coordinates comparisions it would be
great to show the EPSG number in the status bar

Done in r38259.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

Replying to [comment:10 hamish]:
> Replying to [comment:9 timmie]:
> > - it loads like: +proj=utm +zone=24 +south +ellps=aust_SA +units=m
+no_defs <>
> > which doesn't work unless modified to +proj=utm +zone=24 +south
+ellps=aust_SA +units=m +no_defs
>
> "+no_defs" might also be removed, I am not really sure if it does
anything anymore. You may study Gerald's comments on the PROJ.4 list as to
its original purpose:
>
http://search.gmane.org/?query=no_defs&author=gerald&group=gmane.comp.gis.proj-4.devel&sort=date
It is still there in the latest revision. (05-07-2009)

> I only went to %.6f for D.DDDDDD there because this is a GUI and it is
not very approrpiate to claim millimeter ground precision from a screen
pixel+mouse click. Similar just to %.3f for planimetric locations.
True.
May a preference for %.6f be added to the wxGUI preferences?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

Replying to [comment:11 martinl]:
> Replying to [comment:9 timmie]:
> > - please make a switch in the status bar to either native
coodinates of the location or the projection defined in the Config
>
> Done in r38258.
Well, I was looking for a different design.
Which wxGUI python file controls the status bar?
I would like to send you a proposal.

> > - does it check whether the projections comply?
>
> I don't understand what you are asking for.
What happens if a users enters a EPSG code of a projection which does not
match with the projection of the location?
E.g. an adjactant UTM zone instead of WGS84?

> > - please documents that: one needs to input the EPSG number and
then press load code
> I would leave this for native speaker in the best case.
I would like to include this in the proposal.
What file do I need to modify?

Again: thanks. It come in very hand. Great!

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

Replying to [comment:14 timmie]:
> > > - please make a switch in the status bar to either native
coodinates of the location or the projection defined in the Config
> >
> > Done in r38258.
> Well, I was looking for a different design.

And design is? Currently you can enable reprojection from combobox located
in the mapdisplay statusbar, item "Projection". Note that only statusbar
coordinates are reprojected, not the data.

> Which wxGUI python file controls the status bar?

source:grass/trunk/gui/wxpython/gui_modules/mapdisp.py

> I would like to send you a proposal.

Go ahead.

> > > - does it check whether the projections comply?
> >
> > I don't understand what you are asking for.
> What happens if a users enters a EPSG code of a projection which does
not match with the projection of the location?

The required item is proj string not the EPSG code. Coordinates in the
statusbar are reprojected. This is what you are asking for, no?

> E.g. an adjactant UTM zone instead of WGS84?
>
> > > - please documents that: one needs to input the EPSG number and
then press load code
> > I would leave this for native speaker in the best case.
> I would like to include this in the proposal.
> What file do I need to modify?

source:grass/trunk/gui/wxpython/docs/wxGUI.html

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

Give me some time. The whole GUI structure is new to me and I worked last
with wxpython about 1 year ago.
What IDE do you use?
What program do you use to edit
http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/xml/grass-
gxw.dtd?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by cmbarton):

Timmie,

It will be very helpful if you are able to start helping with coding on
the GUI. As you note, you'll need some time to familiarize yourself with
the GUI and GRASS more generally. Ultimately, if you do not have SVN
access, it will be best if you apply for that.

I've tried a number of IDE's and to some extent, it's a matter of personal
preference for how to work. Currently, I'm using Editra. It is written in
Python and wxPython, which makes it very cross platform. With a couple of
plugins, it is very powerful and useful. I've also used Komodo (open
source version) and a couple of Mac-specific ones.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by timmie):

you may need to adjust grid sizes:
{{{
          #
         # projections statusbar settings
         #
         box = wx.StaticBox (parent=panel, id=wx.ID_ANY, label=" %s " %
_("Projection statusbar settings \n (enter EPSG code and press \"Load EPSG
codes\" (and wait) or insert Proj.4 string directly"))
         sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

         gridSizer = wx.GridBagSizer (hgap=3, vgap=3)
         gridSizer.AddGrowableCol(1)

         row = 0
}}}

The other changes will need more time.
I need to setup pydev (my preferred IDE) to reflect the wxGUI.
I will not apply to avn access before being sure that I can contribute in
a reliable way.
I do not use GRASS on daily basis. From time to time I need to work some
tasks and days for one project.
For the time being, count on me for improvement suggestions, only.

What do you think about the decimal degree thing?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#670: add support for alternative coordinates
--------------------------+-------------------------------------------------
  Reporter: timmie | Owner: martinl
      Type: enhancement | Status: assigned
  Priority: normal | Milestone: 6.5.0
Component: wxGUI | Version: svn-develbranch6
Resolution: | Keywords: map display, preferences, workspace
  Platform: Linux | Cpu: x86-32
--------------------------+-------------------------------------------------
Comment (by martinl):

Replying to [comment:16 timmie]:
> Give me some time. The whole GUI structure is new to me and I worked
last with wxpython about 1 year ago.
> What IDE do you use?

I am fun of GNU Emacs (which is not IDE).

> What program do you use to edit
> http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/xml/grass-
gxw.dtd?

GNU Emacs http://www.gnu.org/software/emacs/.

Speaking about IDE, try code::blocks http://www.codeblocks.org/

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/670#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>