Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapwriter plugin missing in the current osmosis package #229

Closed
qB0t opened this issue Nov 15, 2023 · 9 comments · Fixed by #236
Closed

Mapwriter plugin missing in the current osmosis package #229

qB0t opened this issue Nov 15, 2023 · 9 comments · Fixed by #236
Assignees
Labels
bug Something isn't working

Comments

@qB0t
Copy link

qB0t commented Nov 15, 2023

Followed all the instructions for Mac OS, tried creating a map for Cyrpus (only one country) and got this:

ERROR:subprocess error output:
ERROR:Nov 15, 2023 10:30:10 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.49.0
Nov 15, 2023 10:30:10 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Nov 15, 2023 10:30:10 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type mw doesn't exist.
	at org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactoryRegister.getInstance(TaskManagerFactoryRegister.java:69)
	at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.buildTasks(Pipeline.java:51)
	at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipeline.java:112)
	at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86)
	at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)


ERROR:Error in creating map file via Osmosis with tile: 150,100. mapwriter plugin installed?

Was unable to install any other version of osmosis than the current 0.49.0 that comes with brew.

@qB0t qB0t added the bug Something isn't working label Nov 15, 2023
@treee111
Copy link
Owner

Hi @qB0t,
the mapwriter plugin does not come with the osmosis installation.
It is downloaded during usage of wahooMapsCreator and saved in path:
/Users/<username>/.openstreetmap/osmosis/plugins

  1. Could you please have a look what files are in this path on your Mac. There should be a file with the name mapsforge-map-writer-0.18.0-jar-with-dependencies.jar. Maybe this is a authorization issue.
  2. Which version of wahooMapsCreator are you using? run inside your Anaconda environment: pip show wahoomc
  3. What are the first lines of output if you run processing of a example country using this command? python -m wahoomc cli -co malta -v

@alfh
Copy link
Contributor

alfh commented Nov 19, 2023

I have been thinking if one should replace the osmosis with rather using osmium merge for this as well.
It seems we are using osmium for most of the steps. And although I really like Java, it would allow us to just use one tool, and also not requiring the Java to be installed and the separate plugin to be downloaded.

I have not actually tried the osmium merge, but it is on my todo list. I also saw that there is a "tag replace" functionality as part of osmium, although it requires a separate tool from the same author as osmium.
At least it would be fun to try manually if the osmium merge produces the same results as omsosis.

@treee111, I also wonder if it has been considered before to replace osmosis ? It seems to be in "maintenance mode", with no new features being added. So the osmium seems like a better long term solution as well.

@treee111
Copy link
Owner

I think a long time ago I concentrated on using fewer and the same tools on both (main) supported OS: macOS and Windows. You are right, at the moment there are still some tools used and different installation methods for both OS (and maybe also different tools when looking into very detail).

If I remember correct, writing map files using the mapwriter plugin was one thing not easy to replace.

If the results are the same (unittests) or at least very near on both OS, I have no problem switching tools. Apart from performance I have no features on the roadmap and in combination with limited time at the moment wahooMapsCreator is mainly in maintenance mode.

Thank you for your contributions to keep the lights on and have some codechanges 👍

#217 goes into the same direction where I am working on at the moment.

@ldimlight
Copy link

I've had the same issue with mapsforge-map-writer plugin not being loaded by osmosis, although the plugin file exists. I've managed to solve this issue by downgrading osmosis to version 0.47, which works.
I've uninstalled the brew version, downloaded the older one from http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-0.47.tgz, unpacked and added the bin folder to $PATH and the wahooMapsCreator runs successfully.

@ldimlight
Copy link

I see they've removed plugin support from osmosis 0.49.

From changelog https://github.com/openstreetmap/osmosis/releases for 0.49.0:
Remove Java Plugin Framework support (standard Osmosis plugin support remains).

And mapsforge-map-writer was one of those plugins.

@alfh
Copy link
Contributor

alfh commented Nov 21, 2023

Not familiar with the two plugin concepts, but I see
https://github.com/mapsforge/mapsforge/blob/master/mapsforge-map-writer/src/main/config/osmosis-plugins.conf
and
this commit
openstreetmap/osmosis@95a380b

Osmosis has two ways of registering plugins, the method used by all
in-built tasks (i.e. search for osmosis-plugins.conf files) and a JPF
(Java Plugin Framework) method.  The JPF mechanism was added before
Osmosis had any other concept of plugins but has became redundant when
Osmosis was refactored into many Java modules and developed its own
plugin mechanism.  The JPF approach may have some advantages around
classloader separation but it's very complicated and hard to understand.
This change simplifies the Osmosis startup process considerably.

So to me, it seems like the mapwrite plugin would still be supported

@treee111
Copy link
Owner

Hi all,
thanks for digging into this!
You are right, the way of installing the Map Writer plugin like written in the docs is not valid anymore. I was able to reproduce on my device and opened a issue to get to know the way of correctly registering plugins in osmosis v0.49.0: openstreetmap/osmosis#140.
I'll try out on my device if I get it to work with help of the internet.

@treee111 treee111 self-assigned this Nov 21, 2023
@treee111
Copy link
Owner

a little update on this issue:

  1. as a hack (and how other integrated plugins work), this has been tested by some people and works:

    • put the map-writer plugin into libexec/plugins
    • add to the the classpath in libexec/osmosis at the end of the line: :$APP_HOME/plugins/*
  2. @alfh made good progress of reverting the removal of JPF. It seams that osmosis team will have the JPF feature back in a later release and means that the implementation Mapwriter plugin in wahooMapsCreator can stay as-is. Hence we will not dig into getting the hack or any other way implemented.

@treee111
Copy link
Owner

treee111 commented Dec 3, 2023

Hi @qB0t, new version of osmosis is released & published to brew. See the referenced PR and FAQ for reference.

Would be happy if you could check on your end if the latest osmosis version works as well. Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants