Atmospheric correction of LANDSAT8 satellites at present, there are many scholars are doing, casually Baidu can find a lot of papers, proposed algorithms have their own bright spots, academic research has meaning.
However, the problem comes, if you want to really take out any image of a Landsat8, with engineering data processing ability, and the average result accuracy is widely recognized algorithm program, choose Which?
Currently, I think the preferred Usgs-eros project espa-surface-reflectance in the LASRC Version 1.3.0 module. The organization is strong enough, the project is big, Eric Vermote participates in the algorithm. Well, do the atmospheric correction know this man's bar.
The code is hosted on Git
(https://github.com/USGS-EROS/espa-surface-reflectance).
Chinese love to use the Windows platform, the project needs, but LASRC is the Linux platform, because also rely on the Espa-product_formatter algorithm library, its documents more detailed, related files, codes and other information are in (https://github.com/ Usgs-eros/espa-product-formatter), the algorithm library also relies on JPEG, ZLIB, TIFF, GeoTIFF, HDF4, GCTP, Hdf-eos2, XML2, JBIG, Land/water static p Olygon a total of 10 packages or files, plus a large number of cross-platform function replacements in the code. So it took me nearly a week to do my work on porting windows ....
It feels necessary to record it here.
LASRC Version 1.3.0 Release Notes
Release Date:september 2017
Downloads
LASRC (Landsat Surface reflectance code) source code
git clone https://github.com/USGS-EROS/espa-surface-reflectance.git
LASRC Auxiliary Files
http://edclpdsftp.cr.usgs.gov/downloads/auxiliaries/lasrc_auxiliary/lasrc_aux.2013-2017.tar.gz
See git tag [lasrc-version_1.3.0]
The auxiliary packages that are downloaded hereasrc_aux.2013-2017.tar.gz
有
90G
。。。教育网渣网速下载了整整一周。。。。
下载
espa-product-formatter
,找到里面的三个
c
库项目:
common
、
format_conversion_libs
、
io_libs
。编译
LASRC only use these three libraries.
Download LASRC, locate the C library code, under the Espa-surface-reflectance-master\lasrc\c_version\src folder.
Open vs2010, create a new C + + Empty Project, add the code files of all the libraries above.
Add include and Lib:
Some of these libraries can be directly on the official web download to the Win64 bit of the package, some need to compile themselves, the problem is not small, but the debugging process took two days to resolve a bug, and finally found that the HDF4 Library and Hdf-eos2 library version does not match the problem, it is strongly recommended that you compile these two libraries, Note compile time to include on the GCTP Library, the official web download is not included ...
The following attempts to build the VS2010 solution, encountering the error individually:
Espa_metadata.h file 72nd Line code error int class ... It's also useful to name the variable name of the keyword ... Change class to Huclass. I have changed all the references.
PARSE_MATADATA.C the No. 2190 line of the file, the variable declaration xmlattrptr attr; should be placed at the beginning of the function, this is the standard C code ay.
In the No. 468 line of the espa_matadata.c file, the variable declaration and the 472-row variable declaration should be placed at the beginning of the function.
Xmlattrptr attr;
xmlnsptr ns = cur_node->nsdef;
The Convert_espa_to_netcdf.c file indicates that nc_byte is not defined, The reason is that the file includes the header file Netcdf.h file is not complete, the file is integrated in the HDF4 library version is too old, delete the file, from the NETCDF Vault website, a new library containing netcdf.h files. The new file is nearly 2000 lines old and less than 600 lines.
CONVERT_ESPA_TO_RAW_BINARY_BIP.C file 317 line pointer type error, before the FILE_BUF variable (char *), the code of this kind of memory application does not specify the type of situation a lot, slowly change it ...
CONVERT_ESPA_TO_HDF.C file 84 is an undeclared identifier, you check the Hdfeos library version number, and fill out a 2.19.
snprintf all replaced with _snprintf, or in front of all header files, add
#if_MSC_VER
#define SNPRINTF _snprintf
#endif
The Write_global_attributes function redefined errors in convert_espa_to_hdf.h and convert_espa_to_netcdf.h.
Modify one of the function names, fortunately the function is called once, easy to replace.
With the vs2010, even the ROUNDF function is not ... Swap all 6 call positions for the original number plus 0.5 to truncate the rounding.
GET_ARGS.C file cannot find Getopt_long function error, change # include <getopt.h> to # include "Getopt.h",
GetOpt.h is a GNU standard library header file that contains some tools for extracting parameters from the command line for text-based C + + applications. Because Getopt.h is not part of the ANSI C standard library, getopt must be compiled into every project that uses it, or compile it down to a static class, explicitly linked to the program. The C-based getopt library implementation is also available on the CodeProject website, and the download URL is:
Http://www.codeproject.com/Articles/157001/Full-getopt-Port-for-Unicode-and-Multibyte-Microso
Download:
Find Getopt.h, getopt.c, tailor.h three files added to the project.
Compilation succeeded:
Usgs-eros Project Espa-surface-reflectance in LASRC version 1.3.0 module using VS2010 to compile WINDOWS64 bit versions (i)