Modify

Opened 6 years ago

Closed 6 years ago

Last modified 5 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 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by sanderd17

Attachment: data_uri.diff added

comment:1 Changed 6 years ago by sanderd17

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

comment:2 in reply to:  1 Changed 6 years ago by Don-vip

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 Changed 6 years ago by Don-vip

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 Changed 6 years ago by sanderd17

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 Changed 5 years ago by simon04

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.