Comments (3)
As I did not see the attached file, I searched and arrived at this base: (https://dataverse.harvard.edu/file.xhtml?persistentId=doi:10.7910/DVN/QQHCIK/W8MYQO&version=4.0), is this correct?
Assuming so, I verified that it is an 8-bit geotiff and I see in the code that this type of data was not handled:
GeoTiffCOG/GeoTiffCOG/GeoTiff.cs
Line 222 in efac2b5
case RasterSampleFormat.UNSIGNED_INTEGER:
if (metadata.BitsPerSample == 32)
{
heightValue = BitConverter.ToUInt32(buffer, offset * metadata.BitsPerSample / 8);
}
else // metadata.BitsPerSample == 16
{
heightValue = BitConverter.ToUInt16(buffer, offset * metadata.BitsPerSample / 8);
}
heightValue = heightValue * metadata.Scale + metadata.Offset;
break;
from geotiffcog.
I made a small change, to return the byte value inside the "byteScanline" array.
As a test suppose the following coordinate: 51.0, 8.3 (lat,lon); Which corresponds to the pixel 22596, 4364 (x,y).
nearby at that location indicated on the map.
The value (after commit) will return 9. However, it doesn't work well with some points that I took randomly, returning 255 (null value).
We need to review this part of the code to support 8bit geotiff well.
from geotiffcog.
There is no mystery about 8bit support, in my example the points were very close to the border and the code that transforms coordinates into pixels needed an adjustment, which has now been resolved.
@genaray please confirm if this version solves your problem, if so we can close this ticket.
from geotiffcog.
Related Issues (10)
- Weird line in GeoTIFF metadata parsing HOT 1
- Bilinear Interpolation
- How to install this Library in Nuget packages with c#
- Incorrect value being returned HOT 2
- No data at point HOT 1
- GDAL_METADATA
- GeoTiff.cs crash if no metadata. Fix. HOT 1
- Is https://registry.opendata.aws/terrain-tiles/ not a supported format? HOT 2
- Performance ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geotiffcog.