MongoEngine / MongoEngine/mongoengine
Point coordinates should allow more than 2 elements according to GeoJson standard
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4h 41m
- Merged PRs (30d)
- 11
Description
When validating a point, mongoengine enforces a 2d array as coordinates, while, according to GeoJson standard, in "coordinates" field , There must be at least two elements, and may be more.
In my case I would like to have a timestamp together with the position.
I would change the check to len(value) >= 2 and do type check on first 2 values only.
I can create a pull request with the proposed changes in these places.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mongoengine/base/fields.py at the linked point-validation code, then inspect the other locations found by searching for "two-dimensional". Confirm how coordinate length and element types are currently checked, and verify that valid GeoJSON positions with additional elements are accepted while invalid coordinates remain rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100