[mapserver-users] Having an issue displaying a VRT file
Hi all, I've been banging my head against this problem for a while so asking for ideas. Thanks, -Steve W I have GTiff file the looks like: $ gdalinfo -stats -hist /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.tif Driver: GTiff/GeoTIFF Files: /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.tif Size is 8010, 6000 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"]] Origin = (-120.0337498,44.8837499) Pixel Size = (0.0075000,-0.0075000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left (-120.0337500, 44.8837500) (120d 2' 1.50"W, 44d53' 1.50"N) Lower Left (-120.0337500, -0.1162500) (120d 2' 1.50"W, 0d 6'58.50"S) Upper Right ( -59.9587500, 44.8837500) ( 59d57'31.50"W, 44d53' 1.50"N) Lower Right ( -59.9587500, -0.1162500) ( 59d57'31.50"W, 0d 6'58.50"S) Center ( -89.9962500, 22.3837500) ( 89d59'46.50"W, 22d23' 1.50"N) Band 1 Block=8010x1 Type=Float32, ColorInterp=Gray Minimum=0.001, Maximum=392.112, Mean=0.682, StdDev=6.289 0...10...20...30...40...50...60...70...80...90...100 - done. 256 buckets from -0.767845 to 392.881: 5116420 228446 61443 29479 20356 13649 8567 6328 4568 3350 2637 2397 1852 1682 1516 1391 1404 1193 1074 957 874 824 791 663 566 560 574 545 531 466 368 369 379 263 334 301 267 252 250 247 202 178 183 207 195 184 155 163 166 184 152 151 150 138 101 128 131 140 85 113 98 121 127 106 83 92 92 107 81 87 81 72 110 77 68 62 70 59 80 75 75 76 55 55 50 51 66 56 59 44 50 52 60 43 55 52 57 54 35 60 47 35 41 30 38 37 47 49 22 37 25 40 25 36 37 43 39 27 22 32 34 33 33 27 32 32 20 22 26 14 25 21 26 14 16 21 12 26 15 29 23 18 20 5 9 10 9 16 17 12 14 20 19 12 16 17 10 8 11 21 11 21 7 10 16 18 10 11 17 21 11 6 7 11 11 17 3 16 8 6 9 19 17 9 11 11 10 11 9 8 6 16 11 12 14 12 9 11 8 6 8 7 14 10 6 3 4 3 5 7 4 6 5 9 5 5 2 6 10 14 4 4 6 3 5 3 8 3 5 10 7 1 13 14 9 7 5 6 9 9 6 5 10 8 6 7 5 10 11 9 7 4 0 5 0 4 NoData Value=-999 Metadata: STATISTICS_MAXIMUM=392.11212158203 STATISTICS_MEAN=0.68159060504688 STATISTICS_MINIMUM=0.001000474975 STATISTICS_STDDEV=6.2888244425479 I created a VRT file with that looks like: a$ gdalinfo -stats -hist /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt Driver: VRT/Virtual Raster Files: /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.tif Size is 8010, 6000 Coordinate System is `' Origin = (-120.0337498,44.8837499) Pixel Size = (0.0075000,-0.0075000) Corner Coordinates: Upper Left (-120.0337500, 44.8837500) Lower Left (-120.0337500, -0.1162500) Upper Right ( -59.9587500, 44.8837500) Lower Right ( -59.9587500, -0.1162500) Center ( -89.9962500, 22.3837500) Band 1 Block=128x128 Type=Byte, ColorInterp=Palette Minimum=0.001, Maximum=392.112, Mean=0.682, StdDev=6.289 0...10...20...30...40...50...60...70...80...90...100 - done. 256 buckets from -0.5 to 255.5: 4946628 325638 83015 39917 25684 16759 13604 10800 8041 5808 4731 3922 3191 2501 2130 1883 1639 1488 1266 1159 1070 1070 935 916 887 873 833 713 679 620 624 541 544 535 492 445 427 351 364 390 359 389 315 347 316 305 229 263 221 252 189 183 219 210 183 180 173 175 149 166 156 141 123 124 115 124 133 132 119 117 106 110 95 112 119 113 117 98 101 95 89 101 86 61 80 85 75 95 90 60 56 75 68 59 89 67 92 65 60 45 76 66 52 60 67 50 61 55 48 41 63 73 56 47 42 42 45 35 46 42 44 57 46 52 42 57 27 43 31 33 39 27 38 50 31 43 35 22 26 38 41 36 27 29 39 38 29 45 29 32 35 22 41 33 31 23 25 28 15 26 24 17 28 31 42 23 11 20 24 17 26 21 12 27 22 25 26 27 27 20 19 15 17 18 16 27 25 25 15 19 22 21 15 16 16 18 9 19 10 11 18 17 11 16 10 13 6 14 19 4 11 17 8 18 18 14 15 11 15 9 2 5 4 9 9 2 9 13 10 7 10 10 16 12 10 10 9 8 11 10 7 2 7 10 14 7 7 14 11 5 7 5 14 15 5 735 Metadata: STATISTICS_MAXIMUM=392.11212158203 STATISTICS_MEAN=0.68159060504688 STATISTICS_MINIMUM=0.001000474975 STATISTICS_STDDEV=6.2888244425479 Color Table (RGB with 256 entries) 0: 0,0,0,255 1: 0,0,255,255 ... 254: 0,0,0,255 255: 255,255,255,255 When I display if via mapserver it comes out all black: LAYER NAME "chlorophyll" STATUS on TYPE raster DATA "/maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt" PROJECTION "init=epsg:4326" END END But if I run: gdal_translate -of PNG /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt test.png test.png shows the image with the colors! The whole VRT file is: -120.03375 ,0.0075 , 0 , 44.88375 , 0 , -0.0075 Palette -999.0
Re: [mapserver-users] Having an issue displaying a VRT file
Never mind! I figured it out. If your MAP->NAME is the same as you LAYER->NAME then that take priority over of LAYER->NAME and then display all the other layers also. In this case rendering the the gray scale tif over the colors. -Steve On 6/29/2019 12:22 PM, Stephen Woodbridge wrote: Hi all, I've been banging my head against this problem for a while so asking for ideas. Thanks, -Steve W I have GTiff file the looks like: $ gdalinfo -stats -hist /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.tif Driver: GTiff/GeoTIFF Files: /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.tif Size is 8010, 6000 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"]] Origin = (-120.0337498,44.8837499) Pixel Size = (0.0075000,-0.0075000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left (-120.0337500, 44.8837500) (120d 2' 1.50"W, 44d53' 1.50"N) Lower Left (-120.0337500, -0.1162500) (120d 2' 1.50"W, 0d 6'58.50"S) Upper Right ( -59.9587500, 44.8837500) ( 59d57'31.50"W, 44d53' 1.50"N) Lower Right ( -59.9587500, -0.1162500) ( 59d57'31.50"W, 0d 6'58.50"S) Center ( -89.9962500, 22.3837500) ( 89d59'46.50"W, 22d23' 1.50"N) Band 1 Block=8010x1 Type=Float32, ColorInterp=Gray Minimum=0.001, Maximum=392.112, Mean=0.682, StdDev=6.289 0...10...20...30...40...50...60...70...80...90...100 - done. 256 buckets from -0.767845 to 392.881: 5116420 228446 61443 29479 20356 13649 8567 6328 4568 3350 2637 2397 1852 1682 1516 1391 1404 1193 1074 957 874 824 791 663 566 560 574 545 531 466 368 369 379 263 334 301 267 252 250 247 202 178 183 207 195 184 155 163 166 184 152 151 150 138 101 128 131 140 85 113 98 121 127 106 83 92 92 107 81 87 81 72 110 77 68 62 70 59 80 75 75 76 55 55 50 51 66 56 59 44 50 52 60 43 55 52 57 54 35 60 47 35 41 30 38 37 47 49 22 37 25 40 25 36 37 43 39 27 22 32 34 33 33 27 32 32 20 22 26 14 25 21 26 14 16 21 12 26 15 29 23 18 20 5 9 10 9 16 17 12 14 20 19 12 16 17 10 8 11 21 11 21 7 10 16 18 10 11 17 21 11 6 7 11 11 17 3 16 8 6 9 19 17 9 11 11 10 11 9 8 6 16 11 12 14 12 9 11 8 6 8 7 14 10 6 3 4 3 5 7 4 6 5 9 5 5 2 6 10 14 4 4 6 3 5 3 8 3 5 10 7 1 13 14 9 7 5 6 9 9 6 5 10 8 6 7 5 10 11 9 7 4 0 5 0 4 NoData Value=-999 Metadata: STATISTICS_MAXIMUM=392.11212158203 STATISTICS_MEAN=0.68159060504688 STATISTICS_MINIMUM=0.001000474975 STATISTICS_STDDEV=6.2888244425479 I created a VRT file with that looks like: a$ gdalinfo -stats -hist /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt Driver: VRT/Virtual Raster Files: /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.tif Size is 8010, 6000 Coordinate System is `' Origin = (-120.0337498,44.8837499) Pixel Size = (0.0075000,-0.0075000) Corner Coordinates: Upper Left (-120.0337500, 44.8837500) Lower Left (-120.0337500, -0.1162500) Upper Right ( -59.9587500, 44.8837500) Lower Right ( -59.9587500, -0.1162500) Center ( -89.9962500, 22.3837500) Band 1 Block=128x128 Type=Byte, ColorInterp=Palette Minimum=0.001, Maximum=392.112, Mean=0.682, StdDev=6.289 0...10...20...30...40...50...60...70...80...90...100 - done. 256 buckets from -0.5 to 255.5: 4946628 325638 83015 39917 25684 16759 13604 10800 8041 5808 4731 3922 3191 2501 2130 1883 1639 1488 1266 1159 1070 1070 935 916 887 873 833 713 679 620 624 541 544 535 492 445 427 351 364 390 359 389 315 347 316 305 229 263 221 252 189 183 219 210 183 180 173 175 149 166 156 141 123 124 115 124 133 132 119 117 106 110 95 112 119 113 117 98 101 95 89 101 86 61 80 85 75 95 90 60 56 75 68 59 89 67 92 65 60 45 76 66 52 60 67 50 61 55 48 41 63 73 56 47 42 42 45 35 46 42 44 57 46 52 42 57 27 43 31 33 39 27 38 50 31 43 35 22 26 38 41 36 27 29 39 38 29 45 29 32 35 22 41 33 31 23 25 28 15 26 24 17 28 31 42 23 11 20 24 17 26 21 12 27 22 25 26 27 27 20 19 15 17 18 16 27 25 25 15 19 22 21 15 16 16 18 9 19 10 11 18 17 11 16 10 13 6 14 19 4 11 17 8 18 18 14 15 11 15 9 2 5 4 9 9 2 9 13 10 7 10 10 16 12 10 10 9 8 11 10 7 2 7 10 14 7 7 14 11 5 7 5 14 15 5 735 Metadata: STATISTICS_MAXIMUM=392.11212158203 STATISTICS_MEAN=0.68159060504688 STATISTICS_MINIMUM=0.001000474975 STATISTICS_STDDEV=6.2888244425479 Color Table (RGB with 256 entries) 0: 0,0,0,255 1: 0,0,255,255 ... 254: 0,0,0,255 255: 255,255,255,255 When I display if via mapserver it comes out all black: LAYER NAME "chlorophyll" STATUS on TYPE raster DATA "/maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt" PROJECTION "init=epsg:4326" END END But if I run: gdal_translate -of PNG /maps/wms/data/VIIRS_CHLORA/VIIRS_CHLORA.vrt test.png test.png shows the image with the colors! The whole VRT file is: -120.0