Skip to content

Instantly share code, notes, and snippets.

@mongolab-org
Last active August 29, 2015 14:05
Show Gist options
  • Save mongolab-org/d4018455b659a1452631 to your computer and use it in GitHub Desktop.
Save mongolab-org/d4018455b659a1452631 to your computer and use it in GitHub Desktop.
MongoDB invalid/valid polygon example
//Invalid - Each point/vertex of the polygon is provided.
{ "type": "Polygon",
"coordinates": [
[ [ 100.0 , 0.0 ] , [ 101.0 , 0.0 ] , [ 101.0 , 1.0 ] , [ 100.0 , 1.0 ] ]
]
}
//Valid - First vertex of the polygon is provided at both the beginning and end of a LinearRing.
{ "type": "Polygon",
"coordinates": [
[ [ 100.0 , 0.0 ] , [ 101.0 , 0.0 ] , [ 101.0 , 1.0 ] , [ 100.0 , 1.0 ] , [ 100.0 , 0.0 ] ]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment