openstreetmap

Import SQL Data into JS Array

二次信任 提交于 2019-12-13 06:30:24
问题 I want to display a map that shows an array of markers. I'am using OSM with the OpenLayers Library to do that. If I use static values everything works fine. But now I want to display markers that are in a SQL table. What's the best way to get the data and fill it into the JS array? This is my code: <script> map = new OpenLayers.Map("mapdiv"); map.addLayer(new OpenLayers.Layer.OSM()); var size = new OpenLayers.Size(10,10); var icon = new OpenLayers.Icon('img/marker.gif', size); epsg4326 = new

Import OSM all tags using osm2pgrouting

牧云@^-^@ 提交于 2019-12-13 04:42:50
问题 How to use terminal to import downloaded .osm data with all the "tags" into postgresql db. I am using this for now: osm2pgrouting -file /home/zia/Documents/Test/konya.osm -conf /usr/share/osm2pgrouting/mapconfig.xml -host localhost -port 5432 -dbname osm_dem -user postgres -passwd zia123 -prefixtables kn_ -clean 来源: https://stackoverflow.com/questions/26851113/import-osm-all-tags-using-osm2pgrouting

2D Open Street Map Data Representation in Meters

我与影子孤独终老i 提交于 2019-12-13 04:24:19
问题 I am in the process of converting OSM data into an open source Minecraft port (written in javascript - voxel.js). The javascript rendition is written such that each voxel (arbitrarily defined as a cubic meter) is created as a relation from a single point of origin (x,y,z)(0,0,0). As an example, if one wanted to create a cubic chunk of voxels, one would simply generate voxels as a relation to the origin (0,0,0) : [(0,0,0),(1,0,0), (0,1,0)...]. My question is this: I've exported OSM data, and

Simple Leaflet.js Marker Placement

試著忘記壹切 提交于 2019-12-13 03:40:04
问题 I'm using the open source Leaflet.js library to create a simple map. I'm trying to solve a specific problem though. Markers are tied to a specific lat/lng on a map, which makes sense, but I need to be able to make a marker have a fixed offset position from another marker, without it being tied to a lat/lng center. So for example, the map may look like this: But when you zoom out, it'll look like this: What I actually want is for the right marker to be a fixed offset away from the left marker,

Retrieve closest road when given (lat, long) using OSM in Postgres with Postgis using SQL query

偶尔善良 提交于 2019-12-13 03:14:30
问题 Given a set (lat, long) I am trying to find the maximum speed using "max_speed" and street type using "highway". I have loaded my database (Postgres and Postgis) as follows: $ osm2pgsql -c -d gis --slim -C 50000 /var/lib/postgresql/data/germany-latest.osm.pbf The closest related question I could find was How to query all shops around a certain longitude/latitude using osm-postgis?. I have taken the query, and plugged in a (lat, long) that I found in google maps for the city center of Munich

Graphhopper Route for Pedestrian android

六眼飞鱼酱① 提交于 2019-12-13 02:54:51
问题 How do i set route type to Pedestrian in Graphhopper android? I have been using GHRequest.setVehicle() method in android, and it does not work. I have tried using "foot", and "bike". None worked. Also, it doesn't work when i changed Algorithms too. Only Dijkstra_BI is working now. GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon). setAlgorithm(Algorithms.DIJKSTRA_BI).setVehicle("foot"); Thanks in Advance. The map data that i have contain following files. I am getting the following

urllib.error.HTTPError: HTTP Error 429: Too Many Requests

廉价感情. 提交于 2019-12-13 02:25:12
问题 Until last week, I have been able to use the python smopy package https://pypi.org/project/smopy/ to display map tiles obtained from openstreetmap https://www.openstreetmap.org/#map=4/-28.15/133.29 in a python program. But since last week, for some strange reason, smopy has been failing, giving the following error: Traceback (most recent call last): File "/home/pi/Python Learning/smopyTest.py", line 7, in <module> m = smopy.Map((-36.5,-150.0), z=0) File "/home/pi/Python Learning/smopy.py",

Adding a Shapes files as a Layer on Mapbox Map

一笑奈何 提交于 2019-12-13 02:08:40
问题 I have a shapes file from here. I wish to add it on a Map, similar to what is done on the web page. I am not quite sure how to proceed with it. I want to use it on Web and hence use JavaScript. Someone suggested me to use the shapes file as a Layer on the map. But how to go about it? Anyone experience with Mapbox , Leaflet or OSM please guide. 回答1: In order to load a SHP file and display it on a Leaflet / Mapbox.js map, you have several Leaflet plugins that can make the task easy. For example

How to convert HEXEWKB to Latitude, Longitude (in java)?

谁说我不能喝 提交于 2019-12-13 01:30:09
问题 I downloaded Street information from the Open Street Map project. This file is basically a CSV with the following fields: CSV fields ============================================== 1 : id; UniqueId of the street(always null for the moment) 2 : name; The name 3 : location; The middle point of the street in HEXEWKB 4 : length ; Length of the street in meters 5 : countrycode; The iso3166 Alpha2 Code of the country 6 : gid ; GlobalId (not use yet) 7 : type; The type of street (see bellow) 8 :

Offline maps OSM

亡梦爱人 提交于 2019-12-13 01:27:10
问题 I am a bit stuck with an idea of offline maps in android application. I want to use Open Street Maps. But how can I redesign their styles and then use in my project? By the way, the resource, I am looking for, has to be free.. Are there any good tutorials about this? I am new to this, so would be thankful for any helpful information. 回答1: Here are the basics: Raster tiles are awful . To my mind, this approach of mobile mapping is very old-fashioned and has no advantages (unless your plan is