Created
August 16, 2015 15:04
-
-
Save walkermatt/bc3ae3d8101addeaeda2 to your computer and use it in GitHub Desktop.
Create WKT POLYGON from a bounding box in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "POLYGON((left top,right top,right bottom,left bottom,left top))"; | |
var bbox = {left: 10, top: 30, right: 20, bottom: 40}; | |
str.replace(/[a-z]+/g, function(s) {return bbox[s];}); |
victropolis
commented
Mar 7, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment