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