tag:blogger.com,1999:blog-6029629494508626591.post7023668627802497082..comments2024-03-27T07:26:29.743+00:00Comments on Pedro's Tech Mumblings: Processing GeoTiff files in .NET (without using GDAL)Pedro Sousahttp://www.blogger.com/profile/17058685497255714267noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-6029629494508626591.post-26819928058740776432019-09-23T02:27:12.110+01:002019-09-23T02:27:12.110+01:00The last line may or may not be truncated. Accord...The last line may or may not be truncated. According to http://geotiff.maptools.org/spec/geotiff2.4.html<br /><br />"Note on ASCII Keys:<br />Special handling is required for ASCII-valued keys. While it is true that TIFF 6.0 permits multiple NULL-delimited strings within a single ASCII tag, the secondary strings might not appear in the output of naive "tiffdump" programs. For this reason, the null delimiter of each ASCII Key value shall be converted to a "|" (pipe) character before being installed back into the ASCII holding tag, so that a dump of the tag will look like this.<br /><br /> AsciiTag="first_value|second_value|etc...last_value|"<br />A baseline GeoTIFF-reader must check for and convert the final "|" pipe character of a key back into a NULL before returning it to the client software."<br /><br />Since libtiff is particularly barebones I'd say it's not handling the end of line properly. On the bright side, if the '|' is actually the end of data then everything is fine.Anonymoushttps://www.blogger.com/profile/17601587872333676688noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-43111366873318322932019-08-29T22:32:25.711+01:002019-08-29T22:32:25.711+01:00Sir, thanks for your solution.
I have a question a...Sir, thanks for your solution.<br />I have a question about those geoData, can we manipulate it just like a CAD Software, or an industrial CT Scanner ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-41041888019523001912018-02-10T14:13:48.599+00:002018-02-10T14:13:48.599+00:00Hi Pedro,
I'm ATM trying to do something like ...Hi Pedro,<br />I'm ATM trying to do something like you did.. and to find the tifftags used in gdallinfo.I stumbled upon this link : <br />https://www.awaresystems.be/imaging/tiff/tifftags/geokeydirectorytag.html<br />which gives interesting infos on tifftags...<br />in short, we are working on private use tifftags allocated by adobe ...<br />33550 // GEOTIFF_MODELPIXELSCALETAG ( what you were looking for ) <br />33922 // GEOTIFF_MODELTIEPOINTTAG ( what you were looking for )<br />34735 , 34736 , 42113 // ?? yet to see what it is ..<br />34737 // some SRS infos , but not implemented in the tifftag enum of bitmiracle.libtiff, the lib i use.<br /><br />Thanks for the first digging !!Seydoux Nicolashttps://www.blogger.com/profile/06442971238532761841noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-83595025444197714412017-08-21T23:58:11.381+01:002017-08-21T23:58:11.381+01:00Thanks for the start! In what context does geodata...Thanks for the start! In what context does geodata, PointXY and dataItem come from. I don't see them referenced at all in your "full" source code.zackhttps://www.blogger.com/profile/16165059692778406979noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-35589198919172440772017-03-15T16:35:30.546+00:002017-03-15T16:35:30.546+00:00Thanks a lot!!! Literally saved my day!Thanks a lot!!! Literally saved my day!Anonymoushttps://www.blogger.com/profile/10494389553504410017noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-51984217375168001202017-02-28T01:28:12.618+00:002017-02-28T01:28:12.618+00:00Hi. gdal_info will provide you that information:
...Hi. gdal_info will provide you that information:<br /><br />From my example above:<br />Minimum=0.000, Maximum=213.000, Mean=22.754, StdDev=25.124Pedro Sousahttps://www.blogger.com/profile/17058685497255714267noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-66310679358105248662017-02-24T02:14:28.629+00:002017-02-24T02:14:28.629+00:00Hello, this is a wonderful article! Do you have an...Hello, this is a wonderful article! Do you have any idea of how to find the min/max elevation data from the geotiff data set? I am trying to normalize the data set in order to use as a heightmap (which requires values between 0 and 1). Currently I am manually finding the min/max while reading in the raw elevation data, but this seems horribly inefficient.<br /><br />Thanks! gillen033https://www.blogger.com/profile/10440754971800316096noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-34972888849389105982016-04-01T18:57:21.870+01:002016-04-01T18:57:21.870+01:00Interesting question indeed. I'm using python ...Interesting question indeed. I'm using python with libtiff (and sometimes Delphi with LibTiffDelphi). I'm used to add a *.tfw file or world file to my tiff file. That *.tfw file seems to also contain the same data as stored in ModelPixelScaleTag and ModelTiepointTag. And yes, using gdalinfo to scan the file I see this:<br />GEOGCS["WGS 84",<br />DATUM["WGS_1984",<br />SPHEROID["WGS 84",6378137,298.257223563,<br />AUTHORITY["EPSG","7030"]],<br />AUTHORITY["EPSG","6326"]],<br />PRIMEM["Greenwich",0],<br />UNIT["degree",0.0174532925199433],<br />AUTHORITY["EPSG","4326"]]<br />I saw more tags mentioned on this webpage and I tried to retrieve them: http://www.awaresystems.be/imaging/tiff/tifftags/private.html<br />The tags are called ModelTransformationTag, GeoKeyDirectoryTag, GeoDoubleParamsTag and GeoAsciiParamsTag. When I read them with libtiff from the same TIFF file (written by GDAL) as I scanned with gdalinfo, I get:<br />None<br />[1, 1, 0, 7, 1024, 0, 1, 2, 1025, 0, 1, 1, 2048, 0, 1, 4326, 2049, 34737, 13, 0, 2054, 0, 1, 9102, 2057, 34736, 1, 1, 2059, 34736, 1, 0]<br />1.94734590925e-317<br />GCS_WGS_1984|<br />The last line seems to contain truncated information. Not sure I understand the rest of the output, but hopefully we can learn how to retrieve this kind of data further and to make sense out of such data? Regards ...Stevie B. Wonderhttps://www.blogger.com/profile/07061612725790762952noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-81295892936544499942015-10-05T15:11:46.762+01:002015-10-05T15:11:46.762+01:00Hello,
Thanks a lot for the post. It was a great ...Hello,<br /><br />Thanks a lot for the post. It was a great help for something that I needed to do. I do have one question though. Is there any way to extract the following information from the GeoTiff file using libtiff.net?<br /><br />GEOGCS["WGS 84",<br /> DATUM["WGS_1984",<br /> SPHEROID["WGS 84",6378137,298.257223563,<br /><br />Right now I am working with a workaround by calling gdalinfo from inside C# code and parsing the resultant output. It would be really great if libtiff.net offers such a provision. I have looked through the documentation but could not see any information on this. Any ideas??? Thanks a lot in advance.<br /><br />Rashid.Anonymoushttps://www.blogger.com/profile/18089087175390182837noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-14333100530753365742015-05-28T10:47:16.587+01:002015-05-28T10:47:16.587+01:00Haven't really tried it, but the lib does supp...Haven't really tried it, but the lib does support writing tiff files: https://bitmiracle.github.io/libtiff.net/?topic=html/e4f25423-eede-4ef6-a920-9cb539d056c6.htm<br /><br />So I'm guessing it's just the matter of setting the correct tags for getodata.<br />Pedro Sousahttps://www.blogger.com/profile/17058685497255714267noreply@blogger.comtag:blogger.com,1999:blog-6029629494508626591.post-9754554413562237952015-05-28T08:19:19.294+01:002015-05-28T08:19:19.294+01:00how setting geodata to file?how setting geodata to file?Anonymoushttps://www.blogger.com/profile/16682425278437676138noreply@blogger.com