Skip to content

Instantly share code, notes, and snippets.

@chiragtoor
Last active December 16, 2016 04:44
Show Gist options
  • Save chiragtoor/7e49fd73d958203e2c95e26b3ca2fa48 to your computer and use it in GitHub Desktop.
Save chiragtoor/7e49fd73d958203e2c95e26b3ca2fa48 to your computer and use it in GitHub Desktop.
commercial_zones = get_commercial_zones()
|> Enum.map(fn(%{"geometry" => %{"coordinates" => [coordinates]}}) ->
coordinates
end)
commercial_blocks = get_blocks()
|> Enum.map(fn(geoJson = %{"geometry" => %{"coordinates" => [coordinates]}}) ->
# we need the coordinates to check for intersections and the
# original geoJson because if this block is in a commercial
# zone we will want to output it to a new file
{geoJson, coordinates}
end)
|> Enum.map(fn({geoJson, block}) ->
# figure out if the block intersects with any of the zones, if so
# it is valid, if not we can skip it
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment