Last active
August 29, 2015 14:14
-
-
Save clement-tourriere/aa2abdc94de7d1456c58 to your computer and use it in GitHub Desktop.
Polygon containing a coordinate with more than two elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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