Question: I'm working on openlayers and need to change the format of dwg to GeoJSON with ArcGIS.
how can i do this?

Answer: 
Indeed, GDAL has the necessary tools to get this done. ogr2ogr is a program included with GDAL that can transform a [variety of formats](https://gdal.org/ogr_formats.html), including DWG. If you don't already have GDAL installed, here are good tutorials for [windows](https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows) and [mac/linux](https://web.archive.org/web/20160701215457/https://www.mapbox.com/tilemill/docs/guides/gdal/). The [following guide](https://danielbrannstrom.wordpress.com/2010/11/01/converting-autocad-dwg-files-to-esri-shapefiles/) recommends converting to a DXF first, since the library for converting from DXF is included by default with GDAL. You will need to install some additional dependencies to convert directly from DWG. If you convert to DXF first, you can then use command line to convert to GeoJson:

```
ogr2ogr -f GeoJSON ./mynewfile.geojson ./mycadfile.dxf

```

If you are using ArcGIS Desktop there is a [CAD to Geodatabase tool](https://desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/cad-to-geodatabase.htm) that you can use.
Possible that you also need to make match your coordinates from AutoCAD (if meter unit) to geojson (GPS coordinates).

* First: lambert 93 to select part of world area you aim.
* Second: 3 points to focus on affine transformations to adapt AutoCAD geometries (rotation, translation, scale).

You could have a look at this doc:
<https://github.com/open-indoor/openindoor6/blob/main/AUTOCAD.md>

Also, a solution for DWG to DXF (ODAFileConverter in unattended Docker):
<https://github.com/open-indoor/dwg-to-dxf>