Created
July 15, 2021 14:25
-
-
Save markstos/42291c17de9f2a1b7bc369461cd665b1 to your computer and use it in GitHub Desktop.
Fix links on Bloomington Indiana's data portal to generate spec-compliant GeSON
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
// ==UserScript== | |
// @name Fix production Bloomington Data Portal | |
// @namespace https://data.bloomington.in.gov | |
// @description Add GeoJSON spec-compliant projection to URL links | |
// @include https://data.bloomington.in.gov/* | |
// | |
// ==/UserScript== | |
var regex_list = [ | |
/^https:\/\/bloomington\.in\.gov\/geoserver/ | |
]; | |
var i, j; | |
for (i = 0; i < document.links.length; i++) { | |
var link = document.links[i]; | |
for (j = 0; j < regex_list.length; j++) { | |
var match = link.href.match(regex_list[j]); | |
if (match != null) { | |
link.href = link.href += '&srsName=EPSG:4326' | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment