[osmosis-dev] problems importing .osm files into postgis
Brett Henderson
brett at bretth.com
Mon May 3 02:11:48 BST 2010
On Sun, May 2, 2010 at 10:12 PM, _-_ <txp_unimatrix23 at web.de> wrote:
> Hi there,
>
> I've got a problem with importing .osm files into a postgis database.
>
> I think i set up the database correcly is, I used the
> pgsql_simple_schema_0.6.sql schema from osmosis.
> I also used the 900913.sql file.
>
What is the 900913.sql file for?
>
> When i try to import files like this:
>
> osmosis --read-xml file="madagascar.osm" --write-apidb host="localhost"
> database="osm5" user="postgres" password="12345"
>
>
> I'll get the following output/Error messages:
>
> #################################################
>
> SEVERE: Thread for task 1-read-xml failed
> org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to create
> resultset.
> at
> org.openstreetmap.osmosis.core.apidb.common.DatabaseContext.executeQuery(DatabaseContext.java:429)
> at
> org.openstreetmap.osmosis.core.apidb.v0_6.impl.SchemaVersionValidator.validateDBVersion(SchemaVersionValidator.java:82)
> at
> org.openstreetmap.osmosis.core.apidb.v0_6.impl.SchemaVersionValidator.validateVersion(SchemaVersionValidator.java:55)
> at
> org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.initialize(ApidbWriter.java:288)
> at
> org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.process(ApidbWriter.java:1046)
> at
> org.openstreetmap.osmosis.core.xml.v0_6.impl.BoundElementProcessor.end(BoundElementProcessor.java:85)
> at
> org.openstreetmap.osmosis.core.xml.v0_6.impl.OsmHandler.endElement(OsmHandler.java:107)
> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
> Source)
> at
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
> at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
> at
> org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:108)
> at java.lang.Thread.run(Thread.java:636)
> Caused by: org.postgresql.util.PSQLException: ERROR: relation
> "schema_migrations" does not exist
> at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:235)
> at
> org.openstreetmap.osmosis.core.apidb.common.DatabaseContext.executeQuery(DatabaseContext.java:424)
> ... 20 more
>
You are using the wrong task to write to the database. It doesn't support
that schema. So don't use these tasks:
http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#API_Database_Tasks
Use these tasks instead:
http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#PostGIS_Tasks
Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20100503/349a7f0f/attachment.html>
More information about the osmosis-dev
mailing list