[QGIS-Developer] New KML Tools Plugin

C Hamilton adenaculture at gmail.com
Fri Sep 7 08:57:47 PDT 2018


I just released a new KML Tools plugin that includes a fast KML importing
tool and one to expand the KML description field, containing HTML tables
with name/value pairs into fields in the output layer.

Why have another KML import tool? We have had issues with importing KMLs
into QGIS. The situation is that if there are many folders in a KML, QGIS
imports each as a layer and is very slow at importing or crashes during the
import and it can generate hundreds of layers. This also happens using
ArcGIS. I am assuming they both use GDAL and in some respects GDAL tries to
do too much.

With the KML Tools importer rather than create multiple layers for each
folder in the KML, I create one point layer, one line layer and one polygon
layer as needed. I add an additional field that contains the folder
structure for each feature. This way you can still filter on the KML
folders.

The second tool is to expand an HTML table in a layer's field (presumably
from a KML although it could be any layer) into separate attribute fields.
For example if a layer has a description field containing the following, it
would create two new attribute fields named 'City' and 'State' and will
populate the contents appropriately.

<table>
     <tr><td>City</td><td>Provo</td></tr>
     <tr><td>State</td><td>Utah</td></tr>
</table>

This is a first release and I realize that it will not handle all cases,
but it works for our needs. The KML importer is not a complete KML
implementation so I am looking for your input as to what you would like to
see. As I get additional examples I can make the import better and the
'description' expansion better.

Because KMLs are so unstructured, it is impossible to handle all cases of
expansion and even within the same KML different formats may be used in the
description field that may contradict each other. The only ones that can
really be handled are the most structured cases.

Here is the new plugin:

https://plugins.qgis.org/plugins/kmltools/

Let me know if you have any suggestions.

Thanks,

Calvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180907/8b99a5c8/attachment.html>


More information about the QGIS-Developer mailing list