OpenStreetMap import: Difference between revisions
(Switch to {{gitorious source}} to fix the broken Gitorious link.) |
|||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{OSM Navigation}} | |||
With the recent license change, we'll be able to use [[OpenStreetMap]] data in the official [[FlightGear]] [[scenery]]. Some of the most interesting things to '''import from OpenStreetMap''' are shared objects (generic models like windturbines, power lines, water towers). | With the recent license change, we'll be able to use [[OpenStreetMap]] data in the official [[FlightGear]] [[scenery]]. Some of the most interesting things to '''import from OpenStreetMap''' are shared objects (generic models like windturbines, power lines, water towers). | ||
Line 10: | Line 12: | ||
! Model | ! Model | ||
! Number of objects | ! Number of objects | ||
! In OSM 25.03.2014 | |||
|- | |- | ||
! rowspan="2" | Antennas | ! rowspan="2" | Antennas | ||
Line 19: | Line 22: | ||
36,126<br/> | 36,126<br/> | ||
946 | 946 | ||
| align="right" | | |||
56,307<br/> | |||
2,282 | |||
|- | |- | ||
| | | | ||
Line 24: | Line 30: | ||
| Models/Communications/fernmeldeturm_gruenwettersbach.xml | | Models/Communications/fernmeldeturm_gruenwettersbach.xml | ||
| align="right" | 1 584 | | align="right" | 1 584 | ||
| align="right" | 2,905 | |||
|- | |- | ||
! Chimneys | ! Chimneys | ||
Line 30: | Line 37: | ||
| Models/Industrial/generic_chimney_01.xml | | Models/Industrial/generic_chimney_01.xml | ||
| align="right" | 6,486 | | align="right" | 6,486 | ||
| align="right" | 10,080 | |||
|- | |- | ||
! Cooling towers | ! Cooling towers | ||
Line 36: | Line 44: | ||
| Models/Power/coolingtower.xml | | Models/Power/coolingtower.xml | ||
| align="right" | 251 | | align="right" | 251 | ||
| align="right" | 379 | |||
|- | |- | ||
! Lighthouse | ! Lighthouse | ||
Line 42: | Line 51: | ||
| Models/Misc/generic-lighthouse.xml | | Models/Misc/generic-lighthouse.xml | ||
| align="right" | 5,148 | | align="right" | 5,148 | ||
| align="right" | 6,658 | |||
|- | |- | ||
! Obelisks | ! Obelisks | ||
Line 48: | Line 58: | ||
| Models/Misc/generic_monument_01.ac | | Models/Misc/generic_monument_01.ac | ||
| align="right" | 57 | | align="right" | 57 | ||
| align="right" | 117 | |||
|- | |- | ||
! Power pylons | ! Power pylons | ||
Line 54: | Line 65: | ||
| Models/Power/generic_pylon_*.ac | | Models/Power/generic_pylon_*.ac | ||
| align="right" | 2,760,804 | | align="right" | 2,760,804 | ||
| align="right" | 5,465,288 | |||
|- | |- | ||
! Radomes | ! Radomes | ||
Line 60: | Line 72: | ||
| Models/Communications/radome-*.xml | | Models/Communications/radome-*.xml | ||
| align="right" | 37 | | align="right" | 37 | ||
| align="right" | 59 | |||
|- | |- | ||
! rowspan="2" | Tanks | ! rowspan="2" | Tanks | ||
Line 68: | Line 81: | ||
| Models/Industrial/GenericStorageTank*m.xml | | Models/Industrial/GenericStorageTank*m.xml | ||
| align="right" | 46,993 | | align="right" | 46,993 | ||
| align="right" | 689<br/>90,774<br/>3,847 | |||
|- | |- | ||
| | | | ||
Line 73: | Line 87: | ||
| Models/Industrial/Gasometer.xml | | Models/Industrial/Gasometer.xml | ||
| align="right" | 4,423 | | align="right" | 4,423 | ||
| align="right" | 11,527 | |||
|- | |- | ||
! Survey points | ! Survey points | ||
Line 79: | Line 94: | ||
| Models/Misc/trigpoint.xml | | Models/Misc/trigpoint.xml | ||
| align="right" | 271,676 | | align="right" | 271,676 | ||
| align="right" | 281,804 | |||
|- | |- | ||
! Traffic signs | ! Traffic signs | ||
Line 85: | Line 101: | ||
| Models/StreetFurniture/Stop-Sign.ac | | Models/StreetFurniture/Stop-Sign.ac | ||
| align="right" | 68,443 | | align="right" | 68,443 | ||
| align="right" | 128,354 | |||
|- | |- | ||
! Water towers | ! Water towers | ||
Line 91: | Line 108: | ||
| Models/Industrial/water-tower.ac | | Models/Industrial/water-tower.ac | ||
| align="right" | 17,132 | | align="right" | 17,132 | ||
| align="right" | 31,366 | |||
|- | |- | ||
! rowspan="3" | Windturbines | ! rowspan="3" | Windturbines | ||
Line 98: | Line 116: | ||
| Models/Power/windturbine.xml | | Models/Power/windturbine.xml | ||
| align="right" | 79,636 | | align="right" | 79,636 | ||
| align="right" | | |||
121,228<br/>31,565 | |||
|- | |- | ||
| | | | ||
Line 104: | Line 124: | ||
| Models/Power/vestas-v80-sea.xml | | Models/Power/vestas-v80-sea.xml | ||
| align="right" | 39 | | align="right" | 39 | ||
| align="right" | | |||
1344<br/>52 | |||
|- | |- | ||
| | | | ||
Line 109: | Line 131: | ||
| - | | - | ||
| align="right" | 3,928 | | align="right" | 3,928 | ||
| align="right" | 5,961 | |||
|- | |- | ||
! colspan="3" align="right" | Total | ! colspan="3" align="right" | Total | ||
| align="right" | 3,302,125 | | align="right" | 3,302,125 | ||
| align="right" | 6,252,586 | |||
|- | |||
! Churches | |||
| | |||
* <tt>anemity==place_of_worship</tt> | |||
| Models/Misc/generic_church.ac | |||
| align="right" | 298 | |||
| align="right" | 644,805 | |||
|- | |||
! Petrol Station | |||
| | |||
* <tt>anemity==fuel</tt> | |||
| Models/Commercial/Petrolstation1.ac | |||
| align="right" | 28 | |||
| align="right" | 244,986 | |||
|- | |||
! Summit Cross | |||
| | |||
* <tt>summit:cross=yes</tt> | |||
| TODO | |||
| align="right" | 0 | |||
| align="right" | 1120 | |||
|} | |} | ||
Line 119: | Line 164: | ||
* Should we remove shared objects that are currently in the database, if they are not present in OSM? | * Should we remove shared objects that are currently in the database, if they are not present in OSM? | ||
*: {{thumbs down}} [[User:Gijs|Gijs]] 16:18, 14 September 2012 (EDT): OSM still lacks a lot of data, so we cannot state that something doesn't exist if it isn't included in the OSM data. We can be fairly sure though that something exists (or existed) if it is present in OSM. | *: {{thumbs down}} [[User:Gijs|Gijs]] 16:18, 14 September 2012 (EDT): OSM still lacks a lot of data, so we cannot state that something doesn't exist if it isn't included in the OSM data. We can be fairly sure though that something exists (or existed) if it is present in OSM. | ||
*: {{thumbs up}} [[User:Ambush|Ambush]] ([[User talk:Ambush|talk]]) 11:37, 15 December 2013 (UTC) It's right way to get GIS data from one worldwide specialized source with excellent support from a large community. If OSM have not some data existing in real world, it's better to add this data to OSM and get it back instead of support two GIS databases with duplicates. | |||
* In order to prevent us from adding duplicates, a certain radius around the (OSM) object location should be checked for the presence of objects. What would be a good radius? | * In order to prevent us from adding duplicates, a certain radius around the (OSM) object location should be checked for the presence of objects. What would be a good radius? | ||
* In what group should the objects end up? There is an "OSM" group, but there are also specific "WINDPOWER" and "POWER" groups. | * In what group should the objects end up? There is an "OSM" group, but there are also specific "WINDPOWER" and "POWER" groups. | ||
Line 129: | Line 175: | ||
# Check for duplicates within ... meters from the object location. | # Check for duplicates within ... meters from the object location. | ||
# ... | # ... | ||
# For power pylons: Run <code>pylon-headings.pl</code> (from | # For power pylons: Run <code>pylon-headings.pl</code> (from {{gitorious source|fgscenery|tools|text=scenerytools}}) to properly align the pylons in the direction of their cables. | ||
# ... | # ... | ||
# Calculate elevation. | # Calculate elevation. | ||
# ... | # ... | ||
# Push to object database. | # Push to object database. | ||
== overpass turbo == | |||
The overpass turbo webservice is a quick & easy way to download objects from OSM which match the desired criteria (e.g. all terminal buildings in europe) | |||
http://overpass-turbo.eu/ | |||
here is an example to get the lon/lat center of each building - no need to run osmconvert anymore! | |||
<pre> | |||
[out:xml][timeout:25]; | |||
// gather results | |||
( | |||
// query part for: “amenity=place_of_worship” | |||
node["amenity"="place_of_worship"]({{bbox}}); | |||
way["amenity"="place_of_worship"]({{bbox}}); | |||
relation["amenity"="place_of_worship"]({{bbox}}); | |||
); | |||
// print results | |||
out center; | |||
>; | |||
out skel qt; | |||
</pre> | |||
== osmconvert == | |||
wind turbines and power pylons are most of the time easy to handle nodes in OSM. But petrol stations or churches are often ways - not as easy. | |||
The tool osmconvert can convert ways (outline of a building or an area) into nodes(lat/lon points with tags) | |||
Example: | |||
osmconvert input.osm --all-to-nodes | grep -v "<node .*/>" > out.osm | |||
http://wiki.openstreetmap.org/wiki/Osmconvert | |||
From the resulting .osm file it is very easy to generate a .stg file for test in flightgear (with some fixed dummy elevation) and then upload to | |||
http://scenemodels.flightgear.org (correct elevation will be calculated on the the server side) | |||
(with a script similar to this one: [[User:Laserman/gpx2stg.py]] ) | |||
[[Category:Scenery enhancement]] | [[Category:Scenery enhancement]] |
Latest revision as of 17:13, 10 March 2016
Started in | 11/2013 |
---|---|
Description | Improved autogen support for FlightGear using OSM data |
Contributor(s) | radi, vanosten, Soitanen, portreekid |
Status | Under active development as of 02/2016 |
Topic branches: | |
$FG_SRC | https://gitlab.com/osm2city/osm2city/ |
fgdata | https://gitlab.com/osm2city/osm2city-data/ |
OpenStreetMap use in FlightGear |
---|
With the recent license change, we'll be able to use OpenStreetMap data in the official FlightGear scenery. Some of the most interesting things to import from OpenStreetMap are shared objects (generic models like windturbines, power lines, water towers).
This article lists open questions, ideas and planes related to the import process.
Object types
This table lists models from the FlightGear scenery database, together with a corresponding OSM tag.
Tag | Model | Number of objects | In OSM 25.03.2014 | |
---|---|---|---|---|
Antennas |
|
Models/Communications/radio-*.xml |
36,126 |
56,307 |
|
Models/Communications/fernmeldeturm_gruenwettersbach.xml | 1 584 | 2,905 | |
Chimneys |
|
Models/Industrial/generic_chimney_01.xml | 6,486 | 10,080 |
Cooling towers |
|
Models/Power/coolingtower.xml | 251 | 379 |
Lighthouse |
|
Models/Misc/generic-lighthouse.xml | 5,148 | 6,658 |
Obelisks |
|
Models/Misc/generic_monument_01.ac | 57 | 117 |
Power pylons |
|
Models/Power/generic_pylon_*.ac | 2,760,804 | 5,465,288 |
Radomes |
|
Models/Communications/radome-*.xml | 37 | 59 |
Tanks |
|
Models/Industrial/GenericStorageTank*m.xml | 46,993 | 689 90,774 3,847 |
|
Models/Industrial/Gasometer.xml | 4,423 | 11,527 | |
Survey points |
|
Models/Misc/trigpoint.xml | 271,676 | 281,804 |
Traffic signs |
|
Models/StreetFurniture/Stop-Sign.ac | 68,443 | 128,354 |
Water towers |
|
Models/Industrial/water-tower.ac | 17,132 | 31,366 |
Windturbines |
|
Models/Power/windturbine.xml | 79,636 |
121,228 |
|
Models/Power/vestas-v80-sea.xml | 39 |
1344 | |
|
- | 3,928 | 5,961 | |
Total | 3,302,125 | 6,252,586 | ||
Churches |
|
Models/Misc/generic_church.ac | 298 | 644,805 |
Petrol Station |
|
Models/Commercial/Petrolstation1.ac | 28 | 244,986 |
Summit Cross |
|
TODO | 0 | 1120 |
http://taginfo.openstreetmap.org/keys/ lists all tags.
Questions/problems
- Should we remove shared objects that are currently in the database, if they are not present in OSM?
- Gijs 16:18, 14 September 2012 (EDT): OSM still lacks a lot of data, so we cannot state that something doesn't exist if it isn't included in the OSM data. We can be fairly sure though that something exists (or existed) if it is present in OSM.
- Ambush (talk) 11:37, 15 December 2013 (UTC) It's right way to get GIS data from one worldwide specialized source with excellent support from a large community. If OSM have not some data existing in real world, it's better to add this data to OSM and get it back instead of support two GIS databases with duplicates.
- In order to prevent us from adding duplicates, a certain radius around the (OSM) object location should be checked for the presence of objects. What would be a good radius?
- In what group should the objects end up? There is an "OSM" group, but there are also specific "WINDPOWER" and "POWER" groups.
Import process
- Retrieve a node from the OSM data.
- OSM data is already available in the database, so we can take the data directly from there, rather than re-importing from OSM.
- Assign a corresponding FlightGear model (from the #Object types table).
- Skip the node if their is no fitting object.
- Check for duplicates within ... meters from the object location.
- ...
- For power pylons: Run
pylon-headings.pl
(from scenerytools) to properly align the pylons in the direction of their cables. - ...
- Calculate elevation.
- ...
- Push to object database.
overpass turbo
The overpass turbo webservice is a quick & easy way to download objects from OSM which match the desired criteria (e.g. all terminal buildings in europe) http://overpass-turbo.eu/
here is an example to get the lon/lat center of each building - no need to run osmconvert anymore!
[out:xml][timeout:25]; // gather results ( // query part for: “amenity=place_of_worship” node["amenity"="place_of_worship"]({{bbox}}); way["amenity"="place_of_worship"]({{bbox}}); relation["amenity"="place_of_worship"]({{bbox}}); ); // print results out center; >; out skel qt;
osmconvert
wind turbines and power pylons are most of the time easy to handle nodes in OSM. But petrol stations or churches are often ways - not as easy. The tool osmconvert can convert ways (outline of a building or an area) into nodes(lat/lon points with tags) Example: osmconvert input.osm --all-to-nodes | grep -v "<node .*/>" > out.osm
http://wiki.openstreetmap.org/wiki/Osmconvert
From the resulting .osm file it is very easy to generate a .stg file for test in flightgear (with some fixed dummy elevation) and then upload to http://scenemodels.flightgear.org (correct elevation will be calculated on the the server side) (with a script similar to this one: User:Laserman/gpx2stg.py )