-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DWG CRS - GDAL plugin do not retrieve CRS as ODA C++ - OdDbGeoData #11672
Comments
AFAIK there's no support for CRS in the OGR Teigha driver.
As you've found, it's probably relatively straightforward to add |
Ah you're right, thanks for pointing out. Can you guide me where to look at for making this improvements ? |
The ODA Teigha DWG driver code is in There's a vector driver tutorial and plenty of existing drivers to examine — some are a lot more complex than others, so it's probably worth looking at something simpler like CSV initially. |
Hello back, Been trying to look around the vector drivers and it's not easy to get a grasp on SpatialReference Object on how they work. If we take a look into ogrinfo_lib.cpp (line 1270-1282) ; we see that the input from ogrinfo commands come from :
So let's look on for exemple csv driver; we can follow where the GetSpatialRef() takes it's information from : 1 - ogrgeomfielddefn.cpp : method to get spatial ref :
2 - ogrgeomfielddefn.cpp defines poSRS :
3 - orgcvslayer.cpp is using SetSpatialRef:
But this mecanism is nowhere to be found for dwg driver because we don't have any oGeomFieldDefn. So it seems it would be either : another method to get the Layers SRS not using oGeomFieldDefn ; or implement oGeomFieldDefn in the dwg driver. I would be eager to ear any thougts on this ! |
you need to do in the layer constructor something like
|
What is the bug?
Hello,
We're using this method in ODA C++ to get CRS from a DWG file into a given XML output file :
It works from some of the DWG file we have like : https://blocinbloc-public-test.s3.fr...4-MONTAIGU.dwg
In a second time, we built GDAL with ODA support based on https://github.com/OSGeo/gdal/blob/m...all/Dockerfile
We're succesfully getting that driver is being used for DWG, DGN and DXF with ogrinfo commands with results :
The extent is correct but the Layer SRS WKT is always "unknown".
We would like to have the same output as OdDbGeoData in the SRS WKT into the ogr ODA driver.
Steps to reproduce the issue
To build this docker :
After build we can use it like this to have local DWG files in the docker container:
Make ogrinfo command in the docker :
Versions and provenance
GDAL 3.10 built from Ubuntu 24.04 ubuntu_small docker with modifications.
Additional context
No response
The text was updated successfully, but these errors were encountered: