LayerToKML_conversion ERROR 000584: Parameters are not valid...

1236
5
Jump to solution
07-27-2021 11:40 AM
ZacharyUhlmann1
Occasional Contributor III

Simple question with hopefully a nuts and bolts data type response, but I am confused.  I just wrote a script to convert feature classes to KML.  Seemingly same parameters as all the conversion tools --> SomeConversionTool_conversion(feature_class_to_convert, converted_layer_new_name_or_format.ext)

But in the case of LayerToKML_conversion it's erroring out I because I NEED a map open and simply the Layer passed as first argument.  WHY?  All other conversion tools allow a path to the feature?  And Dear ESRI, excellent job with the informative Exceptions.  But I did successfully run the tool in a Notebook using arcpy.LayerToKML_conversion('layer name in current map', fp_out_kml.kml').  

Is there a workaround to make scriptable versions without having to load up all data as Layers in a map.  And...Why Not?

layer_to_kml.JPG

layer_to_kml2.JPG

 

 

 

Thank - Zach

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Either a layer in the map or a *.lyrx on disk

In short it wants a layer, which means if you wanted to use a featureclass in the tool, you would have to embed a behind the scenes MakeFeatureLayer to feed into your conversion.

Kind of kludgy? perhaps, but maybe it is demand driven.  Post an Idea, or look for an existing one to see if there is widespread use of kml/z and whether direct conversion from featureclasses to kml is in demand


... sort of retired...

View solution in original post

5 Replies
Robert_LeClair
Esri Notable Contributor

Zachary - a workaround I came up with is to create a *.lyrx for the feature class in question.  Then use the *.lyrx file as the input parameter for Layer.  The GP tool will process correctly and not throw the ERROR 000584. Not an ideal solution granted but it does work.

ZacharyUhlmann1
Occasional Contributor III

For this time around I'm going with in memory lyr.  Lyrx actually may be a nice solution under a different task, and honestly not a bad idea to start creating .lyrx files for bread and butter data.  Glad you planted the seed!  

DanPatterson
MVP Esteemed Contributor

Either a layer in the map or a *.lyrx on disk

In short it wants a layer, which means if you wanted to use a featureclass in the tool, you would have to embed a behind the scenes MakeFeatureLayer to feed into your conversion.

Kind of kludgy? perhaps, but maybe it is demand driven.  Post an Idea, or look for an existing one to see if there is widespread use of kml/z and whether direct conversion from featureclasses to kml is in demand


... sort of retired...
ZacharyUhlmann1
Occasional Contributor III

That works Dan.  Thanks.  I was hoping there was a way to avoid creating lyrs but apparently not.  Post an idea you say?  I've seen this before yet never contributed.  Just bellyache and criticize.  Perhaps I will for this one...

0 Kudos
ZacharyUhlmann1
Occasional Contributor III

Both @DanPatterson  and @Robert_LeClair  had great solutions, but I wanted to incorporate solution programmatically withOUT having to create extra lyrx files, hence going with Dan's solution.  Thanks!