Alan,
The georeferencing part makes sense, thanks for pointing that out.
When you load from GDAL are you doing something more sophisticated than
this?
poDataset = (GDALDataset*) GDALOpen("path\\RPF\\A.TOC", GA_ReadOnly);
for each subdataset (tile):
nextSubDataset = (GDALDataset*) GDALOpen("path", GA_ReadOnly);
for each tile in nextSubDataset: //is this necessary??!
extract pixel information //It's pretty involved... going
//through RasterBands and
//Blocks, etc.
The reason I is because it seems like you're saying that once you get to
a subdataset then the OSG plugin might be able to extract the tile to an
image for you? This would save a lot of pain.
If it's not possible, do you have any sample code showing how to extract
a tile into an image?
Thanks,
Michael Day
---------------------------------------------
Joe,
I've done this, and I'll give you a basic overview of what I've done,
but there may be better ways to do it, because I was fairly new to OSG
at the time, and some of my ideas may be obsolete these days.
The GDAL OSG plugin will give you image data (pixels), but will not
provide the geo-referencing data, so you'll have to link to GDAL
directly to get the geographic extents of each tile. Shane is right that
the A.TOC file is not supported by OSG, so I had to just load all the
map tiles which existed in a directory, building my own index of tiles
with their extents in them.
I do all the paging myself, going through the index and finding out
what's in range and loading it if need-be. This could probably be done a
lot more elegantly using the PagedLOD class, but I found that in
practice, what I do is fairly fast.
Check the GDAL documentation, and look for GetGeoTransform(). This
returns a bunch of numbers in an array, but one of the GDAL examples
will tell you what each number represents (lat/long, degrees per pixel,
etc.).
You'll need to come up with a projection to map the Lat/Long to some
kind of XYZ that can be used by OSG. I use SEDRIS (www.sedris.org) for
my coordinate conversions these days because it will convert from
anything to anything else (Geodetic, Geocentric, UTM, MGRS, and more).
Check the license to make sure you're comfortable with it. It's free to
use, and available in source form, but they have their own license. For
your purposes though, there's likely a simpler way to do your coordinate
conversion.
Good luck.
Alan.
Glenn Waldron wrote:
> Supposedly GDAL does support the TOC for CADRG/CIB:
>
> http://www.gdal.org/frmt_various.html (search for "RPF")
>
> You might be able to coerce osgEarth's GDAL driver into doing what you
> want.
>
>
> Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
> +1.703.652.4791
>
>
> On Tue, Apr 28, 2009 at 11:28 AM, Tueller, Shayne R Civ USAF AFMC 519
> SMXS/MXDEC <Shayne.Tueller at hill.af.mil
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg>
> <mailto:Shayne.Tueller at hill.af.mil
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg> >> wrote:
>
> Joe,
>
> >From what I understand, GDAL will import a single CADRG image but
> it won't
> handle the dynamic decompression and different map resolutions as
> you zoom
> in and out (the A.TOC file). I've done some moving map support
> using OSG for
> our software but I built my own paged moving map database using
> the OSG
> paging database support with different CADRG images. It seems to
> work for
> what we need.
>
> IMO, I think a "real" moving map plugin that fully handles the
> CADRG format
> would be something useful in OSG...
>
> -Shayne
>
> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg>
> <mailto:osg-users-bounces at lists.openscenegraph.org
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg> >
> [mailto:osg-users-bounces at lists.openscenegraph.org
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg>
> <mailto:osg-users-bounces at lists.openscenegraph.org
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg> >] On Behalf Of
> Sullivan,
> Joseph (CDR)
> Sent: Tuesday, April 28, 2009 8:21 AM
> To: osg-users at lists.openscenegraph.org
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg>
> <mailto:osg-users at lists.openscenegraph.org
<http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o
rg> >
> Subject: [osg-users] Simple moving map using CADRG data
>
> Hello,
>
> I posted this earlier but it may have gotten lost in the shuffle.
>
> I'm interested in adding a moving map display to a simulation.
> (Something
> like an instructor operator station.) I understand GDAL can
> import CADRG
> data but I haven't found an easy way to use that data to create a
> moving map
> display.
>
> Have others implemented anything like this ? If so, any tips or
> suggestions
> appreciated. Is this something others in the community would find
> useful?
>
> Thanks,
>
> Joe
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org