CLI GuideChannel: dxfgeojson

DXF to GeoJSON Converter

Export CAD elements as coordinates for modern web maps.

Converting DXF files directly to GeoJSON is a valuable way to display design and planning data on interactive web maps. However, CAD datasets must be assigned spatial locations to align correctly.

Indirect Mapping Execution Required

Because database connection attributes or local attributes parsing is required, direct web streams are disabled. Use the GDAL CLI script below for precise terminal conversions.

Specification Rules

  • Publish engineering CAD layout plans directly to web dashboards
  • Share vector drawing paths with web development teams as JSON objects
  • Analyze structural outlines on top of public satellite base maps
  • Design elements must be reprojected from local CAD origins to EPSG:4326
  • Large architectural drawings will output very large text files
  • Proprietary CAD blocks will flatten into standard point objects

GDAL Direct Equivalent Terminal Command

sh console shell
$ogr2ogr -f GeoJSON output.geojson input.dxf -t_srs EPSG:4326 -s_srs EPSG:25832

Frequently Asked Queries

Why do my CAD lines show up in the ocean after conversion?

This happens when localized, unprojected CAD drawings are interpreted as latitude/longitude values. You must assign the correct source coordinate reference system (CRS).

Are multiple CAD drawing layers preserved?

Yes, GDAL includes a 'Layer' folder property in each feature, allowing you to filter vectors inside your web maps.

Is text lettering saved?

Yes. CAD labels and title text blocks convert to coordinate points containing the text content as field attributes.

Related Transformations Map