[pktools] 146/375: replace projection option by a_srs
Bas Couwenberg
sebastic at xs4all.nl
Wed Dec 3 21:54:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
sebastic-guest pushed a commit to branch upstream-master
in repository pktools.
commit fab9ca5030f6431ccecc390c233b6f1e89a10bad
Author: Pieter Kempeneers <kempenep at gmail.com>
Date: Fri Nov 29 17:21:36 2013 +0100
replace projection option by a_srs
---
ChangeLog | 15 +++++++++++++--
doc/mainpage.dox | 3 +++
src/algorithms/StatFactory.h | 26 +++++++++++++++++---------
src/apps/pkascii2img.cc | 2 +-
src/apps/pkascii2ogr.cc | 2 +-
src/apps/pkcrop.cc | 2 +-
src/apps/pkinfo.cc | 2 +-
src/apps/pklas2img.cc | 4 ++--
src/apps/pkmosaic.cc | 2 +-
src/fileclasses/FileReaderAscii.cc | 8 ++++----
src/fileclasses/FileReaderAscii.h | 8 ++++----
11 files changed, 48 insertions(+), 26 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 30e7899..4847018 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -125,12 +125,24 @@ version 2.4.2
todo: remove redundancy in AM_LDFLAGS and LDADD
- PosValue.h
remove using namespace std;
+ - StatFactory.h
+ (interpolateUp): adapt to new version of GSL library, which does not support extrapolation. Currently no real extrapolation, but just solved by repeating first/last values
- FileReaderAscii
corrected error for constructor with fieldseparator argument
+ corrected type for npos (should be size_t)
+ - pkcrop
+ changed projection option to -a_srs conform to gdal utilities
+ - pkmosaic
+ changed projection option to -a_srs conform to gdal utilities
+ - pkascii2img
+ changed projection option to -a_srs conform to gdal utilities
+ - pkascii2ogr
+ changed projection option to -a_srs conform to gdal utilities
- pkdiff
introduced short option -m for mask
- pkinfo
bug fixed with -min and -max in hist (thanks to Giuseppe Amatuli for noticing)
+ changed projection option to -a_srs conform to gdal utilities
- pkfilter
new methods for scrambling and shifting images
update help info for support of of even kernel sizes
@@ -140,6 +152,7 @@ version 2.4.2
make histogram more similar to pkstat with support of relative option
- pklas2img
correct for wrong include path for FileReaderLas.h (lasclasses instead of fileclasses)
+ changed projection option to -a_srs conform to gdal utilities
- pkfillnodata
default maximum distance changed from 3 to 0 (infinity)
- pkclassify_nn.h
@@ -160,5 +173,3 @@ version 2.4.2
- pkstat.cc->pkstatascii.cc
renamed to pkstatascii.cc to avoid confusion with raster data (e.g., pkinfo --stat)
support of transposed output
- - still todo
- change all projection options to a_srs
diff --git a/doc/mainpage.dox b/doc/mainpage.dox
index ac9a16b..0ebb610 100644
--- a/doc/mainpage.dox
+++ b/doc/mainpage.dox
@@ -54,11 +54,14 @@ Basic installation (please refer to INSTALL file for more advanced configuration
./configure
make
sudo make install
+sudo ldconfig
\endcode
Prerequisites (required)
------------------------
packages to install before pktool
+ - g++ (via repository)
+ - make (via repository)
- libgdal-dev http://trac.osgeo.org/gdal/wiki/BuildingOnUnix (or via repository)
- libgsl0-dev http://www.gnu.org/software/gsl/ (or via repository)
- libarmadillo-dev (http://arma.sourceforge.net/download.html or via repository)
diff --git a/src/algorithms/StatFactory.h b/src/algorithms/StatFactory.h
index ad8eef1..baef30c 100644
--- a/src/algorithms/StatFactory.h
+++ b/src/algorithms/StatFactory.h
@@ -671,16 +671,24 @@ template<class T> void StatFactory::interpolateUp(const std::vector<double>& wav
assert(&(input[0]));
initSpline(spline,&(wavelengthIn[0]),&(input[0]),nband);
for(int index=0;index<wavelengthOut.size();++index){
- if(type=="linear"){
- if(wavelengthOut[index]<wavelengthIn.back()){
- output.push_back(*(input.begin()));
- continue;
- }
- else if(wavelengthOut[index]>wavelengthIn.back()){
- output.push_back(input.back());
- continue;
- }
+ if(wavelengthOut[index]<wavelengthIn.back()){
+ output.push_back(*(input.begin()));
+ continue;
+ }
+ else if(wavelengthOut[index]>wavelengthIn.back()){
+ output.push_back(input.back());
+ continue;
}
+ // if(type=="linear"){
+ // if(wavelengthOut[index]<wavelengthIn.back()){
+ // output.push_back(*(input.begin()));
+ // continue;
+ // }
+ // else if(wavelengthOut[index]>wavelengthIn.back()){
+ // output.push_back(input.back());
+ // continue;
+ // }
+ // }
double dout=evalSpline(spline,wavelengthOut[index],acc);
output.push_back(dout);
}
diff --git a/src/apps/pkascii2img.cc b/src/apps/pkascii2img.cc
index d50993b..9d90bed 100644
--- a/src/apps/pkascii2img.cc
+++ b/src/apps/pkascii2img.cc
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
Optionpk<double> uly_opt("uly", "uly", "Upper left y value bounding box (in geocoordinates if georef is true)", 0.0);
Optionpk<double> dx_opt("dx", "dx", "Output resolution in x (in meter)");
Optionpk<double> dy_opt("dy", "dy", "Output resolution in y (in meter)");
- Optionpk<string> projection_opt("p", "projection", "projection string");
+ Optionpk<string> projection_opt("a_srs", "a_srs", "Override the projection for the output file");
Optionpk<string> colorTable_opt("ct", "ct", "color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)");
Optionpk<string> description_opt("d", "description", "Set image description");
Optionpk<bool> verbose_opt("v", "verbose", "verbose", false);
diff --git a/src/apps/pkascii2ogr.cc b/src/apps/pkascii2ogr.cc
index d7b2e3e..a502ce6 100644
--- a/src/apps/pkascii2ogr.cc
+++ b/src/apps/pkascii2ogr.cc
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
Optionpk<string> fname_opt("n", "name", "Field names for the columns in the input ascii file");
Optionpk<string> ftype_opt("ot", "ot", "Field type (Real, Integer, String) for each of the fields as defined by name","Real");
Optionpk<string> itype_opt("of", "of", "image type string", "ESRI Shapefile");
- Optionpk<string> projection_opt("p", "projection", "use EPSG:<code> or Wkt string", "EPSG:4326");
+ Optionpk<string> projection_opt("a_srs", "a_srs", "Override the projection for the output file, use epsg:<code> or Wkt string", "epsg:4326");
Optionpk<char> fs_opt("fs","fs","field separator.",' ');
Optionpk<int> verbose_opt("v", "verbose", "verbose (0)", 0);
diff --git a/src/apps/pkcrop.cc b/src/apps/pkcrop.cc
index c5cfbee..ea95ff3 100644
--- a/src/apps/pkcrop.cc
+++ b/src/apps/pkcrop.cc
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
{
Optionpk<string> input_opt("i", "input", "Input image file(s). If input contains multiple images, a multi-band output is created");
Optionpk<string> output_opt("o", "output", "Output image file");
- Optionpk<string> projection_opt("p", "projection", "projection in EPSG format (leave blank to copy from input file, use EPSG:3035 to use European projection and to force to European grid", "");
+ Optionpk<string> projection_opt("a_srs", "a_srs", "Override the projection for the output file (leave blank to copy from input file, use epsg:3035 to use European projection and force to European grid", "");
Optionpk<string> extent_opt("e", "extent", "get boundary from extent from polygons in vector file", "");
Optionpk<bool> mask_opt("m","mask","mask values out of polygon in extent file to flag option (tip: for better performance, use gdal_rasterize -i -burn 0 -l extent extent.shp output (with output the result of pkcrop)",false);
Optionpk<double> ulx_opt("ulx", "ulx", "Upper left x value bounding box (in geocoordinates if georef is true)", 0.0);
diff --git a/src/apps/pkinfo.cc b/src/apps/pkinfo.cc
index b53e89f..8d69a96 100644
--- a/src/apps/pkinfo.cc
+++ b/src/apps/pkinfo.cc
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
Optionpk<double> min_opt("min", "min", "Sets minimum for histogram");
Optionpk<double> max_opt("max", "max", "Sets maximum for histogram");
Optionpk<bool> relative_opt("rel", "rel", "Calculates relative histogram in percentage", false,0);
- Optionpk<bool> projection_opt("p", "projection", "Shows projection of the image ", false,0);
+ Optionpk<bool> projection_opt("a_srs", "a_srs", "Shows projection of the image ", false,0);
Optionpk<bool> geo_opt("geo", "geo", "Gets geotransform ", false,0);
Optionpk<bool> interleave_opt("il", "interleave", "Shows interleave ", false,0);
Optionpk<bool> filename_opt("f", "filename", "Shows image filename ", false,0);
diff --git a/src/apps/pklas2img.cc b/src/apps/pklas2img.cc
index 2a8c68c..e4b3e28 100644
--- a/src/apps/pklas2img.cc
+++ b/src/apps/pklas2img.cc
@@ -45,7 +45,7 @@ int main(int argc,char **argv) {
Optionpk<short> dimx_opt("\0", "dimX", "Dimension X of postFilter", 3);
Optionpk<short> dimy_opt("\0", "dimY", "Dimension Y of postFilter", 3);
Optionpk<string> output_opt("o", "output", "Output image file", "");
- Optionpk<string> projection_opt("p", "projection", "projection in EPSG code, e.g., EPSG:3035", "");
+ Optionpk<string> projection_opt("a_srs", "a_srs", "assign the projection for the output file in epsg code, e.g., epsg:3035 for European LAEA projection");
Optionpk<double> ulx_opt("\0", "ulx", "Upper left x value bounding box (in geocoordinates if georef is true). 0 is read from input file", 0.0);
Optionpk<double> uly_opt("\0", "uly", "Upper left y value bounding box (in geocoordinates if georef is true). 0 is read from input file", 0.0);
Optionpk<double> lrx_opt("\0", "lrx", "Lower right x value bounding box (in geocoordinates if georef is true). 0 is read from input file", 0.0);
@@ -205,7 +205,7 @@ int main(int argc,char **argv) {
outputWriter.open(output_opt[0],ncol,nrow,nband,theType,oformat_opt[0],option_opt);
//set projection
outputWriter.setGeoTransform(minULX,maxULY,dx_opt[0],dy_opt[0],0,0);
- if(projection_opt[0]!=""){
+ if(projection_opt.size()){
string projectionString=outputWriter.setProjectionProj4(projection_opt[0]);
if(verbose_opt[0])
cout << "projection: " << projectionString << endl;
diff --git a/src/apps/pkmosaic.cc b/src/apps/pkmosaic.cc
index 7bb4966..9fd8a68 100644
--- a/src/apps/pkmosaic.cc
+++ b/src/apps/pkmosaic.cc
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
{
Optionpk<string> input_opt("i", "input", "Input image file(s). If input contains multiple images, a multi-band output is created", "");
Optionpk<string> output_opt("o", "output", "Output image file", "");
- Optionpk<string> projection_opt("p", "projection", "projection in EPSG format (leave blank to copy from input file, use EPSG:3035 to use European projection and to force to European grid", "");
+ Optionpk<string> projection_opt("a_srs", "a_srs", "Override the projection for the output file (leave blank to copy from input file, use epsg:3035 to use European projection and force to European grid", "");
Optionpk<string> extent_opt("e", "extent", "get boundary from extent from polygons in vector file", "");
Optionpk<double> ulx_opt("ulx", "ulx", "Upper left x value bounding box (in geocoordinates if georef is true)", 0.0);
Optionpk<double> uly_opt("uly", "uly", "Upper left y value bounding box (in geocoordinates if georef is true)", 0.0);
diff --git a/src/fileclasses/FileReaderAscii.cc b/src/fileclasses/FileReaderAscii.cc
index dd110e8..f65b3ba 100644
--- a/src/fileclasses/FileReaderAscii.cc
+++ b/src/fileclasses/FileReaderAscii.cc
@@ -71,7 +71,7 @@ unsigned int FileReaderAscii::nrOfCol(bool checkCols, bool verbose){
while(getline(csvstream,item,m_fs)){//read a column
if(verbose)
std::cout << item << " ";
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
if(pos>0)
item=item.substr(0,pos-1);
@@ -115,7 +115,7 @@ unsigned int FileReaderAscii::nrOfCol(bool checkCols, bool verbose){
while(lineStream >> item){
if(verbose)
std::cout << item << " ";
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
if(pos>0)
item=item.substr(0,pos-1);
@@ -165,7 +165,7 @@ unsigned int FileReaderAscii::nrOfRow(bool checkCols, bool verbose){
while(getline(csvstream,item,m_fs)){//read a column
if(verbose)
std::cout << item << " ";
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
if(pos>0){
if(verbose)
@@ -208,7 +208,7 @@ unsigned int FileReaderAscii::nrOfRow(bool checkCols, bool verbose){
while(lineStream >> item){
if(verbose)
std::cout << item << " ";
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
if(pos>0){
if(verbose)
diff --git a/src/fileclasses/FileReaderAscii.h b/src/fileclasses/FileReaderAscii.h
index e407d1e..56cdb59 100644
--- a/src/fileclasses/FileReaderAscii.h
+++ b/src/fileclasses/FileReaderAscii.h
@@ -81,7 +81,7 @@ template<class T> unsigned int FileReaderAscii::readData(std::vector<T> &dataVec
while(getline(csvstream,item,m_fs)){//read a column
if(verbose)
std::cout << item << " ";
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
isComment=true;
if(pos>0)
@@ -134,7 +134,7 @@ template<class T> unsigned int FileReaderAscii::readData(std::vector<T> &dataVec
if(verbose)
std::cout << item << " ";
// std::istringstream itemStream(item);
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
isComment=true;
if(pos>0)
@@ -197,7 +197,7 @@ template<class T> unsigned int FileReaderAscii::readData(std::vector<std::vector
while(getline(csvstream,item,m_fs)){//read a column
if(verbose)
std::cout << item << " ";
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
isComment=true;
if(pos>0)
@@ -257,7 +257,7 @@ template<class T> unsigned int FileReaderAscii::readData(std::vector<std::vector
if(verbose)
std::cout << item << " ";
// std::istringstream itemStream(item);
- unsigned pos=item.find(m_comment);
+ size_t pos=item.find(m_comment);
if(pos!=std::string::npos){
isComment=true;
if(pos>0)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git
More information about the Pkg-grass-devel
mailing list