I am converting a KMZ to shapefile and need to see a field called "Type Name", but it is not in any of the shapefiles' attribute tables. enter image description here

I have every name exposed in Format Attributes in the Reader and the reader's User Attributes are blank:

enter image description here

All the fields that show up in the attributes table are listed in the writer's User Attributes tab and I have tried it with Automatic and Dynamic selected: enter image description here

Also, it's strange that none of the fields have any real data. Every record in most of them is either blank or 0, and the others have meaningless constants. Am I doing what I need to do to in the conversion to see all the fields in this KMZ?

  • "Type Name" is not a valid dBase field name (spaces are forbidden)
    – Vince
    Jun 19 '19 at 19:56
  • I'm told, "it's something like 'Type Name'." As shown above in the Feature Type dialog box, "kml_type_name" is not in the attributes list.
    – Regulus
    Jun 19 '19 at 20:06

If it's the KML type, then that's the FME format attribute kml_name. You have it exposed in the reader, but then you need to connect it to something in the writer for it to get written.

Best solution is to use Manual for the output schema and add a new attribute (such as kmltype).

Then use an AttributeManager to rename the incoming kml_name to kmltype on the output.

Otherwise, can you see this attribute if you open up the KMZ in the FME Data Inspector? If you can't see it there then it's not going to come through the reader in Workbench. At that point perhaps open up the KML file in a text editor (the KMZ should simply be a zip file that you could extract the KML file from) and see if you can actually see it inside the file.

Other things you could do are to try the Scan Schema parameter on the reader (when you add the reader it should be set to Yes), and if that fails turn on the Verbose Logging parameter on the reader (which may give more info about what is going on).

  • Every feature in kml_name has NULL as the value. I see a field named kml_type in Data Inspector, though. I am a bit confused how to use AttributeManager because it would output to the writer. But the writer is where I would rename the field so AttributeManager could rename it. How can I do this? Thank you.
    – Regulus
    Jun 20 '19 at 13:27
  • Where you have the option to Automatic/Manual/Dynamic click in the next blank space at the bottom of the list of attributes and enter your new attribute name. Then in the AttributeManager just find the attribute you've exposed on the input, and set its "Output Attribute" name to the attribute name you just added on the output. Jun 20 '19 at 14:31
  • I ran the AttributeManager transformer on the Placemark feature and got no output. (Maybe I did it wrong, as I put the AttrMgr between the reader and the Reprojector transformer. But I now realize the field I was using is just a useless fme field - fme_type - and its value is "fme_point". kml_name = "NULL" and kml_type, which I only see in Data Inspector when I select a point. kml_type = "kml_point". So I have no idea which field to run the AttributeManager on. Scan Schema has always been set to Yes. I ran it again with Verbose Logging = 'Yes' and without AttrMgr and again got no output. ...
    – Regulus
    Jun 20 '19 at 18:41
  • However, I looked in the html code of the output and saw the things I am interested in... Field named TYPE_NAME and values "THEORETICAL SPLICE" and "SPLICE_CLOSURE_ID". [code]<td>TYPE_NAME</td> <td>THEORETICAL SPLICE</td> </tr> <tr bgcolor="#D4E4F3"> <td>SPLICE_CLOSURE_ID</td> <td>&lt;Null&gt;</td>[/code]
    – Regulus
    Jun 20 '19 at 18:45
  • HTML tags, eh? That looks like it might get stored inside the description tag of the KML. Is that the parent tag of this section? If so expose the kml_description attribute in FME and use the HTMLExtractor transformer to get the data out of it. I'm not too well versed in CSS but I think if you put "td" (without the quotes) into the CSS Selector field and then set the Return Format to List Attribute, then you'll be able to see that HTML split up into its components. Then I'd suggest a ListIndexer transformer to get the values you want. Jun 21 '19 at 14:53

Mostly likely you will have to dig deeper and expose the Format Attributes...

There can be many for kml but a good start is to expose the kml_description/raw_text/document attributes.

enter image description here

Here is an example.

  • As stated above, I am exposing every Format Attribute in both the reader and writer.
    – Regulus
    Jun 19 '19 at 20:21
  • use the AttributeExposer Transformer after this step
    – Mapperz
    Jun 19 '19 at 20:28
  • I added that transformer and connected it to the Placemark reader and, regardless if I select Import from Attribute names or Import from Attribute values, the list of attributes to import is blank.
    – Regulus
    Jun 19 '19 at 20:48
  • it might not be in placemark there maybe style or other kml features that need to be used. do you have a link to the the kml?
    – Mapperz
    Jun 19 '19 at 20:56
  • Sorry, there's no link to it. Placemark has 5878 features and all the other features (e.g., Style, Document, ...) combined have 4. I still tried them, though, but got the same result.
    – Regulus
    Jun 19 '19 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.