NoData not working with sid image #2658
Replies: 11 comments 6 replies
-
What do you mean "when I set noData"? Where are you attempting to set this? You can try using a layer shader to mask the white pixels. Not a perfect solution, but might be sufficient for you: |
Beta Was this translation helpful? Give feedback.
-
Glenn: Have you used any of the NAIP images? If so how do you put 2 next to each other? Bruce |
Beta Was this translation helpful? Give feedback.
-
Glenn:
Thanks for the input. I ran gdalbuildvrt on the sid image and it only
showed 3 bands. I added your 4th block to the vrtI and changed the
filename but got an error.
I was able to get a block like you showed by running gdalbuildvrt
-addalpha. The file loaded into GGIS but the white borders still showed.
My osgEarth app also shows the white borders.
my app seems to be quite temperamental. It keeps crashing in various
places. I turned on debug reporting but that does not seem to point to
anything other than expecting a different version of proj.lib.
Bruce
…On Fri, Nov 29, 2024 at 2:36 PM Glenn ***@***.***> wrote:
ChatGPT spits out this template, if it's helpful. The important part is
the final VRTRasterBand entry that tells GDAL to interpret source band 5
as Alpha.
<VRTDataset rasterXSize="WIDTH" rasterYSize="HEIGHT">
<SRS>PROJCS["EPSG:XXXX"]</SRS>
<GeoTransform>ULX, PIXEL_SIZE_X, 0, ULY, 0, -PIXEL_SIZE_Y</GeoTransform>
<VRTRasterBand band="1" dataType="Byte">
<ColorInterp>Red</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">input.mrsid</SourceFilename>
<SourceBand>1</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand band="2" dataType="Byte">
<ColorInterp>Green</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">input.mrsid</SourceFilename>
<SourceBand>2</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand band="3" dataType="Byte">
<ColorInterp>Blue</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">input.mrsid</SourceFilename>
<SourceBand>3</SourceBand>
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand band="4" dataType="Byte">
<ColorInterp>Alpha</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">input.mrsid</SourceFilename>
<SourceBand>5</SourceBand>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
—
Reply to this email directly, view it on GitHub
<#2658 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTTA2AJBTGJZBJH27TT2DC64ZAVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBRHA3DCNY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Glenn:
Sorry about that. This was generated by gdalbuildvrt -addalpha. It is
currently attached
Bruce
…On Wed, Dec 4, 2024 at 1:16 PM Glenn ***@***.***> wrote:
You forgot you post your vrt file.
—
Reply to this email directly, view it on GitHub
<#2658 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTWYREI6NLGBYXQZEE32D5BIPAVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBWGQ3DOMA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Attached both as a vrt file and in case some filter is stripping it off,
attached as a text file
Bruce
On Thu, Dec 5, 2024 at 4:24 PM Glenn ***@***.***> wrote:
Nope still don't see it.
—
Reply to this email directly, view it on GitHub
<#2658 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTT5V4NAPSWVFP3G4FD2EDAABAVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBXHAYDQMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
<VRTDataset rasterXSize="535000" rasterYSize="450000">
<SRS dataAxisToSRSAxisMapping="1,2">PROJCS["NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402_Feet",GEOGCS["NAD83(HARN)",DATUM["NAD83_High_Accuracy_Reference_Network",SPHEROID["GRS 1980",6378137,298.257222101004,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6152"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4152"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",40.0333333333333],PARAMETER["standard_parallel_2",38.7333333333333],PARAMETER["latitude_of_origin",38],PARAMETER["central_meridian",-82.5],PARAMETER["false_easting",1968500],PARAMETER["false_northing",0],UNIT["US survey foot",0.304800609601219,AUTHORITY["EPSG","9003"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","3754"]]</SRS>
<GeoTransform> 1.5125000000000000e 06, 2.5000000000000000e-01, 0.0000000000000000e 00, 6.7875000000000000e 05, 0.0000000000000000e 00, -2.5000000000000000e-01</GeoTransform>
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Red</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">Greene_2024_rgb_100x.sid</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="535000" RasterYSize="450000" DataType="Byte" BlockXSize="1024" BlockYSize="128" />
<SrcRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
<DstRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
<ColorInterp>Green</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">Greene_2024_rgb_100x.sid</SourceFilename>
<SourceBand>2</SourceBand>
<SourceProperties RasterXSize="535000" RasterYSize="450000" DataType="Byte" BlockXSize="1024" BlockYSize="128" />
<SrcRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
<DstRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3">
<ColorInterp>Blue</ColorInterp>
<SimpleSource>
<SourceFilename relativeToVRT="1">Greene_2024_rgb_100x.sid</SourceFilename>
<SourceBand>3</SourceBand>
<SourceProperties RasterXSize="535000" RasterYSize="450000" DataType="Byte" BlockXSize="1024" BlockYSize="128" />
<SrcRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
<DstRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
</SimpleSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="4">
<ColorInterp>Alpha</ColorInterp>
<ComplexSource>
<SourceFilename relativeToVRT="1">Greene_2024_rgb_100x.sid</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="535000" RasterYSize="450000" DataType="Byte" BlockXSize="1024" BlockYSize="128" />
<SrcRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
<DstRect xOff="0" yOff="0" xSize="535000" ySize="450000" />
<ScaleOffset>255</ScaleOffset>
<ScaleRatio>0</ScaleRatio>
</ComplexSource>
</VRTRasterBand>
<OverviewList resampling="nearest">2 4 8 16 32 64 128 256 512</OverviewList>
</VRTDataset>
|
Beta Was this translation helpful? Give feedback.
-
Unfortunately when I change the source band to 5 the images do not show at
all. To make sure I did what you suggested - for the file I sent to you,
in the band 4 block I changed sourceband to 5
…On Fri, Dec 6, 2024 at 10:40 AM Glenn ***@***.***> wrote:
You didn't change your Alpha SourceBand to 5.
Refer to my example from last week.
—
Reply to this email directly, view it on GitHub
<#2658 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTVPXVT4IXXANLBG3D32EHANBAVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBYGY2DINA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Glenn:
I started over using the sample you sent and changed the variable names
to the real data. When I try to load it in QGIS I get an error message
saying band 5 is an illegal value. Really not sure where to go from here
Bruce
…On Fri, Dec 6, 2024 at 3:42 PM Glenn ***@***.***> wrote:
That's what I did for a sample NAIP file I downloaded. It worked.
I didn't use all that "ComplexSource" stuff though.
You can verify in QGIS that your data indeed has the alpha in channel 5.
—
Reply to this email directly, view it on GitHub
<#2658 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTXABAYYCNH46EFMNW32EID35AVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBYHEYDONY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Open your .sid file in QGIS. |
Beta Was this translation helpful? Give feedback.
-
Per your request
Also - the image can be downloaded here -
https://gis1.oit.ohio.gov/geodatadownload/
select OSIP III then the county
General
Name Greene_2024_rgb_100x
Path Z:\geoData\geoRegions\UnitedStates\Ohio\Greene\Greene_2024_rgb_100x.sid
Sidecar file Greene_2024_rgb_100x.sid.aux.xml
Total size 6.73 GB
Last modified Thursday, June 13, 2024 3:12:58 AM
(Greene_2024_rgb_100x.sid.aux.xml)
Provider gdal
Information from provider
Extent 1512500.0000000000000000,566250.0000000000000000 :
1646250.0000000000000000,678750.0000000000000000
Width 535000
Height 450000
Data type Byte - Eight bit unsigned integer
GDAL Driver Description MrSID
GDAL Driver Metadata Multi-resolution Seamless Image Database (MrSID)
Dataset Description
Z:/geoData/geoRegions/UnitedStates/Ohio/Greene/Greene_2024_rgb_100x.sid
Compression
Band 1
STATISTICS_APPROXIMATE=YES
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=142.84600550964
STATISTICS_MINIMUM=10
STATISTICS_STDDEV=60.169203376879
STATISTICS_VALID_PERCENT=100
Scale: 1
Offset: 0
Band 2
STATISTICS_APPROXIMATE=YES
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=136.87988980716
STATISTICS_MINIMUM=19
STATISTICS_STDDEV=62.682728215329
STATISTICS_VALID_PERCENT=100
Scale: 1
Offset: 0
Band 3
STATISTICS_APPROXIMATE=YES
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=124.59917355372
STATISTICS_MINIMUM=13
STATISTICS_STDDEV=68.297783800386
STATISTICS_VALID_PERCENT=100
Scale: 1
Offset: 0
More information
GEOTIFF_CHAR__GeogAngularUnitsGeoKey=Angular_Degree
GEOTIFF_CHAR__GeogEllipsoidGeoKey=Ellipse_GRS_1980
GEOTIFF_CHAR__GeogGeodeticDatumGeoKey=Unknown-6152
GEOTIFF_CHAR__GeogPrimeMeridianGeoKey=PM_Greenwich
GEOTIFF_CHAR__GeographicTypeGeoKey=Unknown-4152
GEOTIFF_CHAR__GTModelTypeGeoKey=ModelTypeProjected
GEOTIFF_CHAR__GTRasterTypeGeoKey=RasterPixelIsArea
GEOTIFF_CHAR__ProjectedCSTypeGeoKey=Unknown-3754
GEOTIFF_CHAR__ProjLinearUnitsGeoKey=Linear_Foot_US_Survey
GEOTIFF_NUM__1024__GTModelTypeGeoKey=1
GEOTIFF_NUM__1025__GTRasterTypeGeoKey=1
GEOTIFF_NUM__1026__GTCitationGeoKey=PCS Name =
NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402_Feet
GEOTIFF_NUM__2048__GeographicTypeGeoKey=4152
GEOTIFF_NUM__2049__GeogCitationGeoKey=GCS Name =
GCS_North_American_1983_HARN|Datum = D_North_American_1983_HARN|Ellipsoid =
GRS_1980|Primem = Greenwich|
GEOTIFF_NUM__2050__GeogGeodeticDatumGeoKey=6152
GEOTIFF_NUM__2051__GeogPrimeMeridianGeoKey=8901
GEOTIFF_NUM__2054__GeogAngularUnitsGeoKey=9102
GEOTIFF_NUM__2055__GeogAngularUnitSizeGeoKey=0.017453
GEOTIFF_NUM__2056__GeogEllipsoidGeoKey=7019
GEOTIFF_NUM__2057__GeogSemiMajorAxisGeoKey=6378137.000000
GEOTIFF_NUM__2059__GeogInvFlatteningGeoKey=298.257222
GEOTIFF_NUM__2061__GeogPrimeMeridianLongGeoKey=0.000000
GEOTIFF_NUM__3072__ProjectedCSTypeGeoKey=3754
GEOTIFF_NUM__3073__PCSCitationGeoKey=ESRI PE String =
PROJCS["NAD_1983_HARN_StatePlane_Ohio_South_FIPS_3402_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1968500.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-82.5],PARAMETER["Standard_Parallel_1",38.73333333333333],PARAMETER["Standard_Parallel_2",40.03333333333333],PARAMETER["Latitude_Of_Origin",38.0],UNIT["Foot_US",0.30480060960121924]]
GEOTIFF_NUM__3076__ProjLinearUnitsGeoKey=9003
IMAGE__ENCODING_APPLICATION=GeoExpress 10.0.0.5011
IMAGE__FORMAT=MrSID/MG3
IMAGE__INPUT_FILE_SIZE=768694072131.000000
IMAGE__INPUT_FORMAT=GeoTIFF
IMAGE__LTI_ESDK_VERSION=9.5.4.5011 win64-vc15/Release_md
IMAGE__MODIFICATIONS=COMPRESSED EMBEDDED REORDERED-BANDS MOSAICKED
IMAGE__PRINT_DENSITY_UNIT=none
IMAGE__PRINT_X_DENSITY=1.000000
IMAGE__PRINT_Y_DENSITY=1.000000
VERSION=MG3
X : 267500
Y : 225000
X : 133750
Y : 112500
X : 66875
Y : 56250
X : 33438
Y : 28125
X : 16719
Y : 14063
X : 8360
Y : 7032
X : 4180
Y : 3516
X : 2090
Y : 1758
X : 1045
Y : 879
X : 523
Y : 440
X : 262
Y : 220
X : 131
Y : 110
X : 66
Y : 55
X : 33
Y : 28
X : 17
Y : 14
X : 9
Y : 7
X : 5
Y : 4
Dimensions X: 535000 Y: 450000 Bands: 3
Origin 1512500.0000000000000000,678750.0000000000000000
Pixel Size 0.25,-0.25
Coordinate Reference System (CRS)
Name EPSG:3754 - NAD83(HARN) / Ohio South (ftUS)
Units feet
Type Projected
Method Lambert Conformal Conic
Celestial Body Earth
Reference Static (relies on a datum which is plate-fixed)
Identification
Identifier
Parent Identifier
Title
Type dataset
Language
Abstract
Categories
Keywords
Extent
CRS EPSG:3754 - NAD83(HARN) / Ohio South (ftUS) - Projected
Spatial Extent
Temporal Extent
Access
Fees
Licenses
Rights
Constraints
Bands
Band count 3
Number Band No-Data Min Max
1 Band 1 n/a 10.0000000000 255.0000000000
2 Band 2 n/a 19.0000000000 255.0000000000
3 Band 3 n/a 13.0000000000 255.0000000000
Contacts
No contact yet.
References
No links yet.
History
No history yet.
…On Sat, Dec 7, 2024 at 10:54 AM Glenn ***@***.***> wrote:
Open your .sid file in QGIS.
In the layers panel, right-click on the layer and selection Properties.
Go to the Information tab.
Copy and paste that information here.
—
Reply to this email directly, view it on GitHub
<#2658 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTT5M34YDEZYZVWL65L2EMKZRAVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBZGQ3TMOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
There is your problem.
Old-style 3-band image. No alpha band at all. You are out of luck. Recommend going to the source and finding a newer image in MG4 format, which will have a separate ALPHA band you can use. |
Beta Was this translation helpful? Give feedback.
-
Glenn:
That is somewhat unfortunate. The images from NRCS appear really faded
and they are 1ft resolution whereas the images from OGRIP are clear with a
good contrast and some are 3in resolution.
You had mentioned using a shader in an earlier email. I have no experience
with setting up shaders. Would they work with these images?
Bruce
…On Sun, Dec 8, 2024 at 12:21 PM Glenn ***@***.***> wrote:
There is your problem.
IMAGE__FORMAT=MrSID/MG3
Old-style 3-band image. No alpha band at all. You are out of luck.
Recommend going to the source and finding a newer image in *MG4* format,
which will have a separate ALPHA band you can use.
https://nrcs.app.box.com/v/naip
—
Reply to this email directly, view it on GitHub
<#2658 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNLDTSVCZ6LHCOD45N34HL2ER53FAVCNFSM6AAAAABSFJDNVOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNJQGA3DANI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am using a MrSid image from the NAIP dataset. It shows a white border that I cannot get rid of using when I set noData. gdalInfo does not appear to show any noData values. QGIS tells me noData is not defined.
Is there another way to get rid of the white boarder so I can place adjacent images without the boarder?
recent version of osgEarth on Windows 10 using visual Studio 2022.
Bruce
Beta Was this translation helpful? Give feedback.
All reactions