Skip to main content
deleted 31 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Problems with gdal1.8 Using gdal Java bindings gdal.ReprojectImage, produces no data

I have a problem with gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no errors popping up at all. The code is the following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

Does anybody know what'sWhat is going on here? Thanks a lot.

Problems with gdal1.8 Java bindings gdal.ReprojectImage, produces no data

I have a problem with gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no errors popping up at all. The code is the following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

Does anybody know what's going on here? Thanks a lot.

Using gdal Java bindings gdal.ReprojectImage produces no data

I have a problem with gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no errors popping up at all. The code is the following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

What is going on here?

edited tags
Source Link
whuber
  • 70.2k
  • 16
  • 187
  • 282

Problems with gdal1.8 Java bindings gdal.ReprojectImage, pruducesproduces no data

I have a problem with the gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no errorerrors popping up at all. The code is asthe following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

Does anybody know what's going on here? Thanks a lot.

Problems with gdal1.8 Java bindings gdal.ReprojectImage, pruduces no data

I have a problem with the gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no error popping up at all. The code is as following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

Does anybody know what's going on here? Thanks a lot.

Problems with gdal1.8 Java bindings gdal.ReprojectImage, produces no data

I have a problem with gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no errors popping up at all. The code is the following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

Does anybody know what's going on here? Thanks a lot.

Tweeted twitter.com/#!/StackGIS/status/67109366947520512
Source Link
weliam
  • 357
  • 1
  • 9

Problems with gdal1.8 Java bindings gdal.ReprojectImage, pruduces no data

I have a problem with the gdal.ReprojectImage from gdal1.8 Java bindings. When I perform the reprojection, the projected image is totally black. And the origin of the projected image is wrong too. There were no error popping up at all. The code is as following:

           Dataset in_ds = gdal.Open(inPath, gdalconst.GA_ReadOnly);
           Dataset out_ds = in_ds.GetDriver().Create(outPath,in_ds.getRasterXSize(), in_ds.getRasterYSize(), in_ds.getRasterCount());

           try {
                   SpatialReference dstRef = new SpatialReference("");
                   dstRef.ImportFromEPSG(26919);

                   out_ds.SetProjection(dstRef.ExportToWkt());
                   out_ds.SetGeoTransform(in_ds.GetGeoTransform());

                   if (gdal.ReprojectImage(in_ds, out_ds) == gdalconst.CE_Failure)
                           System.out.println("something is wrong");
           } finally {
                   in_ds.delete();
                   out_ds.delete();
           }

Does anybody know what's going on here? Thanks a lot.