Sturm Posted April 1, 2019 Report Share Posted April 1, 2019 (edited) Hello guys. Just thinking around here ... What is the level of technical difficulties of using Pyrogenesis, Atlas and/or tools like YAMG to auto-generate a 3D render of OpenStreetMap (OSM) maps? Something like CityGen 3D, for example. FlightGear, an open-source flight simulator is able to use OSM data to build scenery; the same for SuperTuxKart, X-Plane and the freewebcar chung game. Edited April 1, 2019 by Sturm Quote Link to comment Share on other sites More sharing options...
Stan` Posted April 1, 2019 Report Share Posted April 1, 2019 @elexis, @FeXoR Quote Link to comment Share on other sites More sharing options...
elexis Posted April 1, 2019 Report Share Posted April 1, 2019 The map Elephantine is using OpenStreetMap data to create the shape of the river and island. It was not only a fancy proof of concept, but necessary, because all available heightmap data was way too imprecise to capture any shape of the island at all. /** * Heightmap image source: * OpenStreetMap, available under Open Database Licence, www.openstreetmap.org/copyright * https://download.geofabrik.de/africa.html * * To reproduce the river image: * You need a gdal version that supports osm, see https://www.gdal.org/drv_osm.html * wget https://download.geofabrik.de/africa/egypt-latest.osm.pbf * lon=32.89; lat=24.09175; width=0.025; * lat1=$(bc <<< ";scale=5;$lat-$width/2"); lon1=$(bc <<< ";scale=5;$lon+$width/2"); lat2=$(bc <<< ";scale=5;$lat+$width/2"); lon2=$(bc <<< ";scale=5;$lon-$width/2") * rm elephantine.geojson; ogr2ogr -f GeoJSON elephantine.geojson -clipdst $lon1 $lat1 $lon2 $lat2 egypt-latest.osm.pbf -sql 'select * from multipolygons where natural="water"' * gdal_rasterize -burn 10 -ts 512 512 elephantine.geojson elephantine.tif * convert elephantine.tif -threshold 50% -negate elephantine.png * * No further changes should be applied to the image to keep it easily interchangeable. */ 3 Quote Link to comment Share on other sites More sharing options...
Genava55 Posted April 1, 2019 Report Share Posted April 1, 2019 https://opentopomap.org/#map=16/24.08956/32.88976 Quote Link to comment Share on other sites More sharing options...
elexis Posted April 1, 2019 Report Share Posted April 1, 2019 Notice that the data displayed on opentopomap are (1) elevation data, probably a derive of the old SRTM NASA data, and (2) polygons for that island. I think (2) is exactly the OpenStreetMap data, and especially not part of the heightmap. So yes, I think exactly what you're seeing there is the same data used on the map. Notice that the implementation of Elephantine was done by converting that to a heightmap image. I recall spending one or more days trying to load the polygon as JSON, but failed for some very specific reason. Should be mentioned in the IRC logs of the time before Elephantine was committed, I don't remember exactly what it was. Selection of which shapes one wants is one challenge, because OSM provides a lot of information one doesn't want to add to the elevation map (streets for instance), and the polygon needs to be filled, so one would need an additional algorithm for that (flood fill). Coordinate transformations can also be annoying. (But there was some other specific complication that took me like 10 hours to discover, I don't recall.) These commandline tools are very important, it allows one to generate a heightmap at an arbitrary geocoordinate and arbitrary zoom level. I remember that I needed something like 10-20 tries to find the coordinates and zoom levels so that the terrain shapes one had looked for become recognizable. Then 10-20 coordinate / zoom trial and error modifications to center the map perfectly for artistic and balancing aspects. But if one takes a screenshot from a map browser, edits it in gimp, one has one try. Chances are it might not be ideal. Then the entire map created in Atlas is stuck to that error forever. But if there is code to place the entities and actors, you just need to press 4 buttons to do the entire map all over. (There is a terrain recentering patch on trac, but the lost area is replaced with a level plane instead of the heightmap data, and one can't change the zoom level) 3 1 Quote Link to comment Share on other sites More sharing options...
Mercos Posted May 15, 2023 Report Share Posted May 15, 2023 I would Like it to have an Openstreetmap integration in 0AD. It would be nice If could use on OSM mapped castles and ruins they would be available as starting point in 0AD. In such a Map an Import of rivers, forests and hills would be enough. Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 16, 2023 Report Share Posted May 16, 2023 21 hours ago, Mercos said: I would Like it to have an Openstreetmap integration in 0AD. It would be nice If could use on OSM mapped castles and ruins they would be available as starting point in 0AD. In such a Map an Import of rivers, forests and hills would be enough. You can already use json data in random maps see => https://github.com/0ad/0ad/blob/bbae4080acaf09e2716cde8027c7a3c2cd3eaff4/binaries/data/mods/public/maps/random/elephantine.js#L1 You can probably bind the tree data to existing assets (you won't be able to import actual geometry though) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.