How can i get the attachment of a AGOL layer to the Emailer transformer? Keep getting errors...
Please help :)
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Hello @virtualcitymatt , i get the jpg data, by the arcgisonline_attachment.data format. Then i use the rasterreplacer. When i select the data format field in Emailer attachementoption he says: ValueError: stat too long for Windows. I tried to enable windows long paths, but it doesnt' help the error
Hello @virtualcitymatt , i get the jpg data, by the arcgisonline_attachment.data format. Then i use the rasterreplacer. When i select the data format field in Emailer attachementoption he says: ValueError: stat too long for Windows. I tried to enable windows long paths, but it doesnt' help the error
I think you will need to first write out the raster to a file (use the FeatureWriter - jpeg format) The output from the FeatureWriter will include the filepath (_dataset) to the written jpg file. Use this filepath in the Emailer as the Attachement.
I think you will need to first write out the raster to a file (use the FeatureWriter - jpeg format) The output from the FeatureWriter will include the filepath (_dataset) to the written jpg file. Use this filepath in the Emailer as the Attachement.
Then, i get the error in the FeatureWriter: JPEG writer: failed to create folder...
I think you will need to first write out the raster to a file (use the FeatureWriter - jpeg format) The output from the FeatureWriter will include the filepath (_dataset) to the written jpg file. Use this filepath in the Emailer as the Attachement.
Hmm, strange. Can you share a screen shot of the settings in the feature wtiter?
I think you will need to first write out the raster to a file (use the FeatureWriter - jpeg format) The output from the FeatureWriter will include the filepath (_dataset) to the written jpg file. Use this filepath in the Emailer as the Attachement.
I think you will need to first write out the raster to a file (use the FeatureWriter - jpeg format) The output from the FeatureWriter will include the filepath (_dataset) to the written jpg file. Use this filepath in the Emailer as the Attachement.
Ahh, no don't use the attribute for the filename. What you've but in there is the data from the image. The Dataset needs to be a folder path.
Ahh but you're so close! The last issue is that the _pathname attribute looks to be a folder. You need to provide the whole filename. Awesome that you're using the TempPathNameCreator. There should be an attribute coming out of the FeatureWriter which is called dataset or something. Have a look to see if that includes the whole file name. Otherwise from the featureWriter it looks like the "Raster File Name" is "Output". So the path to the file should be @Value(_pathname)\\Output OR @Value(_pathname)\\Output.jpeg
@virtualcitymatt Thanks for your help! Unfortunately, keep getting an error, I can't see whats in the temp folder, because it auto deletes after the translation...
@virtualcitymatt Thanks for your help! Unfortunately, keep getting an error, I can't see whats in the temp folder, because it auto deletes after the translation...
Ahh, no I mean you need to change the path in the Emailer not the FeatureWriter.
If you take a look at the logfile in that last screen shot you can see the "_dataset" attribute which points directly to the output Jpeg. Use the "_dataset" attribute at the path to the attachement in the Emailer.
If you want FME not to delete the file you can add in a decelerator and set it to something like 999999. This will keep the process running and you can go and find the file. Just be sure to also add a Logger so you can see the values of the _pathname (or _dataset) in the logfile.
Very nice!! Do you have an idea how i can add multiple Photo's to emailer, so i can add multiple attachements to my Emailer for one feature. Because raster replacer can only select one attachement a time. So you get different pathnames, which results in multiple features.
You will need to zip up all the files. You should be able to configure the FeatureWriter to create a zip file. Then you can just use the Zip file as the attachment.
I simply use the Raster Replacer to write a JPG file out to a directory, set the name dynamically using the exposed attachment attributes X:\\Geomatics\\Bylaw\\@Value(arcgisonline_attachment{0}.id)-@Value(arcgisonline_attachment{0}.name).jpg ...and then delete all .JPG files in the directory using a Shutdown Python Script.