Hello all,
For developing purposes I've started to set up my own OSM infrastructure. The first step was, to install the overall OSM-Website. The github page states that the rails port includes the website itself (including the web front-end, user management, diary functions...), the editors, GPX Uploader and the XML based API 0.6.
For this question I want to concentrate on the OSM XML API 0.6 (more questions will pop up later on but to keep it as simple as possible, I will ask different type of questions in separate threads).

So...I've set up the osm website and I've also followed the Configuration Steps. Now I've tested the website. I can browse the web frontend (it seems everything is working) and user management also works. Next step was to test the API.


I've created some fist requests using a REST-Console and made the following queries:
Creating a changeset using the following URL:

localhost:3000/api/0.6/changeset/create

And the following input using PUT:
<osm>
<changeset>
<tag k="created_by" v="JOSM 1.61"/>
<tag k="comment" v="Just a comment"/>
</changeset>
</osm>

This gives me a reasonable output of showing me a number. For example

4

So...I would assume that this is working, right?


I've made another request by using GET with:

192.168.178.66:3000/api/capabilities

This gives me the following response:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<api>
<version minimum="0.6" maximum="0.6"/>
<area maximum="0.25"/>
<tracepoints per_page="5000"/>
<waynodes maximum="2000"/>
<changesets maximum_elements="50000"/>
<timeout seconds="300"/>
<status database="online" api="online" gpx="online"/>
</api>
</osm>

Looks like that this is also working.


Now I want to get some data using the API, so I've tested this by using the following GET request, but there is nothing as a output. But actually this should give me the same output than using the openstreetmao.org link below, shouldn't it?

localhost:3000/api/0.6/node/271428118
http://www.openstreetmap.org/api/0.6/node/271428118

I've also tested it with a request using a bounding box, which offers, using the openstreetmap.org website a map.osm file download. Using my localhost instance, I get nothing. The site/connection is not available.


So...for this part I have the question of how to get data using my own openstreetmap instance including the API. Hopefully I haven't missed anything.

Thanks for your help!

asked 14 May '14, 17:44

schlomm's gravatar image

schlomm
56336
accept rate: 0%


You have not loaded anything into your database. Your installation is a totally separate one that knows nothing about any data that might exist in OpenStreetMap. Node 271428118 is a pub in Germany in OSM but the node with that ID could be a bus stop in Brazil in your database - or, more likely, just not exist in your database.

You can use Osmosis to load OSM data into your database (look for the --write-apidb task) but always remember, even if you do that, your database and OSM's database are two totally separate copies and changes to one do not influence the other.

permanent link

answered 14 May '14, 18:54

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
71.3k846451113
accept rate: 24%

Thanks for the explanation.Very helpful.Until now I haven't realized that my OSM-Website wants/tries to access other/local/own data than these from openstreetmap.org itself (although I've check the component overview about the OSM-Architecture before I've started). I've read through the setup guides, but I didn't find something regarding on how to integrate a own data-source as well as a own Tile-Server. Do you have any information about this? Of course I can create a new question about "How to integrate other services?" in another question - might be the best way of providing a good overview.

(14 May '14, 19:03) schlomm
Your answer
toggle preview

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:

×276
×240
×100
×53

question asked: 14 May '14, 17:44

question was seen: 4,333 times

last updated: 14 May '14, 19:06

powered by OSQA