0

I have a georeferenced image of Earth above the Pacific Ocean. Gdalinfo give me this :

 NC_GLOBAL#geospatial_lat_max=81.328201       
 NC_GLOBAL#geospatial_lat_min=-81.328201       
 NC_GLOBAL#geospatial_lon_max=-55.7005      
 NC_GLOBAL#geospatial_lon_min=141.7005 

Problem is lon_min > lon_max so I don't know how I can use the -te gdalwarp's option on an area with for example lon_min = 160 and lon_max = -120. I tried to exchange position in command line and I also tried to transform the 160° in -200° but it doesn't work.

gdalwarp -t_srs EPSG:4326 -te 160 -10 -120 10 sphere.tiff plani.tiff


Creating output file that is -5491P x 392L.
ERROR 1: Attempt to create -5491x392 dataset is illegal,sizes must be larger than zero.

I tried to transform my 160°E in 200°W and I get a picture cut at 180°W.

gdalwarp -t_srs EPSG:4326 -te -200 -10 -120 10 sphere.tiff plani.tiff

Bad image, cut at 180°W

Finally I simply tried to exchange the -120 and 160 in command line but I obtain a weird image.

gdalwarp -t_srs EPSG:4326 -te -120 -10 160 10 sphere.tiff plani.tiff

weird image

Does anyone know how to get an image with these coordinates ?

Thanks,

6
  • --config CENTER_LONG 180 doesn't work for me and I also tried to add +over and +lon_wrap=-180 to proj definition but it still doesn't work.
    – erwanlfrt
    Aug 4 '20 at 9:19
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works.
    – Ian Turton
    Aug 4 '20 at 10:58
  • Please use this edit link to update your question with things you have tried that have failed
    – Ian Turton
    Aug 4 '20 at 10:59
  • 1
    I see no mention of +over or --config in your question
    – Ian Turton
    Aug 4 '20 at 12:37
1

I found a solution using gdalwarp. I don't fully understand how my solution works but here is the solution :

2 steps are necessary to georeference my image sphere.tiff with only west longitude degree unit.

gdalwarp -s_srs "+proj=geos +a=6378160 +b=6356775 +lon_0=-135 +h=35785845 +x_0=0 +y_0=0 +pm=-135" -t_srs "+proj=eqc +lon_0=-135 +pm=-135" sphere.tiff step1.tiff

gdalwarp -s_srs "+proj=eqc +pm=-135" -t_srs EPSG:4326 step1.tiff step2.tiff

Now my image is correctly georeferenced :

gdalinfo step2.tiff
...
Corner Coordinates:
Upper Left  (    -216.283,      76.491) (216d17' 0.01"W, 76d29'27.88"N)
Lower Left  (    -216.283,     -76.496) (216d17' 0.01"W, 76d29'46.07"S)
Upper Right ( -53.7216960,  76.4910783) ( 53d43'18.11"W, 76d29'27.88"N)
Lower Right ( -53.7216960, -76.4961292) ( 53d43'18.11"W, 76d29'46.07"S)
Center      (-135.0025160,  -0.0025254) (135d 0' 9.06"W,  0d 0' 9.09"S)

And finally I can use my step2.tiff image to cut out an area covering the dateline.

gdalwarp -t_srs EPSG:4326 -te -200 -10 -160 10 step2.tiff res.tiff

image sat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.