This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to access the timestamp value from Overpass meta requests with Openlayers.Format.OSM?

0

I am using Overpass-api to request data, then display it in an interactive webpage using Openlayers. When user clicks on some feature, the information is shown in popup.

As of now, the page is working nicely and displays all the tags.

I want to add the "last updated time" of the feature in the popup, which will correspond to the "timestamp" value in the "Overpass-api meta request" but i cannot access that value.

asked 05 Mar '13, 04:56

amritkarma's gravatar image

amritkarma
684212941
accept rate: 11%

1

Can you please give an example query URL?

(05 Mar '13, 05:15) Roland Olbricht

One Answer:

5

I assume this is not Overpass API specific, but a general issue when reading OSM XML with OpenLayers. Then you could give Format.OSMMeta a try, an extension to Format.OSM I wrote. Not well tested, but worked for me.

Include the file/code in your project and replace references to "OpenLayers.Format.OSM" with "OpenLayers.Format.OSMMeta" in your code.

answered 05 Mar '13, 09:49

ikonor's gravatar image

ikonor
1.3k21119
accept rate: 18%

Do you want to contribute that to the main OpenLayers source tree?

(05 Mar '13, 11:57) gormo
1

I plan to, but right now my focus is on making progress with my projects and gather candidates for sharing along the way. Then do some clean up, documentation and tests.

In this case I would like to discuss implementation details first, like: really mix meta info with tags? use a prefix? merge with OSM class? Also, I'm thinking about refactoring the OSM.read method and using one of the implementations for Relation support out there.

(05 Mar '13, 13:57) ikonor

Source code available on GitHub .