Skip to main content
Question

Does MongoDB writer support multi-polygon geometry type?


fmeuser_gc
Contributor
Forum|alt.badge.img+8

Couldn't write to MongoDB with multi-polygon geometry. I get this error.

MONGODB writer: Bulk write: OperationException: { index: 890, code: 16755, errmsg: "Can't extract geo keys: { _id: ObjectId('59fcc51628de9b19a60bf281')

Any parameters to be changed for bulk write/multi-polygon geometry type?

Thanks.

2 replies

richardatsafe
Safer
Forum|alt.badge.img+10

Hi @fmeuser_gc,

The mongo db writer does support a multi-polygon. Possibly it may be a malformed geometry. It may be worth passing the geometry through a GeometryValidator to confirm the geometry, and confirm that the fme_geometry type going in is aggregate. Are you generating the geometry within FME with an aggreagtor?


jakemolnar
Forum|alt.badge.img

First thing, there should be an option to turn off bulk writing in the writer settings:

Advanced > Use Bulk Inserts: No

 

Turning off bulk inserts can help you pinpoint exactly which feature is causing the problem, and often MongoDB gives us a better error message too.

In your case, I suspect either:

  • MongoDB considers your geometry is invalid somehow (eg. self-intersection, 0 rings, etc.)
  • Your geometry exceeds the limits of the LL-WGS84 coordinate system (ie. has a vertex beyond the bounding box of x in [-180,180] and y in [-90,90]

Can you try rerunning with non-bulk inserts and post the log message? It would also be helpful to log the offending feature if possible.


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