Question

DWG to KML file with layers


Badge

Hello,

I have a georeferenced dwg file with lines, polygons and text that I'd like to convert to kml for view in Google Earth complete with the AutoCAD layers. I have been successful with creating a KML file that opens in Google Earth but still some problems. when viewing in FME Inspector everything except the text shows and the layers are missing. When I open the file in Google Earth only the points show and on the Places bar each object is shown on a long list, I want to see the layers like in Autocad and do not want to see the individual objetcs

Looks very promising otherwise.

Thanks


11 replies

Badge +7
Hi @djcad,

 

KML has a fairly complex structure, and you might need to tweak some settings on the writer, or perform some manipulations with KML transformers to achieve the results you're looking for. Would you be able to upload a sample of your input dataset and a description of what you'd like to see as the output? This KML article might give you a few helpful tips as well.

 

Best,

 

Nathan
Badge +2

Hi @djcad,

To set layers in the KML Writer set the Feature Type Name parameter to the fme_feature_type attribute.

Badge

@NathanatSafe

@HollyAtSafe

Thanks for the helpful replies! After tweaking settings and adding the FeatureTypeExtractor Transformer, the KML file now shows the layers correctly. Now i still needto get the text objects to kml and have the text display without the pushpins.

I have uploaded the a sample of the dwg file. greenstar-gps-sample2.dwg It is referenced to coordinate system EPSG 3459. I'd like to have all objects displayed as good as possible in the kml file. Looking at it with the FME Data Inspector, , the Autocad Reader does a great job of correctly loading the file

Thanks.

Badge

I also uploaded my workbench file if that should help greenstar-gps.fmw

Badge

I spent some time getting familiar with the software, and I pretty much have it where I want it. This is some amazing, powerful software! It looks like its best to change text to polygons with TextStroker transformer for a KML file.

Thanks for the help.

Badge +1

@djcad​ I found your question here as I am working on a similar workflow converting dwg to kml. The TextStroker suggestion was really helpful! I'd like to know if you've stuck with it and made more progress since the original post.

Badge

@osdev​ I have since created a workflow to created a fully functional workflow to convert from dwg to kml. To answer your question, the TextStroker works great but I only use it for very large text. Otherwise I use the KMLStyler and assign icons according to the general layer category, to make the display less cluttered. The label then shows as a balloon when I click on it. My dwg file is a fairly large file containing around 30,000 features, so I simplify it as much as possible. Complex geometery like ellipsoids and arcs needs to be simplified with transformers like ArcStroker and Generalizer. Also, try to simplify lines with LineCombiner and polygons with Dissolver.

 

But the problem I ran into with kml, the only software that could properly display my file is Google Earth Pro Desktop with rather shaky rendering. I have since transitioned to creating a multigeometry geopackage file, that I can style just as well with QGIS which has fast rendering and more integration options.

Good Luck!

Badge +1

@osdev​ I have since created a workflow to created a fully functional workflow to convert from dwg to kml. To answer your question, the TextStroker works great but I only use it for very large text. Otherwise I use the KMLStyler and assign icons according to the general layer category, to make the display less cluttered. The label then shows as a balloon when I click on it. My dwg file is a fairly large file containing around 30,000 features, so I simplify it as much as possible. Complex geometery like ellipsoids and arcs needs to be simplified with transformers like ArcStroker and Generalizer. Also, try to simplify lines with LineCombiner and polygons with Dissolver.

 

But the problem I ran into with kml, the only software that could properly display my file is Google Earth Pro Desktop with rather shaky rendering. I have since transitioned to creating a multigeometry geopackage file, that I can style just as well with QGIS which has fast rendering and more integration options.

Good Luck!

@djcad​  Thanks for the response and tips! I'll play around with the transformers you mentioned above. Another issue I'm noticing in making the conversion from dwg to kml is that some of the dwg linework is missing. I use a Tester to ignore the hidden features, but there are some features that aren't hidden and are just missing. Have you experienced this too? I'd be glad to take this offline and discuss my project with you if you'd be interested. jb12apps@gmail.com

Badge +1

@djcad​ If you don't mind me asking, what is your cutoff size for very large text?

Badge

@osdev​ I suspect the linework not showing just needs to be simplified with one of the above mentioned transformers. There's a reason I used each one of them, though some are simply to reduce the file size. The bottom line is, arcs(including those in polylines), splines etc. do not work with kml.

I use Textstroker for text over 4', but my project covers an area of over 500 acres, so that decision is project dependent.

Feel free to ask any questions, I have learned a lot from this forum, and the least I can do is contribute in return.

Badge +1

@djcad​ Thanks for the tip on the TextStroker. I haven't found converting arcs to be an issue yet, but I suspect there will be inconsistency from project to project (dwg to dwg) that I run with each one having a different designer and design standards. I look forward to connecting with you and discussing this topic more.

 

I've work with about a dozen different software platforms for developers and found the documentation and support from FME Support and the Community to be among the top.

Reply