[Script] WME KML Area: creating places from KML polygons

WME KML Area: creating places from KML polygons

Want to add a large Area type Place in WME with detail and precision?

It could be a park, a forest, a lake, a reservoir, a square…

Now you can import polygons directly into WME, without having to trace every curve of the outline.

You only need this script and a KML file obtained from a reliable and public source.


:face_with_monocle: What this script does

This script adds a tab called “KML Area” to the WME scripts panel.
From it, you can:

  • Load a .kml file containing one or more polygons (KML with <Polygon>).
  • List the found polygons and select which one you want to use.
  • Choose a field to name each polygon more usefully.
  • Auto-fill the place name in WME (editable).
  • Select category for the area (e.g., Park, Square, etc.).
  • Preview the polygon on the map (temporary overlay).
  • Create the place (Venue) as an area type with one click.
  • Use Advanced settings:
    • Simplify polygon (reduce vertices) if it is too complex.
    • Adjust position with keyboard arrows (fine movement) if the KML is offset.

Use with moderation and responsibility!


:footprints: Step-by-step Manual

:white_check_mark: Step 1 — Load the KML

  1. Open WME and go to the Scripts tab.
  2. Click on KML Area.
  3. Under “Select KML file”, choose your .kml.
  4. Wait for it to load.

:white_check_mark: Step 2 — Choose the field that names the polygons

  1. Choose one of the fields extracted from the KML that contains the place names.
  2. Click OK.

:white_check_mark: Step 3 — Select the polygon

  1. Select the polygon you want to insert.
  2. Upon selection, the script:
  • shows the preview on the map
  • centers/adjusts zoom as much as possible
  • auto-fills the name in Step 4

:white_check_mark: Step 4 — Review/edit name

  1. Adjust the name if necessary.
  2. Click OK.

:white_check_mark: Step 5 — Select category

  1. Choose the category for the area (e.g., Park).
  2. Click OK.

:white_check_mark: Step 6 — Show or clear polygon (optional)

  • Show polygon: draws the outline on the map (overlay).
  • Clear polygon: removes the overlay from the map.

:white_check_mark: Step 7 — Create area in WME

  1. Click on Create place (Area).
  2. WME creates the Venue with the polygon geometry and applies:
  • Selected category
  • Name (auto-filled/edited)

Now follow the normal WME workflow:

  • check attributes
  • adjust details if necessary
  • click Save in WME

:white_check_mark: Step 8 — Create the next one

After saving in WME:

  1. Click on an empty space on the map to return to the KML Area tab.
  2. Continue:
  • from Step 3 to choose another polygon, or
  • from Step 1 to upload another KML.

:wrench: Advanced settings

Simplify polygon

Use if:

  • The polygon has too many points, making it too “heavy”
  • WME takes too long to save or rejects it due to complexity

How it works:

  • A slider changes the simplification level
  • The script shows the resulting point count
  • Click OK to apply

Adjust position

Use if:

  • The KML polygon is “offset” (e.g., a few meters to one side)

How it works:

  • Click Start adjustment
  • Use the keyboard arrows ← ↑ ↓ → to move with precision
  • Click OK to apply

:red_question_mark: Tips and Troubleshooting

The polygon “doesn’t match” the map (offset)

  • Use Advanced settings → Adjust position
  • Click Start adjustment and move with the arrows

The polygon is heavy and WME won’t save

  • Use Advanced settings → Simplify polygon
  • Reduce vertices until it becomes stable

The script doesn’t detect any polygons

  • Check if the file actually has <Polygon> (not just LineString/Point)
  • Some KMLs downloaded from websites might be “broken” (HTML instead of KML, or XML with junk before the <kml>)

The preview appears, but the created area looks strange

  • KML with degenerate geometry (repeated points, invalid ring, etc.) can generate unexpected results
  • Try simplifying before creating

:nerd_face: Requirements

  • Access to Waze Map Editor
  • Userscript extension:
    • Tampermonkey (recommended) or Violentmonkey
  • Desktop browser (Chrome/Firefox/Edge)

:down_arrow: Download now

Congratulations Paulo :clap:t2: :clap:t2: :clap:t2:

Show :clap::clap::clap:

Great script! :clap:t2::clap:t2:

Great!!! Congratulations!! :grinning_face:

Congratulations :clap: :clap:

@paulogustavoPI Congratulations on the initiative! It will be very useful for registration with the actual geometry.

Just keep in mind that the creation of cities and districts is still carried out exclusively by L6 editors, following guidelines already defined by the community.

The discussion regarding the mapping of villages and hamlets, such as indigenous lands for example, has not yet been authorized based on what I have followed in past debates, whether via POI or in polygon format, as is done for cities.

Hi, @GabiruX, thanks for the encouragement!

It didn’t cross my mind to map districts, especially since they are units almost equivalent to cities (and that’s how they’ve been treated in Waze Brazil).

As for indigenous lands and settlement projects, recognized as such by law and with a defined perimeter, I believe this is relevant information for the user, both visually and so that editors can map roads to drive there.

When I wrote that post you quoted, I was saying that the community didn’t treat settlements or indigenous lands the same way it treats districts and cities. Personally, I don’t see any obstacle to creating them as area-type places, similar to condos.

The script should be used with moderation and responsibility, as I mentioned above, but it would be interesting to make the existence of official staff and community restrictions public, at the risk of depriving the user of relevant information without even having the opportunity to defend its inclusion.