Skip to main content

Hello,

 

How can i get the attachment of a AGOL layer to the Emailer transformer? Keep getting errors...

Please help :)

Can you give us a little more information on your errors? Is it when trying to send the email or when reading the AGOL service

 

 


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.

Knipsel


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.


Stil not working 😞 Knipsel


Stil not working 😞 Knipsel

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...Knipsel


@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...Knipsel

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.


@virtualcitymatt​ Sorry, but i try, it did not work 😞. Knipsel


@virtualcitymatt​ Sorry, but i try, it did not work 😞. Knipsel

Blast- OK try the trick with the decelerator to see what is going on and see what you need to change


Thank! LOL, it was jpg, instead of jpeg XD


Thank you so much!

 


Thank! LOL, it was jpg, instead of jpeg XD

Doh!! nice one. Glad we got there in the end!!


Doh!! nice one. Glad we got there in the end!!

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.


Doh!! nice one. Glad we got there in the end!!

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.


Reply