David Megginson wrote:
>
> Jeff writes:
>
> > //////////////////////////////////////////////////////////////////////////
> > I can not find the string " Loading tile" in my fgfs.log file. Can anybody
> > else see it in here or am I doing something wrong?
> > //////////////////////////////////////////////////////////////////////////
> >
> >
> >
> > //////////////////////////////////////////////////////////
> > Ref. below (from FAQ 6.5)
> > //////////////////////////////////////////////////////////
> >
> > Search the output log file for the first occurrence of the string "Loading
> > tile" and take note of the filename. In the above example, the output line
> > looks like:
> >
> > Loading tile /usr/local/Scenery/w080n40/w076n45/1712601"
>
> There was a major tile-manager rewrite after I came up with those
> original instructions -- I'm not sure what would work now.
>
This little program should do the trick:
#include <iostream>
#include <simgear/bucket/newbucket.hxx>
static void usage()
{
std::cerr << "Usage: bucket Latitude Longitude\n"
<< " where Latitude is in the range [-90,90], and\n"
<< " Longitude is in the range [-180,180]\n";
}
int
main( int argc, char* argv[] )
{
if (argc != 3)
{
usage();
return 1;
}
double lat = atof(argv[1]);
double lon = atof(argv[2]);
if (lat < -90. || lat > 90.)
{
std::cerr << "Invalid latitude: -90.0 < latitude < 90.0\n";
usage();
return 1;
}
if (lon < -180. || lon > 180.)
{
std::cerr << "Invalid longitude: -180.0 < longitude < 180.0\n";
usage();
return 1;
}
SGBucket b( lon, lat );
std::cout << b.gen_base_path() << "/" << b.gen_index_str() << "\n";
return 0;
}
Compile and run it on linux gives:
$ g++ -o bucket bucket.cxx -lsgbucket -lsgmisc
$ ./bucket 37.62 -121.36
w130n30/w122n37/958434
$
Cheers,
Bernie
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel