Opened 16 years ago

Closed 15 years ago

#670 closed enhancement (worksforme)

add support for alternative coordinates

Reported by: timmie Owned by: martinl
Priority: normal Milestone: 6.5.0
Component: wxGUI Version: svn-develbranch6
Keywords: map display, preferences, workspace Cc: grass-dev@…
CPU: x86-32 Platform: Linux

Description

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.

Attachments (5)

mapdisp.py (83.1 KB ) - added by timmie 15 years ago.
a mockup of the statusbar with proj display
diff_utils_proj-params.txt (457 bytes ) - added by timmie 15 years ago.
a diff for the correct parameters retrieval
diff_mockup_mapdisp_project-coordiantes.txt (7.9 KB ) - added by timmie 15 years ago.
diff of the mockup of the statusbar with proj display
mockup_projected-coordinates.jpg (22.5 KB ) - added by timmie 15 years ago.
a screenshot of the status bar mockup 1
mockup_default-location-coordinates.jpg (29.4 KB ) - added by timmie 15 years ago.
a screenshot of the status bar mockup 2

Download all attachments as: .zip

Change History (44)

comment:1 by hamish, 16 years ago

Milestone: 6.4.06.5.0

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

in reply to:  1 comment:2 by timmie, 16 years ago

Replying to 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.

comment:3 by martinl, 16 years ago

Keywords: map display preferences workspace added

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

comment:4 by cmbarton, 15 years ago

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

in reply to:  4 comment:5 by martinl, 15 years ago

Replying to 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.

in reply to:  3 comment:6 by martinl, 15 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: newassigned

Replying to 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.

comment:7 by timmie, 15 years ago

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

in reply to:  7 comment:8 by martinl, 15 years ago

Replying to 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

comment:9 by timmie, 15 years ago

  • 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'

in reply to:  9 ; comment:10 by hamish, 15 years ago

Replying to 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

in reply to:  9 ; comment:11 by martinl, 15 years ago

Replying to 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

in reply to:  9 comment:12 by martinl, 15 years ago

Replying to 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

in reply to:  10 comment:13 by timmie, 15 years ago

Replying to hamish:

Replying to 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?

in reply to:  11 ; comment:14 by timmie, 15 years ago

Replying to martinl:

Replying to 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!

in reply to:  14 comment:15 by martinl, 15 years ago

Replying to 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

comment:16 by timmie, 15 years ago

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?

comment:17 by cmbarton, 15 years ago

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

comment:18 by timmie, 15 years ago

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?

in reply to:  16 comment:19 by martinl, 15 years ago

Replying to 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

in reply to:  18 comment:20 by martinl, 15 years ago

Replying to timmie:

you may need to adjust grid sizes:

>         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"))

The label of static box should be brief. The rest should be explained in the manual pages.

Martin

in reply to:  9 comment:21 by martinl, 15 years ago

Replying to timmie:

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

Done in r38283. Projection settings moved from tab 'Display' to 'Projection'.

Martin

comment:22 by cmbarton, 15 years ago

An important cross platform note. For the Mac, you need to instantiate the wx.StaticBox before its contents. Otherwise, the controls inside will not be accessible.

Michael

by timmie, 15 years ago

Attachment: mapdisp.py added

a mockup of the statusbar with proj display

comment:23 by martinl, 15 years ago

Can we close the ticket or are there any remaining issues?

Martin

in reply to:  23 ; comment:24 by hamish, 15 years ago

Replying to martinl:

Can we close the ticket or are there any remaining issues?

  • does Michael's note about wx.StaticBox need attention?
  • Need to consider Tim's mockup of the statusbar with proj display attachment
  • For my 2c re. the new Projection tab in wxGUI Preferences:

1) needs reorganizing of buttons/entries into workflow order (eg step 1 is load EPSG, so have that first, then...);

2) I agree that the wording could do with some improvement/ clarification - verbose tooltips would help (everyone can help with that);

3) "<>" still needs removing from the end of the auto +epsg string

4) its presence seems to me to be a bit of a trap for new users who are refugees from other GIS which might think this is a much more fundamental Preference setting than it really is. To avoid 747-cockpit style option overload (e.g. tcltk GIS.m layer manager add_vector_layer controls) could this preference, including some entries in the drop down toolbar menu in the Map Display window, be hidden behind some sort of "[] Advanced" preferences setup?

Also, FWIW, I don't really think precision is an issue needing a user-settable option. As long as we provide good defaults:

  • %.3f for planimetric (units= feet or m)
  • %.8f for decimal degrees
  • %.4f for decimal minutes
  • %.3f for decimal seconds

i.e. reporting to approximately the millimeter level will cover 99% of user needs & beyond current RTK GPS surveying limits relevant to GIS. Others can tweak the setting manually (of course keep it easy to do that within the code). Non-GUI & library stuff of course would continue to operate at full precision, I'm just talking about the mouse-over & value shown to the user on the Map Display status bar.

thanks, Hamish

comment:25 by timmie, 15 years ago

I fully agree with Hamish. But I have to say that you did a very great job here!

in reply to:  24 ; comment:26 by martinl, 15 years ago

Replying to hamish:

Replying to martinl:

  • Need to consider Tim's mockup of the statusbar with proj display attachment

Just one note, next time please attach a diff file instead of the original file. It's hard to track changes after a while (especially if the file is changed afterwards).

Martin

in reply to:  24 comment:27 by martinl, 15 years ago

Replying to hamish:

  • does Michael's note about wx.StaticBox need attention?

From ML:

The new wx.StaticBox for projections works fine on the Mac in the version I downloaded and compiled on Monday.

Michael

1) needs reorganizing of buttons/entries into workflow order (eg step 1 is load EPSG, so have that first, then...);

Loading EPSG codes is not required, your can enter proj4 string directly.

2) I agree that the wording could do with some improvement/ clarification - verbose tooltips would help (everyone can help with that);

Also should be documented in the manual page.

3) "<>" still needs removing from the end of the auto +epsg string

It's done when you choose EPSG code. Martin

in reply to:  26 ; comment:28 by timmie, 15 years ago

Replying to martinl:

Just one note, next time please attach a diff file instead of the original file. It's hard to track changes after a while (especially if the file is changed afterwards).

Sorry, how do I do this?

in reply to:  28 ; comment:29 by martinl, 15 years ago

Replying to timmie:

Replying to martinl:

Just one note, next time please attach a diff file instead of the original file. It's hard to track changes after a while (especially if the file is changed afterwards).

Sorry, how do I do this?

No problem at all, wiki:HowToSVN#LocalDiffs

by timmie, 15 years ago

Attachment: diff_utils_proj-params.txt added

a diff for the correct parameters retrieval

by timmie, 15 years ago

diff of the mockup of the statusbar with proj display

by timmie, 15 years ago

a screenshot of the status bar mockup 1

by timmie, 15 years ago

a screenshot of the status bar mockup 2

in reply to:  29 ; comment:30 by timmie, 15 years ago

No problem at all, wiki:HowToSVN#LocalDiffs

I succeeded. Please review. Hamish may give his opinion.

in reply to:  30 ; comment:31 by martinl, 15 years ago

Replying to timmie:

No problem at all, wiki:HowToSVN#LocalDiffs

I succeeded. Please review. Hamish may give his opinion.

May I also? ;-) Thanks for the patch. Anyway from my POV, reprojection of statusbar coordinates is not so often used to occupy so significant space in the mapdisplay statusbar.

Martin

in reply to:  31 ; comment:32 by timmie, 15 years ago

May I also? ;-) Thanks for the patch. Anyway from my POV, reprojection of statusbar coordinates is not so often used to occupy so significant space in the mapdisplay statusbar.

I beg you. Yes, you can.

Well, as reporter of the feauture wish I am biased. I just didn't perceive your way via the drop down list and subsequent checkbox as very accessible. I'd ask other users. But you are right, there are many more functions people may want to be added to the status bar... But I would at least ask to have the small slot showing which projection is used to show the coordinates.

comment:33 by hamish, 15 years ago

Hamish may give his opinion.

May I also? ;-)

maybe this is just trying to anticipate me giving one anyway, ;-)

In this case Martin is the lead architect of the wxGUI so I am generally glad to defer to his judgment on GUI design issues.

I would just add that for my personal work, the projection used usually forms part of the location name, and that appears in the title bar of the Map Display GUI window & terminal prompt. And see also 'd.grid -g,-w' and 'd.where -l,-w'.

7                  code, params = line.split(" ", 1)
8                  code = int(code.replace('<', '').replace('>', ''))
9 +                params = params.replace(' <>', '')

curious: is there ever anything held between those <> or is it an artifact?

Hamish

in reply to:  32 ; comment:34 by martinl, 15 years ago

Replying to timmie:

But you are right, there are many more functions people may want to be added to the status bar... But I would at least ask to have the small slot showing which projection is used to show the coordinates.

Probably functions available from the mapdisplay statusbar could be customized in GUI preferences.

Martin

in reply to:  34 comment:35 by hamish, 15 years ago

Replying to martinl:

Probably functions available from the mapdisplay statusbar could be customized in GUI preferences.

agreed, then everyone can be happy. different people work in different ways with different needs.

comment:36 by cmbarton, 15 years ago

As Hamish notes, projection information is available easily in several places. What goes on the display status bar ought to be stuff that users need to look at regularly and that relates to the way they interact with the display. Martin has a rich variety of information there. But it's also possible to add too much information. It helps to have some predictability in where and how different functions are accessed by the GUI--certain classes of things of show up in/on the display, certain classes show up in the console, etc.

Michael

in reply to:  36 ; comment:37 by timmie, 15 years ago

Just adding something aside:

Replying to cmbarton: [...]

It helps to have some predictability in where and how different functions are accessed by the GUI--certain classes of things of show up in/on the display, certain classes show up in the console, etc.

Remember that you intend to go more mainstream:

  • develop a better GUI
  • support for Windows.

This means that many people will get attracked to GRASS who have never coded / scripted / used command line before. The want to use GRASS for its good modules and reliability.

I like that you are open. I see the discussion "usability vs. functional richness" as fruitful.

May Martin as GUI-chief find a good way. The feature I liked to see is in. I am fine.

in reply to:  37 comment:38 by martinl, 15 years ago

Replying to timmie:

I like that you are open. I see the discussion "usability vs. functional richness" as fruitful.

May Martin as GUI-chief find a good way. The feature I liked to see is in. I am fine.

Well, I am not chief of anything;-) It's coincidence that I was working also on wxGUI. I see customizing mapdisplay statusbar as reasonable choice. Unfortunately, I have no time for that. Any volunteer? Generally we need more developers for wxGUI...

Martin

comment:39 by martinl, 15 years ago

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.