georeference.org
Subscribe to this thread
Home - General / All posts - How to import "description" field with KML file?
GordonG
13 post(s)
#01-Feb-10 18:20

Surely several of you have resolved this, but I don't find specific guidance in the forum archives. What is the best way to get Manifold to import the "description" field along with the rest of a KML file. When I edit the KML file manually to delete "<![CDATA[<div dir="ltr">" and "</div>]]>" from that field, my descriptions are imported. If I do a search/replace to eliminate those codes, Manifold gives an "Unknown Error" message and does not import the drawing at all. All suggestions will be appreciated. Thank you! G

Gustavo Palminha

595 post(s)
#01-Feb-10 18:29

Can you put a kml file here?

Never faced this, probably you edited something wrong.

regards.

GordonG
13 post(s)
#01-Feb-10 19:35

Thanks for your interest, Gustavo. Here is the code from a KML file saved by Google Maps. I agree that this is user error -- I just don't know what my error is! G

<?xml version="1.0" encoding="UTF-8"?>

<kml xmlns="http://earth.google.com/kml/2.2">

<Document>

  <name>Test 07</name>

  <description><![CDATA[Testing import of KML to Manifold]]></description>

  <Style id="style1">

    <IconStyle>

      <Icon>

        <href>http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-dot.png</href>

      </Icon>

    </IconStyle>

  </Style>

  <Style id="style2">

    <IconStyle>

      <Icon>

        <href>http://maps.gstatic.com/intl/en_us/mapfiles/ms/micons/blue-dot.png</href>

      </Icon>

    </IconStyle>

  </Style>

  <Placemark>

    <name>Marker 1</name>

    <description><![CDATA[<div dir="ltr">Good fishing around here</div>]]></description>

    <styleUrl>#style1</styleUrl>

    <Point>

      <coordinates>-110.830078,45.644768,0.000000</coordinates>

    </Point>

  </Placemark>

  <Placemark>

    <name>Marker 2</name>

    <description><![CDATA[<div dir="ltr">Good diving here</div>]]></description>

    <styleUrl>#style2</styleUrl>

    <Point>

      <coordinates>-79.013672,25.562265,0.000000</coordinates>

    </Point>

  </Placemark>

</Document>

</kml>

dgallen
73 post(s)
#22-Apr-10 09:33

I was having the same issue when importing a KML generated by Google Maps via Scribble Maps Pro. Using the CDATA related information provided by Lionel in his note in http://forum.manifold.net/forum/t68225.8 here is the mechanized "search and replace" approach I used.

1) delete all instances of <![CDATA[

2) delete all instances of ]]>

3) delete all instances of <div dir="ltr">

4) delete all instances of </div>

This is a 4 step process.

I initially had Manifold "unknown" import errors when using notepad to edit and save the kml so I switched to a proper editor like Ultraedit and made sure that I saved in UTF-8 format and not plain text.

Worked fine for me and can now create a macro in Ultraedit to automatically clean up my kml so Manifold properly imports the shapes with names and descriptions intact.

1 msec Copyright (C) 2007-2008 Manifold.net. All rights reserved.