1

(Edit) I have added a link to the files needed to reproduce problem (unzips to 180MB TIFF) :

https://www.dropbox.com/s/qrrlsjlmafctt38/issue.zip?dl=0

I have been working on a project the past few months but noticed I have issues when I overlay weather radar data on a Mapbox GL JS map - the data does not align properly. (The longitude seems to be correct but latitude is always incorrect.) I am sure this is simple but I am new with GIS and I am trying to understand how certain things apply to what I am doing. I have gone as far as using gdalinfo to understand the GeoTIFF but I hate to admit that my skill level is at the moment too low to understand what projection the image is or how to convert it so it displays correctly on Mapbox using GDAL tools.

I am using software from NOAA (Weather-Climate Toolkit) to convert weather data to GeoTIFF format. When I run gdalinfo, the following is returned :

Warning 1: TIFFFetchNormalTag:incorrect count for field "PageNumber", expected 2, got 1
Warning 1: TIFFFetchNormalTag:Incompatible type for "GDALNoDataValue"; tag ignored
Raster dataset parameters:
Projection: GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY    ["EPSG","6326"]],PRIMEM    ["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]
RasterCount: 1
RasterSize (7000,3274)
Using driver GeoTIFF
Metadata:
0:  AREA_OR_POINT=Area
1:  TIFFTAG_SOFTWARE=nc2geotiff

Image Structure Metadata:
0:  INTERLEAVE=BAND

Warning 1: TIFFFetchNormalTag:incorrect count for field "PageNumber", expected 2, got 1
Warning 1: TIFFFetchNormalTag:Incompatible type for "GDALNoDataValue"; tag ignored
Subdatasets:
0:  SUBDATASET_1_NAME=GTIFF_DIR:1:MRMS_MBR_FULL.tif
1:  SUBDATASET_1_DESC=Page 1 (7000P x 3274L x 1B)
2:  SUBDATASET_2_NAME=GTIFF_DIR:2:MRMS_MBR_FULL.tif
3:  SUBDATASET_2_DESC=Page 2 (7000P x 3274L x 1B)

Corner Coordinates:
Upper Left (-131.001832620648, 51)
Lower Left (-131.001832620648, 22)
Upper Right (-68.9981673793525, 51)
Lower Right (-68.9981673793525, 22)
Center (-100, 36.5)

Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Band 1 :
DataType: Float32
ColorInterpretation: Gray
Description:
Size (7000,3274)
BlockSize (7000,1)
Offset: 0
Scale: 1

Should I be using gdalwarp to convert this for Mapbox use, and is my script below close to correct? What should it be (and why, so I can learn from this?) I don't know what -s_srs and -t_srs do, I was looking in another forum online and trying different things. After many hours with this I give up and am asking for help here. Below the script I will post a screenshot of what it currently looks like.

 *Current Script :*



gdalwarp -s_srs epsg:3857 -t_srs epsg:4326 MRMS_MBR_FULL.tif MRMS_MBR_FULL_CONVERTED.tif

Screenshot

Problem with conversion

There seems to be a pattern I notated in the image above as well, as notated. It's all the same TIFF, but individual storms are warped out of place from where they should be. (Conformed the misplacement by comparing to known good analysis tools and ruling out HTML/Javascript issues)

Edit : The weather toolkit I use to export has a command-line mode (which I use) and a GUI. The GUI mode's map looks different (more "smooshed?") than Mapbox. Maybe this has something to do with it, if the command line version uses the same projection? Image below.enter image description here

Edit #2 : After I generate the TIFF with the above gdalinfo, I then colorize it using gdaldem - and I noticed the gdalinfo changes. Is this somehow changing the projection and making it incompatible with Mapbox?

Raster dataset parameters:
Projection: PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]
RasterCount: 3
RasterSize (6821,2603)
Using driver GeoTIFF
Metadata:
0:  AREA_OR_POINT=Area

Image Structure Metadata:
0:  INTERLEAVE=PIXEL

Corner Coordinates:
Upper Left (-15586980.8394848, 6621293.72274017)
Lower Left (-15586980.8394848, 2754028.1126001)
Upper Right (-5453051.24794984, 6621293.72274017)
Lower Right (-5453051.24794984, 2754028.1126001)
Center (-10520758.8915103, 4688403.7654631)

Coordinate System is:
PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Mercator_1SP"],
PARAMETER["central_meridian",0],
PARAMETER["scale_factor",1],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
AUTHORITY["EPSG","3857"]]
Band 1 :
DataType: Byte
ColorInterpretation: Red
Description:
Size (6821,2603)
BlockSize (6821,1)
Offset: 0
Scale: 1
Band 2 :
DataType: Byte
ColorInterpretation: Green
Description:
Size (6821,2603)
BlockSize (6821,1)
Offset: 0
Scale: 1
Band 3 :
DataType: Byte
ColorInterpretation: Blue
Description:
Size (6821,2603)
BlockSize (6821,1)
Offset: 0
Scale: 1
  • The source data seems already be in EPSG:4326. – user30184 Sep 11 '18 at 9:35
  • I have added another image and description of what might be going on, at the bottom of my original post. Would that help clarify the problem? I have no idea what is going on. – David Sep 11 '18 at 9:43
  • I noticed the gdalinfo changes after I colorize the image in gdaldem and so I added that information at the bottom of the post. – David Sep 11 '18 at 10:38
  • Could you double check what you have as source data and what you have done. The first gdalinfo shows that the original image is in EPSG:4326. Then with your gdalwarp command (if the s_srs and t_srs parameters really are what you have used) you override the source_srs to be EPSG:3857 and warp the image into EPSG:4326. If this is what you did you have certainly ruined the georeferencing of the image. But then the gdalinfo about the result from gdaldem is in EPSG:3857 and by your description I do not understand how it is possible. – user30184 Sep 11 '18 at 10:47
  • After working on this for another hour I have gotten myself only more confused. I see what you are asking. To hopefully (and finally) clarify, I added a link to the TIF file and the colorization file. dropbox.com/s/qrrlsjlmafctt38/issue.zip?dl=0 – David Sep 11 '18 at 11:03

Your Answer

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

Browse other questions tagged or ask your own question.