Skip to content

Instantly share code, notes, and snippets.

@zouzias
Created August 15, 2017 14:43
Show Gist options
  • Save zouzias/9d4377849c9e70ce4af7fa8814df5464 to your computer and use it in GitHub Desktop.
Save zouzias/9d4377849c9e70ce4af7fa8814df5464 to your computer and use it in GitHub Desktop.
Convert from GeoJSON geometry.coordinates property to WKT (Polygons)
val geometryToWKT = udf((a: Seq[Seq[Seq[Double]]]) => "POLYGON ((" + a.head.map(x => x.head + " " + x.last).mkString(", ") + "))")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment