The GEODATA entity is associated to the Modelspace object. The GEODATA entity is supported since the DXF version R2000, but was officially documented the first time in the DXF reference for version R2009.

Subclass of ezdxf.entities.DXFObject
Factory function ezdxf.layouts.Modelspace.new_geodata()
Required DXF version R2010 ('AC1024')

See also


Do not instantiate object classes by yourself - always use the provided factory functions!

class ezdxf.entities.GeoData
1 R2009
2 R2010
0 unknown
1 local grid
2 projected grid
3 geographic (latitude/longitude)

Handle of host BLOCK_RECORD table entry, in general the Modelspace.

Changed in version 0.10: renamed from dxf.block_record


Reference point in WCS coordinates.


Reference point in geo coordinates, valid only when coordinate type is local grid. The difference between dxf.design_point and dxf.reference_point defines the translation from WCS coordinates to geo-coordinates.


North direction as 2D vector. Defines the rotation (about the dxf.design_point) to transform from WCS coordinates to geo-coordinates


Horizontal unit scale, factor which converts horizontal design coordinates to meters by multiplication.


Vertical unit scale, factor which converts vertical design coordinates to meters by multiplication.


Horizontal units (see BlockRecord). Will be 0 (Unitless) if units specified by horizontal unit scale is not supported by AutoCAD enumeration.


Vertical units (see BlockRecord). Will be 0 (Unitless) if units specified by vertical unit scale is not supported by AutoCAD enumeration.


Up direction as 3D vector.

1 none
2 user specified scale factor
3 grid scale at reference point
4 prismoidal

Bool flag specifying whether to do sea level correction.


2D source vertices in the CRS of the GeoData as VertexArray. Used together with target_vertices to define the transformation from the CRS of the GeoData to WGS84.


2D target vertices in WGS84 (EPSG:4326) as VertexArray. Used together with source_vertices to define the transformation from the CRS of the geoData to WGS84.


List of face definition tuples, each face entry is a 3-tuple of vertex indices (0-based).


The coordinate system definition string. Stored as XML. Defines the CRS used by the GeoData. The EPSG number and other details like the axis-ordering of the CRS is stored.

get_crs() → Tuple[int, bool]

Returns the EPSG index and axis-ordering, axis-ordering is True if fist axis is labeled “E” or “W” and False if first axis is labeled “N” or “S”.

If axis-ordering is False the CRS is not compatible with the __geo_interface__ or GeoJSON (see chapter 3.1.1).

Raises:InvalidGeoDataException – for invalid or unknown XML data

The EPSG number is stored in a tag like:

<Alias id="27700" type="CoordinateSystem">
  <Namespace>EPSG Code</Namespace>

The axis-ordering is stored in a tag like:

<Axis uom="METER">
get_crs_transformation(no_checks: bool = False) → Tuple[Matrix44, int]

Returns the transformation matrix and the EPSG index to transform WCS coordinates into CRS coordinates. Because of the lack of proper documentation this method works only for tested configurations, set argument no_checks to True to use the method for untested geodata configurations, but the results may be incorrect.

Supports only “Local Grid” transformation!

Raises:InvalidGeoDataException – for untested geodata configurations
setup_local_grid(design_point: Vec3, reference_point: Vec3, north_direction: Vec2=Y_AXIS, crs: str=EPSG_3395)

Setup local grid coordinate system. This method is designed to setup CRS similar to EPSG:3395 World Mercator, the basic features of the CRS should fulfill this assumptions:

  • base unit of reference coordinates is 1 meter
  • right-handed coordinate system: +Y=north/+X=east/+Z=up

The CRS string is not validated nor interpreted!


The reference point must be a 2D cartesian map coordinate and not a globe (lon/lat) coordinate like stored in GeoJSON or GPS data.

  • design_point – WCS coordinates of the CRS reference point
  • reference_point – CRS reference point in 2D cartesian coordinates
  • north_direction – north direction a 2D vertex, default is (0, 1)
  • crs – Coordinate Reference System definition XML string, default is the definition string for EPSG:3395 World Mercator