<div dir="ltr">I guess the OP can answer for themselves but I am curious since I cannot see anyway that Cityxxx would facilitate the conversion of an .obj into GeoJSON ?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 2 Dec 2020 at 12:49, Clay, Bruce <<a href="mailto:bclay@infoscitex.com">bclay@infoscitex.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Take a look at CityXml / CityGml and CityJson.  There is partial support at least in GDAL based on web searches.  Also some support for QGIS through a plugin<br>
<br>
<br>
Bruce<br>
<br>
<br>
________________________________<br>
From: gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>> on behalf of Paul Harwood <<a href="mailto:runette@gmail.com" target="_blank">runette@gmail.com</a>><br>
Sent: Wednesday, December 2, 2020 5:31 AM<br>
To: Andrew C Aitchison<br>
Cc: <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
Subject: [EXTERNAL] Re: [gdal-dev] Converting OBJ to Geojson files with ogr2ogr<br>
<br>
.OBJ is a simple object mesh  (or to put it in more traditional terms: TIN) - it has shape but no data values and is not geolocated.<br>
<br>
I don't think there is any driver for OGR that will read .OBJ.<br>
<br>
You are going to problems with geolocation if you write your own. Geojson requires that the geometries are geolocated - and in the current version that they are in epsg:4326. That is not totally impossible - people have been using .dxf files for gis data for decades and that format is also not in theory geolocated. It is not a trivial problem though.<br>
<br>
I guess I would ask the usual question .. why?<br>
<br>
- what are you actually trying to achieve and why a GIS format like GeoJSON?<br>
<br>
- If you have to use GeoJSON - I am guessing you are transferring some data to something that reads GeoJSON only? In that case - can your source produce .dxf? OGR can read .dxf.<br>
<br>
- If you only have the source in .OBJ - what other formats can the destination read? Although, if you only have the source in .obj, I very much doubt any of the GIS tools like GDAL are going to be able to help you. It just is not a format used in GIS.<br>
<br>
It is a problem we solved in the ViRGiS projec<<a href="https://usg02.safelinks.protection.office365.us/?url=http%3A%2F%2Fwww.virgis.org%2F&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296346911%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=P2rkx2BIsKJ0GPY3EdGesGO%2B9Az%2FTB5s0f9YMRkH%2FH0%3D&reserved=0" rel="noreferrer" target="_blank">https://usg02.safelinks.protection.office365.us/?url=http%3A%2F%2Fwww.virgis.org%2F&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296346911%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=P2rkx2BIsKJ0GPY3EdGesGO%2B9Az%2FTB5s0f9YMRkH%2FH0%3D&reserved=0</a>>t - since .obj is used a lot in VR. There we used an existing library to read the .obj files - but that is in C# and I doubt that would help you.<br>
<br>
On Tue, 1 Dec 2020 at 20:15, Andrew C Aitchison <<a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a><mailto:<a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a>>> wrote:<br>
On Tue, 1 Dec 2020, Brandon Biggs wrote:<br>
<br>
> Hello,<br>
> I am wondering how to convert an obj file to a geojson file? I am using ogr2ogr with the command:<br>
> Ogr2ogr -f geojson output.geojson input.obj<br>
> But get the error that ogr2ogr does not have an OBJ driver. I looked on:<br>
> the vector drivers page<<a href="https://gdal.org/drivers/vector/index.html" rel="noreferrer" target="_blank">https://gdal.org/drivers/vector/index.html</a><<a href="https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Fgdal.org%2Fdrivers%2Fvector%2Findex.html&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296346911%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YlMoWYX%2FArELUfRlhGmaqSd8H%2BQeyhJKoWz2FZSQoNM%3D&reserved=0" rel="noreferrer" target="_blank">https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Fgdal.org%2Fdrivers%2Fvector%2Findex.html&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296346911%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YlMoWYX%2FArELUfRlhGmaqSd8H%2BQeyhJKoWz2FZSQoNM%3D&reserved=0</a>>><br>
> but am unable to find a simple obj converter. I am wondering if there is such a thing? I am probably going to write my own that does what I want, because OBJ is so simple, I was just wondering if GDAL could already do it.<br>
<br>
I've never heard of OBJ, but that doesn't mean much.<br>
<br>
If you only want a read-only ogr driver you might want to look at<br>
        <a href="https://gdal.org/tutorials/vector_python_driver.html" rel="noreferrer" target="_blank">https://gdal.org/tutorials/vector_python_driver.html</a><<a href="https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Fgdal.org%2Ftutorials%2Fvector_python_driver.html&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296356903%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ulnrpqd06IeuubvWwEkSSFhsPUWFw9rsfdYfGWf0zis%3D&reserved=0" rel="noreferrer" target="_blank">https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Fgdal.org%2Ftutorials%2Fvector_python_driver.html&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296356903%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ulnrpqd06IeuubvWwEkSSFhsPUWFw9rsfdYfGWf0zis%3D&reserved=0</a>><br>
if you would find a quick-n-dirty python quicker to write than C++.<br>
<br>
--<br>
Andrew C. Aitchison                                     Kendal, UK<br>
                        <a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a><mailto:<a href="mailto:andrew@aitchison.me.uk" target="_blank">andrew@aitchison.me.uk</a>><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><mailto:<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><<a href="https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296356903%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=teiA9QIidI%2F3%2FdzekPU0zwZ%2FySofRSBD1D5OMhPsndc%3D&reserved=0" rel="noreferrer" target="_blank">https://usg02.safelinks.protection.office365.us/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=04%7C01%7C%7C0da679eff03c4694022308d896ad7f40%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637425019296356903%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=teiA9QIidI%2F3%2FdzekPU0zwZ%2FySofRSBD1D5OMhPsndc%3D&reserved=0</a>><br>
</blockquote></div>