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

Add multi-order coverage (MOC) support to pgsphere#1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
feodor merged 80 commits intopostgrespro:masterfrommsdemlei:add-moc
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
80 commits
Select commitHold shift + click to select a range
bdc37d1
pgsphere_1.1.4.916
Jul 5, 2019
a02bfc8
comment fixes
Oct 29, 2017
a73c2f8
healpix_bare support added.
jontxuJul 11, 2019
113fe5e
Compatibility with PostgreSQL 11 for GAVO extensions
Jul 19, 2019
af1775a
init_test.out diffs
Jul 26, 2019
8a631b9
No longer putting .git into the tarball
msdemleiJul 22, 2019
6eabeb4
ignore past Chealpix oddities
Jul 26, 2019
eaf010b
Import healpix_bare 1.0
df7cbDec 3, 2019
a72a14a
Add .gitlab-ci.yml
df7cbDec 3, 2019
07cd808
Add alternate expected output file for PG12
df7cbDec 4, 2019
730184e
Ignore more build artifacts
df7cbDec 4, 2019
899b535
Makefile: Default to USE_PGXS
df7cbDec 4, 2019
ccbb153
Build healpix_bare directly from toplevel Makefile
df7cbDec 4, 2019
59d7825
Only override CXXFLAGS on PG10 and older
df7cbDec 4, 2019
f60104d
doc: Fix syntax of CREATE INDEX statement
df7cbNov 29, 2019
38b081b
Add .travis.yml
df7cbDec 5, 2019
bbff762
Bump version to 1.2.0 and implement smoc_union aka ||
df7cbDec 10, 2019
2fd90cf
Call add_to_map directly without going through add_to_moc
df7cbDec 11, 2019
414095b
Implement smoc_intersection aka *
df7cbDec 11, 2019
62e9cb8
sum() and intersection() aggregates
df7cbDec 11, 2019
5e7f90b
Implement = and <> on smoc
df7cbDec 12, 2019
d697926
Add smoc_disc(order, theta, phi, radius)
df7cbDec 18, 2019
bde580f
Upgrade travis to bionic to get newer libhealpix-cxx-dev
df7cbDec 18, 2019
0385c53
Remove unused empty file
df7cbDec 19, 2019
8536ff1
Use | and & for moc union and intersection
df7cbDec 19, 2019
f018d4f
Variables cleanup
df7cbDec 19, 2019
6068898
Check order in smoc_disc
df7cbDec 19, 2019
15a2438
create_moc_release_context always returns 1, change to void and remov…
df7cbDec 19, 2019
f26c86f
Implement smoc-from-scircle, and swap order of arguments in smoc_disc
df7cbDec 19, 2019
ebeda07
Implement smoc overlap
df7cbJan 20, 2020
77b4129
Fix variable declaration warnings
df7cbJan 20, 2020
1d2ff8b
Run tests with -Werror
df7cbJan 20, 2020
532f79e
Add missing function prototypes
df7cbJan 20, 2020
6849860
Simplify linking with g++
df7cbJan 22, 2020
084fe50
Makefile: Suppress declaration-after-statement in healpix_bare.c
df7cbJan 22, 2020
01c9915
Refresh sparse.c and sscan.c
df7cbJan 22, 2020
ebcaf05
Add IMMUTABLE and PARALLEL SAFE decorators to moc functions
df7cbJan 22, 2020
139c7a4
Ignore tags file
df7cbJan 22, 2020
22b598b
Move conv_theta and math constants to new header pgs_util.h
df7cbJan 23, 2020
999a62d
Implement smoc(order, spoly)::smoc
df7cbJan 23, 2020
28e2bf5
Comment all functions and operators
df7cbJan 23, 2020
672a949
Add smoc subset operators
df7cbJan 23, 2020
3af7c0e
Use query_*_inclusive and add more test cases
df7cbJan 24, 2020
cf1aba9
Fix format warning on 32 bit
df7cbJan 29, 2020
f4d5683
Fix spoly detoasting in smoc_spoly()
df7cbJan 29, 2020
23b7338
Drop MOC_FORMAT_64X and obsolete code using it
df7cbJan 30, 2020
76e47dd
Add smoc_info() function
df7cbJan 30, 2020
df29542
Remove redundant variable
df7cbJan 30, 2020
1e87b8b
Speed up smoc_eq by detoasting header only first
df7cbJan 30, 2020
c140f67
Test equality on a large smoc
df7cbJan 31, 2020
fbe38aa
Speed up overlaps operation by looking at the smoc header first
df7cbJan 31, 2020
33807c7
Speed up subset operations by looking at the smoc header first
df7cbJan 31, 2020
f855597
Add smoc rounding function that converts smocs to lower order
df7cbFeb 4, 2020
0fe578d
Test smoc_round on level 0
df7cbFeb 5, 2020
3fece18
GIN index support
df7cbFeb 7, 2020
98fc1ba
GIN: check && 'empty'
df7cbFeb 20, 2020
6335bfe
Use space as moc interval separator as per recent standards
df7cbFeb 25, 2020
686e018
Implement subset/superset for GIN
df7cbFeb 27, 2020
43d5734
Rename smoc_round to smoc_degrade
df7cbFeb 27, 2020
c289a46
Refactor gin_extact functions
df7cbMar 31, 2020
403da2c
Add a second gin opclass smoc_gin_ops_fine using level 8
df7cbMar 31, 2020
27708bd
Add smoc(order, spoint) function
df7cbApr 1, 2020
3c51f93
Store original moc order
df7cbApr 8, 2020
1ed597a
Include stored moc order in output
df7cbApr 8, 2020
229b55a
Catch PlanckError
df7cbApr 9, 2020
4c86b29
doc/Makefile: Default to USE_PGXS and openjade, and build docs during…
df7cbApr 9, 2020
32533d1
PG13 compatibility
df7cbJun 2, 2020
ae87e3a
doc: smoc type
df7cbJun 2, 2020
c5433d3
smoc documentation
df7cbJun 4, 2020
eb27a2f
Support equality lookups
df7cbJun 4, 2020
875154c
Implement inequality index lookups
df7cbJun 5, 2020
8526665
Remove beta README.GAVO file
df7cbJun 19, 2020
b7eb98e
Expand docs with more smoc details
df7cbJun 19, 2020
9c91983
Rename smoc_area to area and make it return steradians
df7cbJun 19, 2020
229527c
moc: Fix regression test deviation on i386
df7cbAug 21, 2020
91612c5
Fix smoc_degrade bitmask on 32bit
df7cbAug 21, 2020
b3c6d55
Rename internal function moc_round to moc_degrade for consistency
df7cbAug 21, 2020
9bb202c
Fix gin key extraction on 32bit
df7cbAug 21, 2020
18e6ddb
Accept varying moc100 regression output on 32bit
df7cbAug 21, 2020
8d8d99e
Add new expected output files for PG13
df7cbSep 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
*.bc
*.o
*.so
/*.sql
/results
/doc/html/
/doc/pg_sphere.dsl
/results/
regression.out
regression.diffs
regression.diffs
tags
22 changes: 22 additions & 0 deletions.gitlab-ci.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
stages:
- build

.build: &build
stage: build
image: credativ/postgresql-build:${PGVERSION}
before_script:
- apt-get -y install libhealpix-cxx-dev docbook-dsssl docbook-xml openjade
script:
- make PROFILE="-Werror"
- make install
- if ! pg_virtualenv make installcheck; then cat regression.diffs; exit 1; fi
- make -C doc
- make -C doc install

build:9.4: { <<: *build, variables: { PGVERSION: '9.4' } }
build:9.5: { <<: *build, variables: { PGVERSION: '9.5' } }
build:9.6: { <<: *build, variables: { PGVERSION: '9.6' } }
build:10: { <<: *build, variables: { PGVERSION: '10' } }
build:11: { <<: *build, variables: { PGVERSION: '11' } }
build:12: { <<: *build, variables: { PGVERSION: '12' } }
build:13: { <<: *build, variables: { PGVERSION: '13' } }
30 changes: 30 additions & 0 deletions.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
# run the testsuite on travis-ci.com
---
# versions to run on
env:
- PG_SUPPORTED_VERSIONS=9.4 # introduces psprintf
- PG_SUPPORTED_VERSIONS=9.5
- PG_SUPPORTED_VERSIONS=9.6
- PG_SUPPORTED_VERSIONS=10
- PG_SUPPORTED_VERSIONS=11
- PG_SUPPORTED_VERSIONS=12
- PG_SUPPORTED_VERSIONS=13

language: C
dist: bionic

before_install:
# extra apt.pg.o.sh options added in version 204, travis currently has 199 (2019-11-27)
- sudo apt-get -qq update
- sudo apt-get -y install postgresql-common libhealpix-cxx-dev docbook-dsssl docbook-xml openjade

install:
- sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -p -v $PG_SUPPORTED_VERSIONS -i

script:
- make PROFILE="-Werror"
- sudo make install
- pg_virtualenv make installcheck
- if test -s regression.diffs; then cat regression.diffs; fi
- make -C doc
- sudo make -C doc install
172 changes: 162 additions & 10 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@

PGSPHERE_VERSION = 1.1.5
PGSPHERE_VERSION = 1.2.0

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

EXTENSION = pg_sphere
DATA_built = pg_sphere--1.0.sql
RELEASE_SQL = $(EXTENSION)--$(PGSPHERE_VERSION).sql
DATA_built = $(RELEASE_SQL) \
pg_sphere--unpackaged--1.1.5beta0gavo.sql \
pg_sphere--1.0--1.0_gavo.sql \
pg_sphere--1.0_gavo--1.1.5beta0gavo.sql \
pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql \
pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql \
pg_sphere--1.1.5beta4gavo--1.2.0.sql

DOCS = README.pg_sphere COPYRIGHT.pg_sphere
REGRESS = init tables points euler circle line ellipse poly path box index \
contains_ops contains_ops_compat bounding_box_gist gnomo
contains_ops contains_ops_compat bounding_box_gist gnomo healpix \
moc

REGRESS_9_5 = index_9.5 # experimental for spoint3

TESTS = init_test tables points euler circle line ellipse poly path box index \
contains_ops contains_ops_compat bounding_box_gist gnomo healpix \
moc

ifndef CXXFLAGS
# no support for CXXFLAGS in PGXS before v11
CXXFLAGS = -Wall -Wpointer-arith -Wendif-labels \
-Wmissing-format-attribute -Wformat-security -g -O2 -fPIC
endif

EXTRA_CLEAN =pg_sphere--1.0.sql$(PGS_SQL)
EXTRA_CLEAN = $(PGS_SQL)pg_sphere.test.sql

CRUSH_TESTS= init_extended circle_extended
CRUSH_TESTS = init_extended circle_extended

# order of sql files is important
PGS_SQL= pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
PGS_SQL = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql \
pgs_box.sql pgs_contains_ops.sql pgs_contains_ops_compat.sql \
pgs_gist.sql gnomo.sql \
healpix.sql pgs_gist_spoint3.sql pgs_moc_type.sql pgs_moc_compat.sql pgs_moc_ops.sql
PGS_SQL_9_5 = pgs_9.5.sql # experimental for spoint3

USE_PGXS = 1
ifdef USE_PGXS
ifndef PG_CONFIG
PG_CONFIG := pg_config
Expand All@@ -40,11 +63,140 @@ else
include $(top_srcdir)/contrib/contrib-global.mk
endif

# compiler settings
override CPPFLAGS += -I/usr/include/healpix_cxx
SHLIB_LINK += -lhealpix_cxx
LINK.shared = g++ -shared

# healpix_bare.c isn't ours so we refrain from fixing the warnings in there
healpix_bare/healpix_bare.o : healpix_bare/healpix_bare.c
$(COMPILE.c) -Wno-declaration-after-statement -o $@ $^

# experimental for spoint3
pg_version := $(word 2,$(shell $(PG_CONFIG) --version))
pg_version_9_5_plus = $(if $(filter-out 9.1% 9.2% 9.3% 9.4%,$(pg_version)),y,n)
has_parallel = $(if $(filter-out 9.1% 9.2% 9.3% 9.4% 9.5%,$(pg_version)),y,n)
has_explain_summary = $(if $(filter-out 9.%,$(pg_version)),y,n)
#

## the use of spoint 3 is too experimental and preliminary:
#ifeq ($(pg_version_9_5_plus),y)
#REGRESS += $(REGRESS_9_5)
#TESTS += $(REGRESS_9_5)
#PGS_SQL += $(PGS_SQL_9_5)
#endif

crushtest: REGRESS += $(CRUSH_TESTS)
crushtest: installcheck

pg_sphere--1.0.sql: $(addsuffix .in, $(PGS_SQL))
ifeq ($(has_explain_summary),y)
REGRESS += moc1 moc100
endif

ifeq ($(pg_version_9_5_plus),y)
PGS_TMP_DIR = --temp-instance=tmp_check
else
PGS_TMP_DIR = --temp-install=tmp_check --top-builddir=test_top_build_dir
endif

test: pg_sphere.test.sql sql/init_test.sql
$(pg_regress_installcheck) $(PGS_TMP_DIR) $(REGRESS_OPTS) $(TESTS)

pg_sphere.test.sql: $(RELEASE_SQL) $(shlib)
tail -n+3 $< | sed 's,MODULE_PATHNAME,$(realpath $(shlib)),g' >$@


$(RELEASE_SQL): $(addsuffix .in, $(RELEASE_SQL) $(PGS_SQL))
cat $^ > $@
ifeq ($(has_parallel), n)
sed -i -e '/PARALLEL/d' $@ # version $(pg_version) does not have support for PARALLEL
endif

# for "create extension from unpacked*":

UPGRADE_UNP_COMMON = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql \
pgs_box.sql pgs_contains_ops_compat.sql pgs_gist.sql \
pgs_gist_contains_ops.sql contains-ops-fixes-1.sql

AUGMENT_UNP_COMMON = upgrade_scripts/pgs_pre111.sql pgs_contains_ops.sql \
gnomo.sql
# for vanilla 1.1.1 users
AUGMENT_UNP_111 = $(AUGMENT_UNP_COMMON) pgs_gist_pointkey.sql

# for 1.1.2+ users: 'from unpacked_1.1.2plus'
AUGMENT_UNP_FOR_112plus = $(AUGMENT_UNP_COMMON)
UPGRADE_UNP_FOR_112plus = pgs_gist_pointkey.sql pgs_gist_drop_spoint2.sql.in

# for "alter extension":

# TODO: add dynamic pl/pgsql to do perform an additional
# "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5_from_before_2016-02-07';"
# if required.
#
# default 1.0 (after 2016-02-07) -> 1.1.5
UPGRADE_1_0_PRE_xxxxxx = contains-ops-fixes-2.sql
# '1.1.5_from_2015-08-31'
AUGMENT_1_0_PRE_AAF2D5 = pgs_contains_ops.sql gnomo.sql
UPGRADE_1_0_PRE_AAF2D5 = contains-ops-fixes-1.sql pgs_gist_drop_spoint2.sql.in \
pgs_gist_contains_ops.sql

# vanilla 'create from unpackaged' must assume 1.1.1
# ...

# create "create extension from unpacked*" files

# create "alter extension" files


ifeq ($(pg_version_9_5_plus),y)
# 1.1.1.5 -> 1.1.5.1 for Postgres 9.5+ features
else
endif

# local stuff follows here, next will be "beta2"

AUGMENT_GAVO_111 = $(AUGMENT_UNP_111) healpix.sql # for vanilla 1.1.1 users
UPGRADE_GAVO_111 = $(UPGRADE_UNP_COMMON)

# add new Healpix functions and experimental spoint3
AUGMENT_FROM_GAVO = healpix.sql pgs_gist_spoint3.sql

AUGMENT_UNP_115B0G = $(AUGMENT_UNP_111) $(AUGMENT_FROM_GAVO)
UPGRADE_UNP_115B0G = $(UPGRADE_UNP_COMMON)

AUGMENT_1_0_115B0G = $(AUGMENT_FROM_GAVO)
UPGRADE_1_0_115B0G = contains-ops-fixes-2.sql pgs_gist_drop_spoint2.sql

# test installation 0
pg_sphere--unpackaged--1.1.5beta0gavo.sql: $(addsuffix .in, \
$(AUGMENT_GAVO_111) \
$(addprefix upgrade_scripts/, $(UPGRADE_GAVO_111)))
cat upgrade_scripts/$@.in $^ > $@

# (The upgrade of test installation A has been completed.)

# test installation B (generic)
pg_sphere--1.0--1.0_gavo.sql: # dummy upgrade to allow for descriptive names
cat upgrade_scripts/$@.in > $@
pg_sphere--1.0_gavo--1.1.5beta0gavo.sql: $(addsuffix .in, \
$(AUGMENT_1_0_115B0G) \
$(addprefix upgrade_scripts/, $(UPGRADE_1_0_115B0G)))
cat upgrade_scripts/$@.in $^ > $@

pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql: pgs_moc_type.sql.in
cat upgrade_scripts/$@.in $^ > $@

pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql: pgs_moc_compat.sql.in
cat upgrade_scripts/$@.in $^ > $@

pg_sphere--1.1.5beta4gavo--1.2.0.sql: pgs_moc_ops.sql.in
cat $^ > $@
ifeq ($(has_parallel), n)
sed -i -e '/PARALLEL/d' $@ # version $(pg_version) does not have support for PARALLEL
endif

# end of local stuff

sscan.o : sparse.c

Expand All@@ -64,4 +216,4 @@ endif

dist : clean sparse.c sscan.c
find . -name '*~' -type f -exec rm {} \;
cd .. && tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS -czf pgsphere-$(PGSPHERE_VERSION).tar.gz $(SRC_DIR) && cd -
cd .. && tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS --exclude .git -czf pgsphere-$(PGSPHERE_VERSION).tar.gz $(SRC_DIR) && cd -
7 changes: 4 additions & 3 deletionsdoc/Makefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@
#
#----------------------------------------------------------------------------

USE_PGXS = 1
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand All@@ -23,7 +24,7 @@ COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl
endif

ifndef JADE
JADE =jade
JADE =openjade
endif
SGMLINCLUDE = -D $(srcdir)

Expand All@@ -47,9 +48,9 @@ html : pg_sphere.xml $(ALLSGML) pg_sphere.dsl
@rm -rf html
mkdir html
mkdir html/img
cp img/*.jpg html/img
cp img/*.jpgimg/*.pnghtml/img
cp pg_sphere.css html
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d pg_sphere.dsl -i html -t sgml $(XMLDCL) $<
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -b UTF-8 -d pg_sphere.dsl -i html -t sgml $(XMLDCL) $<
mv *.html html

pg_sphere.tex : pg_sphere.xml $(ALLSGML) pg_sphere.dsl
Expand Down
46 changes: 46 additions & 0 deletionsdoc/constructors.sgm
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -405,4 +405,50 @@
</example>
</sect2>

<sect2 id="contr.smoc">
<title>
<type>smoc</type>
</title>

<funcsynopsis>
<funcprototype>
<funcdef><function>smoc</function></funcdef>
<paramdef><parameter>order</parameter> int</paramdef>
<paramdef>spoint</paramdef>
</funcprototype>
</funcsynopsis>
<para>
creates a single-pixel <type>smoc</type> of the given order at <parameter>spoint</parameter>
</para>

<funcsynopsis>
<funcprototype>
<funcdef><function>smoc_disc</function></funcdef>
<paramdef><parameter>order</parameter> int</paramdef>
<paramdef><parameter>lng</parameter> double precision</paramdef>
<paramdef><parameter>lat</parameter> double precision</paramdef>
<paramdef><parameter>radius</parameter> double precision</paramdef>
</funcprototype>
<funcprototype>
<funcdef><function>smoc</function></funcdef>
<paramdef><parameter>order</parameter> int</paramdef>
<paramdef>scircle</paramdef>
</funcprototype>
</funcsynopsis>
<para>
creates an <type>smoc</type> of the given order covering the circle
</para>

<funcsynopsis>
<funcprototype>
<funcdef><function>smoc</function></funcdef>
<paramdef><parameter>order</parameter> int</paramdef>
<paramdef>spoly</paramdef>
</funcprototype>
</funcsynopsis>
<para>
creates an <type>smoc</type> of the given order covering the spoly
</para>
</sect2>

</sect1>
Loading

[8]ページ先頭

©2009-2025 Movatter.jp