Hi,
I have a project in which I need to convert some information to KML from DWG. I have been trying to do this with Autocad Map 3D, but have not fully succeeded, and was hoping someone could help me out, point out what I'm doing wrong or give me some advice on alternative ways to convert dwg to kml.
As an example file (I'll attach this post), I have made a circle in the center of the Helsinki railway station, and am trying to convert it to kml. For some reason I can not seem to get the coordinates right at all. The coordinates I get out in the kml file is instead focused around 20°N 50°E which is in not nearly in the vicinity of Helsinki.
Here is how I am trying to do the conversion:
Anyone who can help me with this problem? I don't understand why the coordinates are suddenly 20°N 50°E in the KML file.
Attached also the dwg but unfortunately I can't seem to attach the kml file, so I'll just copypaste it here.
converstiontest.kml:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>conversiontest</name>
<visibility>1</visibility>
<Folder id="kml_ft_conversiontest">
<name>conversiontest</name>
<Placemark id="kml_1">
<name>kml_1</name>
<Style>
<LineStyle>
<color>ffffffff</color>
</LineStyle>
</Style>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>20.0042489570959,49.9999999218034,0.0 20.0042328095989,50.0002386229927,0.0 20.0041844473856,50.0004755086928,0.0 20.0041042380562,50.0007087760203,0.0 20.0039927916157,50.0009366496048,0.0 20.0038509558443,50.0011573951018,0.0 20.0036798098571,50.0013693323955,0.0 20.0034806559021,50.0015708483882,0.0 20.0032550094577,50.0017604092815,0.0 20.0030045877046,50.0019365722529,0.0 20.0027312964618,50.0020979964417,0.0 20.0024372156824,50.0022434531581,0.0 20.0021245836233,50.0023718352394,0.0 20.001795779807,50.0024821654799,0.0 20.0014533069052,50.0025736040734,0.0 20.001099771684,50.0026454550072,0.0 20.0007378651546,50.0026971713639,0.0 20.0003703420806,50.0027283594851,0.0 20.0,50.0027387819705,0.0 19.9996296579194,50.0027283594851,0.0 19.9992621348454,50.0026971713639,0.0 19.998900228316,50.0026454550072,0.0 19.9985466930948,50.0025736040734,0.0 19.998204220193,50.0024821654799,0.0 19.9978754163766,50.0023718352394,0.0 19.9975627843176,50.0022434531581,0.0 19.9972687035382,50.0020979964417,0.0 19.9969954122954,50.0019365722529,0.0 19.9967449905423,50.0017604092815,0.0 19.9965193440979,50.0015708483882,0.0 19.9963201901429,50.0013693323955,0.0 19.9961490441557,50.0011573951018,0.0 19.9960072083843,50.0009366496048,0.0 19.9958957619438,50.0007087760203,0.0 19.9958155526144,50.0004755086928,0.0 19.9957671904011,50.0002386229927,0.0 19.9957510429041,49.9999999218034,0.0 19.995767232536,49.9997612217984,0.0 19.995815635604,49.9995243396156,0.0 19.9958958832664,49.9992910780312,0.0 19.9960073643536,49.9990632122413,0.0 19.9961492300328,49.9988424763535,0.0 19.9963204002799,49.9986305501916,0.0 19.9965195721098,49.9984290465151,0.0 19.9967452295013,49.9982394987482,0.0 19.9969956549407,49.9980633493146,0.0 19.9972689424972,49.9979019386635,0.0 19.9975630123296,49.9977564950735,0.0 19.9978756265136,49.9976281253085,0.0 19.9982044060701,49.9975178061997,0.0 19.9985468490642,49.9974263772155,0.0 19.9989003496386,49.9973545340762,0.0 19.999262217835,49.9973028234627,0.0 19.9996297000543,49.9972716388587,0.0 20.0,49.9972612175577,0.0 20.0003702999457,49.9972716388587,0.0 20.000737782165,49.9973028234627,0.0 20.0010996503614,49.9973545340762,0.0 20.0014531509358,49.9974263772155,0.0 20.0017955939299,49.9975178061997,0.0 20.0021243734864,49.9976281253085,0.0 20.0024369876704,49.9977564950735,0.0 20.0027310575028,49.9979019386635,0.0 20.0030043450593,49.9980633493146,0.0 20.0032547704987,49.9982394987482,0.0 20.0034804278902,49.9984290465151,0.0 20.0036795997201,49.9986305501916,0.0 20.0038507699672,49.9988424763535,0.0 20.0039926356464,49.9990632122413,0.0 20.0041041167336,49.9992910780312,0.0 20.004184364396,49.9995243396156,0.0 20.004232767464,49.9997612217984,0.0 20.0042489570959,49.9999999218034,0.0</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</Placemark>
</Folder>
</Document></kml>
.
Solved! Go to Solution.
Solved by ChicagoLooper. Go to Solution.
Solved by ChicagoLooper. Go to Solution.
You're correct, you're not doing it right.
First of all, you don't really want to 'convert' your drawing to kml. What you want is a geospatial drawing so it's properly referenced to the equator and north pole.
You are getting the Lat/Long from Google Earth but you don't mention the desired or target coordinate system you wish to work with--there are multiple that you can use for Helsinki.
Do this:
With your coordinate system properly assigned to modelspace, you can verify the Lat/Long coordinates. The coordinates will be LIVE and will instantly update as you move your cursor.
Thanks @ChicagoLooper this was exactly the kind of step-by-step guide I was hoping for! 🙂
I now managed to export the needed objects for my customer to the kml format and it looks perfect! Thank you very much!
Can't find what you're looking for? Ask the community or share your knowledge.