Is there a way to look at all OSM tags in one geographical location? - openstreetmap

I would like to filter locations by a specific OSM tag but I am not sure what OSM tags exist to describe this location. It consists of places where aggregate (sand, gravel) is stored. I looked at tagFinder and taginfo listed here https://wiki.openstreetmap.org/wiki/Tags
Basically I know which geographical point I want to look at and I want to know how OSM tags that place. I will then use overpass turbo to create the query.
Thanks in advance for your help.
EDIT: I have found a solution but there are no features/tags for aggregates and gravel industries. Is there another data source where I could find such information, preferably worldwide? Something like OSM tags?

I have found that you can query features, by right-clicking on the button with the arrow and question mark, then clicking on a place and select "query features".
https://www.openstreetmap.org/
It will return nearby features and enclosing features in the panel on the left.

Related

Mapbox: Is there a way to retrieve all coordinates for a specific feature ID?

I'm building a feature where I need to extract all coordinates of a selecetd road/path in Mapbox when it's clicked on. I've attempted to use the queryRenderedFeatures method, but it seems the result list is fragmented. By "fragmented" I mean that if you have a road or path which is clearly just one long path/road when rendered on the map, it often consists up of 4-5-6 or more features, and you cannot really work out from the feature collection how they're supposed to be connected (in order)
I then tried to use the Tilequery API, but it doesn't return any coordinates for LineStrings.
Is there any API - server or client side - in Mapbox, where you can provide an ID of a feature and retrieve the all coordinates for a road or path?
Thanks in advance :-)
I think you're really asking: "is there a way to access complete LineString features for data in Mapbox's tilesets", to which the answer is, no, not really - other than trying to reassemble them in the way you have tried.
For your own data, you could host it using Mapbox's Datasets, rather than Tilesets.

How to plot a JSON file generated by osrm for route optimization into an OSM map

I am a complete newbie to computation of gps, gis and all these geoinformatical stuff. First I describe my lessons learned to arrive at gps data. You can skip this and go to the last two paragraphs where I explain my problem with osrm and how to map a route onto an OSM map via qgis or similar tools.
I tried to do some route optimization for a bunch of addresses to support my son's paper deliverer job. I was able to generate a list of gps data by using the Nomatim engine that is available via geopy.geocoders. It's kind of a Travelling Salesman problem (TSP).
By using geopy's distance calculator and the or-tools from Google to Generate a shortest list recommendation. That worked well but it was only a TSP solution for air line :-(.
Then I was looking for route optimization toolkits but i struggled to get one for free. I thought osrm could be the right tool. I followed the descriptions given at Github, see here. I was able to generate a JSON file - at least I supposed that it's kind of a JSON file. But I was unable to project this back onto a map in QGis or any online tool from OSM. Can anyone help me?
The file with such JSON-like formatting:
{"code":"Ok","waypoints":[{"hint":"Jh4BgEUzI4BhAAAACwAAAKIAAABZAAAAkLAjQgpyikBay4dCWsuHQmEAAAALAAAAogAAAFkAAAArAAAAxwB4AARI3AI3AXgAWEbcAgIADwXVhXd1","location":...
Due to privacy issues I cannot post it here with any locations. Sorry for this. But does anyone have kind of a recipe / step-by-step guide what I need to do to plot it? I even have no idea how to "open" a map within qgis. You need to do this as kind of a database but this is totally new for me. I would prefer to work with an easier method to plot it.
Thanks in advance for any help.
Please follow the API documentation here. From that documentation
hint Unique internal identifier of the segment (ephemeral, not
constant over data updates) This can be used on subsequent request to
significantly speed up the query and to connect multiple services.
E.g. you can use the hint value obtained by the nearest query as hint
values for route inputs.
You can get the geometry in many ways. Widely GeoJSON is being used by developers. OSRM returns a very clean GeoJSON which can easily be used with Leaflet, Mapbox or other Map APIs. You need to send steps parameter true to get the full step by step direction. You can get the each segments of steps in legs. So call the GeoJSON within the geometries of every legs with loop. You can also get the geometry without passing the steps parameter true. For that you will get full geometry in a single GeoJSON within the routes property.

How can i find certain types of buildings in OpenStreetMap?

i'm trying to make a list of all the police stations that are in OpenStreetMap.org so i can compare it with mine (a full one with all the police stations in the country) and add the ones that are not there. at the moment i'm doing it one by one, searching from my list and if it is not in the map i add it. but i want to now if there is a way to make the map show me all the police stations that are in a country or a region. if someone who knows about OSM could help me that would be great
To find the policestations you can use e.g. OverPass-API (I recommend TURBO). The more complex way is to use the planet.osm dump / extracts and process it using filterers (e.g. osmosis). Last one is more complex, but allows you to controll the area more precise.
Please be aware that building is the wrong feature. Some mappers prefer to map the amenity / usage as a seperate POI and some policestations are mapped as are for the whole site of the station. Be also aware that the community is skeptical about imports and quality of external datasets.
You can use e.g. Overpass to query OpenStreetMap for features. Here is the query that you need to retrieve all police stations.
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity=police”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “amenity=police”
node["amenity"="police"]({{bbox}});
way["amenity"="police"]({{bbox}});
relation["amenity"="police"]({{bbox}});
);
// print results
out body;
>;
out skel qt;
You can run the query with Overpass Turbo, here. First position the map over the area you are interested in, then press "Run".
You can use any of the export options to download the results, instead of viewing them on the map
I forgot to mention that a police station is not really a building type in OpenStreetMap, it is considered an amenity. More information about the correct tagging can be found on the OpenStreetMap wiki, but this system does not allow me to post more links to help you further.

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 assume I'll have to start from a node tagged (k=name, v=city_name) and (k=place, v=city), and based on it's id to find a way node.
Is my assumption correct? If yes, can you give me some directions on what should I look for once I have the node corresponding to the city?
Note. I went through the OSM wiki and studied a little bit the OSM XML format, however I was not able so far to have a whole picture of the OSM XML structure, so perhaps someone who has more experience with this can help me.
Administrative boundaries are mapped as ways or relations with a boundary=administrative tag. The boundary type is specified by an admin_level. The admin_level value for cities differs from country to country and can even include multiple values. But for most countries, admin_level values for cities range from 6 to 8 (for the US it starts even from 5). In contrast, US states have an admin_level of 4. With the help of these keys you can construct a Overpass query for specific cities/stares, or even query for all cities and states. Here is an example for Denver:
[out:json][timeout:25];
// gather results
(
way["boundary"="administrative"]["admin_level"~"6|7|8"]["name"="Denver"];
relation["boundary"="administrative"]["admin_level"~"6|7|8"]["name"="Denver"];
);
// print results
out body;
>;
out skel qt;
You can see that it will yield multiple results. Look at the place and admin_level tags to determine the importance of your results.
Alternatively you can use a geocoder as for example Nominatim. Here is an example for Denver. In contrast to Overpass API, Nominatim will weight the results by importance. It also supports multiple output formats and can return polygons (which you can use for determining the bounds). Please read about Nominatim's usage policy when using the instance at nominatim.openstreetmap.org.
And also see search engine results.

Lucene.NET faceted search

I found a great tutorial on performing a faceted search.
http://www.devatwork.nl/articles/lucenenet/faceted-search-and-drill-down-lucenenet/
This article does not explain how to retrieve the narrowed available attributes to filter from (for further drill down).
Lets say I am looking for planners that are red. When I perform the faceted search, I want to return all available attributes to filter from that are red. Then when I add a "weekly format" filter, I want the attribute list to get even smaller, containing only filters available for the segmented group.
I want love to use Solr/SolrNET but I am in a shared hosting situation with limited access to the actual server.
I am fairly new to lucene.net, so examples are much appreciated.
IIUC, you get a BitArray containing the list of the filtered results. In the tutorial's example, you will have combinedResults as this list. If you want to further narrow this down, you need to reiterate the process: run another searchQuery and intersect the results with the BitArray you have for combinedResults.
I want love to use Solr/SolrNET but I am in a shared hosting situation with limited access to the actual server.
You can always use an off-site, hosted Solr solution. See this question for more information.