[OSM-dev] how to setup api/xapi server?

Mateusz L mateuszzz88 at tlen.pl
Thu Jan 13 00:12:56 GMT 2011


Ian Dees wrote:

> (...)
> Once this is finished, you should have a database that allows you to
> recreate the OSM XML data for bounding boxes of any size. Keep in mind
> that using an entire planet with this method will require 360GB or so and
> take a few days to import (depending on your disk speed).
> 

Hi, thanks for your answer.
I did as you advised and now I have database of my country (checked by $psql 
osm   and select * from nodes limit 10; ). Now I need sth to serve the data 
over network. Are there any tools avilable, preferably cgi-scripts? 
If not, I can code sth tailor-made, BUT I have one problem with osmosis:
I understand that to read the data from a bounding box i run command:

$bin/osmosis \
--read-pgsql host="localhost" database="osm" user="osmuser" password="osm" \
--bounding-box top=49.5138 left=10.9351 bottom=49.3866 right=11.201 \
--write-xml file="-" 

or even simpler 
$bin/osmosis --read-pgsql host="localhost" database="osm" user="osmuser" 
password="osm" --write-xml file="test.osm"

But both give me following exception:

2011-01-13 01:07:37 org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version SNAPSHOT-r24991
2011-01-13 01:07:38 org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
2011-01-13 01:07:38 org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task 2-write-xml 
does not support data provided by default pipe stored at level 1 in the 
default pipe stack.
        at 
org.openstreetmap.osmosis.core.pipeline.common.PipeTasks.retrieveTask(PipeTasks.java:157)
        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:616)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:31)



Am I doing something wrong?

-- 
Mateusz




More information about the dev mailing list