# using GDAL version 3.4 -- test read support for PDS4 table ogrinfo Bm_output_0E360E.xml #ogrinfo -al Bm_output_0E360E.xml # convert to GIS Shapefile, where -a_srs is set to new IAU_2015 code for Mercury (in degrees) # this can be used directly in GIS applications for visualization but many will still # prefer to visualize an image. mkdir output_shapefile ogr2ogr -f "ESRI Shapefile" -a_srs IAU_2015:19900 output_shapefile\\BM_output_0E360E_points.shp Bm_output_0E360E.xml # using GDAL version 3.4 -- convert to a PDS4 (GeoTIFF) image # where -a_srs is set to new IAU_2015 code for Mercury, in degrees), although for images, GDAL will # convert to an Equirectangular projection in meters for the PDS4 label. # -tr = target resolution (in degrees) for the GeoTIFF, PDS4 pixel resolution will be converted to meters. # note the input spacing results in a rectangular output pixel. This is support in PDS4 but not # common (or supported) in other planetary formats (e.g., PDS3, VICAR, ISIS) # -txe and -tye are the target X/Y extents in degrees. THis helps define a hard boundary during the # conversion from points to pixels (using a "-a" nearest neighbor algorithm for the conversion) gdal_grid -zfield "Field Magnitude" -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot Float32 -of GTIFF -tr 1.0 0.5 -txe 0 360 -tye 75 35 -a_srs IAU_2015:19900 Bm_output_0E360E.xml Bm_output_0E360E_mag.tif gdal_grid -zfield "Field Radial" -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot Float32 -of GTIFF -tr 1.0 0.5 -txe 0 360 -tye 75 35 -a_srs IAU_2015:19900 Bm_output_0E360E.xml Bm_output_0E360E_rad.tif gdal_grid -zfield "Field East" -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot Float32 -of GTIFF -tr 1.0 0.5 -txe 0 360 -tye 75 35 -a_srs IAU_2015:19900 Bm_output_0E360E.xml Bm_output_0E360E_east.tif gdal_grid -zfield "Field North" -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot Float32 -of GTIFF -tr 1.0 0.5 -txe 0 360 -tye 75 35 -a_srs IAU_2015:19900 Bm_output_0E360E.xml Bm_output_0E360E_north.tif gdal_grid -zfield "Altitude" -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -ot Float32 -of GTIFF -tr 1.0 0.5 -txe 0 360 -tye 75 35 -a_srs IAU_2015:19900 Bm_output_0E360E.xml Bm_output_0E360E_alt.tif # Now add PDS4 label to existing GeoTIFF using the original PDS table label as the input template # which helps set metadata no longer supported in the created output GeoTIFF. Note the input # PDS4 template was update to 1.G.0.0 (1.16.0.0) to support more recent updates in CART (optional). # Generally the output PDS4 label will need some minor touch-ups (but it should validate) # -of = output format # -co = conversion option gdal_translate -of PDS4 -co CREATE_LABEL_ONLY=yes -co TEMPLATE=Bm_output_0E360E.xml Bm_output_0E360E_mag.tif Bm_output_0E360E_mag.xml gdal_translate -of PDS4 -co CREATE_LABEL_ONLY=yes -co TEMPLATE=Bm_output_0E360E.xml Bm_output_0E360E_rad.tif Bm_output_0E360E_rad.xml gdal_translate -of PDS4 -co CREATE_LABEL_ONLY=yes -co TEMPLATE=Bm_output_0E360E.xml Bm_output_0E360E_east.tif Bm_output_0E360E_east.xml gdal_translate -of PDS4 -co CREATE_LABEL_ONLY=yes -co TEMPLATE=Bm_output_0E360E.xml Bm_output_0E360E_north.tif Bm_output_0E360E_north.xml # note: alt is al the same value "40", not converted #gdal_translate -of PDS4 -co CREATE_LABEL_ONLY=yes -co TEMPLATE=Bm_output_0E360E.xml Bm_output_0E360E_alt.tif Bm_output_0E360E_alt.xml # convert GeoTIFFs to simple stretched 8bit jpegs (optional browse export) mkdir browse gdal_translate -of JPEG -scale -ot Byte Bm_output_0E360E_mag.tif browse\\Bm_output_0E360E_mag_browse.jpg gdal_translate -of JPEG -scale -ot Byte Bm_output_0E360E_rad.tif browse\\Bm_output_0E360E_rad_browse.jpg gdal_translate -of JPEG -scale -ot Byte Bm_output_0E360E_east.tif browse\\Bm_output_0E360E_east_browse.jpg gdal_translate -of JPEG -scale -ot Byte Bm_output_0E360E_north.tif browse\\Bm_output_0E360E_north_browse.jpg #gdal_translate -of JPEG -scale -ot Byte Bm_output_0E360E_alt.tif browse\\Bm_output_0E360E_alt_browse.jpg