More

How do I find OSM way-id from latitude/longitude?


How do I find the way-id (in an OpenStreetMap), from the latitude-longitude combination? To give some context:

I have loads of sensors that report pollution data (roughly) in the form: lat, long, timestamp, value

Given that I'll have many sensors, I want to tag each 'way' with the amount of pollution recorded, so that my routing algorithm (GraphHopper) can assign different weights to each way.

Any ideas?


What you are looking for is called 'reverse geocoding' and is implemented e.g. with Nominatim API


Vivek, one issue you will have is for very long ways. Returning the OSMid for a long way will inhibit that whole way being used, rather than a possible simple route around the problem area.

If your area is not huge, (city size) you may want to consider PG_Routing as you can dynamically update the routing tables for an individual segment based on a lat long look up using PostGis functions.

Alternatively, you could build the sensor positions into the routing graph easily and then just weight those with a High Cost in real time

PG_routing is not a particularly fast performer, but it is great for these types of requirements as it is all in the database and very flexible.

I am discussing a Graphhopper/Pg_Routing bridge on the Graphhoper list. The reason is that I want to be able to dynamically route at the country level (disaster and seasonal related changes like roads unavailable in rainy seasons, etc) and GraphHopper is a very good performer, but it only works on the XML files, which means rebuilding the graph, or updating an in memory table on a regular basis from the database and modifying the GraphHopper Source to look at the in memory table it and apply the weights.

Again, Graphhopper keeps the OSMId for the way, which can be very long in some circumstances, so you risk making an entire freeway non routeable where as a simple diversion might be all that is necessary in all practicality to get around the polluted area.

For smaller areas, I just use PG_Routing and I have all my data in a PostGIS database already.


Looking for corpus of Geographic Data

I was wondering if anyone has a lead on a corpus of geographic locations? City names and coordinate pairs would be ideal. I'm training a chatbot and I'd (ideally) like it to be able to pick up on locations in the chat and then display a map if requested. For example, if the words "I'm headed to Chicago" were typed, the chatbot could render a map of Chicago. Wishes and wants aside, if y'all do know of one or how I could make one, I'd appreciate it.


Содержание

The simplest way to get started with Overpass API is to use Taginfo and to navigate to the tag you are interested in. Take post boxes as an example. Push the Overpass Turbo button there in the upper right. This will start the Overpass Turbo user interface and produce the following query

The Overpass Turbo user interface has a lot of capabilities. For the moment it should suffice that you have in the upper left corner of the map view a textfield. Type in your favorite location. It will then, with the use of Nominatim move the map view to that location. Type in e.g. Manhattan and choose the first hit. The map then jumps to the upper end of the Central Park in Manhattan. Zoom out two levels to see some of the built area. Run the query by hitting Run.

The Taginfo Example

Now we can start to understand the query.

Most of the previous query are comments - everything after // and between /* and */. Hence, a more concise variant of the query is

As we are about a simple example here, we reduce the query further in two steps to get it really simple.

We know for post boxes by common knowledge that they are always nodes:

And we can remove most of the cryptic syntax that mostly tells what to do with ways and relations. We can get the same result as before with only two lines.

All these steps work with an tag from Taginfo. There is no magic involved. It just replaces amenity = post_box with the respective value.

Some Standard Features

Now what about the extra syntax? Let us review them bit by bit. To see an effect, we switch to query for restaurants instead of post boxes, because then you can see the effect in adding support for ways.

Not all restaurants are mapped as nodes. Hence we want to search for ways and relations too:

Running this query will result in a message that geometry is missing. This is because the OpenStreetMap data model does not directly associate coordinates to ways and relations. Ways and relations instead get their geometry by resolving their node references.

The out statment has various modes to address this problem in a more convenient way: You can choose for example out geom to let Overpass API resolve the coordinates for you. Or you use out center to collapse the geometry to a single coordinate per object:

We can put all these requests simply one after another. Then we get the results one after another and Overpass Turbo displays them all at once.

The Taginfo generated queries use instead the sequence out body, >, out skel qt. This is merely for historical reasons. This does essentially the same as out geom but delivers elements strictly from the OpenStreetMap data model. Overpass Turbo nowadays can directly process the results of out geom and out center and the delivered raw data is more concise.

As a last step, we make the query more concise:

This still has the same result as before. But we have brought the bounding box to a single place in the beginning of the query. An important reason to do so is that you should develop the habit of having always a bounding box unless you really want results from all over the planet.

We also have grouped the query statements by an union statement - these are the parentheses. This allows to have only a single output statement.

The Taginfo generated query also uses two other global settings: The first is [out:json]. This might be an advantage if you want to directly read the returned data. You can do so on the Data tab over the map view.

The second one is [timeout:25]. This limits the runtime of the query to 25 seconds. If something goes wrong then the limit assures that neither the server nor you waste time. Like the Global Bounding Box it is a useful precaution.

In total, we arrive at the following request:

Rare Tags

If you do not know beforehand where you would expect a tag, but if you are pretty sure that there are not much more than some hundred elements, then you can drop the bounding box.

If you also leave the timeout setting out, then the server sets a default of 180 seconds:

Other examples

In addition to this page, there are lots more examples are in the Overpass API dev blog. There are also links to specific examples from sections below.


2 Answers 2

Google Maps data comes with many restrictions so isn't really suitable as a base for further use.

Although it can be of varying quality, Open Street Map (OSM) increasingly includes boundaries as well as ways (roads) and points, and is Open Data (subject to their terms of use including attribution).

The OSM data is in XML format (download link at bottom of the left column in the example) that lists the relations, ways and nodes in the boundary that was selected. In a nice simple case like that Acadia University boundary, utilities like osmtogeojson should be able to convert it into a mapping format like geojson, but it might struggle with a more complex nested boundary.

By comparing Google Maps with the OSM data you'll see there are some differences with the campus boundaries (especially north of Hwy 1 / Main St). It's debatable which is more accurate, the official campus map doesn't show any boundaries but does include (for example) buildings west of Westwood that neither Google or OSM include within the campus.

For a more general solution, many countries now have open data boundary files online, such as GeoBase for Canada. These are more likely just to be government admin areas (provinces, municipalities, ridings and so on), and can be a large amount of data to deal with.


1 Answer 1

First of all, you may want to split your data set into cities. This will probably yield better results than keeping everything together.

Then the tool of choice probably is ELKI:

  1. It contains lots and lots of algorithms for outlier detection. In particular, it has the Local Outlier Factor (wikipedia), which exactly tries to capture local differences in density
  2. It supports Geodetic distance, with different earth models
  3. It can use R-tree indexes for acceleration, so 300k is not a problem (but you may still want to split the data set on cities, for better results and without it, a hotel titled "Chicago" but with coordinates in California will still appear to be normal from the coordinates). I have used 100k multidimensional data sets myself already and I've seen the author use 23 million tweets in clustering.
  4. Open-source, written in Java.

You may also want to check the authors work on customizing outlier detection. This may be required if you want to process all 300k at once, and use the city and hotel columns as well. (Most methods are designed for numerical data!) From my interpretation of this model, you may want to define the context as hotels in the same city, and then compare the densities.

Schubert, E., Zimek, A., & Kriegel, H. P. (2014).
Local outlier detection reconsidered: a generalized view on locality with applications to spatial, video, and network outlier detection.
Data Mining and Knowledge Discovery, 28(1), 190-237.

hmm. thinking of your problem, this one may also be relevant, detecting outliers in car accident and radiactivity measurement data:

Schubert, E., Zimek, A., & Kriegel, H. P. (2014).
Generalized outlier detection with flexible kernel density estimates.
In Proceedings of the 14th SIAM International Conference on Data Mining (SDM), Philadelphia, PA.


Deep's Homepage

I have varied interests in computers, programming, GIS, etc. The purpose of this website is to share various resources and tools put together by me.

Just use the menu at the top of each page for browsing to any of the sections.

  • Deesha
    Award winning, completely free app which allows you to use your smartphone with location sensor for off road navigation. Has full support for the Indian Grid system.
    Map images created specially for use with Deesha from JOG mapsheets.
  • Indian Grid

      Information about the Indian Grid, it's usage and it's parameters.
      Convert between geodetic coordinates (longitude/latitude) and Indian Grid coordinates.
  • Settings for Garmin
    Configuring Garmin navigation devices for using Indian Grid system.
    • International Map of the World (IMW)
    • India and Adjacent Countries (IAC)
      Find map bounds for specified map number, find map number for a specified location or convert between IAC and OSM map numbers.
    • Android

        For the security conscious, an app to encrypt/decrypt text using AES 256-bit encryption with a symmetric key.
        To keep your text safe from traditional filters/bots, garbles the text with letter like Unicode characters.

      • Application to encrypt/decrypt plain text and binary files using AES 256-bit encryption with a symmetric plain text key.
        Java library to add popup menu and menu items with common text actions, for text components.
        Application which gives useful information about the Sun and Moon based on the excellent ephemerides by Tomás Alonso Albi.
        Java class to calculate magnetic declination, magnetic field strength, inclination etc. for any point on the earth.

        Swift class to calculate magnetic declination, magnetic field strength, inclination etc. for any point on the earth.
      • Sun Moon Calculator
        Swift port of the excellent ephemerides (in Java) by Tomás Alonso Albi.

        Check out if your weight indicates you as healthy as per your height.
        For a given location of receiver, calculate azimuth, elevation etc of a satellite based on it's location or location of satellite based on the it's azimuth and elevation.
        Phonetic Devanagari keyboard layout based on Shusha for Linux.
      • WhatsApp Text Formatter
        Create formatted WhatsApp messages with ease to paste in WhatsApp Web.
        Answer a few questions to learn more about yourself.

      In case you are a regular visitor do check out What's New since your last visit.

      In case of any suggestions, feedback or errors discovered, please feel free to get in touch with me.


      Import OpenStreetMap data into Unreal Engine 4

      This plugin allows you to import OpenStreetMap XML data into your Unreal Engine 4 project as a new StreetMap asset type. You can use the example Street Map Component to render streets and buildings.

      (Note: This plugin is a just a fun weekend project and not officially supported by Epic.)

      It's easy to get up and running:

      Download the StreetMap plugin source from this page (click Clone or download -> Download ZIP).

      Unzip the files into a new StreetMap sub-folder under your project's Plugins folder. It should end up looking like "/MyProject/Plugins/StreetMap/"

      Rebuild your C++ project. The new plugin will be compiled too!

      Load the editor. You can now drag and drop OpenStreetMap XML files (.osm) into Content Browser to import map data!

      Drag and Drop imported Street Map Data Asset into the viewport and a Street Map Actor will be automatically generated. You should now see your streets and buildings in the 3D viewport.

      If the rebuild was successful but you don't see the new features, double check that the Street Map plugin is enabled by clicking the Settings toolbar button, then click Plugins. Locate the Street Map plugin and make sure Enabled is checked.

      If you're new to plugins in UE4, you can find lots of information right here.

      Getting OpenStreetMap Data

      Legal: OpenStreetMap data is licensed under the ODC Open Database License (ODbL). If you use this data in your project, make sure you understand and comply with the terms of that license e.g. lookup the Legal FAQ.

      Here's how to get data for a location you're interested in:

      For larger areas (more than a neighborhood or small town) you should use Mapzen Extracts.

      Go to OpenStreetMap.org and use the search feature to navigate to your favorite location on Earth.

      Click the Export button on navigation bar at the top of the page to go into Export Mode.

      Scroll and zoom such that the region you want to export fills your browser window. Start with something reasonably small so that the export and download will complete quickly. Try zooming in on a small town or a city block.

      When you're ready, click Export on the left. OpenStreetMap will generate an XML file and initiate the download soon.

      If you want to fine tune the rectangle that's saved, you can click "Manually select a different area" in the OpenStreetMap window, and adjust a rectangle over the map that will be exported.

      Keep in mind that many locations may have limited information about building geometry. In particular, the heights of buildings may be missing or incorrect in many cities.

      If you receive an error message after clicking Export, OpenStreetMap may be too busy to accomodate the request. Try clicking Overpass API or check one of the other sources. Make sure the downloaded file has the extension ".osm", as this is what the plugin will be expecting. You can rename the downloaded file as needed.

      Of course, there are many other places you can find raw OpenStreetMap XML data on the web also, but keep in mind the plugin has only been tested with files exported directly from OpenStreetMap so far.

      Attention: OSM covers the real world and includes only fact based knowledge. If you like to build up an fictional map, you can use the JOSM offline editor, to create an local XML file, which you don't upload(!) to the project.

      You can easily contribute back to OSM, for example to improve your hometown. Just signup at www.openstreetmap.org and click at the edit tab. The online iD editor allows you to trace aerial imagery and to add POIs easily. To learn more details, just look over here:

      Please be aware, that the project community (the inhabitants!) is the essential part. Thus it's wise to get in touch with mappers close to you, to get more tips on local tagging, or unwritten rules. Happy mapping!

      When you import an OSM file, the plugin will create a new Street Map asset to represent the map data in UE4. You can assign these to Street Map Components, or directly interact with the map data in C++ code.

      Roads are imported with full connectivity data! This means you can design your own navigation algorithms pretty easily.

      OpenStreetMap positional data is stored in geographic coordinates (latitude and longitude), but UE4 doesn't support that coordinate system natively. That is, we can't easily deal with spherical worlds in UE4 currently. So during the import process, we project all map coordinates to a flat 2D plane.

      The OSM data is imported at double precision, but we truncate everything to single precision floating point before saving our UE4 street map asset. If you're planning to work with enormous map data sets at runtime, you'll need to modify this.

      An example implementation of a Street Map Component is included that generates a renderable mesh from loaded street and building data. This is a very simple component that you can use as a starting point.

      The example implementation creates a custom primitive component mesh instead of a traditional static mesh. The reason for this was to allow for more flexible rendering behavior of city streets and buildings, or even dynamic aspects.

      All mesh data is generated at load time from the cartographic data in the map asset, including colorized road strips and simple building meshes with triangulated roof polygons. No spline interpolation is performed on the roads.

      The generated street map mesh has vertex colors and normals, and you can assign a custom material to it. If you want to use the built-in colors, make sure your material multiplies Vertex Color with Base Color. The mesh is setup to render very efficiently in a single draw call. Roads are represented as simple quad strips (no tesselation). Texture coordinates are not supported yet.

      There are various "tweakable" variables to control how the renderable mesh is generated. You can find these at the top of the UStreetMapComponent::GenerateMesh() function body.

      (Street Map Component also serves as a straightforward example of how to write your own primitive components in UE4.)

      While importing OpenStreetMap XML files, we store all of the data that's interesting to us in an FOSMFile data structure in memory. This contains data that is very close to raw representation in the XML file. Coordinates are stored as geographic positions in double precision floating point.

      After loading everything into FOSMFile, we digest the data and convert it to a format that can be serialized to disk and loaded efficiently at runtime (the UStreetMap class.)

      Depending on your use case, you may want to heavily customize the UStreetMap class to store data that is more close to the raw representation of the map. For example, if you wanted to perform large-scale GPS navigation, you'd want higher precision data available at runtime.

      There are various loose ends.

      Importing files larger than 2GB will crash. This is a current UE4 limitation.

      Some variants of generated OSM XML files won't load correctly. For example, single-quote delimeters around values are not supported yet.

      Street Map APIs should be easy to use from C++, but Blueprint support hasn't been a focus for this plugin. Many methods are inlined for high performance. Blueprint scripting hooks could be added if there is demand for it, though.

      As mentioned above, coordinates are truncated to single-precision which won't be sufficient for advanced use cases. Similarly, geographic coordinates are not retained beyond the initial import phase. All coordinates are projected onto a plane and transposed to be relative to the center of the map's bounding rectangle.

      Runtime data structures are setup to support pathfinding (see FStreetMapNode member functions), but no example implementation of a GPS algorithm is included yet.

      Generated mesh data is currently very simple and lacks collision information, navigation mesh support and has no texture coordinates. This is really just designed to serve as an example. For more rendering flexibility and faster performance, the importer could be changed to generate actual Static Mesh assets for map geometry.

      You can search for @todo in the plugin source code for other minor improvements that could be made.

      This plug-in requires Visual Studio and either a C++ code project or the full Unreal Engine 4 source code from GitHub. If you are new to programming in UE4, please see the official Programming Guide!

      The Street Map plugin should work on all platforms that UE4 supports, but the latest version has not been tested on every platform.

      We'll try to keep the source code up to date so that it works with new versions Unreal Engine as they are released.

      I'm not planning to actively update the plugin on a regular basis, but if any critical fixes are contributed, I'll certainly try to review and integrate them.

      For bugs, please file an issue, submit a pull request or catch me on Twitter.

      Finally, a big thanks to the OpenStreetMap Foundation and the fantastic community who contribute map data and maintain the database.


      Options

      show this help message and exit

      choses the area to generate osm SRTM data for by bounding box. If necessary, files are downloaded from the NASA server. Specify as <left>:<bottom>:<right>:<top> in degrees of latitude and longitude, respectively. Latitudes south of the equator and longitudes west of Greenwich may be given as negative decimal numbers. If this option is given, specified hgt files will be omitted.

      use polygon FILENAME as downloaded from http://download.geofabrik.de/clipbounds/ as bounds for the output contour data. The computation time will be somewhat higher then. If specified, a bounding box passed to the --area option will be ignored.

      only download needed files, don't write contour data.

      specify contour line step size in meters or feet, if using the --feet option. The default value is 20.

      output contour lines in feet steps rather than in meters.

      say this, if you don't want the sea level contour line (0 m) (which sometimes looks rather ugly) to appear in the output.

      specify a prefix for the filenames of the output osm file(s).

      specify the prefix for the files to write longitude/latitude/elevation data to instead of generating contour osm.

      specify a string of two comma seperated integers for major and medium elevation categories, e. g. '200,100' which is the default. This is needed for fancy rendering.

      number of jobs to be run in parallel (POSIX only)

      pass a number as OSM-VERSION to use for the output. The default value is 0.6. If you need an older version, try 0.5.

      write the timestamp attribute of node and way elements in OSM XML and o5m output. This might be needed by some interpreters. In o5m output, this also triggers writing of changeset and user information.

      specify an integer as id of the first written node in the output OSM xml. It defaults to 10000000 but some OSM xml mergers are running into trouble when encountering non unique ids. In this case and for the moment, it is safe to say 10000000000 (ten billion) then.

      specify an integer as id of the first written way in the output OSM xml. It defaults to 10000000 but some OSM xml mergers are running into trouble when encountering non unique ids. In this case and for the moment, it is safe to say 10000000000 (ten billion) then.

      specify an integer as a maximum number of nodes per generated tile. It defaults to 1000000, which is approximately the maximum number of nodes handled properly by mkgmap. For bigger tiles, try higher values. For a single file output, say 0 here.

      specify an integer as a maximum number of nodes per way. It defaults to 2000, which is the maximum value for OSM api version 0.6. Say 0 here, if you want unsplitted ways.

      simplify contour lines using the Ramer-Douglas-Peucker (RDP) algorithm with this EPSILON value. The larger the value, the more simplified the contour lines. The value passed will be directly used, i. e. in case of WGS84 based reference systems like EPSG:4326, the passed value is interpreted as degrees of latitude and longitude, respectively. Use a value of 0.0 to remove only vertices on straight lines. Sensible values to reduce the output file size while preserving resonable accuracy are dependent on the file resolution. For SRTM3 data, some value between 0.0001 and 0.0005 seems reasonable, reducing the file size by something like one or two thirds. Note that using contour line simplification will slow down contour line generation. The default is not to use RDP.

      Do not delete all vertices while simplifying a contour line using RDP but only delete points within this range. The default is to delete all dispensable vertices. Only use this option if you want to get the benefit of RDP but need somehow close-lying points because of rendering issues or so. Using this option will dramatically slow down contour line generation.

      turn on gzip compression of output files. This reduces the needed disk space but results in higher computation times. Specifiy an integer between 1 and 9. 1 means low compression and faster computation, 9 means high compression and lower computation.

      write protobuf binary files instead of OSM XML. This reduces the needed disk space. Be sure the programs you want to use the output files with are capable of pbf parsing. The output files will have the .osm.pbf extension.

      write o5m binary files instead of OSM XML. This reduces the needed disk space. Be sure the programs you want to use the output files with are capable of o5m parsing. The output files will have the .o5m extension.

      use SRTM resolution of SRTM-RESOLUTION arc seconds. Possible values are 1 and 3, the default value is 3. For different SRTM data versions and map coverage, see the --srtm-version option.

      use this VERSION of SRTM data. Supported SRTM versions are 2.1 and 3. Version 2.1 has voids which were filled in version 3 using ASTER GDEM and other data. In version 2.1, only the US territory is included in the 1 arc second dataset. In version 3, nearly the whole world is covered. The default for this option is 3. If you want the old version, say --srtmversion=2.1 here

      the username to use for earthexplorer login. This is needed if you want to use NASA SRTM sources in version 3.0. If you do not yet have an earthexplorer login, visit https://ers.cr.usgs.gov/register/ and create one. Once specified, phyghtmap will store the earthexplorer login credentials unencrypted in a file called '.phyghtmaprc' in your home directory. I. e., you only have to specify this option (and the --earthexplorer-password option) once. In addition, the password specified on the command line may be read by every user on your system. So, don't choose a password which you don't want to be disclosed to others. This option should be specified in combination with the --earthexplorer-password option.

      the password to use for earthexplorer login. This option should be specified in combination with the --earthexplorer-user option. For further explanation, see the help given for the --earthexplorer-user option.

      if specified, NASA SRTM data are masked with data from www.viewfinderpanoramas.org. Possible values are 1 and 3 (for explanation, see the --srtm option).

      specify a list of sources to use as comma-seperated string. Available sources are 'srtm1', 'srtm3', 'view1' and 'view3'. If specified, the data source will be selected using this option as preference list. Specifying --source=view3,srtm3 for example will prefer viewfinder 3 arc second data to NASA SRTM 3 arc second data. Also see the --srtm-version option for different versions of SRTM data.

      correct x offset of contour lines. A setting of --corrx=0.0005 was reported to give good results. However, the correct setting seems to depend on where you are, so it is may be better to start with 0 here.

      correct y offset of contour lines. A setting of --corry=0.0005 was reported to give good results. However, the correct setting seems to depend on where you are, so it may be better to start with 0 here.

      Cache directory for hgt files. The downloaded SRTM files are stored in a cache directory for later use. The default directory for this is ./hgt/ in the current directory. You can specify another cache directory with this option.

      rewrite the index files and exit. Try this if phyghtmap encounters problems when trying to download data files.

      extend the void value range up to this height. The hgt file format uses a void value which is -0x8000 or, in terms of decimal numbers, -32768. Some hgt files contain other negative values which are implausible as height values, e. g. -0x4000 (-16384) or similar. Since the lowest place on earth is about -420 m below sea level, it should be safe to say -500 here in case you encounter strange phyghtmap behaviour such as program aborts due to exceeding the maximum allowed number of recursions.


      Build options

      Depending on the build type (see above), different build options are ON or OFF . You can change the settings in ccmake or on the command line with something like

      Build option Default Description
      BUILD_BENCHMARKS OFF ( ON in Dev build) Build the benchmark programs. You only need this if you intend to run the benchmarks.
      BUILD_DATA_TESTS OFF ( ON in Dev build) Build the data tests. These tests need OSM test data from a different repository, so they are a bit more difficult to run. See chapter Running Tests for details.
      BUILD_EXAMPLES ON Build the examples in the examples directory.
      BUILD_HEADERS OFF ( ON in Dev build) Only interesting for Libosmium developers. This will build every Libosmium header file by itself to check if the include dependencies are all set correctly.
      BUILD_TESTING ON Build the unit tests. See chapter Running Tests for details.


      “That’s maybe a bit too dorky, even for us.”

      Around the time we added support for Open Plaques machine tags Frankie Roberto, the project lead, asked: “What about supporting Open Street Map (OSM) way machine tags?”

      My immediate response was something along the lines of “That’s maybe a bit too dorky, even for us.” Which meant that I kept thinking about it. And now we’re doing it.

      If you’re not sure way what a “way” is, it’s best to start with OpenStreetMap’s own description of how their metadata is structured:

      Our maps are made up of only a few simple elements, namely nodes, ways and relations. Each element may have an arbitrary number of properties (a.k.a. Tags) which are Key-Value pairs (e.g. highway=primary) …

      A node is the basic element of the OSM scheme. Nodes consist of latitude and longitude (a single geospacial point) …

      A way is an ordered interconnection of at least 2 and at most 2000 nodes that describe a linear feature such as a street, or similar. Should you reach the node limit simply split your way and group all ways in a relation if necessary. Nodes can be members of multiple ways.

      Frankie’s interest is principally in marking up buildings in and around Manchester, where he lives. When he tags one of his photos with osm:way=30089216 we can fetch the metadata (the key-value pairs) for that way using the OSM API and see that it has the following properties:

      That allows to us “expand” the original machine tag and display a short caption next to the photo, in this case: “St George’s House is a building in OpenStreetMap” with a link back to the web page for that way on the OSM site.

      You may have noticed that there are a bunch of other key-value pairs in that example, like the name of the architect, that we don’t do anything with. Which attributes are we looking for, then? The short answer is: Not most of them. The complete list of map features in OSM is a bit daunting in scope and constantly changing. It would be nice to imagine that we could keep pace with the discussions and the churn but that’s just not going to happen. If nothing else, the translations alone would become unmanageable.

      Instead we’re going to start small and see where it takes us. Here are the list of tagged features in a way or node definition that we pay attention to, and how they’ll be displayed:

      k=name v=
      … is a feature in OpenStreetMap (If present, with another recognized tag we will display the name for the thing being described in place of the more generic “this is a…”)

      k=building v=yes
      … is a building in OpenStreetMap

      k=cycleway
      … is a bicycle path in OpenStreetMap

      k=motorway (v=cycleway)
      … is a highway in OpenStreetMap (unless v is “cycleway” in which case it’s a bike path)

      k=railway v=subway (or tram or monorail or light_rail)
      … is a subway (or tram or monorail or light_rail) line in OpenStreetMap

      k=railway v=station
      … is a train station in OpenStreetMap if the type of railway is also defined (above) then we’ll be specific about the type of station. I should mention that as of this writing we’re still waiting for the translations for “this is a train station” to come back because I, uh… anyway, real soon now.

      k=waterway v=stream (or canal or river)
      … this is a stream (or canal or river) in OpenStreetMap

      k=landuse v=farm (or forest)
      … this is a farm (or forest) in OpenStreetMap

      k=natural v=forest (or beach)
      … this is a forest (or beach) in OpenStreetMap

      Which means: We’ve almost certainly got at least some of it wrong. Anyone familiar with OSM features will probably be wondering why we haven’t included amentiy or shop tags since they contain a wealth of useful information. I hope we will, but it wasn’t clear how we should decide which features to support (more importantly, which to exclude) and the number of possible combinations were starting to get a bit out of hand and we have this little photo-sharing site to keep running.

      This is the part where I casually mention that we’ve also added alpha shapes and “donut holes”, derived from geotagged photos, and some of it is just trying to shine the spotlight on places and environments that we take for granted.

      Like I said, we’ve almost certainly got at least some of it wrong but hopefully we got part of it right and can correct the rest as we go. This one is definitely a bit more of an experiment than some of the others.

      Finally, in the tangentially related department we finished wiring up the RSS/syndication feeds to work properly with wildcard machine tags. That means you can subscribe to a feed of all the (public) photos tagged with osm:way= or osm:node= or, if you’re like me, all the photos of places to eat in Dopplr with dopplr:eat= .


      Watch the video: Видеоурок: как создать карту в OpenStreetMap и разместить ее на своём сайте? (October 2021).