Skip to main content
Question

Read from Mongo, transform geometry and write back to Mongo doesn't give expected output.


Forum|alt.badge.img

Hello,

I am having problems with Mongo reader/writer. First I read from Mongo, it works fine and I add several transformers (Clipper, spatialFilter - comparing with other datasets) and then I want to write back to mongo. When I check the output from the Data Inspector, it seems to be fine, geometry is the way I expected and the result looks good. But the Mongo Writer gives back the original geometry.

in writer settings, I put "Document Source":JSON Attribute -> mongodb_json

Thanks!

7 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • August 29, 2018

Hi @johannafalkenst,

Please change the Document Source to Feature. It is the feature that has been modified by the transformers, while the json attribute contains the original geometry.


Forum|alt.badge.img
daveatsafe wrote:

Hi @johannafalkenst,

Please change the Document Source to Feature. It is the feature that has been modified by the transformers, while the json attribute contains the original geometry.

hi @DaveAtSafe

 

Thanks for your answer. I tried to change it to Feature, but then I lose the information from the original mongo features.

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • August 29, 2018

Could it be containing a format attribute with the type of geometry?

If reader and writer have the same format, the writer gives a higher priority to format attributes and if that contained type it will remain the original geometry type instead of the converted geometry.

The quick solution would be using the BulkAttributeRemover removing all format attributes using 'mongodb_*' to be removed.

Hope this helps.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • August 29, 2018
johannafalkenst wrote:
hi @DaveAtSafe

 

Thanks for your answer. I tried to change it to Feature, but then I lose the information from the original mongo features.
Hi @johannafalkenst,

 

Would you mind sharing your workspace with me? It would help me better understand the problem you are seeing.

 


Forum|alt.badge.img

@DaveAtSafe I can now share my workspace. question-fme-hub.fmw

So the goal is to keep the attributes as in: "lines with attributes coming from Mongo* see example" (The structure looks similar to this: image-1.png)

and use the changed geometry from the FME transformation.

Thank you


Forum|alt.badge.img
daveatsafe wrote:
Hi @johannafalkenst,

 

Would you mind sharing your workspace with me? It would help me better understand the problem you are seeing.

 

@DaveAtSafe I attached my workspace in the answer above. Could you maybe have a look at it?

I still have to deal with the same problem...


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • February 20, 2019

Hi @johannafalkenst,

Please edit the properties on the at_vie_all_tmp4 feature type and expose the format attribute mongodb_id.

In the properties for the output feature type test_, set the Parameter Document ID Attribute to mongdb_id. You may also need to set the Geometry field name to 'geometry'.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings