NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello, All. I'm using JOSM (Revision:18583 Build-Date:2022-11-01 14:35:40) on windows-64, and try to load selection from an external file, but with no luck. :-(

Help says that there is a possibility to use urls in the search prompt for such files:

Fetch external file and replace selection A very under-used feature that lets you enter a web URL (file://, http://, https://, ftp://) in the search field. JOSM will then attempt to load that URL, and select any objects that it finds referenced in that file. JOSM will look for XML tags "way", "node", and "relation" in the document (clarify? examples?), and use their id attribute . You can access another OSM file on your hard disk this way and have JOSM select all objects that are present in the file (provided they are present in JOSM's dataset too).

The help is very vague on the subject. I've tried this with a "file://drive/path/file.ext" url, and even run an http server and used a "http://localhost/found-outlines.xml" url. And I've tried different file formats, like "wNNNNNNN", "<way id="NNNNNN"></way>" per line. Also nothing happens if I use standard osm (xml) file.

Did anyone make it working? How must the data to be formatted in the file, and how to give the url to the file correctly? Maybe it's disabled somewhere in the preferences?

asked 05 Apr '23, 08:02

mechanic_ua's gravatar image

mechanic_ua
11114
accept rate: 0%

edited 05 Apr '23, 08:04

1

Why are you trying to load an OSM file from a URL rather than just using File>Open ?

I've not spent much time manually editing OSM files but I would expect a way to require reference to nodes between the open and close tags too.

This question sounds like there is background that would be useful. What are you actually trying to do?

(05 Apr '23, 09:44) InsertUser

I'm not trying to open data with url, the data is already opened in editor. All I need is to load selection (select elements by an externally passed list of IDs). Those IDs I get from my own scripts, which fiddle with SQL queries to somehow process them. Actually I'm building a workflow to generate 3d city with as much existing data as I can collect. Some data is my-project-only-related, so there is no sense to clutter a global database with it. But I use osm objects' IDs to sync my own data among my tools. JOSM is a very handy tool to edit spatial data visually, and it's easy to generate it's format (xml) for data exchange. Multiple selection is mostly for merging layers with "merge selection" command. I know about remote control, but it would be more convenient to feed a long lists of id's directly from texts. I'd already started to invent the wheel, but someone has dropped those few lines in the help, which somehow stops me from reinventing an already existing (?) wheel :-) If it works, I need to know how, and if it doesn't, then nothing will stop me from facing a shiny brand new wheel. =)

(05 Apr '23, 11:40) mechanic_ua

Thank you, All. You helped a lot just doing nothing! ;-) While the question were itching, I decided to get my paws dirty with the JOSM source. At last. And now I can just build it, set some breakpoints, and trace whatever I cannot understand in the help system.

The right answer to my question is "Nope". :-|

No, there is no search string hooks in the last release of JOSM which will do something like that mentioned in the help. And yes, it just parses the url into the pair key='http', value='//localhost/file.xml'. This pair is used as the search settings in org.openstreetmap.josm.actions.search.SearchAction.SearchTask.realRun().

So, magic doesn't live in this code, just in the help..

Hope, that someone won't believe me, and will compile his own custom jar oneself! ;-)

permanent link

answered 06 Apr '23, 16:57

mechanic_ua's gravatar image

mechanic_ua
11114
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×622
×30

question asked: 05 Apr '23, 08:02

question was seen: 754 times

last updated: 06 Apr '23, 16:57

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum