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)
Change History (32)
Changed 9 years ago by
Attachment: | LatLonToolPatch.diff added |
---|
comment:1 Changed 9 years ago by
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
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
Do you want want to include it yourself when you obtain openstreetmap.org SVN account?
comment:5 Changed 9 years ago by
Hmm, it is strange - just compiled several times. Checkouting new copy ant checking...
comment:6 follow-up: 8 Changed 9 years ago by
Sorry, forgot to do "svn add" after refactoring. Improving...
comment:7 Changed 9 years ago by
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?
comment:8 Changed 9 years ago by
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:10 Changed 9 years ago by
If in question - always who asks :-)
The rules for plugins aren't as strict as for the core.
comment:11 follow-up: 12 Changed 9 years ago by
@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 Changed 9 years ago by
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 NodesWhere 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
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
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 ;)
comment:15 Changed 9 years ago by
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
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
As I can see, not much code is left from AddNode - not more than 10 lines :)
comment:19 Changed 9 years ago by
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
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
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:23 Changed 9 years ago by
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:25 Changed 9 years ago by
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:27 Changed 9 years ago by
@Iysgaard: Please read section "Publishing the new plugin" of DevelopersGuide/DevelopingPlugins, thanks.
comment:28 Changed 9 years ago by
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
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch with the code