FAQ Database Discussion Community

the unit of the distance and duration of road in osmbonuspack

I am using the OSMbonuspack library to display road in osm map , i succeeded to get the distance and the duration but i don't know what's the unit .Here 's the code : Toast.makeText(getActivity(), "distance="+road.mLength,Toast.LENGTH_LONG).show(); Toast.makeText(getActivity(), "durée="+road.mDuration,Toast.LENGTH_LONG).show(); A snapshot of the result is :...

Tiled OSM's - find the bounds of given city/state

I used the overpass api to downloaded a couple of tiled pieces of USA's map and now that I have the USA map locally, I would like to obtain the bounds of a given city (or state) without involving the API. Should I search for certain tags, or relations? I...

Local nominatim openstreemap with Speed limits

I'm currently running a local copy of the nominatim maps of openstreetmap on PostGIS. Is there a way i can get the speed limits into this database so i can return that information as well. I've found that this data is available when querying openstreetmap but require this to be...

Where does Nominatim get its address info?

Till now, I was using the Nominatim API to fetch landmark information from but recently, I've downloaded the OpenStreetMaps database, and tried to make my own dataset, so I would not rely so heavily on Nominatim services. I managed to extract from the OSM database the needed information (nodes tagged...

Cannot access the OSM database

I am trying to get the speed limit using the OSM through php. But, I am unable to do that because I am getting the message as written below: The data included in this document is from www.openstreetmap.org. The data is made available under ODbL. What could be the problem?...

Lat-Long of exits on a Freeway e.g US 101 say arranged in N-S direction

I am trying to find all exits on US 101 exits, preferably in the order North to South using the OpenGIS osm2pgsql. But no luck so far. Closes solution I found is: http://stackoverflow.com/questions/1960005/how-to-get-lattitude-and-longitude-of-us-interstate-exits-programmatically comes close with the SQL: select osm_id, name, ref from planet_osm_roads where highway='motorway_link'; The query: select osm_id,...

How to get planet-latest.osm.bz2 in my mysql database?

I have an Intel i3-2350M CPU @ 2.30GHz with Windows 7, 64 bit, 4GByte Ram and enough free HD space. The openstreetmap-file planet-latest.osm.bz2 is very big and compressed. (The version I have is 36 GByte compressed, and I believe it's like 100 GByte uncompressed. I have a mysql-database running, that...

Convert meters to foot in xml data via xsl transformation

I would like to modify my xml file by converting some values ([email protected]) from meter to foot. I am a newbie to xml and this should be no problem for one of you. The formular is: 1 meter are 3.2808 feet I want to convert the attribute value of node/[email protected]

Null Pointer Exception while getting current location using osmdroid

I'm using osmdroid AIP to get current location and display a overlay at that point but I get following error. Error is caused by String provider = mLocMgr.getBestProvider(criteria, true); but I don't know what's wrong. My Activity having error public class LSLocationSender extends Activity implements LocationListener, MapViewConstants { protected MapView...

Zoom to fit leaflet.js markers

I'm converting my site from google maps to leaflet/openstreetmap. On the site, search results show up as markers on a map. Results can have one marker, or 10, or 200. That's all fine and great. But when the results have multiple markers, I'm having trouble getting it to zoom/fit all...

Editing xml data

I have an .osm file which is basically an xml. I would like to remove all the elements in it which do not have a "highway" tag in it. The highway tag is an simple xml attribute. It's quite a large file and it's not easy to do manually. What...

osm file, parsing, memory error even with clearing elements.

I want to take an osm file, clean it, and then save it as a json file. The xml file is about 1 gb big. def audit(): osm_file = open('c:\Users\Stephan\Downloads\los-angeles_california.osm', "r") with open('lala.txt', 'w') as outfile: for event, elem in ET.iterparse(osm_file, events=("start",)): if elem.tag == "node" or elem.tag == "way":...

MapController setCenter doesn't work

I've got a GeoPoint gPt with 55.790833, 49.114444 coordinates. I add that thing to map and try to center. But my marker is not in the center of map (it's a little bit higher). What is wrong? This is my code: mResourceProxy = new ResourceProxyImpl(this.getActivity().getApplicationContext()); mapView = (MapView) v.findViewById(R.id.mapview); mapView.setTileSource(TileSourceFactory.MAPNIK);...

How to display polygons that are within a specific range (circle) using Leaflet

I am trying find a solution on how to display polygons that are only within a specific range, a circle with radius using leaflet. Polygons screenshots Before, I have ask for help regarding on the display of points within a specific range but this time, since a polygon have many...

error “illegal option --t” occus when import OSM map into postgis [windows environment]

I want to import OSM map into postgis, so used the following command in windows cmd console: osm2pgsql -U postgres -d osm -hstore -s _S ./default.style ./xxxx.osm But "illegal option --t" error occus: osm2pgsql illegal option --t Usage error. I don't know what's the meaning of "illegal option --t" and...

Separate forward and backward relation in overpass-api

I need to get from overpass-api all the data about one, specific public transport line. Let's say it has a number 148 in my city. I use something like this example below but this gives me combined ways of forward and backward routes. How can I get them separately? <osm-script...

Click inside the Path in Openstreetmap

I have two overlays in my openstreetmap app, Itemized overlay and Path overlay together. I want to provide click inside the path inside the path overlay and custom marker

How to add two geoJSON feature collections in to two layer groups

I have two geoJSON feature collections that I need to add to the map, and I also want them to be toggled on and off via the layer visibility controllers as shown in http://leafletjs.com/examples/layers-control.html how can I do this?...

Overpass API - URL fetching, not working on iPhone, working on mac

I've got this problem last time i did some coding in my project, and i just can't seem to find where the error should be located. When i try the URL in the browser on my mac, everything is working fine - and i get the json file displayed. My...

Why is PostgreSQL doing a sequential scan instead of a index scan in this query?

I'm working with OpenStreetMap osm2pgsql database. One of its table (planet_osm_line) have two indexed fields: osm_id (int, primary key) and way (postgis geometry). I'd like to find which streets intersect with a specific street, which I know by it's osm_id. So I do: SELECT name, * FROM planet_osm_line WHERE highway...

Use of Planet.osm with osmDroid for offline maps

does anyone know if it is possible to build an Android application using osmDroid that makes use of Planet.osm stored on an SD card? for example, you would store Planet.osm on a large SD card that has been put in a phone. The application loaded on the phone would then...

How to fetch GPS trace from web service based on OpenStreetMap

I'd like to get GPS all traces from this web service which is based on OpenStreetMap. Is it possible? How to do that?

Graphhopper Server - Create and use a custom vehicle type

While browsing https://github.com/graphhopper/directions-api/blob/master/docs-routing.md I found the option to choose one of the preset vehicle types car, foot and bike. But unfortunately I have to calculate the duration based on vehicles with caped maximum speed (slower than a car and faster than a bike) which are also not allowed to drive...

how to render a 3d map with html5/js with point of interest

i need to rendere a 3d map like https://www.airbnb.it/map and put on it some "point" at runtime, loading them dinamically via rest. have someone information about building a 3d map (eventually getting data from openstreetmap) via js or others techniques? thanks...

Options to create a reverse geocode system using OpenStreetMap

I need to create a local reverse geocode service for my specific country using open source maps. My first option is OpenStreetMap so I downloaded my country PBF file. Can anyone give any idea on how to start using this data? or other options? ...

MKTileOverlay not defined

I have a simple map application using openStreetMap that works well on all iPhone simulators ( xcode 6.1, IOS 7.1 & 8.1 ). However, when I compile on a real device (iPhone 4 iOS 7.1), I encounter some issues (see screenshot), the application doesn't recognize some classes, such as MKTileOverlay,...

Understand the response of Open street map query response

I am trying to get the speed limit of the surrounding locations of a specific coordinate. OSM Query: www.overpass-api.de/api/xapi?*[maxspeed=*][bbox=5.6283473,50.5348043,5.6285261,50.534884] Response: <?xml version="1.0" encoding="UTF-8"?> <osm version="0.6" generator="Overpass API"> <note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note> <meta osm_base="2015-06-09T07:04:02Z"/> <node id="21265775" lat="50.5350159" lon="5.6293520"/> <node...

Performance issue when zooming (Leaflet 0.7.3)

I'm facing a performance problem with Leaflet (version 0.7.3). I'm working with an OSM map that I use to display a bunch of CircleMarkers linked by decorated Polylines (with arrow pattern every 25px). Loading take a little time but the main problem is that when I zoom the map I...

Why osmdroid not working in offline mode (multiple questions)?

I am working on the OSMdroid library, and wanted to make it offline so i used this code mMapView.setUseDataConnection(false); but in this condition it won't even display the map other than the graph page. But when i change the boolean to true it again starts working. So how do i...

Map shows multiple markers (overlays)

I'm using osmdroid API for maps in my project. Below is the code I wrote to put an overlay(marker) on selected location. If I click on map to select any location, it puts an overlay there, but if I tap on map again to select any new location, it shows...

Extracting Data from .osm XML file With Php

I tried to extract some data from an .Osm File. So I have something like this: <way id="28747493" visible="true" version="7" changeset="9347177" timestamp="2011-09-19T21:48:11Z" user="Camilo Alvarez" uid="492132"> <nd ref="316077528"/> <nd ref="316077503"/> <tag k="highway" v="primary"/> <tag k="lanes" v="1"/> <tag k="name" v="Calle 51"/> <tag k="oneway" v="yes"/> <tag k="ref" v="Boyacá"/> </way> <way id="28747492" visible="true" version="9"...

How to enable horizontaly world repeat in google maps?

I am using Google maps (via OpenStreetMap) and need to have world repeated horizontally. I thought its by default, but it is not. var map; map = new google.maps.Map(element, { center : new google.maps.LatLng(mapa_start_X, mapa_start_Y), zoom : mapa_start_Z, mapTypeId: "OSM", mapTypeControl: false, streetViewControl: true }); map.mapTypes.set("OSM", new google.maps.ImageMapType({ getTileUrl: function(coord,...

Offline OpenLayers web app using offline OSM

I'm trying to create map based web app which user can set landmark on the provided map. Boundaries of map is limited to a small city, and the client computer is always offline, no internet access at all. After a whole day of googling I've found that combination of OpenLayers...

Drawing Road on Terrain Map

I have vertex Coordinates of Left and Right side of the road (Shown as green and black points). My terrain is an array which corners of squares represent a different height value. I was drawing my road by just giving interpolated heights to my each vertex but that doesn't give...

Undefined offset error in php?

Hello everyone! I am trying to parse a JSON/XML from OSM (Overpass Turbo) into php and trying to get the speedlimit value. I am able to get the value, but before that there are some errors "Undefined offset: 1 in C:\xampp\htdocs\android_connect\test-osm.php on line 44", which is this code if ($temp[1]=="maxspeed")...

the map wont show up using openlayer

i'm trying to use openlayer to display a map, but nothing is showing up, all i can see is a white page here is my code <!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script> <script> function init() { map = new OpenLayers.Map("basicMap"); var mapnik = new OpenLayers.Layer.OSM(); var epsg4326 = new...

Leaflet map sources

Is there a list for all potential map sources out there? On the sample page one can browse through four types of maps. What else is out there? http://tombatossals.github.io/angular-leaflet-directive/#!/

What does the fadeTime for the Citymaps SDK's CEMarker class represent?

Documentation claims only this: /** How long it takes the marker to fade in and out when visibility changes. */ @property (nonatomic, assign) CGFloat fadeTime; Does this CGFloat value represent seconds? milliseconds? No matter what value I supply: [marker setFadeTime:3000.0f]; // assume milliseconds or marker.fadeTime = 3.0f; // assume seconds...

How to implement offline map in web application and where can i get the map tiles for download?

currently i am trying to do a offline map feature in web application. When their is no internet connection i want to load map tiles from my application it self . How can i have the tile images stored with in my application during the network is available and further...

Displaying an auto updating map off a Google Sheet

I am trying to help witth rescue operations in Nepal. I have setup a Google Form here and that information gets stored on a Google Sheet. Now, I want to provide a map (OSM) that would autopopulate using data in the Google Sheet (there is a column with GPS coordinates....

Implementing shortcuts (reach) pruning while using A*

I am working on a project for shortest path finding. I have looked at alot of resources online to come up with a good algorithm. I am working with openstreetmap data and it's clear to me that I have to use A* algorithm. While looking for different solutions, I have...

unaccent() preventing index usage in Postgres

I want to retrieve a way with a given name from an OpenStreetMap database imported into PostgreSQL 9.3.5, the OS is Win7 64-bit. In order to be a bit failure tolerant, I use the unaccent extension of Postgres. My query looks as follows: SELECT * FROM germany.ways WHERE lower(tags->'name') like...

Postgres preferring costly ST_Intersects() over cheap index

I'm executing a rather simple query on a full planet dump of OSM using Postgres 9.4. What I want to do is fetching all ways which belong to the A8 autobahn in Germany. In a preparation step, I've created multipolygons for all administrative boundary relations and stored them in the...

.bindpopup function is not working for displaying a large amount of points onto a map (Leaflet)

I am trying to make use of the bindpopup function to display more than 100 points on a map, but the function is not working as expected. The points are added without any error on the map but when it comes to adding the .bindpopup function, no map is being...

Create picture from geocordinates [closed]

I have the geocordinates of a trip and I would like to save the picture that display the path on a map. Do you know an api or library that woud do that ?

Routing between places with mapbox or similar direction api

I have a geoJSON objects and I want to route between waypoints on my geoJSON file. { "type":"FeatureCollection", "generator":"JOSM", "bbox":[ 23.4668, 58.9198, 23.6412, 58.974 ], "features":[ { "type":"Feature", "properties":{ "wheelchair":"yes", "smoothness":"bad", "surface":"crushed stones" }, "geometry":{ "type":"Point", "coordinates":[ 23.53359252, 58.95034587858 ] } }, { "type":"Feature", "properties":{ "wheelchair":"yes", "addr:housename":"Saue kohvik", "amenity":"pub", "name":"Saue...