Partial Elixir port of geo_ruby gem