[GIS] Convert DWG/shp format for Openlayers

openlayers-2

I need to convert DWG/shp files to some vector data file that is supported in
Openlayers (e.g KML,GML). I tried following this guide but it doesn't work.

Please advise me some converter (not necessarily free) that I can use.

Best Answer

For shapefile - simply open shp in QGIS and on the Layer menu -> "Save as", it can save to KML, GML, GeoJSON and many more.

For DWG it is a bit harder because it is not open format, you will need some comercial tool to convert it to DXF 2000/2000i/2002 version. Then DXF file you can also open in QGIS (it uses GDAL/OGR behind the scene).

For converting DWG to DXF 2000/2000i/2002 you can use e.g. Microstation, Teigha libraries, AutoCAD.. If you need the converting automatically done on server side at runtime then it's more complicated, two possible solutions:

http://geokods.com/#!/blog/view/v8_dgn_dwg_gdal_ogr_dxf_patches

Related Question