Tag Info

Hot answers tagged

4

I'm not familiar with programming in JavaScript but in the OpenStreetMap Wiki there is a section describing "Mercator". Following this link you'll find a sample code snippet to tranform from lat long to mercator. I actually don't know if it's correct because I did not test the code.


4

As you query to have only nodes it is that all you get. See http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide#Nodes for more details. Your query should be http://overpass-api.de/api/interpreter?data=(node(52.06,5.04,52.08,5.06);<;>;);out;


3

You can use an intersection of the features. You can find it here: Vector > Geoprocessing Tools > Intersect... As the input layer you use the roads. As intersect layer you use the provinces of the netherlands. Either you can make a filter for the province you need or you select the province and check the Use only selected features box. Then you can ...


3

No, it's not possible to recycle the database, as both tools do very different tasks and therefore they create very specific datastructures to run nice and smooth. Please import another time your DB dump for mapnik, as explained here: www.switch2osm.org


3

Check out the Overpass Turbo API. Use the wizard to simply search for your desired OpenStreetMap routes using their location or the route's osm-id and then press the export-tab. There you can choose "KML" as an export format.


2

When you define your vector source, put the projection setting pointing to the target coordinate reference system (see the docs): new ol.layer.Vector({ title: 'added Layer', source: new ol.source.GeoJSON({ projection : 'EPSG:3857', url: 'mygeojson.json' }) }) Look at this example (using your sample data): ...


2

Have a look at mapsforge ... this framework uses offline vector map files based on OpenStreetMap. next to the source code on github, there is also a quite active mailing list on googlegroups. On github you can find some wiki articles how to start, and also a sample app with all basic feeatures.


2

Actually there isn't anything called an osm_id, at-least not officially. In the OSM database, each node, relationship, way etc have a unique id.This uniqueness is only within a particular element type. i.e. there could be a node with id 1023, a relationship with id 1023 as well as a way with id 1023. These are often called the OSM ID for that particular ...


2

There seems to be something wrong with the style file option. Try: F:\randomGISstuff\ethiopia>osm2pgsql -c -G -U postgres --hstore -S F:\randomGISstuff\ethiopia\default.style -U postgres -d ethiopia ethiopia-latest.osm.pbf If the user needs to give a password, you might have to put it on the command line as well. It might help to always give the full ...


2

The ArcGIS network analyst extension needs a properly prepared network dataset (graph) for routing. Ordinary OpenStreetMap data sets are not routable because they are simple linestrings. Take a look at the OSM2NetwordDataset tool by Eva Peters. This tool creates a routable network dataset and takes turn restrictions (from OSM relations), oneway roads and ...


1

Here is a list: Create a simple in-memory graph with nodes and edges. Apply A* to it (there are many examples on the web) Then look into the OSM data structure and build a simple parser (or reuse existing) to fill your in-memory graph then run A* on it via nodeIDs or lat/lon for start and end location create the address search which returns a nodeID or ...


1

Streets data are the most important part of your project. You have to get vector data with few requirements: it must be a complete network, without gaps and isolated streets each street beetween two nodes should be a single object, it should start and end in particular node, you can even split streets to straight lines (each single straight line is single ...


1

If you have to implement your own, then read here: http://en.wikipedia.org/wiki/A*_search_algorithm That way you learn the most. But if you start from scratch and want to implement ALL steps on your own, then it is a major task you are looking at.


1

Depending on your configuration, setting wtr.finalMask=bike rtr.supportedRouteClazzes=bicycle filters all cycleways and adds ways referenced by Bicycle-Relations. You'll find the extra info in the meta-column of the *_4pgr-PostGIS-Table. In order to modify costs, you'll have to overwrite the DefaultJoinFilter.validate(Way way) -method.


1

Nominatim and Mapnik/renderd use different database schemes, so you better put them in separate databases. See Can we use existing plant database for Nominatim for more details. Unfortunately, noone has ever documented the nominatim database scheme yet.


1

In the example of Anita Graser the st_distance function is used in combination with min() to get the nearest node for every airport.if you have the id's of the nearest nodes you can loop through your table and use this id's for the pgr_drivingdistance function. You can also have a look at the following three links where you always find a good answer from ...


1

You could use ST_LineMerge http://postgis.net/docs/ST_LineMerge.html First you need join all your ways into one MultiLineString using ST_DUMP http://postgis.net/docs/ST_Dump.html and ST_Multy Afterwards use ST_LineMerge to get a set of Linestrings of maximum length sewed from segments.


1

The default.style file https://github.com/openstreetmap/osm2pgsql/blob/master/default.style does not pick maxspeed into its own column. Edit default.style or use the --hstore option for writing all the tags into hstore.


1

Answering my own question here in the hope that this helps others (or my future self). In the intervening weeks since I posted the question, I was unable to find an elegant solution to this problem that could be done algorithmically in PostgreSQL. Instead, I broke the task down into constituent parts and more or less brute-forced it. For the purposes of ...


1

I've had good luck using the 6-color algorithm described in the introduction to Two Linear-Time Algorithms for Five-Coloring a Planar Graph. Although it's certainly possible to color a graph using fewer colors, it may not look any better than using 5 or 6. ALGORITHM 6-COLOR. Given an n-vertex planar graph G in adjacency list form, this algorithm ...


1

Finally I decided to use Quick OSM plugin, which allows you to make a query based on a territory name or a layer (which can contain vectors).


1

Maybe you could rely on osm2x3d project. Demo here: http://web.osm2x3d.net The main feature is to convert osm xml data to x3d format (3D scene graph). Also using x3dom js library, it allows to render the result natively in a web browser.


1

You could use leaflet, an open source JavaScript Library for interactive maps. It supports drawing circles on a webmap using the circle-class. All you need is the geographical point and the radius in meters. You can find a simple example in the quick start guide.


1

I would recommend the following approach: it returns coordinates for ways' nodes 'in place', like you described in your question. The only thing, which is missing in the output is the technical OSM node-id (ref). I assume that for use case of drawing some boundary area on a map, this is most likely not needed. If you take a look at the screenshot below, ...


1

I finally solved the problem with the following code: I left the code (almost) as it was before (especially the proj4) and as it is in the question. I then added the following: lat_min = 47.975 lon_min = 7.8 lat_max = 48.0 lon_max = 7.875 x_min = 6378137.0 * num * lon_min a = lat_min * 0.017453292519943295; y_min = 3189068.5 * math.log((1.0 + ...


1

I guess most tools around the rendering stack rely heavily on WGS84 and so it might be not a good idea to alter the projection of the metadata. Instead I would recommend to reproject the rendered image itself? Doing it on the data level seems to be very tricky: http://wiki.openstreetmap.org/wiki/Mapnik_GB_Projection


1

Maybe you can find some hints and solutions in this blog posting by the developer of the OSM-based routing solution Graphhopper. His project with your aim is called Map Matching


1

What you are after is a good map-matching algorithm. There are very few available off the self: see explanation and description on OSM. In case you're interested in simply using an API for that purpose, have a look at TrackMatching on my profile.


1

You didn't tell us how name and ref are related in your query but in case you want to get all objects with a specific name AND ref value then try this query: [out:json] [timeout:25] ; ( node ["name"="John F Foran Freeway"] ["ref"="I 280"]; way ["name"="John F Foran Freeway"] ["ref"="I 280"]; relation ["name"="John F Foran Freeway"] ...


1

Openlayers should fit your need, but I don't know what kind of "gis files" you want to deal with. Consuming and displaying 256x256px tiles is easy, but storing a whole country offline will slow down any application.



Only top voted, non community-wiki answers of a minimum length are eligible