Hi @jimo,
I have just created a dynamic translation to KML and I can still change the extension kml to kmz and it works just fine. Try it yourself and change the D:
esult2.kmz to D:
esult2.kml
acad2ogckml.fmwt
Hi @jimo,
I have just created a dynamic translation to KML and I can still change the extension kml to kmz and it works just fine. Try it yourself and change the D:
esult2.kmz to D:
esult2.kml
acad2ogckml.fmwt
This works because you are writing the file name. However, in my case the file name will be set by a parameter. When I do it this way, I always get "doc.kml", not the filename that I passed in.
At any rate, I realized that I can use the zipfile module in the Python shutdown script to extract the doc.kml from the KMZ file, like this:
import zipfile
zip_ref = zipfile.ZipFile(pathToSourceKML, 'r')
# Where I want to write the KML
zip_ref.extractall(pathToUnzippedKML)
zip_ref.close()
Then I can use shutil.move(src,dst) to change the file name from doc.kml to the name that I want it to be.
Also when fetching the parameter value and adding the .kml to it ?
Hi @jimo, I think you can control the destination format (KML or KMZ) via file extension (.kml or .kmz) in the string expression for the Fanout Dataset option in the KML writer. e.g. assume that a feature attribute called "_basename" stores the destination filename without extension,
Hi @jimo, I think you can control the destination format (KML or KMZ) via file extension (.kml or .kmz) in the string expression for the Fanout Dataset option in the KML writer. e.g. assume that a feature attribute called "_basename" stores the destination filename without extension,
If the destination filename without extension will be specified through a user parameter (e.g. named "BASENAME"), this expression is available.
$(BASENAME).kml
Hi @jimo, I think you can control the destination format (KML or KMZ) via file extension (.kml or .kmz) in the string expression for the Fanout Dataset option in the KML writer. e.g. assume that a feature attribute called "_basename" stores the destination filename without extension,
The $(BASENAME).kml is the syntax that works. Thanks @takashi@takashi.