Skip to content

Instantly share code, notes, and snippets.

@netmilk
Created Mar 7, 2016
Embed
What would you like to do?
MSON Array of arrays of arrays
# MSON Array of arrays of arrays
# GET /polygon
+ Response 200 (application/json)
+ Attributes (Complex Polygon)
+ Body
[[[0, 0], [0, 5], [5, 5], [0, 5], [0, 0]], [[1, 1], [4, 1], [4, 4], [1, 4], [1, 1]]
# Data structures
## Complex Polygon (array[Polygon])
- (Polygon, required) - First list is an enclosing polygon
- (Polygon, optional) - Next ones are cut out areas
# Polygon (array[Point])
Polygon is defined by three or more points
- (Point, required)
- (Point, required)
- (Point, required) - Three points make basic polygon - the triangle
- (Point, optional)
# Sample
- (array)
- (Point)
- 1
- 2
- (Point)
- 3
- 4
- (Point)
- 5
- 6
- (Point)
- 7
- 8
- (Point)
- 9
- 10
## Point (array)
- 100 (number, required) - position on axis X
- 200 (number, required) - position on axis Y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment