dr-ni / helmert3d

The 3D Helmert transformation is a frequently used method in geodesy to produce transformations between different Cartesian coordinate systems
http://helmparms3d.sourceforge.net/
Other
3 stars 8 forks source link

Release? #3

Closed zvezdochiot closed 3 years ago

zvezdochiot commented 3 years ago

:question: Release?

:link: See https://github.com/Geo-Linux-Calculations/helmparms3d/releases

dr-ni commented 3 years ago

I have made some changes again. Can you check if all is fine?

zvezdochiot commented 3 years ago

@dr-ni say:

Can you check if all is fine?

Everything is fine. But why so many commits? Do you make edits through the WEB-face?

See also:

dr-ni commented 3 years ago

Everything is fine. But why so many commits? Do you make edits through the WEB-face?

I'm working from different locations - also sometimes over web UI

cppcheck -v -f . 2>cppcheck.err splint *.c > splint.log

were these ok?

I prefere using valgrind. e.g. valgrind ./helmparms3d examples/testpoints_src.txt examples/testpoints_dest.txt examples/testpoints_params.txt valgrind ./helmert3d examples/testpoints_src.txt examples/testpoints_params.txt that was ok so far

uwe@rp4-sams:~/helmparms3d$ valgrind ./helmparms3d examples/testpoints_src.txt examples/testpoints_dest.txt examples/testpoints_params.txt
==2110== Memcheck, a memory error detector
==2110== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2110== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==2110== Command: ./helmparms3d examples/testpoints_src.txt examples/testpoints_dest.txt examples/testpoints_params.txt
==2110== 

examples/testpoints_src.txt:
4157222.5430000001 664789.3070000000 4774952.0990000004 
4149043.3360000001 688836.4430000000 4778632.1880000001 
4172803.5109999999 690340.0780000000 4758129.7010000004 
4177148.3760000002 642997.6350000000 4760764.7999999998 
4137012.1899999999 671808.0290000000 4791128.2149999999 
4146292.7289999998 666952.8870000000 4783859.8559999997 
4138759.9019999998 702670.7380000000 4785552.1960000005 

examples/testpoints_dest.txt:
4157870.2370000002 664818.6780000000 4775416.5240000002 
4149691.0490000001 688865.7850000000 4779096.5880000005 
4173451.3539999998 690369.3750000000 4758594.0750000002 
4177796.0639999998 643026.7000000000 4761228.8990000002 
4137659.5490000001 671837.3370000001 4791592.5310000004 
4146940.2280000001 666982.1510000000 4784324.0990000004 
4139407.5060000001 702700.2270000000 4786016.6449999996 

R =
1.0000000000 0.0000048146 -0.0000043328 
-0.0000048146 1.0000000000 -0.0000048409 
0.0000043327 0.0000048409 1.0000000000 

T =
641.8804120357 68.6553412730 416.3981803656 

s = 1.0000055825 (= 0.0000055825 ppm)

...done
==2110== 
==2110== HEAP SUMMARY:
==2110==     in use at exit: 0 bytes in 0 blocks
==2110==   total heap usage: 119 allocs, 119 frees, 65,520 bytes allocated
==2110== 
==2110== All heap blocks were freed -- no leaks are possible
==2110== 
==2110== For lists of detected and suppressed errors, rerun with: -s
==2110== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
uwe@rp4-sams:~/helmparms3d$ valgrind --leak-check=full --show-leak-kinds=all  ./helmert3d examples/testpoints_src.txt examples/testpoints_params.txt
==2565== Memcheck, a memory error detector
==2565== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2565== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==2565== Command: ./helmert3d examples/testpoints_src.txt examples/testpoints_params.txt
==2565== 

found 7 points
reading helmert parameters...
1.000000 0.000005 -0.000004
-0.000005 1.000000 -0.000005
0.000004 0.000005 1.000000
641.880412 68.655341 416.398180
1.000006
...done
starting transformation...
...done
Results written to transformed.xyz
==2565== 
==2565== HEAP SUMMARY:
==2565==     in use at exit: 0 bytes in 0 blocks
==2565==   total heap usage: 9 allocs, 9 frees, 19,296 bytes allocated
==2565== 
==2565== All heap blocks were freed -- no leaks are possible
==2565== 
==2565== For lists of detected and suppressed errors, rerun with: -s
==2565== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
zvezdochiot commented 3 years ago

@dr-ni say:

I prefere using valgrind.

Valgrind helps to catch leaks, but does not say anything about incorrect comparisons and type mismatches.

PS: Use markdown for code. See https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/basic-writing-and-formatting-syntax#quoting-code

dr-ni commented 3 years ago

my experiance is that valgrind complains also most of incorrect comparisons and type mismatches

did you do your proposed tests?

maybe pull again

zvezdochiot commented 3 years ago

@dr-ni say:

did you do your proposed tests?

Cppcheck is rude and only finds obvious bloopers. The log is empty.

Splint is very picky and has issued a lot of matrix operator warnings. I did not delve into it. But he is very picky and most of the warnings can be ignored. Now I can't make a log, only tomorrow.

dr-ni commented 3 years ago

ok

I have renamed the project, since its much more clear what its doing...

zvezdochiot commented 3 years ago

Hi @dr-ni .

Current commit: https://github.com/dr-ni/helmert3d/commit/d4c79c1c6ba47ff1ece4f2e6cb86ca9ba5565c8a

$ cd src
$ splint *.c > splint.log
Splint 3.1.2 --- 20 Feb 2009

Finished checking --- 126 code warnings

See splint.log: splint.log

dr-ni commented 3 years ago

Hi zvezdochiot, I'll go through the log later.

of course you can rebase all untill yesterday under "cleanup and improved error handling"

zvezdochiot commented 3 years ago

@dr-ni say:

of course you can rebase all untill yesterday

This will change little, the warnings will be the same. Splint is very picky. I ignore most of his warnings.

dr-ni commented 3 years ago

I have now made most of all splint fixes, can you check if all is ok for you?

If all is good - may be you can make some packages for win32 win64 osx-dmg deb-i386 rpm? I can make one for deb-armhf and deb-amd64.

...then we can include it to the release

zvezdochiot commented 3 years ago

Hi @dr-ni .

Current commit: https://github.com/dr-ni/helmert3d/commit/970fc7177f435e54d78fdfc89377a55a41a953ec

! :warning: !

$ ./helmparms3d examples/testpoints_src.txt examples/testpoints_dest.txt examples/testpoints_prms.txt 

See stdout: stdout.txt

$ splint *.c > splint.log
Splint 3.1.2 --- 20 Feb 2009

Finished checking --- 18 code warnings

See splint.log: splint.log

$ cppcheck -v -f . 2>cppcheck.err

cppcheck.err:

svdm.c:50:37: error: Invalid calloc() argument nr 1. The value is 0 but the valid values are '1:'. [invalidFunctionArg]
    double     *r = (double*)calloc(0, sizeof(double)*(size_t)n);
dr-ni commented 3 years ago

again some changes, can you check again?

zvezdochiot commented 3 years ago

Hi @dr-ni .

Current commit: https://github.com/dr-ni/helmert3d/commit/7f136f0d1d4517b5e4b6021362b547d99a31e3e4

$ splint *.c *.h > splint.log
Splint 3.1.2 --- 20 Feb 2009

Finished checking --- 16 code warnings

See splint.log: splint.log

dr-ni commented 3 years ago

and cppcheck -v -f .:

Checking helmert3d.c ...
Defines:
Undefines:
Includes:
Platform:Native
1/3 files checked 20% done
Checking helmparms3d.c ...
Defines:
Undefines:
Includes:
Platform:Native
2/3 files checked 66% done
Checking svdm.c ...
Defines:
Undefines:
Includes:
Platform:Native
3/3 files checked 100% done

may be you can make some packages for win32 win64 osx-dmg deb-i386 rpm? I can make one for deb-armhf and deb-amd64...

zvezdochiot commented 3 years ago

Hi @dr-ni .

Make release 1.0.0. I'll add win32 and deb-i386 to it.

dr-ni commented 3 years ago

ok

dr-ni commented 3 years ago

have fond an inconsistent path in your deb:

in Makefile and man the examples are in /usr/local/share/helmparms3d in your deb /usr/share/doc/helmparms3d/examples

shall we change the release or the deb?

zvezdochiot commented 3 years ago

Hi @dr-ni .

I used the standard paths scheme for packager. Later I will bring it into line with man or make symlinks.

PS: This is just one of the problems with using absolute paths. Therefore, I did not use them.

dr-ni commented 3 years ago

the best solution would be using autogen autoconf automake etc... but I have not so much experience with that

zvezdochiot commented 3 years ago

@dr-ni say:

the best solution would be using autogen autoconf automake etc...

Nonsense! Under Win even the simplest thing is tortured to collect. For such utilities, the Makefile is more than sufficient.

dr-ni commented 3 years ago

ok I like also clear Makefiles much more, however - we cannot prepare a Makefile for all systems.

I cannot run the win32 bins in wine. How did you bild them? ther is also an issue while checking on

https://www.virustotal.com/gui/file/a8df9c7566afc1aa00569e9ea5c052567117f2a8536a85c70be850b70bfa82ea/detection

https://www.virustotal.com/gui/file/6f2bb9a7bf857b6ce1a3dbab918372d190e10f4328381cd4bf83e4b8e00dfec7/detection

zvezdochiot commented 3 years ago

@dr-ni say:

I cannot run the win32 bins in wine. How did you bild them?

Due to problems with web-face github.com, I have one Win10 machine.

Bkav

He even finds something that is not there. And this is due to the incorrect fprintf under Win.

helmert3d-1.0.0-win32>make
gcc -Wall -O2 -o helmert3d src/helmert3d.c -lm
src/helmert3d.c: In function 'main':
src/helmert3d.c:90:28: warning: unknown conversion type character 'z' in format [-Wformat=]
   90 |     fprintf(stdout,"Found %zu points\n",l);
      |                            ^
src/helmert3d.c:90:20: warning: too many arguments for format [-Wformat-extra-args]
   90 |     fprintf(stdout,"Found %zu points\n",l);
      |                    ^~~~~~~~~~~~~~~~~~~~
src/helmert3d.c:90:28: warning: unknown conversion type character 'z' in format [-Wformat=]
   90 |     fprintf(stdout,"Found %zu points\n",l);
      |                            ^
src/helmert3d.c:90:20: warning: too many arguments for format [-Wformat-extra-args]
   90 |     fprintf(stdout,"Found %zu points\n",l);
      |                    ^~~~~~~~~~~~~~~~~~~~
gcc -Wall -O2 -o helmparms3d src/helmparms3d.c src/svdm.c -lm
dr-ni commented 3 years ago

have made a new asset using mingw, however even worse fond now 11 issues but included also man pdf do you think %zu changing to %lu helps? are exe files running?


$ wine helmert3d.exe testpoints_src.txt pa 
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key
*******************************
*      helmert3d v1.0.0       *
*   (c) U. Niethammer 2020    *
*******************************
Reading points...
Found zu points
Reading helmert parameters...
1.000000 0.000005 -0.000004
-0.000005 1.000000 -0.000005
0.000004 0.000005 1.000000
641.880425 68.655345 416.398185
1.000006
...done
Starting transformation...
...done
Results written to transformed.xyz
$ wine helmert3d.exe testpoints_src.txt pa 
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key
*******************************
*      helmert3d v1.0.0       *
*   (c) U. Niethammer 2020    *
*******************************
Reading points...
Found 7 points
Reading helmert parameters...
1.000000 0.000005 -0.000004
-0.000005 1.000000 -0.000005
0.000004 0.000005 1.000000
641.880425 68.655345 416.398185
1.000006
...done
Starting transformation...
...done
Results written to transformed.xyz

%lu did help for mingw exe

is comitted... can you make again win32 with man pdf's?

zvezdochiot commented 3 years ago

@dr-ni say:

can you make again win32 with man pdf's?

:question: What for?

dr-ni commented 3 years ago

a correct working helmert3d...

zvezdochiot commented 3 years ago

@dr-ni say:

a correct working helmert3d...

And what was wrong in the commit (https://github.com/dr-ni/helmert3d/commit/92007b49af2358e3ccbf913f2572054a460b012a)? Has the result changed?

PS: I don't take part in flea catching. Who needs it?

dr-ni commented 3 years ago

pdfs are already in the new win32 asset


%zu was wrong


716e5dfc3a2b100aac231042e01cc4c7a10bc064

zvezdochiot commented 3 years ago

@dr-ni say:

716e5dfc3a2b100aac231042e01cc4c7a10bc064

helmert3d-master>make
gcc -Wall -O2 -o helmert3d src/helmert3d.c -lm
gcc -Wall -O2 -o helmparms3d src/helmparms3d.c src/svdm.c -lm

Win10, gcc 32bits

>gcc --version
gcc (GCC) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
dr-ni commented 3 years ago

still the same exe in your upload?

$ wine helmert3d.exe testpoints_src.txt pa 
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key
Reading points...
Found zu points
Reading helmert parameters...
1.000000 0.000005 -0.000004
-0.000005 1.000000 -0.000005
0.000004 0.000005 1.000000
641.880425 68.655345 416.398185
1.000006
...done
Starting transformation...
...done
Results written to transformed.xyz
zvezdochiot commented 3 years ago

@dr-ni say:

still the same exe in your upload?

https://github.com/dr-ni/helmert3d/releases/download/v1.0.0/helmert3d-1.0.0-win32.zip

PS: You do not need PDFs, but a link to open the console in the desired folder (the most common question for console tools: How to start them?)