Modify

Opened 9 years ago

Closed 9 years ago

#7237 closed enhancement (fixed)

Added functionality: LatLonTool that lets you define geometry with lat lon coordinates.

Reported by: lysgaard Owned by: team
Priority: normal Milestone:
Component: Plugin utilsplugin2 Version:
Keywords: Cc:

Description

I've made a tool that lets you create a set of nodes, ways or areas with
lat lon coordinates.
I asked the mailing list on how to get it in and they said utilsplugin2 was the right place.
I'm going to attach a patch and the icon image for the tool, shuld be pretty straight forward to apply the patch, if not, ask me.

Attachments (3)

LatLonToolPatch.diff (21.5 KB) - added by lysgaard 9 years ago.
Patch with the code
latlon.png (4.0 KB) - added by lysgaard 9 years ago.
This is the icon, put it in images/
LatLonPlugin2.diff (23.3 KB) - added by lysgaard 9 years ago.
Newest diff for the latlonplugin

Download all attachments as: .zip

Change History (32)

Changed 9 years ago by lysgaard

Attachment: LatLonToolPatch.diff added

Patch with the code

Changed 9 years ago by lysgaard

Attachment: latlon.png added

This is the icon, put it in images/

comment:1 Changed 9 years ago by lysgaard

Oh, forgot to mention. I took the svn diff from the root folder of the utilsplugin2, *not* the root of the whole JOSM project.

comment:2 Changed 9 years ago by simon04

Summary: Added functionality: LatLonTool that lets you define geometry with lat lon coordinates.[Patch] Added functionality: LatLonTool that lets you define geometry with lat lon coordinates.

comment:3 Changed 9 years ago by akks

Do you want want to include it yourself when you obtain openstreetmap.org SVN account?

comment:4 Changed 9 years ago by bastiK

@akks: Utilsplugin2 does not compile.

comment:5 Changed 9 years ago by akks

Hmm, it is strange - just compiled several time. Checkouting new copy ant checking...

Version 0, edited 9 years ago by akks (next)

comment:6 Changed 9 years ago by akks

Sorry, forgot to do "svn add" after refactoring. Improving...

comment:7 Changed 9 years ago by akks

Commited, svn update -> ant dist works. No more commits from me :)

By the way, is it OK to use jdk 1.7 to compile plugin JARs?

Last edited 9 years ago by akks (previous) (diff)

comment:8 in reply to:  6 Changed 9 years ago by stoecker

Replying to akks:

Sorry, forgot to do "svn add" after refactoring. Improving...

Always do a "svn status" and "svn diff" before checkin :-)

By the way, is it OK to use jdk 1.7 to compile plugin JARs?

As long as the resulting binary is 1.6: Yes.

comment:9 Changed 9 years ago by akks

Who will include this patch - lysgaard himself, bastiK, or me?

comment:10 Changed 9 years ago by stoecker

If in question - always who asks :-)

The rules for plugins aren't as strict as for the core.

comment:11 Changed 9 years ago by bastiK

@lysgaard regarding patch:

The GUI is a bit unconventional. Some ideas:

I'd suggest a text area with 4-5 lines initially (wrapped in a scrollbox) that expands only when you increase the dialog size. In addition, "Line" should be called "Way" - this is the technical term used throughout JOSM.

The combobox selection could be replaced by something like this:

  o Way
      □ closed way (area)
  o Nodes

Where the default selection depends on the number of entered coordinates. (not sure about last one)

comment:12 in reply to:  11 Changed 9 years ago by lysgaard

Replying to bastiK:

@lysgaard regarding patch:

The GUI is a bit unconventional. Some ideas:

I'd suggest a text area with 4-5 lines initially (wrapped in a scrollbox) that expands only when you increase the dialog size. In addition, "Line" should be called "Way" - this is the technical term used throughout JOSM.

The combobox selection could be replaced by something like this:

  o Way
      □ closed way (area)
  o Nodes

Where the default selection depends on the number of entered coordinates. (not sure about last one)

I can make the textbox changes.

I can also change the text in the combobox so that it follows JOSM standards.

It makes sense to deactivate the Way option if there is less than 2 coordinates and deactivate the Area option if there is less than 3 coordinates.

To do this I still need to get an SVN account, isn't there a signup anywhere. Do i have to talk to someone?

comment:13 Changed 9 years ago by akks

You should ask Tom Hughes for SVN account by mail, this could help.
(I had the same problem: #6168). You can edit files in your local copy ( svn co http://svn.openstreetmap.org/applications/editors/josm josm ) and commit from that copy when you obtain account (it usually takes 1-2 days). You can post a patch here for review or inclusion at any time.

comment:14 Changed 9 years ago by lysgaard

I've gotten my own account. Also done some changes to the interface so it's easier to understand.

Do you mind looking at it now and see if it's ok, if so I'm committig it.

The patch is in the attatchments ;)

Changed 9 years ago by lysgaard

Attachment: LatLonPlugin2.diff added

Newest diff for the latlonplugin

comment:15 Changed 9 years ago by akks

There is already one "Add Node" action in core with the same Shft-D shortcut... Maybe you should rename your one?

comment:16 Changed 9 years ago by bastiK

Can you reuse the code for "Add Node"? Not copy+paste, but override the class or something.

Any change to JOSM-core is no problem, just add a separate patch.

comment:17 Changed 9 years ago by akks

As I can see, not much code is left from AddNode - not more than 10 lines :)

comment:18 Changed 9 years ago by bastiK

Why, it seems to be very similar?

comment:19 Changed 9 years ago by akks

LatLonAction creates nodes/ways/areas, and AddNodeAction - only nodes, so most of its 50-line code is action initialization (used for copy-paste) and dialog invocation. Do we need general "Action that shows some dialog and then executes some Josm command?". It looks too abstract.

comment:20 Changed 9 years ago by bastiK

LatLonDialog in the patch shares a lot of code with http://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java, this is what I mean.

comment:21 Changed 9 years ago by akks

Sorry :) Now I see it too... New tool is really a seriiously extended verion of old one. Do we need both?
Maybe it should be debugged and polished in utilsplugin2 and then replace core Add Node? (in non-expert mode it is should be simpler, of course).

comment:22 Changed 9 years ago by bastiK

Yes, why not.

comment:23 Changed 9 years ago by lysgaard

First, thanks for being positive about the patch :) This is my first experience with contributing to an open source project so I'm happy it's a good one.

Second, I've fixed the hot-key issue. I'm wondering, can I commit this now to utilsplugin2 and then I can polish it more afterwards? It works, but it's not beautiful yet. It's just that I'm quite eager to see the code in action.

comment:24 Changed 9 years ago by akks

I think you can commit. Do not forget to add picture (svn add) :)

comment:25 Changed 9 years ago by akks

Maybe it is better to align raiobuttons horizonatlly to give more space for coordinates. Some "Apply" or "Preview" button can also be helpful (undo action if cancel was pressed).

comment:26 Changed 9 years ago by bastiK

Added by Iysgaard in [o27443].

comment:27 Changed 9 years ago by bastiK

@Iysgaard: Please read section "Publishing the new plugin" of DevelopersGuide/DevelopingPlugins, thanks.

comment:28 Changed 9 years ago by bastiK

Summary: [Patch] Added functionality: LatLonTool that lets you define geometry with lat lon coordinates.Added functionality: LatLonTool that lets you define geometry with lat lon coordinates.

comment:29 Changed 9 years ago by stoecker

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.