D
deadpickle
when I try to compile my C program I get these warnings (at bottom).
Not sure how to fix them since I'm new to C.
#include "ogr_api.h"
#include "ogr_srs_api.h"
int main()
{
//~ variable declaration
const char *format = "ESRI Shapefile", *name = "testc.shp",
*source,
*target;
const char *sprj = "+proj=lcc +lat_1=33.000000
+lat_2=45.000000
+lat_0=39.000000 +lon_0=-96.000000 +x_0=0.0 +y_0=0.0 +datum=NAD83";
const char *tprj = "WGS84";
OGRSFDriverH driver;
OGRDataSourceH ds;
OGRCoordinateTransformationH ctrans;
//~ get driver and create ds
driver = OGRGetDriverByName(format);
ds = OGR_Dr_CreateDataSource(driver, "testc.shp", NULL);
//~ create spatrefs and trans
OSRNewSpatialReference(source);
OSRNewSpatialReference(target);
OSRSetFromUserInput(source, sprj);
OSRSetFromUserInput(target, tprj);
ctrans = OCTNewCoordinateTransformation(target, source);
}
dal_test_convert.c: In function ‘main’:
gdal_test_convert.c:22: warning: passing argument 1 of â
€˜OSRSetFromUserInput’ discards qualifiers from pointer target type
gdal_test_convert.c:23: warning: passing argument 1 of â
€˜OSRSetFromUserInput’ discards qualifiers from pointer target type
gdal_test_convert.c:24: warning: passing argument 1 of â
€˜OCTNewCoordinateTransformation’ discards qualifiers from pointer
target type
gdal_test_convert.c:24: warning: passing argument 2 of â
€˜OCTNewCoordinateTransformation’ discards qualifiers from pointer
target type
Not sure how to fix them since I'm new to C.
#include "ogr_api.h"
#include "ogr_srs_api.h"
int main()
{
//~ variable declaration
const char *format = "ESRI Shapefile", *name = "testc.shp",
*source,
*target;
const char *sprj = "+proj=lcc +lat_1=33.000000
+lat_2=45.000000
+lat_0=39.000000 +lon_0=-96.000000 +x_0=0.0 +y_0=0.0 +datum=NAD83";
const char *tprj = "WGS84";
OGRSFDriverH driver;
OGRDataSourceH ds;
OGRCoordinateTransformationH ctrans;
//~ get driver and create ds
driver = OGRGetDriverByName(format);
ds = OGR_Dr_CreateDataSource(driver, "testc.shp", NULL);
//~ create spatrefs and trans
OSRNewSpatialReference(source);
OSRNewSpatialReference(target);
OSRSetFromUserInput(source, sprj);
OSRSetFromUserInput(target, tprj);
ctrans = OCTNewCoordinateTransformation(target, source);
}
dal_test_convert.c: In function ‘main’:
gdal_test_convert.c:22: warning: passing argument 1 of â
€˜OSRSetFromUserInput’ discards qualifiers from pointer target type
gdal_test_convert.c:23: warning: passing argument 1 of â
€˜OSRSetFromUserInput’ discards qualifiers from pointer target type
gdal_test_convert.c:24: warning: passing argument 1 of â
€˜OCTNewCoordinateTransformation’ discards qualifiers from pointer
target type
gdal_test_convert.c:24: warning: passing argument 2 of â
€˜OCTNewCoordinateTransformation’ discards qualifiers from pointer
target type