TransWikia.com

Assigning known georeference to PNG using GDAL

Geographic Information Systems Asked on July 12, 2021

I have a little experience with GDAL using the command line. However I am not sure where to start with this issue as it deals with adding projection to an image and I have never done it from scratch.

I have a PNG image (radar/rain data) that I need to convert to geoTIF. I was told what the projection and bounding coordinates are, but I am not sure if I have enough information or even if I am doing it right.

Here is the information I was given :

Longitude: -102.328, -93.7296
Latitude: 26.0468, 33.3013
Projection: AzimuthalEquidistant.

For additional clues, I know the image was generated by in python with Py-Art (weather radar tools). I found information on projection output with this tool at this link, which states about image generation :

The GeoTIFF can be the standard Azimuthal Equidistant projection used
in Py-ART, or a lat/lon projection on a WGS84 sphere.

So, I know the image was generated using the first option, but is this enough information to properly georeference my image? I see projection code in that link but it seems it is for their latter option (non standard Azimuthal Equidistant Projection). My end goal is to get the PNG projected to EPSG:3857 for Mapbox, but I am not sure how to get there. Here is what I have tried :

So, from what I read online, Azimuthal Equidistant Projection is also known as EPSG:4326. Perhaps what I am trying is too simple – but here was my command using what I believe are the coordinates and projection :

gdal_translate -of Gtiff -a_ullr -102.328 33.3013 -93.7296 26.0468 -a_srs EPSG:4326 image.png image2.tif

I then used this command to get to EPSG:3857 :

gdalwarp -t_srs EPSG:3857 image2.tif image2-projected.tif

I verified that the final image was wrong (image2-projected.tif).

What am I doing wrong? I see from other examples online that there are “proj4” strings and SRS data, but I don’t exactly understand what needs to be added and how to add it (if anything.)

Last, here is the image itself for completeness, and this is a public google drive link to get the actual PNG :

enter image description here

One Answer

Commands:

$ gdal_translate -of VRT -a_srs EPSG:4326 -a_nodata 255 3lXUn.png 3lXUn.vrt -a_ullr -102.328 33.3013 -93.7296 26.0468
$ gdalwarp -overwrite -s_srs EPSG:4326 -t_srs EPSG:3857 -co COMPRESS=LZW 3lXUn.vrt 3lXUn.tif

Answered by spatialhast on July 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP