MongoEngine / MongoEngine/mongoengine

Point coordinates should allow more than 2 elements according to GeoJson standard

Open
#1,172 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.