Skip to content

Instantly share code, notes, and snippets.

@sordina
Last active June 21, 2017 00:12
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 sordina/fff0801af163d7002f36493c4e8658f5 to your computer and use it in GitHub Desktop.
Save sordina/fff0801af163d7002f36493c4e8658f5 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[
145.131889,
-38.390694
],
[
144.470912,
-38.083542
],
[
143.403133,
-38.780987
],
[
140.969273,
-33.997216
],
[
141.560468,
-34.1909
],
[
142.23229,
-34.255036
],
[
142.511671,
-34.740888
],
[
142.948867,
-34.669674
],
[
143.328679,
-35.0459
],
[
143.962441,
-35.51398
],
[
144.5019,
-35.958039
],
[
144.957378,
-35.961005
],
[
145.7263,
-35.942312
],
[
146.291125,
-36.020163
],
[
146.872952,
-36.073681
],
[
147.718672,
-35.945513
],
[
148.150489,
-36.558336
],
[
147.067248,
-38.475119
],
[
146.199527,
-38.716096
],
[
146.283915,
-39.024887
],
[
145.192934,
-38.296557
]
]
]
]
}
}
]
}
@sordina
Copy link
Author

sordina commented Jun 21, 2017

import Data.List.Split

geo = [ [ [ [ 145.131889, -38.390694 ] ]]] -- ...

sample n l = map head $ chunksOf b l
  where
  b = max 1 (c `div` n)
  c = length l

main = print $ map (map (sample 20)) geo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment