Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ff66ac

Browse files
authored
Merge pull request#1 from msdemlei/add-moc
Add multi-order coverage (MOC) support to pgsphere
2 parentsb9b4431 +8d8d99e commit7ff66ac

File tree

107 files changed

+30039
-1250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+30039
-1250
lines changed

‎.gitignore‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
*.bc
12
*.o
23
*.so
34
/*.sql
4-
/results
5+
/doc/html/
6+
/doc/pg_sphere.dsl
7+
/results/
58
regression.out
6-
regression.diffs
9+
regression.diffs
10+
tags

‎.gitlab-ci.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
stages:
2+
-build
3+
4+
.build:&build
5+
stage:build
6+
image:credativ/postgresql-build:${PGVERSION}
7+
before_script:
8+
-apt-get -y install libhealpix-cxx-dev docbook-dsssl docbook-xml openjade
9+
script:
10+
-make PROFILE="-Werror"
11+
-make install
12+
-if ! pg_virtualenv make installcheck; then cat regression.diffs; exit 1; fi
13+
-make -C doc
14+
-make -C doc install
15+
16+
build:9.4:{ <<: *build, variables: { PGVERSION: '9.4' } }
17+
build:9.5:{ <<: *build, variables: { PGVERSION: '9.5' } }
18+
build:9.6:{ <<: *build, variables: { PGVERSION: '9.6' } }
19+
build:10:{ <<: *build, variables: { PGVERSION: '10' } }
20+
build:11:{ <<: *build, variables: { PGVERSION: '11' } }
21+
build:12:{ <<: *build, variables: { PGVERSION: '12' } }
22+
build:13:{ <<: *build, variables: { PGVERSION: '13' } }

‎.travis.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# run the testsuite on travis-ci.com
2+
---
3+
# versions to run on
4+
env:
5+
-PG_SUPPORTED_VERSIONS=9.4# introduces psprintf
6+
-PG_SUPPORTED_VERSIONS=9.5
7+
-PG_SUPPORTED_VERSIONS=9.6
8+
-PG_SUPPORTED_VERSIONS=10
9+
-PG_SUPPORTED_VERSIONS=11
10+
-PG_SUPPORTED_VERSIONS=12
11+
-PG_SUPPORTED_VERSIONS=13
12+
13+
language:C
14+
dist:bionic
15+
16+
before_install:
17+
# extra apt.pg.o.sh options added in version 204, travis currently has 199 (2019-11-27)
18+
-sudo apt-get -qq update
19+
-sudo apt-get -y install postgresql-common libhealpix-cxx-dev docbook-dsssl docbook-xml openjade
20+
21+
install:
22+
-sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -p -v $PG_SUPPORTED_VERSIONS -i
23+
24+
script:
25+
-make PROFILE="-Werror"
26+
-sudo make install
27+
-pg_virtualenv make installcheck
28+
-if test -s regression.diffs; then cat regression.diffs; fi
29+
-make -C doc
30+
-sudo make -C doc install

‎Makefile‎

Lines changed: 162 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
PGSPHERE_VERSION = 1.1.5
1+
PGSPHERE_VERSION = 1.2.0
32

43
# the base dir name may be changed depending on git clone command
54
SRC_DIR =$(shell basename$(shell pwd))
@@ -8,24 +7,48 @@ MODULE_big = pg_sphere
87
OBJS = sscan.o sparse.o sbuffer.o vector3d.o point.o\
98
euler.o circle.o line.o ellipse.o polygon.o\
109
path.o box.o output.o gq_cache.o gist.o key.o\
11-
gnomo.o
10+
gnomo.o healpix.o moc.o process_moc.o healpix_bare/healpix_bare.o
1211

1312
EXTENSION = pg_sphere
14-
DATA_built = pg_sphere--1.0.sql
13+
RELEASE_SQL =$(EXTENSION)--$(PGSPHERE_VERSION).sql
14+
DATA_built =$(RELEASE_SQL)\
15+
pg_sphere--unpackaged--1.1.5beta0gavo.sql\
16+
pg_sphere--1.0--1.0_gavo.sql\
17+
pg_sphere--1.0_gavo--1.1.5beta0gavo.sql\
18+
pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql\
19+
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql\
20+
pg_sphere--1.1.5beta4gavo--1.2.0.sql
21+
1522
DOCS = README.pg_sphere COPYRIGHT.pg_sphere
1623
REGRESS = init tables points euler circle line ellipse poly path box index\
17-
contains_ops contains_ops_compat bounding_box_gist gnomo
24+
contains_ops contains_ops_compat bounding_box_gist gnomo healpix\
25+
moc
26+
27+
REGRESS_9_5 = index_9.5# experimental for spoint3
28+
29+
TESTS = init_test tables points euler circle line ellipse poly path box index\
30+
contains_ops contains_ops_compat bounding_box_gist gnomo healpix\
31+
moc
32+
33+
ifndefCXXFLAGS
34+
# no support for CXXFLAGS in PGXS before v11
35+
CXXFLAGS = -Wall -Wpointer-arith -Wendif-labels\
36+
-Wmissing-format-attribute -Wformat-security -g -O2 -fPIC
37+
endif
1838

19-
EXTRA_CLEAN =pg_sphere--1.0.sql$(PGS_SQL)
39+
EXTRA_CLEAN =$(PGS_SQL)pg_sphere.test.sql
2040

21-
CRUSH_TESTS= init_extended circle_extended
41+
CRUSH_TESTS = init_extended circle_extended
2242

2343
# order of sql files is important
24-
PGS_SQL= pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql\
44+
PGS_SQL = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql\
2545
pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql\
2646
pgs_box.sql pgs_contains_ops.sql pgs_contains_ops_compat.sql\
2747
pgs_gist.sql gnomo.sql\
48+
healpix.sql pgs_gist_spoint3.sql pgs_moc_type.sql pgs_moc_compat.sql pgs_moc_ops.sql
49+
PGS_SQL_9_5 = pgs_9.5.sql# experimental for spoint3
2850

51+
USE_PGXS = 1
2952
ifdefUSE_PGXS
3053
ifndef PG_CONFIG
3154
PG_CONFIG := pg_config
@@ -40,11 +63,140 @@ else
4063
include$(top_srcdir)/contrib/contrib-global.mk
4164
endif
4265

66+
# compiler settings
67+
overrideCPPFLAGS += -I/usr/include/healpix_cxx
68+
SHLIB_LINK += -lhealpix_cxx
69+
LINK.shared = g++ -shared
70+
71+
# healpix_bare.c isn't ours so we refrain from fixing the warnings in there
72+
healpix_bare/healpix_bare.o : healpix_bare/healpix_bare.c
73+
$(COMPILE.c) -Wno-declaration-after-statement -o$@$^
74+
75+
# experimental for spoint3
76+
pg_version :=$(word 2,$(shell$(PG_CONFIG) --version))
77+
pg_version_9_5_plus =$(if$(filter-out 9.1% 9.2% 9.3% 9.4%,$(pg_version)),y,n)
78+
has_parallel =$(if$(filter-out 9.1% 9.2% 9.3% 9.4% 9.5%,$(pg_version)),y,n)
79+
has_explain_summary =$(if$(filter-out 9.%,$(pg_version)),y,n)
80+
#
81+
82+
## the use of spoint 3 is too experimental and preliminary:
83+
#ifeq ($(pg_version_9_5_plus),y)
84+
#REGRESS += $(REGRESS_9_5)
85+
#TESTS += $(REGRESS_9_5)
86+
#PGS_SQL += $(PGS_SQL_9_5)
87+
#endif
88+
4389
crushtest: REGRESS +=$(CRUSH_TESTS)
4490
crushtest: installcheck
4591

46-
pg_sphere--1.0.sql:$(addsuffix .in,$(PGS_SQL))
92+
ifeq ($(has_explain_summary),y)
93+
REGRESS += moc1 moc100
94+
endif
95+
96+
ifeq ($(pg_version_9_5_plus),y)
97+
PGS_TMP_DIR = --temp-instance=tmp_check
98+
else
99+
PGS_TMP_DIR = --temp-install=tmp_check --top-builddir=test_top_build_dir
100+
endif
101+
102+
test: pg_sphere.test.sql sql/init_test.sql
103+
$(pg_regress_installcheck)$(PGS_TMP_DIR)$(REGRESS_OPTS)$(TESTS)
104+
105+
pg_sphere.test.sql:$(RELEASE_SQL)$(shlib)
106+
tail -n+3$<| sed's,MODULE_PATHNAME,$(realpath $(shlib)),g'>$@
107+
108+
109+
$(RELEASE_SQL):$(addsuffix .in,$(RELEASE_SQL)$(PGS_SQL))
110+
cat$^>$@
111+
ifeq ($(has_parallel), n)
112+
sed -i -e '/PARALLEL/d' $@# version $(pg_version) does not have support for PARALLEL
113+
endif
114+
115+
# for "create extension from unpacked*":
116+
117+
UPGRADE_UNP_COMMON = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql\
118+
pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql\
119+
pgs_box.sql pgs_contains_ops_compat.sql pgs_gist.sql\
120+
pgs_gist_contains_ops.sql contains-ops-fixes-1.sql
121+
122+
AUGMENT_UNP_COMMON = upgrade_scripts/pgs_pre111.sql pgs_contains_ops.sql\
123+
gnomo.sql
124+
# for vanilla 1.1.1 users
125+
AUGMENT_UNP_111 =$(AUGMENT_UNP_COMMON) pgs_gist_pointkey.sql
126+
127+
# for 1.1.2+ users: 'from unpacked_1.1.2plus'
128+
AUGMENT_UNP_FOR_112plus =$(AUGMENT_UNP_COMMON)
129+
UPGRADE_UNP_FOR_112plus = pgs_gist_pointkey.sql pgs_gist_drop_spoint2.sql.in
130+
131+
# for "alter extension":
132+
133+
# TODO: add dynamic pl/pgsql to do perform an additional
134+
# "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5_from_before_2016-02-07';"
135+
# if required.
136+
#
137+
# default 1.0 (after 2016-02-07) -> 1.1.5
138+
UPGRADE_1_0_PRE_xxxxxx = contains-ops-fixes-2.sql
139+
# '1.1.5_from_2015-08-31'
140+
AUGMENT_1_0_PRE_AAF2D5 = pgs_contains_ops.sql gnomo.sql
141+
UPGRADE_1_0_PRE_AAF2D5 = contains-ops-fixes-1.sql pgs_gist_drop_spoint2.sql.in\
142+
pgs_gist_contains_ops.sql
143+
144+
# vanilla 'create from unpackaged' must assume 1.1.1
145+
# ...
146+
147+
# create "create extension from unpacked*" files
148+
149+
# create "alter extension" files
150+
151+
152+
ifeq ($(pg_version_9_5_plus),y)
153+
# 1.1.1.5 -> 1.1.5.1 for Postgres 9.5+ features
154+
else
155+
endif
156+
157+
# local stuff follows here, next will be "beta2"
158+
159+
AUGMENT_GAVO_111 =$(AUGMENT_UNP_111) healpix.sql# for vanilla 1.1.1 users
160+
UPGRADE_GAVO_111 =$(UPGRADE_UNP_COMMON)
161+
162+
# add new Healpix functions and experimental spoint3
163+
AUGMENT_FROM_GAVO = healpix.sql pgs_gist_spoint3.sql
164+
165+
AUGMENT_UNP_115B0G =$(AUGMENT_UNP_111)$(AUGMENT_FROM_GAVO)
166+
UPGRADE_UNP_115B0G =$(UPGRADE_UNP_COMMON)
167+
168+
AUGMENT_1_0_115B0G =$(AUGMENT_FROM_GAVO)
169+
UPGRADE_1_0_115B0G = contains-ops-fixes-2.sql pgs_gist_drop_spoint2.sql
170+
171+
# test installation 0
172+
pg_sphere--unpackaged--1.1.5beta0gavo.sql:$(addsuffix .in, \
173+
$(AUGMENT_GAVO_111) \
174+
$(addprefix upgrade_scripts/,$(UPGRADE_GAVO_111)))
175+
cat upgrade_scripts/$@.in$^>$@
176+
177+
# (The upgrade of test installation A has been completed.)
178+
179+
# test installation B (generic)
180+
pg_sphere--1.0--1.0_gavo.sql:# dummy upgrade to allow for descriptive names
181+
cat upgrade_scripts/$@.in>$@
182+
pg_sphere--1.0_gavo--1.1.5beta0gavo.sql:$(addsuffix .in, \
183+
$(AUGMENT_1_0_115B0G) \
184+
$(addprefix upgrade_scripts/,$(UPGRADE_1_0_115B0G)))
185+
cat upgrade_scripts/$@.in$^>$@
186+
187+
pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql: pgs_moc_type.sql.in
188+
cat upgrade_scripts/$@.in$^>$@
189+
190+
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql: pgs_moc_compat.sql.in
191+
cat upgrade_scripts/$@.in$^>$@
192+
193+
pg_sphere--1.1.5beta4gavo--1.2.0.sql: pgs_moc_ops.sql.in
47194
cat$^>$@
195+
ifeq ($(has_parallel), n)
196+
sed -i -e '/PARALLEL/d' $@# version $(pg_version) does not have support for PARALLEL
197+
endif
198+
199+
# end of local stuff
48200

49201
sscan.o : sparse.c
50202

@@ -64,4 +216,4 @@ endif
64216

65217
dist : clean sparse.c sscan.c
66218
find. -name'*~' -type f -exec rm {}\;
67-
cd ..&& tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS -czf pgsphere-$(PGSPHERE_VERSION).tar.gz$(SRC_DIR)&&cd -
219+
cd ..&& tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS --exclude .git -czf pgsphere-$(PGSPHERE_VERSION).tar.gz$(SRC_DIR)&&cd -

‎doc/Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
#----------------------------------------------------------------------------
66

7+
USE_PGXS = 1
78
ifdefUSE_PGXS
89
PG_CONFIG = pg_config
910
PGXS :=$(shell$(PG_CONFIG) --pgxs)
@@ -23,7 +24,7 @@ COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl
2324
endif
2425

2526
ifndefJADE
26-
JADE =jade
27+
JADE =openjade
2728
endif
2829
SGMLINCLUDE = -D$(srcdir)
2930

@@ -47,9 +48,9 @@ html : pg_sphere.xml $(ALLSGML) pg_sphere.dsl
4748
@rm -rf html
4849
mkdir html
4950
mkdir html/img
50-
cp img/*.jpg html/img
51+
cp img/*.jpgimg/*.pnghtml/img
5152
cp pg_sphere.css html
52-
$(JADE)$(JADEFLAGS)$(SGMLINCLUDE)$(CATALOG) -d pg_sphere.dsl -i html -t sgml$(XMLDCL)$<
53+
$(JADE)$(JADEFLAGS)$(SGMLINCLUDE)$(CATALOG) -b UTF-8 -d pg_sphere.dsl -i html -t sgml$(XMLDCL)$<
5354
mv*.html html
5455

5556
pg_sphere.tex : pg_sphere.xml$(ALLSGML) pg_sphere.dsl

‎doc/constructors.sgm‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,50 @@
405405
</example>
406406
</sect2>
407407

408+
<sect2 id="contr.smoc">
409+
<title>
410+
<type>smoc</type>
411+
</title>
412+
413+
<funcsynopsis>
414+
<funcprototype>
415+
<funcdef><function>smoc</function></funcdef>
416+
<paramdef><parameter>order</parameter> int</paramdef>
417+
<paramdef>spoint</paramdef>
418+
</funcprototype>
419+
</funcsynopsis>
420+
<para>
421+
creates a single-pixel <type>smoc</type> of the given order at <parameter>spoint</parameter>
422+
</para>
423+
424+
<funcsynopsis>
425+
<funcprototype>
426+
<funcdef><function>smoc_disc</function></funcdef>
427+
<paramdef><parameter>order</parameter> int</paramdef>
428+
<paramdef><parameter>lng</parameter> double precision</paramdef>
429+
<paramdef><parameter>lat</parameter> double precision</paramdef>
430+
<paramdef><parameter>radius</parameter> double precision</paramdef>
431+
</funcprototype>
432+
<funcprototype>
433+
<funcdef><function>smoc</function></funcdef>
434+
<paramdef><parameter>order</parameter> int</paramdef>
435+
<paramdef>scircle</paramdef>
436+
</funcprototype>
437+
</funcsynopsis>
438+
<para>
439+
creates an <type>smoc</type> of the given order covering the circle
440+
</para>
441+
442+
<funcsynopsis>
443+
<funcprototype>
444+
<funcdef><function>smoc</function></funcdef>
445+
<paramdef><parameter>order</parameter> int</paramdef>
446+
<paramdef>spoly</paramdef>
447+
</funcprototype>
448+
</funcsynopsis>
449+
<para>
450+
creates an <type>smoc</type> of the given order covering the spoly
451+
</para>
452+
</sect2>
453+
408454
</sect1>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp