GeoData and AcDbGeoData

1
Dmitry
9/16/2016 9:20 AM

Hi!
Is there any plans to support GeoData (AcDbGeoData, available since 2009) objects ?
They seem to be a common way for geo-referencing CAD drawing on the map, so currently it's simply impossible to show/locate DWG on the map using CadLib (GeoData appears in list of 'unsupported objects' after loading DWG file).

Wout
9/16/2016 9:40 AM

You're the first to ask for it. I haven't seen any files with it yet, could you share one?

- Wout

Dmitry
9/16/2016 1:29 PM

Ok, I just took sample drawing from latest AutoCAD and added geographic marker to it (using GEOGRAPHICLOCATION command) - this marker links a point on drawing (with given WCS coordinates) to the map coordinates (in simplest case - just global lat/lon, but more common - map coordinates in specified map projection system - like UTM/NTM, etc. Same marker defines TrueNorth direction on the drawing for that map system.
Files on google drive: sample files
I saved both DWG and DXF - FloorPlanSample1 is just unchanged original as found in AutoCAD, FloorPlanSample2 - same with added GEODATA object (can be viewed in DXF in clear text, also specified here: GeoData description

Wout
9/16/2016 1:41 PM

Meh, looks like AutoDesk partially described the DXF format, except the large blob of XML that is embedded in it. Everything outside the xml looks not too bad. I'm not sure if the XML covers all of the objects inside it or not, will need to investigate a bit.

- Wout

Wout
9/16/2016 2:12 PM

Looks like the XML describes a coordinate system for MapGuide software. It's fairly extensive (sample XML), so it'd be quite a bit of work mapping all the MapGuide structures into .NET classes. I could however implement the object, with a basic string property to give access to the raw XML. Would that be sufficient for your needs?

- Wout

Dmitry
9/16/2016 2:31 PM

I think xml simply as a raw string is Ok - and unfortunately it's really needed, as only this xml contains information about which map projection system was used for values in fields 11,21 (in case when field 70 = 1)...
And in ObjectARX API, AutoCAD (see this example) just hidden all XML-related complexity inside one object which transforms lat/lon <-> XML-defined map projection.
Of course performing such map transform for arbitrary map projection is not a small job (and is usually done via public web services - like those on ESPG).

Wout
3/21/2017 1:46 PM

Hi,

I've just implemented the GEODATA object, see class WW.Cad.Model.Objects.DxfGeoData. There's no support for the coordinate system XML, so you'd have to construct the XML yourself. Note that in AutoCAD 2009 a different format for the coordinate system string was used than in the later versions: a "well known text" string containing a project coordinate system (PROJCS).

- Wout

1