Created
September 25, 2017 18:14
-
-
Save jnewmoyer/103780ab76bfa2f9b5dcecf24509c228 to your computer and use it in GitHub Desktop.
Get imagery metadata from GeoServer WMS
This file contains 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
$.ajax('http://backup.novasp.local:7880/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&QUERY_LAYERS=collect&LAYERS=osm_hybrid_imagery%2Caoi%2Ccollect&INFO_FORMAT=application/json&FEATURE_COUNT=50&X=189&Y=201&WIDTH=256&HEIGHT=256&SRS=EPSG%3A4326&BBOX=125.145263671875%2C43.954925537109375%2C125.14595031738281%2C43.95561218261719', { | |
dataType: 'json', | |
error : function(jqXHR, statusText, errorThrown) { | |
console.log('error: ' + statusText); | |
}, | |
success : function(data, statusText, jqXHR) { | |
if(data) { | |
var myObj = data; | |
console.log(myObj); | |
console.log('meta: ' + myObj.features[0].properties.meta); | |
console.log('acquired: ' + myObj.features[0].properties.acquired); | |
var meta = JSON.parse(myObj.features[0].properties.meta); | |
console.log('source: ' + meta.source); | |
console.log('cloudCover: ' + meta.cloudCover); | |
} | |
else | |
console.log('data is undefined'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment