Page 2 of 2

"can't find any special indices: 2d (needs index), 2dsphere (needs index),

Posted: Sun May 12, 2013 9:54 pm
by geevaa

"can't find any special indices: 2d (needs index), 2dsphere (needs index),

Posted: Sun May 12, 2013 10:06 pm
by geevaa

I posted the required screenshots and waiting for your reply


"can't find any special indices: 2d (needs index), 2dsphere (needs index),

Posted: Sun May 12, 2013 10:49 pm
by Igor

Can you share the app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?


"can't find any special indices: 2d (needs index), 2dsphere (needs index),

Posted: Mon May 13, 2013 7:15 am
by Kateryna Grynko

Hi,

You attempt to make a request using the opportunities of working with Mongo spatial data. You request geographic locations that are located in a certain neighborhood of a given point. Unfortunately, we do not support MongoDB's geospatial features.

We can offer a solution for distances up to 300 miles that is used in aviation. Here is the JS code:codefunction distance(from_lat, from_long, to_lat, to_long) {
return Math.sqrt(
Math.pow( (111.13209-0.56605 * Math.cos( 2 * ( from_lat + to_lat )/2/180Math.PI )
+ 0.00120 * Math.cos( 4 * ( from_lat + to_lat )/2/180Math.PI )
) * ( from_lat - to_lat ), 2 )
+ Math.pow( (111.41513 * Math.cos( ( from_lat + to_lat )/2/180Math.PI )
- 0.09455 * Math.cos( 3 * ( from_lat + to_lat )/2/180Math.PI )
+ 0.00012 * Math.cos( 5 * ( from_lat + to_lat )/2/180*Math.PI )
) * (from_long - to_long), 2 )
)/1.60933966531
}

console.log(distance(40.45029, -80.026184, 40.503764, -79.858034) + " -- " + "9.60");
console.log(distance(40.45029, -80.026184, 41.678638, -83.479484) + " -- " + "199.26");
console.log(distance(40.45029, -80.026184, 41.493026, -81.674572) + " -- " + "112.29");
console.log(distance(40.45029, -80.026184, 39.793372, -83.681536) + " -- " + "198.83(198.82)");
/code
There may be a slight deviation somewhere in hundredths on separate checks.


"can't find any special indices: 2d (needs index), 2dsphere (needs index),

Posted: Mon May 13, 2013 1:09 pm
by geevaa

I have done it.. Can you help me in fixing it ASAP ?


"can't find any special indices: 2d (needs index), 2dsphere (needs index),

Posted: Mon May 13, 2013 1:33 pm
by Kateryna Grynko

Please find our suggestion below.