From osm at tobias-knerr.de Wed Jun 1 07:36:51 2022 From: osm at tobias-knerr.de (Tobias Knerr) Date: Wed, 1 Jun 2022 09:36:51 +0200 Subject: [OSM2World] Get OSM file and convert it to OBJ directory via class library In-Reply-To: References: Message-ID: <5b9032f6-56e5-5b77-128e-efd853757ddb@tobias-knerr.de> 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.