var mongoose = require('mongoose'),
    _ = require('cloneextend'),
    adHocModels = {};


var adHocModel = function(collectionName, Schema, options) {
    if (!adHocModels[collectionName]) {
        var options = options || {};
        if (options.strict == undefined) {
            options.strict =  false;
        }
        var Schema = Schema || new mongoose.Schema({}, options);
        adHocModels[collectionName] = mongoose.model(
            'adhoc_' + new mongoose.Types.ObjectId().toString(), Schema, collectionName);
    }
    return adHocModels[collectionName];
};

/*
Modifies the JSON object to be sent to the client as GeoJSON 
*/
var toGeoJSON = function(obj) 
{
    delete obj.bounds2d;
    return obj;
};


module.exports = {
	adHocModel: adHocModel,
	toGeoJSON: toGeoJSON
};
@@ -698,16 +698,266 @@
 unds2d;%0A
+    if (obj.bbox && !obj.bbox.length && obj.geometry.type == 'Point') %7B%0A        obj.bbox = %5B%0A            obj.geometry.coordinates%5B0%5D, obj.geometry.coordinates%5B1%5D, %0A            obj.geometry.coordinates%5B0%5D, obj.geometry.coordinates%5B1%5D%0A        %5D;%0A    %7D%0A
     retu

Send bbox for Point features