DWITHIN ECQL query of wfs is not working properly

المشرف العام

Administrator
طاقم الإدارة
I dont know where i am making mistake. And my url is returning the all values of feature layer

queryRequest: function (layer) { if(layer!= null || layer!= undefined){ var center = this.draw.getGeometry().getCenter(); var radius = this.formatRadius(); var latLong = this.getLatLong(center); var latLongExtent = this.getLatLongExtent(latLong); var wfsUrl = layer.getWFSGetRequestUrl(); console.log("Feature Url :"+wfsUrl); wfsUrl = wfsUrl+"&CQL_FILTER=DWITHIN(geometry,POINT("+latLongExtent+"),"+radius+")";//wfsUrl ="http://geoserver.saartha.net:7070/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typename=saartha:s03travel&outputFormat=json&srsname=EPSG:3857&CQL_FILTER=DWITHIN(geometry,POINT(76.78399222656249%2013.47409553818946),27.71,kilometers)"//It should return only one value ..."travel_num":4727. console.log("Feature Url :"+wfsUrl);

var request = new ProxyRequest().get(wfsUrl,{ version:'1.0.0', }); request.then(lang.hitch(this,"readFeatures")) console.log("Request Url :"+request); } },getLatLong :function(extentCircle){ var latLong=[]; var coord=[];

coord=[extentCircle[0],extentCircle[1]]; var convertedVal = ol.proj.transform(coord,'EPSG:3857','EPSG:4326' ); latLong.push(convertedVal[0],convertedVal[1]); return latLong; }, getLatLongExtent: function (latLong) { var latLongExtent=latLong[0]+" "+latLong[1]; console.log("LAT-LONG :"+latLongExtent); return latLongExtent; }, formatRadius: function () { var radius; if ( this.draw != undefined && this.draw != null) { var center = this.draw.getGeometry().getCenter(); var endPoint = [center[0], center[1] + this.draw.getGeometry().getRadius()]; var sourceProj = this.mapObj.getView().getProjection(); var c1 = ol.proj.transform(center, sourceProj, 'EPSG:4326'); var c2 = ol.proj.transform(endPoint, sourceProj,'EPSG:4326'); radius = this.wgs84Sphere.haversineDistance(c1, c2); } else { radius = Math.round(this.draw.getGeometry().getRadius() * 100) / 100; } var output; if (radius > 100) { output = (Math.round(radius / 1000 * 100) / 100) + ' , ' + 'kilometers'; } else { output = (Math.round(radius * 100) / 100) + ' , ' + 'meters'; } return output; }, readFeatures: function (response) { var feature = this.geoJsonformat.readFeatures(response); console.log("feature :"+feature); },

أكثر...
 
أعلى