BBox calculation

Hello,

I am trying to receive some OSM data regarding surveillance cameras. I try it like this: http://www.overpass-api.de/api/xapi?node[bbox=48.894966,2.119140,48.894966,2.392723][amenity=man_made=surveillance][@meta]

But the file is empty… So I guess my bbox calculation is wrong… It looks like this:

-(void)calucalteBBox:(CLLocation*)location radius:(float)radius
{
   
    CLLocation* leftHand = [self newPointFromStartPoint:location
                                               andBearing:270
                                              andDistance:radius];
    CLLocation* rightHand = [self newPointFromStartPoint:location
                                              andBearing:90
                                             andDistance:radius];
    
    NSLog(@"MIN LAT:%f",leftHand.coordinate.latitude);
    NSLog(@"MIN LONG:%f",leftHand.coordinate.longitude);
    
    NSLog(@"MAX LAT:%f",rightHand.coordinate.latitude);
    NSLog(@"MAX LONG:%f",rightHand.coordinate.longitude);
    
}
-(CLLocation*)newPointFromStartPoint:(CLLocation*)startPoint andBearing:(float)bearing andDistance:(float)d
{
    float lat1 = startPoint.coordinate.latitude;
    float lon1 = startPoint.coordinate.longitude;
    float distance = d;
    float earthR = 6371;
    float dR = distance/earthR;
    
    float lat1Radian = lat1*(M_PI/180);
    float lon1Radian = lon1*(M_PI/180);
    float bearingRadian = bearing*(M_PI/180);
    
    float lat2 = asin( sin(lat1Radian)*cos(dR) +
                      cos(lat1Radian)*sin(dR)*cos(bearingRadian));
    
    float lon2 = lon1Radian + atan2(sin(bearingRadian)*sin(dR)*cos(lat1Radian),
                                    cos(dR)-sin(lat1Radian)*sin(lat2));
    
    lat2 = (lat2*(180/M_PI));
    lon2 = (lon2*(180/M_PI));
    
    return [[CLLocation alloc]initWithLatitude:lat2 longitude:lon2];

}

I start at his point.: lat.: 48.8950482 long.:2.2559316 radius:10.

Thanks for your help

I understand that it is old question but every question should has an answer :slight_smile:

In your link, you have the same value for both latitude
bbox=48.894966,2.119140,48.894966,2.392723

There is very convenient tool to create bbox expression
http://harrywood.co.uk/maps/uixapi/xapi.html