Query Records by Buffer - All features returned

Discussion created by mbalwanz on Dec 11, 2012
Latest reply on Mar 5, 2013 by leiyongjun
I am working on configuring the Javascript Park Finder app from the local government resource center.  I have set the app up to use our local data and changed the spatial reference throughout the app to match what our data uses and what my geometry service uses. 

When I run a query on my parks layer using a 1 mile buffer, all the parks are returned by the querytask.  I have tried mutliple spatial relationships in the query and the result is always the same.  Here is the code.

//function for Displaying the buffer
function ShowBuffer(geometries) {
    var lineColor = new dojo.Color();
    var fillColor = new dojo.Color();
    fillColor.a = 0.55;
    var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
        new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
        lineColor, 2),
    dojo.forEach(geometries, function (geometry) {
        AddGraphic(map.getLayer(tempBufferLayer), symbol, geometry);

//function for getting the features and their length with in the buffer region
function QueryLayer(geometry) {
    var qTask = 'qTask';
    qTask = new esri.tasks.QueryTask(devPlanLayerURL);
    var query = new esri.tasks.Query();
    query.geometry = geometry;
    query.where = "1=1";
    query.outFields = ["*"];
    query.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CONTAINS;
    query.returnGeometry = true;

    qTask.execute(query, function (featureset) {
        if (dojo.byId('spanParkActivityContainer')) {
            dojo.byId('spanParkActivityContainer').style.display = 'none';
        dojo.byId('spanParkListContainer').innerHTML = 'Found ' + featureset.features.length + ' park(s) near the address';

I did (just for testing purposes) write a more restrictive Where statement and that querytask did come back with the correct amount of records so I am thinking it must have to do with the spatial reference. 

My app does still use an arcgis online routing task, but I do not believe that would have anything to do with this query. 

Anyone ever experience this or have any ideas as to what might be causing this?