Removed direct dependency on GDAL

This commit is contained in:
Robert Osfield
2004-10-28 08:57:23 +00:00
parent 8dfea424c5
commit ce73909033
3 changed files with 5 additions and 40 deletions

View File

@@ -4,9 +4,7 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgdem.cpp\
INC += $(GDAL_INCLUDES)
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgText -losgGA -losgDB -losgUtil -losg $(GDAL_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
INSTFILES = \
$(CXXFILES)\

View File

@@ -4,13 +4,6 @@ include $(TOPDIR)/Make/makedefs
CXXFILES =\
osgdem.cpp\
ifneq ("$(GDAL_INCLUDES)","")
INC += $(GDAL_INCLUDES)
endif
ifneq ("$(GDAL_LIB_DIR)","")
LDFLAGS += -L$(GDAL_LIB_DIR)
endif
LIBS += -losgProducer -lProducer -losgTerrain -losgFX -losgGL2 -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)

View File

@@ -51,8 +51,6 @@
#include <osgTerrain/DataSet>
#include <ogr_spatialref.h>
class GraphicsContext {
public:
GraphicsContext()
@@ -73,30 +71,6 @@ class GraphicsContext {
Producer::ref_ptr<Producer::RenderSurface> rs;
};
char *SanitizeSRS( const char *pszUserInput )
{
OGRSpatialReferenceH hSRS;
char *pszResult = NULL;
CPLErrorReset();
hSRS = OSRNewSpatialReference( NULL );
if( OSRSetFromUserInput( hSRS, pszUserInput ) == OGRERR_NONE )
OSRExportToWkt( hSRS, &pszResult );
else
{
CPLError( CE_Failure, CPLE_AppDefined,
"Translating source or target SRS failed:\n%s",
pszUserInput );
exit( 1 );
}
OSRDestroySpatialReference( hSRS );
return pszResult;
}
osg::Matrixd computeGeoTransForRange(double xMin, double xMax, double yMin, double yMax)
{
osg::Matrixd matrix;
@@ -352,7 +326,7 @@ int main( int argc, char **argv )
if (arguments.read(pos, "--cs",def))
{
currentCS = !def.empty() ? SanitizeSRS(def.c_str()) : "";
currentCS = !def.empty() ? osgTerrain::DataSet::coordinateSystemStringToWTK(def) : "";
std::cout<<"--cs "<<currentCS<<std::endl;
}
else if (arguments.read(pos, "--wkt",def))
@@ -383,7 +357,7 @@ int main( int argc, char **argv )
else if (arguments.read(pos, "--bluemarble-east"))
{
currentCS = SanitizeSRS("WGS84");
currentCS = osgTerrain::DataSet::coordinateSystemStringToWTK("WGS84");
geoTransformSet = true;
geoTransformScale = true;
geoTransform = computeGeoTransForRange(0.0, 180.0, -90.0, 90.0);
@@ -394,7 +368,7 @@ int main( int argc, char **argv )
else if (arguments.read(pos, "--bluemarble-west"))
{
currentCS = SanitizeSRS("WGS84");
currentCS = osgTerrain::DataSet::coordinateSystemStringToWTK("WGS84");
geoTransformSet = true;
geoTransformScale = true;
geoTransform = computeGeoTransForRange(-180.0, 0.0, -90.0, 90.0);
@@ -405,7 +379,7 @@ int main( int argc, char **argv )
else if (arguments.read(pos, "--whole-globe"))
{
currentCS = SanitizeSRS("WGS84");
currentCS = osgTerrain::DataSet::coordinateSystemStringToWTK("WGS84");
geoTransformSet = true;
geoTransformScale = true;
geoTransform = computeGeoTransForRange(-180.0, 180.0, -90.0, 90.0);