I am trying to generate a map of a mock city.
The city layout was drawn in DWG format with the district boundaries drawn as "MPolygons".
I would like to convert the city layout from DWG to KML, while converting the "MPolygons" (in DWG) to "Polygons" (in KML).
However, every time I export my DWG to KML, the "MPolygons" are converted to "Polylines" instead.
Has anyone ever came across this problem and does anyone have a solution?
P.S.
The reason why the district boundaries have to be in Polygon is because I am building a choropleth map with Mapbox for data visualisation.
My intention is for the districts to change colour depending on the data tagged to the respective districts.
Mapbox does not recognise polylines as "containers" so the data cannot be tagged to the districts.
It does however, recognise polygons.
Solved! Go to Solution.
Solved by ChicagoLooper. Go to Solution.
Solved by braudpat. Go to Solution.
I tried in 2019, and I got a polygon in kml from mpoligon to dwg.
What is your version?
And how exactly do you export?
Apparently, you need to attach an example of your mpoligons in dwg.
Hi @АлексЮстасу
Thanks for responding.
I am using AutoCAD Civil 3D 2021 Metric.
My apologies, it seems, I did not assign a proper coordinate system.
Instead, I plotted the map based on a rough estimate of the lat long converted from the Civil 3D's XYZ (I did this as the local authorities uses a different coordinate system than the standard WGS48).
After assigning the proper coordinate system (WGS48-47N), I successfully exported the MPolygon to Polygon in KML.
DWG:
KML:
However, now I found another problem.
When I loaded the KML file in Google Earth, I noticed that the polygon is somehow "broken".
The coordinates in the polygon does not follow the outline of the district boundary but it "zig-zags" around the interior of the polygon:
Have you come across the same problem?
I've attached my files for your reference.
Hello
I don't understand why you are using MPolygons !
You have no Islands / Holes into your MPolygons so why you don't use standard 2D closed PLines ?
Please test with my KML ... Is it OK for you ?
When I have "unnecessary" MPolygons (no Islands / Holes), I am using a beautiful Lisp routine (from a french developper Bruno) to convert MPolygons to 2D closed Plines keeping ODs (Object Data) if there are ODs present on the MPolygons !? ... Do you need it ??
THE HEALTH, Regards, Patrice
Patrice BRAUD
If you want KML polygons taken from your AutoCAD file, you can export the polygons to shapefile. Be sure you have already assigned an appropriate coordinate system to modelspace before performing MapExport. After the shapefile has been successfully exported, you can bring it into to Google Earth Pro and perform a Save As to KMZ or KML. The new KMZ/KML will be polygonal objects.
Here are the steps:
Chicagolooper
Hello @ChicagoLooper
BRAVO for your very clear Tutorial ! I hope it will help @muhammadfareez !?
THE HEALTH, Regards, Patrice
Patrice BRAUD
Thanks @ChicagoLooper @braudpat !
Both solutions work perfectly.
This is my first time posting in this forum.
I'm glad for the positive feedback from the community 🙂
Kudos to you two legends!
Can't find what you're looking for? Ask the community or share your knowledge.