<p>Based on <a href="https://forum.dji.com/thread-283890-1-1.html" rel="nofollow noreferrer">this post</a>, this solution works great:</p>
<pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;kml xmlns=&quot;http://www.opengis.net/kml/2.2&quot;&gt;
  &lt;Document&gt;
    &lt;Style id=&quot;transBluePoly&quot;&gt;
      &lt;LineStyle&gt;
        &lt;width&gt;1.5&lt;/width&gt;
      &lt;/LineStyle&gt;
      &lt;PolyStyle&gt;
        &lt;color&gt;7dff0000&lt;/color&gt;
      &lt;/PolyStyle&gt;
    &lt;/Style&gt;
    &lt;Placemark&gt;
      &lt;name&gt;QGISexport&lt;/name&gt;
      &lt;styleUrl&gt;#transBluePoly&lt;/styleUrl&gt;
      &lt;Polygon&gt;
        &lt;extrude&gt;1&lt;/extrude&gt;
        &lt;altitudeMode&gt;relativeToGround&lt;/altitudeMode&gt;
        &lt;outerBoundaryIs&gt;
          &lt;LinearRing&gt;
            &lt;coordinates&gt;
Copy here and remove this text            &lt;/coordinates&gt;
          &lt;/LinearRing&gt;
        &lt;/outerBoundaryIs&gt;
      &lt;/Polygon&gt;
    &lt;/Placemark&gt;
  &lt;/Document&gt;
&lt;/kml&gt;
</code></pre>
<p>To automate this process for regular workflows, I wrote <a href="https://github.com/CharlesLehnen/QGIS_KML_to_DJI_Pilot_2" rel="nofollow noreferrer">this script</a> which makes the process super fast for many KML files.</p>

CC BY-SA 4.0
2023-06-22T17:23:38.130Z
2023-06-22T17:23:38.130Z
Charles Lehnen
<p>I am unable to import KML polygon layers I generated in QGIS in DJI Pilot 2 on my DJI remote. I get the following error:</p>
<pre><code>Attempt to invoke interface method java.util.iterator java.util.List.iterator()
</code></pre>

<dji><smartphone-app>
QGIS KML to DJI Pilot 2 for Flight Route
Charles Lehnen
# QGIS KML to DJI Pilot 2 for Flight Route

(Asked by: username_0 on 2023-06-22)

I am unable to import KML polygon layers I generated in QGIS in DJI Pilot 2 on my DJI remote. I get the following error:

```
Attempt to invoke interface method java.util.iterator java.util.List.iterator()

```

**Tags:** dji, smartphone-app


---

## 1 answers

### Answer by username_0 on 2023-06-22. Score: 2 | Accepted answer

Based on [this post](https://forum.dji.com/thread-283890-1-1.html), this solution works great:

```
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <Style id="transBluePoly">
      <LineStyle>
        <width>1.5</width>
      </LineStyle>
      <PolyStyle>
        <color>7dff0000</color>
      </PolyStyle>
    </Style>
    <Placemark>
      <name>QGISexport</name>
      <styleUrl>#transBluePoly</styleUrl>
      <Polygon>
        <extrude>1</extrude>
        <altitudeMode>relativeToGround</altitudeMode>
        <outerBoundaryIs>
          <LinearRing>
            <coordinates>
Copy here and remove this text            </coordinates>
          </LinearRing>
        </outerBoundaryIs>
      </Polygon>
    </Placemark>
  </Document>
</kml>

```

To automate this process for regular workflows, I wrote [this script](https://github.com/username_0/QGIS_KML_to_DJI_Pilot_2) which makes the process super fast for many KML files.


---

