Skip to content

Instantly share code, notes, and snippets.

@clement-tourriere
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clement-tourriere/aa2abdc94de7d1456c58 to your computer and use it in GitHub Desktop.
Save clement-tourriere/aa2abdc94de7d1456c58 to your computer and use it in GitHub Desktop.
Polygon containing a coordinate with more than two elements
# Delete index
curl -XDELETE "http://localhost:9200/test_geojson"
# Create a test index
curl -XPOST "http://localhost:9200/test_geojson"
# Put mapping
curl -XPOST "http://localhost:9200/test_geojson/geo/_mapping" -d'
{
"geo": {
"properties": {
"location": {
"type": "geo_shape"
}
}
}
}'
# Valid Polygon
curl -XPUT "http://localhost:9200/test_geojson/geo/2" -d'
{
"location": {
"type": "Polygon",
"coordinates": [
[
[
178,
42
],
[
178,
39,
0.1
],
[
-178,
39
],
[
-178,
42
],
[
178,
42
]
]
]
}
}'
# Invalid Polygon (coordinate with a third element)
curl -XPUT "http://localhost:9200/test_geojson/geo/2" -d'
{
"location": {
"type": "Polygon",
"coordinates": [
[
[
178,
42
],
[
178,
39,
0.1
],
[
-178,
39
],
[
-178,
42
],
[
178,
42
]
]
]
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment