2

I'm trying to import Osmosis schema into into a PostGIS DB. I followed this article.

I created a DB:

createdb osm_schema

Then I executed the following command:

osmosis --write-pgsql host="localhost" database="osm_schema" pgsimple_schema_0.6.sql 

pgsimple_schema_0.6.sql is the basic schema I found in Osmosis tarball inside Script directory. The command above fails to execute. I got the following error:

Nov 16, 2012 6:51:39 PM org.openstreetmap.osmosis.core.Osmosis run INFO: Osmosis Version 0.40.1 Nov 16, 2012 6:51:41 PM org.openstreetmap.osmosis.core.Osmosis run INFO: Preparing pipeline. Nov 16, 2012 6:51:41 PM org.openstreetmap.osmosis.core.Osmosis main SEVERE: Execution aborted. org.openstreetmap.osmosis.core.OsmosisRuntimeException: No default pipes are available as input for task 1-write-pgsql. at org.openstreetmap.osmosis.core.pipeline.common.PipeTasks.retrieveTask(PipeTasks.java:150) at org.openstreetmap.osmosis.core.pipeline.common.TaskManager.getInputTask(TaskManager.java:165) at org.openstreetmap.osmosis.core.pipeline.v0_6.SinkManager.connect(SinkManager.java:50) at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.connectTasks(Pipeline.java:74) at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.prepare(Pipeline.java:116) at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:86) at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:328) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351) at org.codehaus.classworlds.Launcher.main(Launcher.java:31)

What am I doing wrong?

3

Use psql to execute SQL scripts that generate schemas.

You don't need osmosis to generate OSM schemas. Osmosis reads and writes from files and databases, but it does not create schamas.

There's a detailed WIKI page on how to create the OSM schema and import OSM data using osmosis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.