[Marble-devel] Showing/editing the coord in bookmark editor; GeoDataCoordinates::fromString vs. toString; coordinates edit widget

Friedrich W. H. Kossebau kossebau at kde.org
Tue Sep 13 23:18:36 UTC 2011


Hi,

(no need to cc: me, am subscribed :) )

And please don't take it as offence if I talk too much about things that could 
be improved in Marble, see I would not invest my time here if Marble would not 
already be a very fine tool I use more and more often :)

Lundi, le 12 septembre 2011, à 07:53, vous avez écrit:
> Hi,
> 
> On Sunday, 11. September 2011 22:47:53 Friedrich W. H. Kossebau wrote:
> > I today got a geo coord from someone, so decided to enter it in Marble to
> > see where the point is... First I failed to find a way to do that. It
> > really is not obvious that one can enter a coord in the _Search_ field of
> > the Navigation tool (only found that when I came across the code of the
> > LatLonPlugin ;) ).
> 
> Well, would you be surprised if I told you that you can do the same in
> Google Maps? And even in most other better maps applications?

So they all copied that from you? See your responsibility! ;)

> Even worse: You can search _anything_ in Marble's Search field. Even
> "www.kde.org" or the name of a geotagged Wikipedia article will create a
> result.
> 
> It's similar to what plasma does with the runner concept.

I see. Candidate for discoverability improvement then :)

> > I was more expecting something like a "Go to" action.
> 
> We can have that. Let's just find a nice way in terms of UI to put it into
> the user interface.

Now I know about the Search field (once fixed), don't count on me for that one 
;) But I will be happy to give you at least feedback.

> > To get a start I went to fix something which had annoyed me for some
> > time, that is that the bookmark editor does not show the actual coord of
> > the bookmark.
> > Also added the option to edit the coord (e.g. if wrong or for the
> > usecase when you got the coord passed from someone and enter it).
> 
> Awesome! Thanks!

Modified the patch to use the LatLonEdit for showing/editing the coords and 
put on review board: https://git.reviewboard.kde.org/r/102608/

> > But unless I did something wrong I found out that:
> > 	GeoDataCoordinates::fromString does not eat
> > 	the output of GeoDataCoordinates::toString :(
> > 
> > Is that known?
> 
> Yes. IIRC there is even a bug report mentioning that.
> 
> > Is that on purpose?
> 
> No, I believe it's an oversight.
> 
> > If not, is somebody working on it?
> 
> Nobody is working on this AFAIK. It would be great if you could look into
> it!
> 
> :-)

Hm... I found that KStars "Set Geographic Location" (Ctrl-G) dialog has a 
textline widget per single coord to enter it (in quite some formats as the 
tooltip tips) so perhaps there is code that could be shared/ripped.

Will have a look the next week(s).

> > And that also affects the LatLonPlugin: if one enters a coord with secs
> > that will not be parsed and accepted. Which I consider fail :/
> 
> Yes, that is fail. The are numerous ways to specify coordinates.
> Additionally they get translated.  And we should handle them all.
> But at least we should be able to parse our own output.

Blame the project coordinator to push for unit tests for such things :P

> > Another question:
> > Has anybody ever worked on a input widget for coordinates?
> 
> Have a look at
> 
> marble/src/plugins/designer/latloneditwidget

Or rather marble/src/lib/LatLonEdit.*

Hm, has that ever been used somewhere besides the WorldClock plasmoid? :)
As it is quite... incomplete. First thing I stumbled across was 
LatLonEdit::setDimension(...) which added bogus data to the widget when I 
tried to use it :)

And the rest of the code also challenged me to rather rewrite some parts of 
it. Also wanted to have a double value for the secs editor, to allow more 
precision. To split the coord into the different subvalues I changed the 
calculation to be more close to what e.g. GeoDataCoordinates::lonToString(...) 
does. But I have no clue if this all is perfect wrt to numeric precision on 
digital systems (must have been something I missed during studies :P). Also 
wonder if that kind of calculations should not be in some separate methods, 
instead of being copied all over the codebase? GeoDataCoordinates::lonToString 
and GeoDataCoordinates::latToString already give a bad example, I think.

Is LatLonEdit bound to some ABI contract? In the patch above I changed the API 
slightly, so might have to redo it again then.

Cheers
Friedrich


More information about the Marble-devel mailing list