Skip to content

Commit

Permalink
2.9: use mean in coordinate deformation
Browse files Browse the repository at this point in the history
  • Loading branch information
zvezdochiot committed Dec 18, 2021
1 parent 699699a commit d77fbff
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 26 deletions.
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ REL = 2
PREFIX = /usr/local
INSTALL = install
LN = ln -fs
GROFF2PDF = groff -m man -T pdf
RM = rm -f

.PHONY: all clean install

all: $(PROGS)

clean:
rm -f $(PROGS)
$(RM) $(PROGS) man_*.pdf

$(PROGNAME1): $(SRCS)/$(PROGNAME1).c
$(CPP) $(CFLAGS) $^ -o $@ $(LIBS)
Expand All @@ -37,6 +39,23 @@ $(PROGNAME4): $(SRCS)/$(PROGNAME4).c
$(PROGNAME5): $(SRCS)/$(PROGNAME5).c
$(CPP) $(CFLAGS) $^ -o $@ $(LIBS)

manual: man_$(PROGNAME1).pdf man_$(PROGNAME2).pdf man_$(PROGNAME3).pdf man_$(PROGNAME4).pdf man_$(PROGNAME5).pdf

man_$(PROGNAME1).pdf: man/man1/$(PROGNAME1).1
$(GROFF2PDF) $^ > $@

man_$(PROGNAME2).pdf: man/man1/$(PROGNAME2).1
$(GROFF2PDF) $^ > $@

man_$(PROGNAME3).pdf: man/man1/$(PROGNAME3).1
$(GROFF2PDF) $^ > $@

man_$(PROGNAME4).pdf: man/man1/$(PROGNAME4).1
$(GROFF2PDF) $^ > $@

man_$(PROGNAME5).pdf: man/man1/$(PROGNAME5).1
$(GROFF2PDF) $^ > $@

install: $(PROGS)
$(INSTALL) -d $(PREFIX)/bin
$(INSTALL) -m 0755 $(PROGS) $(PREFIX)/bin/
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ Exec finding unknown distances:

Result gpsout.dat:
```
Mean: 3
M 2508.9040 5588.8650 124.2887 2508.7340 5589.0163 124.5183
Deformation coordinate base: 3
(CONST)
A 2303.4430 5622.9030 149.3070 2302.8540 5623.2230 148.8560
Expand Down
16 changes: 16 additions & 0 deletions doc/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ Name: GeoFindKey
OldName: FindKey
URL: https://github.com/Geo-Linux-Calculations/geofindkey

2.9

use mean in coordinate deformation

2.8

add atmospheric refractive index

2.7

deformation of coordinates by the "unit spheres" method.

2.6

rescale to sea level

2.5

dZ of radius Earth
Expand Down
4 changes: 3 additions & 1 deletion man/man1/geodeform500.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoDeform500" 1 2.8 "15 Dec 2021" "User Manual"
.TH "GeoDeform500" 1 2.9 "19 Dec 2021" "User Manual"

.SH NAME
geodeform500
Expand Down Expand Up @@ -45,6 +45,8 @@ input-file
.TP
report-file
(sample):
Mean: 3
M 2508.9040 5588.8650 124.2887 2508.7340 5589.0163 124.5183
Deformation coordinate base: 3
(CONST)
A 2303.4430 5622.9030 149.3070 2302.8540 5623.2230 148.8560
Expand Down
2 changes: 1 addition & 1 deletion man/man1/geofindkey.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoFindKey" 1 2.8 "15 Dec 2021" "User Manual"
.TH "GeoFindKey" 1 2.9 "19 Dec 2021" "User Manual"

.SH NAME
geofindkey
Expand Down
2 changes: 1 addition & 1 deletion man/man1/geofindkey2p.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoFindKey2Pow" 1 2.8 "15 Dec 2021" "User Manual"
.TH "GeoFindKey2Pow" 1 2.9 "19 Dec 2021" "User Manual"

.SH NAME
geofindkey2p
Expand Down
2 changes: 1 addition & 1 deletion man/man1/geositer500.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoSIter500" 1 2.8 "15 Dec 2021" "User Manual"
.TH "GeoSIter500" 1 2.9 "19 Dec 2021" "User Manual"

.SH NAME
geositer500
Expand Down
2 changes: 1 addition & 1 deletion man/man1/geoszbtoyxh.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "GeoSZBtoYXH" 1 2.8 "15 Dec 2021" "User Manual"
.TH "GeoSZBtoYXH" 1 2.9 "19 Dec 2021" "User Manual"

.SH NAME
geoszbtoyxh
Expand Down
53 changes: 45 additions & 8 deletions src/geodeform500.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geodeform500.c
Version: 2.8
Date: 2021-12-15
Version: 2.9
Date: 2021-12-19
Author: zvezdochiot (https://github.com/zvezdochiot)
*
build:
Expand Down Expand Up @@ -30,6 +30,8 @@ C* 2748.808 5314.058 109.855
*
output file gpsout.dat:
*
Mean: 3
M 2508.9040 5588.8650 124.2887 2508.7340 5589.0163 124.5183
Deformation coordinate base: 3
(CONST)
A 2303.4430 5622.9030 149.3070 2302.8540 5623.2230 148.8560
Expand Down Expand Up @@ -57,7 +59,7 @@ C* 2748.8080 5314.0580 109.8550 2749.1000 5314.5570 110.5850
#include <unistd.h>

#define PNAME "GeoDeform500"
#define PVERSION "2.8"
#define PVERSION "2.9"

#define defEps 0.000001
#define defMode "CONST"
Expand Down Expand Up @@ -94,6 +96,8 @@ void geodeform500usage()
fprintf(stderr, " C* 2748.808 5314.058 109.855\n");
fprintf(stderr, "\n");
fprintf(stderr, "report-file(sample):\n");
fprintf(stderr, " Mean: 3\n");
fprintf(stderr, " M 2508.9040 5588.8650 124.2887 2508.7340 5589.0163 124.5183\n");
fprintf(stderr, " Deformation coordinate base: 3\n");
fprintf(stderr, " (CONST)\n");
fprintf(stderr, " A 2303.4430 5622.9030 149.3070 2302.8540 5623.2230 148.8560\n");
Expand All @@ -116,7 +120,7 @@ void geodeform500usage()
int main(int argc, char *argv[])
{
char buf[1024], name[32], format4[128], format7[128];
double x[3], y[3], wgt, dy[3];
double x[3], y[3], xcp[3], ycp[3], wgt, dy[3];
double xd[1500], dxd[1500], r2, r2d[500], w[500], s;
unsigned n, i, j, k;
int np;
Expand Down Expand Up @@ -175,6 +179,39 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}

for (j = 0; j < 3; j++)
{
xcp[j] = 0.0;
ycp[j] = 0.0;
}
n = 0;
s = 0;
while (fgets(buf, 1024, fp0) != NULL)
{
np = sscanf(buf, "%s %lf %lf %lf %lf %lf %lf %lf", name, &x[0], &x[1], &x[2], &y[0], &y[1], &y[2], &wgt);
if (np >= 8)
{
for (i = 0; i < 3; i++)
{
xcp[i] += (x[i] * wgt);
ycp[i] += (y[i] * wgt);
}
s += wgt;
n++;
}
}
if (s > 0.0)
{
for (j = 0; j < 3; j++)
{
xcp[j] /= s;
ycp[j] /= s;
}
}
fprintf(fp1, "Mean: %d\n", n);
fprintf(fp1, format7, "M", xcp[0], xcp[1], xcp[2], ycp[0], ycp[1], ycp[2]);
rewind(fp0);

n = 0;
for (j = 0; j < 1500; j++)
{
Expand All @@ -192,7 +229,7 @@ int main(int argc, char *argv[])
for (i = 0; i < 3; i++)
{
xd[j + i] = x[i];
dxd[j + i] = y[i] - x[i];
dxd[j + i] = (y[i] - ycp[i]) - (x[i] - xcp[i]);
r2 += (dxd[i + j] * dxd[i + j]);
}
r2d[n] = r2 * wgt;
Expand All @@ -210,7 +247,7 @@ int main(int argc, char *argv[])
np = sscanf(buf, "%s %lf %lf %lf %lf %lf %lf %lf", name, &x[0], &x[1], &x[2], &y[0], &y[1], &y[2], &wgt);
if (np >= 4)
{
s = 0;
s = 0.0;
for (i = 0; i < n; i++)
{
if (r2d[i] >= 0.0)
Expand All @@ -233,7 +270,7 @@ int main(int argc, char *argv[])
w[i] = 0.0;
}
}
if (s > 0)
if (s > 0.0)
{
s = 1.0 / s;
for (i = 0; i < n; i++)
Expand All @@ -249,7 +286,7 @@ int main(int argc, char *argv[])
dy[i] += dxd[k] * w[j];
k += 3;
}
y[i] = x[i] + dy[i];
y[i] = x[i] + dy[i] + (ycp[i] - xcp[i]);
}
}
else
Expand Down
6 changes: 3 additions & 3 deletions src/geofindkey.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Name: geofindkey.c
OldName: findkey.c
Version: 2.8
Date: 2021-12-15
Version: 2.9
Date: 2021-12-19
Author: Игорь Белов (https://gis-lab.info/forum/memberlist.php?mode=viewprofile&u=10457)
Author: zvezdochiot (https://github.com/zvezdochiot)
Author: Zoltan Siki (https://github.com/zsiki)
Expand Down Expand Up @@ -62,7 +62,7 @@ output file report.dat:
#include <unistd.h>

#define PNAME "GeoFindKey"
#define PVERSION "2.8"
#define PVERSION "2.9"

#define defMScale "NORM"
#define defREarth 6370009.0
Expand Down
6 changes: 3 additions & 3 deletions src/geofindkey2p.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geofindkey2p.c
Version: 2.8
Date: 2021-12-15
Version: 2.9
Date: 2021-12-19
Author: zvezdochiot (https://github.com/zvezdochiot)
*
build:
Expand Down Expand Up @@ -61,7 +61,7 @@ output file report.dat:
#include <unistd.h>

#define PNAME "GeoFindKey2Pow"
#define PVERSION "2.8"
#define PVERSION "2.9"

void geofindkey2ptitle()
{
Expand Down
6 changes: 3 additions & 3 deletions src/geositer500.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geositer500.c
Version: 2.8
Date: 2021-12-15
Version: 2.9
Date: 2021-12-19
Author: zvezdochiot (https://github.com/zvezdochiot)
Author: Zoltan Siki (https://github.com/zsiki)
*
Expand Down Expand Up @@ -54,7 +54,7 @@ OKD-12 3.8890 288.39138889 133.60805556
#include <unistd.h>

#define PNAME "GeoSIter500"
#define PVERSION "2.8"
#define PVERSION "2.9"

#define defREarth 6370009.0
#define defUnits "DEG"
Expand Down
6 changes: 3 additions & 3 deletions src/geoszbtoyxh.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Name: geoszbtoyxh.c
Version: 2.8
Date: 2021-12-15
Version: 2.9
Date: 2021-12-19
Author: zvezdochiot (https://github.com/zvezdochiot)
Author: Zoltan Siki (https://github.com/zsiki)
*
Expand Down Expand Up @@ -55,7 +55,7 @@ OKD-12 -2.6721 2.5453 1.2270
#include <unistd.h>

#define PNAME "GeoSZBtoYXH"
#define PVERSION "2.8"
#define PVERSION "2.9"

#define defREarth 6370009.0
#define defUnits "DEG"
Expand Down

0 comments on commit d77fbff

Please sign in to comment.