Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10646 closed enhancement (fixed)

[PATCH] Allow data URIs in remotecontrol

Reported by: sanderd17 Owned by: team
Priority: normal Milestone: 14.10
Component: Core remotecontrol Version:
Keywords: Cc:

Description

It's currenlty possible to create a dynamic OSM file server-side, and serve it to JOSM users by using a remote-control link. But there are some downsides to server-side files:

  • Server-side modifications means that porting over websites is harder
  • When the files get cleaned on the server (f.e. generated files are no longer considered neccesary), the links become obsolete or wrong

Therefore, for rather small OSM files, the URI data schema would be handy.

Example: http://sanderd17.github.io/8840.html is a webpage I'm making (currently only working in Firefox) that should allow you to download OSM and official CRAB address data in several comparisons. It's meant to be rather portable, so others can host and improve it. Thanks to the data URI, it's possible to generate the OSM data purely dynamical via client-side scripts (which means that no apache, PHP, but just a webbrowser is needed).

Ideally, JOSM would also be able to open it through the remote-control as with server-hosted files.

Attachments (1)

data_uri.diff (8.1 KB ) - added by sanderd17 9 years ago.

Download all attachments as: .zip

Change History (6)

by sanderd17, 9 years ago

Attachment: data_uri.diff added

comment:1 by sanderd17, 9 years ago

Summary: Allow data URIs in remotecontrol[PATCH] Allow data URIs in remotecontrol

I went for a solution without the real data URI, in order to support more specific cases. But the data still has to be encoded directly in the URL. It supports adding data to a new layer or an existing layer. And in the case of a new layer, allows you to suggest a name for it (as the filename, like in the import case, can't be used).

Currently only OSM XML data can be encoded, but I included the option to add mime-types, so different kinds of data could be added (GPX, CSV, ...). With a default to OSM data.

This is my first patch, and my first time working with the JOSM code, so please point out any wrong things.

Click this link to try it (if there are no bugs in either the code or the link).

in reply to:  1 comment:2 by Don-vip, 9 years ago

Milestone: 14.10

Replying to sanderd17@…:

This is my first patch, and my first time working with the JOSM code, so please point out any wrong things.

Not bad for a first patch :) I'm refactoring some other code to avoid duplicated methods but this is very nice of you to submit a working patch :)

comment:3 by Don-vip, 9 years ago

Resolution: fixed
Status: newclosed

In 7636/josm:

fix #10646 - Remote Control v1.6: new load_data handler to load OSM data directly from URL (modified patch by sanderd17)

comment:4 by sanderd17, 9 years ago

Thanks, it's a very nice cleanup too. I didn't find a good way to avoid that duplication (also because the codebase is still unknown for me, and I don't know what things can be split up easily)

I didn't expect the review to be so quick ;)

comment:5 by simon04, 9 years ago

In 8191/josm:

see #10646 - Remote Control: simplify load_data implementation

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.