src/geostore.js
function(primitive){
          completed++;
          if ( primitive ){
            var geometry = new Terraformer.Primitive(primitive.geometry);
            if (shapeGeometryTest(geometry, shape)){
              if (self._stream) {
                if (completed === found.length) {
                  if (operationName == "within") {
                    self._stream.emit("done", primitive);
                  } else {
                    self._stream.emit("data", primitive);
                  }
                  self._stream.emit("end");
                } else {
                  self._stream.emit("data", primitive);
                }
              } else {
                results.push(primitive);
              }
            }

            if(completed >= found.length){
              if(!errors){
                if (self._stream) {
                  self._stream = null;
                } else if (callback) {
                  callback( null, results );
                }
              } else {
                if (callback) {
                  callback("Could not get all geometries", null);
                }
              }
            }
          }
        }
function(primitive){
          completed++;
          if ( primitive ){
            var geometry = new Terraformer.Primitive(primitive.geometry);
            if (shapeGeometryTest(geometry, shape)){
              if (self._stream) {
                if (completed === found.length) {
                  if (operationName == "within") {
                    self._stream.emit("done", primitive);
                  } else {
                    self._stream.emit("data", primitive);
                  }
                  self._stream.emit("end");
                } else {
                  self._stream.emit("data", primitive);
                }
              } else {
                results.push(primitive);
              }
            }

            if(completed >= found.length){
              if(!errors){
                if (self._stream) {
                  self._stream = null;
                } else if (callback) {
                  callback( null, results );
                }
              } else {
                if (callback) {
                  callback("Could not get all geometries", null);
                }
              }
            }
          }
        }
function ( primitive ) { completed ++ ; if ( primitive ) { var geometry = new Terraformer . Primitive ( primitive . geometry ) ; if ( shapeGeometryTest ( geometry , shape ) ) { if ( self . _stream ) { if ( completed === found . length ) { if ( operationName == "within" ) { self . _stream . emit ( "done" , primitive ) ; } else { self . _stream . emit ( "data" , primitive ) ; } self . _stream . emit ( "end" ) ; } else { self . _stream . emit ( "data" , primitive ) ; } } else { results . push ( primitive ) ; } } if ( completed >= found . length ) { if ( ! errors ) { if ( self . _stream ) { self . _stream = null ; } else if ( callback ) { callback ( null , results ) ; } } else { if ( callback ) { callback ( "Could not get all geometries" , null ) ; } } } } }
the function to evalute results from the index
the function to evalute results from the index