openstreetmap

Change Projection in OpenLayers Map

落花浮王杯 提交于 2019-12-06 07:14:02
问题 I want to set "EPSG:4326" as the projection of an OpenLayers map, but when I try it, I always get "EPSG:900913". function init() { var options = { projection: new OpenLayers.Projection("EPSG:4326") // ignored }; map = new OpenLayers.Map('map', options); var layer = new OpenLayers.Layer.OSM.Osmarender("Osmarender"); map.addLayer(layer); ... alert(map.getProjection()); // returns "EPSG:900913" ... } The base map is open street map. How can I set the Projection to EPSG:4326? 回答1: It is

OSM: convert ties from projected coordinates in spherical mercator “EPSG:900913” to “EPSG:4326” coordinates

萝らか妹 提交于 2019-12-06 06:56:12
问题 I'm using a map with a layer (from the example): var lonLat = new OpenLayers.LonLat(40.4088576, -86.8576718) .transform( new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 map.getProjectionObject() // to Spherical Mercator Projection ); on moveend i'm get center coordinates: map.getCenter(); map.getZoom(); and zoom level: 4925535.4503328, -9668990.0134335, 12 Using algorithm from documentation public PointF TileToWorldPos(double tile_x, double tile_y, int zoom) { PointF p =

Alternative to google place api? [closed]

旧城冷巷雨未停 提交于 2019-12-06 05:48:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm developing an iphone app that is using Google Place API. As far as I know, Google allows 1000 queries per 24 hour for this Place API, and 100,000 queries per 24 hour if the account is verified with a credit card. Exceeding 100,000 queries per 24 hour will incur extra charge. I'm asking if there is any another

How can I automatically plot markers for addresses on a Google or OpenStreetMap?

故事扮演 提交于 2019-12-06 01:24:44
I have a list of UK addresses and would like to plot them on a google or openstreetmap (I dont mind which). Is there a way to render a batch of addresses on a map with dots to represent the location (rather then the standard marker). To make things slightly more complex, I would like to change the colour and size of some markers. The data source is a street address including postcode and a marker type (size, color). Does anyone know of a site, script, process to achieve this? The geographic region will be a suburb so it is quite a small area. You can use the Google Geocoding service to spin

Flash library for OpenStreetMap

一世执手 提交于 2019-12-06 01:22:58
Is there a library in Flash to access and draw vector data from OpenStreetMap? See Halcyon . It is an OSM rendering engine written in flash. It downloads and renders vector data, not pre-rendered tiles. One option would be to use OpenLayers, which can draw OpenStreetMap data. One example use of this is the data layer on the OpenStreetMap website (Click the blue + in the top right and the check data). Alternatively you could look into the upcoming replacement to the current online OpenStreetMap editor Potlatch, which has a data viewer fully built in flash, which in active development. Search

How do I activate a feature + popup when clicking outside of a map in Openlayers?

纵饮孤独 提交于 2019-12-06 00:52:46
问题 I'm re-parsing the KML that's already been loaded onto the map similar to the example here: http://openlayers.org/dev/examples/sundials.html and turning it into a clickable list that will center the map on the point clicked, and display the popup window for it. This was really easy to do in Google Maps, but I can't find any similar Openlayers examples. Is there any easier way to do this? Something built-in that I'm missing? HTML : <ul id="locationTable"> </ul> JS: htmlRows = ""; for(var feat

Parsing osm.pbf data using GDAL/OGR python module

青春壹個敷衍的年華 提交于 2019-12-05 23:46:00
I'm trying to extract data from an OSM.PBF file using the python GDAL/OGR module. Currently my code looks like this: import gdal, ogr osm = ogr.Open('file.osm.pbf') ## Select multipolygon from the layer layer = osm.GetLayer(3) # Create list to store pubs pubs = [] for feat in layer: if feat.GetField('amenity') == 'pub': pubs.append(feat) While this little bit of code works fine with small.pbf files (15mb). However, when parsing files larger than 50mb I get the following error: ERROR 1: Too many features have accumulated in points layer. Use OGR_INTERLEAVED_READING=YES MODE When I turn this

Android draw route on openstreetmap [closed]

南笙酒味 提交于 2019-12-05 17:09:15
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 4 years ago . I am looking for a way to draw a route path on openstreetmap in my android app. I only have the start and end points, however do not want just a straight line. Any ideas on how I could do this? For obtaining a route you can use one of the various online routers for OSM . Many of them offer a GPX export of the calculated route which you then can display in your application. Have

Using osmosis to convert POSTGIS Table to .OSM

久未见 提交于 2019-12-05 15:55:24
I am using osmosis 0.42 and PostGIS 2.0.1 and I'm trying to export some postGIS tables to .OSM xml files. I am using the --read-pgsql command to read from postgis (instead of --read-apidb as it throws an error while connecting to the DB ).. Unfortunately running: osmosis --read-pgsql host="x" database="x" user="x" password="x" --write-xml file="myfile.osm" produce the following error: Task 2-write-xml does not support data provided by default pipe stored at level 1 in the default pipe stack Any ideas? Thanks a lot! Fede I have not found a solution despite the fact that my data in postgis has

Osmdroid and Pinch

末鹿安然 提交于 2019-12-05 11:16:29
I'm developing an app using osmdroid (3.0.8). When I zoom using two fingers in and out, the zoom starts from the center of the map, not from the middle of the two fingers (using MapView.setMultiTouchControls(true); ). I've tried to implement the pinch ( pinch ) but with bad results. I've read other similar questions but without finding a good solution. Note: I MUST use OSM, and not other solutions Osmdroid 3.0.10 includes support for zooming at the location you pinched at. The samples also include a two-finger rotation gesture overlay if that is something you are interested in trying. 来源: