cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
uday_guntupalli
Level VIII

Is it possible to generate a bounding box around a set of coordinates in JMP ?

All,
    If I have a set of coordinates, is there a geo-spatial function that can generate the coordinates of  a bounding box within specified radius. 

    For e.g. 

         Latitude = 47.80 
         Longitude = -122.00 

    

    I would like to generate a bounding box around these coordinates within a 10 mile radius. Does JMP have any inbuilt functions for this ? 

    

    I was able to acheive this using "R" , except I would prefer to do this in JMP if at all possible. Also, the function documentation for the function accepts a fraction and not necessarily distance - not clear on what the fraction symbolizes. To eliminate the ambiguity , I prefer to do it in JMP if possible.

 

Lat <- 47.80
Lon <- -122.00
Rad <- 0.05 
BBox <- ggmap::make_bbox(lon = Lon,lat = Lat,f = Rad)
Best
Uday
1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Is it possible to generate a bounding box around a set of coordinates in JMP ?

Not sure what you intend to use the bounding box for, but I have used something like below to control the "zooming" of Graph Builder maps by JSL (quick adaptation from the metric system).

 

Names default to here(1);
// Desired map central position and distance to view boundary
Lat = 40.782222; //Latitude
Lon = -73.965278; //Longitude
Rad = 7; // miles

// Calculate bounding box coordinates with geodetic approximation (WGS84)
a = 6378137; // Radius of earth at equator (m)
e2 = 0.00669437999014; // eccentricity squared
m = 1609.344; // 1 mile in meters
r = Pi() / 180; // convert to radians
//Distance of 1° latitude (miles)
d1 = r * a * (1 - e2) / (1 - e2 * Sin(Lat * r) ^ 2) ^ (3 / 2) / m;
//Distance of 1° longitude (miles)
d2 = r * a * Cos(Lat * r) / Sqrt(1 - e2 * Sin(Lat * r) ^ 2) / m;

//Bounding box coordinates
{minLat, maxLat} = {Lat - Rad / d1, Lat + Rad / d1};
{minLon, maxLon} = {Lon - Rad / d2, Lon + Rad / d2};
//––––––––––––––––––––––––––––––––––––––––––––––––––

//Example map 
dt = Open("$SAMPLE_DATA/SAT.jmp");
gb = dt << Graph Builder(Variables(X(:Longitude), Y(:Latitude)), Elements(Points(X, Y)));
Report(gb)[FrameBox(1)] << Background Map(Images("Street Map Service")); Wait(1);

//Set bounding box (Manhattan, ~13 miles long)
Report(gb)[ScaleBox(2)] << {Min(minLat), Max(maxLat)};
Report(gb)[ScaleBox(1)] << {Min(minLon), Max(maxLon)};

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Is it possible to generate a bounding box around a set of coordinates in JMP ?

Not sure what you intend to use the bounding box for, but I have used something like below to control the "zooming" of Graph Builder maps by JSL (quick adaptation from the metric system).

 

Names default to here(1);
// Desired map central position and distance to view boundary
Lat = 40.782222; //Latitude
Lon = -73.965278; //Longitude
Rad = 7; // miles

// Calculate bounding box coordinates with geodetic approximation (WGS84)
a = 6378137; // Radius of earth at equator (m)
e2 = 0.00669437999014; // eccentricity squared
m = 1609.344; // 1 mile in meters
r = Pi() / 180; // convert to radians
//Distance of 1° latitude (miles)
d1 = r * a * (1 - e2) / (1 - e2 * Sin(Lat * r) ^ 2) ^ (3 / 2) / m;
//Distance of 1° longitude (miles)
d2 = r * a * Cos(Lat * r) / Sqrt(1 - e2 * Sin(Lat * r) ^ 2) / m;

//Bounding box coordinates
{minLat, maxLat} = {Lat - Rad / d1, Lat + Rad / d1};
{minLon, maxLon} = {Lon - Rad / d2, Lon + Rad / d2};
//––––––––––––––––––––––––––––––––––––––––––––––––––

//Example map 
dt = Open("$SAMPLE_DATA/SAT.jmp");
gb = dt << Graph Builder(Variables(X(:Longitude), Y(:Latitude)), Elements(Points(X, Y)));
Report(gb)[FrameBox(1)] << Background Map(Images("Street Map Service")); Wait(1);

//Set bounding box (Manhattan, ~13 miles long)
Report(gb)[ScaleBox(2)] << {Min(minLat), Max(maxLat)};
Report(gb)[ScaleBox(1)] << {Min(minLon), Max(maxLon)};
Craige_Hales
Super User

Re: Is it possible to generate a bounding box around a set of coordinates in JMP ?

This post will point you to this site that describes the haversine formula for calculating distances between points on the globe and other useful formulas. I used the formulas in the section Destination point given distance and bearing from start point to create a circle of points around the center location. In my post, I used a distance that went 90 degrees away in every direction. 10 miles will be a fraction of a degree. (At least that's the way I think I did it. With a little luck there are some comments in the JSL.)

Projected circle of sunlightProjected circle of sunlight

Craige