Opened 15 years ago

Closed 5 years ago

#2729 closed enhancement (wontfix)

[PATCH] gdalwarp - Polar to Cylindrical reprojections cuts off part of target image when Polar image crosses pole

Reported by: glewis Owned by: Even Rouault
Priority: normal Milestone: closed_because_of_github_migration
Component: Utilities Version: 1.6.0
Severity: normal Keywords: gdalwarp
Cc: warmerdam

Description

When using the gdalwarp tool, if converting an image in a Polar projection (such as an laea projection) that crosses the pole, to a Cylindrical projection (such as a latlong projection), by default the target image is cut off and doesn't extend to the pole.

Using -wo settings of SOURCE_EXTRA, SAMPLE_GRID, and SAMPLE_STEP do not change this behavior. Manually setting the cylindrical extent boundaries with -te does work, but since it is manual you have to know what values to use.

Allowing an option to force internal gridding would be beneficial.

Attachments (1)

gdaltransformer_bug2729.patch (6.9 KB ) - added by Even Rouault 15 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Even Rouault, 15 years ago

Owner: changed from warmerdam to Even Rouault
Status: newassigned

comment:2 by Even Rouault, 15 years ago

Cc: warmerdam added
Summary: gdalwarp - Polar to Cylindrical reprojections cuts off part of target image when Polar image crosses pole[PATCH] gdalwarp - Polar to Cylindrical reprojections cuts off part of target image when Polar image crosses pole

Attached a patch that solves the issue.

With it: gdalwarp -t_srs EPSG:4326 polar.gtiff.tif polar_wgs84.tif

gives:

$ gdalinfo polar_wgs84.tif
Driver: GTiff/GeoTIFF
Files: polar_wgs84.tif
Size is 5111, 857
....
Origin = (-180.000000000000000,90.000000000000000)
Pixel Size = (0.070436313832909,-0.070445741950979)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N)
Lower Left  (-180.0000000,  29.6279991) (180d 0'0.00"W, 29d37'40.80"N)
Upper Right ( 180.0000000,  90.0000000) (180d 0'0.00"E, 90d 0'0.00"N)
Lower Right ( 180.0000000,  29.6279991) (180d 0'0.00"E, 29d37'40.80"N)
Center      (  -0.0000000,  59.8139996) (  0d 0'0.00"W, 59d48'50.40"N)
Band 1 Block=5111x1 Type=UInt16, ColorInterp=Gray

There's one part where I'd like to get Frank's opinion. It's the part where I adjust the x and y resolution so that the computed geotransform with the computed width and height doesn't overlap the 180° meridian. The only issue I see with that is that the pixel size is no longer a perfect square, as it's stated in the documentation of GDALSuggestedWarpOutput2(). But otherwise, another patch I'm working on in GDALWarpOperation::ComputeSourceWindow() for dealing with the inverse problem (warping to polar projection) can't work properly if the right edge of the image overlaps the 180° meridian.

by Even Rouault, 15 years ago

comment:3 by warmerdam, 12 years ago

Milestone: 1.6.4

Remove non-serious milestone.

comment:4 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: assignedclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.