[CSHARP-807] Error: Can't extract geo keys from object, malformed geometry? Created: 27/Aug/13 Updated: 20/Mar/14 Resolved: 28/Aug/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.8.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Vladimir Bodurov | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Attachments: |
|
| Description |
|
If I have geo-spherical index on "geo" field I can insert the attached document to mongo DB 2.5.1 but when I try to insert collection as collection.Insert(BsonDocument.Parse(File.ReadAllText("data1.txt"))) I get error MongoDB.Driver.WriteConcernException : WriteConcern detected an error 'Can't extract geo keys from object, malformed geometry?: Why I get error when using the driver when I can insert it directly to mongo 2.5.1 |
| Comments |
| Comment by Robert Stam [ 28/Aug/13 ] | |||||||||||||||||||||||||||
|
OK. Thanks for the update. | |||||||||||||||||||||||||||
| Comment by Vladimir Bodurov [ 28/Aug/13 ] | |||||||||||||||||||||||||||
|
I tried 2.5.2 and it works. | |||||||||||||||||||||||||||
| Comment by Robert Stam [ 28/Aug/13 ] | |||||||||||||||||||||||||||
|
I am able to reproduce your error message when I run against a 2.5.0 server, but not against 2.5.1 or 2.5.2. This is the test code I'm using:
This is the output when run against a 2.5.0 server:
This is the output when run against a 2.5.1 server:
This is the output when run against a 2.5.2 server:
I also saw this warning in the server log when I ran the above test code against 2.5.1 or 2.5.2:
| |||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
Oops... I wasn't using the latest version of the server. Sorry. I'm away from my development computer right now, but I will try again later tonight. | |||||||||||||||||||||||||||
| Comment by Vladimir Bodurov [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
Did you try inserting it into 2.5.1? Yes I can insert it into 2.5.1 using the shell! It is not expected to work on a version of mongo (db.version()) less than 2.5.1 | |||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
I tried inserting the document you provided in Data1.txt using the mongo shell and I got the same error you are seeing from the C# driver:
| |||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
Right, What do you mean when you say "I can insert the given polygon directly into mongo"? Do you mean using the MongoDB shell? | |||||||||||||||||||||||||||
| Comment by Vladimir Bodurov [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
the result is: , , mongo 2.5.1 DOES support multi objects Event more so I can insert the given polygon directly into mongo The problem is in the driver not in the mongodb | |||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
It might just be that the server doesn't support MultiPolygon data. The following documentation page: http://docs.mongodb.org/manual/core/2dsphere/ Only lists the following GeoJSON objects:
The following server ticket states that support for MultiPolygon was added in 2.5.1: https://jira.mongodb.org/browse/SERVER-8907 Which is a bit odd since you mention that you were testing with 2.5.1. | |||||||||||||||||||||||||||
| Comment by Robert Stam [ 27/Aug/13 ] | |||||||||||||||||||||||||||
|
Can you provide the result of running this command in the MongoDB shell:
Replacing "test" with the name of your collection. Knowing exactly how your index is defined will help me try to reproduce this. Also, can you clarify what you mean by "I can insert it directly to mongo 2.5.1". Do you mean using the MongoDB shell? |