hexagonly 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +4 -1
- data/LICENSE.txt +1 -1
- data/README.md +26 -14
- data/examples/1.geojson +1 -0
- data/examples/2.geojson +1 -0
- data/lib/hexagonly/hexagon.rb +0 -13
- data/lib/hexagonly/point.rb +4 -1
- data/lib/hexagonly/polygon.rb +16 -0
- data/lib/hexagonly/version.rb +1 -1
- data/localities.rb +18 -3
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmE0MWE1MjAyYmVkZWM0NGNmOWNkZjBhYjE4ZWEyZThkZjU5Yjc0NA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTkyOGQ2N2M4NjJjYjAzY2U5ZmZlYjEwMDRjNTk1ZWRlMTljZTIyYQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTZhZDU0YmZjYzgwYzZhZjRlN2M4NmMyNWRhNjY4OThiNGI1NmJhZjEwNzlh
|
10
|
+
YmQ0MmVhZTNkZjFlMjMxYTA0M2YyZmYzM2IyMzQ0N2Q0MWRkMmRkMDg1YTk3
|
11
|
+
ZWVmZGY1ZjI4Mjg5OGQwY2Y3MjZjN2JjZGMwNTZlMGYyZjQzZmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzQ4MWQ4N2E3YjA1N2VkNWVmYWY3ZGEwZDNlYWM3ODM4OTVhMWUwNWYzNGUz
|
14
|
+
NTkyOWY1YjlmNWJlYjA3NGVhZDBiMTg0ZDhlN2M1YzFiZmU4YjVjYTlkODI3
|
15
|
+
ZTYxNjk5MjczMTRlM2E4ZTNmNWM2MmMzNDlmOGZmYmJlMDZkYTg=
|
data/.gitignore
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Circles would have been a good option for grouping objects in a 2-dimensional sp
|
|
11
11
|
circles are not really *tileable*.
|
12
12
|
**Hexagons**, on the other hand, combine properties of the two shapes: they are easily tileable and have (sort of) a radius.
|
13
13
|
|
14
|
-
I've tested this on my
|
14
|
+
I've tested this on my project with > 5000 points, but I guess it should work with **2D games** as well, or anything else that requires tiling or polygon-related operations.
|
15
15
|
|
16
16
|
## Features
|
17
17
|
|
@@ -58,7 +58,7 @@ There are 2 ways for defining Point objects:
|
|
58
58
|
2. By using your custom class (e.g. think ActiveRecord) and including ``Hexagonly::Point::Methods``
|
59
59
|
inside your class definition. Then you would assign your own accessors as coordinate getters and setters.
|
60
60
|
This is accomplished via the class method ``x_y_coord_methods`` which takes two arguments: the names of the x and y coordinate accessors.
|
61
|
-
The ``x_y_coord_methods`` defaults to ``:x`` and ``:y``.
|
61
|
+
The ``x_y_coord_methods`` method defaults to ``:x`` and ``:y``.
|
62
62
|
|
63
63
|
```ruby
|
64
64
|
class MyCustomPoint
|
@@ -118,7 +118,7 @@ The ``poly_points_method`` method defaults to ``:poly_points``.
|
|
118
118
|
|
119
119
|
### Hexagons
|
120
120
|
|
121
|
-
Hexagons inherit all methods
|
121
|
+
Hexagons inherit all methods from Polygons. There are 2 ways of creating new Hexagons:
|
122
122
|
|
123
123
|
1. By using the pre-defined ``Hexagonly::Hexagon`` class:
|
124
124
|
|
@@ -152,16 +152,17 @@ Hexagons inherit all methods of Polygons. There are 2 ways of creating new Hexag
|
|
152
152
|
|
153
153
|
### Hexagonal tiling
|
154
154
|
|
155
|
-
You start by defining your boundries. Boundries are basically a collection of 2 or more
|
155
|
+
You start by defining your boundries. Boundries are basically a collection of 2 or more ``Hexagonly::Point`` objects or objects including ``Hexagonly::Point::Methods``:
|
156
156
|
|
157
157
|
```ruby
|
158
|
+
# Use the default Point class
|
158
159
|
boundries = [
|
159
160
|
Hexagonly::Point.new(1, 2),
|
160
161
|
Hexagonly::Point.new(4, 5),
|
161
162
|
...
|
162
163
|
]
|
163
164
|
|
164
|
-
# Or
|
165
|
+
# Or use a custom class that includes Hexagonly::Point::Methods
|
165
166
|
boundries = [
|
166
167
|
MyCustomPoint.new(1, 2),
|
167
168
|
MyCustomPoint.new(4, 5),
|
@@ -170,15 +171,15 @@ boundries = [
|
|
170
171
|
```
|
171
172
|
|
172
173
|
Once you've defined your boundries, you can pass them to the ``Hexagonly::Hexagon.pack`` method. This takes 3 arguments:
|
173
|
-
-
|
174
|
-
-
|
175
|
-
-
|
176
|
-
- ``:hexagon_class``:
|
174
|
+
- The *boundries* or *points* that mark your hexagon field.
|
175
|
+
- The distance from the center to the left / right boundries (half of the desired width of your hexagons).
|
176
|
+
- A *Hash* of additional parameters:
|
177
|
+
- ``:hexagon_class``: The class used to instanciate new Hexagons. Defaults to ``Hexagonly::Hexagon``. If you are
|
177
178
|
using custom Hexagon classes, you should include your class here.
|
178
|
-
- ``:point_class``:
|
179
|
-
- ``:grab_points``:
|
179
|
+
- ``:point_class``: The class used to instanciate Hexagon **center** points. Defaults to ``Hexagonly::Point``.
|
180
|
+
- ``:grab_points``: A boolean, determining whether the first argument (points / boundries) will also be used to collect
|
180
181
|
contained points for every generated hexagon (see next category).
|
181
|
-
- ``:reject_empty``:
|
182
|
+
- ``:reject_empty``: A boolean, determining whether generated hexagons with no collected points should be removed from
|
182
183
|
the result. Only works if ``:grab_points`` is enabled (see next category).
|
183
184
|
|
184
185
|
```ruby
|
@@ -210,6 +211,12 @@ puts hexagons[0].collected_points # => all objects from the points variable cont
|
|
210
211
|
puts hexagons[0].collected_points[0].class # => Hexagonly::Point or your custom point class
|
211
212
|
```
|
212
213
|
|
214
|
+
### Examples with geographical coordinates
|
215
|
+
|
216
|
+
1. [This one](https://github.com/lipanski/hexagonly/blob/master/examples/1.geojson) applies hexagonal tiling & grabbing over a collection of 100 points. The ``:reject_empty`` option is disabled.
|
217
|
+
|
218
|
+
2. [This example](https://github.com/lipanski/hexagonly/blob/master/examples/2.geojson) uses the same collection, but the ``:reject_empty`` option has been enabled.
|
219
|
+
|
213
220
|
### More examples
|
214
221
|
|
215
222
|
While tiling and grabbing objects, you can also mix classes in your ``points`` collection, as long as they are
|
@@ -248,9 +255,14 @@ ingredients = [
|
|
248
255
|
...
|
249
256
|
]
|
250
257
|
|
251
|
-
# And we want to create hexagonal pizzas out of them,
|
258
|
+
# And we want to create hexagonal pizzas out of them,
|
259
|
+
# by just laying the dough on top and removing the extra dough
|
252
260
|
pizza_size = 1.0
|
253
|
-
pizzas = Hexagonly::Hexagon.pack(ingredients, pizza_size, {
|
261
|
+
pizzas = Hexagonly::Hexagon.pack(ingredients, pizza_size, {
|
262
|
+
:hexagon_class => Pizza,
|
263
|
+
:grab_points => true,
|
264
|
+
:reject_empty => true }
|
265
|
+
)
|
254
266
|
|
255
267
|
puts pizzas[0].class # => Pizza
|
256
268
|
puts pizzas[0].collected_points[0].class # => Salami or Cheese
|
data/examples/1.geojson
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[22.916666409999998,46.48333359],[22.84166641,46.61323740056767],[22.69166641,46.61323740056767],[22.61666641,46.48333359],[22.69166641,46.35342977943233],[22.84166641,46.35342977943233],[22.84166641,46.35342977943233]]]},"style":{"fill":"194b81","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.14166641,46.61323740056767],[23.06666641,46.74314121113534],[22.91666641,46.74314121113534],[22.841666410000002,46.61323740056767],[22.91666641,46.48333359],[23.06666641,46.48333359],[23.06666641,46.48333359]]]},"style":{"fill":"877fdc","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,46.48333359],[23.29166641,46.61323740056767],[23.141666410000003,46.61323740056767],[23.066666410000003,46.48333359],[23.141666410000003,46.35342977943233],[23.29166641,46.35342977943233],[23.29166641,46.35342977943233]]]},"style":{"fill":"015a78","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,46.61323740056767],[23.516666410000003,46.74314121113534],[23.366666410000004,46.74314121113534],[23.291666410000005,46.61323740056767],[23.366666410000004,46.48333359],[23.516666410000003,46.48333359],[23.516666410000003,46.48333359]]]},"style":{"fill":"f7bed8","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,46.48333359],[23.741666410000004,46.61323740056767],[23.591666410000006,46.61323740056767],[23.516666410000006,46.48333359],[23.591666410000006,46.35342977943233],[23.741666410000004,46.35342977943233],[23.741666410000004,46.35342977943233]]]},"style":{"fill":"0d8c39","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.041666410000005,46.61323740056767],[23.966666410000006,46.74314121113534],[23.816666410000007,46.74314121113534],[23.741666410000008,46.61323740056767],[23.816666410000007,46.48333359],[23.966666410000006,46.48333359],[23.966666410000006,46.48333359]]]},"style":{"fill":"0974b3","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.266666410000006,46.48333359],[24.191666410000007,46.61323740056767],[24.04166641000001,46.61323740056767],[23.96666641000001,46.48333359],[24.04166641000001,46.35342977943233],[24.191666410000007,46.35342977943233],[24.191666410000007,46.35342977943233]]]},"style":{"fill":"7b4b48","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.491666410000008,46.61323740056767],[24.41666641000001,46.74314121113534],[24.26666641000001,46.74314121113534],[24.19166641000001,46.61323740056767],[24.26666641000001,46.48333359],[24.41666641000001,46.48333359],[24.41666641000001,46.48333359]]]},"style":{"fill":"6d0e0a","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[22.916666409999998,46.22352596886467],[22.84166641,46.35342977943234],[22.69166641,46.35342977943234],[22.61666641,46.22352596886467],[22.69166641,46.093622158297],[22.84166641,46.093622158297],[22.84166641,46.093622158297]]]},"style":{"fill":"3d9ab2","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.14166641,46.35342977943234],[23.06666641,46.48333359000001],[22.91666641,46.48333359000001],[22.841666410000002,46.35342977943234],[22.91666641,46.22352596886467],[23.06666641,46.22352596886467],[23.06666641,46.22352596886467]]]},"style":{"fill":"d78f2e","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,46.22352596886467],[23.29166641,46.35342977943234],[23.141666410000003,46.35342977943234],[23.066666410000003,46.22352596886467],[23.141666410000003,46.093622158297],[23.29166641,46.093622158297],[23.29166641,46.093622158297]]]},"style":{"fill":"b15244","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,46.35342977943234],[23.516666410000003,46.48333359000001],[23.366666410000004,46.48333359000001],[23.291666410000005,46.35342977943234],[23.366666410000004,46.22352596886467],[23.516666410000003,46.22352596886467],[23.516666410000003,46.22352596886467]]]},"style":{"fill":"288a5a","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,46.22352596886467],[23.741666410000004,46.35342977943234],[23.591666410000006,46.35342977943234],[23.516666410000006,46.22352596886467],[23.591666410000006,46.093622158297],[23.741666410000004,46.093622158297],[23.741666410000004,46.093622158297]]]},"style":{"fill":"066a89","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.041666410000005,46.35342977943234],[23.966666410000006,46.48333359000001],[23.816666410000007,46.48333359000001],[23.741666410000008,46.35342977943234],[23.816666410000007,46.22352596886467],[23.966666410000006,46.22352596886467],[23.966666410000006,46.22352596886467]]]},"style":{"fill":"e22c2f","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.266666410000006,46.22352596886467],[24.191666410000007,46.35342977943234],[24.04166641000001,46.35342977943234],[23.96666641000001,46.22352596886467],[24.04166641000001,46.093622158297],[24.191666410000007,46.093622158297],[24.191666410000007,46.093622158297]]]},"style":{"fill":"6c84bb","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.491666410000008,46.35342977943234],[24.41666641000001,46.48333359000001],[24.26666641000001,46.48333359000001],[24.19166641000001,46.35342977943234],[24.26666641000001,46.22352596886467],[24.41666641000001,46.22352596886467],[24.41666641000001,46.22352596886467]]]},"style":{"fill":"3f4d33","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[22.916666409999998,45.96371834772934],[22.84166641,46.09362215829701],[22.69166641,46.09362215829701],[22.61666641,45.96371834772934],[22.69166641,45.83381453716167],[22.84166641,45.83381453716167],[22.84166641,45.83381453716167]]]},"style":{"fill":"c28e72","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.14166641,46.09362215829701],[23.06666641,46.22352596886468],[22.91666641,46.22352596886468],[22.841666410000002,46.09362215829701],[22.91666641,45.96371834772934],[23.06666641,45.96371834772934],[23.06666641,45.96371834772934]]]},"style":{"fill":"da391b","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,45.96371834772934],[23.29166641,46.09362215829701],[23.141666410000003,46.09362215829701],[23.066666410000003,45.96371834772934],[23.141666410000003,45.83381453716167],[23.29166641,45.83381453716167],[23.29166641,45.83381453716167]]]},"style":{"fill":"639ecc","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,46.09362215829701],[23.516666410000003,46.22352596886468],[23.366666410000004,46.22352596886468],[23.291666410000005,46.09362215829701],[23.366666410000004,45.96371834772934],[23.516666410000003,45.96371834772934],[23.516666410000003,45.96371834772934]]]},"style":{"fill":"4f0bb0","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,45.96371834772934],[23.741666410000004,46.09362215829701],[23.591666410000006,46.09362215829701],[23.516666410000006,45.96371834772934],[23.591666410000006,45.83381453716167],[23.741666410000004,45.83381453716167],[23.741666410000004,45.83381453716167]]]},"style":{"fill":"27d1e7","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.041666410000005,46.09362215829701],[23.966666410000006,46.22352596886468],[23.816666410000007,46.22352596886468],[23.741666410000008,46.09362215829701],[23.816666410000007,45.96371834772934],[23.966666410000006,45.96371834772934],[23.966666410000006,45.96371834772934]]]},"style":{"fill":"07279c","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.266666410000006,45.96371834772934],[24.191666410000007,46.09362215829701],[24.04166641000001,46.09362215829701],[23.96666641000001,45.96371834772934],[24.04166641000001,45.83381453716167],[24.191666410000007,45.83381453716167],[24.191666410000007,45.83381453716167]]]},"style":{"fill":"0a33f2","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.491666410000008,46.09362215829701],[24.41666641000001,46.22352596886468],[24.26666641000001,46.22352596886468],[24.19166641000001,46.09362215829701],[24.26666641000001,45.96371834772934],[24.41666641000001,45.96371834772934],[24.41666641000001,45.96371834772934]]]},"style":{"fill":"b7f57d","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[22.916666409999998,45.70391072659401],[22.84166641,45.83381453716168],[22.69166641,45.83381453716168],[22.61666641,45.70391072659401],[22.69166641,45.57400691602634],[22.84166641,45.57400691602634],[22.84166641,45.57400691602634]]]},"style":{"fill":"cc1a48","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.14166641,45.83381453716168],[23.06666641,45.96371834772935],[22.91666641,45.96371834772935],[22.841666410000002,45.83381453716168],[22.91666641,45.70391072659401],[23.06666641,45.70391072659401],[23.06666641,45.70391072659401]]]},"style":{"fill":"0abb4b","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,45.70391072659401],[23.29166641,45.83381453716168],[23.141666410000003,45.83381453716168],[23.066666410000003,45.70391072659401],[23.141666410000003,45.57400691602634],[23.29166641,45.57400691602634],[23.29166641,45.57400691602634]]]},"style":{"fill":"c81a5b","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,45.83381453716168],[23.516666410000003,45.96371834772935],[23.366666410000004,45.96371834772935],[23.291666410000005,45.83381453716168],[23.366666410000004,45.70391072659401],[23.516666410000003,45.70391072659401],[23.516666410000003,45.70391072659401]]]},"style":{"fill":"d7387b","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,45.70391072659401],[23.741666410000004,45.83381453716168],[23.591666410000006,45.83381453716168],[23.516666410000006,45.70391072659401],[23.591666410000006,45.57400691602634],[23.741666410000004,45.57400691602634],[23.741666410000004,45.57400691602634]]]},"style":{"fill":"987c27","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.041666410000005,45.83381453716168],[23.966666410000006,45.96371834772935],[23.816666410000007,45.96371834772935],[23.741666410000008,45.83381453716168],[23.816666410000007,45.70391072659401],[23.966666410000006,45.70391072659401],[23.966666410000006,45.70391072659401]]]},"style":{"fill":"e36098","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.266666410000006,45.70391072659401],[24.191666410000007,45.83381453716168],[24.04166641000001,45.83381453716168],[23.96666641000001,45.70391072659401],[24.04166641000001,45.57400691602634],[24.191666410000007,45.57400691602634],[24.191666410000007,45.57400691602634]]]},"style":{"fill":"8338a9","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.491666410000008,45.83381453716168],[24.41666641000001,45.96371834772935],[24.26666641000001,45.96371834772935],[24.19166641000001,45.83381453716168],[24.26666641000001,45.70391072659401],[24.41666641000001,45.70391072659401],[24.41666641000001,45.70391072659401]]]},"style":{"fill":"0a24e5","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.76666641,46.48333359]},"properties":{"marker-size":"small","marker-color":"194b81","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.8308239,46.45446396]},"properties":{"marker-size":"small","marker-color":"194b81","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.87143517,46.45794296]},"properties":{"marker-size":"small","marker-color":"194b81","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.27972221,46.37944412]},"properties":{"marker-size":"small","marker-color":"015a78","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.20632744,46.36909485]},"properties":{"marker-size":"small","marker-color":"015a78","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.25469398,46.37455368]},"properties":{"marker-size":"small","marker-color":"015a78","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.7068882,46.36198807]},"properties":{"marker-size":"small","marker-color":"0d8c39","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56666756,46.45000076]},"properties":{"marker-size":"small","marker-color":"0d8c39","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.06333351,46.27388763]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.94981575,46.45343018]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.87399673,46.34539032]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.102108,46.37870026]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.04555511,46.36249924]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.04555511,46.36249924]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.03333282,46.25]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.96666718,46.45000076]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.87988472,46.39764404]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.00943375,46.3272438]},"properties":{"marker-size":"small","marker-color":"d78f2e","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.17424774,46.26281357]},"properties":{"marker-size":"small","marker-color":"b15244","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.28664589,46.10693741]},"properties":{"marker-size":"small","marker-color":"b15244","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.27799988,46.27199936]},"properties":{"marker-size":"small","marker-color":"b15244","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.12989426,46.30702591]},"properties":{"marker-size":"small","marker-color":"b15244","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.4090004,46.24200058]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.53673172,46.4010582]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.46809959,46.47639847]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.39831924,46.33602524]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.38333321,46.46666718]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.53004074,46.31506348]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.41666603,46.40000153]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.42751503,46.40002441]},"properties":{"marker-size":"small","marker-color":"288a5a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.68920135,46.31515121]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.68000031,46.20000076]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56972122,46.17428207]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.61666679,46.18333435]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.61666679,46.18333435]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.63197517,46.3479538]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72757339,46.16122055]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72332954,46.27283096]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.74728394,46.29226685]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.64442825,46.13524246]},"properties":{"marker-size":"small","marker-color":"066a89","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.00583267,46.3413887]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.87055588,46.32083511]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.8175106,46.29201508]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.90596199,46.42734909]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.93333244,46.40000153]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"e22c2f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.16977882,46.24666214]},"properties":{"marker-size":"small","marker-color":"6c84bb","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.1098938,46.22266388]},"properties":{"marker-size":"small","marker-color":"6c84bb","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.01666641,46.21666718]},"properties":{"marker-size":"small","marker-color":"6c84bb","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.11639786,46.11066818]},"properties":{"marker-size":"small","marker-color":"da391b","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.27123642,45.9738121]},"properties":{"marker-size":"small","marker-color":"639ecc","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.33677673,45.93271255]},"properties":{"marker-size":"small","marker-color":"639ecc","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.38570023,45.97929001]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.51555634,46.14444351]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.41008759,46.10109711]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.55149841,46.10002136]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"4f0bb0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.73674774,46.07210922]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.65996742,45.88759995]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.61666679,46.04999924]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.66666603,45.93333435]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.66666603,46.01666641]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.66666603,46.01666641]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.63124084,46.07695007]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.60565186,45.88346863]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72019196,45.85932541]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.55487442,45.98847198]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57939529,45.86943054]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56285667,45.92011642]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57086945,45.95895004]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57611847,45.87892914]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57086945,45.95895004]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.77907181,45.97460175]},"properties":{"marker-size":"small","marker-color":"27d1e7","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.91444397,46.17527771]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.83798409,46.19127274]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.0050621,46.05820465]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.91666603,46.09999847]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.92223167,46.09680176]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.83608627,46.17145538]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.91444397,46.17527771]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.78981972,46.07052231]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.88666916,46.0567131]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.95000076,46.20000076]},"properties":{"marker-size":"small","marker-color":"07279c","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.37459946,45.83940125]},"properties":{"marker-size":"small","marker-color":"d7387b","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.48333359,45.93333435]},"properties":{"marker-size":"small","marker-color":"d7387b","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.47479439,45.9053688]},"properties":{"marker-size":"small","marker-color":"d7387b","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.39572144,45.90744019]},"properties":{"marker-size":"small","marker-color":"d7387b","marker-symbol":"circle"}}]}
|
data/examples/2.geojson
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[22.916666409999998,46.48333359],[22.84166641,46.61323740056767],[22.69166641,46.61323740056767],[22.61666641,46.48333359],[22.69166641,46.35342977943233],[22.84166641,46.35342977943233],[22.84166641,46.35342977943233]]]},"style":{"fill":"51b3bd","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,46.48333359],[23.29166641,46.61323740056767],[23.141666410000003,46.61323740056767],[23.066666410000003,46.48333359],[23.141666410000003,46.35342977943233],[23.29166641,46.35342977943233],[23.29166641,46.35342977943233]]]},"style":{"fill":"8033e0","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,46.48333359],[23.741666410000004,46.61323740056767],[23.591666410000006,46.61323740056767],[23.516666410000006,46.48333359],[23.591666410000006,46.35342977943233],[23.741666410000004,46.35342977943233],[23.741666410000004,46.35342977943233]]]},"style":{"fill":"e078f2","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.14166641,46.35342977943234],[23.06666641,46.48333359000001],[22.91666641,46.48333359000001],[22.841666410000002,46.35342977943234],[22.91666641,46.22352596886467],[23.06666641,46.22352596886467],[23.06666641,46.22352596886467]]]},"style":{"fill":"c8d972","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,46.22352596886467],[23.29166641,46.35342977943234],[23.141666410000003,46.35342977943234],[23.066666410000003,46.22352596886467],[23.141666410000003,46.093622158297],[23.29166641,46.093622158297],[23.29166641,46.093622158297]]]},"style":{"fill":"ecbff6","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,46.35342977943234],[23.516666410000003,46.48333359000001],[23.366666410000004,46.48333359000001],[23.291666410000005,46.35342977943234],[23.366666410000004,46.22352596886467],[23.516666410000003,46.22352596886467],[23.516666410000003,46.22352596886467]]]},"style":{"fill":"5bb768","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,46.22352596886467],[23.741666410000004,46.35342977943234],[23.591666410000006,46.35342977943234],[23.516666410000006,46.22352596886467],[23.591666410000006,46.093622158297],[23.741666410000004,46.093622158297],[23.741666410000004,46.093622158297]]]},"style":{"fill":"d4f04a","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.041666410000005,46.35342977943234],[23.966666410000006,46.48333359000001],[23.816666410000007,46.48333359000001],[23.741666410000008,46.35342977943234],[23.816666410000007,46.22352596886467],[23.966666410000006,46.22352596886467],[23.966666410000006,46.22352596886467]]]},"style":{"fill":"45a6e5","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.266666410000006,46.22352596886467],[24.191666410000007,46.35342977943234],[24.04166641000001,46.35342977943234],[23.96666641000001,46.22352596886467],[24.04166641000001,46.093622158297],[24.191666410000007,46.093622158297],[24.191666410000007,46.093622158297]]]},"style":{"fill":"f110e1","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.14166641,46.09362215829701],[23.06666641,46.22352596886468],[22.91666641,46.22352596886468],[22.841666410000002,46.09362215829701],[22.91666641,45.96371834772934],[23.06666641,45.96371834772934],[23.06666641,45.96371834772934]]]},"style":{"fill":"c2f87f","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.36666641,45.96371834772934],[23.29166641,46.09362215829701],[23.141666410000003,46.09362215829701],[23.066666410000003,45.96371834772934],[23.141666410000003,45.83381453716167],[23.29166641,45.83381453716167],[23.29166641,45.83381453716167]]]},"style":{"fill":"7f3a5f","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,46.09362215829701],[23.516666410000003,46.22352596886468],[23.366666410000004,46.22352596886468],[23.291666410000005,46.09362215829701],[23.366666410000004,45.96371834772934],[23.516666410000003,45.96371834772934],[23.516666410000003,45.96371834772934]]]},"style":{"fill":"5fcfb9","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.816666410000003,45.96371834772934],[23.741666410000004,46.09362215829701],[23.591666410000006,46.09362215829701],[23.516666410000006,45.96371834772934],[23.591666410000006,45.83381453716167],[23.741666410000004,45.83381453716167],[23.741666410000004,45.83381453716167]]]},"style":{"fill":"337054","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[24.041666410000005,46.09362215829701],[23.966666410000006,46.22352596886468],[23.816666410000007,46.22352596886468],[23.741666410000008,46.09362215829701],[23.816666410000007,45.96371834772934],[23.966666410000006,45.96371834772934],[23.966666410000006,45.96371834772934]]]},"style":{"fill":"067f3a","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[23.591666410000002,45.83381453716168],[23.516666410000003,45.96371834772935],[23.366666410000004,45.96371834772935],[23.291666410000005,45.83381453716168],[23.366666410000004,45.70391072659401],[23.516666410000003,45.70391072659401],[23.516666410000003,45.70391072659401]]]},"style":{"fill":"d9b1d0","stroke-width":2,"fill-opacity":0.5},"properties":null},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.76666641,46.48333359]},"properties":{"marker-size":"small","marker-color":"51b3bd","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.8308239,46.45446396]},"properties":{"marker-size":"small","marker-color":"51b3bd","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.87143517,46.45794296]},"properties":{"marker-size":"small","marker-color":"51b3bd","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.27972221,46.37944412]},"properties":{"marker-size":"small","marker-color":"8033e0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.20632744,46.36909485]},"properties":{"marker-size":"small","marker-color":"8033e0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.25469398,46.37455368]},"properties":{"marker-size":"small","marker-color":"8033e0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.7068882,46.36198807]},"properties":{"marker-size":"small","marker-color":"e078f2","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56666756,46.45000076]},"properties":{"marker-size":"small","marker-color":"e078f2","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.06333351,46.27388763]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.94981575,46.45343018]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.87399673,46.34539032]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.102108,46.37870026]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.04555511,46.36249924]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.04555511,46.36249924]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.03333282,46.25]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.96666718,46.45000076]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[22.87988472,46.39764404]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.00943375,46.3272438]},"properties":{"marker-size":"small","marker-color":"c8d972","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.17424774,46.26281357]},"properties":{"marker-size":"small","marker-color":"ecbff6","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.28664589,46.10693741]},"properties":{"marker-size":"small","marker-color":"ecbff6","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.27799988,46.27199936]},"properties":{"marker-size":"small","marker-color":"ecbff6","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.12989426,46.30702591]},"properties":{"marker-size":"small","marker-color":"ecbff6","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.4090004,46.24200058]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.53673172,46.4010582]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.46809959,46.47639847]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.39831924,46.33602524]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.38333321,46.46666718]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.53004074,46.31506348]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.41666603,46.40000153]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.42751503,46.40002441]},"properties":{"marker-size":"small","marker-color":"5bb768","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.68920135,46.31515121]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.68000031,46.20000076]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56972122,46.17428207]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.61666679,46.18333435]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.61666679,46.18333435]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.63197517,46.3479538]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72916603,46.31222153]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72757339,46.16122055]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72332954,46.27283096]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.74728394,46.29226685]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.64442825,46.13524246]},"properties":{"marker-size":"small","marker-color":"d4f04a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.00583267,46.3413887]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.87055588,46.32083511]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.8175106,46.29201508]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.90596199,46.42734909]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.93333244,46.40000153]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.86000061,46.38999939]},"properties":{"marker-size":"small","marker-color":"45a6e5","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.16977882,46.24666214]},"properties":{"marker-size":"small","marker-color":"f110e1","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.1098938,46.22266388]},"properties":{"marker-size":"small","marker-color":"f110e1","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.01666641,46.21666718]},"properties":{"marker-size":"small","marker-color":"f110e1","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.11639786,46.11066818]},"properties":{"marker-size":"small","marker-color":"c2f87f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.27123642,45.9738121]},"properties":{"marker-size":"small","marker-color":"7f3a5f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.33677673,45.93271255]},"properties":{"marker-size":"small","marker-color":"7f3a5f","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.38570023,45.97929001]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.51555634,46.14444351]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.41008759,46.10109711]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.55149841,46.10002136]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56999969,46.06694412]},"properties":{"marker-size":"small","marker-color":"5fcfb9","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.73674774,46.07210922]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.65996742,45.88759995]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.61666679,46.04999924]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.66666603,45.93333435]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.66666603,46.01666641]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.66666603,46.01666641]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.63124084,46.07695007]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.60565186,45.88346863]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.72019196,45.85932541]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.55487442,45.98847198]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57939529,45.86943054]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.56285667,45.92011642]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57086945,45.95895004]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57611847,45.87892914]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.57086945,45.95895004]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.77907181,45.97460175]},"properties":{"marker-size":"small","marker-color":"337054","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.91444397,46.17527771]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.83798409,46.19127274]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.0050621,46.05820465]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.91666603,46.09999847]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.92223167,46.09680176]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.83608627,46.17145538]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.91444397,46.17527771]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.78981972,46.07052231]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.88666916,46.0567131]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.95000076,46.20000076]},"properties":{"marker-size":"small","marker-color":"067f3a","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.37459946,45.83940125]},"properties":{"marker-size":"small","marker-color":"d9b1d0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.48333359,45.93333435]},"properties":{"marker-size":"small","marker-color":"d9b1d0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.47479439,45.9053688]},"properties":{"marker-size":"small","marker-color":"d9b1d0","marker-symbol":"circle"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[23.39572144,45.90744019]},"properties":{"marker-size":"small","marker-color":"d9b1d0","marker-symbol":"circle"}}]}
|
data/lib/hexagonly/hexagon.rb
CHANGED
@@ -180,19 +180,6 @@ module Hexagonly
|
|
180
180
|
corners
|
181
181
|
end
|
182
182
|
|
183
|
-
def to_geojson
|
184
|
-
corner_points = hex_corners.map{ |p| [p.x_coord, p.y_coord] }
|
185
|
-
corner_points << corner_points.last
|
186
|
-
{
|
187
|
-
:type => "Feature",
|
188
|
-
:geometry => {
|
189
|
-
:type => "Polygon",
|
190
|
-
:coordinates => [corner_points]
|
191
|
-
},
|
192
|
-
:properties => nil
|
193
|
-
}
|
194
|
-
end
|
195
|
-
|
196
183
|
private
|
197
184
|
|
198
185
|
def hex_point_class
|
data/lib/hexagonly/point.rb
CHANGED
@@ -87,6 +87,8 @@ module Hexagonly
|
|
87
87
|
# [x_coord, y_coord]
|
88
88
|
# end
|
89
89
|
|
90
|
+
attr_accessor :geo_properties
|
91
|
+
attr_accessor :geo_style
|
90
92
|
def to_geojson
|
91
93
|
{
|
92
94
|
:type => "Feature",
|
@@ -94,7 +96,8 @@ module Hexagonly
|
|
94
96
|
:type => "Point",
|
95
97
|
:coordinates => [x_coord, y_coord]
|
96
98
|
},
|
97
|
-
:
|
99
|
+
:style => geo_style,
|
100
|
+
:properties => geo_properties
|
98
101
|
}
|
99
102
|
end
|
100
103
|
|
data/lib/hexagonly/polygon.rb
CHANGED
@@ -79,6 +79,22 @@ module Hexagonly
|
|
79
79
|
parts[0]
|
80
80
|
end
|
81
81
|
|
82
|
+
attr_accessor :geo_properties
|
83
|
+
attr_accessor :geo_style
|
84
|
+
def to_geojson
|
85
|
+
points = poly_points.map{ |p| [p.x_coord, p.y_coord] }
|
86
|
+
points << points.last
|
87
|
+
{
|
88
|
+
:type => "Feature",
|
89
|
+
:geometry => {
|
90
|
+
:type => "Polygon",
|
91
|
+
:coordinates => [points]
|
92
|
+
},
|
93
|
+
:style => geo_style,
|
94
|
+
:properties => geo_properties
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
82
98
|
end
|
83
99
|
|
84
100
|
include Methods
|
data/lib/hexagonly/version.rb
CHANGED
data/localities.rb
CHANGED
@@ -6,12 +6,27 @@ require 'csv'
|
|
6
6
|
localities_csv = CSV.read(File.expand_path('../spec/fixtures/localities.csv', __FILE__))
|
7
7
|
|
8
8
|
points = []
|
9
|
-
localities_csv.first(
|
9
|
+
localities_csv.first(100).each do |row|
|
10
10
|
points << Hexagonly::Point.new(row[2].to_f, row[1].to_f)
|
11
11
|
end
|
12
12
|
|
13
|
-
hexagons = Hexagonly::Hexagon.pack(points, 0.
|
13
|
+
hexagons = Hexagonly::Hexagon.pack(points, 0.15, { grab_points: true, reject_empty: true })
|
14
14
|
|
15
|
+
# Style features
|
16
|
+
collected_points = []
|
17
|
+
hexagons.each do |hex|
|
18
|
+
color = "%06x" % (rand * 0xffffff)
|
19
|
+
hex.geo_style = { 'fill' => color, 'stroke-width' => 2, 'fill-opacity' => 0.5 }
|
20
|
+
collected_points += hex.collected_points.map do |point|
|
21
|
+
point.tap do |p|
|
22
|
+
p.geo_properties = { 'marker-size' => 'small', 'marker-color' => color, 'marker-symbol' => 'circle' }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Generate GeoJson
|
15
28
|
geo = Hexagonly::GeoJson.new(hexagons)
|
16
|
-
|
29
|
+
geo.add_features(collected_points)
|
30
|
+
|
31
|
+
# Output
|
17
32
|
puts geo.to_json
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexagonly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florin Lipan
|
@@ -109,6 +109,8 @@ files:
|
|
109
109
|
- LICENSE.txt
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
|
+
- examples/1.geojson
|
113
|
+
- examples/2.geojson
|
112
114
|
- hexagonly.gemspec
|
113
115
|
- lib/hexagonly.rb
|
114
116
|
- lib/hexagonly/geo_json.rb
|