Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#8193 closed enhancement (fixed)

Support for OSM "notes"

Reported by: bastiK Owned by: ToeBee
Priority: normal Milestone:
Component: Core notes Version:
Keywords: Cc: Stemby, grinapo

Description

There will be an bug tracking system called notes similar OpenStreetBugs on the main OSM website. We should add support for this.

http://lists.openstreetmap.org/pipermail/rails-dev/2012-October/001080.html

Attachments (0)

Change History (27)

comment:1 Changed 6 years ago by Don-vip

Looks like the launch of this new feature is imminent.

comment:2 Changed 6 years ago by Don-vip

It's live :)

comment:3 Changed 6 years ago by stoecker

If this is now official I think integrating OpenStreetBugs plugin and this system into core JOSM is a good idea.

comment:4 Changed 6 years ago by Don-vip

I agree but we need to be careful, because notes is not exactly the same as OpenStreetBugs, and OpenStreetBugs instance is still active AFAIK.

We should only integrate the parts of OpenStreetBugs plugin that are relevant to Notes, and add support for its new features (e-mail contact).

EDIT: There is not yet a complete documentation but I have asked for details here.

EDIT2: The API is described here: http://wiki.openstreetmap.org/wiki/API_v0.6#Map_Notes_API

Last edited 6 years ago by Don-vip (previous) (diff)

comment:5 Changed 6 years ago by Don-vip

Ticket #8675 has been marked as a duplicate of this ticket.

comment:6 Changed 6 years ago by Manu1400

I suggest to create a new JOSM plugin for support for OSM "notes".

comment:7 Changed 6 years ago by Don-vip

It is planned to do it directly into core, but this requires some work.

comment:8 Changed 6 years ago by anonymous

it would be sufficient to have a layer for notes in JOSM - most of the time the work can be done without it, but when the comment gives exact position, it is cumbersome to add the node at the right palce.

comment:9 Changed 6 years ago by Stemby

This ticket blocks #8840.

comment:10 Changed 6 years ago by Stemby

Cc: Stemby added

comment:11 Changed 6 years ago by extropy

It's 3 months already.

How long can this possibly take?
Just take OpenStreetBugs plugin and replace the URLs and have a working variant we can use.

The fact that it "is planned directly in core" discourages making a plugin and makes everybody just sit and wait.

/Troll mode off/

comment:12 in reply to:  11 ; Changed 6 years ago by stoecker

Replying to viesturz@…:

It's 3 months already.

How long can this possibly take?
Just take OpenStreetBugs plugin and replace the URLs and have a working variant we can use.

If it is so easy, then provide a patch. A simple Google search with "openstreetbugs api" and "Osm notes API" would show you, that these are two different things.

The fact that it "is planned directly in core" discourages making a plugin and makes everybody just sit and wait.

Whether it is a plugin or in core, the work is the same. Someone needs to write the interface. Currently nobody does this, so no progress.

If you need that feature, find someone who implements it or spend money to pay for implementation. But don't wonder when you find that such a task is worth more than a number with four digits.

comment:13 in reply to:  12 Changed 6 years ago by apmon

Replying to stoecker:

Replying to viesturz@…:

It's 3 months already.

How long can this possibly take?
Just take OpenStreetBugs plugin and replace the URLs and have a working variant we can use.

If it is so easy, then provide a patch.

It really should be that easy.

A simple Google search with "openstreetbugs api" and "Osm notes API" would show you, that these are two different things.

They are mostly very similar. Yes, they are no longer identical as they were originally planned, but predominantly they are changes in the parameter naming in the URL. The concept stayed pretty much the same.

Can you say what needs changing in the code other than going through all of the places where the URLs to talk to OSB are constructed and update them to the new schema?

The fact that it "is planned directly in core" discourages making a plugin and makes everybody just sit and wait.

Whether it is a plugin or in core, the work is the same. Someone needs to write the interface. Currently nobody does this, so no progress.

:-(

If you need that feature, find someone who implements it or spend money to pay for implementation. But don't wonder when you find that such a task is worth more than a number with four digits.

Compared to all of the other things going on in josm, this is a pretty minor task. So hopefully someone is willing to fix this pretty important and useful feature...

comment:14 Changed 6 years ago by ToeBee

Ian Dees and me worked on this today. We copied the OSB plugin code and went from there. Ian did some refactoring to take out the hackish practice of using the Node class to display notes on the map. As of now, note display works and adding comments as anonymous works.

The biggest issue is authentication. JOSM doesn't seem to have an easily accessible way of sending an authenticated HTTP request from outside of core. I came up with a hack of subclassing OsmConnection in order to give myself a proxy to call the protected addAuth method. This is working for basic auth but not for oauth and I'm not sure why. The oauth header is being added but the server is not recognizing it for some reason.

Our code is on GitHub. My initial attempt at doing auth is on a branch that may or may not survive:
https://github.com/iandees/josm-notes

comment:15 Changed 6 years ago by bastiK

Great! Glad to hear you got rid of the Node class hack. :)

As JOSM is probably the first external user of the Notes API (?) the problem with OAuth could in principle also be on the server side.

edit:
Should have read the wiki first: OAuth seems to work with this site: http://osmlab.github.io/osm-note/

The http header reads:

POST /api/0.6/notes.json HTTP/1.1
User-Agent: Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.10
Host: www.openstreetmap.org
Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate
Referer: http://osmlab.github.io/osm-note/?oauth_token=#######
Connection: Keep-Alive
Content-Length: 36
Authorization: OAuth lat="0", lon="0", oauth_consumer_key="#########", oauth_nonce="#####", oauth_signature="########", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1373816587", oauth_token="#############", text="well%20mapped%20..."
Origin: http://osmlab.github.io
Content-Type: application/x-www-form-urlencoded

text content:

lat=0&lon=0&text=well%20mapped%20...
Last edited 6 years ago by bastiK (previous) (diff)

comment:16 Changed 6 years ago by ToeBee

For those of you watching this ticket, I did just put an initial version of the notes plugin out there. It has basic functionality but still needs work. Because of #8875, it needs josm-latest plus some manual tweaking to use OAuth. Please see the wiki page for more information: http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Notes

comment:17 Changed 6 years ago by extropy

Awesome. Works like a charm. Not using OAuth.

Thank you so much.

comment:18 Changed 6 years ago by extropy

Non ASCII chars are not rendered correctly.
See http://www.openstreetmap.org/?lat=56.965657&lon=24.16492&zoom=18&layers=MN

Looks like new String(bytes, "UTF-8") is missing somewhere.

comment:19 Changed 6 years ago by grinapo

Cc: grinapo added

comment:20 Changed 6 years ago by ToeBee

Hmm that's odd. I actually tested it with some chinese text before I published the jar and thought everything was working. The note you linked to displays fine for me too. As far as I can tell, I should be getting an appropriately encoded string back from JOSM in the first place. Can anyone else confirm this?

comment:21 in reply to:  20 Changed 6 years ago by grinapo

Replying to ToeBee:

Can anyone else confirm this?

Yes, it's garbled for me, too, when checking Hungarian entries.

comment:22 Changed 6 years ago by Don-vip

Component: CorePlugin notes
Owner: changed from team to ToeBee

comment:23 Changed 6 years ago by ToeBee

Status: newassigned

For some reason everything worked when my locale was set to en_US.UTF8 but when I manually changed it to hu_HU.UTF8, things did indeed break. The fix was changing some code I copied straight out of the OsmApi class in core. I'm not sure why it broke since I'm pretty sure core doesn't have this problem... But regardless, please give it a try and make sure it is working. If so I guess I will close this ticket since the powers that be created a new Notes plugin component for trac so future problems can be filed as new tickets.

comment:24 Changed 6 years ago by ToeBee

Resolution: fixed
Status: assignedclosed

comment:25 Changed 6 years ago by grinapo

Component: Plugin notesCore

Aside from closing I have verified that it works now. Thanks.

comment:26 Changed 6 years ago by Don-vip

Component: CorePlugin notes

comment:27 Changed 6 years ago by Don-vip

Ticket #8910 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain ToeBee.
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.