Question

Does MongoDB writer support multi-polygon geometry type?

  • 6 November 2017
  • 2 replies
  • 2 views

Badge +6

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

Badge +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?

Badge

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.

Reply