[OSM2World] Get OSM file and convert it to OBJ directory via class library

Tobias Knerr osm at tobias-knerr.de
Wed Jun 1 07:36:51 UTC 2022


Hello Christian,

Am 20.05.22 um 15:50 schrieb Christian H.:
> I want to get and convert an OSM to an OBJ file to use it in Unity.
> I looked at the javadoc but can't find with which methods I can get the 
> osm file via coordinates and then export the osm file/files as an obj 
> directory.
> 
> I did it via the graphical interface but I need to do it programatically.

for the conversion, you usually want to use 
ConversionFacade.createRepresentations in org.osm2world.core and pass a 
suitable Target instance (e.g. an ObjTarget or GltfTarget) to it.

Obtaining OSM files isn't something OSM2World is always the best tool 
for (depending on your data source), but if you want to pull data from 
an Overpass API instance, you can use OverpassReader to obtain an 
OSMData object.



More information about the OSM2World mailing list