Modify

Opened 12 years ago

Closed 12 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 12 years ago.
Patch with the code
latlon.png (4.0 KB ) - added by lysgaard 12 years ago.
This is the icon, put it in images/
LatLonPlugin2.diff (23.3 KB ) - added by lysgaard 12 years ago.
Newest diff for the latlonplugin

Download all attachments as: .zip

Change History (32)

by lysgaard, 12 years ago

Attachment: LatLonToolPatch.diff added

Patch with the code

by lysgaard, 12 years ago

Attachment: latlon.png added

This is the icon, put it in images/

comment:1 by lysgaard, 12 years ago

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 by simon04, 12 years ago

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 by akks, 12 years ago

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

comment:4 by bastiK, 12 years ago

@akks: Utilsplugin2 does not compile.

comment:5 by akks, 12 years ago

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

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

comment:6 by akks, 12 years ago

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

comment:7 by akks, 12 years ago

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 12 years ago by akks (previous) (diff)

in reply to:  6 comment:8 by stoecker, 12 years ago

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 by akks, 12 years ago

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

comment:10 by stoecker, 12 years ago

If in question - always who asks :-)

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

comment:11 by bastiK, 12 years ago

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

in reply to:  11 comment:12 by lysgaard, 12 years ago

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 by akks, 12 years ago

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 by lysgaard, 12 years ago

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

by lysgaard, 12 years ago

Attachment: LatLonPlugin2.diff added

Newest diff for the latlonplugin

comment:15 by akks, 12 years ago

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

comment:16 by bastiK, 12 years ago

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 by akks, 12 years ago

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

comment:18 by bastiK, 12 years ago

Why, it seems to be very similar?

comment:19 by akks, 12 years ago

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 by bastiK, 12 years ago

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 by akks, 12 years ago

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 by bastiK, 12 years ago

Yes, why not.

comment:23 by lysgaard, 12 years ago

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 by akks, 12 years ago

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

comment:25 by akks, 12 years ago

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 by bastiK, 12 years ago

Added by Iysgaard in [o27443].

comment:27 by bastiK, 12 years ago

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

comment:28 by bastiK, 12 years ago

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 by stoecker, 12 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.