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

Hello,

I want to convert a .osm file (previously downloaded) to a .map file using Osmosis and Mapforge's mapfile-writer inside an Android application.

To do so, I created a new project (I am using Android Studio)

I imported the osmosis-core library (using implementation 'org.openstreetmap.osmosis:osmosis-core:0.43-RELEASE' in the build.gradle file)

I created a class with a public void main which calls Osmosis.run(new String[]{"--read-xml mapUPS.osm --mapfile-writer file=mapUPS.map"});

But i am getting this error :

java.lang.IllegalArgumentException: unknown plug-in ID - org.openstreetmap.osmosis.core.plugin.Core at org.java.plugin.registry.xml.PluginRegistryImpl.getPluginDescriptor(PluginRegistryImpl.java:729) at org.openstreetmap.osmosis.core.TaskRegistrar.registerCorePlugin(TaskRegistrar.java:212) at org.openstreetmap.osmosis.core.TaskRegistrar.loadJPFPlugins(TaskRegistrar.java:159) at org.openstreetmap.osmosis.core.TaskRegistrar.initialize(TaskRegistrar.java:88) at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:81)

I don't know where is the problem. Where am I wrong ?

Thank you in advance,

iomega11

asked 29 Apr '19, 14:44

iomega111's gravatar image

iomega111
11113
accept rate: 0%

edited 30 Apr '19, 09:39


If I understand what you are doing correctly you are essentially trying to run the command line version of osmosis on Android, I'm not ruling out that you could get it to work, but the Android JVM differs in a number of ways from "standard" Java and I'm actually slightly surprised you got as far as you did.

Using the various bits and pieces of osmosis as a library should however work, you just need to write the corresponding glue that joins everything together. For example I use the Osmosis's PBF reading support in Vespucci. If you are doing format conversion you will likely be rather limited in the size of OSM extracts you can convert.

Maybe you should explain a bit more what you actually want to achieve.

permanent link

answered 29 Apr '19, 15:44

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Hi SimonPoole, thanks for your reply.

On my computer I use osmosis via this command :

osmosis --read-xml mapUPS.osm --mapfile-writer file=mapUPS.map

I want to convert a .osm file (previously downloaded) to a .map file using Osmosis and Mapforge's mapfile-writer.

I have never heard of the Vespucci app, I will look at how osmosis is used in this app, in order to do the same with my app.

Thanks a lot !

iomega111

(30 Apr '19, 07:23) iomega111

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:

×252
×181
×29
×11
×6

question asked: 29 Apr '19, 14:44

question was seen: 2,173 times

last updated: 09 Jan '21, 22:52

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