pax_global_header00006660000000000000000000000064146114010150014503gustar00rootroot0000000000000052 comment=daa9478bcd1988d5934541b7e09b37a909d23b92 pgsphere-1.5.1/000077500000000000000000000000001461140101500133245ustar00rootroot00000000000000pgsphere-1.5.1/.editorconfig000066400000000000000000000002731461140101500160030ustar00rootroot00000000000000root = true [*.{c,cpp,h,l,y,pl,pm}] indent_style = tab indent_size = tab tab_width = 4 [*.{sgml,xml}] indent_style = space indent_size = 1 [*.xsl] indent_style = space indent_size = 2 pgsphere-1.5.1/.github/000077500000000000000000000000001461140101500146645ustar00rootroot00000000000000pgsphere-1.5.1/.github/workflows/000077500000000000000000000000001461140101500167215ustar00rootroot00000000000000pgsphere-1.5.1/.github/workflows/build-and-check.yml000066400000000000000000000043171461140101500223630ustar00rootroot00000000000000name: Build and Check on: push: pull_request: jobs: build_and_test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: pg_version: [10, 11, 12, 13, 14, 15, 16] use_healpix: [0, 1] name: PostgreSQL ${{ matrix.pg_version }} - USE_HEALPIX=${{ matrix.use_healpix }} steps: - name: Install dependencies run: | sudo apt update && sudo apt install -y \ postgresql-common \ libhealpix-cxx-dev \ docbook-xml \ docbook-xsl \ libxml2-utils \ xsltproc \ fop - name: Install Postgres run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -p -v ${{ matrix.pg_version }} -i - name: Clone pgSphere uses: actions/checkout@v4 - name: Set MAKE_CMD variable run: echo "MAKE_CMD=make --keep-going -j$(nproc) -l$(nproc) -O" >> $GITHUB_ENV - name: Build pgSphere run: ${MAKE_CMD} PROFILE="-Werror -Wall" USE_HEALPIX=${{ matrix.use_healpix }} - name: make test run: pg_virtualenv ${MAKE_CMD} USE_HEALPIX=${{ matrix.use_healpix }} test - name: Show test regression.diffs if: ${{ failure() }} run: cat regression.diffs - name: Install pgSphere run: sudo ${MAKE_CMD} USE_HEALPIX=${{ matrix.use_healpix }} install - name: make installcheck run: pg_virtualenv ${MAKE_CMD} USE_HEALPIX=${{ matrix.use_healpix }} installcheck - name: Show installcheck regression.diffs if: ${{ failure() }} run: cat regression.diffs - name: make crushtest run: pg_virtualenv ${MAKE_CMD} USE_HEALPIX=${{ matrix.use_healpix }} crushtest - name: Show crushtest regression.diffs if: ${{ failure() }} run: cat regression.diffs - name: Build docs run: ${MAKE_CMD} -C doc - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 - name: Upload artifacts uses: actions/upload-artifact@v3 if: success() || failure() with: name: ${{ env.GITHUB_REF_SLUG_URL }}-pg${{ matrix.pg_version }}-use-healpix-${{ matrix.use_healpix }}-${{ github.run_id }} if-no-files-found: ignore path: | ./**/*.log ./**/*.diffs pgsphere-1.5.1/.github/workflows/deploy-docs.yml000066400000000000000000000016571461140101500216770ustar00rootroot00000000000000name: Build and Deploy Docs # Deploy docs only for master on: push: branches: - "master" # Allow deployment to GitHub Pages permissions: pages: write id-token: write jobs: deploy-docs: name: Deploy Docs environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Install dependencies run: | sudo apt update && sudo apt install -y \ docbook-xml \ docbook-xsl \ libxml2-utils \ xsltproc \ fop - name: Clone pgSphere uses: actions/checkout@v4 - name: Build docs run: make -C doc - name: Setup Pages uses: actions/configure-pages@v3 - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: path: 'doc/html' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 pgsphere-1.5.1/.gitignore000066400000000000000000000003501461140101500153120ustar00rootroot00000000000000*.bc *.o *.so /*.sql /doc/html/ /doc/pg_sphere*.fo /doc/pg_sphere-*.html /doc/pg_sphere-*.pdf /doc/pg_sphere-full.xml /doc/pg_sphere.dsl /doc/version.xml /log /results/ regression.out regression.diffs tags /tmp_check buildpod .deps pgsphere-1.5.1/.gitlab-ci.yml000066400000000000000000000014271461140101500157640ustar00rootroot00000000000000stages: - 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' } } pgsphere-1.5.1/CONTRIBUTING.md000066400000000000000000000017031461140101500155560ustar00rootroot00000000000000First off, thanks for taking the time to contribute! ❤️ All types of contributions are encouraged and valued. See the Table of Contents for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. # Table of Contents - [Project Scope](#project-scope) - [Development Plans](#development-plans) # Project Scope - Types. - Operations on types (creating, searching, sorting, set operations and others). - Indexing structures and algorithms. # Development Plans - Move all source files into src folder. - Implement optional compilation with HEALPIX and SMOC. - Use pgindent to format sources. - Check compilation with newest postgrespro versions. - Add more tests including performance tests. - Add more documentation. pgsphere-1.5.1/COPYRIGHT.pg_sphere000066400000000000000000000030131461140101500165670ustar00rootroot00000000000000Copyright (c) 2003-2023, pgSphere development team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the pgSphere development team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. pgsphere-1.5.1/HACKING000066400000000000000000000032511461140101500143140ustar00rootroot00000000000000SQL definitions =============== Long version: . If you're writing new features that require SQL support, pick some descriptive name; let's say my_new_op. Put your new code into a file called pgs_my_new_op.sql.in. The .in extension here usually indicates "it's for copying stuff together"; usally, not much processing is done on such files. Then edit the Makefile. The PGS_SQL variable contains a list of the SQL files eventually copied together, without the .in. Add your new file there. You will also need to create an upgrade file. In order to tell postgres to execute it, increase PGSPHERE_VERSION as appropriate. As a consequence, you will have to:: git mv pg_sphere--.sql.in pg_sphere--.sql.in and also to update the version in pg_sphere.control. Then create a make rule:: pg_sphere----.sql: pgs_my_new_op.sql.in cat $^ > $@ (of course, this will extend to having multiple sql.in files). Finally, add the target of that rule to the DATA_built variable. Regression tests ================ Regressions tests are as per . In short, write queries executing your new features into a file sql/my_new_op.sql, and add "my_new_op" (without the extension or the directory name) to both REGRESS and TESTS in the Makefile. Then touch expected/my_new_op.out, run make test. This will of course fail, because your tests hopefully will output something. But then you can pick out the diff from /var/lib/postgresql/pgsphere/regression.diffs, have another critical look at it and generatoe your .out file from it. pgsphere-1.5.1/Makefile000066400000000000000000000207261461140101500147730ustar00rootroot00000000000000 include Makefile.common.mk RELEASE_SQL = $(EXTENSION)--$(PGSPHERE_VERSION).sql USE_PGXS = 1 USE_HEALPIX ?= 1 PGINDENT ?= pgindent PGBSDINDENT ?= pg_bsd_indent # the base dir name may be changed depending on git clone command SRC_DIR = $(shell basename $(shell pwd)) MODULE_big = pg_sphere OBJS = src/sscan.o src/sparse.o src/sbuffer.o src/vector3d.o src/point.o \ src/euler.o src/circle.o src/circle_sel.o src/line.o src/ellipse.o src/polygon.o \ src/path.o src/box.o src/output.o src/gq_cache.o src/gist.o src/gist_support.o \ src/key.o src/gnomo.o src/epochprop.o src/brin.o ifneq ($(USE_HEALPIX),0) OBJS += src/healpix.o src/moc.o src/process_moc.o \ healpix_bare/healpix_bare.o endif DATA_built = $(RELEASE_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 \ pg_sphere--1.2.0--1.2.1.sql \ pg_sphere--1.2.1--1.2.2.sql \ pg_sphere--1.2.2--1.2.3.sql \ pg_sphere--1.2.3--1.3.0.sql \ pg_sphere--1.3.0--1.3.1.sql \ pg_sphere--1.3.1--1.4.0.sql \ pg_sphere--1.4.0--1.4.1.sql \ pg_sphere--1.4.1--1.4.2.sql \ pg_sphere--1.4.2--1.5.0.sql \ pg_sphere--1.5.0--1.5.1.sql DOCS = README.pg_sphere COPYRIGHT.pg_sphere TESTS = version tables points euler circle line ellipse poly path box \ index contains_ops contains_ops_compat bounding_box_gist gnomo \ epochprop contains overlaps spoint_brin sbox_brin selectivity \ knn output_precision REGRESS = init $(TESTS) PG_CFLAGS += -DPGSPHERE_VERSION=$(PGSPHERE_VERSION) PG_CPPFLAGS += -DPGSPHERE_VERSION=$(PGSPHERE_VERSION) 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 = $(PGS_SQL) pg_sphere.test.sql 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_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 pgs_brin.sql pgs_circle_sel.sql pgs_hash.sql ifneq ($(USE_HEALPIX),0) TESTS += healpix moc moc1 moc100 mocautocast PGS_SQL += healpix.sql endif PGS_SQL += pgs_gist_spoint3.sql ifneq ($(USE_HEALPIX),0) PGS_SQL += pgs_moc_type.sql pgs_moc_ops.sql \ pgs_moc_geo_casts.sql endif PGS_SQL += pgs_epochprop.sql ifdef USE_PGXS ifndef PG_CONFIG PG_CONFIG = pg_config endif PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else subdir = contrib/pg_sphere top_builddir = ../.. PG_CONFIG := $(top_builddir)/src/bin/pg_config/pg_config include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif ifneq ($(USE_HEALPIX),0) # compiler settings for linking with libhealpix_cxx PKG_CONFIG ?= pkg-config override CPPFLAGS += $(shell $(PKG_CONFIG) --cflags healpix_cxx) SHLIB_LINK += $(shell $(PKG_CONFIG) --libs healpix_cxx) LINK.shared = g++ -shared endif # 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 $@ $^ pg_version := $(word 2,$(shell $(PG_CONFIG) --version)) has_support_functions = $(if $(filter-out 9.% 10.% 11.%,$(pg_version)),y,n) has_index_options = $(if $(filter-out 9.% 10.% 11.% 12.%,$(pg_version)),y,n) crushtest: TESTS += $(CRUSH_TESTS) crushtest: installcheck ifeq ($(has_support_functions),y) PGS_SQL += pgs_gist_support.sql TESTS += gist_support endif ifneq ($(USE_HEALPIX),0) ifeq ($(has_index_options),y) PGS_SQL += pgs_moc_options.sql TESTS += moc_options endif endif # "make test" uses a special initialization file that doesn't rely on "create extension" test: pg_sphere.test.sql $(pg_regress_installcheck) --temp-instance=tmp_check $(REGRESS_OPTS) init_test $(TESTS) pg_sphere.test.sql: $(RELEASE_SQL) $(shlib) tail -n+3 $< | sed 's,MODULE_PATHNAME,$(realpath $(shlib)),g' >$@ $(RELEASE_SQL): pg_sphere_head.sql.in $(addsuffix .in, $(PGS_SQL)) cat $^ > $@ # 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 # add new HEALPix functions and experimental spoint3 ifneq ($(USE_HEALPIX),0) AUGMENT_FROM_GAVO = healpix.sql endif AUGMENT_FROM_GAVO += pgs_gist_spoint3.sql AUGMENT_1_0_115B0G = $(AUGMENT_FROM_GAVO) UPGRADE_1_0_115B0G = contains-ops-fixes-2.sql pgs_gist_drop_spoint2.sql # 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 $^ > $@ ifneq ($(USE_HEALPIX),0) 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: cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.1.5beta4gavo--1.2.0.sql: pgs_moc_ops.sql.in cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.2.0--1.2.1.sql: pgs_moc_geo_casts.sql.in pgs_epochprop.sql.in cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.2.1--1.2.2.sql: upgrade_scripts/pg_sphere--1.2.1--1.2.2-healpix.sql.in cat upgrade_scripts/$@.in $^ > $@ else pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql: cat upgrade_scripts/$@.in > $@ pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql: cat upgrade_scripts/$@.in > $@ pg_sphere--1.1.5beta4gavo--1.2.0.sql: cat upgrade_scripts/$@.in > $@ pg_sphere--1.2.0--1.2.1.sql: pgs_epochprop.sql.in cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.2.1--1.2.2.sql: cat upgrade_scripts/$@.in > $@ endif pg_sphere--1.2.2--1.2.3.sql: cat upgrade_scripts/$@.in > $@ pg_sphere--1.2.3--1.3.0.sql: pgs_brin.sql.in cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.3.0--1.3.1.sql: cat upgrade_scripts/$@.in > $@ ifeq ($(has_support_functions),y) pg_sphere--1.3.1--1.4.0.sql: pgs_gist_support.sql.in endif ifneq ($(USE_HEALPIX),0) ifeq ($(has_index_options),y) pg_sphere--1.3.1--1.4.0.sql: pgs_moc_options.sql.in endif endif pg_sphere--1.3.1--1.4.0.sql: pgs_circle_sel.sql.in pgs_hash.sql.in cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.4.0--1.4.1.sql pg_sphere--1.4.1--1.4.2.sql: @echo "-- Nothing to upgrade in the schema" > $@ pg_sphere--1.4.2--1.5.0.sql: cat upgrade_scripts/$@.in $^ > $@ pg_sphere--1.5.0--1.5.1.sql: cat upgrade_scripts/$@.in $^ > $@ # end of local stuff src/sscan.o : src/sparse.c src/sparse.c: src/sparse.y ifdef YACC $(YACC) -d $(YFLAGS) -p sphere_yy -o $@ $< else @$(missing) bison $< $@ endif src/sscan.c : src/sscan.l ifdef FLEX $(FLEX) $(FLEXFLAGS) -Psphere -o$@ $< else @$(missing) flex $< $@ endif dist : clean find . -name '*~' -type f -exec rm {} \; cd .. && tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS --exclude .git -czf pgsphere-$(PGSPHERE_VERSION).tar.gz $(SRC_DIR) && cd - # To use pgindent, set the PATH environment variable to include the directories # containing the binaries pgindent and pg_bsd_indent. It is important to # utilize a specific version of pg_bsd_indent, which sources can be found # in the /src/tools/pg_bsd_indent directory, where # is the root directory of the PostgreSQL project source tree. # # The sources of the utilities can be found in the following directories: # - /src/tools/pgindent # - /src/tools/pg_bsd_indent # # pgindent-typedefs.list should be updated every time after implementing # new types and introducing new typedefs in the code. For details how # to update pgindent-typedefs.list and for other information about pgindent, # please, read the doc: /src/tools/pgindent/README. # # pgindent-excludes.list is used to specify files to be ignored. # pgindent: $(PGINDENT) \ --typedefs=pgindent-typedefs.list \ --excludes=pgindent-excludes.list \ --indent=${PGBSDINDENT} \ src pgindent-headers: $(PGINDENT) \ --typedefs=pgindent-typedefs.list \ --excludes=pgindent-excludes.list \ --indent=${PGBSDINDENT} \ src/*.h pgsphere-1.5.1/Makefile.common.mk000066400000000000000000000003711461140101500166620ustar00rootroot00000000000000#---------------------------------------------------------------------------- # # pgSphere common definitions # #---------------------------------------------------------------------------- EXTENSION := pg_sphere PGSPHERE_VERSION := 1.5.1 pgsphere-1.5.1/README.pg_sphere000066400000000000000000000053731461140101500161670ustar00rootroot00000000000000pgSphere is a PostgreSQL extension for spherical geometry. It provides: * New data types (points, spherical polygons, paths, circles, ellipses, coordinate ranges) * Input and output of data in various formats * Membership, overlap, and other operators * Circumference and area of objects * Object rotation by Euler angles * Indexing of spherical data types This is an R-tree implementation using GiST for spherical objects like spherical points and spherical circles with useful functions and operators. It also supports the Block Range INdexing (BRIN) for large datasets. NOTICE: This version will work only with PostgreSQL version 10 and above. VERSIONING: Stable versions are marked with tags containing version numbers in the GitHub repository at https://github.com/postgrespro/pgsphere/. Each stable version contains upgrade scripts for updating an existing installation to the latest version using the ALTER EXTENSION UPDATE TO command. The master branch is intended for development purposes and may contain intermediate changes. The current version in the master branch and its functionality are subject to change. Note: The master branch should not be used in production because the upgrade scripts and the current version number may be changed. INSTALLATION: -- Build and install make make install -- HEALPix/MOC support is included by default. If your platform does not -- have the required libhealpix_cxx dependency, you can optionally build -- pgSphere without HEALPix/MOC support, like this: make USE_HEALPIX=0 make USE_HEALPIX=0 install -- Load extension psql -c "CREATE EXTENSION pg_sphere;" UPDATING AN EXISTING INSTALLATION: -- If you are updating from a previous version of pgSphere, perform the -- same make and make install steps as above, but, instead of the CREATE -- EXTENSION step, you need to do: psql -c "ALTER EXTENSION pg_sphere UPDATE TO 'A.B.C';" -- where A.B.C is a placeholder for the current version. -- You also may want to check what version of pgSphere is installed using either or both of the following commands: psql -c "SELECT pg_sphere_version();" psql -c "SELECT * FROM pg_available_extension_versions WHERE name = 'pg_sphere';" REGRESSION TEST (as the same user as the currently running PostgreSQL server): make installcheck -- or -- make USE_HEALPIX=0 installcheck LONG REGRESSION TEST: make crushtest -- or -- make USE_HEALPIX=0 crushtest The 'make' program used in all of the above commands must be compatible with GNU make. For more information or to report issues or to help with development, please refer to https://github.com/postgrespro/pgsphere/ Original repository for pgSphere: https://github.com/akorotkov/pgsphere Have a lot of fun! pgsphere-1.5.1/data/000077500000000000000000000000001461140101500142355ustar00rootroot00000000000000pgsphere-1.5.1/data/test_spherebox.data000066400000000000000000000425221461140101500201330ustar00rootroot00000000000000((0, -90d),(0,-90d)) ((0d, -90d),(10d, -80d)) ((10d, -90d),(20d, -80d)) ((20d, -90d),(30d, -80d)) ((30d, -90d),(40d, -80d)) ((40d, -90d),(50d, -80d)) ((50d, -90d),(60d, -80d)) ((60d, -90d),(70d, -80d)) ((70d, -90d),(80d, -80d)) ((80d, -90d),(90d, -80d)) ((90d, -90d),(100d, -80d)) ((100d, -90d),(110d, -80d)) ((110d, -90d),(120d, -80d)) ((120d, -90d),(130d, -80d)) ((130d, -90d),(140d, -80d)) ((140d, -90d),(150d, -80d)) ((150d, -90d),(160d, -80d)) ((160d, -90d),(170d, -80d)) ((170d, -90d),(180d, -80d)) ((180d, -90d),(190d, -80d)) ((190d, -90d),(200d, -80d)) ((200d, -90d),(210d, -80d)) ((210d, -90d),(220d, -80d)) ((220d, -90d),(230d, -80d)) ((230d, -90d),(240d, -80d)) ((240d, -90d),(250d, -80d)) ((250d, -90d),(260d, -80d)) ((260d, -90d),(270d, -80d)) ((270d, -90d),(280d, -80d)) ((280d, -90d),(290d, -80d)) ((290d, -90d),(300d, -80d)) ((300d, -90d),(310d, -80d)) ((310d, -90d),(320d, -80d)) ((320d, -90d),(330d, -80d)) ((330d, -90d),(340d, -80d)) ((340d, -90d),(350d, -80d)) ((350d, -90d),(360d, -80d)) ((0d, -80d),(10d, -70d)) ((10d, -80d),(20d, -70d)) ((20d, -80d),(30d, -70d)) ((30d, -80d),(40d, -70d)) ((40d, -80d),(50d, -70d)) ((50d, -80d),(60d, -70d)) ((60d, -80d),(70d, -70d)) ((70d, -80d),(80d, -70d)) ((80d, -80d),(90d, -70d)) ((90d, -80d),(100d, -70d)) ((100d, -80d),(110d, -70d)) ((110d, -80d),(120d, -70d)) ((120d, -80d),(130d, -70d)) ((130d, -80d),(140d, -70d)) ((140d, -80d),(150d, -70d)) ((150d, -80d),(160d, -70d)) ((160d, -80d),(170d, -70d)) ((170d, -80d),(180d, -70d)) ((180d, -80d),(190d, -70d)) ((190d, -80d),(200d, -70d)) ((200d, -80d),(210d, -70d)) ((210d, -80d),(220d, -70d)) ((220d, -80d),(230d, -70d)) ((230d, -80d),(240d, -70d)) ((240d, -80d),(250d, -70d)) ((250d, -80d),(260d, -70d)) ((260d, -80d),(270d, -70d)) ((270d, -80d),(280d, -70d)) ((280d, -80d),(290d, -70d)) ((290d, -80d),(300d, -70d)) ((300d, -80d),(310d, -70d)) ((310d, -80d),(320d, -70d)) ((320d, -80d),(330d, -70d)) ((330d, -80d),(340d, -70d)) ((340d, -80d),(350d, -70d)) ((350d, -80d),(360d, -70d)) ((0d, -70d),(10d, -60d)) ((10d, -70d),(20d, -60d)) ((20d, -70d),(30d, -60d)) ((30d, -70d),(40d, -60d)) ((40d, -70d),(50d, -60d)) ((50d, -70d),(60d, -60d)) ((60d, -70d),(70d, -60d)) ((70d, -70d),(80d, -60d)) ((80d, -70d),(90d, -60d)) ((90d, -70d),(100d, -60d)) ((100d, -70d),(110d, -60d)) ((110d, -70d),(120d, -60d)) ((120d, -70d),(130d, -60d)) ((130d, -70d),(140d, -60d)) ((140d, -70d),(150d, -60d)) ((150d, -70d),(160d, -60d)) ((160d, -70d),(170d, -60d)) ((170d, -70d),(180d, -60d)) ((180d, -70d),(190d, -60d)) ((190d, -70d),(200d, -60d)) ((200d, -70d),(210d, -60d)) ((210d, -70d),(220d, -60d)) ((220d, -70d),(230d, -60d)) ((230d, -70d),(240d, -60d)) ((240d, -70d),(250d, -60d)) ((250d, -70d),(260d, -60d)) ((260d, -70d),(270d, -60d)) ((270d, -70d),(280d, -60d)) ((280d, -70d),(290d, -60d)) ((290d, -70d),(300d, -60d)) ((300d, -70d),(310d, -60d)) ((310d, -70d),(320d, -60d)) ((320d, -70d),(330d, -60d)) ((330d, -70d),(340d, -60d)) ((340d, -70d),(350d, -60d)) ((350d, -70d),(360d, -60d)) ((0d, -60d),(10d, -50d)) ((10d, -60d),(20d, -50d)) ((20d, -60d),(30d, -50d)) ((30d, -60d),(40d, -50d)) ((40d, -60d),(50d, -50d)) ((50d, -60d),(60d, -50d)) ((60d, -60d),(70d, -50d)) ((70d, -60d),(80d, -50d)) ((80d, -60d),(90d, -50d)) ((90d, -60d),(100d, -50d)) ((100d, -60d),(110d, -50d)) ((110d, -60d),(120d, -50d)) ((120d, -60d),(130d, -50d)) ((130d, -60d),(140d, -50d)) ((140d, -60d),(150d, -50d)) ((150d, -60d),(160d, -50d)) ((160d, -60d),(170d, -50d)) ((170d, -60d),(180d, -50d)) ((180d, -60d),(190d, -50d)) ((190d, -60d),(200d, -50d)) ((200d, -60d),(210d, -50d)) ((210d, -60d),(220d, -50d)) ((220d, -60d),(230d, -50d)) ((230d, -60d),(240d, -50d)) ((240d, -60d),(250d, -50d)) ((250d, -60d),(260d, -50d)) ((260d, -60d),(270d, -50d)) ((270d, -60d),(280d, -50d)) ((280d, -60d),(290d, -50d)) ((290d, -60d),(300d, -50d)) ((300d, -60d),(310d, -50d)) ((310d, -60d),(320d, -50d)) ((320d, -60d),(330d, -50d)) ((330d, -60d),(340d, -50d)) ((340d, -60d),(350d, -50d)) ((350d, -60d),(360d, -50d)) ((0d, -50d),(10d, -40d)) ((10d, -50d),(20d, -40d)) ((20d, -50d),(30d, -40d)) ((30d, -50d),(40d, -40d)) ((40d, -50d),(50d, -40d)) ((50d, -50d),(60d, -40d)) ((60d, -50d),(70d, -40d)) ((70d, -50d),(80d, -40d)) ((80d, -50d),(90d, -40d)) ((90d, -50d),(100d, -40d)) ((100d, -50d),(110d, -40d)) ((110d, -50d),(120d, -40d)) ((120d, -50d),(130d, -40d)) ((130d, -50d),(140d, -40d)) ((140d, -50d),(150d, -40d)) ((150d, -50d),(160d, -40d)) ((160d, -50d),(170d, -40d)) ((170d, -50d),(180d, -40d)) ((180d, -50d),(190d, -40d)) ((190d, -50d),(200d, -40d)) ((200d, -50d),(210d, -40d)) ((210d, -50d),(220d, -40d)) ((220d, -50d),(230d, -40d)) ((230d, -50d),(240d, -40d)) ((240d, -50d),(250d, -40d)) ((250d, -50d),(260d, -40d)) ((260d, -50d),(270d, -40d)) ((270d, -50d),(280d, -40d)) ((280d, -50d),(290d, -40d)) ((290d, -50d),(300d, -40d)) ((300d, -50d),(310d, -40d)) ((310d, -50d),(320d, -40d)) ((320d, -50d),(330d, -40d)) ((330d, -50d),(340d, -40d)) ((340d, -50d),(350d, -40d)) ((350d, -50d),(360d, -40d)) ((0d, -40d),(10d, -30d)) ((10d, -40d),(20d, -30d)) ((20d, -40d),(30d, -30d)) ((30d, -40d),(40d, -30d)) ((40d, -40d),(50d, -30d)) ((50d, -40d),(60d, -30d)) ((60d, -40d),(70d, -30d)) ((70d, -40d),(80d, -30d)) ((80d, -40d),(90d, -30d)) ((90d, -40d),(100d, -30d)) ((100d, -40d),(110d, -30d)) ((110d, -40d),(120d, -30d)) ((120d, -40d),(130d, -30d)) ((130d, -40d),(140d, -30d)) ((140d, -40d),(150d, -30d)) ((150d, -40d),(160d, -30d)) ((160d, -40d),(170d, -30d)) ((170d, -40d),(180d, -30d)) ((180d, -40d),(190d, -30d)) ((190d, -40d),(200d, -30d)) ((200d, -40d),(210d, -30d)) ((210d, -40d),(220d, -30d)) ((220d, -40d),(230d, -30d)) ((230d, -40d),(240d, -30d)) ((240d, -40d),(250d, -30d)) ((250d, -40d),(260d, -30d)) ((260d, -40d),(270d, -30d)) ((270d, -40d),(280d, -30d)) ((280d, -40d),(290d, -30d)) ((290d, -40d),(300d, -30d)) ((300d, -40d),(310d, -30d)) ((310d, -40d),(320d, -30d)) ((320d, -40d),(330d, -30d)) ((330d, -40d),(340d, -30d)) ((340d, -40d),(350d, -30d)) ((350d, -40d),(360d, -30d)) ((0d, -30d),(10d, -20d)) ((10d, -30d),(20d, -20d)) ((20d, -30d),(30d, -20d)) ((30d, -30d),(40d, -20d)) ((40d, -30d),(50d, -20d)) ((50d, -30d),(60d, -20d)) ((60d, -30d),(70d, -20d)) ((70d, -30d),(80d, -20d)) ((80d, -30d),(90d, -20d)) ((90d, -30d),(100d, -20d)) ((100d, -30d),(110d, -20d)) ((110d, -30d),(120d, -20d)) ((120d, -30d),(130d, -20d)) ((130d, -30d),(140d, -20d)) ((140d, -30d),(150d, -20d)) ((150d, -30d),(160d, -20d)) ((160d, -30d),(170d, -20d)) ((170d, -30d),(180d, -20d)) ((180d, -30d),(190d, -20d)) ((190d, -30d),(200d, -20d)) ((200d, -30d),(210d, -20d)) ((210d, -30d),(220d, -20d)) ((220d, -30d),(230d, -20d)) ((230d, -30d),(240d, -20d)) ((240d, -30d),(250d, -20d)) ((250d, -30d),(260d, -20d)) ((260d, -30d),(270d, -20d)) ((270d, -30d),(280d, -20d)) ((280d, -30d),(290d, -20d)) ((290d, -30d),(300d, -20d)) ((300d, -30d),(310d, -20d)) ((310d, -30d),(320d, -20d)) ((320d, -30d),(330d, -20d)) ((330d, -30d),(340d, -20d)) ((340d, -30d),(350d, -20d)) ((350d, -30d),(360d, -20d)) ((0d, -20d),(10d, -10d)) ((10d, -20d),(20d, -10d)) ((20d, -20d),(30d, -10d)) ((30d, -20d),(40d, -10d)) ((40d, -20d),(50d, -10d)) ((50d, -20d),(60d, -10d)) ((60d, -20d),(70d, -10d)) ((70d, -20d),(80d, -10d)) ((80d, -20d),(90d, -10d)) ((90d, -20d),(100d, -10d)) ((100d, -20d),(110d, -10d)) ((110d, -20d),(120d, -10d)) ((120d, -20d),(130d, -10d)) ((130d, -20d),(140d, -10d)) ((140d, -20d),(150d, -10d)) ((150d, -20d),(160d, -10d)) ((160d, -20d),(170d, -10d)) ((170d, -20d),(180d, -10d)) ((180d, -20d),(190d, -10d)) ((190d, -20d),(200d, -10d)) ((200d, -20d),(210d, -10d)) ((210d, -20d),(220d, -10d)) ((220d, -20d),(230d, -10d)) ((230d, -20d),(240d, -10d)) ((240d, -20d),(250d, -10d)) ((250d, -20d),(260d, -10d)) ((260d, -20d),(270d, -10d)) ((270d, -20d),(280d, -10d)) ((280d, -20d),(290d, -10d)) ((290d, -20d),(300d, -10d)) ((300d, -20d),(310d, -10d)) ((310d, -20d),(320d, -10d)) ((320d, -20d),(330d, -10d)) ((330d, -20d),(340d, -10d)) ((340d, -20d),(350d, -10d)) ((350d, -20d),(360d, -10d)) ((0d, -10d),(10d, 0d)) ((10d, -10d),(20d, 0d)) ((20d, -10d),(30d, 0d)) ((30d, -10d),(40d, 0d)) ((40d, -10d),(50d, 0d)) ((50d, -10d),(60d, 0d)) ((60d, -10d),(70d, 0d)) ((70d, -10d),(80d, 0d)) ((80d, -10d),(90d, 0d)) ((90d, -10d),(100d, 0d)) ((100d, -10d),(110d, 0d)) ((110d, -10d),(120d, 0d)) ((120d, -10d),(130d, 0d)) ((130d, -10d),(140d, 0d)) ((140d, -10d),(150d, 0d)) ((150d, -10d),(160d, 0d)) ((160d, -10d),(170d, 0d)) ((170d, -10d),(180d, 0d)) ((180d, -10d),(190d, 0d)) ((190d, -10d),(200d, 0d)) ((200d, -10d),(210d, 0d)) ((210d, -10d),(220d, 0d)) ((220d, -10d),(230d, 0d)) ((230d, -10d),(240d, 0d)) ((240d, -10d),(250d, 0d)) ((250d, -10d),(260d, 0d)) ((260d, -10d),(270d, 0d)) ((270d, -10d),(280d, 0d)) ((280d, -10d),(290d, 0d)) ((290d, -10d),(300d, 0d)) ((300d, -10d),(310d, 0d)) ((310d, -10d),(320d, 0d)) ((320d, -10d),(330d, 0d)) ((330d, -10d),(340d, 0d)) ((340d, -10d),(350d, 0d)) ((350d, -10d),(360d, 0d)) ((0d, 0d),(10d, 10d)) ((10d, 0d),(20d, 10d)) ((20d, 0d),(30d, 10d)) ((30d, 0d),(40d, 10d)) ((40d, 0d),(50d, 10d)) ((50d, 0d),(60d, 10d)) ((60d, 0d),(70d, 10d)) ((70d, 0d),(80d, 10d)) ((80d, 0d),(90d, 10d)) ((90d, 0d),(100d, 10d)) ((100d, 0d),(110d, 10d)) ((110d, 0d),(120d, 10d)) ((120d, 0d),(130d, 10d)) ((130d, 0d),(140d, 10d)) ((140d, 0d),(150d, 10d)) ((150d, 0d),(160d, 10d)) ((160d, 0d),(170d, 10d)) ((170d, 0d),(180d, 10d)) ((180d, 0d),(190d, 10d)) ((190d, 0d),(200d, 10d)) ((200d, 0d),(210d, 10d)) ((210d, 0d),(220d, 10d)) ((220d, 0d),(230d, 10d)) ((230d, 0d),(240d, 10d)) ((240d, 0d),(250d, 10d)) ((250d, 0d),(260d, 10d)) ((260d, 0d),(270d, 10d)) ((270d, 0d),(280d, 10d)) ((280d, 0d),(290d, 10d)) ((290d, 0d),(300d, 10d)) ((300d, 0d),(310d, 10d)) ((310d, 0d),(320d, 10d)) ((320d, 0d),(330d, 10d)) ((330d, 0d),(340d, 10d)) ((340d, 0d),(350d, 10d)) ((350d, 0d),(360d, 10d)) ((0d, 10d),(10d, 20d)) ((10d, 10d),(20d, 20d)) ((20d, 10d),(30d, 20d)) ((30d, 10d),(40d, 20d)) ((40d, 10d),(50d, 20d)) ((50d, 10d),(60d, 20d)) ((60d, 10d),(70d, 20d)) ((70d, 10d),(80d, 20d)) ((80d, 10d),(90d, 20d)) ((90d, 10d),(100d, 20d)) ((100d, 10d),(110d, 20d)) ((110d, 10d),(120d, 20d)) ((120d, 10d),(130d, 20d)) ((130d, 10d),(140d, 20d)) ((140d, 10d),(150d, 20d)) ((150d, 10d),(160d, 20d)) ((160d, 10d),(170d, 20d)) ((170d, 10d),(180d, 20d)) ((180d, 10d),(190d, 20d)) ((190d, 10d),(200d, 20d)) ((200d, 10d),(210d, 20d)) ((210d, 10d),(220d, 20d)) ((220d, 10d),(230d, 20d)) ((230d, 10d),(240d, 20d)) ((240d, 10d),(250d, 20d)) ((250d, 10d),(260d, 20d)) ((260d, 10d),(270d, 20d)) ((270d, 10d),(280d, 20d)) ((280d, 10d),(290d, 20d)) ((290d, 10d),(300d, 20d)) ((300d, 10d),(310d, 20d)) ((310d, 10d),(320d, 20d)) ((320d, 10d),(330d, 20d)) ((330d, 10d),(340d, 20d)) ((340d, 10d),(350d, 20d)) ((350d, 10d),(360d, 20d)) ((0d, 20d),(10d, 30d)) ((10d, 20d),(20d, 30d)) ((20d, 20d),(30d, 30d)) ((30d, 20d),(40d, 30d)) ((40d, 20d),(50d, 30d)) ((50d, 20d),(60d, 30d)) ((60d, 20d),(70d, 30d)) ((70d, 20d),(80d, 30d)) ((80d, 20d),(90d, 30d)) ((90d, 20d),(100d, 30d)) ((100d, 20d),(110d, 30d)) ((110d, 20d),(120d, 30d)) ((120d, 20d),(130d, 30d)) ((130d, 20d),(140d, 30d)) ((140d, 20d),(150d, 30d)) ((150d, 20d),(160d, 30d)) ((160d, 20d),(170d, 30d)) ((170d, 20d),(180d, 30d)) ((180d, 20d),(190d, 30d)) ((190d, 20d),(200d, 30d)) ((200d, 20d),(210d, 30d)) ((210d, 20d),(220d, 30d)) ((220d, 20d),(230d, 30d)) ((230d, 20d),(240d, 30d)) ((240d, 20d),(250d, 30d)) ((250d, 20d),(260d, 30d)) ((260d, 20d),(270d, 30d)) ((270d, 20d),(280d, 30d)) ((280d, 20d),(290d, 30d)) ((290d, 20d),(300d, 30d)) ((300d, 20d),(310d, 30d)) ((310d, 20d),(320d, 30d)) ((320d, 20d),(330d, 30d)) ((330d, 20d),(340d, 30d)) ((340d, 20d),(350d, 30d)) ((350d, 20d),(360d, 30d)) ((0d, 30d),(10d, 40d)) ((10d, 30d),(20d, 40d)) ((20d, 30d),(30d, 40d)) ((30d, 30d),(40d, 40d)) ((40d, 30d),(50d, 40d)) ((50d, 30d),(60d, 40d)) ((60d, 30d),(70d, 40d)) ((70d, 30d),(80d, 40d)) ((80d, 30d),(90d, 40d)) ((90d, 30d),(100d, 40d)) ((100d, 30d),(110d, 40d)) ((110d, 30d),(120d, 40d)) ((120d, 30d),(130d, 40d)) ((130d, 30d),(140d, 40d)) ((140d, 30d),(150d, 40d)) ((150d, 30d),(160d, 40d)) ((160d, 30d),(170d, 40d)) ((170d, 30d),(180d, 40d)) ((180d, 30d),(190d, 40d)) ((190d, 30d),(200d, 40d)) ((200d, 30d),(210d, 40d)) ((210d, 30d),(220d, 40d)) ((220d, 30d),(230d, 40d)) ((230d, 30d),(240d, 40d)) ((240d, 30d),(250d, 40d)) ((250d, 30d),(260d, 40d)) ((260d, 30d),(270d, 40d)) ((270d, 30d),(280d, 40d)) ((280d, 30d),(290d, 40d)) ((290d, 30d),(300d, 40d)) ((300d, 30d),(310d, 40d)) ((310d, 30d),(320d, 40d)) ((320d, 30d),(330d, 40d)) ((330d, 30d),(340d, 40d)) ((340d, 30d),(350d, 40d)) ((350d, 30d),(360d, 40d)) ((0d, 40d),(10d, 50d)) ((10d, 40d),(20d, 50d)) ((20d, 40d),(30d, 50d)) ((30d, 40d),(40d, 50d)) ((40d, 40d),(50d, 50d)) ((50d, 40d),(60d, 50d)) ((60d, 40d),(70d, 50d)) ((70d, 40d),(80d, 50d)) ((80d, 40d),(90d, 50d)) ((90d, 40d),(100d, 50d)) ((100d, 40d),(110d, 50d)) ((110d, 40d),(120d, 50d)) ((120d, 40d),(130d, 50d)) ((130d, 40d),(140d, 50d)) ((140d, 40d),(150d, 50d)) ((150d, 40d),(160d, 50d)) ((160d, 40d),(170d, 50d)) ((170d, 40d),(180d, 50d)) ((180d, 40d),(190d, 50d)) ((190d, 40d),(200d, 50d)) ((200d, 40d),(210d, 50d)) ((210d, 40d),(220d, 50d)) ((220d, 40d),(230d, 50d)) ((230d, 40d),(240d, 50d)) ((240d, 40d),(250d, 50d)) ((250d, 40d),(260d, 50d)) ((260d, 40d),(270d, 50d)) ((270d, 40d),(280d, 50d)) ((280d, 40d),(290d, 50d)) ((290d, 40d),(300d, 50d)) ((300d, 40d),(310d, 50d)) ((310d, 40d),(320d, 50d)) ((320d, 40d),(330d, 50d)) ((330d, 40d),(340d, 50d)) ((340d, 40d),(350d, 50d)) ((350d, 40d),(360d, 50d)) ((0d, 50d),(10d, 60d)) ((10d, 50d),(20d, 60d)) ((20d, 50d),(30d, 60d)) ((30d, 50d),(40d, 60d)) ((40d, 50d),(50d, 60d)) ((50d, 50d),(60d, 60d)) ((60d, 50d),(70d, 60d)) ((70d, 50d),(80d, 60d)) ((80d, 50d),(90d, 60d)) ((90d, 50d),(100d, 60d)) ((100d, 50d),(110d, 60d)) ((110d, 50d),(120d, 60d)) ((120d, 50d),(130d, 60d)) ((130d, 50d),(140d, 60d)) ((140d, 50d),(150d, 60d)) ((150d, 50d),(160d, 60d)) ((160d, 50d),(170d, 60d)) ((170d, 50d),(180d, 60d)) ((180d, 50d),(190d, 60d)) ((190d, 50d),(200d, 60d)) ((200d, 50d),(210d, 60d)) ((210d, 50d),(220d, 60d)) ((220d, 50d),(230d, 60d)) ((230d, 50d),(240d, 60d)) ((240d, 50d),(250d, 60d)) ((250d, 50d),(260d, 60d)) ((260d, 50d),(270d, 60d)) ((270d, 50d),(280d, 60d)) ((280d, 50d),(290d, 60d)) ((290d, 50d),(300d, 60d)) ((300d, 50d),(310d, 60d)) ((310d, 50d),(320d, 60d)) ((320d, 50d),(330d, 60d)) ((330d, 50d),(340d, 60d)) ((340d, 50d),(350d, 60d)) ((350d, 50d),(360d, 60d)) ((0d, 60d),(10d, 70d)) ((10d, 60d),(20d, 70d)) ((20d, 60d),(30d, 70d)) ((30d, 60d),(40d, 70d)) ((40d, 60d),(50d, 70d)) ((50d, 60d),(60d, 70d)) ((60d, 60d),(70d, 70d)) ((70d, 60d),(80d, 70d)) ((80d, 60d),(90d, 70d)) ((90d, 60d),(100d, 70d)) ((100d, 60d),(110d, 70d)) ((110d, 60d),(120d, 70d)) ((120d, 60d),(130d, 70d)) ((130d, 60d),(140d, 70d)) ((140d, 60d),(150d, 70d)) ((150d, 60d),(160d, 70d)) ((160d, 60d),(170d, 70d)) ((170d, 60d),(180d, 70d)) ((180d, 60d),(190d, 70d)) ((190d, 60d),(200d, 70d)) ((200d, 60d),(210d, 70d)) ((210d, 60d),(220d, 70d)) ((220d, 60d),(230d, 70d)) ((230d, 60d),(240d, 70d)) ((240d, 60d),(250d, 70d)) ((250d, 60d),(260d, 70d)) ((260d, 60d),(270d, 70d)) ((270d, 60d),(280d, 70d)) ((280d, 60d),(290d, 70d)) ((290d, 60d),(300d, 70d)) ((300d, 60d),(310d, 70d)) ((310d, 60d),(320d, 70d)) ((320d, 60d),(330d, 70d)) ((330d, 60d),(340d, 70d)) ((340d, 60d),(350d, 70d)) ((350d, 60d),(360d, 70d)) ((0d, 70d),(10d, 80d)) ((10d, 70d),(20d, 80d)) ((20d, 70d),(30d, 80d)) ((30d, 70d),(40d, 80d)) ((40d, 70d),(50d, 80d)) ((50d, 70d),(60d, 80d)) ((60d, 70d),(70d, 80d)) ((70d, 70d),(80d, 80d)) ((80d, 70d),(90d, 80d)) ((90d, 70d),(100d, 80d)) ((100d, 70d),(110d, 80d)) ((110d, 70d),(120d, 80d)) ((120d, 70d),(130d, 80d)) ((130d, 70d),(140d, 80d)) ((140d, 70d),(150d, 80d)) ((150d, 70d),(160d, 80d)) ((160d, 70d),(170d, 80d)) ((170d, 70d),(180d, 80d)) ((180d, 70d),(190d, 80d)) ((190d, 70d),(200d, 80d)) \N \N \N \N ((200d, 70d),(210d, 80d)) ((210d, 70d),(220d, 80d)) ((220d, 70d),(230d, 80d)) ((230d, 70d),(240d, 80d)) ((240d, 70d),(250d, 80d)) ((250d, 70d),(260d, 80d)) ((260d, 70d),(270d, 80d)) ((270d, 70d),(280d, 80d)) ((280d, 70d),(290d, 80d)) ((290d, 70d),(300d, 80d)) ((300d, 70d),(310d, 80d)) ((310d, 70d),(320d, 80d)) ((320d, 70d),(330d, 80d)) ((330d, 70d),(340d, 80d)) ((340d, 70d),(350d, 80d)) ((350d, 70d),(360d, 80d)) ((0d, 80d),(10d, 90d)) ((10d, 80d),(20d, 90d)) ((20d, 80d),(30d, 90d)) ((30d, 80d),(40d, 90d)) ((40d, 80d),(50d, 90d)) ((50d, 80d),(60d, 90d)) ((60d, 80d),(70d, 90d)) ((70d, 80d),(80d, 90d)) ((80d, 80d),(90d, 90d)) ((90d, 80d),(100d, 90d)) ((100d, 80d),(110d, 90d)) ((110d, 80d),(120d, 90d)) ((120d, 80d),(130d, 90d)) ((130d, 80d),(140d, 90d)) ((140d, 80d),(150d, 90d)) ((150d, 80d),(160d, 90d)) ((160d, 80d),(170d, 90d)) ((170d, 80d),(180d, 90d)) ((180d, 80d),(190d, 90d)) ((190d, 80d),(200d, 90d)) ((200d, 80d),(210d, 90d)) ((210d, 80d),(220d, 90d)) ((220d, 80d),(230d, 90d)) ((230d, 80d),(240d, 90d)) ((240d, 80d),(250d, 90d)) ((250d, 80d),(260d, 90d)) ((260d, 80d),(270d, 90d)) ((270d, 80d),(280d, 90d)) ((280d, 80d),(290d, 90d)) ((290d, 80d),(300d, 90d)) ((300d, 80d),(310d, 90d)) ((310d, 80d),(320d, 90d)) ((320d, 80d),(330d, 90d)) ((330d, 80d),(340d, 90d)) ((340d, 80d),(350d, 90d)) ((350d, 80d),(360d, 90d)) ( (0, 90d),(0, 90d) ) \N \N \N \N \. pgsphere-1.5.1/data/test_spherecircle.data000066400000000000000000000136371461140101500206110ustar00rootroot00000000000000<(2.52,-0.92),0.07> <(1.51,-0.04),0.08> <(-2.08,-0.54),0.09> <(1.88,-1.22),0.08> <(1.42,-0.49),0.07> <(-1.74,-0.58),0.06> <(1.86,-0.00),0.02> <(-0.27,0.32),0.05> <(-0.70,-1.05),0.08> <(3.01,0.69),0.05> <(-0.19,0.04),0.04> <(-3.03,-1.33),0.07> <(-2.00,0.34),0.08> <(-1.24,-0.37),0.09> <(-0.70,0.51),0.09> <(-3.02,0.23),0.10> <(0.10,-0.19),0.04> <(-2.14,0.39),0.06> <(1.41,-1.12),0.09> <(2.00,0.31),0.09> <(2.63,0.58),0.10> <(-1.53,-1.10),0.10> <(1.41,-0.57),0.08> <(1.05,-0.79),0.07> <(-0.35,-0.72),0.07> <(2.88,0.04),0.04> <(2.02,0.32),0.06> <(0.87,0.69),0.07> <(-1.83,0.29),0.05> <(-0.78,0.72),0.08> <(2.08,-0.02),0.09> <(1.51,1.23),0.09> <(0.47,0.39),0.07> <(0.54,0.14),0.09> <(-0.83,1.19),0.08> <(-1.53,-0.88),0.09> <(-3.09,-1.09),0.10> <(1.04,-0.37),0.07> <(2.18,0.47),0.07> <(0.42,-0.31),0.07> <(2.03,-0.35),0.06> <(-1.59,1.07),0.07> <(2.75,1.23),0.08> <(1.00,-0.50),0.06> <(-2.06,-0.24),0.09> <(1.26,-0.23),0.10> <(1.90,-0.22),0.09> <(-2.40,-0.01),0.10> <(-1.56,-0.59),0.06> <(2.92,-0.70),0.03> <(-0.85,-0.27),0.09> <(-2.83,-0.40),0.07> <(0.52,-0.16),0.08> <(-1.49,-0.37),0.09> <(-1.92,-0.42),0.08> <(-1.00,-0.02),0.05> <(-2.96,-0.49),0.08> <(1.90,0.08),0.09> <(-1.74,0.57),0.04> <(2.47,-0.39),0.07> <(0.96,0.79),0.05> <(2.45,-1.08),0.09> <(0.70,0.05),0.09> <(1.07,0.72),0.09> <(-1.36,-0.29),0.07> <(-0.52,-0.48),0.06> <(-2.30,-0.78),0.07> <(1.35,-0.87),0.05> <(-0.77,-0.01),0.08> <(0.89,0.92),0.03> <(-1.56,-0.54),0.09> <(0.88,-0.04),0.10> <(-1.99,0.18),0.10> <(-2.61,-0.74),0.08> <(-2.69,-0.79),0.08> <(0.10,-0.02),0.09> <(2.39,0.13),0.09> <(-2.83,1.13),0.05> <(1.75,-1.07),0.09> <(0.81,-0.94),0.05> <(2.63,-1.43),0.09> <(-3.00,-0.70),0.09> <(-0.13,0.53),0.10> <(-0.09,1.34),0.08> <(0.90,1.02),0.08> <(0.52,0.83),0.07> <(2.67,0.27),0.10> <(-0.19,-1.02),0.09> <(-0.58,0.29),0.09> <(-2.98,-1.29),0.08> <(1.01,-0.79),0.07> <(-2.07,1.28),0.08> <(-3.07,0.31),0.06> <(-1.56,-0.45),0.07> <(-1.24,0.43),0.08> <(2.62,-0.96),0.09> <(1.70,0.64),0.06> <(-2.86,-0.24),0.09> <(2.02,0.68),0.09> <(-0.60,0.46),0.09> <(1.73,-0.16),0.05> <(-1.44,0.44),0.08> <(-2.49,0.74),0.06> <(-1.25,0.12),0.06> <(1.99,0.02),0.06> <(-2.56,-0.90),0.02> <(-2.66,0.44),0.09> <(0.67,-0.17),0.09> <(-3.08,-0.32),0.07> <(-1.60,1.38),0.09> <(-0.19,0.42),0.07> <(1.79,-0.68),0.10> <(-2.77,0.20),0.09> <(-1.71,-0.26),0.07> <(2.70,0.78),0.09> <(2.66,0.21),0.08> <(2.93,0.29),0.10> <(2.11,-0.32),0.06> <(-2.59,-1.05),0.07> <(2.94,0.82),0.10> <(0.38,-0.13),0.05> <(3.09,1.27),0.08> <(-1.63,0.14),0.09> <(1.73,0.93),0.08> <(-1.99,-0.93),0.06> <(-0.59,-0.12),0.08> <(2.33,1.12),0.08> <(1.35,-0.25),0.06> <(2.61,-1.40),0.10> <(-0.36,0.27),0.06> <(2.04,-0.54),0.09> <(-1.24,-0.41),0.09> <(-2.24,-0.84),0.08> <(-1.02,0.23),0.05> <(-1.12,-0.04),0.07> <(-0.74,0.61),0.08> <(-2.18,0.64),0.08> <(-2.88,-0.68),0.09> <(-1.15,-0.21),0.10> <(-2.44,-0.36),0.09> <(-2.09,-0.10),0.04> <(-2.78,0.80),0.10> <(3.08,-0.55),0.10> <(-2.20,-0.52),0.08> <(-0.45,0.17),0.04> <(-3.09,0.05),0.09> <(-0.94,0.09),0.05> <(-0.79,0.09),0.10> <(0.83,0.19),0.07> <(-1.79,-1.05),0.08> <(2.57,-1.21),0.09> <(1.29,-0.48),0.09> <(0.19,0.43),0.09> <(1.96,-1.20),0.07> <(-1.58,0.31),0.08> <(1.24,0.14),0.07> <(-1.48,1.00),0.08> <(1.02,-0.40),0.07> <(2.23,0.77),0.09> <(1.16,-0.44),0.04> <(-1.70,-0.50),0.09> <(0.26,-0.24),0.09> <(1.30,-1.04),0.06> <(1.68,-0.56),0.07> <(-2.92,-1.14),0.08> <(0.80,-0.72),0.07> <(2.27,1.25),0.05> <(-2.41,0.19),0.09> <(1.32,-0.81),0.07> <(0.51,-0.00),0.07> <(-3.04,0.63),0.08> <(-2.11,-0.17),0.08> <(1.34,-0.33),0.06> <(-1.63,1.12),0.07> <(0.04,-0.64),0.07> <(1.53,-0.18),0.06> <(1.89,-0.12),0.10> <(-2.34,0.06),0.06> <(-3.12,-0.06),0.08> <(2.67,0.29),0.07> <(-1.91,-1.15),0.04> <(-1.60,1.26),0.06> <(-2.07,-0.18),0.07> <(3.08,0.27),0.10> <(-2.38,0.27),0.08> <(0.19,0.65),0.09> <(-2.47,1.00),0.09> <(-2.74,-0.30),0.09> <(-1.06,0.22),0.08> <(-2.95,0.60),0.04> <(2.61,1.15),0.07> <(0.40,0.32),0.09> <(-1.36,-0.39),0.10> <(-0.48,-0.02),0.05> <(0.36,0.06),0.09> <(-0.55,0.20),0.10> <(-2.31,0.08),0.08> <(-2.33,-0.35),0.06> <(1.78,1.27),0.08> <(-0.37,-0.88),0.05> <(-0.13,-0.81),0.08> <(-0.85,-0.24),0.02> <(-0.34,1.31),0.09> <(-1.22,0.80),0.10> <(0.91,-0.47),0.08> <(-0.87,-0.95),0.07> <(1.22,-0.14),0.08> <(1.22,0.21),0.10> <(0.59,1.16),0.06> <(-1.79,0.26),0.05> <(1.61,-0.54),0.06> <(2.57,1.46),0.08> <(0.88,0.72),0.07> <(-0.46,0.49),0.07> <(-2.88,0.07),0.07> <(-0.96,-0.14),0.08> <(-2.07,-0.73),0.09> <(-2.09,-0.36),0.10> <(2.84,1.01),0.08> <(-2.41,0.12),0.08> <(-0.82,1.23),0.08> <(0.21,-0.60),0.08> <(-2.19,-0.18),0.05> <(-0.71,0.67),0.10> <(-0.13,0.23),0.09> <(2.36,-0.79),0.09> <(1.11,-0.22),0.08> <(-0.70,1.26),0.07> <(-1.82,-0.43),0.05> <(0.49,0.64),0.06> <(-2.87,0.25),0.07> <(-0.53,-0.99),0.08> <(1.01,-0.35),0.07> <(-1.62,0.47),0.07> <(-1.45,0.38),0.09> <(-1.78,0.26),0.07> <(-0.76,-0.61),0.08> <(-0.72,-0.87),0.09> <(1.53,0.05),0.10> <(-0.35,-0.75),0.08> <(1.73,0.20),0.05> <(-0.35,0.01),0.05> <(-1.33,-1.18),0.09> <(2.67,-0.08),0.09> <(-1.97,-0.05),0.09> <(0.34,-1.29),0.06> <(-2.59,0.27),0.09> <(-1.39,-0.48),0.09> <(-0.54,-0.11),0.08> <(-2.74,0.12),0.08> <(-2.97,-0.72),0.08> <(0.98,-0.52),0.07> <(-2.99,-1.22),0.08> <(3.09,0.63),0.03> <(-0.17,-0.43),0.07> <(-3.13,0.33),0.08> <(2.12,-0.15),0.09> <(1.14,-1.39),0.06> <(0.54,0.14),0.08> <(3.13,-0.63),0.06> <(-0.42,0.60),0.10> <(-2.94,-0.66),0.07> <(-0.16,0.72),0.09> <(-2.48,-0.50),0.08> <(-2.56,-1.20),0.08> <(2.75,0.22),0.07> <(-2.90,1.32),0.05> <(-2.21,-0.93),0.08> <(2.89,-0.76),0.10> <(-1.45,-0.10),0.08> <(-1.11,0.59),0.09> <(-2.92,0.22),0.08> <(-0.55,-1.11),0.08> <(1.90,-0.19),0.06> <(-0.27,-0.97),0.10> <(2.69,-0.43),0.07> <(0.77,1.38),0.09> <(1.12,1.21),0.09> <(-2.53,-0.50),0.08> <(1.69,0.06),0.09> <(3.11,0.81),0.06> <(-2.58,0.33),0.09> <(1.89,-0.89),0.04> <(-1.23,0.98),0.04> <(-1.45,0.69),0.07> <(-2.04,0.22),0.06> <(2.06,0.17),0.04> <(3.03,-0.41),0.08> <(3.05,-0.34),0.08> <(1.21,0.31),0.07> <(2.55,-0.14),0.09> <(1.20,0.23),0.07> <(0.78,1.26),0.10> <(0.96,0.04),0.06> <(3.14,0.03),0.10> <(-2.53,-1.05),0.09> <(1.31,0.09),0.09> <(0.70,-1.23),0.03> <(-1.15,1.09),0.09> <(2.91,-0.60),0.09> \N \N \N \N \N \N \N \N \. pgsphere-1.5.1/data/test_spherepath.data000066400000000000000000000075511461140101500203020ustar00rootroot000000000000001 {(0d,30d),(45d,30d),(90d,30d),(135d,30d),(180d,30d),(225d,30d),(270d,30d),(315d,30d)} 2 {(0d,-5d),(1d,-5d),(2d,-5d),(3d,-5d),(4d,-5d),(5d,-5d),(6d,-5d),(7d,-5d),(8d,-5d),(9d,-5d),(10d,-5d),(11d,-5d),(12d,-5d),(13d,-5d),(14d,-5d),(15d,-5d),(16d,-5d),(17d,-5d),(18d,-5d),(19d,-5d),(20d,-5d),(21d,-5d),(22d,-5d),(23d,-5d),(24d,-5d),(25d,-5d),(26d,-5d),(27d,-5d),(28d,-5d),(29d,-5d),(30d,-5d),(31d,-5d),(32d,-5d),(33d,-5d),(34d,-5d),(35d,-5d),(36d,-5d),(37d,-5d),(38d,-5d),(39d,-5d),(40d,-5d),(41d,-5d),(42d,-5d),(43d,-5d),(44d,-5d),(45d,-5d),(46d,-5d),(47d,-5d),(48d,-5d),(49d,-5d),(50d,-5d),(51d,-5d),(52d,-5d),(53d,-5d),(54d,-5d),(55d,-5d),(56d,-5d),(57d,-5d),(58d,-5d),(59d,-5d),(60d,-5d),(61d,-5d),(62d,-5d),(63d,-5d),(64d,-5d),(65d,-5d),(66d,-5d),(67d,-5d),(68d,-5d),(69d,-5d),(70d,-5d),(71d,-5d),(72d,-5d),(73d,-5d),(74d,-5d),(75d,-5d),(76d,-5d),(77d,-5d),(78d,-5d),(79d,-5d),(80d,-5d),(81d,-5d),(82d,-5d),(83d,-5d),(84d,-5d),(85d,-5d),(86d,-5d),(87d,-5d),(88d,-5d),(89d,-5d),(90d,-5d),(91d,-5d),(92d,-5d),(93d,-5d),(94d,-5d),(95d,-5d),(96d,-5d),(97d,-5d),(98d,-5d),(99d,-5d),(100d,-5d),(101d,-5d),(102d,-5d),(103d,-5d),(104d,-5d),(105d,-5d),(106d,-5d),(107d,-5d),(108d,-5d),(109d,-5d),(110d,-5d),(111d,-5d),(112d,-5d),(113d,-5d),(114d,-5d),(115d,-5d),(116d,-5d),(117d,-5d),(118d,-5d),(119d,-5d),(120d,-5d),(121d,-5d),(122d,-5d),(123d,-5d),(124d,-5d),(125d,-5d),(126d,-5d),(127d,-5d),(128d,-5d),(129d,-5d),(130d,-5d),(131d,-5d),(132d,-5d),(133d,-5d),(134d,-5d),(135d,-5d),(136d,-5d),(137d,-5d),(138d,-5d),(139d,-5d),(140d,-5d),(141d,-5d),(142d,-5d),(143d,-5d),(144d,-5d),(145d,-5d),(146d,-5d),(147d,-5d),(148d,-5d),(149d,-5d),(150d,-5d),(151d,-5d),(152d,-5d),(153d,-5d),(154d,-5d),(155d,-5d),(156d,-5d),(157d,-5d),(158d,-5d),(159d,-5d),(160d,-5d),(161d,-5d),(162d,-5d),(163d,-5d),(164d,-5d),(165d,-5d),(166d,-5d),(167d,-5d),(168d,-5d),(169d,-5d),(170d,-5d),(171d,-5d),(172d,-5d),(173d,-5d),(174d,-5d),(175d,-5d),(176d,-5d),(177d,-5d),(178d,-5d),(179d,-5d),(180d,-5d),(181d,-5d),(182d,-5d),(183d,-5d),(184d,-5d),(185d,-5d),(186d,-5d),(187d,-5d),(188d,-5d),(189d,-5d),(190d,-5d),(191d,-5d),(192d,-5d),(193d,-5d),(194d,-5d),(195d,-5d),(196d,-5d),(197d,-5d),(198d,-5d),(199d,-5d),(200d,-5d),(201d,-5d),(202d,-5d),(203d,-5d),(204d,-5d),(205d,-5d),(206d,-5d),(207d,-5d),(208d,-5d),(209d,-5d),(210d,-5d),(211d,-5d),(212d,-5d),(213d,-5d),(214d,-5d),(215d,-5d),(216d,-5d),(217d,-5d),(218d,-5d),(219d,-5d),(220d,-5d),(221d,-5d),(222d,-5d),(223d,-5d),(224d,-5d),(225d,-5d),(226d,-5d),(227d,-5d),(228d,-5d),(229d,-5d),(230d,-5d),(231d,-5d),(232d,-5d),(233d,-5d),(234d,-5d),(235d,-5d),(236d,-5d),(237d,-5d),(238d,-5d),(239d,-5d),(240d,-5d),(241d,-5d),(242d,-5d),(243d,-5d),(244d,-5d),(245d,-5d),(246d,-5d),(247d,-5d),(248d,-5d),(249d,-5d),(250d,-5d),(251d,-5d),(252d,-5d),(253d,-5d),(254d,-5d),(255d,-5d),(256d,-5d),(257d,-5d),(258d,-5d),(259d,-5d),(260d,-5d),(261d,-5d),(262d,-5d),(263d,-5d),(264d,-5d),(265d,-5d),(266d,-5d),(267d,-5d),(268d,-5d),(269d,-5d),(270d,-5d),(271d,-5d),(272d,-5d),(273d,-5d),(274d,-5d),(275d,-5d),(276d,-5d),(277d,-5d),(278d,-5d),(279d,-5d),(280d,-5d),(281d,-5d),(282d,-5d),(283d,-5d),(284d,-5d),(285d,-5d),(286d,-5d),(287d,-5d),(288d,-5d),(289d,-5d),(290d,-5d),(291d,-5d),(292d,-5d),(293d,-5d),(294d,-5d),(295d,-5d),(296d,-5d),(297d,-5d),(298d,-5d),(299d,-5d),(300d,-5d),(301d,-5d),(302d,-5d),(303d,-5d),(304d,-5d),(305d,-5d),(306d,-5d),(307d,-5d),(308d,-5d),(309d,-5d),(310d,-5d),(311d,-5d),(312d,-5d),(313d,-5d),(314d,-5d),(315d,-5d),(316d,-5d),(317d,-5d),(318d,-5d),(319d,-5d),(320d,-5d),(321d,-5d),(322d,-5d),(323d,-5d),(324d,-5d),(325d,-5d),(326d,-5d),(327d,-5d),(328d,-5d),(329d,-5d),(330d,-5d),(331d,-5d),(332d,-5d),(333d,-5d),(334d,-5d),(335d,-5d),(336d,-5d),(337d,-5d),(338d,-5d),(339d,-5d),(340d,-5d),(341d,-5d),(342d,-5d),(343d,-5d),(344d,-5d),(345d,-5d),(346d,-5d),(347d,-5d),(348d,-5d),(349d,-5d),(350d,-5d),(351d,-5d),(352d,-5d),(353d,-5d),(354d,-5d),(355d,-5d),(356d,-5d),(357d,-5d),(358d,-5d),(359d,-5d)} \. pgsphere-1.5.1/data/test_spherepoint.data000066400000000000000000000076401461140101500204760ustar00rootroot00000000000000(1.32,0.61) (-0.40,-0.17) (2.30,0.60) (-0.92,-0.19) (-0.93,0.52) (1.89,0.10) (1.33,0.52) (2.19,0.94) (0.13,0.34) (0.19,-0.79) (0.52,0.45) (-1.62,0.14) (-1.46,-0.75) (-0.81,-0.08) (3.00,-0.08) (2.21,-0.91) (0.89,1.48) (-0.61,-0.82) (1.06,-1.13) (1.99,-1.11) (-0.18,-0.41) (3.09,1.25) (0.01,0.28) (-3.08,0.72) (-2.67,0.97) (2.32,0.88) (-1.44,0.07) (-0.26,-0.09) (-2.79,1.36) (-0.27,-0.51) (2.15,0.84) (-1.58,0.30) (2.23,0.63) (-0.43,0.52) (-3.12,0.85) (2.65,-0.20) (2.33,-0.05) (-2.08,0.14) (-0.92,-1.16) (2.87,-1.38) (2.43,1.09) (-0.44,-0.50) (0.41,-0.34) (-1.47,-0.44) (2.61,0.34) (3.02,0.84) (1.14,0.01) (-3.12,-0.21) (0.99,-1.22) (2.39,-0.42) (-2.33,-0.20) (0.22,-0.09) (-0.78,-0.41) (-2.51,-0.53) (0.66,1.29) (-2.68,-0.78) (1.48,-0.93) (1.57,-1.06) (2.33,-0.66) (1.08,0.27) (-0.21,-0.30) (-2.69,-0.49) (-1.82,0.48) (0.03,0.29) (2.50,0.63) (-0.73,-0.14) (-2.09,-0.49) (-0.89,0.66) (1.29,0.57) (2.51,-0.96) (2.66,0.16) (0.97,-0.84) (-1.00,1.02) (2.71,0.08) (2.64,-0.89) (-2.35,0.92) (1.10,0.35) (1.07,1.09) (1.13,0.53) (-0.33,-0.29) (1.50,1.10) (-3.06,0.07) (0.25,-0.17) (0.07,-0.46) (0.06,0.40) (-2.60,0.75) (-1.38,-0.66) (2.01,-0.23) (0.42,-0.01) (1.05,-1.24) (-2.11,-0.82) (-0.16,-0.05) (0.30,-0.39) (1.35,0.05) (-0.93,0.50) (-2.28,0.11) (2.82,0.68) (2.74,-0.90) (1.36,-0.31) (-0.81,-0.20) (2.07,-0.04) (-2.59,0.57) (-1.82,0.44) (-0.46,0.06) (1.09,-0.57) (2.49,-0.07) (-2.39,-0.14) (-1.92,-0.47) (-1.26,0.35) (-2.83,0.16) (1.42,0.42) (-3.13,-0.99) (-0.31,0.14) (-1.63,-0.14) (-1.01,-0.63) (-2.75,-0.20) (1.21,0.69) (0.05,-0.97) (-2.30,0.12) (2.05,-0.82) (1.30,-0.33) (2.89,0.03) (2.47,0.50) (-2.59,0.28) (-1.16,-0.21) (-0.28,0.15) (2.26,-0.90) (1.40,0.67) (-2.93,0.50) (-1.62,0.09) (1.32,0.32) (-2.40,0.43) (-1.88,0.80) (-0.84,0.80) (-2.15,-0.04) (1.29,-0.90) (2.26,0.27) (1.56,0.48) (3.06,0.12) (2.54,0.59) (0.98,-0.60) (1.41,0.05) (1.25,0.42) (-3.11,-0.19) (2.22,-0.73) (0.42,0.09) (-0.98,-0.11) (-0.02,0.99) (-1.06,0.32) (-2.14,-1.13) (-3.11,0.35) (1.45,-0.39) (-2.92,-0.90) (0.93,0.27) (2.42,1.29) (2.65,-0.07) (-2.19,0.05) (-1.33,-0.23) (2.24,-0.57) (-1.81,0.88) (0.01,0.51) (0.97,-0.71) (2.71,-0.26) (1.67,-0.35) (-1.52,0.45) (-1.78,-0.01) (0.38,1.03) (1.90,-0.69) (1.92,0.65) (-1.83,-1.40) (-2.27,0.45) (0.84,0.18) (-0.87,0.60) (2.20,0.89) (-0.39,-0.33) (0.84,-0.71) (0.62,-0.15) (1.63,-0.11) (1.43,0.46) (-0.45,0.91) (2.02,0.24) (-1.25,-0.73) (2.45,0.74) (2.82,0.52) (2.50,-0.83) (-2.02,0.32) (1.89,-0.02) (1.48,0.98) (1.45,-0.54) (-3.00,-1.04) (3.08,-0.25) (2.41,0.02) (-2.56,-0.51) (2.14,-0.58) (2.87,-1.24) (-3.12,-1.38) (1.24,0.95) (-0.67,1.05) (1.97,-0.20) (-0.01,-0.49) (-0.51,-0.43) (3.02,0.69) (1.09,-0.09) (-0.10,-0.57) (-3.08,-0.15) (0.08,0.32) (-1.54,-0.46) (-1.82,0.73) (-1.26,0.40) (0.22,-1.42) (1.23,-1.14) (-2.08,-1.03) (1.42,-0.64) (1.72,0.11) (1.70,0.90) (2.79,0.31) (2.90,0.28) (-2.54,0.69) (-2.17,0.28) (1.75,-0.00) (-1.16,-0.47) (1.02,0.12) (-0.88,-0.37) (2.45,-0.78) (-1.49,-1.16) (-0.31,1.25) (1.70,-0.94) (-1.96,0.05) (-1.70,-0.99) (-1.68,0.79) (-2.32,-0.35) (-2.01,-1.32) (2.55,-0.69) (2.87,0.26) (-0.01,0.64) (-0.17,0.84) (2.10,1.08) (1.91,0.90) (-0.80,-0.45) (2.51,0.44) (-0.92,-0.80) (1.18,0.83) (-2.79,0.90) (1.85,-0.46) (-2.47,0.02) (2.67,-0.65) (2.77,-0.22) (-1.95,0.27) (-1.76,0.31) (-0.37,0.64) (1.07,-0.97) (2.63,-0.28) (2.44,-0.32) (0.36,-0.86) (-1.31,0.89) (-0.12,-0.65) (-1.09,0.56) (-2.93,-0.05) (1.90,0.02) (2.54,-1.17) (2.75,1.18) (-1.05,-0.29) (0.42,-0.06) (-0.78,-1.15) (-1.29,0.10) (0.67,0.97) (3.00,0.76) (-0.12,-1.12) (-1.87,-0.02) (-1.68,-0.74) (1.84,-0.42) (0.57,0.10) (0.55,0.27) (-2.94,1.05) (1.49,0.52) (0.38,0.04) (1.94,1.33) (-1.39,0.41) (2.06,0.60) (1.06,-0.54) (2.92,-0.37) (0.53,-1.21) (0.69,1.35) (-2.67,-0.48) (1.31,1.19) (0.21,-0.72) (0.26,-1.00) (3.03,0.54) (-2.86,0.01) (1.97,1.48) (-1.74,0.93) (3.09,0.60) (-1.83,-0.28) (-3.06,-0.56) (1.46,-0.48) (0.69,-1.09) (0.13,-0.66) (-2.41,0.05) (1.23,-0.62) (0.67,0.89) (12h 12 , -2d 23.0 ) (180d 1m 10s , -2d 23' 59" ) (12h 11m 10 , +2d 23' 59.9 ) \N \N \N \N \N \N \N \N \. pgsphere-1.5.1/data/test_spherepolygon.data000066400000000000000000000075511461140101500210350ustar00rootroot000000000000001 {(0d,30d),(45d,30d),(90d,30d),(135d,30d),(180d,30d),(225d,30d),(270d,30d),(315d,30d)} 2 {(0d,-5d),(1d,-5d),(2d,-5d),(3d,-5d),(4d,-5d),(5d,-5d),(6d,-5d),(7d,-5d),(8d,-5d),(9d,-5d),(10d,-5d),(11d,-5d),(12d,-5d),(13d,-5d),(14d,-5d),(15d,-5d),(16d,-5d),(17d,-5d),(18d,-5d),(19d,-5d),(20d,-5d),(21d,-5d),(22d,-5d),(23d,-5d),(24d,-5d),(25d,-5d),(26d,-5d),(27d,-5d),(28d,-5d),(29d,-5d),(30d,-5d),(31d,-5d),(32d,-5d),(33d,-5d),(34d,-5d),(35d,-5d),(36d,-5d),(37d,-5d),(38d,-5d),(39d,-5d),(40d,-5d),(41d,-5d),(42d,-5d),(43d,-5d),(44d,-5d),(45d,-5d),(46d,-5d),(47d,-5d),(48d,-5d),(49d,-5d),(50d,-5d),(51d,-5d),(52d,-5d),(53d,-5d),(54d,-5d),(55d,-5d),(56d,-5d),(57d,-5d),(58d,-5d),(59d,-5d),(60d,-5d),(61d,-5d),(62d,-5d),(63d,-5d),(64d,-5d),(65d,-5d),(66d,-5d),(67d,-5d),(68d,-5d),(69d,-5d),(70d,-5d),(71d,-5d),(72d,-5d),(73d,-5d),(74d,-5d),(75d,-5d),(76d,-5d),(77d,-5d),(78d,-5d),(79d,-5d),(80d,-5d),(81d,-5d),(82d,-5d),(83d,-5d),(84d,-5d),(85d,-5d),(86d,-5d),(87d,-5d),(88d,-5d),(89d,-5d),(90d,-5d),(91d,-5d),(92d,-5d),(93d,-5d),(94d,-5d),(95d,-5d),(96d,-5d),(97d,-5d),(98d,-5d),(99d,-5d),(100d,-5d),(101d,-5d),(102d,-5d),(103d,-5d),(104d,-5d),(105d,-5d),(106d,-5d),(107d,-5d),(108d,-5d),(109d,-5d),(110d,-5d),(111d,-5d),(112d,-5d),(113d,-5d),(114d,-5d),(115d,-5d),(116d,-5d),(117d,-5d),(118d,-5d),(119d,-5d),(120d,-5d),(121d,-5d),(122d,-5d),(123d,-5d),(124d,-5d),(125d,-5d),(126d,-5d),(127d,-5d),(128d,-5d),(129d,-5d),(130d,-5d),(131d,-5d),(132d,-5d),(133d,-5d),(134d,-5d),(135d,-5d),(136d,-5d),(137d,-5d),(138d,-5d),(139d,-5d),(140d,-5d),(141d,-5d),(142d,-5d),(143d,-5d),(144d,-5d),(145d,-5d),(146d,-5d),(147d,-5d),(148d,-5d),(149d,-5d),(150d,-5d),(151d,-5d),(152d,-5d),(153d,-5d),(154d,-5d),(155d,-5d),(156d,-5d),(157d,-5d),(158d,-5d),(159d,-5d),(160d,-5d),(161d,-5d),(162d,-5d),(163d,-5d),(164d,-5d),(165d,-5d),(166d,-5d),(167d,-5d),(168d,-5d),(169d,-5d),(170d,-5d),(171d,-5d),(172d,-5d),(173d,-5d),(174d,-5d),(175d,-5d),(176d,-5d),(177d,-5d),(178d,-5d),(179d,-5d),(180d,-5d),(181d,-5d),(182d,-5d),(183d,-5d),(184d,-5d),(185d,-5d),(186d,-5d),(187d,-5d),(188d,-5d),(189d,-5d),(190d,-5d),(191d,-5d),(192d,-5d),(193d,-5d),(194d,-5d),(195d,-5d),(196d,-5d),(197d,-5d),(198d,-5d),(199d,-5d),(200d,-5d),(201d,-5d),(202d,-5d),(203d,-5d),(204d,-5d),(205d,-5d),(206d,-5d),(207d,-5d),(208d,-5d),(209d,-5d),(210d,-5d),(211d,-5d),(212d,-5d),(213d,-5d),(214d,-5d),(215d,-5d),(216d,-5d),(217d,-5d),(218d,-5d),(219d,-5d),(220d,-5d),(221d,-5d),(222d,-5d),(223d,-5d),(224d,-5d),(225d,-5d),(226d,-5d),(227d,-5d),(228d,-5d),(229d,-5d),(230d,-5d),(231d,-5d),(232d,-5d),(233d,-5d),(234d,-5d),(235d,-5d),(236d,-5d),(237d,-5d),(238d,-5d),(239d,-5d),(240d,-5d),(241d,-5d),(242d,-5d),(243d,-5d),(244d,-5d),(245d,-5d),(246d,-5d),(247d,-5d),(248d,-5d),(249d,-5d),(250d,-5d),(251d,-5d),(252d,-5d),(253d,-5d),(254d,-5d),(255d,-5d),(256d,-5d),(257d,-5d),(258d,-5d),(259d,-5d),(260d,-5d),(261d,-5d),(262d,-5d),(263d,-5d),(264d,-5d),(265d,-5d),(266d,-5d),(267d,-5d),(268d,-5d),(269d,-5d),(270d,-5d),(271d,-5d),(272d,-5d),(273d,-5d),(274d,-5d),(275d,-5d),(276d,-5d),(277d,-5d),(278d,-5d),(279d,-5d),(280d,-5d),(281d,-5d),(282d,-5d),(283d,-5d),(284d,-5d),(285d,-5d),(286d,-5d),(287d,-5d),(288d,-5d),(289d,-5d),(290d,-5d),(291d,-5d),(292d,-5d),(293d,-5d),(294d,-5d),(295d,-5d),(296d,-5d),(297d,-5d),(298d,-5d),(299d,-5d),(300d,-5d),(301d,-5d),(302d,-5d),(303d,-5d),(304d,-5d),(305d,-5d),(306d,-5d),(307d,-5d),(308d,-5d),(309d,-5d),(310d,-5d),(311d,-5d),(312d,-5d),(313d,-5d),(314d,-5d),(315d,-5d),(316d,-5d),(317d,-5d),(318d,-5d),(319d,-5d),(320d,-5d),(321d,-5d),(322d,-5d),(323d,-5d),(324d,-5d),(325d,-5d),(326d,-5d),(327d,-5d),(328d,-5d),(329d,-5d),(330d,-5d),(331d,-5d),(332d,-5d),(333d,-5d),(334d,-5d),(335d,-5d),(336d,-5d),(337d,-5d),(338d,-5d),(339d,-5d),(340d,-5d),(341d,-5d),(342d,-5d),(343d,-5d),(344d,-5d),(345d,-5d),(346d,-5d),(347d,-5d),(348d,-5d),(349d,-5d),(350d,-5d),(351d,-5d),(352d,-5d),(353d,-5d),(354d,-5d),(355d,-5d),(356d,-5d),(357d,-5d),(358d,-5d),(359d,-5d)} \. pgsphere-1.5.1/data/test_spherepolygon_aggregate.data000066400000000000000000000101651461140101500230360ustar00rootroot00000000000000(0d,-0.9) (1d,-0.9) (2d,-0.9) (3d,-0.9) (4d,-0.9) (5d,-0.9) (6d,-0.9) (7d,-0.9) (8d,-0.9) (9d,-0.9) (10d,-0.9) (11d,-0.9) (12d,-0.9) (13d,-0.9) (14d,-0.9) (15d,-0.9) (16d,-0.9) (17d,-0.9) (18d,-0.9) (19d,-0.9) (20d,-0.9) (21d,-0.9) (22d,-0.9) (23d,-0.9) (24d,-0.9) (25d,-0.9) (26d,-0.9) (27d,-0.9) (28d,-0.9) (29d,-0.9) (30d,-0.9) (31d,-0.9) (32d,-0.9) (33d,-0.9) (34d,-0.9) (35d,-0.9) (36d,-0.9) (37d,-0.9) (38d,-0.9) (39d,-0.9) (40d,-0.9) (41d,-0.9) (42d,-0.9) (43d,-0.9) (44d,-0.9) (45d,-0.9) (46d,-0.9) (47d,-0.9) (48d,-0.9) (49d,-0.9) (50d,-0.9) (51d,-0.9) (52d,-0.9) (53d,-0.9) (54d,-0.9) (55d,-0.9) (56d,-0.9) (57d,-0.9) (58d,-0.9) (59d,-0.9) (60d,-0.9) (61d,-0.9) (62d,-0.9) (63d,-0.9) (64d,-0.9) (65d,-0.9) (66d,-0.9) (67d,-0.9) (68d,-0.9) (69d,-0.9) (70d,-0.9) (71d,-0.9) (72d,-0.9) (73d,-0.9) (74d,-0.9) (75d,-0.9) (76d,-0.9) (77d,-0.9) (78d,-0.9) (79d,-0.9) (80d,-0.9) (81d,-0.9) (82d,-0.9) (83d,-0.9) (84d,-0.9) (85d,-0.9) (86d,-0.9) (87d,-0.9) (88d,-0.9) (89d,-0.9) (90d,-0.9) (91d,-0.9) (92d,-0.9) (93d,-0.9) (94d,-0.9) (95d,-0.9) (96d,-0.9) (97d,-0.9) (98d,-0.9) (99d,-0.9) (100d,-0.9) (101d,-0.9) (102d,-0.9) (103d,-0.9) (104d,-0.9) (105d,-0.9) (106d,-0.9) (107d,-0.9) (108d,-0.9) (109d,-0.9) (110d,-0.9) (111d,-0.9) (112d,-0.9) (113d,-0.9) (114d,-0.9) (115d,-0.9) (116d,-0.9) (117d,-0.9) (118d,-0.9) (119d,-0.9) (120d,-0.9) (121d,-0.9) (122d,-0.9) (123d,-0.9) (124d,-0.9) (125d,-0.9) (126d,-0.9) (127d,-0.9) (128d,-0.9) (129d,-0.9) (130d,-0.9) (131d,-0.9) (132d,-0.9) (133d,-0.9) (134d,-0.9) (135d,-0.9) (136d,-0.9) (137d,-0.9) (138d,-0.9) (139d,-0.9) (140d,-0.9) (141d,-0.9) (142d,-0.9) (143d,-0.9) (144d,-0.9) (145d,-0.9) (146d,-0.9) (147d,-0.9) (148d,-0.9) (149d,-0.9) (150d,-0.9) (151d,-0.9) (152d,-0.9) (153d,-0.9) (154d,-0.9) (155d,-0.9) (156d,-0.9) (157d,-0.9) (158d,-0.9) (159d,-0.9) (160d,-0.9) (161d,-0.9) (162d,-0.9) (163d,-0.9) (164d,-0.9) (165d,-0.9) (166d,-0.9) (167d,-0.9) (168d,-0.9) (169d,-0.9) (170d,-0.9) (171d,-0.9) (172d,-0.9) (173d,-0.9) (174d,-0.9) (175d,-0.9) (176d,-0.9) (177d,-0.9) (178d,-0.9) (179d,-0.9) (180d,-0.9) (181d,-0.9) (182d,-0.9) (183d,-0.9) (184d,-0.9) (185d,-0.9) (186d,-0.9) (187d,-0.9) (188d,-0.9) (189d,-0.9) (190d,-0.9) (191d,-0.9) (192d,-0.9) (193d,-0.9) (194d,-0.9) (195d,-0.9) (196d,-0.9) (197d,-0.9) (198d,-0.9) (199d,-0.9) (200d,-0.9) (201d,-0.9) (202d,-0.9) (203d,-0.9) (204d,-0.9) (205d,-0.9) (206d,-0.9) (207d,-0.9) (208d,-0.9) (209d,-0.9) (210d,-0.9) (211d,-0.9) (212d,-0.9) (213d,-0.9) (214d,-0.9) (215d,-0.9) (216d,-0.9) (217d,-0.9) (218d,-0.9) (219d,-0.9) (220d,-0.9) (221d,-0.9) (222d,-0.9) (223d,-0.9) (224d,-0.9) (225d,-0.9) (226d,-0.9) (227d,-0.9) (228d,-0.9) (229d,-0.9) (230d,-0.9) (231d,-0.9) (232d,-0.9) (233d,-0.9) (234d,-0.9) (235d,-0.9) (236d,-0.9) (237d,-0.9) (238d,-0.9) (239d,-0.9) (240d,-0.9) (241d,-0.9) (242d,-0.9) (243d,-0.9) (244d,-0.9) (245d,-0.9) (246d,-0.9) (247d,-0.9) (248d,-0.9) (249d,-0.9) (250d,-0.9) (251d,-0.9) (252d,-0.9) (253d,-0.9) (254d,-0.9) (255d,-0.9) (256d,-0.9) (257d,-0.9) (258d,-0.9) (259d,-0.9) (260d,-0.9) (261d,-0.9) (262d,-0.9) (263d,-0.9) (264d,-0.9) (265d,-0.9) (266d,-0.9) (267d,-0.9) (268d,-0.9) (269d,-0.9) (270d,-0.9) (271d,-0.9) (272d,-0.9) (273d,-0.9) (274d,-0.9) (275d,-0.9) (276d,-0.9) (277d,-0.9) (278d,-0.9) (279d,-0.9) (280d,-0.9) (281d,-0.9) (282d,-0.9) (283d,-0.9) (284d,-0.9) (285d,-0.9) (286d,-0.9) (287d,-0.9) (288d,-0.9) (289d,-0.9) (290d,-0.9) (291d,-0.9) (292d,-0.9) (293d,-0.9) (294d,-0.9) (295d,-0.9) (296d,-0.9) (297d,-0.9) (298d,-0.9) (299d,-0.9) (300d,-0.9) (301d,-0.9) (302d,-0.9) (303d,-0.9) (304d,-0.9) (305d,-0.9) (306d,-0.9) (307d,-0.9) (308d,-0.9) (309d,-0.9) (310d,-0.9) (311d,-0.9) (312d,-0.9) (313d,-0.9) (314d,-0.9) (315d,-0.9) (316d,-0.9) (317d,-0.9) (318d,-0.9) (319d,-0.9) (320d,-0.9) (321d,-0.9) (322d,-0.9) (323d,-0.9) (324d,-0.9) (325d,-0.9) (326d,-0.9) (327d,-0.9) (328d,-0.9) (329d,-0.9) (330d,-0.9) (331d,-0.9) (332d,-0.9) (333d,-0.9) (334d,-0.9) (335d,-0.9) (336d,-0.9) (337d,-0.9) (338d,-0.9) (339d,-0.9) (340d,-0.9) (341d,-0.9) (342d,-0.9) (343d,-0.9) (344d,-0.9) (345d,-0.9) (346d,-0.9) (347d,-0.9) (348d,-0.9) (349d,-0.9) (350d,-0.9) (351d,-0.9) (352d,-0.9) (353d,-0.9) (354d,-0.9) (355d,-0.9) (356d,-0.9) (357d,-0.9) (358d,-0.9) (359d,-0.9) \. pgsphere-1.5.1/doc/000077500000000000000000000000001461140101500140715ustar00rootroot00000000000000pgsphere-1.5.1/doc/Makefile000066400000000000000000000063231461140101500155350ustar00rootroot00000000000000#---------------------------------------------------------------------------- # # pgSphere documentation generation # #---------------------------------------------------------------------------- ifndef PGSPHERE_VERSION include ../Makefile.common.mk ifndef PGSPHERE_VERSION $(error PGSPHERE_VERSION is not set) endif endif ifndef FOP FOP = fop endif ifdef XMLLINT XMLLINT := $(XMLLINT) --nonet else XMLLINT = xmllint --nonet endif ifdef XSLTPROC XSLTPROC := $(XSLTPROC) --nonet else XSLTPROC = xsltproc --nonet endif override XSLTPROCFLAGS += \ --path stylesheets --path img --path . \ --stringparam pg_sphere.version '$(PGSPHERE_VERSION)' \ --stringparam pg.version '$(PGSPHERE_VERSION)' XMLINCLUDE = --path . ALLSGML := $(wildcard *.sgm) ALLIMAGES := $(wildcard img/*.jpg) all: html pdf .PHONY: all html pdf clean # This line fixes the error like: # No rule to make target 'pg_sphere.control' .PHONY: pg_sphere.control version.xml: @echo $(PGSPHERE_VERSION) > version.xml pg_sphere-full.xml: version.xml pg_sphere-full.xml: pg_sphere.xml $(ALLSGML) $(XMLLINT) $(XMLINCLUDE) --output $@ --noent --valid $< #------------------------------------------------------------------------------ # HTML #------------------------------------------------------------------------------ XSLTPROC_HTML_MULTIPAGE_FLAGS := --stringparam img.src.path '' XSLTPROC_HTML_SINGLEPAGE_FLAGS := --stringparam img.src.path '' html: html-singlepage html-multipage html-multipage: stylesheets/stylesheet.xsl pg_sphere-full.xml version.xml $(ALLIMAGES) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_MULTIPAGE_FLAGS) $(wordlist 1,2,$^) mkdir -p html/img cp $(ALLIMAGES) html/img html-singlepage: pg_sphere-$(PGSPHERE_VERSION).html pg_sphere-$(PGSPHERE_VERSION).html: stylesheets/stylesheet-html-nochunk.xsl pg_sphere-full.xml version.xml $(ALLIMAGES) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_SINGLEPAGE_FLAGS) -o $@ $(wordlist 1,2,$^) #------------------------------------------------------------------------------ # PDF #------------------------------------------------------------------------------ pdf: pg_sphere-${PGSPHERE_VERSION}-A4.pdf pg_sphere-${PGSPHERE_VERSION}-US.pdf pg_sphere-$(PGSPHERE_VERSION)-A4.pdf: pg_sphere.A4.fo $(FOP) -v -fo $< -pdf $@ pg_sphere-$(PGSPHERE_VERSION)-US.pdf: pg_sphere.US.fo $(FOP) -v -fo $< -pdf $@ pg_sphere.A4.fo: stylesheets/stylesheet-fo.xsl pg_sphere-full.xml version.xml $(ALLIMAGES) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type A4 -o $@ stylesheets/stylesheet-fo.xsl pg_sphere-full.xml pg_sphere.US.fo: stylesheets/stylesheet-fo.xsl pg_sphere-full.xml version.xml $(ALLIMAGES) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USLetter -o $@ stylesheets/stylesheet-fo.xsl pg_sphere-full.xml #------------------------------------------------------------------------------ # Cleanup #------------------------------------------------------------------------------ clean distclean: rm -rf ./html rm -f version.xml rm -f pg_sphere-full.xml rm -f pg_sphere.A4.fo rm -f pg_sphere.US.fo rm -f pg_sphere-$(PGSPHERE_VERSION).html rm -f pg_sphere-$(PGSPHERE_VERSION)-A4.pdf rm -f pg_sphere-$(PGSPHERE_VERSION)-US.pdf pgsphere-1.5.1/doc/appendixes.sgm000066400000000000000000000040211461140101500167360ustar00rootroot00000000000000 Appendix Changes from version 1.0 to 1.1 Speed up index query time. The index scan is much faster than in 1.0. Remove B-tree index. It was used to cluster the index. This version is compatible to PostgreSQL 8.4 Changes from version 1.1 to 1.1.5 Modify behavior of function set_sphere_output_precision. Compatibility with PostgreSQL 9.2 and later. Creating spath and spolygon objects "as aggregate" from tables should now work. Improved accuracy of spoint (great circle) distance calculation. Add new contains operators consistent with the geometry operators of the plain used in PostgreSQL 8.2 and later: <@ and @>, the old operators @ and ˜ still work. Improved correctness of spatial indexing. pgsphere-1.5.1/doc/constructors.sgm000066400000000000000000000452111461140101500173540ustar00rootroot00000000000000 Constructors Constructors within pgSphere are functions needed to create spherical data types from other data types. For actual use, there isn't a difference to usual PostgreSQL functions. pgSphere constructor functions are named by returned data type. Constructor functions expecting one parameter only are implemented as casting operators, too. These are not mentioned here. Point There is only one constructor function for spherical points. spoint float8 lng float8 lat where lng is the longitude of the spherical point in radians, lng is the latitude of the spherical point in radians. A spherical point from longitude and latitude Get a spherical position with 270° of longitude and -30° of latitude. SELECT spoint ( 270.0*pi()/180.0,-30.0*pi()/180.0 ) AS spoint;]]> Euler transformation There are two constructor functions for an Euler transformation: strans float8 phi float8 theta float8 psi strans float8 phi float8 theta float8 psi character axis where phi, theta and psi are the three angles of Euler transformation. The fourth parameter is the three letter code of Euler the transformation axis. If that parameter is omitted, pgSphere will assume ZXZ. For more information about that parameter, see . Create an Euler transformation object Create a transformation object to rotate a spherical object counterclockwise, first 20° around the x-axis, second -270° around the z-axis, and last 70.5° around the y-axis. SELECT strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY');]]> Circle The function scircle spoint center float8 radius returns a spherical circle with center at center and a radius radius in radians. The circle radius has to be larger than or equal to zero but less or equal to 90°. Otherwise, this function returns an error. A circle around the north pole Get a spherical circle around the North Pole with a radius of 30°. SELECT set_sphere_output('DEG');]]> SELECT scircle ( spoint '(0d,90d)', 30.0*pi()/180.0 );]]> ]]> Line The input of spherical lines using Euler transformation and length is quite circumstantial (see ). For short lines it is easier to input a line specifying the beginning and the end of the line. sline spoint begin spoint end If the distance between begin and end is 180° (&pg_pgr;), this function returns an error because the location of the line is undefined. However, if longitudes of begin and end are equal, pgSphere assumes a meridian and returns the corresponding spherical line. A line created using begin and end of line A line starting at spoint '(270d,10d)' and ending at spoint '(270d,30d)': SELECT set_sphere_output('DEG')]]> SELECT sline( spoint '(270d,10d)', spoint '(270d,30d)');]]> Furthermore, there is a function for inputing a line using Euler transformation trans and line length length sline strans trans float8 length where the line length length must be given in radians. A line created with its transformation and length The same line as in , but using transformation and line length. SELECT sline ( strans '10d, 90d, 270d, ZXZ', 20.0*pi()/180.0 );]]> Ellipse You can use the function sellipse spoint center float8 major_rad float8 minor_rad float8 incl to create a spherical ellipse. The first parameter center is the center of ellipse. The parameter major_rad and minor_rad are the major and the minor radii of the ellipse in radians. If the major radius is smaller than minor radius, pgSphere swaps the values automatically. The last parameter incl is the inclination angle in radians. For more informations about ellipses, see . Create an ellipse An ellipse with a center at 20° of longitude and 0° of latitude. The minor radius is part of the equator. The major radius has a size of 10°. The minor radius has 5°. SELECT set_sphere_output('DEG');]]> SELECT sellipse ( spoint '( 20d, 0d )', 10.0*pi()/180.0, 5.0*pi()/180.0,]]> ]]> Polygon The functions spoly and spoly_deg can be used to create spherical polygons. Function spoly is overloaded and can accept arrays of float8 or spoint elements. There are the same restrictions as for using the input function of spherical polygon (see ). Create a spherical polygon from an array of pair-consecutive numbers (lng, lat). The coordinates are specified in radians. SELECT spoly(ARRAY[0, 0, 0, 0.5, 0.5, 0.5, 0.5, 0])]]> Create a spherical polygon from an array of spoint elements. SELECT spoly(ARRAY[spoint(0, 0), spoint(0, 0.5), spoint(0.5, 0.5), spoint(0.5, 0)])]]> Create a spherical polygon from an array of pair-consecutive numbers (lng, lat). The coordinates are specified in degrees. SELECT spoly_deg(ARRAY[0, 0, 0, 10, 10, 10, 10, 0])]]> The aggregate function spoly can be used to create a polygon from a set of spherical points. The function returns NULL, if the polygon could not be created. Create a spherical polygon using a set of spherical points Create a table and put in some spherical points with a unique ID. Then, create two polygons with different edge sequences. SELECT set_sphere_output('DEG');]]> CREATE TABLE points ( i int PRIMARY KEY, p spoint );]]> INSERT INTO points VALUES (1, '( 0d, 0d)');]]> INSERT INTO points VALUES (2, '(10d, 0d)');]]> INSERT INTO points VALUES (3, '( 0d,10d)');]]> SELECT spoly(data.p) FROM ( SELECT p FROM points ORDER BY i ASC ) AS data ;]]> SELECT spoly(data.p) FROM ( SELECT p FROM points ORDER BY i DESC ) AS data ;]]> Path Similar to spherical polygons, you can use the aggregate function spath spoint edge to create a spherical path using a set of spherical points. There are the same restrictions as with the input function of spherical path (see ). The function returns NULL if the path couldn't be created. Create a spherical path using a set of spherical points Create a table and put in some spherical points with a unique ID. Then, create a spherical path from it. SELECT set_sphere_output('DEG');]]> CREATE TABLE points ( i int PRIMARY KEY, p spoint );]]> INSERT INTO points VALUES (1, '( 0d, 10d)');]]> INSERT INTO points VALUES (2, '( 0d, 0d)');]]> INSERT INTO points VALUES (3, '( 0d,-10d)');]]> SELECT spath(data.p) FROM ( SELECT p FROM points ORDER BY i ASC ) AS data ;]]> SELECT spath(data.p) FROM ( SELECT p FROM points ORDER BY i DESC ) AS data ;]]> Coordinates range The function sbox spoint south_west spoint north_east creates an sbox object with its first parameter south_west as the southwest edge and its second parameter northeast as the north-east edge of the coordinates range. Create a spherical box using edges A coordinate range between 0° and +10° in latitude and longitude. SELECT sbox ( spoint '(0d,0d),(10d,10d)' );]]> <type>smoc</type> smoc order int spoint creates a single-pixel smoc of the given order at spoint smoc_disc order int lng double precision lat double precision radius double precision smoc order int scircle creates an smoc of the given order covering the circle smoc order int spoly creates an smoc of the given order covering the spoly pgsphere-1.5.1/doc/examples.sgm000066400000000000000000000071361461140101500164260ustar00rootroot00000000000000 Examples Astronomical Coordinates transformation A commonly used task is a coordinate transformation. With the parameters of a new coordinate system (plane) relative to an old one, &pg_OHgr; longitude of the ascending node angle between line of nodes and the zero point of longitude in the old plane. &pg_ohgr; argument of pericenter the angle from the ascending node to the position in the new plane. i inclination angle between the new plane and the old plane. you can do a transformation of an object object from an old into a new coordinate system using: object - strans '&pg_ohgr;, i, &pg_OHgr;' or object - strans (&pg_ohgr;, i, &pg_OHgr;) Otherwise, for a transformation of an object object from the new into the old coordinate system, use the operator +: object + strans '&pg_ohgr;, i, &pg_OHgr;' or object + strans (&pg_ohgr;, i, &pg_OHgr;) perihelion and aphelion coordinates of a comet's orbit We are assuming the orbital elements of a comet are &pg_OHgr;=30°, i=60° and &pg_ohgr;=90°. We get the spherical position of perihelion and aphelion with: SELECT set_sphere_output('DEG');]]> SELECT spoint '(0,0)' + strans '90d,60d,30d' AS perihelion;]]> SELECT spoint '(180d,0)' + strans '90d,60d,30d' AS aphelion;]]> pgsphere-1.5.1/doc/faq.sgm000066400000000000000000000001711461140101500153470ustar00rootroot00000000000000 FAQ tbw pgsphere-1.5.1/doc/functions.sgm000066400000000000000000001055721461140101500166230ustar00rootroot00000000000000 Functions The functions described below are implemented without having an operator. If you are missing some functions, see and use the operators. Area function The area function returns the area of a spherical object in square radians. Supported data types are: scircle, spolygon, sbox, smoc. The polygon should be convex, otherwise the behaviour is undefined. Area of a spherical circle as a multiple of &pg_pgr; SELECT area( scircle '<(0d,90d),60d>' ) / pi() AS area;]]> Area of a Multi-Order Coverage (MOC) object SELECT area(smoc '0/1-3');]]> <type>spoint</type> functions Longitude and latitude The functions long spoint p lat spoint p returns the longitude or latitude value of a spherical position p in radians. Get the longitude and latitude of a spherical point in degrees SELECT long ( spoint '(10d,20d)' ) * 180.0 / pi() AS longitude;]]> SELECT lat ( spoint '(10d,20d)' ) * 180.0 / pi() AS latitude;]]> Cartesian coordinates The functions x spoint p y spoint p z spoint p return the Cartesian x, y or z value of a spherical position p. The returned values are always between -1.0 and +1.0. Get the Cartesian <literal>z</literal>-value of a spherical point SELECT z ( spoint '(10d,-90d)' ) AS z;]]> You can get a float8 array of Cartesian values using the function xyz spoint p Get the Cartesian values of a spherical point SELECT xyz ( spoint '(0d,0d)' ) AS cart;]]> Point-within-distance function The function spoint_dwithin spoint p1 spoint p2 float8 radius returns a boolean value that signifies whether the points p1 and p2 lie within distance radius (in radians) of each other, i.e. it computes the boolean expression p1 <-> p2 <= radius. On PostgreSQL 12 and later, the function has GiST support and the PostgreSQL optimizer will transform it to either p1 <@ scircle(p2, radius) or p2 <@ scircle(p1, radius) where appropriate. Efficiently join two tables of points with some fuzziness permitted SELECT * FROM stars1 JOIN stars2 WHERE spoint_dwithin(stars1.s, stars2.s, 1e-5);]]> <type>strans</type> functions Converting to ZXZ Using the function strans_zxz(strans), you can convert an Euler transformation to ZXZ axes transformation. Change the transformation axes to <literal>ZXZ</literal> Convert the transformation strans '20d, -270d, 70.5d, XZY' to a ZXZ transformation. SELECT strans_zxz ( strans '20d, -270d, 70.5d, XZY' );]]> Angles and axes It is possible to get the components of an Euler transformation. Getting Euler transformation attributes function description phi first angle of a transformation theta second angle of a transformation psi third angle of a transformation axes transformation axes as a three letter code
The angles will always returned as a float8 value in radians. The axes are returned as a three letter code. Get the second axis and its rotation angle SELECT theta( strans '20d,30d,40d,XZY' ) * 180 / pi() AS theta;]]> SELECT substring ( axes ( strans '20d,30d,40d,XZY' ) from 2 for 1 ) AS axis;]]>
scircle functions You can get the radius of a spherical circle in radians using the radius function. The center of the circle is available with the operator @@ (). Radius of a spherical circle in degrees SELECT 180.0 * radius( scircle '<(0d,90d),60d>' ) / pi() AS radius;]]> <type>sellipse</type> functions pgSphere provides 4 functions to get the parameters of a spherical ellipse: Getting spherical ellipse attributes function description lrad the major radius of the ellipse srad the minor radius of the ellipse center the center of the ellipse inc the inclination of the ellipse
To get the ellipse center, you can use the operator @@ () instead of using the function center(sellipse). Get the minor radius of an ellipse SELECT srad ( sellipse '< { 10d, 5d }, ( 20d, 0d ), 90d >' )]]>
<type>sline</type> functions Begin and end To get the beginning and the end of a line, pgSphere provides two functions: sl_beg sline line sl_end sline line Get the beginning of a line SELECT sl_beg( sline '(10d, 90d, 270d, ZXZ ), 20d';]]> Create a meridian You can create a meridian as a line using the function meridian float8 lng The function returns a line starting at a latitude of -90° and ending at a latitude of 90°. The line goes along the given longitude lng in radians. A meridian for longitude 20° SELECT set_sphere_output('DEG');]]> SELECT meridian (20.0 *pi() / 180.0 );]]> <type>spath</type> functions Count of points You can get the count of points of a spherical path using the function: npoints spath path Count of spath's points SELECT npoints ( spath '{(0,0),(1,0)}' );]]> Positions at a path pgSphere provides three functions to get points at a path. spoint spath path int4 i spoint spath path float8 f spath_as_array spath path The first function returns the i-th point of a path. If i is less than 1 or larger than the count of spath points, the function returns NULL. The second function does nearly the same, but does linear interpolation between edge positions. Get the “center” of a one segment <type>spath</type> SELECT spoint ( spath '{(0d,0d),(30d,0d)}', 1.5 );]]> Get i-th point of a path SELECT spoint( spath '{(0, 0),(1, 1)}', 1 );]]> SELECT spoint( spath '{(0, 0),(1, 1)}', 2 );]]> Get array representation of points SELECT spath_as_array( spath '{(0, 0),(1, 1)}');]]> <type>spoly</type> functions Count of edges Similar to an spath (), you can get the count of edges of a spherical polygon using the function: npoints spoly polygon Count of edges of a spherical polygon SELECT npoints ( spoly '{(0,0),(1,0),(1,1)}' );]]> Positions at a polygon pgSphere provides two functions to get points at a path. spoint spoly path int4 i spoly_as_array spath path Get by index SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 1 );]]> SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 2 );]]> SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 3 );]]> Represent points as array SELECT spoly_as_array( spoly '{(0,0),(1,0),(1,1)}' );]]> Spoly is convex Returns true if the specified spherical polygon is convex. Returns false otherwise. spoly_is_convex spoly polygon Check if polygon is convex SELECT spoly_is_convex( spoly '{(0,0),(1,0),(1,1),(1,2)}' );]]> <type>sbox</type> functions The functions sw sbox box ne sbox box se sbox box nw sbox box return the corresponding southwest, northeast, southeast, or northwest edge. The returned value will be a spherical point. The southwest edge of a box SELECT sw ( sbox '( (0d,0d), (90d,0d) )' ) ;]]> <type>smoc</type> functions smoc_info smoc Returns information about the internal representation of the smoc. A circle SELECT smoc_info('0/4 1/0 2 12-13 34-35 45 47 2/4 6 12 14 56-57 60-61 88 90-91 116-117 119 130-131 134-135 177 179 185 187');]]> smoc_degrade order int smoc Adjusts the order of an smoc to be more or less precise. When order is smaller than smoc's maximal order, the MOC resolution is degraded to the new order, and its maximal order is set to that order. When order is larger than the smoc's maximal order, smoc's shape is not modified, but its maximal order is raised to order. sum smoc intersection smoc smoc union and intersection are available as aggregate functions that compute the aggretated coverage over a given column. Computing the overall coverage of a catalog max_order smoc Returns the maximal order of an smoc. The maximal order of a MOC can be higher than than the highest order appearing in the serialisation. For instance, in the example below the full-sky coverage given at order 6 means that no patch larger than about 1 degree is not covered. In the ASCII serialisation, give the maximum order with an with an empty cell list. Obtaining a MOC order Epoch propagation 6-Parameter Epoch Propagation double precision[6] epoch_prop spoint pos double precision parallax double precision pm_long double precision pm_lat double precision radial_velocity double precision delta_t Propagates a spherical phase vector in time (in particular, applies proper motion to positions) Following both pg_sphere and, where missing, astronomical conventions makes units somewhat eclectic here; pm_long and pm_lat need to be in rad/yr, whereas parallax is in mas, and radial_velocity in km/s. The time difference must be in (Julian) years. This function returns a 6-array of [long, lat, parallax, pm_long, pm_lat, radial_velocity] of the corresponding values delta_t years after the reference epoch for the original position. As in the function arguments, long and lat are in rad, pm_lon and pm_lat are in rad/yr, parallax is in mas, and radial_velocity is in km/s. If you are only interested in the position, consider the epoch_prop_pos functions below that have a somewhat less contorted signature. It is an error to have either pos or delta_t NULL. For all other arguments, NULLs are turned into 0s, except for parallax, where some very small default is put in. In that case, both parallax and radial_velocity will be NULL in the output array. This uses the rigorous method derived in "The Hipparcos and Tycho Catalogues", ESA Special Publication 1200 (1997), p 94f. It does not take into account relativistic effects, and it also does not account for secular aberration. Propagating Barnard's star into the past Epoch Propagation of Positions Only spoint epoch_prop_pos spoint pos double precision parallax double precision pm_long double precision pm_lat double precision radial_velocity double precision delta_t spoint epoch_prop_pos spoint pos double precision pm_long double precision pm_lat double precision delta_t These are simplified versions of epoch_prop returning only spoints; the propagated values for the other coordinates are discarded (but still internallay computed; these functions do not run any faster than epoch_prop itself). As with epoch_prop itself, missing values (except for pos and delta_t) are substituted by 0 (or a very small value in the case of parallax). Barnard's star, position and proper motion
pgsphere-1.5.1/doc/gen_moccast.py000066400000000000000000000103411461140101500167240ustar00rootroot00000000000000# A script to create the automatic casts for overlaps and intersects # between MOCs and spolys/scircles. # # This has originally been used to create pg_sphere--1.2.0--1.2.1.sql. # Before 1.2.1 is release, this can be fixed to improve that SQL. # After the 1.2.1 release, this is just documentation on how MOC # casts were generated that is perhaps just a bit more readable than # that bunch of SQL. import datetime import re import sys OVERLAP_DEFS = [ # func_stem, operator, commutator ('subset', '<@', '@>'), ('not_subset', '!<@', '!@>'), ('superset', '@>', '<@'), ('not_superset', '!@>', '!<@'), ] INTERSECT_DEFS = [ # func_stem, operator, commutator ('intersect', '&&', '&&'), ('not_intersect', '!&&', '!&&'), ] GEO_TYPES = ["scircle", "spoly"] OP_DEFS = OVERLAP_DEFS class Accum: """an accumulator for our output. """ def __init__(self): self.parts = [] @property def content(self): return "".join(self.parts) def write(self, s): self.parts.append(s) def writeln(self, *strings): self.parts.append("\n".join(strings)+"\n") def replace_last(self, subs): """replaces the last non-whitespace char with the string subs. """ for index, part in enumerate(reversed(self.parts)): if part.strip(): break else: # nothing to replace return index = -1-index self.parts[index] = re.sub("[^\s](\s*)$", lambda mat: subs+mat.group(1), self.parts[index]) def introduce_section(self, sec_name): self.writeln() self.writeln("-- #################################") self.writeln(f"-- {sec_name}") def emit_drop_code(accum): accum.introduce_section("Cleanup") accum.writeln("DROP OPERATOR IF EXISTS") for _, op, _ in OP_DEFS: for geo_type in GEO_TYPES: accum.writeln(f" {op} (smoc, {geo_type}),") accum.writeln(f" {op} ({geo_type}, smoc),") accum.replace_last(";") def make_negator(op): if op.startswith("!"): return op[1:] else: return "!"+op def emit_op_def(accum, operator, leftarg, rightarg, procedure, commutator): accum.writeln( f"CREATE OPERATOR {operator} (", f" LEFTARG = {leftarg},", f" RIGHTARG = {rightarg},", f" PROCEDURE = {procedure},", f" COMMUTATOR = '{commutator}',", f" NEGATOR = '{make_negator(operator)}',", f" RESTRICT = contsel,", f" JOIN = contjoinsel", f");") def emit_op_and_func(accum, op_def): func_stem, operator, commutator = op_def for geo_type in GEO_TYPES: func_name = f"{geo_type}_{func_stem}_smoc" accum.writeln( f"CREATE OR REPLACE FUNCTION {func_name}(", f" geo_arg {geo_type}, a_moc smoc) RETURNS BOOL AS $body$", f" SELECT smoc(max_order(a_moc), geo_arg) {operator} a_moc", f" $body$ LANGUAGE SQL STABLE;") emit_op_def(accum, operator, geo_type, "smoc", func_name, commutator) accum.writeln() func_name = f"smoc_{func_stem}_{geo_type}" accum.writeln( f"CREATE OR REPLACE FUNCTION {func_name}(", f" a_moc smoc, geo_arg {geo_type}) RETURNS BOOL AS $body$", f" SELECT a_moc {operator} smoc(max_order(a_moc), geo_arg)", f" $body$ LANGUAGE SQL STABLE;") emit_op_def(accum, operator, "smoc", geo_type, func_name, commutator) accum.writeln() def main(): accum = Accum() accum.writeln("-- MOC/geometry automatic casts.") accum.writeln(f"-- Generated {datetime.date.today()} by {sys.argv[0]}.") accum.writeln(f"-- Re-generation needs to be triggered manually.") accum.writeln() emit_drop_code(accum) accum.introduce_section(" smoc/geo OVERLAPS") for op_def in OVERLAP_DEFS: emit_op_and_func(accum, op_def) accum.writeln() accum.introduce_section(" smoc/geo INTERSECTS") for op_def in INTERSECT_DEFS: emit_op_and_func(accum, op_def) accum.writeln() print(accum.content) if __name__=="__main__": main() pgsphere-1.5.1/doc/img/000077500000000000000000000000001461140101500146455ustar00rootroot00000000000000pgsphere-1.5.1/doc/img/Makefile000066400000000000000000000004171461140101500163070ustar00rootroot00000000000000# Graphics EPS = logo.eps sbox.eps scircle.eps sellipse.eps sline.eps spath.eps sphere.eps spoint.eps spoly.eps strans.eps CONVERT = convert all: eps eps : $(EPS) %.eps: %.jpg $(CONVERT) $< eps:$@ %.eps: %.png $(CONVERT) $< eps:$@ clean : rm -f $(EPS) pgsphere-1.5.1/doc/img/logo.png000066400000000000000000002765771461140101500163430ustar00rootroot00000000000000PNG  IHDRP1-WbKGD pHYs.#.#x?vtIME 1 IDATxieǑ%h{[.$SD2@]յH%Vii"E2x/2IQKDJ|H<2ExرchfpS:=SSpGr!!"")NfFʹqۦGu3jS 3"O?6L4:Oޟ)N@]T۾Ϟ>{~s똹s|J8=Uu׶7jin*_YY]ߌk]z:GNqc׫ӛvۧc2Pc"v.~c=??ow dvFOqR9ám]׶nߵ}ץc*bbHףz4Vs ,Uuykw !>8~')u}]mu]m+}bߥRbק> :F캮:Ue7uj8~c|xr)v?,7nls9SB>ԧ~wh*C3 a>.ɧs΅TFMRT{?u][8}>Oq9>6f{\n>fJmݾ]w&Y(Ƥ"nvK]}ɧιjvÌ)bA?1ffb>>?ףpA_s5+vz^?_.7}wJjf``b 9]۵ám!>"brMʡGz߶O&oyq\x<}~xuaz/ݏ>{d~C:_N'u3)6vwwvwhC!x:"d>ŮK;4R׶WUvv9<3w}]>|,䓛Go=;SMEf}[~5:{ëSS?+x9t]uv=}{RTUJ_:$b>emۮv>mJI51"wHnS0Ţ*[ifv8',K]Ez2~4 ]rCClO?o‹iUUBWfvO?Y6!e9P !&g1u}ߧeIIrAT"WCU]1npy8kqX4,WO?{z$fJ`H`dCTs}cJ}]]NDb9 ]EDHLK _ϟ=8t2 2\7Tm'{B`1 .dU5C029?_6_7u]O&SW}z5 "043D@&4#3R#,gccE#&ɥ k;Q=pcmS~&or4j^ƼsR.6"`B&B &F/ff"Um;^D?zFS*Wfn*3" Af 1徏d"Ir5^R9ޥs@L޸%!M""mghNnWPsM>8dbD$@LUP2%DE&DDC "f"U_埼["ɓ'WWW4NS|ODx4ͅQ,-fY̜TDEQTE$V!:fqf2EQUcB@1;6v/. UuqyE{`fYE@٘T LM$s1+cDX!$V5b6onn?z߿;ūxĦr)dIYLD@L@KD nVIS)ݵUP՗.LDDR$g[ǜ95@Xi|@"@Dǎj@S0-LД  @{vh;o?zWgt2ٍڶ,)$eU5Ք"@q\_1YNhVgcLyeT1 "Ɣ9e5hl"U],ϯō9Lgd$d癘Ej vD>AR#CSD@BD5h3ӛoo:Yk<xwUb,*fff4  W ``YT _vJ9gyt1;SۮU0EZUD$f`_$jP(ry@4dzӿ?{CBN֚xEhf YDr:D<*hŕ /#4hERu\Ux6e5>nIɆ>0T  #r 385SGg~Go|;XSGDI1ABh mЫQMTK./~酂dty|F5cώw1u@1!!9G$$bs,כ?;O<9???}vOJXPޮպQ5\h65UPpQIh- *5M⦅-s3鲒:8Ԉii LEUJ+͐ٱUU3 "  fղ>|曏NUuw8ܮ6}dJj]܋ 91gQ3U pꅴKD!b^Ov\쯟wG}[.8bJHTr)ҡSr9*TUfVUEsÈ EY$jmQo-NSofRxabE˝X rjUr /cTEU ̡ |~6|ی:U??m~|tgBUaRB"b$g5.ŔF{Q(H֬fxnۧ70$7x5~ۦJ] l^fX/_⏯iD{_5hqƾ||6ToWe~oW?MQŦ <45mkB'Dbץc۩)4o&9SJQp\^7x%K_ <Ñt7P,2njYK~59iwUB%..^[_9&}< ޻ΞO˿6_W/../1ž떷+l>s!vߩ1i2uJ,j`hSc})f$b^{wyw>}O<h&14F%S4+\j q+*૪LgySy,Lח[V7gSzFxBUA}ui>}rHvNZo! (6@4$9sNYrJj}Ǐs;` z6&,)dP505 K" @D[AU-%ȥuh_v #!q]\>wrT)Ů@cIߏeltTx`% ֛Q^,$8Gb E-SJ9d1B4rD٥蓧?G|oļԼ<?0ժkaMApJ:wH_Vb#TWWϧ!ֻd:}&͞u۟:WGﺛ;jD$'Ѹ<7սiSgGLTZX &Rѡ:A$@.c&e?^?NGQ] E5e;"DdY,mG!-C lٍJ=K % ;nF{znw7l|1WҧOl ox /lǠwnM'|FL~jUeHGB0`U@4$%v30]\pb2iOB.ϧɯ~94cSvc&l7Mi z? è TՆ1+Πא,2Dri6Gf=ލƣݿzp8;>Ŕ*<|{W|ӟ>Z8eG߲ѻc:LFDSbLkl6 ~hZ>||h59"S"r1C׭6fl}/";odz6NF7p= _I1+)gZBS3YS.6H!ڻ۹zwj53d̦ߟg\l_{BP ^lnvrsY޽$0f),y4_f񈈞<{OoiuϻnOɟ̮q'4 dB0$* Fv:Q]ODDd177mL|6$Ͷm#~_jTU]ߵ]Z#thv ''B͊ʭ, Y+vCҡ,pBDtՁF_/;֜?tE}x/ X[GQR˒]|*}͟{OAw3˙Q9 K}D*j꺪|s9frn2jƣvXo91:7Y/4S61{wJ'vw\CB(`&¬,`VK K%ejX/`ijz>Lh:upدWPfBTѾwCT;v)*䙪 YR͸>?M_enfoQkbhifdP,.P>C6TCi6~݊"fUPb@q=re@DE$1u1Z8$U]'lJ]>/R@%/e~_݆CUUaӈA#9D5K&Q]WQO?y޺ݓa}춑Ѵ1ShlшЌ jvښ#"牉 {0"{g-AL=t朓?YD rƾgb i&;k&bUA-bep0:V"̪\^`ǡgd~uьƁC3lbMC"v??ysnFMniOǓivb)d\OG9U}߃w,5.@re~9l@he^D%isnY51{F<Hϒchr;t! !?,)uիooNS]l.8$DsJD& @TP 9&7Gn>/|%СN"f78bBABgdLMSؔBl4Y,Fә  LPFSSFl>;"h:* ?yu3zc(XE=kjfgX-zvh~w&՜ࡕ wwr>vGdr: ODrUC"V0C5ERBf% @9x:& 60*n92^;h9g;6Kj,D 0XB&" UU`")<Tz̼Zo~G)& {/Zwɒ(H5a74DUgvɗImp.b&c3jNRuk01ay&]ًmۧTOV;E&@`6 ղZ&bĮCjWUHKGDr׶1l1MmxTr r ab]?}䣏?]mydYUO1SUYl)1[Z,b_[؀r<w/}5+c$`aTsLU5{ q.&q _] b]Uf>rb@3 H@UIE#ٕZ9mu|>f蜨"[ԗFk @b a&Χ;Wjǟ.WjHH٢fVVQh6"Y(8P=r(;EKo@Q?9W야XBp;@16 IDATBGsTxI)j9B 'ud>l>*"CrD 1%2&"5)8n|(Mr5#_mjvRtͫ63ȊYp4@чgr{{7/(v}hĄD ju*oV;K._03CepHjڳg,asv@!Ș|ǡ T؟UMG.F_/WTcFQ0Thƈ8:f RNA$f|VO} 0 Z |PWK"][zS ! 3=1#evXm50dUi٩,h([uرcUAMvXSfa&s0ݡF'./泋fy*T' E i-wh>!z"VSE$$$b"*]Q lKB$.}Zn 5rc :MW?j C;K/7m.H4P5DN?.:?;f~?e֢}3s|%Dt9rLDι1զX `U ZoGb"J]M5|`DT#G%3# {kPYvؿ$Rn^s Gw BgS0_^abthfl4CdQ y,sT q~5ؽ|(Bp#wvۜJXvۭ6}p83󮮫:Tc'l:me5\/&*znc &&YT>miꪪ|Ĭ*TuhL(V,6o =bKPaXncFP|bl-pK0M9]/ , A !pJ=%1'^++C_|x<⒴K%" f6@H!d- {d*-,>jr1JCIJ| DU# BFdl}FI_\ K(4 R{4-I4Bףz_?7D|uj fޓsHՈ{'vK _y ⨮]\^WK UԷc7MFQU e>0 JJ#}}>}\ae Q2@b,c%gNݠ9Ό*G#10jEHhfe%r9_1ch{BrVA 8ʩ2SB +g͓qmKH` wOLL^GDǓѨlAeѦn(W͜w!WU3dR}eݗu&fx'X \bS1{K3RtZyGU([ ^(_"wKc#%uhܳ QMox0"5G2<+n9Hd̦|cQ8`5CC&$,@@_CXL(/[y@MQ(I_~b6qq7w}^ꚙ"12Wu5LYSf4j꺪flյYE8WMVef,8W|ڲd5UP=ջ2!#" ZKXbߩJ 2f1&B raE1- ghzs ^5΃F@̾ Ҷ)gOow/$9K)%⬮2bq1xⵋyGxAA*,2 IJ㫈 f5'5%"CsHLG ;q,HT|*T%zO-3whfh P,pQ1ՔE%>;.QM|AdI 0+ $;bFŠ$hw9Tf1}{cB bS3Nǣѝjʌx:q_Bva:f$JҐ+wTSsNYt)_qUQ՜5g#r!*xb=CӭZw8wT" 5$DƁsh/_ن蘙xN#&>$fj*V?ee3{j7珟-'}sJz9r]zLF+"K^W|EH wG *"<܃ o`eUt50t΅r Qrʢ؜!21{N ̔P6Dd `lq'ԏ2?BΡgr\n6hY[w㸎I4WG<}og뮗=[m1a>_^\,(t?}rރZDP+}u+ uQ%AY5ScdbI%9BD tT d x&BT40@U0vNH! fe%]fb z2˕< sTnO]Tft^Z0s9vy?+RJvZm61g$ޏFbX,q55f\m,1ojL#1&V / ) cŮKmh\UPR1bL!!:&GXF~)1/_̇s[1 `ӔkB.x.&"8BT=h`bbq.BQS3g}x7\RΉ%Fw3kJfSn 9CC5:m6[4jf߬ePƩ0\8,~>%2%܊z rj+ro6Qʩ\ p;r"&p7saݭ95gRr ~vs0!ӓgg_1O.7q-)$awY&2bρq*wsn;U6 7kthH>bkD`!tiBJnGC{^+-t89eH@}FrwU%? D㽪 1Vf{p:V[s K^ [g'k2sy.6%sNр1u- Tݚ) *ܬSDn-,@ fps&NTa&nn;|ik4y. /#Ld"2&tunS_ְn2OYhDJ\aR"I"Q7f<ܬ!ػŢ|{P֚swΒrJPJ¿hDݴ]4JFd׋lzQjlfU#uí9+")+Sk r/ Q Gsqٽ8wSeҵ߷b!LI3+X@hϏ:="ݝKPrb`q'^lp!i*Tr< h&zKL+_~9۾%6m LJ0 \ˋ4ݻ p=Ke媪0U\XZjϞ2%uΩ |di裏<}vc"\d]a*,gaΉ!bF$@'ˉjfdHbR&e0/aJMGHiQp !s_?xC%ybs93Txar)܃jn Bᶪ5U_b Ӹzxs@[D)ܺܐV%Rǟ^|o_ٮ4vj˥U2nDTV+ʩv6rnWZj` \w!~LT8Ȁ2 L+ϭUxiXK@(%Z+jm8[N#whN,RnD92G?zoRjݍckЫϧ~]ztZێ/.6\ÙiHiHwhzRO=d3Wsmffha&wsR5ۼv6M!9_~rx~ޝr繶:n,(;&uRyӧ?{4<8;*kns7uW54f\ j/KE`uMm8nb✈US&I,Za["[ku7WzTZ =Oao#KNGyn?|㽷2XoLwoq܍ck-zbSkͼjz5WWiB5` G7,KfF]5&>rڡ0ʹSݍfɧ`~eF?~ ;@HCI)mBc fݴ\>~9ZKɜis5]|/-07% _ z ̌cL`X, y]29 \kDZdΌDpsks3JꞅqYszfCA%}.ْZU0hZivSs~!xkiڍ˫q܅"jhbOK ZBUMu̚]s꼽n|azHWEuWpwߏ<Ο?U>:Zز\͵)f4UwCIոNGG?ÚJ)'j5Rl\}!t/Mnq8np/..6.e( .0r*C LH Ly}$N={Ho@|`@.Ϟ?/)甆|LiڍnݍUm1s^jS5R49',UVq7W0=}rtqΪ춿nJ?>}ln6\mY$VYjU9e"$dY׫9.o߿u(З[(HhxW/NqWVKz(-|F$"ːN޴y5vۍaęE!2 H9ܩ yf82q'??=xఓCzxYX́r`A8uzzoj:r즱զ-{ O8tVhIB?i ̪6TkV`MOVGOmW37NͽFv3i2WD2UsaHIHsIlF郷ZY#2Ek@EpΖ#Rޅ BTR_`ָ 9cnfv#haavgf2 [3S5L`K7`->1kCOx~~QRr$VC vӸqjusknŸ=BBLCʹV ;񝳻'4 d;G CYO>EkmMٰ^BjHIZRaluӁnVBL Xw"^ [oҺzދs])ʮx3 |m@Sq7&hX$1fՔRrgVwD.@f019;(}:Zn{@otETvꋐ""9_ݼ\BY^a`Tͬ{5jM)ݿw>Y5Ӌ~DϞo?Lgwӟ}17޽sv̵iaV䤬D IAPaND`⁩ϥsGj!i95g$BoISri/wá%^ђ݉I䰙#&ynf[V0.P Q}r@PIUgQ\>g׿r)]O)"esh4r(n&Wy|#jDZ6/5@,Qmo`Qzfj]ƩNO[w7yg3Ozp;~?%%f2\@)e(6J@Plr$j=},5@A1 eb HI䱕Ĭ1`$L7ꅾڬu:\պ BktO SPmK[C*K-FBIE u>>N陇 UA5mUkmڍwoYxo|Vkiigw/T4_?5i) kj>,ռjz=o<|x=Տ_<2wB牥-aփ$2)uqȍKݽ">921@Tq/9${xbqDZ[7݋=b&/\RJ KҪ:M3!!ZA9:1ˢ7h2LiǔNN0\ÿݾ}_ӡ]ZgT f8MkSzIFgAnS tuy7UUu@,,HS!бزc^7޿wvsM?iq7>=jws/LYX$%qY2"%DʩιIJFF]i$ YuSnIXN-XDV{e% =eDvr&:9:.,:F7 kbnjDj߯CGzyW&w_ǀw7i/6-43Dsi<VR@u8ԂB仮^8K]5tVaO]lPu;'Goݻw쵓E"Vw5>d nzGy7ŒKY0 $`"9; 7:3y~>u_'$r>{vrnf3; ]Ï֭q9rNDԚ6msk[ |5yl>9)m{5=Jl,~ctw޹sv6~29c>o|py5 =^T(9眄%eNOpP_S^8D09XFbY٣!uot;hbX(1@ $N&D(;Q30$YXhj\XU+U1YS0kҰ-]05K`-ku{ }:_=<WÝ85iiO&DdsI9*ܖ Rgry 5*pS9ޅ[ݖ|_xk wIrvzruz"Y~޽0Un?ǟ7`01Qң6k,nXlp䪍AE`cnDǔb?Z4ԥkSSH9H13qOLD>Om^4_Uuk3zp5khAHfR:wV_rIj >yR[C?5 $rZ95bfJDMIK. 0sm3nu[-&u kߤ $[HF{X!tzipO>ѻo[Սܿa+Ao+nn|ݒȏC7 yomv0S"a!̭{k*f LaZ{O;< חon55ڸboߙMC /ܒ{x^VApai[-0?|÷ooCӧyeP}NCJ舘M݁"Z#H$3̬gAw@DNrw!XѢ3EnH$HMwaqc ^g%p5E3RXJXWӮi$$wQW$R\P2Cn DOIixɃ{w>;^4fS[6U&N(v]7 ^CkW[C'''nݺur{o׏>(IoLl.BL`9>fN@Y ] C6x8ugED`쪁e fVVpe cj2 A:fj3x.ú C"L@)E-2l\k5 n桄# B(qX)9qbaD^~yX_$;gg\sJ/.תʹ5SWuFhT$޵EAEPKNIRNsmj&,)PJiڍ{z5D~'a7?'tmRJ>jc7R0!#$EEBʑ<8.6qV`n~Aff6Wus.' -u~<IÐT+vAk!jˍ0P Y^A .D9}V[3U.CV9*hMcHfhmwͭzP"JBǶ:%fNp;0[%B2RS]&16O@f(V\F%7_ )<32d3*q#Nf!f.c35hzS"ˍݧ:^gu$[Tf:jh<[,y^fxv؈"yv&T5afW߹{俆oH4C)a5ժ6nvS&vrwr9>>sga(9K. +\;W'KG Rbyf2`?^1Ӣ ֧, WK)q$xS%QlFaY[s\kmֹjV9PglnZINId%܈sY=<1U8}ԯ]c/>2s)Z^\\>{bƹp\$%pr9NNNsJW6z7//\G;"D م޿1ɒة;U07NNLn 3lRPd pUUs- T2$-4SmD@ ݘpԖ'7\Y_> d;o@n%K "2 íZSeCAB#zꁣa=%Y(|HSlgpˉ TX?~qY6f$lT1U͉ыkI4MC b v_( i:OKfĜ ~&n"`}z^;6͔19Hdnjt#\,' 6b3հrT20/9{v^^mX%Kב 3_ qͫӟ֭b "F]qJrDޫޜ$whfeaw)֮mޱHh,*UKx{lNf7(bů\2D6ܨ 3On=?NMU ʜAD$9/o3<Ο?wq7./df6Ņ L G0w3ɝjj}/s;yƍ`f.Ϥ/ӯ /^|`yq/%j4 }_2̴ s@jIT]Xғ= ";~ !2Qu8I$EdnUBs,2a_vJ"aAP Y0У{f,qeB Kb^@8c.9n}=pjӧ7IݽT$֬Q@zҮj̕n^4ddfWkjHL-hNLnqeY܍H 1En7sj*|$RBAlr3HF^޴'w5 >\[oO_82[/l=`_(0^tCyYmłʈv{kjsS'"Ť]hg˶쵽V[bvu.ET͛lV$Dd6>pJ$Z`/;W{Iau0`C|ݺ "G ~Q{f&D$a7$vQ7jة7k4yתP&fA ZԫKYb88n \j? @9Dd.38Sg_ֽOI_av;aizF{{u |ػAb׭*Pfu5' 8p1؋οӍ)Ke3Z&{}&07fgݵѠm7nkӆf0RHRk`"9j哏?97]`[l7\֧}#Q)tT2ZX&cm?{RN%RJ3kVj[T"7>&[?jpG'_apyFZ jHu!3PpOBnv 1 ܸo4$T6ε-#&ԏZ*0XnY~#%{w"z:@.mXٳgyvӣa503o*"tti=@BfL~WhmI995y3br`2[Z#ZVfPbzvaVB}&n@`f16]Z,=5S 9,}@VPMr)ڬ\Uݧq|痛ʹsJ)'ݣ.6'@@ags"te[%K+h "S8^]07O,9{Q; XD! f5’|+7{M7#vf$אa5ìZvsy~tr!g3k%aI9'2Ј plMIi/ JOܟpMw[i+95\B Do ulcRopcq"#Rlmv[x="z7XzƎ L"V59iY 'ΉT)jR0wxi_}qG:W0`ċg1ĩnp3t3}w~mcv}2a xs5!fM-xuJ fmop &ok͐$_t˪kg:Mg`w8֎˱HՊKy9РĜ(L(n, q;-ɸ 1,l IIj_U:H%{!kFS>rO]zȹ5vE\z$uBM~kXK8$}w͚@pӹM boŲrsN(Lp9ܽUse`! odjRjG]nzWuΫ"RR➜E KWW,̠<wZ>~k%ѝ[=z7?}_m/OpEBG]%FyHfJ7n\0w&Jq.d ZLG;\DPO43TڀDL 3aR"3S @)sI’"?j[f6R)%I=,%uk(0ey^[I}!f|Ν??{w?CG vK2 jM!:d@uUk_JdK_fx]9oAxQao1#"%H!yʙ\3!;{SwaDh7h9*UX2ATrگTϼu( `y'֮yyxo7iu"|-WS%'GSkARТH H3/kt!^OT\Yb6ϡ79r};vʽI)rͪidNDrdȎv8U,;9lX^JRylY֌gfpf7v <}9>&g!q _=<;AD (҈aԄC@$b.`T/bB)D'"ZQ14PF,(wJBŻlMl-)c*5m(q~AAH)X!ފl7|W;n}p]ZQႀYhDȱc$'`thdρ`DV2bFrR̙}1^& ѵlmbcpa(AI  j EI1>($3ҥ@ҜCk$Go!$NfgH\$"Dik" j%BJ 1֐{[ QϚwѨm)hL *{Ї۽`fl3MC`BA) ]Y^tۚ0h t= PFTH4""cF;mapu]o߱IX))cHQDAZ=cL$U(ŀh/h4ii[x+J"0 kjxD\-.;Mf@0A L2yD@uRN$a^z:x}"f:: ҈A0H`0<ݯ0 !YcS!#O." *ڴG A0ZR.QbD{ք5>xD8!J[EF) k"BȖʽE4ڈssn(,rnDcHR2dW;U[a:Rn g]]2h%A@HRFJL jnj)i)&%,N"tfA#"' C5)Ģ";iQ+1Q` GwTl=%J?a){kcera{ўHqZ ikf72.@`A"* [8BE< wjzSgb]#70q ]H!EYp IFt"_D\UF*R @aA9h.H3!RY%ȋt"ie@H1 x6N?F. "J"PE ]JS}(9<0ke і> +FbpD[ sa6t].y\x% ~jj*RZimlHݐ6(-׭yP h2b,]O%yKÆEB4 ",d|PEqiւ-#QA#% n]Nˬ@DV xu E"iw̥Jp.8wp.ˈH@ n!9a!n\vGe(GZ)BQs`ׇ,TLA8ssD@iaQU* !($&4bD` Z⊈ 2▲D mTIN3oA8s9 #U m=9ڿo{=rvk#wn0̚k0{]HscùM\ЅQw] m-_'H- iH[p `5b.Udch!>O2%mviC*$RR4GK\U4Qd[˰ (QG&VkGkyX,pAuB7bgD$ЄX[Q̧jni"w81;=>LwNソAϐZ;AkI8क़Q@}ۅy3l@aVQdXiUSw17xJbp b[s9 .'aQŶX/h@@2vI@ E-Y%;'"HE!%\6tVcQ\MT=N,Mb1Rό(h`$,y'z0&#.h k՚'hFA悧VHDT^@*RMR0Z&yH><˓(rfI hYH@80ml;ڒҨW8 Yw!4r)rQka{ Y+!"W54уEVTpox8%Hޏ䘋 Q྽{\E <@ ߿m~z: wa x@)̽-T9 &#Q@Y"TlD-gp@"!?Bi[Gu,-BdDxKzkzڝP =FEh4*C|! Fκ]r Q2(URF&),vE'_l ^?ucmaR$U}AAff `2Z5* X@Ȑ"r$R6"C(`,8jED|XR."7 !$vǣA("28DH[u|830 \0^8‚4&h8P# 8F6gC# Pl(9""1 DkX1ZkQuAԊHXQBЄfrv=wgͳҲ$hCA0 "EvH&BN:mVښNsC"4Ik{4JR6XG` , !ъ 0G@-/zшA%D0 ^lXB5#GZA4ṟ\'w Qo;rQr!,ZY*(m GڲH -ʭ42&V']aZ 1y E5Ab DZ"$- A`Dbq @,,CFBK Cų8V(}@@&*uҮ5E!TDj&^\`^ A>U]ׁďwrfl< σ0( ll%"Ҡ#Kh# =)FQhk4kH /g /D㜫Q\*(6֊,)Bb\PDDB[0,gHH8CHp^7ecT V@+ D\4/Y$r>Ǭ VJk@D b>0b½g,A ++=WlvphnHOrs(t=ߦ YbbP _[-3SdQkZ A0T; AX$@AAHA@*/@*FyDpH_)tN jMa> 63M[lsJ"B s2j{{ lRJ+f `4hCRd(R3nol^zs܏|/gy bMj9wk7+7 @DF.4(!"!(BD\P%ڸLDqԇ "=C&P(1ǥjzRP (J92xaѢYZez)D!ّ6"awFiTT؋d9sX(#jV 8"Ϭ*(vފpei9MӴۻƅn?;8wIC8Yĺ~MクF6\,Q!2ڦpAԇ @#;r)-fR*VGj->R#-:7F1#f1v#-GRˆNA$g\RHb쭈OV RXkhǢB'$*vYMkŅb.sʥfT)3 Ξ=w1?;›//fr3b],IyP̢muT|i$51$.R*MʹuZ1VPLJZԅ3 +hDAEB.*[nw(`%9ֺR|qwipr-RB"BLD Zغ dy͵ udU\e IDAT\ylȰsv;Dٍ/|3gZmfkCW*Y_^wtfDWV67WmTڷgfVOhvK_qfcy2($oo 2#D)U*ƠX- %bE.Q`.E-Z5W&7V#"$j)4+6T7ZV34*Z͚6J) rJYkEػ WNcj}cf^o={=αͧ6jo㋯^lwĠz"Y{+ ,:٠ 1 fYND0Eaje,9xZ.}p.࿷ꮬoZNARJBVP@F,(rSJRe9P䱑1q)V /Y$2ʼe 0Xk"oE]0^8򷯰BB)C@]\!諾t!TFeZ4W&g˥ mn6+2Z|X_]o77*j*;M_2 ?Y}/\ƒnқoRJQ ܥTUHK`c0Y !pp33Rutw ~8{]HXĈ@@=h "w rm:T$M&.)=iקJE$ f^uH0K"F ͻ2Sza[a$ A#"9H. ZeJyrr1V__]muz\Dzvv@̃rCt٬IȀZYkL v,bܟ--wR_ǯl,O}4f촭Va0YfY/0"̬*d74m.]aQ%p`8~0 ϛ8fsN3tt{;s3Ks^άgjw8Њӫ [.8ܘFp>osF~fLwLD.]ky׉H+HyCgP]QDGA\[Aj\uB)H_YFҙP U1J( 3-"<"qg>D J(rZ6QoXINWوY]*]9}jjL+RTYzx (NwsUڋKt;QN}}~*s3,lܞ?cWW̋/==@ԇƑWʱjTmN!tTD "D JꓥɽoSُ'b@p뺭m̹/| Ľ3 #xN+_Ts#U˥rFՒcsSI)"R)fK7zTCFq|˪Bu}S3#kO%{?o.sz_WG~?:nsWlwǾ׫QdƫR4,y>huDJ3anov..`C%^\\y^YL;T.„x狼{CX>A2\I`q R< r@CC]3J"C`B3YKW7j-{Vxvr|VFJ%Z90T+JIb([X,lbߠ_׿ 7XX6{-=N/].[c?S.pzLU2աt0 (dfaRR-WY7L3F%@X$gpޟN.J ggtC_ "xB ~ei9ϳR "އ4Ϙ$JD](xpx, jbVODhkbx1Azejr."N*{`GGZ@ (HUi0ɵuw}:J~knVZJSK=|^RU瞮m^~e݃M}_-_ V7c@A&UU*HD"kJ7j1NխjI"+P)$=gŇΆĈ@DC['p8Z>0 F HeY6} i#a۝ypP!^|NZ[HEpD8\Y]/~ hjnZJTG(ȁtY7uqd%Vb^9=Umw>1V ){N Iaj<^(uJ0W^-HW?o}Ot{ï3DaXu7&>:QkxA:LZDQ$̥r)N⹫<CX_]fy$IH4fٰknB3[88`g9Le=?6<;&4F<3W%`0kśAni}l @& @kW(%5s׊֚GcG6f@U mza6MčVf3H;bWBrK̂vyy\ KM24J=7iJɠId*rtϏ~_\&vnHٳg?ԇ3mY4tևx׸>QhZ,V~2R<4WK!aY7+yke0n`R{ nyT"8ey62R60K ! =IQy:, VGBVV je&-!b#{Ax< @!acejV:7/s: ؜LְM>YnsOog7 L* 9 A >]Zy|__g wj^GwK÷[dqX/Ror纬J}d,=z165*3QizJ-++1'x0.U7azH M!blmoh1I`0lu$nLNzjj@I#)DP)C`!eml&PpȽ2gw+岀"@a?i;fˑamgʍYT߆+"aw)FRo dKQ_5h 0ۼ5B~Їӵ׻j[~_}И݃}_;ʜ3W TcD@ *|*FM(9^K 8Lm[D$\ Oڐjv!V :"2ZJ%7]\)j5\ו<T79I)lTI؇nBF-JJv;rd|-_Y83dz^{.SH{n;ᝀ_7 9;Do ςK( {!E[{>ዓyӗdpgpXޜ<رϮ{w;MLҹf=+MU`շQm! ᧳18f>`ˣ1gT+ܯ*.|{l54{)穈 @\ⳙJ P%QGVbK"K/#ܞ9BrT9*y\'j I#][(uؼsw+VY8e"PtGooѕߎW |lcvݐF˲+_W䉉 |a;:H0e$Z-m?ߣo7+́}:JûЀI=%3kFRwS* ZN?<FxutJZF`AFu{.HADS,ԚTA>%03O@wY؏dUnp쓮)mO=ruۋCC 08d;T3RHS93cmGF%8qeA(yDX+zKߩ >|m|VC]mLVNEj)6J7!x V jrh w!b SX+j˵KϰR[7c"G>jOq[quw#G?OO~]s xȲ_=(N6 W@ :-(wAXz;BCnE_;^9+5 y5 ;!I2k9(`[{`ڦ58C86YO\->DeBX@cV1k3RAG֐ѽ47ڛ`@,YHU0+{~pɤ2Y2^N;ݰ}ռdV+>&E坰?c>3 _mH/ KP^,W~ʿi)|EPd\%pu$ӱi3K{UHf[m*WV׼^LҸ+ dVND=ɣsE/[3?<.>ޭŲP 4bGcֵ .ѫ4҆R# ) s=U mN[9V#f3V.SDyP'? bƙóM.>LD@[_CDZ ŌCo"@Am> Hg6fuΊ "V~n7|gO?7zs0}_6w7MKu>n^ K75z2=j0cE`[`aa\+.:\EDH8sjFZ Ȣ/[ "ζ^$?0>{L~KS] $*ko6.hqҡRj*Zz?:*n mlsSw ;__Bqaweܗ:_߽,sG:oPhWhy+LWƞ֢ʂuh{f3~GU׾{!d4_<]`;(ԦU( K~Y?|^CW֞_yp{FDnsڛ:>>Ӷm^ ]hzs1:vChۧy'TRX[9o+ =_|  ہO?|?ww}v]ӽtE^d@wڮ_TMPi/32&Rs{zo죮G|;TP <Z4RHFm4}}\2~VD B_̯<^}=u"2[Ll;=-'; Pu}}+_o>O/G>Bi+3=1̕Sa0j"b6dž'g~^Ύ5v~G?v|2E<VCĽ=Nw]?+iyAM^q!UdŹM8w =xW^U?~99Jfv &O }GֈԹw-=8h[Ӱ3}ænQJ7j՗ acͺ;S坣57Mui l|0[>+g+gOmgc@~|層?E7xiIo-+_'f_YOm%@HĀ2e,MWa#aNN8LƵLeeo+ͳJmH턄9ymC2ubūhnM;rt+i|.>^E72rg[WiJc&|ԉ|l9ۤٷ ovsr,*+8L/Z}~w+#y\yQ?~ݳ EwvK6?`P: *PN=\)|kP{] ض:(%;-~/鉻GEGq |>̼tK+Kέ8Ihq(߬oCrut-INnLnۥJYkfUvj~3g/ "4;Y)N]iP^>w|}{ÿO,˲=-m!?eObA@=Q~e`RIJhuͫ+n3zG¼qd?|5Ly,9/G«<Z]>铟XM ~hƞn~f&k~zCAg WZFLEYn_SW,&{oKt>J#=ɇ֨~}?B^َ\|20`W$tg஫VKߚsk pq|$79 ;ԡɟ٘E~0SSN-y+ڷQL{? \2?3:"xqm")'+õ_jo}Poσ7xczo\qAP|t,;0tU[>5nG\( ŎMؑZ>s끡vL~'f,({19ٌ5 hڗ]?6sdؕ;GX*@ ^mO[|˘/#I9Kҁ9{o>8wH=Y)vK~) hCnRع"d?[kfyKv.4JmJg!K?j>P3w P`ֺ;ƍx<߯`k`کQouuU]ry,y0kP 6VEvᾥf@Nץ,#5HBCayz;>=k%/ IDAT԰<=ѽT,C# h" NK'W)N|7͐75H^jNCwϟOySz4Q4뽃ůqrGSo|}>> E_sπ9\FNTBcF(Q)"dHoH3en5o-".fQO4{𤃌~_# mZ,YhQɥ>=_abr֪,D;hȠmk">ʠ2oHw4Ԧ? ״vXBnߕ&fأ*'}m~{?dU/}Kxqb=hn.p5+3yFv$0d( ͟͞n݄c8uJ8Sʒ> c؄m,P x&RK7㬅b]>?ݍiȎmC?ӿx˧yy^63i(>Qa|̩WZOnC)ŀ0hļy28B٬wx O/A.h_? =PPuԬ OcQnCWboa7{>k2gr00TU  >p ۟_;u`GڧeԂ\u"oREv 58՘paTY;9$X45QQ\ \y xϝ?fnp7{ΖE`uCE c{!ɣ'%K?VWWw]1UxуZnƱ|"ŇͦG)A)s'qf\̤t1Z1r]Ww}Kl/dfrER+EQ$Z\$˛*Wu U403`gT70LL ݵ]eٲ%˒%Q)k{=㾈xIJr\e ŋsmo& c}Fo(ՙAeɏx A8o/Ż$`<пo@$H~:1w\sĞXd:"RI巂.H츻_I^?{w=k| _Q,WKWʰb &|jqwZcw>ӣ־!wZS}{/mX!>5k}'2`XT'ly0K,uWia{~Bhc;X葲!' %^OQ?q|zr;-]hh\jh8VuH |b juλ6+'*cb'VS_: aWۺq-YIwҝ9dWxWvӥIi#T1'''؉7Rj'ۺz.ٝ1d@Ⱥ o4.w"IHЈ^Vls_llu <>X^*c1˒JYіw;cuwz2U*?f\iݶjw+(:}r޹;9盂ވ)ggwvǣ:&0Q1fo u!Du @TE@ԇWY̞tkV%Q=# X>vk.z6s2uG`s}ymRluq}$N Kۗ- կN_z|՝m o MVoSΧ+HXv dxE:[fI^1Ry\.& |߿C.)X,YM?03"0@8F*&<cOoWvrѢQCg҇i3'v}u=sT*瀑?`",[ojǿOx=wjM;Dxm *jkƼ "jU`Ku@rz%q5>HKڃc?ǔ9[O%G5ڎ+t[̚,yc>2\yvz{օYڲ&;VI$`y$rdA "v@L @>6N8 ƸR! i ha&FH4A8O:=ry\oS{9jGeۨI×ٖEef;Xt74UuDifM"k*!ED]*9G>Nbwū٩ⅣGnG__,ѳ:SgV$%0d蓻ӕ#q^SkG^ƶF{ t^8EU1.9G{N2^pa /_IvM MjkUɮĶYaoͥ*hD@Izhie.be]jyZϭ-&vwA  m VAl`OՋ/'i{Q'^g]=-e9c{qb?S|c'^^,='ՙJu}|$Cl} Y gw\F}#O7~J\MZ,()zt$Vz664551Ѷw>}6/9H;WjÀX%x`鬕7hdB-d X2[RH"[m%mkڒ,),)W+O hk=]?"R۹^c#[%-3˪`^Z Stu/Ŕ+л7+ُ^v'=y}z᝱t.fJKUT’n5'"\tB֕v,lПݦ;,-Ԍ~znJɌ<ЙVG3ڵMd[RMA!n@h 275 *wxقں{?ݏٷ~\-ɶ)D{ue%EYZNѱ sضsSme0G'sg?xٱPOZ X.H `Uw1C IN'c,v]*:545Xi7ls'JXs$Ӄ-^{gfQ17Ilph:]/x(NJf>~nIaI!0~Ptu|Rm/G+(.)nQܦ7~by%vC?;qb,w<ɓW\41LwvDFU}>+o@\vrgb/&b>BBfF}N7%@\#`+"Z^u]V5|#mu` r9,ҥ;&vݽ1<ݷi\«[fj'4٢Kj7[Hxsrr]_S#ݿFl;zҾ_-CJ\:-ۺ_[^(hZ-YT+][ruS|WhA6Nΐ3(Y yb](uZ/N3gr93`56ْ\I ld[J~y-$G>Zd rEJyۮo](fWy-Ȗd aIa܁]5ByZWg{%{d&M}hοzc'iǑ[/B>')_[6y-ME>bm+zx?ω-ޤxvZ|O\ ! <7dD})#@a 3/Q )'ԉ:. EE+(ȯ]{C{Vr$\I۞AO8wܯm-VhG`0O"^zFX |\I\ae=[gϞ[XJݏ/͆1Ҭ(+:2^-rꦮ 8h{/yYw6YM(&]Mm6W*z OH p5f>%,+$$ Gϭ^叩\eķ_RBmۭR;w<Lcϗ9%Y$Vs֨b_.P@K'&{ Iŷ^w-Ccǎ-,iƩg2[6T|Ut}"3sChU+;"Zٶۣ1XWp\ F,oH@}3] 3Q҂6|OV./eHoz-&ۭ*΍.c푽{]bqEd YMMGoڷ;nJ)sOޑn2(uilظ`&'o>C^, 8um浳SZƀo 3z[-?ObqPkY3=u*RJr;YAhF\< ٫m< Wdx"[9B&6qԏo1 J-I$$%jd*zx# ) Nξ*uIۨe0 µz?3{!o+j+?<~=ZRnkl57¾.B߫tߠ CQ,(܈ i6uWn:oDbM!"Y@/=y[Y!{y4&C(qAqIF E^qIIImR {+Ȩ1)}t׿ ! %y%z1;;5%'(?)mվtz?=s{+f>q܇' Xvz 󫾘I:*vcuѭUk״ xfFq[4Dl D}H^ęԴ("z:f5_=d f>TSH(xߜ?):|QU'( 7!!KrE48U>=h%ӕW-MʼUͱh"jM 7 B\|{%W;Ioo ?|f-{ab詐I jNAzW,zk̭ٞuŚB׭ؔp50Nvsb3W`,Y< :8xiq*.;Eb/SiɁgېP乨Hw2՗C S]zQmAݏ?ram_ l"lb FȻM m`J^jݯ߿/lOOO/dVrJs=^*tE7<>[hs%}q,Ci  t3o;}NѸC|O3'tGK>ꐏrx7& "YNy| y\YǟKWv<'I!` eH\rDUnO7p:?*\<)X19$l>zIa3EMŠc(+2ޕX|f3/8Y49 䍖`Ō6lu-붔-_ż uZ+m[-m얊g}Gc?i'b`Oy.ry~K, 4MԎJ dߑ'}=}`!'O% J;/"zS];Hؒ o>U(\<*QY{SV\ot)K9{-5ԎsFo %x㍹%@XaIY`;P ؂%w8cYW=1\IhU-Iaz3G>̹RA罔&q]՝A @5B)lLw]m>Q4f́D`ß! iqݑZ f$ S@_vrݟ I?o45m!)h7g !@ȖFM G{x,{= ygGe"UoF4g1J|@+YEvMr+_$'N( ˕g 뷖dbYߵSԩQZv<"0(ȳ7W9Vd[s,(i̝1,=u<4u Ҿ X@ԥop &г{ߑ)ҹw-RpL%q6{N$ۢ{Գa.'-tB~,f2u=ֈT>kֱxO:w0m׶C& nk9eH(oaoB-fb f>D-oj_Ŋu~z߽mԨ>SJCOl2\- IDAT\ݻ '^.+K30@a7|zTӶrO=-111[f>6:@j9kRzޓ,'<+k `nz@ve ˖mZZX祫UȼoySk B eK5Pi{Sorytݾ[`y3KIKHXTWrǀ_^{Gt8==UnMzg*RM^Xx q;v@wjpӄ*{P`>/ɐwMY\I_]S|hb) m_7_&WYH[ b(7ZOo$mH|޴e7h&g^NG{v|3}Wу k 'i4AEoP~)hն67?PQnRW:ԕ+zyr&DuKTn kM~:(lgsJ)bq8Rd{mʄp-~[_䙋㋹Z:Pl=nm0/rf 5+Z1A‡~2Hy ]tu bE+WxRZFLݟKcSu7Z7^H eŚb(|\K*Ҏ劣n~Q./O/IJPIX_ٹ/*zZfi)HlB4(i&Uq8@W,?eš?yJCˢ-:㚄Ɔ6!Qb/w`/ lAvf pيN*F݇' B^J!|f^ 3'wzP@@1{ azьυؕoJm=;v!hH!cwK;&ReT-:j0xqez`mw>_03V%$6,T8˾1zJg'5.Cwll玞3 {-| ŽaVhW3ӫcJsqgRBίoooR΅J=,{ٞRnom%!)tRTSSACi7Փ p%#M"hY@J|0FUBG>m̛kDm$5SVuUu9P̒;宝E8yn*^3F]MC{W/C$Rw=󃪛u3ʞjC|5sݺo;o\tmG ?٭#./zrWr;joK` zʺbH#{V3*oAA\!}`i.wvxXx5lN FEZ iLt= arU w/vQIS7m掳:FIG- ~ta-_$N j Ft=HR  E_fM[!NAi"%TĂ597_Qyqn5Y朏~sSosRqKV3e|mKl w usZlll PUg*n{4o֖ܟ-\NZ7=k(kr 8<ґ;=y+aPRH"̕p0h ?  %ROЉՁJq9eSnS ЌfYW*-5XlfC;Q%$Q5#3 {S'!`YJ>kT*N2'nl JL~l+A릊p*kQXΦ-U6g efޗPY3K^pf)NSUO@mKw wd J5XRE]yg 毥VH3.cIS MO HHٽ&SeU >(WԔ]7)tќ1k{m2xϪ>4J=w_b41 |.:QP&''_ BI&,nDT+MóNP.ˁrpP+;jhųe _u[~*畎ԍf-o|Gv./E74ֱFꁘm iMn)E֑8l✛Rh[XrJ ZTTKo pn|fUtEyU|huϠęSü|͞?1|M?z3n/TukRz0^\/ySn9GYnB{ąY$4bz_^Rۿc[CVZfҤ\l;Dlz2"A"Y1oLGLǦ"3|fK찏u9ײS]$F-6.\4# `]3Pbl(A;ZO~~h `% ʽU_7nƏOLKr9L=XE:mrNL Qilv~,ckH7BeSmT-_r!C,nkdwtKǯA 1K׬4ZZ>@W4[A4{xIsEsYQ\R\0׸ ^)щ/g%O- Z(4^oX">5Z-$n{d#7DYR1:[o'O<=ZѹRyYq[344@FlKvbB0WUYdu!+Sl!_\@mT㨝 tJP5=m}ǒ =efeRW_}cǴήDUA4eAwg>EզVrKV]Z+v,%fde[o333SJf$@R&V{G9?hFuoTuut#E_C.X"N睆ΓÌV8\_6C5hT drkցFY _SESEQ@ɏ+Po䣉tMẖd4wb9@Y! @FQ6=25_ߜ:uGF?RR f0<@A1}U% i9yd0ClPt΢L%|X5O-f:ڒ]ircz:criᣄ H6:^6I&W処{-7Z򁪻}'H<(8nYY>k[ŭ^ney$yO=k5M>4 @!P!؂Ho`o<4s}Tl|A '[o333~|qw\WJ}G{=-t MwR {l3WDh9^'*ݱ0lV6lk]7MZ y1m7r<r \Fm~ckRZ])pyRcj?pD[^~EtW&}QQZE"l?W_?oMX} DVQ0SU`ŸVR|n}A{t+:B?.8b]90A a %nD|ѠFm [6[{FgOwRfv>j=+h bP-V!2xY;"R@ l%̽ c`kY 7}i@L>UרvccP&2Ѣ74Q6 EZTkY$%):$$i~xP')m8#噩ᑀɄt@&FFӽ 3c:L3_CS3R]3U% "IʪwWfugVoBwN2t nTg}qo _R[ jվ !>ض6]0񹝃} 8qy*gjI/TMQapYL,a,tmÑqXOt6- '!(Ex6BB:,$,Y[Gy sڅna'ᵣ4kl"26)qUuտNڰĊ1Y ɂt@BЖ,ڶG "fAEb?uסf'_#d3i)0 ӯF"L];oWW@Ի}𓿓Lwx: UL0PU|J\33/tfyTizmGm?ZC}# YZ*ή#O~̞筬/rY)|2uwwo߾q/K/Ġ|E+bo9{}f=#S+sbhׅ<`"Vr'' Mb|+})#?ѥbymm퓙BiB B.˂oCl$o)݇x:{Z!-:Sc4͡I{d湐APkS0wbtW[DG! \K:EyS#-k)uy~*3358RHC^ @ʿ|+'? Cw}W%0S0քobjPs)f7|L@ʒ;{Cǐ9YnCe/ՀbWԽ/# XZZ裏\.(HRÇ:tbd=m#f tw%5o;LI7]Q))vLv~nvjrjl.,nz:mQ]l.t g8٩-[TNMٮY/J6XWX^gD텦Y/{g罕U)ks8 ;L uw!Fmǫ rK3'I jXZPYx~\f:}ۑC{uHk_ wO8`Vf߯hWEޱ-ᾫǜd,ז) BYlGbhXI/֥RŋoƱc+xufffJѣGGGG]]YY 䅫v3z~$b'{-ꈔ!iu0B>\,qɕWLNMla4v1#K}~$PrCwoQk,HV28"TBp&s:rks3o%9BNH;ȍC4ЖO캫t.L>{  .J3>9շ}]"5NVۻu׀̾FM+͂#ٮm{$RjiiܹsKʥ YJb.+0::zJruv-nw{;}x̴ IDAT,BF^B`!8k~Oό]_[ւ oŊ*hBUT`)kBA-$)\>YA#M>6dÛU%jɇlUf8~0v8)ojjzpW*KDi:HZՐ[ pfh}| V/L<<3;vUmrb;|gR54LK\1O{{uQ>onl%PQ'|0rZV"Kلn˚{NL'b y %<3A077wҥr,IwĐr|QpǏ|>A?xǞ+N-J1)/q2T -W2_Z #䕂 mj|zx.6R..yCS(X+kT83Nv%!d͒oҺu6,jLZMmtcx+siE: \WZ](.HkM3| f&H±r]`beW/_9CZ#{G4ޖR"c(,sf6Q7~59h0XiV>7eVbgqgau 7Ye.$JnG :Ad2L&چzscr p~%U0TU卵m]T"vή^ꁃY'3Nɣ*2յզd3յ\v m6>t'nW/1YLgQpvsW7 b5Pk:UU*Exp[d Wqnf}/@(EDh4#I%4ahO/_ron+L\̟yW PGoǮܣMwA^08 Và:Pр 7Gmݛ=c'loύ@}ie'~lW>0Jr\*|' `wߎWhLd)qP<3)M88c)|[/c)ދłI@cO%%|͢>ZKP·PWUAjWex4f}::fĥ7spTW){|7Q@iw;zQ%P!Kb[+\Pn {8,[L-.&KuOuWgYvmvmMۼVUdEUdQ@h~D$9;/>ЪH 3<¯{=\6?]dS;Ƥ{_/D?pb7;yh8p1n7mqt*-Y\.qsHg]u|L8VZ {'C .AqLX85]F3T[.!ۈk%$DN(R!) DDI^}76.mz"DuD1{)!PPv( 1>nDžBa'ڗ^! djڱ3%;!ǴF0HZw]{ГRLh:$w6?Us`*u'3_mowx5Cj:2yE.%H(pU|9eL`hg]6`/ Óf <$ * $#S?4ѷ@fǝ f1 J)#%hRJIibEjȀ$2]d)8(!P DZ<ÏmCRtURJL}v<ԍW4p'6dؽ_\y P:8"F㇦=4 Zo[G|&, #]UW1L%yo?=\/7/ΔsƟy2bu ^8#||5oqeLmH;A>H04Dn. (IEm;o 3@#g];Ӵ$Te!AKmU!O(7_?K"?Y~_DJ#DD#r "~T9Q3Y3W؏'`GQcQȊt Rhtl8/NpoMA JVX`: ~mS|)p-}hړfr^A%o- cAq:,?m|˪H,/UKby6d}/@O~:[LY7CܮF@@4P(ӁCȩafW'LdtR"xQJ - q 1c(JIPJai05!䜳Hpv?ha Rj"įVA!𥉉 u-9a!m"PN!i !0!z"hm_ d2'Fdɷ-SZc qѐԈnt^/Ldn) )+ornҵqk >bh6>8{xi:C^^,~lRyBҼgxp!%ǶX@wim鹄0 *e!yLE2<,@x}9KE\.J &-G D%S C1즥6ŔAױX6aê:LICB\PCU1h5J Uscc-C75'S,[fRI QKX)cB@(5Di|O3ݴU.UK3qKP vcÝg?uw6Bϑc-[s=,p JD:397qO(Q1`uˏ/8{J!4gF e0 ;I SDaDNCO<[L)jdepza4m@ؙ}B4|TJi&Y\\/oݺ555e6sH$*jmllt:Θaq~C`:u%h6j;ۛAqsUGJO 矸}5ŸW\`e#"` ih E~nRkR9SR>Jfj)th ݠ|E9@DA܎ZqZqjkxK!RYӲHlw'dHGS_}6~Q(n}rН!) +=Q }hzfT7{6/t eJB7JAM*^,H'guQv7ddYp"΋;7Wx0 89 ! NCөn s W Bfw64:, ϿxD`~D.R8M)n^TLf #ݡ$o)޽;L%[{Kuݶm7nܘsTF!/:Y >追BȂXI䑒R gUn?' TR9*H类.B^ kc!/fyM^1Adgj "H"Y(Rŷ2Jf>b +?Z~IH[J(|[nm4 XD`:sj4."xBN |5/gyr ul02nL2M~~'gUOb 7qnc`z{:Nxx\  &Z\ 17Xx{$z_ R恆V]6h`nMy?9޷mi,=Y*89F.1F!x< ;k"ҥOB/]՟P[{f׬Ї>9|1<&b92(L`'l#ˏDHs mn@3^bXvgs^yJä~jNp}8p\ȠIUOdss3)D!sj) Z -7Յ_|g2.\HRbw4x)y_^[[S\Q(dD1Opkf1AOC$vi  Ǎ)d48̷/ۀCJd,<|4JI&XsdW)n 3tv ޸&#B~ĖCB ApH&6Y I.qk- Z]Fȡ- usѫɰ^ޠz'uIi|<[3z> kT" iL`~ m<7t{s%ȭuj" ib2ϫ~s\zmlv9ǺoHA@#%e"a ca2<~UR NK0!H:F~_{Fَz^젾g:l]Ual%O/:a@HpCnݻ߼yry;o@ gq1K%|5X'еðjAzK%Md3P<ӽe,d,LS)JIù?=ԧ[H m"a(P8 x;D4 Y h9M( i|oQJ.iX10D]!t ꥉ 02V?2ZP~3H^W9l%%6=)`PQ w׺:cL俙?,F1_tˆ!Ug`Q/' IDAT^Z=H M("aĵ wKX, 8&&2Ix,FL.?Zus~ӂbRDLd]?,u{'4kpCh4vvv\ꫯabAD)j8nVqy$K <+:o?,9|2u>JKuL0GGǃBr 5U0u9O&!%6:v40c"թ+L2e$29nr W'PH ><%UZLI0ݫm4\p)^$I- c!Gz>eLg]H2y5& Y:^6E85UD}ȴR_y|9zj0. o)vRIRHE|60oaj O#EݰQYA!<×90êy=f`H$j>3xStO)pfq*8.xĞs$w-$gUdlGOʭB(A&Xkcol3be,`hI{|?@zm.Ȕ0u &A5478chZq<2fr0(8pPz e!1B~ b10KG29d *)1FE1jhЏNL&2a`2k|9/fqtW_z,7u9;nW@ɓ=lHɣx# h?Bf?#n SY Wʈ|nbEw,pYB#Y, yo޼Y]]댱w&L6n,gGFNMxTW?]gU&)R֫WGi i`o,"spoq\Q'v,{X☁cy>j&%& /{ fVNWU0B2V SoUvE5 0h\pxA)'vdfH#Hflli :ڸXwpkKGKC7)miYHqBQ8#/8ao p<2tH܊IT=c6.A .HRr/ |2.W3G{ijCZ|+|Aal ``RA8"%'H['E_0C`7^Qw!}dK%L" ,lg&0hfaމ?D^B)sY8qPNxnN-IV*:uE%~*Bf!dL"@FkPJb*"cJ*G񪁚 !8pz! % Q*Y YOA 2?Q Lc#Gm5mGZ=չHԐq;BJ廖m.sΉף7mM*&('3PGmg5z9U %2)LtN~L#Nia^ĢL~6~ڱg#k7p ɼklL/vE;DI)]14nJMn !xh 1~TGo:xM1žEb6b oφiHk1t}l^58S.W'$l9 tT*pC49FpJ*"kKE6v$vx-wv*b66u˂a5F ?&~X{G5Q9&rBg~XǽM gLPJb&Rr??|.myeBt|bzdsFLPOvBC$&cΨT' Bkg5?-:_hQLfpsF\U}c*bi# `G`x>˷N-4Qs(=3"L|z=_Po_W@c.0,&W8t==}A3 j\qQesG;*mMM!h .4t y,GBzZ>z{2t] 7<3R1JM§S1y O<:Xi-_b4KJ)i. =}𦍿7e w,VkF{ Aĥ2 huBJDJZLsye.r\3x@eY_|0u F\Cot.ڱP%D\ 3 .ptKlV` z!m>$t„a"r Yk?(l>@E-o:!xڪ@7Cd0`B8;pE<)c/h4 h }|Ry 2@J LtkzJ< ^&Dt+[_MM-H[{oG^?aBY `x6n*E 4L^r嫯o? U&Hĝ=hh$@r 39 {jF0kA9׸hV *TG2;!0 >ÛN;a6G~/e뺮I$-64t뽼éjXĂt˨^2!T>"? 6xYb목f' ײY)jXj$]NMM^ݙ =(v"Bn"jo'&&N=$mFכp>O/8Xf.FX4p:j0>TAU%H@H+,s0\4\^_JtGBhIXY7ܐe1it f-ކ@hvXa]ʜN3%P]BLLB7 ۔Qu  XL3(XNJ;H-VH :JΜCrkFF҄rp֮z7r;Rѫao(9=M%}"͔ D}! "a|.P9J w6/;kUFnR+A 5Oɥ;_gSl'opе8E(%~e!yr& zٽBэY˲t"zwT*U.Uryo< "aCkwVK59â,Id$ُ~烞.B 𺅻iǏty ~t菧TD{ w'QJDP0ܕwj29C RbQ>2&xwc1Y 8Qe񪞮e}l^iߟ ; ٤PęƱ[GXȣǡR! !X,ixdYzx [9Q6`+  Qg"Q:۸^ u H:Y*F6?յ?F{ř.a[x^nL>i(:3W!{[qWsasjd+F$BA$Sf=sR78f2ul^V9H[1l͸cADQ4?^՗}@T3_+!U""pڎUқX.T3P S=գ1@)LHXۄf|9[3Hy^I2*{h ?Cq؏OI~ W0z߳7>$xzn=]lvO<2X*|;xQǞslWoNqf1oIH9 1R34EHfyB!wzoà(%PRIBnryj}~x奥%c@N"HǍcQ`*~=+(ΑErCY 3Y, ⒇D ) R _ M S&PJB1WNjy=[5^)9|3r B+n^qHVz+Sڇ~7JOoݙd0Z2>.[md b ?uRJNBQfgXFS^' %ktd<kyQl!6$Yi$MI"ly^S<{?ڸP'>3~fWs6iLJ*TȎm<ϧ-; @cqGC%%|5/fQ<5\|0,_9%Xd7ib&pe"ػpF-24:,7zJpk.8"wYd@:40{Dְ $cVa2">D1 )EF PP0!!f+y<x 6:HÙJc3)W1qUR\ƷY=o?*$pm"zQd6c|5LB?kvpw4R'CpXU.4T=wPw »{v4@jQO5 *aQ;kc.e7,"c) ]9t7PswsF)>Z!u Bږ)04\lMW:85M5) pf޿ ^bT{L=rdOge0|B"~.y>Tf!.[G9+eik/Nr t|Ha0t}dwQw93JG 22FrS,pATwq8A]یYXBI;z]jPcaw3 Ik(cy¹B@m^yu$eDMB)\4bx݌*$b,..#sxzT$mB;)bal  i XcҸx.1(f.R<T|1TkRzJvx;q5'==mq4T;E~STBGD> a?-cϷ}׭Bw;>V[1YPgë Nޟ 0ܗ{_hp z!j=**k`I5l &HۓOky, b͞&2dq4rlyPJ53r0NiMp3!+AP ~P!!rj&_dzj$-NYܭrL1C) h4~Ԫĝu^Ph: AA DWЭn3[UŵJNӳ #?eE ^өzD=|D,rI0z"mkaf" -=/= |Sh@ڂmuoN ~iiΝ;]mie3 2%qHLҤ0ٙj,Lχ!e*r=Xl0ehn<@@NqgG?S>P 萡y -SQHaU$xƒ- ~ًGrP$s$7٭a=w.QLrp<,78WA漗º[m/^Dq>`PE Qt IDAT1/A@5BAy {N׬Ih4;j|CG͍ Ūag>7 cn1+a`aG(&N ^ ð9S.QIx+D]yvENYtڶQZ Gr?E9|}ijne3S@AB<Dg+㸩-r'+- ӓP>F= OK7Iƒ!J6՞'"pqpz;r]RLNNw|r0l:S&%($]VpB4x+s)+\T^1s [zvkG;|i2HSǕYY/ D#/*eb%3,_uz=ИbЈK)$qwbC!m"EA *b_"Pn,)C.W$wɱ``@}6{SҜsֽi4pvVVf֩￿=G+u"S.[k;C@)L==XnakX-D xMsMhI)`Pe_excV%\R%=c(#Sj:Xm_&H4l|(Gn0tau$'BbWr;W&+ sy0uG_`k5l%O0A5pTOt&2PJ]ǵfK>`1~Sk5J&,E0FcҬG ac[ e,dVV!;yE"z2`k^ּGeȈajZRYXX\ǣj2{*{J ku|"a=z?{lXKxo6D"xnaש=55٭r ȃib)%Bj 2 gjtzO2D":UӲn,OaC(P$sg|[+!{Uac MKjlz[ \?Fcc |x %[q5Bd T%펊\#zp]nڼw>!w"S)A?$[u!%wgNo1z%g ,3F紾qg{p,^j5 nzV&i_RN@%!3s+K`_sX-P4ٳ;;;[[[ZmkkHgs;>A0K8xK&&&t]8罽ÍFuR 5[dTq$l681J?hvn)H/{ED+]KI5p )=2pD@H(YQC h>h7KvOKmfʐȠgG1zǐ^> COiU[h9nv\7 NKRF +dxǵ  cb*n h1RU H|dz$a$2<.?C-jh4)(WZVԇ&Tr/^h4ZJU2ϛ \FFF\/NOO.a9occc/_PJYeKinl2955555X6ǎ~0^:{d\K' юQ+@(nſѲ( 5$  R E@$[t$r g(7a> !U@7T^'-AVe2z> N=yͳ9 5ئG%kA# F ӱS4!Lôh-ٴmT5:$X+4?H`!igH'h:ʺћwJ)6V V[e2RZhb6p&98K>Bw9Q@ -Bi"G'XgC%cJAlBDw J'NdrnnVIK=L&3>>~ҥK.ǔ{T*599 (y [n6tmB׆pu$=+B̠7xQ [AςwOSp6 6̼#)abuݭ/9llrP犆Ji/`8oVVRwFR@}&yL*^bn[ef4 (b ϼ >(&RM쨘v2=_OXQ0-")< 4@R$PB)IQ{I1(*yi4uJCe}oUBQ% W~u"/ 0 |H!*LM wg J?NS٤ ٣d%<0(!Dc%!b}Vْ2꩑Dƣ}*.ބvPSEt%RyscGUJ$} }vq{ SiQ_~<( 8RL]fKq>sC-"$WZY0#m,ہ h 8 `rx_#8<)Ao,,pz꫿;sy}s5x{^w[ p;qdl p|/c@sHJi_aPŷ=xaH* :0q(@I[bdC"B N Bލ0Jb3{EMa*W9XM޳ 4/tEa>-Nk2Ц0xni sh1iClص+7ugM| xOJ]_tUUHRjCK)Tn?R¹Wlg*_ɑ;w3[- g8ҋl`#JUG# n_ƣLKp0(z6駔N[ۋkզ+#TW' ̷|@,VTض  f?'P)rjRC%HB'@(XB$Yu1P'FeL . O@|]KJ_eޑ[’ *U"]O4u):+z4*毴 oyUgiQs#a)JB+ON9vݍr6>ػo!Ρ1PHpΐ~\eW$lج_@N\JtP`׫W3'&R clX̥^rc԰b;o90y< ߖC*N̻"|ڄ%PPi/9u %MecWוc*^RxZ['!FQ˫&$)N$,:JMZK-֔tf Ii[;ŁX#1NZ0_2T o FU?4GZ;3W֓c{k(=Q~TTTÏ'-|Vx yQ-|@մ|\#^zmj()9tq{ inaJvc{vn{[xoo/v^$lU7[?0m/NcIC+SLXʆeW6Jݒ1Q]%R@e M`$B$4J K7ƃgm0Rk[N0md4 E^I T%ﷲ Y,MrΗ3 R(LfyҡuJtOG0a~oSCrO{!vMo; =vx) Fo])uIr.Z=tjDJ ?gx/#@0W-yK_9hާ!%J&nmޚ{~=#cWK[I%…A] ]$I|ؗ^1ʭJ B:B8 a~;"4m25$5,WquoaJ9g)ri0z;j5O'BhT(Zi*ٛEA+g>ȅR dD=1]zW=}c4Ƒ/˙rm="(zz^7\ZvrfTw+FKM톤`dk!\a/{^ νko]kF&4p<95zqn7hW |r!)="fSB2@xo?J$3 `>c:t}G8EST.i gw R!u#s%K(0](B c`V:@a v$+DZ\?FB!0G PLKa2n( @1a p( B=V{YΧ|dW+@©Pe%vV2a8xρ93ct胅偁EvmK*e:XET[۸8~d^V[ƒ-Ku7`FF5]O0Ў^*]1J]gQBOiڅ|OJ~]ل(SKI%BHp-{虭mKPjj瑓* 笷0:_)Bj ilygTeTn[{f:4 㾖*;u Է %*c.49u\7Agfw;/tg'Ɏ$#1ppe::g Fu} +WpF*0ItLNsuIJ5_joW⒰[^*HU\%9,LcC|nxddyiIPYp]B'uSf VX|uid:#-D1/`Dv_ku{Qˆ2CW**~tܼ6TaKa;()G",5G`etP"S3A #`B}# {vA^)Bvȶ=OXd`կ&=]{#%NUS;0)LSIs3Rz@aX:J"YNI qeҕ6lpn9hLMM ;2@{ !<|1(Xv^΋IK'RB) ,$E浝.~J*0Q)&tҥjf5ʥ zl5T(=" GTKōcP("1GcO>å4Wv.|w.}L$wjRZy2mR QjL^7mGͽu#f}>껒^fnǔiz:m?TI: jXKn "lA;Ww~YG铇[N#䙂uvɊK?$# DC5="&tk2A93Ho-3J./#Y_6EI<^ii*gMȢx'sγᴽEa*XSCj<;o!ȹufRIlֹs-,swl_t^Kn̮a:*uGenAX <\0(@|R$fPrâl}L׻vPB\Jܕs=yr^n2Y)^J|(e ^lWc8+NMڽjقS.2jѡ~sxML >lT"' xvܝ_{CE,MmG]DDs"jm x 8BRqJ=[sF+_U#kZ_X1)rV)5H꼚8cbbϟp ?dhIFw?:w$H lH܎vLZTӁy56)?j]G`IiK2u54sm 6t&}DFյ67t<.-7 /Kk#XWgaP| lx,w3\P=YVˉքnWlƋu˗x⃅F֭͢9WȋӇ|`\7?ί~fIu{xcG D`/ATRH?*w:#uQmN NG{Q`?=טǤdTR3d]X\ݔlu?Z~,i}+yY[h&xOsRF^9|ga#5QW-.C}?Fc\\HYfv DŽyz0v'wϷH g{mKuA\):gMtuz@ewA ݕmk^|PRIٚvW.դG[V#H9sԬc BMX8\"' 3K`5.kSb?ƧaЧyrŞ+N/_vc}~|J0Ni!dN}Cs{0 {T@5>aF 16w*&Yqk6jxA;PuO.`;8v-n7QZ^;Y=Ԕ{޼k`6O,}S%&p{4K?1ak˘r_lD8O)gK)TssZ~iSz|Û[[Gl lPʡd7~qϝ:wAY{ۣ{$'{p@גы\ *ؠ{i 3qdBgȖ&*e$|g^3LiPڋE!ZrҎ}'Kܾ1gZ7$%dfCFM4i܉jOc4D䅐Ǫόi[g\U`K7)Oo{uu;^q*+_ƩC_p+핝|2+e% sʽb<){nVO'QjV;bױ<O wv8Aՙy+w+1,_vZ569 1(f*Vg]'[[WyK^O:`QJ9kZ-^>S|饗.>71! F%m {? Խc:g\4*O$ܣ+$a̱Q=q39?ؘ}riFU3S#;̢bd]7+F|> (^:-J3WѺf ~$i?l9yqXЮݴSG/bDɰ;$+5Xg)%%;<)0U&UXg3?EF/Yi5}A/چF%)61?-՗w*oƲ}*X*/n>q󧎜92~mfzOiٮmqF;;#X} W9m6fy.z@ MJ>>lFê073vDV'|`Oqn1'K-6T,Wϻu~LF[`BG6v0g/9?`mM}"\T`wRdڷ"|S9n8N<9ܗM,b(׿3;xnhō3џicgTȁNlTtoc^GMXPG mmS ̓s=v4E8=%ȱ鬢#)C:q^R/RSb u6h^)zNz"yLtw鬵WNտGxo0D4q5j=oS8>Mr\ݴZ(G7\!=\9vbb_<{-n* flNXBm֊B_h=mH0nO9JNIB-GP "V34E#{8gjw=:Ca.`ap}T+ *6%ۋ97CyJ&k$Im쬏,C ctj[5ӧO_yraWZ ]PaP=z~Ѻ:`ys|gN]L%ړM2P'jKvbu5>VD`ߩ#+PU)$ *}@~;Oe]۰.uI7&fL)dZZB-5pT*M$Mm3{.?n$'hCW7Dfr\c\[)D`O20ᜒK= yg|j~666fhOdQōcS#LFyz|g]wҫhMYe,bq +5B,}=hDڈC+`&X Jbn\=?1ZuMFb(͎.mNܣg1[۽9fJ={ @g-@p)ܯ)4)ʫ?O9cls}*qegn UP%tRmjsk兵cQT_.2'Qf@^A6oCx *PѰNp<{D*ɂ3q]l_nE$ϴ)=ffBr&'dIA%MӝVӻ"l*+Y)?+TCi_LtJ65dc?qh CG=79ZH~aY7c{E{ggQ5*CT+`$MtF)!ckزnyZaMXKq&GU; _۽N3^)s~2izVܼj1d?tE~hw@JrA~?pMYxo^KX` =ԛf:+d_`{޻еGGS66;39︢a6MiR֌?K~Ja3@=#A@8 qIp]ʢDug9O f8yҫ(`pzGOpiu)3Y'YnvBFl>%8Q0vNdf ≤pِC#`Ѕ [($a_cǎ__|jWKzEO<ŵ4Β-yrRR CL8DHya:B8Skޚ[ݮ4HRڻmxw4'/jXSKQSF"pAh1AD_uJ ORAŪ}ji)V)ӏ?!]r4CoG3(&:`*ѱZno% ҲyoM5EAw%þGDGd)*Гp=M<~J<\ݖ~?} -lp.2sgL*J_NV6ZKۍuE2mlٖ\\MCbya+΃D4|УRV0^C=Q_Y1 I-mt5˭YJe[U&õ2ֈK ߊڰO aO:ߊ1yt.Rr㷊U冸.? :vG~87RԚ#Sw,?Зfݿ3wv?OLr匮k+-y)%L>08Oڡ|&K';听5LqZ- u!#*r89nJ KJuuƈirI`LcDc$e!J $lROȄ0vZ^PBvlb4CQ^jWHǖ6Q8vXQAM_Oe#n㝩,'W[\nVMLQC?s?u蕗 R[Nc從,!ŏ6JՏ7QJ}B͑¡b&i2~_]1F /%ؗJQJH{=BE*P+O' WŒy{hP0 DuQw> 6YG$A`&,#À;_Hz;-â'?$8nh`gEފ>xbz# %chF$fpJB.ߑq}OS}p,ol |bOkߝ5]7;1k#zRۏ+I f]%sN(B!D\**q$#Ѥm+ul4UHNew"蒢iP욖+JoE{[Bv4/7vgʼ`ڞH 7*uЄ!+ ]JB)_ni Gs )|C3xv|i+'޺pnmI].7[V*a$ ' cHg Buw,W~;:j'Ev튔`~W}iAN("ԍ:-.bvfG=2_F]YV>rS[C1HWAՐ~xH\)6RV#tɍQnhqދ$$\IN)cQd[K+p9䮛 SfџZ卿2])|O /IDATot~5SۏRHsgdO'Dp;_݆|JD1W"7I_AxWgG;$?h DKGp!bȮ&>lo׌vFuu~4*7ץhA^]o vVN 1QL~?o~R1n}zO._<39سY7KU@e~eC{/E<4RcJX9QPʿ`{C@Q{iw1DdnpX>RRGFxW>,Z_2#ʠ[6sL(B8ȅ nt-RRuwzJ-_)rL(a ̢ٔްf?Ц-nT?:sfkNm_'lTCNL.o:6OXT%e6Í}[fgPӥ'n *%ߣ]wմuc#"3J>nKNH!⡕ {e^FȊ?} Ssƹ_&oֲV}Hs4XnU}T&W7]nu7k'G&5\IZ&Ο)yGlԛΓ5wNd{j?%Mu M|Uy{Ef۔v, >?GtWB(v824W >R~6OnJtY5P] Ӈ޻W퐐>CV6~Bz]'l:3,ۑfbZzPFz];Ó/̋9.b?PO/S,AnƔ~?<"u ys ~LΥS*@;ޏ85k_v߹37.po~ƣr#z7猝`l?9 Crz" nnV.L2@D"j<pHI{t G! mrp.J&h'Pؕ! ;v6/"Gu?Cݒz]`M$+@}w?#h+ _wn)>@ʻww@039ww~?tcqh֎Vi'jZ6\Te07x]T|iBI>f̙1~huIy1gX!7lU{֜dەB{RBvpuQ3YJ}Pmz>Κܐ)&ۯ33>?9}D;M&.R۵Yܘ_/:sx{vv`i'k|zbWv\‡r؇$WfVS}?ٴZ̖}g!i|3g#twx\iW#Iui@Ki|tmI3D&F)%j*/F%AF/ Zs&apX~¹x뭤amj\F.L:=5RHc·{^%¸ HC@Кi=t:VZ)i{Q2H#L;\ I:{6/_1U}XVolC\e҃܇6{Z1R-#{b7|I "_Dz>gxu&zcf%{>/ <{n <~|lI {pt^cl< 3S[;¡S/r5^k*:O`x7{A1"E7ٲjXy%LPD|#Ycf@{]v' &S:`@V>ɰt~B@jKgvСC'~5<1t´[җ{Ż91sژȳpG PhZQMOgUOޑb퟼t,'K!Vh{?.@w<`nge]4!F5Gk̚:-:.~&SI:E']ʦU ,mg330GJ&gxqtjtf)U@'t4Bəxf_±xg{Gq.bf"[0jV,˚a}n0Y3DX d0#K0LKRj覕*JYI0 oy ;Go3QT*ď Kd7gZ&e_ޝZ-?ӿ`Y2tmv4<)\KtdPF\U `RQlIΕ*|KaZo>a,(St<6;IN*ɼdR4S1fX1kP_O57MjEz͘HV*Bù?OzEs-dON%@!ql T*olF\ydA֫݃ӯ _q/B( StE.%Vi0Q5g|EttTphfNBt,1,ð f1BW ! !B$+Ir%+G3L 4`~ kGf^]ЁC@K5bdhYBN橝eŘmjΗc1YQI1I  &tGlݷc3o9[:9);!1‰fn+njCe>:~HSs0 BluvoK)YVվ+5&`!bB&| 1-X}{^&O芄"M]= L4ynXL1)*q,1c0\aC *+Eږ5jiEH]`o[(q5i ;OMN.XS\͓\ ji <yS3ŜRRk+LZ{:}=^B''Ʋ%IUۍ-MG|{?zo\2E#% EIT6l׬?sӮB_/olW5`]cz~9nhp #ti|t9%܊[:3+*YYgڊRe1zsك1?x YUߠS۩dMo<@7~DCa76@ xw3 \Du+{QDC%ո́[r󯎖f3Zot D<-~W[RK|Y]M. =ḿd6?ϟxڨrM>St"fJi4y\Y/-O=tO:1riJǔ4<׾FCD-k{W#:X%3Y6/^ %nsЛҥ3F}GϏoҹg'߿{M]ዺjk`A^"d1K'9G۷0Mcm塿ܵ%H2:5eܾ3,VZk~C.E\E3մ%ҫ=[{Z}nוhL|1NdmyMLN_4t0 lt*J+I /t^&?9F~!bt, \Q㙳S"\`6&'5ól";9v%?`lo#/.~c=wG 1Ms)Jtv*z[]mo${ |غ -vt3u[niqy!/ɉB)4t>\<9M6&''=:s,K(K !S eYUu:w]fB Fs@wй)B~ga 7wX1- A8M^_ RtZm"\~t7uF0|LEQ4Mm:vyI5ݐdev){⤓gۚ|tdV7X͔-z'x쁻5x "B0qu!tNռ\^LI^\m7hM&H:WgSb*w;8AwR:33sx<^(UM/IfϟU+Ζhd^^ʦj?˲ޞeb6zxxv6Rt&X*_u*HJU ,cmi x}BS瓹* :hEi$Zr$!`+ ñhE7bEM微B^3@Cs%r]d["M>cY%jB:?܈Ožpd d,'Wl><<F3aZŲ$J2WJKGNbU[AG . yUʪo|TQZn\' aycn1qv eX=N%2JR"[հ$EK7xw_{w8n#c<˶6w4Mus])*n d iDô2/W<˴|-eG,B PX 1BAafv,B,ˢPJ-@7hq^)aZP"7E8% ÄN߻M˪(jAR\! ϼ#s?~S㓒']!iYc3K7ؑB88 }P5LӴ ˒]7R>Ruν%vmu )uDMdL_Oׇ~e 6aMLNo}䃜 ]K`v]ZHZ1,pBwkߎMKO_+qc01-M~;xشT,S(M>7xFU9㳉,}[<0 0ʚF4+]-nWtW泽=={Gï /V}u@EX5|,U[Hf X4 /~NuC%igUb,F|;ÒAU5c*\L-C^]ƫavgxhGޅɱ+KR݀w"% .!pa|rq6s3* R6S;BB2R +Z$-%Y]L-BLRBiY!"ϱA A- BIEі2s9@MMW5B.cd4 ux[R|?xg/5cY⾶SdYʼaZeB ˢVY}{ac18`bf2W%  _R,}䩃m-fhbrR2~irjf~bjzl|2Jۻ7*GϖD_HJA ( 7wmr׶m;j6a׶7no˖;SȾl۲e8VhdIENDB`pgsphere-1.5.1/doc/img/logo.xcf000066400000000000000000013137651461140101500163270ustar00rootroot00000000000000gimp xcf fileBB\gimp-image-grid(style solid) (fgcolor (color-rgba 0.000000 0.000000 0.000000 1.000000)) (bgcolor (color-rgba 1.000000 1.000000 1.000000 1.000000)) (xspacing 10.000000) (yspacing 10.000000) (spacing-unit inches) (xoffset 0.000000) (yoffset 0.000000) (offset-unit inches) .`s{B Elephant     JLl.<.H.Tx !!!#0^\G +l|#*,$,4,D,T,d,t,,,,,,,,---$-4-D-T-d-t--------...$.4b73󲺷1򯳺.𹱱a,𹴳~a'稞~%槨!ᢝ~ww~񞦢𚐇{lffrޛ{qfabm|ݘzric`bkx🞝蕎xkfa\Z\dn~~| L𡢢昏wneb^YVW^dt~|x L𪨨ᙕxog`]WSPPV_lv}jT=.|ά{tf`[TONMMQYdfvcQ=-B𛜛}vmb]UOLLMQ[`mx{iME=9WTd欫{tjb[QMLLNX`gjs|l\JHZUkᠣyqha\TNLLT\aaddp{umuy霙}wphb_YROMLLPW^aa_eexᤩyuohba]VRNLLMPUY[\_]fv𢨬~wtfaa_[UPMLLOPRUWY^cr㩮{use`a]UOLLMNOPSVbr㶴{usica\QML LMO\n}񶱦ztrga`\QL LNRcy~񽯬xtqfa_ZQML LOWcw񤥩zvslda]VOL LMRWg~򤠜yvtqeab\TNL LNTbjillN8BZm줢zttpeaa[RLLJHILOU_nkX>[l^du졢xttogbaWOLLKB:DLWg{rGMeV_{㢦~}wtsogca^TNLLC@IQjk2 %T{b73¼1ļŽ.ƽ`,󻸳`'筬~%謫!᮫zz}ummv휙~tjcdqꚘ~vld_alz¿皓zrja\Z\ep} M斍zphc]YVW^iw~{ M򴳰ᙔzsh_\WSPPWapynV=.}񹶳ߚ|wnd[UPNMNRYen|fS=-B㼻~ysh_UPMMNR\dpzoQG>:X`h廹}wnc[RNMMOX_gnw}ucOK]hv᯳{ui`\TOMMT\acglv~u}߭~zsia_YSPNMMQW]`abhpᴹ{ysia`\WSOMMNQUYZ[^bjxᲸ~zxqga^ZUQNMMOQSUWY_jw㹾|yvkc`\UOMMNOPPTZfuĺ|xvib`\RM MNP^q|xujb_[RM MOSe;{xtha^ZRNM MPXd{⯱|ywqf`]VPM MNS_l⭮|yxupfa\UOM MOUeqonyt﫩|xxsjb`ZRMMKIJMPWevp]brz{np|n`n}㬭zxxwrha`WPMMLC;EMXm{lqvy{{xgXi㭮~zxvskd`]UOMMLHAAJRmwowePg{{zwb731ýý.g,󻸴g'筮%꯵!ᱮ륣xx}򬭭ysmnw똗ztkgir~皕~{sjeadku V旐~uqlda^_es~ Vᙖ~wnfc_\YY_jur^E4񻹶ߚ{ynb]YWVW[akzm\E3J󼺹󙕏|yrh]XVVW[cnw~uWNEAbqp🜛ztjbZVVW`gnw}yhTQfᲴ~xogc\WVV\dhlnx~y߰}wnhf`[XWVVZ`eggmq}ᶺ|wohgc_[XVVWZ^aacgmu화}{~rhfb]YWVVXZZ]_aix㹽|yvmgd]XVVWXY]emyº{yoigc[V VWXdv{yqjfcZV VX[kɾ~{woieaZWV VY`j~ⱳ|zxmgd_YV VW\mv⯰|{y|phc]XV VX]lzyuˋ{{wskgb[VVSQSVY_n|vgwПrf|ﭨ~{{vmhg_YVVTKCNV`sl]s㯰}{zxskgd]XVVUPHHS[s~}ܜb 7"D[J+ 3Z־C11V&. 0pT, %<|6'#Knz'%*Y?!:[ h$Kr3 0Lxن1?fa ":dQ #p]& Y ɏ\%  &"ǐ\)  >HZ'ӟm7 +Ekľ(ϘcG` C+ I.$5 y5V5S5W5Z5 5 *6!i757-7 FL<L"8LK-""7IHGE&""3"#$*E;5/$)0;ONLN/,#%&2KD2*':DLSOLN/,,7;ALJA?MceZ_llmy~B*AGIJLLRUr{{hBL)NMNNC`(QTXYg'c^kuLL#x{}|LL#裔ZLL#㣘vSMLLJ@"睢|]NJ5$""!檥wO/"""⭪8)'$""!ꡧS3/,""!쩬gD;;""eN-""yK1)"!⬫kJ<4"!﫩bICB"㨤hTV\"⟘|x!╇!vu}Y4*, FM<M"8ML.""7JIHF'""3"#$*F<5/$)0;POMPhv,#%&2LE2*':ENUQMPhv,,7DJVTJIYkq|vv*IPSTVV^oV)WY(Z]al'ny|VV#VV#eVV#򻸳gWVVTI"󳭦򹳭mXT<)''!庴Y6(''"⼷=/,*''!⻸W953''!mKCC'"mW3'"󻺷U8/'!⵴tSC;'!㲯hQLJ"ﯩp\^e"艹!硏!򶭢b;/2 F<7]8 J36)p?WQ2 #Y?-Y; ,0+-LiR_mLFH2 ,JO#=s36âl:* [u3#[ԛʡ^$)aY[X(4i\!'TF "~ L %T."sCKac&"޵f8"Y(!YBA5 ,7Yx`< (.mϤ{H$ '7gēe/& ^ʝR& +th*& "]̨\$& )L佂\.' DoŽH&*4}ھxL ,pԪzZ7 -,f0 -#Lx;/EϕD0ai$ 05x90$YՠO0Pi( 03z}A1%^ԚI05q) 1 EݒI2Uz6 2f^$2!oL2 *ښ<27ԏ3 2M˅. 1%_x( 12yo"1:v%8ˆ.  /uԕ:$!_^'  ?dPؐN  (LzJǎM( )eR係P  ,S&`澍H 8j$_~I $OuI̡hB"  %/Km㨪{yvtqgbaa^UNLLNQMKPZzd%$6* O팈xvttofbaa^TNLLORPNVnd  (!\𦠙wttogbaa_UNLLMNNTk. 0Sꩣ~xttsjcaa`UPMLLMQZm¡I2`~}yutsc^aa_^YVQNMLR\s̲s8#`}xutsa^a`]]^]ZZYZfvŮfVj}wtsqfaa_`aa^fp|vtqi``aa`a`iqĸ͝zutqe_aahm|uyttrkcbaadj{{˯|vtshaa\iyũ˱{vsled`cw骦u|ŏ€ytqkjkqr~Ώ~wtrs{駜Ζ~{wz񵴳ͨ~~ղ߱ͥ͢¬ͪ׬ƹͬ궷ȭ٥챯לأ ݭ ܭߓߑޥ୮ﯮய𵴭yxiwsqžڢך¾ؠƿ٠ܠ騕ꦡ־¾z߮t ͭĿq 򭯸q۞¿kWiȜÿ}_Ucsܣ웜tovwvv{­Ľ|fr||󰯬̗}rv}ſsr}us˓ztqrx{ypouzþuqqs{|ȼÿ~tqu}QQm}yx}uox|ZZkxvtvvww~~y}w}vr~~wtt{~¿wy|vZEwyvtt邈ὼyqRRttzuLu{xtt{㮰~|zxupga`]UOMMJFEJQ^tw^B\y{|{yxxskc``]UOMMJHIL_x}tzrdnz{}zxxsha``_UOMMLMVt{{xy{xxwpf``_VQNMMNR\rš~{|~{yxvne``^]XVRONMS^xˤ~z{{~{yxwne`_\]^\ZZY\j|ͺ~~zxwukd``^^_``djsű}yxupjd``dhpyƼѫ|yxvphc``blt}²{xxwqfa``dl~}zxwpe``dn{Τ}ywqgdgn~Ӟ|xunlrxz¾Ӟzxvv}ѥ|z|繸Ϸÿ׹ϱ¿̼ϲ¿Ǻ϶黸ϸ⩨ÿ켱ʼ򮫪綯퍖 ߷ﹴ ⽮þ䣭䡭ľ鯭߱軸¿¿񼹶ÿzſx}ſſ󻷯󹴭ſ½򻹹ÿ٭ſž½u ߻¾󩬨c ͼ}Qg񮯳gCXܫ痢xL9SrƮ½sO@Kgw}WD^}ÿxqx}pSTn򾽻qQHHFIqſpN3-!(GcþnS9($>i}bI4*%)Apſ~dC0".HpVVp~|}bC+Fw\\ozyxz||}dC$%_|xx|}tJ',]}el}zxxyuQ>1XvRRxxyx}||{My|zxx㯲}{y{qigd]XVVRMLRZgJ~|{{wtlgge]XVVROQUmۙ~{{vmhggf]XVVUTV]|ʷ{{zwmggf]YWVVWZdvŒ|{z}qggfe`^ZWVV[e|ȶӟ~|{zsgfddedbbacp˷~{zxumggeefghrtxð|{yzyoggmvyŻϮ|{z~xlggkt~|{zznhghks}{{|oghtxȥ}{zojt|Ϡ{xrqz~ԹР}{yzϦ}͹¾㻼ͳ򛗒󻱠ǹ͵߻͸霫ǽͻ󽾽Ⱦ񯬫򼶣۹򷦙 ߹⾯䥯ÿ飯þ岳괵¾󽼸潻¿񽼺¿𾽺յՐ¾}¿¿򾽻þ󽹲þآ¿þÿ󹷴󻹶٭ÿþ¿ÿy g ¾Ti񯱵¿jG\ۮÿ捻zO ߤX- )GmyC 鼌M%  lprOr_rorrrrrrrrrsss/s?sOP#!   "##%%%        %%%%%##"       P#!   "##%%%        %%%%%##"       P  ""++( Dj}`7gj3%֡e-%Ϧa1%ՙb0%ա\, %̜c1%ӛb,%˧Σi6 %p==?MqϗT%B6rl%B:ql%B @pl %B7sl %B!\l %B [l3 %B"Il4j %B Ol4m %D !Ek,a %W+Oa0k %춂VVWeJ5a %ű뿌P& 'a %㾈U) 2x %ĊS& 9%ŽQ) 9%̉S&9%͟K9% N# 9%̺ R 9%_ _XC$ 9%^& &# 9%B9%B9j+(&%$""!!     '%% " "":::9#"       j+(&%$""!!     '%% " "":::9#"       j * %+ +% '#Js sU' % M W+ $ F ʏU # $I ƑI'! M …Q!@ ͊  J F~!P4z[D==COCÎPJ C翋L( $KCnjU  "M  C՚P  H~0Tchh[B 'J^hhgcG$ C͆7  %Hv`{@E|>C̅5  6EIIضzH-]ߠPCܨc0 േW{WCѝg.ɋXCڤ[1X<Уi:"X.lՠs\VVI7X8os8ٺ X ?o̬s?ܰ~`oX=p ڬr+ٮuA"1\X:t ڪd8ۨt> ,JYqX @p էmܷo7  #PX2v o;#SX5j֐B #OX6kӈ4 $VX 2Q__ep҆30sX  &&,6i҆3 ^X 6h҆3 ^X5ht 4 3 3 0 / . - - , + + + +          " # # $$$$      t 4 3 3 0 / . - - , + + + +          " # # $$$$      t  3*++*23]^42LŎN0 `c / `c ' - `c L , `c P', `c Q + `c ÐW' * `c 缅<* `c ݩM* `c ݩM* `c פK `c əF    `c d.  C[ghh_P+7]ehhdZ5 `c II?04uJ4kg6 `dCִ`&9pעk5 `k!FHi0 !|D `v#ݩMIh) !|D `c ݩMIh) !|D `c     !<<<<<))'& & $ $ $    !<<<<<))'& & $ $ $     AYhhfQ3"I`h hcN)>yc(  $J T) zʟd3 %U ƑZ+Ϩg/ $U ǔ`0 ]. #JϝZ-  Ҥe5#W͚b*՛d0 'O˖[/Оf3Jˡ[) ɴʠh8#\Ũڦϖ_*Ŗs_\d{Қ^ 'g㿏_][[\c˔KőY5"&>v|*'gȺR"(Ue)ǏZ* @sˈ.'gΝmW:%Rp-R$9pϋ/'gzXB?<889Ais.Q'5oϋ/'g²s. Hϋ/'g q. ;ϋ/'g m,:ϋ/'gӝQ :ϋ/'gާn2 :ϋ/'gԮl8           "#$$$$$                 "#$$$$$           1Qhh[@ )F`fhh^J' 0XchhUp1 SP   /^$n̐? )RT$ .f'wܛH)W”R( 4c(xߞQ%QԋP ,` (xmVȑQ& 3j (x꾗ÉQ(4b(xčV  !`(xì徎T+ *wۺ(x嶋g^[[^f忈I0ֲ~`\[(xݸ~N)!!)Pݯa 0õvA#(x}I#  %L߲c 0뾓{fP0(x=PϞV0nNB?;988(x޷uC GĔV, 0ּ(x䶀=5u]%0(x}? =              ! ! " " 4 <<<<<<<<>=%B9%B9%B9%B9%B9%B9%B 6 %B -n %BI %B ? %B I %BI %BK %B M $}܌@  lz8! IqR&! ,882 3  ;/H;"c;*y;+{;U;0d;2;==        ';;;;;;::777 2 " """"""$$$&'),k        ';;;;;;::777 2 " """"""$$$&'),k҆3 ^X  6i҇3 _X $))  6rӉ7bX'ZtG1m۝V*;|X:k$ FœU( 8yXB~- E{ƍY)=nXCՙO"F}ŽS'  5mXC{F  ExŏY44HmXCⶃI;44;G}šXCܺ􄍴XCXC X9ӗ֫X"PrːYˢoX"0Fb̗O*Hҝjf^& :ϋ/7lҤ m, :ϋ/0p s. :ϋ/ ;j s. :ϋ/5ob' :ϋ/7n~= :ϋ/;jݼ{E 8~Ȇ.1s߸D 1mӮu(:kα~C  !I}uO ;jqI   05887-  '2885+      B                  "  #  $  @                  "  #  $  @(xߝD0(xߝD0(xߝD0꺍skk(xߝD0V0$$(xߝD0ۉ=(xߝD0ۈ: (xߝD.܍B  (xߝD 'lb?44(xߝDI~Ü(xߝDC(xߝD !H}(xߝD G(xߝDB(xߝD H~&tؘBG!e: !FDp~Y'! Ks +881""+588  #  @-//.2 ---------///0  r-//.2 ---------///0  r ʔ_+,Y' .knpqgT0.$%&7IUUN>*- 9hh41 MƦm=, d٩h. ,47=~ߕK,򁅮W,\,\, N, ةi/ , ԧh9, ةq0. ŧj8. i:. 81'/  qpp88 Black Text     At.tNuZujuzuuuuuuuuv vv*v:vJvZvjvzvvvvvvvvw ww*w:wJwZwjxZxyzB{{m{}{|~}}~Mx(8HXhx  "#$%&'())))) )     ) 2 2 2 2 2 2 2 2 ' & % $ # ! !  )&%$#!    >=====<;:" % 2/..-+*))('''% 6689:;<%'';<=>=;9@============   !##;;96 D     ! "#%&========='&&  @ 4 3 3 100/.,++++++++++++++                     ::::::::::;<=>? !#$k===;;;;       !""#%%&);%%$##"! ..........01 3 j777777777777$$#!        "  ++,++++++++++++,--./ pp88Black Text smooth     T^~dp| *:JZjz *:JZjzv'7f\l| ,<L\!#$&')*+,-..// / / 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ' !#$&')*+,-..// / / 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ' !#$&')*+,-..// / / 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 '   7JRUURJ7OX& Bդa( "lߧc(  :c(  Jc( Rc( Sc( Uc( U a&U!ߤXU"Պ7 U#J  U#R U$S7JU U &XU ؾU '`U ؕbWsV ![U c %b\#!MU cCpGVU ؕ_JOlϗ U ؼ U  U% U/ U/ U/ U/ U# U" U  Uᰋ UߩlOr Uڥc1+^ U͗[(W UˋM U U ϓLU U ù 򳦆QU)(%$#"   !"")(%$#"   !"")(%$#"   !"")(   $7JRU URL:"# &X lC" (a ! (c  )c/eDvRB%nE#m =%\RUUS^:9s%>8n %8ns9;998Ԭ7nj6pNj5^+2dX1l \!'Ohg m@BUp֊D!7m Ȍzz3@ ڵֻ 3 1-+*('&%$##"!8:;<=> 3 1-+*('&%$##"!8:;<=> 3 1-+*('&%$##"!8:;<=> 31  ,7JRUURJ7*%WWZ%)WՠZ' 7ؔE& Jz8%RzE$S ŔZ%#U ءZ"U ؓD"U v. !U \ U ؎=  U e,  U ڝnZVUUSMD?DMSUURJ7U øQU ϓLUˋM U1͗[' U2ڥa( U3ߧc)Wd1)^jNp அ Ͳ ἵ ʕiIDp! ˋM'(_" l7-`$lQr6ᰋ79:97͜6ܕQ=e4a ,}4N!n@==<<;;;;;;;;;   #=@==<<;;;;;;;;;   #=@==<<;;;;;;;;;   #=@=<%;W;7 :J :R:S:U:U:U:U:U:Zn/    ܠp[VUURJ7 7JRUURJ7ùX& OQդa( DϓL ߧa' 1vˋM  ߥ[ 1i͗[' ڗLDvڥa' ͋M Rߥ[!͗[)EڗMڦiBH}͌ᵐ "97Ѱ5͎^Su3ԔM 93ΔUc3  ! " #77:=  ! " #77:=  ! " #77:=        7JRUUSMD?DMSUURJ7 7JRUUNW%O 5ՠZD J ؓD 1vRv/ 1i Ue) Ex Ve/ 'Z !#\vG%/c UEmŗjZr}޽۹ ";86㵐4iBJ &c+Z#g)  9#Ӂ4 N 4 2 10/.--+*))(((((((((((((( 4 2 10/.--+*))(((((((((((((( 4 2 10/.--+*))(((((((((((((( 4 1URJ70Q/ϓL.ˋL- ˔S, ӐD, v1 * i1) vD(ďO(Ά5 'J 'R'S'U'U'U'U'U'U'U'U'S'R' & % #                     7777777889:;<=>? & % #                     7777777889:;<=>? & % #                     7777777889:;<=>? U ܠp[VUURJ7U U n/  U U Z U U UU U UU U UU U UU U UU U US U UR U U J U U 5 U UO U UDv U U/e S U )gR S 2z JRU 7J M Wʅ5  g %WN 8 7JRUURJ7 J   R S7U7U7U7S7R6 J6 77X7&a8 (c9 (c: (a; &<=? !!!   !"#$%(* !!!   !"#$%(* !!!   !"#$%(*ܘS#@ ߚ`Mi Η[5:m ؅3 [ ֡y SFߢjZ{ ˽#i;98ڵ7Ȍ}6mEZ\&,iWOU8դUNXU7JRUURJ7U  USRJ ׊7 [v. ӐD˔SˋLӔL ĐS! ׫vD"X [.#7JRU URJ7 $   '*&&%#! (((((((**,-/2 &&%#! (((((((**,-/2 &&%#! (((((((**,-/2 n4)M岅=====- $  ᰋ ŝlOr xNDpg2+^ i2!\v1W x1 VؓDU ڔDUءZRZUēZ% J`'U ׫vD 5& U ù[.NU ܠp[VUURJ7 7JRUURJ7U n/   U Z  U U'U U'U U'U S'S R'R J ' J ߒ: ' 7l")XؓC)&`ՠZ+ &XW%,7JRUURJ7.  1D<=================##!  D<=================##!  D<=================##!  ڕQW3j%U3XU3UU3UU3UU3UU3UU3UU3UU3UU #UU !UU UU ϘUU qNcUS ^(&GzSR V 8zܳR J RE鮦J  7J Zv5 Wʅ5 '`ΏDN%WN &XO7JRUURJ77JRUURJ7        =<:.........--,+('%$#  "  =<:.........--,+('%$#  "  =<:.........--,+('%$#  "  c7JRUURL?Bn#W \#U V#UU#UU#UU#UU#UU#US#UR"U J U 5 UO SDv Ĺ R._ ʘ J  M l{ ߒ: M gDel" _ 5&RؓC .v8ՠZCNW%O7JRUURJ77JRUU   "  ((((((((((((((())**+,-. 1((((((((((((((())**+,-. 1((((((((((((((())**+,-. 1M'D '? 'D 'M'R'S'U'U'U'U'S'R'J '׊7 '[(v. ( ڔD) ߤZ) դ`'* X& + URJ7,  -  1pp88Grid     H5U*6aq!1AQaq~‡—§·æ#O'[o[[[hm^n~<fVϳcpcpcp  efggf`\ca^cgrrpffgfec immv{|}~}~xommkc cdcpuuz~~{xqiimuzqijjiiqw|~~|vuueijq~}xttst"(+72'#"'5olzxrtAAGGHIJJIJJKMKKvsttx eort}~xnlnt%&#%+-('0>EE>nv|kfIHGEGJMMJR[\WPMMtcghv|zxxtngns#"(+--' ::7jrztl027>EIICHKMMPRTRMHIP[bPelp|wopt ! %('('%&-52+2:qu|p թ5!Ǘm#Hq Ym a\ nܸ%7tm|rsRVXZ[^_adjlmnqrruvwwyqm|vqjjp{{ri fuq7:lt{x}tQSVXZ[^`cdejmoqqssuwypu}tdqt~unt cwpj8fxzjp|yRSWXZ[^`cdejmoqqssuwkx|tj~kpz}~xxgxp7xnyquptyQRUWXZ[^`cdejmoqqssyj|ym|}~yqt}cszu9ryo{Dn{sQRUWXZ\_acdejmoqqssrzxh{|}~nsrylnsxpcCEihQRUWZ[\_acdejmoqqkt}wkz{|}~izm7sxp=?CFqgQSVXZ[\_acdejmoqdt~ptyz{|}~h{urqxqq>@DFv|kQSVXZ[\`acdejmygu|kxwyz{|}~xvhrvw>2>BEJx{mQSVXZ[^`ccdejmqv{nsuwyz{|}~m|pryp79:?BEFxzpRVVWZ\^_`adjjuz|nrsuvwyz{}~i|trwv38:;@CEF|xoRVVWZ\^_`adnq|xpqrsuvwyz{}~cu{twq28:;>@CEJy|kSVVWZ\^_`adp|xsnqrsuvwyz{}}~o|yqq38:;>@CEJxgSVVWZ\^_`jp|wrlnqrsuvwyz{|}~hzp+0379:=BCFJwgSVVWZ\^_`p}ttllnqrsuvwyz{|}~eu~ph.0278:=BDFIsnUVVWZ\^jp|tojllnqrsuvwyz{||}k~q{*/0379=?BDFIgyUVVWZ\jp}syjjllnqrsuvwyz{||}~x{u)+/338:>@BDJIk||UVVWZ\p}tpdjjllnqrsuvwyz{{|}~l}{j++/279;>@BDFJru}sUWZnp|vsacdelmnnqrsuwyzz||}~eu|o{#*+/279;>@BDFJIp}syVXq|xtaacdejmnnqrsuvyzz{|}~j~tx"&*+/289;>@BDFJIry{mtszxr_aacdejlmnqrsuvwyz{||}z|h%**./28:;>@BDFJIMrtqyzp\_`aacdjlmnqqrsvwyz{{|}~po&+*./38:=?BBDFJIMl}z|nZ[^``acdjlmmoqrsvwyy{{|}~|k&++.039:=?BBDFJIMupnXZ[^``acdejlmoqrsuvwyz{{|uy"%*./039:=?BBDFJIMjt~tsX[^_``adejlmooqsuvwyzz{s#%*//079;=@BBDFJItt|z~}iXZ\_``acejlmooqruvwyzz{t $)+./0389;=?DDFJ{p|tts|i[^_``adejlmmorssuvyyz{ $)+./0389;=?DDEJhzyoRku{h^_``adejlmmorrssvyyz $)+./0389;=?CDEmzyfQRUtuh_``acejllmoqrrsvyy:ehq}y7clu|pq5fkw{wpio3fkw|tr1cjv}xko0jz}tm.fq|{si+cfnz{xp~ku+kz}qqsn{v)fr|{skpjddltuttu|~r'fi|{qknw{}{yuux||'t}|{|unklpqyyvxoonk$cgu~xutfgrynq|ph#gptosq}t!ciz~|ptyr{tc gstixyydxsdu|ocm|~vdr|lrkipm|uomxuwtppx}xcl|}uojntpvyysfgnhy|vyp|{qpscru|uogstv|vilqjpozuslk|}vt|xqhnivtoyps{{pmuyxsympkttdjjr{zvqjxr|rskmots{mp|yoqxq}rlympmk{siluyyolprykv|tmpmlyq{ku}tk{q}rkp}xqmpmyrzwkt|tltr|tytv~tgckpmrn{jlt|vpkqx}kpq|vmpkpmosztwuo{vmxvqsjx}qy{vmn{qxtkxyrkxk~|w|xojckk{jnhyxs{rlmzuj cktegkxoxk{dr|pw cmtjgcrp||pot~ss}pt lsenjgnw{rqoy|oyp}}tl eto^ftm|rsqm|vqjjp{{ri fuqZ_lt{x}tpu}tdqt~untɉ cwpj[fxzjp|ykx|tjkpz}~xxgxpZxnyquptyyj|ymyqt}cszu^ryo{on{srzxhnsrylnsxpcnrihkt}wkƉizmZsxpcgnsqgdt~ptƆh{urqxqqfjosv|kygu|kxxvhrvwfVfkrvx{mqv{nm|prypZ^_gkrsxzpuz|ni|trwvW[_bjnrs|xonq|xpĂcu{twqV[_bfjnrvy|kp|xsćo|yqqW[_bfjnrvxgjp|wrÅhzpJRWZ^_cknsvwgp}ttÆeu~phKRVZ[_ckoswsnjp|to½ˆk~q{GNRWZ^cgkoswgyjp}sy½x{uCJNSW[_fjkovwk||p}tpl}{j5JJNVZ^bfjkosvru}snp|vseu|o{;GJOVZ^bfjkosvwp}syq|xtj~tx9BGJOV[^bfjkosvwry{mtszxrz|h3?GGKOV[_bfjkosvwzrtqyzppo3BJGKOW[_cgkkosvwzl}z|n|k55BJJKRW^_cgkkosvwzupnuy59?GKNRW^_cgkkosvwzjt~tss/5;?FNNRZ^bcjkkosvwtt|z~}it37=CJKNRW[^bcgoosv{p|tts|i137=CJKNRW[^bcgoorvhzyoku{h137=CJKNRW[^bcgnormzyftuh:#O7ڗ:5hٽZ.4p߱M6gO6ZP7,Ά5.۝0+sEgվ),p 1gC'aAdyϻ'רyneK8g\OYn$ Jϻzqڞ'>} k߶'Yn Hش&15 ,& T%  tm(OY 8й:  bӃ..R j֣] ٛ T<!CΏ Hmµ0#gǦ b֊dа" ޹:5ka߳dvwy: !ݲY \ݳ E8 ,<p1>ܸ? T&޽O#b Ћyb0Ae:? h?<ɣۘ(t#] :٘5䝆#Jh\ވ (%%nJyv,W(M.H翃# ƀM1ߐ]в1ϓJҗKH hWՔ1Հv? \Fw\FF#Yh_nE1OܩJ< v.!3 MTUk|E* >a%Uݙ1% qCE yK7 q3]C|: KHm E}ߵ0d y_qܴ!j C߫wp :n&|J \zݻ,Y#h g.0g(KP?b!TE*,_CeK   7P. 5gܨPT8#H<103Huqhoovvipzxuttddflty57:l~tiACxpgdpsux|xmkPrjjy~xvvrncgpWY  ns|pnp%&'(+--0257kti>ACEGHIIJJsmtxpv}mnrUUWWY[  iktwxx~zn#%&'(+-0025cl}tf>ACEGHHIJJwikx||umTTUWWY[\  cluxppto#%'(+-00225muc>AACGHHIJJpoyupuotptUUWWY[[\ untypnky%&'(-0025qzwk>>ACEGHIhsv{}qitPPRmr}xmWWY[\fnzug !yrry'(+-022my|u>>CCEGkn{~tmyMPPRTr}|lWWY[\\]]ntwmy !"lzzi'+--022ro<>ACCEwry~rpKMMPRTkr}xtWWY[\\]]ysjw !"#tum+-00sr~pc>>Asjt}xpisKKMMPRTks}pcWY[\\]]g !""#g}t+-00l{zq<>Apt}xpHHIIKKMMPRTUyzgWY[\\]]ddgmy !"##kpss00mw~i:opt}{ljGHIIJKKMMPRTUWmtWY[\\]]|xnklps !"#%&nz|n02srwgpxnEEGHHIJJKKMMPsrqonno|klnpqqvkkrx~zssr"##%''tpynzwjqx~sfCEEGHIIytssxy{{|}}}|{{|slfgrtwx||shk'k~ms|~umnlghpx{||{zxvwwvuuttpffkrrffqrttpnu~{op~tpv|}ytnnpsvMMPRTUWWorY[\\]^ !"pks}|ztkgipsGHIIJKMMPRTUWWorY[\\]^tpmlkkwz~~tntCCEGHIIJKMMPRTUWWorY[\\]^sttw|}|xy|wttsEGHIIJKMMPRTUWWoqY[\\]^|~}zuttvddrn||}pguttx}~yoilJKMMPRTUWny|tY[\\]^pmnr{ npu|sp}p<>ACnnmr|zppqMMPPRTUWg{WY[\\]^xlpx{w|zzsk||odACCEqhfqxy||zvpgsRRTUWwtWY[\\]^smy}so#n|y225k{oACCEGHIIJppt|}tmqRRTTUp}|iWY[\\]^itw|wkjm|y2257n|~niAEGGHIJJKxliw}~zusdkjrqoY[\\]]kxti !'(iy22577nytrEEGHIIJJKKMMPrtwvp}xyWY[\\]]lr}uk !'(iy22577:pxutEGHHIJJKKMMPRrks}{mWY[\\]]s|zrd ''(iy22577:sru~wpGGHIIJKKMMPRgyxy}xqjh\]]pm &''(iy22577:<>yxvtGHHIIKKMMPReuutmoy|}onw]^kd&''(jw22577:<>>qx~wpGHIIKKMMPRcvykWWkjt|{vqh%&&''(jv22577:<>>AttwtHIIKKMMPgwwkUWWY[oqx|#%&&''(jv22577:<>>ACpxtxHIKKMMPuxxkTUWWY[\\pkx#%&&((kv02557:<>AACCtwtrIIJJKMcp}|roTUWWYWWY[\]^`d"#%&&'((pv02557:<>AACCEtxsyIJJKtq|jRRTUWWYWYY[]^^``!"#%&&''(tt00257:<>AACErx~ocJkjz~upRRTUWWYY[\]^``a !"%%&''(ws002557:>>AACEGo{pov{pPPRRTUWWYY[\]^`aab !"#%%&''xq-02257:<>>AACCEGm|vlsPPRRTUWWY[[\]^`abc !"#%%&&'xn--0257:<>>ACskqxnMPPRTUWWY\\]^`abbe "##%&&'zf--0225:<<>>Aot|vo|rMPPRTUWWY\]]^abbcf !"#%&&'zf--02257:>ACEGHIIJlwujPRUWWY\\^abcegik}zssttstx}sklq::<>>ACEGHHIIJKgz~tPRUWW[]]`bcefikmtuvvx{||{zwvvtldfl2557::<>>CEGGHIIJKMg|sUWWY\^]`befgjmm{utrrqtuy%&|f++002257::<<>ACEGHIIJKMss}|pUWWY]^^acfgimpn !""#%%{f(+-002577:<<>ACEGGIIJKMPkt{jWW[]`^aefijnqq !""#%%{f((-002577<>ACEGGIIJKMPPtxpY[]`^aegiknqt !"##%{f((+--0257:<<>ACEGGHIJMPPkvx[]`begjknqtu !"##%{g((++-0257:<<>ACEGGHIJMPPRr|m[]`beijmnrux !!"##{g'(++-02577:<>ACEGGHIJMPPRTm~n^acfikmptw{ !!""#zg''(+-02577:<<>AEEGGHIJMPPRTdn}{tacfjmnqux} !""#zg''((+-0257::<>ACEEGHIJMPPRTWyvsdegknqtx{ !""zg&'((+-02557:<>ACEEGHIJMPPRTWYm{rogkpruz} !!"yp&&'(+-02557::ACEGHIJMPPRTW[\^r|lmqtw}!!xt%&''(+-02277:<>ACCGHJJKMPRRTW[]`nuxpruz !!vx%&''(+-02257:<>ACCGHJJKMPRRTW[]`cevvu{ !tw%%&'(+-022577:>AACGHIJKMPRRTW[]`cfp|}nw{ !pv%%&''(+002557:<>AAEHIJJMPRRTW[]`cfjp~x} mv#%&&'(+-00557:<>AAEGIIJKPRRTW[]`cfjitx jx##%&'(+-002557<>>AEGHIJKPRRTW[]`cfknn{ro ix##%&&'+--02257:<>ACGHIIKMPRTW[]`cfkprj~x ix##%&&'(+-02257:<>>CGHIIKMPRTW[]`cfmptwtymhiy!"##%&'(++00257:<ъ& : !1J3Tʆ? P8e%mܿyke>AT:ˏ &5CEOZZmaZOEECnnѳH%(KTߌJ7 _*%7& Zmzyya#pٱǻw5t }kY:*<sAet#tӢH J!pƒq  (.Zְ\1 kWHk W⤇?:5 O߿KFa CR  bWYT% \繓(sOYH&#mMy1Y7.,\>8#HY& 5]M Z>7 #,Je|Z0% &(#WZ &?,,g>3] 1  %Mt 0(eRm : bFZ Teכ>&Mj?J C M  . mň_1 .8ݽJwg0 .aءW*n 3 R]8e<(y°v (вma >0g %JZYUaJ5._ R.30,0&1R1b3F3 58PJ s1g % egw!<g!!Z"H Y#_bY$!0Y$&Y$Y"#aY[[\\]]^`amptvnjeemecquv{}xjgc[\\]]^^`abdr{mee][^uknpx|ph\]^`abcnqxtnegmaT`xymgpzzxgc\]]^^``abcefwymbemkiicefnjqvtk]^``abcceflxxlfkbbjfgjjc\tkv}tg]^``abcefgkv~hiij jsw}whc]^``abccefgglvylij jtm{|pg]^``abcefgikzxojjkmqkpy|jf]^``abcefgik|pjjkktbepmu}tg]^``abbcefgijqs|mskkmmkjnmipj~ylc |^``abbcceeffgijvylkknnrxpagrmvsc xvssrx~~ceffgijjkotmmnnwae{ukbtorjK uvwwx{{||{yhhs}jjkpt}pmnnrntqeguwqdm|xjbR^`astpnnp{|{ppvjkkn|rnnpqpqrqqp|{km[^`abccefykggnvz{zzxytgpxupnnppqpqrqjp{|me^`abcceffgijsqqt{~}~svnppqpqrqpq||rf}M^`abcceffgijjspjpy}uvppqrqznliqr^`abcceffgijjksfuu{}zkxqq rjpxlojtq^^``aabcceffgijjkmg|fnnmv~|syrrtrovkelhm-^^``aabcceffgijjkmqvfnppkfqxzzwgyt tlrtmhomrC^^``aabcceffgijjkmynfnppqmpuxppttuqpwjqmnpr]^^`abbcceeffggijkmksppqqrjiu}wt|ttuutlzlrrn]^``abbcceeffggijkmkxppqqrtpv~xnouujutirrq]^`aabbceefggijkkmkvppqqrtklwtsuujxrttq^^`abbceefgijkmnkfppqqrtlety|jpuuyowktp^`aabcceeffggiijkmnstfppqqrtugo~uowuu|otw^`abbcceffgiijkmmnkzfppqqrtugryxnvunyjklwbcceffgijkmnd~gppqqrtugs|wtk|mrysqcceffgijkmnpdvnppqqrtuwyjx|t{vtlu|~xkoffggijkkmnpprtkppqrtuwkpw~|paapt}|tqggijkkmnnpqrvkpqqrtuwkp{uabcnjv||wkokmnnppqrtrrp{vmrr tuwyv}bcefgitr|~toppqrttmsttuws~cefgijkqku~|twrqqrttukw}puwwuuwt~efgijkkppqrs}xptuuwwxmyxxwuwt|fgijkmmqqrtknu~|tzz{{xp{{zzx wuwvwfgijkmnrrtuwkix||pt}}p~wp}}{zzx wuwqikmmnqrttwxzzxnzxrku|l}}}{{zzxtuwkmnpqtuwxz{}}qlt||wj~jxy}}{{zxwttuuwlnqrrtwzz{߅gu}|q}h{{zzxxwwuuwlprtuwz}}tm|ri}}{{zxxwuwwlpruwx{jp~xp}{zzxzxx wkquwx{p~nwwx}{{zx wktxz}q{let||tq}{{zxxwwkwz}evryiw{s}}{zzxwwkx{uyoqp|t}{zxxwust{evxjtuzg}{zzwuoxcuzg诬ft~yw~}{zzwug}fu|f赳koz}vp}{{xwuieuygÿülv{x}}zzxxwwuscv|gÿom~|sr{{zxwwuunwxgÿoyv{{zxxwuxwp{xlڽÿptxq}{{zxwo|qcp|}soЌǿgq}|m}zxyp~qtpkſnry}x~}zxmw|xyiz{mxhy}xo{zj~xwoprtǿkv~xf}zrnwcv}~rdſlux{|}jwnr}xdj ſsn{{z~r~oiwkx~pkſi~|xlxzkxwv}~xkyýlz}uojmtxxwznnz~tg|f{xxtmsýnx~pdqpc{zxqutq|gy|k}zxmptvnjmecquv{}xjgcdr{m򳱴ýnpx|ph\nqxtnymgpzzxgc9fwymjqvtkc&lxxltkv}tgzkv~h sw}whclvyl tm{|pglkzxokpy|jf*k|p·mu}tgn qs|ms󽼿pj~ylc@ |vylmvsc xvssrx~~otǶýtorWuvwwx{{||{yhhs}pt}p¿dm|xjstpnnp{|{ppvn|rp|{k[鹺ykggnvz{zzxytgpxupjp{|me΋sqqt{~}~svq||rfʥ.spjpy}uvqznlissfuu{}zkx jpxlog|fnmv~|sy ovklh;qvfkfqxzzwgy lrthomžynfmpuxpppwjmn³ksjiu}wt|tlzl񿳴kxpv~xnojutikvklwtsjxrkflety|jpyowkstf go~uo|oǴkzf gryxnvnyjklwd~g gs|wtk|mysqdvn yjx|t{vlu|~xkotk kpw~|ppt}|tqvk kp{xnjv||wkop{vmyvtr|~tomsqku~|twrkw}p鶅rs}xpmy뺅knu~|txp kix||ptp~wp Ĉxnzxrku|lkqlt||wj~jxylgu}|q}hltm|riljp~xp kp~nwwx kq{let||tq kevryiw{skuyoqp|tstevxjtuzgoxcuzgft~yw~g}fu|fkoz}vpieuyglv{xscv|gom~|srunwxgoyvxwp{xlptxqo|qcp|}sogq}|myp~qtpknry}x~mw|xyiz{mxhy}xoj~xoprtkv~xfrncv}~rdlux|}jnr}xdj sn{{z~r~oikx~pki~|xlxzkv}~xkylz}uojmtznnz~tg|ftmsnx~pdqpcqutq|gy|kmptvnjmecquv{}xjgcdr{mnpx|phnqxtnymgpzzxgc^fwymjqvtkBlxxltkv}tgkv~h sw}whclvyl tm{|pgkzxokpy|jfGk|pmu}tg qs|ms pj~ylcj |vylmvsc- xvssrx~~ottor։uvwwx{{||{yhhs}pt}pdm|xjstpnnp{|{ppvn|rp|{kޏykggnvz{zzxytgpxupjp{|mesqqt{~}~svq||rfKspjpy}uvqznlisfuu{}zkx jpxlog|fnmv~|sy ovklhbqvfkfqxzzwgy lrthomynfmpuxpppwjmnksjiu}wt|tlzlkxpv~xnojutikvklwtsjxrkflety|jpyowkstf go~uo|okzf gryxnvnyjklwd~g gs|wtk|mysqdvn yjx|t{vlu|~xkotk kpw~|ppt}|tqvk kp{ynjv||wkop{vm ywtr|~tomsqku~|twrkw}pՈrs}xpmyډknu~|txpkix||ptp~wpxnzxrku|l  lqlt||wj~jxy lgu}|q}hltm|riljp~xp kp~nwwx kq{let||tq kevryiw{s kuyoqp|tstevxjtuzgoxcuzgft~yw~g}fu|fkoz}vpieuyglv{xscv|gom~|srunwxg oyvxwp{xlptxqo|qcp|}sogq}|myp~qtpknry}x~mw|xyiz{m xhy}xoj~xoprtkv~xfrncv}~rdlux|}jnr}xdj sn{{z~r~oikx~pki~|xlxzkv}~xkylz}uojmtznnz~tg|ftmsnx~pdqpcqutq|gy|k PO ]ZE , ԃUߦH, Mѫ071+.>p+&7 bA*F aM(*A nޣC(! g'Fږ37& ߁ WԀ %3< ƽgZ! zڽJJ7%bPqřg%gߛqq0>>]аZ#*jy%TՖ0 >_WtCd%W7 h&7 UѦk #K.tք5 <w<|5]jF#Rɣ(?Hja |] jA %k]5emAEk܃ EH z*vE&ݭM>TկC Y٧EHst!Z߱Ts۵:ܻAT!CPܩ P &kw #Yk. Jw0. P (* 7."jem%&\p18P(Uߌ }Ӌ,J8-F:0!1Cb=jt ;khc#:koqxG9rnnmbP8knmg+7jp\xwp<6q[ivkxA5p{cwsnne4utqniuJ3suwuutrjuk 2yxvwuttzistl1twtuuttwwmvtf%0rutuwttxjuo{xc0rwxtzo}{ekmyxe/ywxvmyxpcmi|rc.~lxxwgtxhtqprj{rp-cwwylyq~ttp{iW,cwwkzuittpw{i+cwwqsujtrfxyf+cwwdquirpo|mi*cwwudpvesp|i&)cwwuttqtejhxuc(cwwuttjqtfpm~pr(cwwuttrqtgtuzf^'cuutjqvrm|nk<&cuutpvgtgc&{huutjqunow^%stuutdp||fu$ju utrppkn$ju utrmx~rmmM#pu utrtxqnmw# utrqmxtjn\"wuttuttrqe}vtjc+!wuttuttrqlt{ktb!wuttuttrql~|{gnR wuttur rqlzp|u\w wuttur rqzks|lwWwuttur rqsmjv{hrwuttur rqnstgq|teHwuttuqqrqpstkjomnxwutrrqrqqpsvmklyxf\xwutrrqpsvmkkr~kkxwutrrqptvmkkjwzeH@}#=Q<…;kh2koȟ9nnm7ny̻7ԡ6ӸĪȝ2̸33¼Ą2ɵ1ǥ{ug0ȼo{xcj,Ȑ{ɹѽmyxe^.ȳoyxpոi|rcR-gtxhj{r,cylyq~p{i+ckzuipw{i+cqsujfxyc*cdquio|m)cdpvesp|i(cqtehxuc~(cjqtfm~pQ'cqtgtuzf'cjqvm|n&cpvgtgd%{hjqunoǴ$stdp||fË$j ppZ#j mx~r"p txqnmy" mxtj*! e}vtj! lt{k·d  l~|{g  lzp|u_ qzks|lǯ3 smjv{h stq|tstjom@svlyxfsvr~k_tvwze@!};=<;kh#2ko9nnm!7n76#2鱿+3觹3礖2ݞ1񓑞~uh0єo{xc+,흄myxe.oyxpi|rc-퀚gtxhj{r5,cylyq~p{i++ckzuipw{i+cqsujfxy*cdquio|m!)cdpvesp|i!(cqtehxuc(cjqtfm~p'cqtgtuzf'cjqvm|n&cpvgtg%{hjquno5$stdp||f$j pp#j mx~r-"p txqnm" mxtjG! e}vtj! lt{k  l~|{g  lzp|u qzks|lW smjv{h stq|t)stjomjsvlyxfsvr~ktvwze!1<81=.:698X6B5+43M1ɸ11K>0)A/Q!WԲ.U. AZڭ.kmW-dϗ P,?!, Uن+%Z* ) h) &0( Kތ( y&J' \'&b&a#n&*,w:TEa:ⶐ]9 y:t>9eZ9>|8%H8sJ޻87:*6wy6m!:h|rup9uzn{i9}ph{o8pyngxt7euttsy7j}pvp7cnxkwp7c|oxwp7f|mxp7s{xp7vrxp6evxp6mtwp6njvwt4cqjtzp4gpqo~j4gogl4hjh|v4tst3hql3pkn|2fug{u2jxor1colk1cl;e{o;qt<ut;ewt;k}w;m~yi0m~ s/cn{xt/exxqy/f|rm~/gikyu/gio}k/giuwr/gixyq0giqzr0gitrx1gnj{p1guk~h1f|xuxo1exz{|ox1hrxtzp2motqvx2kpttxtt3mpttpys3mpstsk}g3mpdzqxnzk3mpjylowpn3mpjxkfk4mpl|ef{m4mpnrtswt4mppxttr5lprzqxr5lps~s5lpj||t5hko|p;nq;n{n:ny{xj3fh{psq}p:h|rup9uzn{i9}ph{o8pyngxt7eut tsy7j}pvp6cnxkwp6c|oxwp6f|mxp6s{xp6vrxp5ev xp5mt  wp5njvwt4cqjtzp4gpqo~j4gogl4hjh|v4tst3hql3pkn|2fug{u2jxor1colk1cl1e{o2qt"2ut$1ewt%1k}w1m~yi0m~s/cn{xt/exxqy/f|rm~/gikyu/gio}k/giuwr/gixyq/giqzr/gitrx/gnj{p/guk~h/f|xuxo/exz{|ox/hrxtzp0motqvx0kpttxtt0mpttpys0mpstsk}g0mpdzqxnzk0mpjylowpn0mpjxkfk0mpl|ef{m0mpnrtswt0mppxttr0lprzqxr0lps~s0lpj||t0hko|p1nq1 n{n1 ny{xj0fh {psq}p:h|rup9uzn{i9}ph{o8pyngxt7eut7tsy7j}p3vp/6cnxk1wp/6c|ox/wp/6f|m3-xp/6s{1/xp/6vr5/1xp/5ev73/5xp/5mt71/7wp/5nj/353vwt4cqj/353tzp4gpq/33o~j4go-/131gl4hj//11h|v4t11//st3hq11//l3pk311//n|2fug11{u2jxo11r1col311k1cl1131e{o112qt9/112ut=/111ewt?/111k}w//111m~y//11i0m~1/11s/cn{3-11xt/exx3-11qy/f|r5-311m~/gi5+311kyu/gi5+311o}k/gi35/11uwr/gi35/11xyq1/gi15/11qzr1/gi13/11trx11/gn/3/11j{p11/gu/1/11k~h11/f|x/1/11uxo11/exz-1/11{|ox11/hrx33+11tzp110mot35+11qvx110kptt5-11xtt110mptt5/11pys110mpsts11k}g110mpdzq31xnzk110mpjyl31owpn110mp1jxk1fk110mp/l|e1f{m110mp/nrt1swt110mp//pxttr110lp//rzqxr110lp//5s~s110lp//5j||t110h/5ko|p1115//51nq111-7/-3n{n111+7/-3ny{xj110fh71-{psq}p11:Fᆪz9FY90A87.*7êt7g57 7zƦ7.MѦ7Ѧ7wѦ6!Ѧ66O#47}84<EY4A*e4E%ܵ4 3F3._2,2d1w1w;#H;<;!ʃ;v5;0 8//!ϱ:/,v/1WϪ/1UEP/1U#/1Uї01UgE01U 11e?@BCEJIIPPQSVWXZZ\_``aceejtszttsddho "#&*./0kp}u;=??BCEFIINPQSUWXZZ\__``ceejl~vu{|xpjj "#&*./0r}qj;=??BCEFJINPQSUWXZZ\^__`cedejlypllsz~"$&*+.lxwp8:==?BCDEJINNPQSUVWZZ[\_`accdejrsuvwrmfgotvvxx"$&*+{q|k38:==?BCCEJINNPQSUVVZZ[\_`aacdejrrsvwwy{{|}~ $&**i{v{37:;=?BCCDFIMNPQRUVVXZ[\^`aaccdqqrsuvwyz{{|~ #&**t|i2379;=>@BCDFIMMNQRSUVXXZ\^_`aacnqqrsuvwwzz{|}~ #%*p|sq2279;;>@BCDFJMMNPRSUVXXZ[^_`aacnoqqsuvvwyyz{|}~~#%iuwr03239:;>@BBCEJIMNPQSUUWXZ[\_``aanooqrsuvwwyyz|}}~t"xoo/03238:;=?BBCEJIMNPQRSUWXZ[\^_`aamooqrsuvvwwyz{|}}ty"j{xk.03238:;=?@BCEJIIMPQRSUWWX[\^_``mmooqrsuvvwwyz{|}}~xp"p|l*+/03279;=>?BDEEIIMNQRSSVVWZ[\^_`lmmnoqrsuuwwyz{|}}~mvxup*+/00279;;>?BCDEJIMNPRSSVVWX[\^^`jlmmnnorssuwwyz{|}}~}zlp}u)*+//0378:;=?@CDEJJINPQRSUVWXZ[\^jllmmnoqrssvwwy{||}~st{v&)*+//0338::;>@BCDFJIMNQRRSUVWZ[\ejllEmnoqrsvvwyz{||}m{|k%))*.//3389:;=?BCCEFJINPQQSSUVXZ[dejjlmnoqrruuvwyz{{}ysuu%&)*.//03789:=>@BCEEFIMNPQRSUVWXZadeejjlmnoqqsuuvyzz{|q{i%&)*.//02789:;>?BBDEFJINPPRRSUWXZacdeejjlnooqssuvwyzz{kx}yt&)*.//027889;>?@BDEFJIMNPQRSUVXZ_acddeejlmnoqssuvwyzz{lpv~q&&*+//027789;=?@BDDEJIMNPPRUUVV_`accejlmnoqqrsuvwyyzztppz|pj*+.//23789:=?@@DDEFIMNNPQSUUV_`accejjlnooqqrrsvwwyz}nn|r)+.//33778:=>?@CDEFJIMNNQSUU^`aaceejlmnooqqrsuvwwyvpmu~xr*+./323789;=??BCDEJIMMNPRSS\^_`aaddejlmnooqrsuvwyrtvuo++/022379:=>?BBCDFJIMMPQRS[\^_``cdejlmnnoqrsuvvwu"l{uy+./32238:;=>@BCDEFJIINQRRZ[^__`ccdejlmmnnoqrsuuw "lx~vp+/332379;==@@BCEFJJINPQQZ[\^__accdjllmmnnorssuv "#lxyq/032379:==?@BCDFJJIMPQQXZ[\^__aacdejlmmnoqrsuv"$ky~{od33279:;=?@BCDEFJIMNPWXZ[\^^``acdejjmmnoqrssu"$&puot3278:;=??@CDEFJIMNPVWWX[\\^``acdejjlmnoqrss"$&)tr~~wk2389:;>?@BCEFFIIMVVWXZ[\\_``adeejllmnoqrrs #%&)*oz~pk79:;>>?@CDEFJJIUUVWXZ[\__`acdeejlmnoqqrr"$&)*+pu}us89:==>@BCDEFJISUVWXZ[[^^_`acddjjlmnoqqr"$%&)*.grz|tn9;=>?@CDDFFSSUVWXZZ\^^_accdeejlmnoqq #%%)*../lt}{zol;=?@BCDEF}RSSUWXXZ\\^_`acceejlmnooq #$%&*..//slz~~xrgj@BCCEEQRRSUVWXZ\\^_`accdeejmnnoo #%&)*+.//3yqx|nl@BBDDPQQRSUVWWZ[\^_`aacddelmmno #$&)*++//32yjo~xsuBDDNQQRSUVWWZ[[\_``accdejlmmo "$%&)*+./0237ylrv}}{kqMNPQQRUVVWZZ[\^_``acdejlmmn"#%&)**+/032389:jotMMPPQRSUVVXXZ[\^_`aacdejlln "$%&**+./322789:=rgq{~qhhnPQRSUUWXZ[\^__`aacdejlm"#%%)**./032778:;=>?}|plnuSSUWWXZ[\^^``acdejjl #$%)**+//33789:=>>t{|vttyWWX[\\^__`acdejl #$$))*+//033789:;=>Jyqttz~|vmjjkntsacdeel #$%&**+./332378:;;EFFJIyollt|}{xtqq #$$&**+./3323789:;DEFJIIMPQrigisuxxz|} "#$&**+/0332389::DEEJJIMNPQQSUUVXZyvsqpprt "#%)**+//0033789:CDEFFJIMNPQSSUVWXZZ\__`ayv  #$&)**.//0323899@CDDEFJIMNPPRRSUVWXXZ[^^_acc "$&))*+//033788@BCCEEFJIMNNQRRSVWWXX[\^^`aa #%&)*+//03237?@BCDEEFIMMNQQRSUVWWXZ\\^_aa #%&)*+.//3237?@BCDDEFJIMNQQRSUVWWZ[\\^_a`  "#$%&)*../0323=>?@BBCDFJIINNPQRSUUVWZZ[\__  "$%&)*..//323;>?@@BCDEJIIMNPQRSUUWXZZ[\__  "#$&))++./032;=>?@@BDEFJIMMNPQRSSUVXZXZ\^^137=CJKNRW[^bcgnorvzk~~otzh137=CJKNRW[^bcgnip}sy{~pt|sk137=CJKNRW[^bcgko}tjz{~vs}~tg137=CJKNRW[^bcgqytjvz{{js|xpk137=CJKNRW[^bcds|urvw{{nw~xk379;BGKRSZ[^_cronrswz{ll|ss½379;BGKRSZ[^_o{ppnrswz{dop|}xno379;BGKOSW[[lvxtknoswzzps|wps379;BGKOSWZ[u|kjjnosvwz~skuy~~{|379;BGKORWZn}tqgjkorvwz~yqu|opҽ379;BGKNRVrxwkfgjknrvww~~tszttsddho379;BGKNRkp}ubcggknrsww{~~vu{|xpjj379;BGKNRr}qjbcggknrsvw{~ypllsz~359=BGJKlxwp[_ccgknorvw{{~rmfgotvvxx359=BFJ{q|kW[_ccgknnrvw{{~357=BFGi{v{WZ_bcgknnoswz{~357;BFGt|iVWZ^bcfjknoswzz{137;?Fp|sqVVZ^bbfjknosvzz{~135;?iuwrRSVW^_bfjkknrvwz{~t359xooNRSVW[_bcgkknrvwz{~ty59j{xkKRSVW[_bcgjknrvwwz~xp59p|lFJNRSVZ^bcfgkorrwwz{~m5vxupFJNRRVZ^bbfgknorvwz{~}zlp}uCFJNORSZ[_bcgjnorvvw{~Ͻst{vBCFJNORSW[__bfjknosvwz{7m{|k?CCGKOOSW[^_bcgknnrsvw{~ysuu?BCGKNORWZ[^_cfjknrrswz{~1q{i?BCGKNORVZ[^_bfgkkorsvw{~~kx}ytBCFKNORVZ[[^bfgjkorsvwz{~lpv~qBBFJNNRVZZ[^bcgjkoorvwz{~~ztppz|pjFJKNOVWZ[^_cgjjoorswz{{~}n15n|rCJKNOSWZZ[_cfgjnorsvwz{{vp13mu~xrGJKNSVWZ[^bcggknorvwzz{~ìr1135tvuoJJNRVVWZ^_cfgkknosvwzz~u1159l{uyJKOSVVW[_bcfjknorsvww{1//1379lx~vpJOSSVWZ^bccjjknrsvvw{~1//1379;lxyqNRSVWZ^_ccgjknosvvwz~11/11359=ky~{odSSVZ^_bcgjknorsvwz{~11/11359=BpuotSVZ[_bcggjnorsvwz{~1/11359=BCtr~~wkVW[^_bfgjknrsswwz11/11357;?BCGoz~pkZ^_bffgjnorsvvw11/113559=BCFJpu}us[^_ccfjknorsvw11/113559=?BCGKgrz|tn^bcfgjnooss11/113537;??CGKKNlt}{zolbcgjknors}11/113537;=?BGKKNOslz~~xrgjjknnrr1157;?BCFJKNOSyqx|nljkkoo~11357;=BCFJJNOSVyjo~xsukoo{11379=?BCGJKORVWZylrv}}{kqz{~11359;?BCGGJNRSVW[^_jotzz~~11/1379=?BFGJKOSVVZ[^_crgq{~qhhn~11/1359;??CFGKNRSVZZ[_bcfg}|plnu11-/157;=?CFGJNOSSWZ[^_cfft{|vtty11-/137;==CCFJNORSWZ[^_bcfvyqttz~|vmjjknts11/1357;=?BFGJKOSSVWZ[_bbrssvwyollt|}{xtqq1/157;==BFGJKOSSVWZ[^_borsvwwz~rigisuxxz|}1/1379;=BFGGJNRSSVW[^__orrvvwz{~yvsqpprt11/113579;?CFGJNORRSWZ[^_norssvwz{~yv1 13577;=BCFGKOORSVW[^^jnoorsvwz{~~11/113579=BCCFJNOORSWZ[[jknnrrsvwz{{11/13357;?BCFJNNORSVWZgjknorrswzz{11/1357;?BCFJKNNOSVWZgjknoorsvwz{1 179;=?BCFKKNRSVWcfgjkknosvww{{~1 179=?BCFKKNOSVWbfgjjknorvwwz{~1 1579;=BCCJJKORSVbcfgjjkorsvwzz{~!K#O.n jd] & >ͺ 8 :] *pݤ1YvJٔh% 3&#aËEF h?ڳs3bߐ J#nR1e! 5_Et&Ͼ%7Pض *EO(Cn_0g|0ЮPq%pdC>F*M_5>1<:P3qO .!"5&$_k pO%OJ n:&ڈ3 #(F҃()ey,܁5qF-5zͲ>/w_O3z58.#4ۗd1žb -(}Yܪm]]PC( #?mEz}ưOg#(0b?3e|:9O]9.9::i{!!"##%&((+--0257::ACCGIKMPRRWW[]bekou~}sks i| !""#%&'((--0257::AACEHKMPPRUWYjit|~|xpjn{ i| !"#%&'((+--0577:AACEHJMMPRUWos~}qpyzl i| !""#&''(++-0257:>AAEHJMMifrx||ukjptx}k m|| !""#%&'(++-02577>AAEHJkkt~vptcgjnrw} m|{y !""#%&&'((+-0255:>AGIJMPRTW[^aeimqw} jpplttuy}znjmq027:<EHIJMPRTY\^afjnrz||{| {sllnt!""#%%&(++-257:<>EHHJMPRTW\^aeimrx}xxy{{yyxxvtotqjt !!"##%&'(++0057<>ACCHJMPRUW\^bfintx} {xwwxypp !!"##%&'(++0027<>ACCGJMMPTW[]aeimrw} pp !!"##%'((+-025:>AACGIKMPRUY]`cfkptz r~t~  "#%&'((+-057<>AAEIJMMRTW[^aeimqt s}x{ !!"#%&''++027:<>AEHJJMPRWY]`bfjnr u|zq !!"%&&'(+-05:<<>CGIIKMPUW[]`cgkr w{{m !"#%&&((+057:<>CGHIJMPTWY\^afip {zi !"#%&&'(+027:<>AEHHIKMTUY[]aeij zi !"#%%&&'(-022::>CGHJJPRWY\`bfi zi "##%%&'(+0227:AEHHJMPRTW[]a wr !""#%&(+--227<>CGGJMPRRUY\^ wy !!""#&'(+-005:CCGIKMMPRU  g| !""#%&&'(-0025:>>CGHJMPRU g}!!"#%%&&(+002:>>AEHIKPRR   g}!!""#%%&'+--27<<>CGHJMPP g} !"##%%&(++05::>AEHKM   mz~t !"##&''+0527:<AAC mt ""#%&'((--027:<j!7t Wt>qᶡ*t] :Ozɣ0HÌ_A &*zm8*k}ٯe#Cـ]F " (ERd込;nn}|ո}j0ܞH((³zb&$#,17<11(#j;g;g;OE:3k:;;#xxpwxs}{xpodo~|o{x~|üt|z}xxvoŽdq~~x}xgy~vǽpztoy}xq}}kŽf}ldpx}su{ýevmcdo~qd}kztjtxkpp}so~|tr}fdp|qu{oh|}k{s}lxgzssrwl}{tl~tpowv~lxtf}p|mlytcür{oxtcünx~qolxvlüxk|~tlzvyüw}vy lxtlǿ}w}h{x g{scý}txyp~yqyk|tc}ntx{kvodjr~tfſ}mrw{quettzjntx}isww~rný}xfkprx}lx~uip|yfǿ{xcikptx}q~zko}xg}zwbfjmqux}nxxnu~|tlŽ{xw`cfimqux}l}xyk{|kſ}xuu\`beimptw}dqtofu|tl{wttY]`beimptx}n{~piky{qȀ}zwttW[]`bgjmptx{tvdts}xns}zwunUW[]`egimqux}jzxom{{sd{zwtrnRUWY]aceimqtw{ynzxgvsiůzxutqpmPRUWY^abeimprw{}ft~tt{{pmӨ}xutrpnkPRTUW\^`cfjmptwx{t|td˟}zwtrqpmjMPRRUY\]`cfikprrsqy|ksĚ{{wtqqpnkiKMMPRUWY\`bcfjclyx}|kŖzxwtpnnmkjgIJKMPRUWY]`ayprxoqtwǑ}{wttqmkkjiggEGIKMPRTW[inz|{tgyqq{~p{}Έ}{xwutqpnmjigfeCGIKMPPRtmuzptgjkmpq{nz}ʅ}{zxutrqnmkjgfeccAEHIKietx~~sls`befgij~xtwxz{{}{zxwutqpnnkjigecbb>AEyip}voyWY\\]abcegm~xxrtuwwxxz{zxwuttrqnmkkiigfcbaa<>ps|xklRRTWYW[]`abelx~pnqrrtuwutrqqpnmkjjggfecbaa^p|~zvmjKMPPRTUUW[]]`beq|mmnnpqrqpmkjiigeecbaa`]yomCCGIJKMMPRRUWY[\^aa|rgijjkkmkmkjiigffeebbaa`^^\xnk<>ACCGHIJJMPPRUWWY]^]nyoffijgiijiiggffeeccbb``^^]]\\[0257:<>CEGHIJKKPPRRTUWW\lx~p`aacceeffgeccbaa``^^]\[YYWY-0257::AACEGHIIPPRTUUYYqvp]^``aabbcca`^^]]^]]\[YWWY(+-0255<<>ACEGGMMPRUkym[[\\] ^]\[\[YWW'(+-022::<>ACEEJJKMMPPRTpzWWY[ \[Y[YYWWUW'(+-02277:<>ACCGHHIKMMPRlxsUUWWYWUTU&'(+-00557:<>AACCEGHIJKMMPPn}vpTTUWUTl#%&'(+-00257:<<>ACEGHHIJKKMpx~lRRTUTUTRjv"#%&'((++-0257:<>ACEGHHIJKp{jPPRkx##%&''-02557<<>ACCEGGHIIg|qMMPR Pfvw"#%%&''((+--02277:<<>AACCEGHkmxoKKMMPyg{wf!"#%%&&'(++--2257::<<>>ACEElx}pIIJJKKMspztkM!!"##%%&'(++02257::<>AACEr~xnHIIJJKMir}ukMM !""##%%&'((++002577::<>ACCE{lHHIIJ Kcs~{qsKK !!""#%%&''((-0025577:<>AAovGGHHIJIt~hKK !!"!""#%&&'(++-02252557::<AACEHtnppII !!""#%&&'(++-00257p{{k<<>ACEhx~}ncGGHHIH !!"#%%&%%&'((++-002557uqo<<>ACCnm|vpGGH !!"##%#%%&'((+--025m|f::<<>ACt}tkEEGxxpwxspodo~|o~|t|zxvodq~~xgy~vpztoyq}}kf}ldpxsu{evmcdo~qdkztjtxkppso~|tr}fdp|qu{oh|}k{s}lxgzssrwl}{tl~tpowv~lxtfp|mlytcr{oxtcnx~qolxvlk|~tlzvyvy lxtlh{x g{scyp~yq yk|tcʿkvodjr~tfʾquettɼisww~rnȺlx~uip|yfȸq~zko}xgǷnxxnu~|tlǵl}xyk{|kòdqtofu|tl±n{~piky{q°tvdts}xnsÿjzxom{{sd¿ynzxgvsift~tt{{pmt|tdsqy|ksclyx}|kyprxoqtw塣inz|{tgyq{~ptmuzptq{nietx~~slsj~xyip}voym~xx㜝ps|xkllx~pp|~zvmjq|mڸyom|rxnknyo۱lx~p󹸸㞟qvp񥩪kym ްpz 霝lxs񭮕󠡢n}vplpx~ljv󡢣p{j kx󠡡g|q fvwkmxo yg{wflx}p spztkr~xnir}uk{l cs~{qsovt~hh{|fn|xkyprtnppp{{khx~}ncuqonm|vpm|ft}tk xxpwxspodo~|o~|t|zxvodq~~xgy~vpztoyq}}kf}ldpxsu{evmcdo~qdkztjtxkppso~|tr}fdp|qu{oh|}k{s}lxgzssrwl}{tl~tpowv~lxtfp|mlytcr{oxtcnx~qolxvlk|~tlzvyvy lxtlh{x g{scyp~yq yk|tckvodjr~tfquettisw w~rnlx~uip|yfq~zko}xgnxxnu~|tll}xyk{|kdqtofu|tln{~piky{qtvdts}xnsjzxom{{sdynzxgvsift~tt{{pmt|td sqy|ks clyx}|k yprxoqtw inz|{tgyq{~ptmuzptq{nietx~~slsj~xyip}voym~xxps|xkllx~p p|~zvmjq|myom|r xnknyolx~pqvp kym pz lxsn}vplpx~ljvp{j  kxg|qfvwkmxo yg{wflx}p spztkr~xn ir}uk{l cs~{qsovt~hh{|fn|xkypr tnppp{{khx~}ncuqonm|vpm|ft}tk 00 A1(# /*C ..*s>-e+#}.*0T)( 'KHCj&< !gA$1 8"7.W!10,1&m]53&,v< |8WUM% }!7n($3>% >'K8 bh)C+Ma_.1K.s܊0y0EU3夾Ձ5ݶ5O4d*3]ы,0Jڗ%Ke.!|ԗ(*:.d(Tǁs&y# (n$ּO ##ϖ5|#d.y:.|;#:m;};!q;t*h( g.t(.wb!Uz |3M"8.w?#5%OH 5' ge)J ( xwutrrqpqpnpvumkkjl}lcxwutrrqpqppnpvumkkjjryexwutrrqpnpvumkkjjm|pbxwutrrqpnpnpvumkkjjbv|gxwutrrqppnpnmptumkkjjih}ln{zwtrqqp ntvkkjjkjrzj{zwtrqqp nmswkkjjgfl|g<{zwtrqqppnmswkjjijcywteizwtrqqppnmswkjjiikieszh qiwtrqqppnn msutjjiifmfdkU~uwtrqqnnmkp|tjiigkikxxcx}w~rqqnnmkcjiiggmbkck~f"m||rqqnnmkcjiiggpUmipzn`{k|xepnnmmkkjjpuziigfeessw^{wj|vjnmmk jg|pwiiggfeesxg{wtj}uvmmkjjijjhkiiggfeccs|mazwtt~vmmkkjjiijjs{niggfeccb{n`zutrlw{ikkjjiiwtwggfeccbrxfzurqqgy~lkjiigiip{pggfecbbahhRxurqpnl{xxjiiggiin|xggffcbbahh^xurqpmtr}pciiggiiky{ggfecbbak|rPwrqpnmkkrpggfopfeecba`tu|TIurppnmjkkuzxggfw{leecba`yp|WRuqpnnkjjq{ueffk|pfeecba`]o{TUtqnnmkijigktifeeq|neecba`^]o|hTrpmmkjiigfmq~yeccl{wwceccba`^]o~mRrnmkkiggfelxykccnqqccba`^\orMCqnkkjifgfeccg}stbh|ylbbccba`^]\orMRqnkkjgfgfeccbtmbtmbbcba`^]\o|pRWmkjiggcbet{rzxpbba`a``^]]\oxt`Jmkiggffccbq|taa`a``^]\\ow{`Mkjigffbaw{aa`^]]\[otP[RHjigfeebacy|o``^]\[[oskkT[igfecca`yqx|s``^]^]]\[YYognmUTgfecbb`^h||uu{i^^]\[[YWogaJWJgecbaa`^t{~g^h|wk^^]]\]\\[YWrtgUPWJfecaa`^qtn]qpp]]\[YWm{gJlhPcba`^]^^]nl~uf\\itxi\]]\[YWh|kRpiI(cba`^^]]p|s\\o|p\]]\\[YWWhxqRpmI5ba``^]]csoi\[[xzg\\[YWnpwPmRHC`^]\jsp[[h}q\[[YWxnUPPHJ^]\r{t[YYns|y[[YYWU{pTPPMIM]\\[f|~iYYq{ryYYWWUswvRPRnJK\[[gy~kYYWWtykWWUpvRRPRtMG[hysyYW Wm~ppWWUysuRRPTtPCYWkwtnW WqtdWWUUToxsRMMPtU<YWWkvwjU Un{oWUUTRk~fRMKPvgEWkwxcUUqsxkUUTTiovmPPJRxlJWouxfUTTUn|nTTRf}kPPIRumKnvxeTTwykRRn{pPPIPtmGuxfRRTj}pRRvtPPMPKKtm>yfRRmtwRRPqypMMGqm7xcRRPRRp{kRRPsp{PMMJMAsm5fPPpyqPPi{pMKKMEIrscPunPMi{kMKKEItvf MPpjMMzpMKKJJIEHurc MPMPMkytMmzmKKJJIGGxeKMlpusKJJIIEHCxm0 KMn|z~kJJIIHHAIAzm'JKMKMKntqpJIIHH~m%IJKMKMKt}nJJIIHHG:I<~m%HI JKJl~}oIHHGECC>kvwj n{ok~fvgPkwxcqsxkiovmxleouxfn|nf}kumznvxewykn{ptm~uxfj}pvttm|yfmtwqypqmyxcp{ksp{smvfpyqi{prscl uuni{ktvfn pjzpurcnkytmzmxelpusxm[ n|z~kzmSntqp~mNt}n~mN l~}oy~m; ct~lt}k/ rptvju|jvul}lkvujrye vum|pSvuv|g tuh}l tvjrz swl|g1swywtviswszhqi sutdk7~u p|tkxxcx}w~ kck~fm|| kcpznk|xe puzisswj|vj g|pwsxgj}uvhks|m#tt~vs{n{nklw{iwtwrxfgy~lp{phhl{xxn|xhhCtr}pcky{k|rىrpoptu|kuzxw{lyp|q{uek|po{9ktiq|no|hۄmq~yl{wwo~mlxyknqqorg}sth|ylorBtmtmo|pvet{rzxpoxt՞q|tow{w{otcy|o oskkyqx|sognm9h||uu{iogot{~gh|wkrtgՔqtnqppm{glh٤nl~ufitxih|kpip|so|phxqpmcsoixzgnpwmjsph}q xnr{tns|y{pf|~iq{ryswvn?gy~k tykpvtshysy m~ppysutҖkwtn qtdoxstfkvwj n{ok~fvg~kwxcqsxkiovmxl՟ouxfn|nf}kumֹnvxewykn{ptmҾuxfj}pvttmӼyfmtwqypqmԷxcp{ksp{smԴfpyqi{prsc uuni{ktvf pjzpurckytmzmxe lpusxmՏn|z~kzmքntqp~m{t}n~m{ l~}oy~mb ct~lt}kO rptvju|j5UP5U%4UJߜ4UA3b333p82 Ǵ HqMa vpdEPp>ђ\# _#ބw3d k ކ F ُ(P ɶ ,< Pٛ J?F3  H?( :۪taj &7 H!,ޙ v_MsF 57U!8 "kkے"!ؒ.#ZR$$ q>3!ߖA!>*WA"7 A"k5AOs F5|%AR݈ HH8 ]7 p# s(KE֧ (5] ?  ., ,R# Kؖd?#  (Jq!&EFF]Ǵ,?dy,,.ՙ,؀,\8,A]ٜ,͙>-|>.a7˃./h.Wb-Jv-dꏪ}]0en{tthkr{p2eqtpxht{ve1etpl|hk|us0exij|h{p|ss/exihhsw|p0mkh|ljv0mth|lgx0mzh|mf0m~hzp7m~hzo7j{thzn7ewth{m8uth|l8utjzl8n|mmzl8clm{h8ctswh8crjqh9jqnh9gyxtn:r~|t:f|x;x|;k|;ev|s;l|q;cx{l;wqd:wt:l{xk9ftts8c{zmxj9kdnxm8ktsvr7gxukvs8txugx8k|pq9}st;lzl;h|n;crx<izq<yur;h~l;fvx<l=s=g0en{tthkr{p0eqtpxht{ve/etpl|hk|us/exij|h{p|ss/exihhsw|p0mkh|ljv0mth|lgx0mzh|mf0m~hzp1m~hzo1j{thzn1ewth{m2uth|l2ut#jzl2n|mmzl2clm{h2ctswh2crjqh3jqnh3gyxtn4r~|t4f|x4x|4k|4ev|s 5l|q 5cx{l 6wqd6wt6l{xk6ftts6c{zmxj7kdnxm7ktsvr7gxukvs8txugx8k|p q9}st9lzl9h|n 9crx#:izq;yur;h~l;fvx<l=s=g0en{1-tthkr{p110eqt3/pxh1t{ve11/etp3/l|h11k|us1/exi51j|h11{p|ss/exi51hh11sw|p0mk5+h|l11jv0mt5-h|l11gx0mz3-h|m11f0m~3-hzp111m~3/hzo111j{t/hzn111ewt/h{m112ut1h|l112ut;jzl112n|mmzl112clm{h112ctswh112crjqh113jqnh113gyxtn114r~|t114f|x351--114x|133//14k|1133/14ev|s/175-15l|q-177-15cx{l/57/16wqd35116wt15116l{xk5-16ftts/16c{zmxj317kdnxm17kt/svr7gxu1kvs8txu3gx8k|p7+q9}st)19lzl/19h|n719crx;1:izq1;yur;h~l;fvx<l=s=g0!}HT2!%H(!1!10HZ߳ 0!W8H}܊/!U?Fh0a?70?750?50?,7?.7]#?07!ʃ?08?78ø878T188w.H8%H8&F9dTH9>ͩ]:߈:0;;p;#(;z;H;:M:!9虤8ET9qHC8qM!77ϰ8!38qn*9 ;w(;Fs;<Wk<Ӻ;Kb;<}==?9999h{iz}i}nx|ky|ygy|tn|extk| gw~vd|"ku|zrj#sp}}p#yky~wmv &tqpk 'dpz~xrf *t|uny*sly|sm,jnx|tij.tpy}qpy/yhtz~{xrhn2ypx~{ns3yoly6jrtmks6~|tpty4x{~{xvqglp/uqr{ztlmr,{mjt|}zttswy&gdqttx|{vpkijnqt {upllv|~{xwqqpkgfnvwxx{|}~xvtrpp:myojpynsr{pj r|p ks{m!nq|od!nr{pt"spxxk~$gv|ky~tku{tg vqyn{xls |miz{p tzjko|xmy gxp pv~qkpxqyir|ysgn{tn lt~{otl|j ymy~vrsevyt shsx}ypmhzqonzypl o{onlpx|ys cu{qs| i|rxkxxtpm~rk~}tkpso}r򆋋nwzsptydp{ss킌lgswy}|ywmhnugw{pyppx}}zqnpuh~yryoklx{}~}xwuurddkpx i{yps wtstx}zxpkk "$%&)**+//0:;=>??@BCDFJJIMNPQRRSSVWXX[\^ "#$%&**.//9:;=>>?@BDEFFIIMNPQRRSUWWXZ\\ "$%%))*+./89:;=>>?BCDEFJJIMNPQRRSVWVWZ[\ "#$%&)**+.789:;=>?@BDEEJJIMNPQQSUVVWX[["#$$&&)*+.389:;=>?@BCDEFJJINPPQQSUVVXZ[h "#&&)*+23789;;=>?@BBEFJIMNNPPQQRUVVWZ{i "#%&)**23789;;=>?@BBEEFJIMNNPPQRSUVVXz}i""%%&)*}032788:;;=?@@BDEEFIMMNNPQRSUVVXnx|ky  $$%&*|/02378::;=>?@@CDDEJIIMNNPQRSUUWygy|tn  ##$%)|/0323799:;=>??BCCDFJJIMNNPQRSUVextk ""#$&|//0233899:=>>?@BBCEFFJMMNPQRSSUgw~vd "$%|./0323889:;=>>@@BCDEFFIIMNPQRSSku|zrj "#%./0322889:;=>>?@@BCDEFIIMNPQRRSsp}}p "$*.//033789:;;??@BCDEFJJIMNPQQSyky~wmv "#*+//0023789:;;??@BCDEEFJIMNPQQRtqpk  "*+.//0223789::>>?@BCDDFFJIMNPPQdpz~xrf &)*+.//33237899==>?@BCDEEFJIMNNQ t|uny%&**+./00323788;;=>?@BBDDEFJIMMN sly|sm$%)**+.//032377::;=>?@BCCDEFJIIN jnx|tij$%&)**+//032379::;>??@BBCDEFJIMtpy}qpy#$%)**+//0323399:;=>??BBCDEFJJIyhtz~{xrhn"#%&)**+.//0233789:;==>@@BCDEFFIypx~{ns"#$&)**++./03237789:;==?@BCDEFFJyoly "$%&)**+.//0323778:;;=??@BCDEEFjrtmks$%&)**+.//0323379::;>>?@BCDDF~|tpty&)**+.//03223899:==>?@BCCDۅx{~{xvqglp+.//03327889;;=>?@BBDuqr{ztlmr/00323788::;=>?@BC󅋍{mjt|}zttswy2378::;=>?@@B "gdqttx|{vpkijnqt>?? #$%&{upllv|~{xwqq "#$%&**.pkgfnvwxx{|}~ "#$%)**+../033233xvtrppۆ "#$&))*++./003223789::; "#%&&**+//03323789::m #$%%**+.//033278899yoj "$%%)**+.//003237889pyn "#%%&)**++//0323378sr{pj "#$%&)**++//032338r|p ""$$%&)**.//32237ks{m  ##$%&)**+../03323nq|od  ""#$%&))*++./0032nr{pt  "#$%&&**+//03spxxk~ "#$%&**+.//0gv|ky~ "#$%%)**+.//0t#ku{tg   "#$%%&)**++/vqyn{xls   "#$$%&)**++/|miz{p ""$$%&)**.tzjko|xmy   ##$%&)**+gxppv~qk ""#$%&))*pxqyir|ysgn  "#$%&&*{tnlt~{ot  "#$%&*l|j ymy~vrs  "#$%%)evytshsx}ypm "#$%hzq onzypl"#$$o{onlpx|ys "##cu{q s| ""i|r xkxxtp m~rk~}tkpso}r 򆋋nwzspty dp{ss킌lgswy}|ywmhnugw{pyppx}}zqnpu h~yryoklx{}~}xwuurddkpx i{yps wtstx}zxpkk1579=?BCGGJNOR_bcfggjknosvvwz{~1 1359;=?BFFGKNO^_bcffgjkorsswwz{~113579=??CCFJKN[^_bcffgknorsvvwz{~11379;=?BCFGJKZ[^_bcfgjkorrvvwz{~11359;==BBCFJKW[^_bcfgjknorsvvw{~~h113579;BBCFJVWZ[^bbcfgjkkrsvwz{{~~{i113579;?BCFGVWZ[^bbcfgjkkrrsvwz{{~~z}i113599??BCG}RSVZ[[_bbcgjjkorrswzz{{~nx|ky1 13577==?BF|ORVWZ[__bcfgjjnoorvwwz{{~ygy|tn1 1357;;=?C|NRSVWZ^^_bcfggknnosvvwz{{~11extk1 13599;=B|NORVWW[^^_cffgjkknrssvzz{~11gw~vd11311379=?|KORSVW[[^_bcffjjknorsswwz{~11ku|zrj11311/1133579;?KNRSVV[[^_bcffgjjknorswwz{~11sp}}p1 1359=GKNORSWWZ[^_bbggjknorsvvwz{~11yky~wmv1 1359;GJNORRVWZ[^_bbggjknorrsvwz{~11tqpk1 1579FJKNORVVWZ[^__ffgjknoossvwz{~~11dpz~xrf11357BCGJKNOSSVWZ[^^ccfgjknorrsvwz{{1 1t|uny1131135?BFGJKNRRSVWZ[[bbcfgjkkoorsvwzz{1 1sly|sm113113=?CFGJKOORSVWZZ__bcfgjknnorsvww{1 1jnx|tij131//1=?BCFGJNNORSVWZ^__bfggjkknorsvwz11tpy}qpy1/-/;=?CFGJNNORSVWW^^_bcfggkknorsvvw11yhtz~{xrhn19;?BCFGJKNORVWWZ[^_bccfjjknorssw11ypx~{ns9;=BCFFJJKORSVWZZ[^_bccgjknorssv11yoly79=?BCFGJKNORSVWZZ[_bbcggjknorrs11jrtmks=?BCFGJKNORSVWWZ^__bffgjknoos11~|tptyBCFGJKNORSVVW[^^_ccfgjknno11ۅx{~{xvqglpJKNORSSVZ[[^bbcfgjkko111uqr{ztlmrNRRSVWZ[[__bcfgjkn11󅋍/13{mjt|}zttswyVWZ[__bcfgjjk11113579gdqttx|{vpkijnqtfgg11113577;=?B{upllv|~{xwqq1113579;=?BFGGKpkgfnvwxx{|}~111135579;=?CFFJKKNRSSVWWxvtrpp1ۆ11//133579;=BCCGJJKORRSVVWZ[^__b111//13579;?BBFGGJNOORSSVWZ[^__m111//13357;=??FFGJKNOORSSVZ[[^^yoj111//13579=??CFFGJKNORRSVWZ[[^pyn11113579;??BCFGJJNORSVWWZ[sr{pj11113579;=?BCFGJJNNORSVWW[11r|p111 13599==?BCFGGKNNOSVVWZ11ks{m111 13577;;=?BCFFJKKNRSSVW11nq|od111 135799;=?BCCGJJKORRSV11nr{pt111 135779;=?BBFGGJNOORS11spxxk11~113113579;=?BFFGJKNOOR11gv|ky11~11311/11335579;=??CFFGJKNORt;3-1531ku{tg1 11 1579;=??BCFGJJNvq3-/11yn{xls1 11 13579;==?BCFGJJN|m3/-//11iz{p1 1113599==?BCFGGKtzj3//11ko|xmy1 11 1/1357;;=?BCFFJgxp531311pv~qk111 1/13399;=?BCCGpxq511yir|ysgn111 1/13779;=?BBF{tn1/11lt~{ot111 1/1335579;=?BFl|j/+1 1ymy~vrs111 13113579;=??Cevyt//3551//11shsx}ypm11113579;=?hzq5//1 1onzypl111359;==o{on-+-/3311lpx|ys113133579;;cu{q1--1331 1s|1135799i|r531331/1 1xkxxtp113557m~rk53//11~}tkps11/135o}r7/+-311򆋋nwzspty1 1/133dp{ss'-511킌lgswy}|ywmhnu11/1gw{p35/1111yppx}}zqnpu1 1h~yry1111oklx{}~}xwuurddkpx11 i{yps111 1wtstx}zxpkk09MW9bK9b?9e1KRRF_.܈ %#j 3U!n h>"zk#WU y%(. & yb *U *_ݦ8,m߭7 .P/3\2}n3,e6FZ>6C۱A 4бY&/Щn>,C_ҽ<&J׭t_\ZC. !\ɿ!*,?5_z:ӋR͈zq |k Մk!ݖU!|ؔ% ":JF$*ZnP%ٝ eC eWՙ _ j3t q0a&уaCٯ 5׀OJC qwJ  bq0nHՌ%z͎& Z&g՗  e Uާ Odqa< kwү? a?(vճZ5&>R0Zϛp&F( m,C\ǿ<  UU tδmmdrqs t}zm  x|g |g   |g  {q ww  qy  g|  g|y  j}|w  py~r    xpr    or  ory     q}ws    s{|n   xj xj  vqv uxm p~efcspkfdkstzkztpjjv{}|xrsttppx}}uoqtlu ngirvx{~~{zumhlkuspllnz}|uqrum}xtuttv|{ojmuyuqnjp}xy||}~{uttsudh pprsrsrsrrqpprvx||wplmqx~}}~}~}~}~~}|{yx|{tpffhpxpqrvwxwxwxxwwutppqsuysxq {zvusttsuwx{ u~{m;}g;}g;xt;px;iy;j}zt:p{}r:xqp;pp;q}wq:s|}k:xyi;xo;vx;p};f~;j{t:ts:{nt;m~vn:q{|m:tuk;tqs:tym:vep dmpqqx lxu yliiuy{|~~y!nx sqnmp{}{tppq!jxnsohddqtuvw|~||wohmsquyyytq}}skpx{}ytstt^_`acddeejlmnoorrsuvvwyrqs|}}~ڌ^^_`acddeejlmnoqqrrsuvvwt}zm{||}}~\^_`accddejlmnnoqqrssuuvx|g{{||}~~󋌌[\^_`accdejlmnooqqrsuuvv|gz{{|}~􆇇[\^_`aaccdejlmmnooqrssuvv|gz{{|}~~򊋌Z[\^_``ccdejjlmmnnoqqrss{qwyyzz{|}}~~߉Z[\^_``aacdeejjlmmnoqqrsswwwyzz{||}~~ƈXZ[\^__`aacdeejllmnnoqqrrqyvwwyzz{|}}~~䇈WXZ[\^^_``acddejllmnoorg|vvwyyzz{|}}~VWXZ[\\^__`accdjjlmnnoqqg|yvvwwyz{{||}~ÆUVWXZ[[\^^_`aaceejllmnnoqj}|wuuvwwyz{{|{||}~ևSUVWXZ[\\^^_`aadeejlmmnoopy~ruuvvwyyz{{|}~SUVWXZZ[\\^_``deejllmmnoxprsuvvwwyz{{z{{|}~~SUVWXZZ[[\^_`aacdeejnnorrsuuvvwyzzyzz{|}}~~džSSUWXXZZ[[\_``a`aacdeejmmnoryrsuuvwyyzyyz{||}}~~RSUVWXXZ[\^_``accdeelmmq}wsrssuuvwwyyz{||}}~QRSUVWWXXZ[\^__`acddjlls{|nqrrssuvwwyz{{||}}~PQRSUVVWXZ[\^^__`accdejjlxjoqqrrsuuvvwwyz{{|}~NPQRSUUVVWXZ[\\^^_``accdeejxjnooqqrsuuvvwwyz{{|}~~DŽMNPQRSSUUVWXZ[[\^^_`aacddeevqvnnoqqrssuvvwyyzz{{||}~MNPQRSSUVWXZ[[\^^_``aacddeuxmnnoqrrsuuvwwyzz{|}~~IMNPQRRSSUVWXZZ[\\^_``cdp~emmnnoqrrsuvwwz{|}}~~؂IIMPQQRRSSUWXXZ[[\^^_``aacdfclmmnoqqrrsuuvwwyyz{||}}~~spkJIMNPQQRSUVWXXZZ[\^^__`aacfdllmmnooqqrsuuvvwyyz{||}}~kstzFJIMNPPQQRSUVWWXZZ[\\^^_``akztjjllmnooqrssuuvwwyz{{pjjv{}|xEFJIMNNPQRSUVVWWXZ[[\\^__`rsteejjlmmnnoqrrssuvvwtppx}}uoqtDEFJIMMNNPQRSUUVWWXZZ[[\^^_`luddeejlmmnoqnngirvx{~~{zumhl|}~CDEFJIIMMNPQRSSUVVWXZZ[\\^^_kuccdeejllspllnz}|uqruyzz{{||~CDEFJIIMNPQRSSUUVWXXZZ[\\^_m}xtccdeuttv|{ojmuwwyyz{|}@CDDFJIIMNPQRRSSUVWWXyuqnjp}xy||}~{uttsudhrsuvvwvwwyz{{|pprsrsrsrrqpprvx||wplmqxmnooqqrsuuvvwyyz{{|~}}~}~}~}~~}|{yx|{tpffhpxeejlmmnnoqqrsuuvuuvwyyzz{ppqrvwxwxwxxwwutppqsuy\sxq``acddejllmmnooqrssusuuvwwyyz=?@{zvusttsuwx{QRSSUVWWXZ[u~{m__`aaccdejjllmnnoqrrsrrsuvvwwy;>?>?BCDDEFJIMMNPQRRSUVVWXZZ}g^^_`aacdeejjlmmnoqqrqrrsuuvvw;=>>@BCCDEFJIIMMNNPQRRUUVVWXZ}g\^^_``acdeejllmmnoqqoqqrsuuvw:==>@BBCDEFJIIMNPQQSUUVWXXxt[\^__``acddeejllmnooqrssuuv89:;=>?@@BCDEFFIIMNPPQRRSSUVWpxZ[\\^^_``acddejlmnnooqqrrssu89:;=>>?@BCDEFFJJIMNNPPQRRSUVViyZZ[\\^__`aacddejlmmnooqrs789:;==??@BCDEEFJJIMNNPQQRRSUUj}ztZZ[\\^^_`aaccddeejllmnnoqrs3789:;=>>?@BCDDEFFJIMMNPPQQRSUp{}rXXZ[[\^^_``aaccddejllmmnooqr23789::==>?@BCCDEEFJIIMNNPPQRRxqpWWXZZ[[\^__``aaccdeejllmnoq323789:;;=>?@BBCDDEFJJIMMNNPQRRppVVWXXZ[[\^^__``aacdeejjlmmno3327889::;=>?@BCCDDEFJJIIMNNPQQq}wqVVWWXZZ[\^^__`aacddeejjllmmn0323788::;=>?@@BCCDEFFIMNPPQs|}kUVWWXXZ[\\^^__`accdeejlmn/032337789:;==>??@BCDEFFJIMMNNxyiSUUWXZ[[\\^_``aaccdejjll//032337789:;==??@BCDEEFFJJIMMNPxoRSUUVVWXZZ[[\\^^_``aacdeejjl//32233778:;;=>>?@BCDDEEFJJIMMNvxRRSSUVVWXZZ[[\^^_``acdeejj../033223379::;==>?@BCDDEFFJIIMp}QQRRSUUVWXXZZ[\\^__`acddee++./0033223899:;;=>?@BBCCDEEFJJIf~PPQQRSSUVWWXXZ[[\^^_`accdd**+//0327889::;=>?@BBCDDEFFJj{tNPPQRRSUVVWWXZZ[\\^_`aacc**+.//03237889::;>??@@BBCDDEEFttsNNPQQRRSUVVWXZZ[[\\^^_`aa*+.//03237899:;=>??@@BBCDEEF{ntMNNPQQRSUUVWXZ[[\^_``a%&)**++//032337889:;;=>>?@BBCEEm~vnIMPPQQRSUUSSUVWWXZZ[\\^__%&)**++.//022337889::==>?@@BBDDq{|mIIMMNPQQRRSUVVWWXZZ[\^^__$%&)**+../033232237889;==>?@@BCDtukJIJIIMNPPQQRRSUVVWWXXZ[\\^^##$%))**+.//0033233788:;;=>??@BCCtqsJJIMNNPPQQRSUUVVWXZZ[[\ "#$%&&**+.//32337889::;=>>?@BBtymFFJJIMNNPQRSSUUVWXZZ[ "#$%%&))*+../03323778899:;==>?@@veEEFFJIMMNMNNPQRRSRSSUVWWXp "#$$%&&**++.//0332338899:;==??@dmDDEFJIIMMNNPQRRQRRSUpqqx "#$%%&)**++.//03327889:;;>??lxuCBBCDEEFFIMMNPQyliiuy{|~~y ""$$%&))**+.//0337889::;;=>nx@BCCDEFFJJsqnmp{}{tppq $$%%&))**+.//002337899:;;==jxnBsohddqtuvw|~||wohmsSSUquyy##$$%&&)**+.//32237889::ytq}}skpx{}ytsttPQRS𔖗rqs喗t}zm㑔x|gˏ랟|g⏑|g➟{qʎwwʌqyɉg|ȇg|yȆj}|wDŽpy~rDŽ枟xprƄor׆oryꙜq}ws񡤤s{|n~嗙xj{~xjz{~vqvz{~膇uxmwz{~p~ewwz~fcspkvwz{~၄fdԾkstzsvwz{~~kzt䮯pjjv{}|xrsvwz{{~rst𩬮tppx}}uoqtorsvwzz{{~luĩnngirvx{~~{zumhlnorsvwwzz{~kuspllnz}|uqrunorsvwwz{~m}xtuttv|{ojmujnoosvwwz{~yuqnjp}xy||}~{uttsudhprsrsrsrrqpprvx||wplmqx~}}~}~}~}~~}|{yx|{tpffhpxppqrvwxwxwxxwwutppqsuysxqᡤcgj{zvusttsuwx{u~{m۞bfgfgknoorsvwzz{~}g瞟bcffjknnorsvwwzz{{~}g蜞_ccfjkknorsvwwz{~xt鬮[^_bcfgjjknorsswwz{~~pxŤ[^_bcffgjknorssvvwz{{~~iyǯZ[^_bccggjknorrsvvwz{{~j}ztƮWZ[^_bcffgjknoorssvwzz{~~p{}rƬVWZ[^__ccfgjknnorrsvwwz{{~~xqpƩSVWZ[^_bbcfgjkknoorsvvwzz{{~ppϧSSVZ[[^__bcfgjknnoorsvvwwz{{~q}wqܗRSVWZ[[__bcfgjjknnorsswz{~~s|}k禧ORSVWWZZ[^_bccfggjknorssvwzz{{xyiÞNORSVWWZZ[^_bccggjknorrssvvwzz{~xoʜNNOSVVWWZZ[_bbcffgjknoorrsvvwzz{vx㜞KKNRSSVVWWZ^__bccfgjknoorssvwwzp}יJJKORRSSVVW[^^_bbcfgjkknnorrsvvwf~~㗙GGJNOORRSSVZ[[^__bcfgjkknoorssvj{t{~~̖FGJKNOORRSVWZ[[^__bfggjjkknoorrstts{{~􌎎FGJKNOORRSVWZ[^^_bcfggjjkknorrs{ntz{{~?BCFGJJNNORSVWWZ[[^_bbcffgjkknrrm~vnwz~~􆇉?BCFGJJKNNORVVWWZ[[^__ccfgjjkkooq{|mwwzz{~=?BCFGGJKKNRSSVSVVWZ[[^bccfgjjknotukvwvwwz{~~;;=?CCFGGJKNORRSSVWWZ[[_bbcfggjknntqsvvwz{{~~̉79;=?BBFFGJKNOOSSVWWZ[[^__bcffgjkktymssvvwz{{~579;=??BCCFJKKNRSSVWZZ[[^^_bccfgjjverrssvwzz{z{{~p3579;==?BBFGJJKOORSSVWW[[^^_bccggjdmoorsvwwzz{{~pqqx13579;=??BCFGJJKNNORSSVZ[[^_bbfgglxunkknorrsswzz{~yliiuy{|~~y1355799==?BCCFFGJKNORSSWWZ[[^__bbcfnxjknnorssvvsqnmp{}{tppq1135577==??BCCFGGJKNORRVWWZ[^^_bbccjxnksohddqtuvw|~||wohmsquyy355;;==?BBCFFGJKNOOSVVWZ[[^__ytq}}skpx{}ytstt~:m,:,A;C;E;p;;k;E;E:?1:(}:;;:t&:JO;g;g;::A : Ah .p%EU8㴈Uw %0֨R8tTzzݸz!"d*8t_M .FWt 𒜃|zwtsתvM ԌF,,%𡤵¼|e< ##!%% C&;3;3;;;T;M:8p:;;%:MM: W;p;;P;0;%M::;|:Ke:y;:t:#. 5C  *5C!n Uհ%!a :gM7<&(|kκd !"##"##%&''(++-02jwt77::<>ipzyrdCCE !!"!""#%&&'((+-0m}vy577:tp}wg>>AAC !! !!"#%%&''(+-sv~k255ni{~|pl<<>A  !"#%%&&'((+-qti22fu~to::<>A>  !"##&'(+-t}~girx|rl77::<> !"#%&'(+s{x~vf2557:<> !"##%&'(i|lo02257:< !!""#%&sks|tn+--002257:< !"##%toy~|~vj(+--0257: !"ipx~~yilzk'((++--0257 !imuxny%%qw&'((+-025jt~|qo"##%j|~&&''((+-02jhzztks!""##vps&&''((+-0tov{pp  !"#o}wt&&''(+-0jhtz~~zsjs  !"kv~l%&&'(+- ykp}uou !"rri%%&&'(+- kcru|yjh  !p}g##%%&'(+ skp{to nts""##%&'( trt|{lntjx!!""#%&'  klv|~zvqjoy|p!!"#%&  non|xplqo !!"#%jfkuw}~|vhmt|xk  !"#%p}xsp zo  !"#~skl nw !"#uoek     h~|s !"    kt~p !    n~ss     pz{m   wk    txkmx    fdi{    kwrkt||p   kvykvwp    m|ytshqzug   s}ooyymy    snyn|rm    t}{ksiz~xpj     }qs|~tn     v~~|lj    hy}rt    ht{zy  nq}xtx~ptpx{nl pq  yhrz~|ql  p|tq  ylv|tr  x}k   sfnv~yjs  xi   qp{|tqrs    pqxvmng}   ujs|{tnmk{ soq}{pppupsgpx|~{ng{yntslt|}tr m~toru~}rkxq{vyyknx}|vrfkst{q ypqzynpt}mpinwy~~{vnk{tlolu}zqot!vtu ctt|xilt#wymxljx|utt(dgk{}|xlov*g|gpq|wxtjho.uhoiy|ug3msus|xky4jvpv}rl6jup󑒓jwtipzyrdm}vytp}wgsv~kni{~|pl qtifu~tot}~girx|rls{x~vfi|losks|tntoy~|~vjipx~~yilzkimuxnyqwjt~|qoj|~jhzztksvpstov{ppo}wtjhtz~~zsjskv~l򅆆ykp}uourrikcru|yjhp}gskp{tontstrt|{lntjxklv|~zvqjoy|pnon|xplqojfkuw}~|vhmt|xkp}xspzo~sklnwuoekh~|skt~pn~ss~pz{m}~~wk}~txkmx|}}~~fdi{||}~~kwrkt||p{{||}}~kvykvwpzz{||}~m|ytshqzugyyzz{{|}~s}ooyymywyz{||}}~~snyn|rmvwwyyzz{{||}}~~t}{ksiz~xpjuvwyzz{{||}~}qs|~tnuvwwyz{|}~v~~|ljsuvwyyz{{|}~hy}rtrsuvwwyyzz{|}~ht{zyqrsuvvwyyz{|}~nq}xtx~poqrsuuvvwwyz{|}~tpx{nlpqnoqqrssuvwyyzz{{|}~yhrz~|qlp|tqnoqrsuvwyz{|}~ylv|trx}klmmnnooqqrsuvvwwyyz{|}sfnv~yjsxilmnoqqrssuvwyz{|qp{|tqrsjjllmmnooqrsuuvwwyz{{pqxvmn~~g}eejllmnnoqrssuuvvwyujs|{tnm}}~k{ddeejjlmmnoqrrsuuvsoq}{ppz{||}~pupcdeejllmnoqqrrssgpx|~{ng{yzz{{|}ynt~accddeejjlmmnooqrslt|}trvvwwyz{|}m~t~~~aaccddejjlmnoru~}rkxuvvwyz{|q{vy}}~_``aacceejlmyknx}|vrfkrrssussuuvvwwyyz{st{q}}_`acdeejypqzynpnoqqrsuvwyz{t}m{{|^__``aacdpinwy~~{vnk{mnnooqrrsuvwyztlyy{\^^__``olu}zqotejllmnoqrssuvwvtuwwy[\\ctt|xiltddejlmnoqrsuvwymwwxljx|utt``aacdeejejjllmmnoqqrqqrrsudgvvk{}|xlov^^__``acdedeejjllmnoqoqrsg|guupq|wxtjho\\^__`aacdeddejjlmmnoqooqruhrroiy|ugVVWWXXZ[[\^_``accdejlmnoqoqmsrus|xkyrVVWXZ[\^_`acdejlmnojvpv}rlqqUVWWXZ[\^_`a``acdejlmjupnnojwtipzyrd m}vytp}wg sv~kni{~|plqtifu~to t}~girx|rls{x~vfi|losks|tntoy~|~vjipx~~yilzkimuxnyqwjt~|qoj|~jhzztksvpstov{ppo}wtjhtz~~zsjskv~lykp}uourrikcru|yjhp}gskp{tontstrt|{lntjxklv|~zvqjoy|pnon|xplqojfkuw}~|vhmt|xkp}xspzo~sklnwuoekh~|sӿkt~pҿn~sspz{mwktxkmxfdi{kwrkt||pkvykvwp͹m|ytshqzug̷s}ooyymysnyn|rmt}{ksiz~xpj}qs|~tnv~~|ljhy}rtht{zynq}xtx~ptpx{nlpqyhrz~|qlp|tq ylv|trx}k sfnv~yjsxiqp{|tqrsápqxvmng}Ÿujs|{tnmk{soq}{pppupsgpx|~{ng{yntslt|}tr m~toru~}rkx q{vyyknx}|vrfkst{qypqzynpt}m甖pinwy~~{vnk{tl뼑olu}zqotvtuctt|xiltwymxljx|uttdgk{}|xlovg|gpq|wxtjhouhoiy|ugmsus|xkyjvpv}rljup kՄ,h&A.y\ބ00U27m46Uh4,!5#%3UE5Z1g} 0bފ7(-!Rԣ*Փ<t&(ه(n$_迊 nZ!#!K׳P#}|Kd1MZ8bpȎ58߱K(Z,ΰq!ek7#vH%<:;::H;j;Z H+ a+q܆,qCT-\1 (/v]]0 }<2#*

 !# hܘJEz:eqt!]H 7mŀR}ˎYp&AٽR#\ҧy!E &\:# P_߿>((Z߼|_ *(Ч1#.,3ܰ3k_\4]R16]eEGHIHHIHkztvigECCA>>E+tuc+CEGHGHst}lEl|gCAA><<>+tu'!ACEGEGk~sECrstA>><::7sxt+ >ACEGCEt~wjCCpx>><::72m~i(>ACECcq|pCCAAqxs<::772ld&>A>AACippAA>xxs<:752ovd0<>>A> As~rcAA>><>Aexxp>><:yp:7520qj%":<:<>ewm><<:7uqy520-v|i&7:7: g{fg}hkxkh+ h|zgnyhrpr k|}guqpwxpp p{}o{orpua px~rsnwwtkMp|snxmyepm0lx}snn|xoyjh}k|snnvpmm`h{}sn󔓓n~qmnQg|~ss󒓑n|syj}ynkxxk{sr{{myswkMkt~yeykz~t{k)euwkwtwullespwwk 򏎎l|lohsmcepz|psx|mtthmm3o}|ksxpnzhkkwpwp|xjznvklqth{qgvmve/dovrcjtur ws|tty{h\ j}lx~|~ k|mzu pywtt|hNku{hr~xfynzgxspwddn|moy|kyq}rku}dt|sjvi2q~rityeqr~tctl~;op|sckuvccp}tn}ln8 io}tf}gycqo~s|x}iy; otc~~w}s|tfc dm|si~~}}yds}kd0wo}sj~}|tp{N qt|sj~~}|{wo|yfn/ ~kyyr~~|{zyxx|jsC!~hy{jy}}||zzywm~rnj!}pr}wi}||{{zwwvnyce*"|pv}tk{{zzyyzyvvxz|im>#{opw|oszyywwvvwvuudp~qcW#yq|ynyywwvuvussrsjj8$p}tovvwvususrry|{gjF$|quuvusrqoq|{h`[*%pnssrqoomduk_[2&rqonmeot}kd[W'qoqoonow~pZjX"'qonmlow|vg`^3(onnmljjeedpwyvjXd?) kztvigtuc st}ll|gtuk~srstsxtt~wjpxm~iשcq|pqxsldՌ ippxxsovdc s~rcypg}qcJ exxpypqj!ewmuqyv|i sukkxpoxtcռ yrpyg|kpxpԑj{xtghwsppfg{fg}hkxkhJh|zgnyhrpr+ k|}guqpwxpp p{}o{orpuϙ px~rsnwwtkzp|snxmyepmRlx}snn|xoyjh̽k|snnvpmmɗh{}snn~qmng|~ssn|s/yj}ynkxxk̼sr{{my swkzkt~yeykz~t{kCeuwkwtwulle#spwwk l|lohsmcşpz|psx|mtthmmWo}|ksxpnzhkk!wpwp|xjznvk¤qth{qgvmveNdovrcjtur ws|tty{h j}lx~|5 k|mzuĿ pywtt|h{ ku{hr~xfnzgxspdn|moy|k3q}rkut|sjviVq~rityer~tctlbop|sckuvcp}tn}l[ io}tfgyc/o~sx}ib otcs|tf dm|sids}kRwo}sjtp{ qt|sjo|yfO kyyrxx|jn!hy{jym~r5!pr}winycF"pv}tkxz|if#opw|osdp~qc/#q|ynrs[$p}toy|{gs$|qq|{hG%pndukV&ot}kd'ow~p9'ow|vgW(񤡡pwyvjg)(٪ \*+CJ*,d(ʼ+(m\*Ty)Y)MՏ(!,қTd(!TU'qH*д&z8Ewȇ'H8Okg&A# 5O>,%M< #O.%:& eZA$0T }q%(s O$*jvF!<́, :  OCp  MC!5|O5%&j.\p.k:O}mOHMe&Ojq?}.Ch,ڐ8,#ǧ?3 ,O3Pe37q0}va0hڡY/j.Rz-aݳ-_n|,j!, U,hU޻*ް j* *ߊ *)>e ])F? b(t E', 3\&7 &O ': R:'wKO(b y9y89&8Ǣ<, i{s yqmkow{~ i{{rj xnjffttuw iytr'pqtpks (ktxp (npxo (hpngxqk (momluxl)mpmplxshy*mntsvo+ofqysps0kt|sjy0ykxxp-lkqwylgy-jlxnpxyps,ckrqkoxxs-pskqt-cqtyrs-cpve~znkn*crul􅋉px|tppy(cpxqk񈋊lktyyxumgm&q}pyppt{}umnr#co|ptpolv}}zttdfkx|jyrtty}} gx{pt rmkp!frzwhy t#ixxp3gx|tqk3iv|nm4eq}xr4cgw|xp~6ks}6cgy8iv8cqy9}tip6jxxpq6syt7t7hox:jw<kv i{s yqmkow{~ i{{rj xnjffttuw iytr pqtpks  ktxp  nnpxohpngxqk momluxlmpmplxshymn tsvoofqyspskt|sjy ykxxplkqwylgyjlxnpxypsckrqkoxxspskqtcqtyrscpve~znkncrul􅋉px|tppy cpxqk񈋊lktyyxumgmq}p  yppt{}umnrco|ptpolv}}zttdfkx|jyrtty}} gx{pt rmkp!frzwhy t#ixxp  %gx|tqk 'iv|nm (eq}xr)cgw|xp~,ks}-cgy0iv1cqy3}tip4jxxpq5syt7t7hox:jw<kv i{s111 1yqmkow{~ i{{rj1 111xnjffttuw !iytr1111/ pqtpks1 111 -1ktxp1 1113 -nnpxo/31111hpngxqk1 111momluxl1111mpmplxshy1111mn71tsvo1111/o31fqysps1111+511kt|sjy1111#711ykxxp11111l31//kqwylgy111%jlx1/13npxyps11ckrq//11koxxs11psk1-11qt11cqt5-11yrs11cpve11~znkn11crul11􅋉px|tppy1 1cpxqk11񈋊lktyyxumgm11q}p5773/7311yppt{}umnr11co|pt+-5///11polv}}zttdfkx|j/3+-/111yrtty}} gx{pt/1331 1rmkp!frzwhy511 1t#ixxp73-+1 1%gx|tqk-1 1'iv|nm-1 1(eq}xr-31-11)cgw|xp~3311,ks}311-cgy110iv111cqy113#}tip114jxxpq15syt7t7hox:jw<kv P]b 7]n U؃ * M YǴ'8E >(J H(bdU (h 5ϋ, _(77M:) :z͠* 3e +5}О&b0ܖ5M0\|%M-.kg0-eEyӗ , md*pˠ-}?-Z0-#pH*bܒ߲O(]R!>ТH,&ߒF%RⴄtE#ݗ AdԿvsTC} 1w 8# :ky!ػ(| #Y}3?޴AA3az1F54#˔F48ns6n6:#8aC8 _Ӂ9\%6n£s6FẾ7vՙ77>:< qzxtssrssttvwwzwtzzxwvvtsrsstx||{unklrx wy{|}~~}|}}~~}}{ywz}vtofgksxxwtrpnnortutvtxvttpnpqtxs}|k!{xxuvtvstwxx{{ t{i;yr;tz;h|y:i|}p:qsr;nus:p|{p:{wl;utt:t~d:fr:kyt;mwy:m}{q:vun;sss:t~}g;{opnmo'vvohdnutt{}~xjjlpv"j}{tvtmjjlv|}yuttvx|zuqqrttyvs}~uqux|zumkntxlfentvxxz{|{{xwvttrttuvwxx{|~~zxxutpeelsx yurpoorvx{||~|zxutpooq|}lxvrnmmkhkmmpsvx{yxk;sz;ky:ptt;n}wt:rx}m;rtm:t}h;tu;k}{p vogly(jrps ptxpnry&n|zk xihtyuuttddmy vtqgddstssu{wnkkmpyh}}nyrlkkv|}zt}spkkpx|ytrrsuwzywwtst}yty}ztkknpxhr|zyz}vngfforuuvuuttvxyzz{{zxxwwuuvwvzyjffkr pwy|~pmmx {yussqppqstuwxp|rcgirtqigntdm~udcortvmlnuyp~tfcijp{wttstyqttcdjtuu{||zwoiikmnppttpommjmy~{vy}~~cjkmmnx}}|{zyxwwxz{||}zxqmmlcefggfggqrrlnggffggeczxtssrssttvwwzwtzzxwvvtsrsstx||{unklrxJJIIMNNPQRwwy{|}~~}|}}~~}}{ywz}vtofgksxCCDDEFJJIIMMNNPQxwtrpnnortutvtxvttpnpqtx8s}|k;=>>?@@BCDEEFJJIMN{xxuvtvstwxx{{.//00322337t{i:;==>??@BCDDEFFJIM ##$%&)**++.//0322377yr::;=>>??@BBCDDEEFFJJIIM #$%&)**+.//0322tz99:;==>?@BCCDDEFJI  "#$&&)**+..//032h|y889::;;=>??@@CDDEFJ "#%%&))**++.//03i|}p377899:;=>>?BCCDEEF "#$%%&)**+..//0qsr23778899:;==>@@BBCCDDE "#$$%%&)**+..//nus237889:;==?@BC  "##$%&&)**+./p|{p2237789:;;==>>??@@B  ""#$%%&))**+.{wl03322337789::;==>>??@  "##$%%&))**+utt/0033237788;;=>>?@ "##$$%&))**t~d/003223378899:;= ""#$$%%&))*fr.//032237789::; #$%&&)kyt*++.//03223378: ""#$%%&%mwy**+..//03322379 ""#$$%m}{q**+.//02378 "##$vun)**+.//323  ""sss&&))**+..//0332 t~}g$$%&&)**./02% {o#$%%&&))**+./pnmo$vv"#$%%&ohdnutt{}~xjjlpv!j}{t vtmjjlv|}yuttvx|zuqqrttyvs}~uqux|zumkntx**lfentvxxz{|{{xwvttrttuvwxx{|~~zxxutpeelsx%%&&))*yurpoorvx{||~|zxutpooq|}l ##$%)xvrnmmkhkmmpsvx{yxk ""##$$%%sz  "#$+ky +ptt +n}wt ,rx}m2rtm0t}h2tu.k}{pvoglyjrps ptxpnryn|zk xihtyuuttddmy vtqgddstssu{wnkkmpyh}}nyrlkkv|}zt}spkkpx|ytrrsuwzywwtst}yty}ztkknpxhr|zyz}vngfforuuvuuttvxyzz{{zxxwwuuvwvzyjffkrpwy|~pmmx {yussqppqstuwxp|rcgirtqigntdm~ud cortvmlnu yp~tf cijp{wttstyqttcdjtuu{||zwoiikmnppttpommjmy~{vy}~~cjkmmnx}}|{zyxwwxz{||}zxqmmlcefggfggqrrlnggffggec/Lzxtssrssttvwwzwtzzxwvvtsrsstx||{unklrxvvwwz{{~wwy{|}~~}|}}~~}}{ywz}vtofgksxnnoorsvvwwzz{{~/xwtrpnnortutvtxvttpnpqtx[s}|kbcffgjjknorrsvvwz{113{xxuvtvstwxx{{KNORRSVVWWZt{i_bccfggjknoorssvwz3311/1135577;;=?BCFFJJKNNORRSVVWZZyr__bcffggjkknoorrssvvwwz1 1;=?BCFFGJJKNNOORSVVtz^^_bccfgjknnoorsvw1 179;=BBCFFGJKKNOORRSVh|y[[^__bbcfggjjnoorsv1 1359;??BCCFGJJKNNOORSi|}pWZZ[^^_bcffgknnorrs1 1/1359;=??BCFFGGJKKNORqsrVWZZ[[^^_bccfjjkknnoor1 1/1359;==??BCFFGGJKKNOnusVWZ[[^_bccgjkn1 1/13579;;=?BBCFFGGJKNp|{pVVWZZ[^_bbccffggjjk1 131135799;=??BCCFFGJK{wlRSSVVWWZZ[^__bccffggj1 153311379;;=??BCCFGGJJuttORRSSVWZZ[[bbcffgj11579;;==?BCCFFt~dORRSVVWWZ[[^^_bc1357799;==??BCCFfrKNNORRSVVWZZ[^__b11357;=?BBCkytGJJKNNOORSVVWWZ[_11/113799;=??B?mwyGGJKKNNORSSVVWZ^11/15799;==?m}{qFGGJJKNOORRVVWZ[113579;;=vunCFFGGJKNNOOSSVW 135799sssBBCCFGGJKKOORSSV131/113557755t~}g==?BBCFFGGKKNNOORRV1%157{o;=??BBCCFFGJJKKNpnmo1$135vv9;=??Bohdnutt{}~xjjlpv1!13j}{t7vtmjjlv|}yuttvx|zuqqrtt11/yvs}~uqux|zumkntxGGlfentvxxz{|{{xwvttrttuvwxx{|~~zxxutpeelsx??BBCCG11yurpoorvx{||~|zxutpooq|}l11335577;;=?C11xvrnmmkhkmmpsvx{11yxk//11335799;;==?1%131sz--//1133779;=+1ky113557+1ptt113571+1n}wt1 13,1rx}m11/21rtm11-//01t}h11/21tu11/131.1k}{p113vogly33//--/13511jrps1 1ptxpnry331/11n|zk1 1xihtyuuttddmy1 1vt11qgdds--tssu{wnkkmpy11h}}nyrlkkv|}zt}1/-spkkpx|ytrrsuwz11ywwtst}yty}ztkknpxhr|zyz}133vngfforuuvuuttvxyzz{{zxxwwuuvwvzyjffkr11pwy|~pmmx1 1{yussqppqstuwx11p|r11#/cgirtqignt11dm~ud11 +3cortvmlnu3351/ 1yp~tf--/5 !%cijp{wttst1//3311/13yqtt/11-cdjtuu{||zwoiikmnppttpommjmy~{vy}~~!cjkmmnx}}|{zyxwwxz{||}zxqmml#cefggfggqrrlnggffggec%#/LŹtRP.83&"J*KaajϿ*Ҹ\3 <|㻨Шyg5 #%:ǿsέy?%%  :nY &588>?HJJ>881!e;;3:;n:t;:&;;R> R8#(  ]ĒF&M7 0!JOп< qwEY׸tjjZ55<5_kjjѶհKpqͲY83Pdиͣqq\> ME (dȼ& p? 73(!#!%%5>??@CDDEFFJIMMIojpz}{vrinPPQ QRQsxQQPjuy==>?BCDEFJtnr|xpoMNN PQPtxxPPNNtuwn;;=>>?@BCsiquy}|wkmxIIMM NPNqzxMMjt|pnC9::;;==>?@sms||trkEEFFJI MIl}vIqvwqEE@8899::=>?rtx}xomxCCDEF JFjxtythDCCm778899;qks{~~yusqkxBBCD EDn~yknB@yjz337788tppw}zrmq{=>>??@BC DCBxxop?>=przinjgpvy{|zytklq::;==>??@B CBnpx~sn>=;evvh0t|~|spqu778899;;=> ?B@?Bwkxy{~m9>ylxvg8"~{qilx33223779:; =?>qwu|touxr;isypg*+..//03237789 :;:pt{tq9kxr3mr}m2+*++..//032378 9:99pqyumj7youru|n.*+./03237 8krywnj322o{xm{tfc*+./032 3kozwqx2230/t|}sc&)*+./03jptxypox00/jm}~}gc$%&)*+. /pks}tp{//+p|}pf "#$$%%&&)*+./yqu}ulj+**.yq|zk"  "##$$%%&)*+oit|xsnm**&)**skx|qdc  "#$%&)*pou~vop))&$%mt|tkc  "#$yhqvxzsjp$$#"hpz|jf tmp|{rqx$$"" km||qg rtv}xjlq  "rx~rhcjkkx|ytsdlo{}tgtps}{qnrjqxtksjgtxyxxskjx sjryztfcsqnmt||tppx jot~vphtvvz|wpikt jmsv|}ifsux mkt~ysjqsyzlgtkmx|{wrfcc" por|voj%spgktvx{{oge'tnlox}{rrk",tx|}wljh/{xuupjdcc3jgt}sfqpxxn~~qs}{q{x{{~~sgtzzqkwtxyz{~~qp{|teysyzwwzz{{~sqxxktqyzvwwzz{{~~kn|}vrkq|usvvwwzz{{~wovxnnq|urrssvvwzz{~ois{|xnkq|uoorrssvwz{~lp|~tpq|vknnoorrssvwwz{~~ogpu{~vksq|vjkknnoorrssvvwz{~ymn{ytvqyzjknorrssvvwz{~sy{olqyxwpccffggjnoorssvwzzwojpz}{vrin~~ sx~juyccfgknorsvtnr|xpoz{{ ~~txx~~{{tuwnbbcffgjknsiquy}|wkmxwwzz {~{qzxzzjt|pnn^__bbccfgjsms||trkrrssvw zwl}vwqvwqrrj[[^^__cfgrtx}xomxnnors vsjxtythonnmZZ[[^^bqks{~~yusqkxkkno ron~yknkjyjzWWZZ[[tppw}zrmq{cffggjkn onkxxopgfcprzinjgpvy{|zytklq__bccfggjk nknpx~snfcbevvhRt|~|spquZZ[[^^bbcf gkjgkwkxy{~m^fylxvg[9~{qilxSSVVWZZ^_b cgfqwu|touxrbisypgF'JKKNNOORSVWZZ[^ _b_pt{tq^kxrWmr}mVJ!GJJKKNNORSVWZ[ ^_^^pqyumjZyouru|nK3GJKNORSVWZ [krywnjWVVo{xm{tfc/FGJKNORSV WkozwqxVVSROt|}sc5BCFGJKNORSjptxypoxRRNjm}~}gc3=?BCFGJKNOpks}tp{ONNJp|}pf719;==??BBCFGJKNyqu}uljJGFFGKyq|zk9) 79;;==??BCFGJoit|xsnmGGBCGGFskx|qdc# 579;=?BCFpou~vopCCB=?mt|tkc# 133579;=yhqvxzsjp==;9hpz|jf#1357tmp|{rqx==9975km||qg+) 13rtv}xjlq779553rx~rhc!1/13jkkx|ytsd133531lo{}tg-'311/1tps}{qnr33/1131jqxtk5+1sjgtxyxxskjx11//-+-/3557sjryztfc/1sqnmt||tppx117531/jot~vph/%tvvz|wpikt113113575jmsv|}if)!sux1 1311355mkt~ysj5)1qsyzlg+%!1/tkmx|{wrfcc!" 1por|voj%#%1spgktvx{{oge+%'53tnlox}{rrk91',tx|}wljh+'%/{xuupjdcc%3jg-)%#!46Z68՝4ٓ.21#0Y.(k\F,kF),mF(Ov A$ 7W C"<}ж(!C؄:k :sںK}ƗP(eJMݻO%8ٞ!,h۵Pߪ?b}yO]竘Ч,C#KqM\1Ϟ}5!1W%.YҘA# "d Kۭs% \q?>؁YE &ܠ71mә3.7֯?8Р.˺h!E܌-.R1Ӽn׾+:n**b!C)d]y*)_ mt(HɄ#Mި&1|5߻q$#Z֜?#g$mצ_ 0yݤC$>_C zM Paнq 1zA!_֒m5 p.8φ1! <ٶ.U۲v vǘH޵pP? a*]8#9i;3:8.;. x{tmf))vwyqk9*owxsphK+owyppm[,pwxtk!,tyqk)-furvm{o-.xtscnnc3/ot{rcnnmv;0p{rrqzzkC1{uxostqnrB2q}xf{tlgvkC3ztlzttgwnF4jr{puigs=5~utingB6{ovik_B7mxijc78yif[;9ibS-:[K';K+ W87e 8 WO7R< 73:E98R.6zӐ.6zрU76(O <5>h86Ҝ*&87a .R:&Y:>R:AW;P<R ~pp88Sphere     F-=M]m} -=S\ctDeo~ooovUKw1 =\-mmmmmrR6FVfv#; %'&%-'+<>55ACAAC>:JIHJH- &-"!&0:<<::A:E>ACHKMPPMKJPTWTPJ "(+72'#"'5A727>CAAGGHIJJIJJKMKKJKPRP "! "%&#%+-('0>EE>:7KJIIHGEGJMMJR[\WPMMR #"(+--' ::7>C-027>EIICHKMMPRTRMHIP[bP  ! %('('%&-52+2:<<JHIJMPPMPRMPRUWWTPW !"#%&((+-02577:<>ACEGGHHIJKKMMPRTUW !"%&&(++-25577::ACEEGHHIJKKMMPRTUWWY *9=:CWcdmvurnmle`\M>++JXev}/Is*Fl )Pa} Dw򝞘;e=|ҡ/s젡Iy~{򡢣 #F^c_nzfJ3%JvɽOwFs C~ o1bcOwľ )I#(- 0 48:}R]R 9RIRWRYRRTI3WPUTP\Y\TPRYP& /YT\[RWRPY^YUW]^Wa["+]T[\W^YUYYWY^\UY\WWb\(WY[[\]^^`\\]W2%WYY[[\\]^`^`amgWk "Y[\]^`bcMeU]jfU n8/wJ35񬡫j30w/-걭Z)賭['D#"! [5!#/ѶvW-5ϡW0ĶO-ӎ/)Ϗ'o# 9!! :6 0.*(#"=<<;)=3<-/<1/;#5/=<=<)} :  8 7  6 5 4 3 2 2 / 1 / / / / . . , , - - - , , , , , , , , , , , , , , , , , , , , , - - - - - - - . - . . / / 0 0 0 0 1 1 <*J{82[zs79d~4=Wu|y~33msz19jzs{|~/+Mdwzw|}-=dwwv{~+2`musrw}*.Uaqrsu{|(7\qqmuzz{~}'$Qljenv{|yv{&:ajamussvwy}$V[ajmoqrwz|}~#3W[_emoqsuwz|}~!9[l`dmorsuwy{}~~ %N\[Zdjorssvwz{}~+S`[\eeloqrsvyz|~0WZU\jmjmoqrswz{};R\VWel_jmorsvy|{}@USXaeaaelnqruw{}|}BWVX[^`cjmnqsuuvy{~~%=MRVX\_`cjmnqsuuvy{~~)IVUUWZ^`adjmnqsuuwz{~~&CRRU[Z\_acdlnoqsuvwz|~~)EPINV\[^`cdemnoruvvwz|~~*@QNMVZW\_cdejmooruvvy{|~~&DFINUZ[X_`ceejnooruvwy{}~~$FICESXUW`_adejlnqqruvwy{}~~+B=EIPSVX[^`adejlnqruvwwy{}~~7CDFIQSVX[^`adjjlnqruvwwy{}~~#9>CMJMQUVX[^`cejjlnqruvwwy{}~~3C@CMINRVWZ\^`cejlmoqruvwwy{}~~/;?BFMMPSVXZ\_acejlmorruvwwy{}~~ +@?=ENMNQUWXZ\_adjllmorruvwwy{}~~ &8C@?JNIPRVXZ[\_adjllnqrruvwwy{}~~ %29>?CJIJPRVXZ[^_adjlmnqrruvwwy{}~~ 37:?CEJMPQSVXZ[^`cdejmoqqssuwyz{|}~ *38:?CEJNPRSWXZ[^`cdejmoqqssuwyz{|}~ *739;@DEJNQRUWXZ[^`cdejmoqqssuwyz{|}~ "39;:=BDFINQRUWXZ\_acdejmoqqssuwyz{|}~ 0/3@;>CEFINQRUWZ[\_acdejmoqqssuwyz{|}~/7/3@=?CFJIPQSVXZ[\_acdejmoqqssuwyz{|}~#/327:>@DFJMPQSVXZ[\`acdejmoqqssuwyz{|}~/*+:>2>BEJIMPQSVXZ[^`ccdejmoqqssuwyz{|}~&/379:?BEFJMPRVVWZ\^_`adjjllnqrsuvwyz{}~#*038:;@CEFIMPRVVWZ\^_`adjjllnqrsuvwyz{}~#)/28:;>@CEJIMQSVVWZ\^_`adjjllnqrsuvwyz{}}~$&+038:;>@CEJINQSVVWZ\^_`adjjllnqrsuvwyz{|}~$*+0379:=BCFJINQSVVWZ\^_`adjjllnqrsuvwyz{|}~%"*.0278:=BDFIMNRUVVWZ\^_`adjjllnqrsuvwyz{||}&$*/0379=?BDFIMPRUVVWZ\^_`adjjllnqrsuvwyz{||}~9"%)+/338:>@BDJIMPRUVVWZ\^_`adjjllnqrsuvwyz{{|}~"++/279;>@BDFJIMQRUWZ[[\_aacdelmnnqrsuwyzz||}~ #*+/279;>@BDFJIMQRUVX[[\_aacdejmnnqrsuvyzz{|}~"&*+/289;>@BDFJIMQRSVXZ[\_aacdejlmnqrsuvwyz{||}%**./28:;>@BDFJIMQRSVXZZ\_`aacdjlmnqqrsvwyz{{|}~"&+*./38:=?BBDFJIMQRSUWZZ[^``acdjlmmoqrsvwyy{{|}~"&++.039:=?BBDFJIMQRRUWXZ[^``acdejlmoqrsuvwyz{{|~"%*./039:=?BBDFJIMQRRUWXX[^_``adejlmooqsuvwyzz{|}~#%*//079;=@BBDFJIMQRRUWXXZ\_``acejlmooqruvwyzz{|}~ $)+./0389;=?DDFJMNPQRUWXZ[^_``adejlmmorssuvyyz{|}~~ $)+./0389;=?DDEJMNPQRUWXX[^_``adejlmmorrssvyyzz{}~~ $)+./0389;=?CDEJINPQRUWXXZ\_``acejllmoqrrsvyyz{|}~<Fv8Vï7^þ45c3S1^/Jz--c+V*K(#Z'=&_$'#W!!^ ?{JRb)j3k?czCwBnCr~w{Gj{zBosw{=swnrJkcrw~1Znosw;^fnzvz'Wnjnzw{%Nbgkszz~ Jjgcr{z{ B[njgv{w~ ?V^fgnvwv~ 3SZ_gnrvz~ 'FS[_gnrv{~ FZW^bjorv{ 9S^b_ckosw{7ROWjbfnrsw{!NZNSjcgnsvw~;OSVZ_fjosvz~1NGJ_fVfkrvwz~-5BNSZ^_gkrsvz~3;GRW[_bjnrswz~/;CNV[_bfjnrvwz=BJRW[_bfjnrvw{1=FJRWZ^_cknsvw{+?9FKRVZ[_ckoswz{𽿿5B=GNRWZ^cgkoswz~)9?CJNSW[_fjkovwz~)915JJNVZ^bfjkosvwz+75;GJOVZ^bfjkosvwz!/59BGJOV[^bfjkosvwz133?GGKOV[_bfjkosvwz'953BJGKOW[_cgkkosvwz-955BJJKRW^_cgkkosvwz/359?GKNRW^_cgkkosvwz//5;?FNNRZ^bcjkkosvwz137=CJKNRW[^bcgoosvz{~137=CJKNRW[^bcgoorvz{~137=CJKNRW[^bcgnorvw{~<985 4 2 0.,+))('%q$"!   #$%&'()*+,-q,I-.0 1 2 q1 3 4 54678899:9;:;;<=q ! !"#%&'(+-0257::<>ACEGGHHIJKKMMPRUWY  !!"#%&'(+--0257:<<>ACEGHIIJJKMMPRTUWY[  !"#%&'(+-00257:<<>>ACEGHHIJJKMMPRTUWWY[\   !##%'(+-00225:<<>>AACGHHIJJKMMPRTUWY[[\ !"#%&'(-00257:<>>ACEGHIIJJKMMPRTUUWWY[\ !""%&&'(+-02257:<>>CCEGHHIKKMMPRTUWWY[\\]] !""%&&'+--02257:<>ACCEEGHIIKKMMPRTUWWY[\\]] !"#%&'(+-002557<>>ACCEGGHIIKKMMPRTUWWY[\\]] !""#&&'(+-00557:<>AACEEGHHIIKKMMPRTUWWY[\\]] !"##&''(+002557:<>AAEEGGHIIJKKMMPRTUWWY[\\]] !"#%&'(+-022577:>AACEEGHHIJJKKMMPRTUWWY[\\]] "##%''(+-02257:<>ACCEEGHIIJJKKMMPRTUWWY[\\]] !"##%''(+-02277:<>ACCEGGHIJJKMPRTUWWY[\\]] !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&''(+-02257:<>ACCEGHIIJKMMPRTUWWY[\\]^ !"#%&&''(+-022577:<>>AEGGHIJJKMPRTUWWY[\\]] !"#%&&''(+-022577:<>>AEEGHIIJJKKMMPRTUWWY[\\]] !"#%&&''(+-022577:<>>AEEGHHIJJKKMMPRTUWWY[\\]] !"#%&&''(+-022577:<>>AEEGGHIIJKKMMPRTUWWY[\\]] !"#%&&''(+-022577:<>>ACEEGHHIIKKMMPRTUWWY[\\]]^ !"#%&&''(+-022577:<>>ACCEGGHIIKKMMPRTUWWY[\\]]^ !"#%&&''(+-022577:<>>ACCEEGHIIKKMMPRTUWWY[\\]]^ !"#%&&''(+-022577:<>>ACCEGHHIKKMMPRTUWWY[\\]]` !"#%&&((+-002557:<>AACCEEGHIIJKMPPRTUWWYWWY[\]^`` !"#%&&'((+-002557:<>AACCEEGHIIJKMPPRTUWWYWYY[]^^`` !"#%&&''(+--00257:<>AACEGHHIIJJKMPPRTUWWYY[\]^``a !"%%&''(++-002557:>>AACEGGHHIJJKMPPRTUWWYY[\]^`aab !"#%%&''(+--02257:<>>AACCEGHHIJJKMPPRTUWWY[[\]^`abc !"#%%&&'(++--0257:<>>ACEGGHIJJKMPPRTUWWY\\]^`abbe "##%&&'((+--0225:<<>>ACEEGGIJJKMPPRTUWWY\]]^abbcf !"#%&&''(+--02257:<>>ACEEGGIJJKMPPRTUWWY\]^`abccf !"##%&&'(++--2257::<<>ACEGHHIIJKMPPRUWY[\]`aabegf "##%&&'((+--22577:<<>AACGHHIIJKMPPRUUWWY\\^`abcfgi !"#%&&''(+--22557:<<>>ACEGHIIJKMPPRUWWY\\^abcegik !"##%&&'(++-02257::<>>ACEGHHIIJKMPPRUWW[]]`bcefikm !""#%%&''(++002557::<>>CEGGHIIJKMPPRUWWY\^]`befgjmm !"#%%&&'(++002257::<<>ACEGHIIJKMPPRUWWY]^^acfgimpn !""#%%&'((+-002577:<<>ACEGGIIJKMPPRUWW[]`^aefijnqq !""#%%&'((-002577<>ACEGGIIJKMPPRUWY[]`^aegiknqt !"##%%&'((+--0257:<<>ACEGGHIJMPPRTWWY[]`begjknqtu !"##%%&'((++-0257:<<>ACEGGHIJMPPRTWWY[]`beijmnrux !!"##%&''(++-02577:<>ACEGGHIJMPPRTWYY\^acfikmptw{ !!""#%&&''(+-02577:<<>AEEGGHIJMPPRTWY[\`acfjmnqux} !""##%&''((+-0257::<>ACEEGHIJMPPRTWY[]`begknqtx{ !""#%&&'((+-02557:<>ACEEGHIJMPPRTWY\]acegkpruz} !!"#%%&&'(+-02557::ACEGHIJMPPRTW[\^befimqtw}!!"#%%&''(+-02277:<>ACCGHJJKMPRRTW[]`cfgjnruz !!"#%%&''(+-02257:<>ACCGHJJKMPRRTW[]`cfiknru{ !"##%%&'(+-022577:>AACGHIJKMPRRTW[]`cfikprw{ !""#%%&''(+002557:<>AAEHIJJMPRRTW[]`cfjmqtw} !"##%&&'(+-00557:<>AAEGIIJKPRRTW[]`cfjmqux} !""##%&'(+-002557<>>AEGHIJKPRRTW[]`cfknruz !!"##%&&'+--02257:<>ACGHIIKMPRTW[]`cfkprwz !"##%&&'(+-02257:<>>CGHIIKMPRTW[]`cfmptw{ !!"##%&'(++00257:<\]^`abcegmaT`xt[iYT`b<\]]^^``abcefbemkiicefnurmf^W]^``abccefgfkbbjfgjjc\`knfnY]^``abcefgi jan^]^``abccefggi jeijcaM]^``abcefgijkmqqgit\ ]^``abcefgij ktbepkgmqW]^``abbcefgijkmkjnmiqqcrp- ]^``abbcceeffgijknrxpagrpjWet ]^``abcceffgijjkmnwae{ukbiutkjK ]^``abcceeffgijkmnrntqeguwqqminpbR^`abcceffgijjkmnnpqpqrqqpnnmm[^`abcceffgijjkmnnpqpqrqppnnmj^`abcceffgijjkmnnpqpqrqpn^}M^`abcceffgijjkmnnpqrqpnp`qr^`abcceffgijjkmnnpq rqzuqjtq^^``aabcceffgijjkmnnpqrtra{ea}m-^^``aabcceffgijjkmnnpqr tucmparC^^``aabcceffgijjkmnnpqrtuqpxzqqupr]^^`abbcceeffggijkmpqrtutrn]^``abbcceeffggijkmpqrtutrq]^`aabbceefggijkkmnpqrtutq^^`abbceefgijkmnpqrtutp^`aabcceeffggiijkmnpqrtuwutw^`abbcceffgiijkmmnpqrtuwu``abcceffgijkmnpqrtuwur``abcceffgijkmnpqrtuwut`abceffgijkkmnpprpqrtuwuaabeffgfggijkkmnnpqrpqqrtuwuabcefgiijkmnnppqrtr r tuwubcefgiijkkmnppqrttuwucefgijkmmnpqqrrqqrttuwuwefgijkkppqqrttuttuw xwuwfgijkmmqqrttuwwxz {zx wuwfgijkmnrrtuwwx{{}}}{zzx wuwikmmnqrttwxzz}}}}{{zzxtuwkmnpqtuwxz{}}}}{{zxwttuuwnqrrtwzz{톃{{zzxxwwuuwprtuwz}}}}{{zxxwuwwpruwx{珎}{zzxzxx wquwx{ꔒ}{{zx wtxz}왖}{{zxxw wz}枚}}{zzxw wx{}{zxxwu{㱮}{zzwu诬}{zzwu쀅赳}{{xwu낆ÿ߼}}zzxxwwuu慉ÿ{{zxwwuu戌ÿ{{zxxwuu拏ÿ}{{zxwuuǿ}zxwwÌſ}zxww鎔{zxwwꏖǿ}zxxwwſ{zxxw ſ{zxxwſ}zxxwý}zxxw{xxý{zx}zx´9򳱴ýó\﻾±q9캷¾c&컺z q l²* ·n 󽼿@  Ƕý½W¿[΋ʥ.s  ̹ʾ;øž ³ 񿳴    Ǵ ϵ µ µ ö ö÷ø        ^ӑӬ^ޜB޹  ֤G ܧ  j - ։ޏK  b               )                !#&()+-/02 4 5 689;<= b=jt ;wac#:nrqxG9rfzwbP8kgkg+7jpW{wp<6q[iwmxA5p{cwtrre4utrqixJ3uwuutrj] 2uwwuttziu{n1wuttwwjj{n%0wutxjutkkw0wxxwuu{ekpqgb/xwuukcmbka.xwuqtqprqqkp- wuttrtiW, wuttrwcn+ wuttrnmtf+ wuttrprrji* wuttrg}mx&) wuttrxj{rgz( wuttrkxpktcr( wuttr}qkzi}^' utrqnmk<& utrqnmkc& utrqpmmw^% utrpnmmu$ utrqpnikn$ utrqqppmmM# utrqqtm`w# utrqqrfpn\"wuttuttrqrpfpc+!wuttuttrqkrmitb!wuttuttrqpqternR wuttur rqujrmf\w wuttur rqfrrbewWwuttur rqmptmczerwuttur rqntpgfw\eHwuttuqqrqpkjkmigjnxwutrrqrqqpnmkkjji\xwutrrqpnmkkjjikxwutrrqpnmkkjjenH@}#=Q<…;Ƕ2ȟ9ºǷ7л̻7԰6ӻǾȝ2̸3Ȣ3¼˳Є2ɻɿ1Ǽɿ0ȼ½j,ɹѽ^.ýոηνR-, + Ǹ+ ºc* ¼) ˻ʾȕ( ȼ»~( ¸Q' ɻʴ' & d% Ǵ$ Ë$ Z# " ¾y" º*! ! ¾·d  ¹¿  ü¾_ ·ǯ3 ¾ɹ Dz@_@!};=<;#29!776#2+33210+,.-5, ++ + * !) !( ( ' ' & % 5$ $ # -" " G! !      W  )j!==<;:7876 3 4 3 2 10/.-+,+)()(('&%%$##""!!   !!<::99 8 8 87776 6  55556544 333333"3$3%32222221011111111111110 0 111111111 1 1 </5/:#51/:+5//915//9)751/85317/8#51/7/8+3//5/7!13-/5/7+51//3/735/13//6!73/55-/6#71/773/5)+/3531/35)+/3531/35+-/331/15-/13116/15)11//1/4311//1/47311//1/3%31133'31133+31133/11335113#9/113)=/113-?/1131//1121//112!1/112'3-112+3-112/5-311235/311315/31130'135/111)135/111+115/111-113/111/3/3/1113/1/11153/1/1115-1/111/133/111/135/11115-1113115/11131/511151/5311071/53110!71/551115//51115//51115//51115//51115//51115//51115//51115//5111-7/-3111+7/-3111)71-311<;);::99)988877)6666655 5 4I4q44 4 3) 3 3 3 2 2 2q 2 2 2 2 1q 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 2 1 2 2 2 4 4 4 5 5 566778899:::::;== ? $)+./0389;=?CDEFINPPRSVWXZ\__`acdjllmnqrrsvwyyz{|}~~ $)+./0389;=?CCDFIMNPQSVWXZ\^__`cdejllnqqrruwwyy{|}}~ $)+./0389;=?BCDFJMNPQSVWWX[^__`adejjlnoqqruww6yz{|}~ $)+./0389;=?BCDEJMNNQRUWWX[^^_`acejjlmoqqruvwwyz{|}}~ $)+./0389;=?BCDEJINNQRUVWX[^^_`acejjlmoqqruvwwyz{|}}~ "#&*.03789:=?@BCEFIMNQRSUWX[[\^`aacejjlmnorssuvwyz{{|}~~ "#&*.03789:=?@BCEFIMNQQSUWX[[\^`aacejjlmnoqrsuvvwz{{|}}~ "#&*./3388:=?@BCDFIMMQQRUWXZ[[^`aacdjjlnoqrsuuvwyz{|}}~ "#&*./33789=>@@CDFJIMPQRUVXZ[[^``aadjejlmoqrruuvwyz{{|}~ "#&*./03789;>?@BDEJIMPQRSVWZZ[\_``adeejlmnqrrsuuwyzz{||}~ "#&*./02779;>?@BCEJIIPPQSVWXZZ\_``aceejmnoqrssuvwyz{||}~ "#&*./02378;=??BCEFIINPQSUWXZZ\__``ceejlnoqqssuvwyzz{|}~ "#&*./02378;=??BCEFJINPQSUWXZZ\^__`cedejlnoqqssuvwyzz{|}~"$&*+./3378:==?BCDEJINNPQSUVWZZ[\_`accdejlnooqrsuvwwy{{|}~"$&*+./338:==?BCCEJINNPQSUVVZZ[\_`aacdejlmnoqrrsvwwy{{|}~ $&**./3237:;=?BCCDFIMNPQRUVVXZ[\^`aaccdjlmnoqqrsuvwyz{{|~ #&**./32379;=>@BCDFIMMNQRSUVXXZ\^_`aacdelmnnqqrsuvwwzz{|}~ #%**+/02279;;>@BCDFJMMNPRSUVXXZ[^_`aacdejmnnoqqsuvvwyyz{|}~~#%)*+/03239:;>@BBCEJIMNPQSUUWXZ[\_``aacejlmnooqrsuvwwyyz|}}~"%)*+/03238:;=?BBCEJIMNPQRSUWXZ[\^_`aacdjlmmooqrsuvvwwyz{|}}"%)*+.03238:;=?@BCEJIIMPQRSUWWX[\^_``acdjlmmooqrsuvvwwyz{|}}~"$&**+/03279;=>?BDEEIIMNQRSSVVWZ[\^_`acdejlmmnoqrsuuwwyz{|}}"$&)*+/00279;;>?BCDEJIMNPRSSVVWX[\^^``adejlmmnnorssuwwyz{|}}~ $&)*+//0378:;=?@CDEJJINPQRSUVWXZ[\^_`acdjllmmnoqrssvwwy{||}~ #&)*+//0338::;>@BCDFJIMNQRRSUVWZ[\\__`adejllmnoqrsvvwyz{||} #%))*.//3389:;=?BCCEFJINPQQSSUVXZ[\^^_acdejjlmnoqrruuvwyz{{}#%&)*.//03789:=>@BCEEFIMNPQRSUVWXZ[\^_`adeejjlmnoqqsuuvyzz{|"%&)*.//02789:;>?BBDEFJINPPRRSUWXZZ\\^`acdeejjlnooqssuvwyzz{"$&)*.//027889;>?@BDEFJIMNPQRSUVXZZ\\^_acddeejlmnoqssuvwyzz{"%&&*+//027789;=?@BDDEJIMNPPRUUVVX[\\^_`accejlmnoqqrsuvwyyz"$&&*+.//23789:=?@@DDEFIMNNPQSUUVX[\\^_`accejjlnooqqrrsvwwyz"$%%)+.//33778:=>?@CDEFJIMNNQSUUVWZ[\\^`aaceejlmnooqqrsuvwwy #$%)*+./323789;=??BCDEJIMMNPRSSUWX[[\^_`aaddejlmnooqrsuvwy"#$&*++/022379:=>?BBCDFJIMMPQRSSVXZZ[\^_``cdejlmnnoqrsuvvw"#$%**+./32238:;=>@BCDEFJIINQRRSVWXZZ[^__`ccdejlmmnnoqrsuuw "#%)**+/332379;==@@BCEFJJINPQQRUWXXZ[\^__accdjllmmnnorssuv "#%)**+/032379:==?@BCDFJJIMPQQRUVXXZ[\^__aacdejlmmnoqrsuv"$)**+/033279:;=?@BCDEFJIMNPQSUUVWXZ[\^^``acdejjmmnoqrssu"$&**+/003278:;=??@CDEFJIMNPQRSUVWWX[\\^``acdejjlmnoqrss"$&)**./002389:;>?@BCEFFIIMNQRSSVVWXZ[\\_``adeejllmnoqrrs #%&)*.//03379:;>>?@CDEFJJINPQRSUUVWXZ[\__`acdeejlmnoqqrr"$&)*+//02389:==>@BCDEFJIMNQRRSUVWXZ[[^^_`acddjjlmnoqqr"$%&)*.//033799;=>?@CDDFFJINPQQSSUVWXZZ\^^_accdeejlmnoqq #%%)*..//32789;;=?@BCDEFJIMNPQRSSUWXXZ\\^_`acceejlmnooq #$%&*..//02788;;=>@BCCEEFIMNPQRRSUVWXZ\\^_`accdeejmnnoo #%&)*+.//3377::;=?@BBDDEJIMNPQQRSUVWWZ[\^_`aacddelmmno #$&)*++//32379:;=>@BBDDEFIMNNQQRSUVWWZ[[\_``accdejlmmo "$%&)*+./023799:=>?@BCDEFJIMNPQQRUVVWZZ[\^_``acdejlmmn"#%&)**+/032389:;=?@@BCDEJIMMPPQRSUVVXXZ[\^_`aacdejlln "$%&**+./322789:=>??BBCDFJIMNNPQRSUUWXZ[\^__`aacdejlm"#%%)**./032778:;=>?@BCDEFJIMNNPRSSUWWXZ[\^^``acdejjl #$%)**+//33789:=>>@@BCEFJJMMNPQRSSVWWX[\\^__`acdejl #$$))*+//033789:;=>?@BCDFJJMMNPQRSSVVWXZ[\^__`acdeel #$%&**+./332378:;;>?@BCEFFJIMNPQRRUUVWXZ[[\^`a`adee #$$&**+./3323789:;>?@BCDEFJIIMPQQRUUVWXZ[[\^``aced "#$&**+/0332389::>>?@CDEEJJIMNPQQSUUVXZZ[[^_``cdd "#%)**+//0033789:==>@BCDEFFJIMNPQSSUVWXZZ\__`adc  #$&)**.//0323899;=>?@CDDEFJIMNPPRRSUVWXXZ[^^_acc "$&))*+//033788;;=>@BCCEEFJIMNNQRRSVWWXX[\^^`aa #%&)*+//032378:;=>?@BCDEEFIMMNQQRSUVWWXZ\\^_aa #%&)*+.//32378::;>?@BCDDEFJIMNQQRSUVWWZ[\\^_a`  "#$%&)*../0323799:=>?@BBCDFJIINNPQRSUUVWZZ[\__  "$%&)*..//323399:;>?@@BCDEJIIMNPQRSUUWXZZ[\__  "#$&))++./0323889;=>?@@BDEFJIMMNPQRSSUVXZXZ\^^137=CJKNRW[^bcgnorsw{~~137=CJKNRW[^bcgnnoswz{~137=CJKNRW[^bcgknosvz{~137=CJKNRW[^bcgknorvz{{137=CJKNRW[^bcgknorvw{{379;BGKRSZ[^_cgjknrswz{½379;BGKRSZ[^_cgjknrswz{Ҿ379;BGKOSW[[_cgjknoswzz379;BGKOSWZ[^cfjjnosvwz~379;BGKORWZ[^bfgjkorvwz~ҽ379;BGKNRVZZ^bfgjknrvww~~򡦧ҽ379;BGKNRVWZ[bcggknrsww{~379;BGKNRVWZ[bcggknrsvw{~359=BGJKOSWZ[_ccgknorvw{{~359=BFJKOSWW[_ccgknnrvw{{~357=BFGKOSVWZ_bcgknnoswz{~357;BFGKOSVWZ^bcfjknoswzz{137;?FGJNRVVZ^bbfjknosvzz{~135;?CFJNRSVW^_bfjkknrvwz{~1359?CFJNRSVW[_bcgkknrvwz{~/159?CFJKRSVW[_bcgjknrvwwz~3359=BFFJNRSVZ^bcfgkorrwwz{3359=BCFJNRRVZ^bbfgknorvwz{~3357=BCFJNORSZ[_bcgjnorvvw{~Ͻ1337;BCFJNORSW[__bfjknosvwz{1137;?CCGKOOSW[^_bcgknnrsvw{~1135;?BCGKNORWZ[^_cfjknrrswz{~1159?BCGKNORVZ[^_bfgkkorsvw{~~//159=BCFKNORVZ[[^bfgjkorsvwz{~11359?BBFJNNRVZZ[^bcgjkoorvwz{~~1159=BBFJKNOVWZ[^_cgjjoorswz{{~1159=??CJKNOSWZZ[_cfgjnorsvwz{{1137;=?CGJKNSVWZ[^bcggknorvwzz{~11359;=BFJJNRVVWZ^_cfgkknosvwzz~1159;=?FGJKOSVVW[_bcfjknorsvww{1//1379;?CFGJOSSVWZ^bccjjknrsvvw{~1//1379;?CFGJNRSVWZ^_ccgjknosvvwz~11/11359=CFGJNRSSVZ^_bcgjknorsvwz{~11/11359=BFFJNRRSVZ[_bcggjnorsvwz{~1/11359=BCFGKORRVW[^_bfgjknrsswwz{11/11357;?BCGKOORSWZ^_bffgjnorsvvw{~11/113559=BCFJNNORVW[^_ccfjknorsvwz{11/113559=?BCGKNORSWZ^^bcfgjnoossvw{~11/113537;??CGKKNOSVZ[^bbcgjknorsvwz{~11/113537;=?BGKKNORVZ[[bbcfjknnrrswz{~1157;?BCFJKNOSWZZ__bcgjkkoorvwz{~11357;=BCFJJNOSVWZ^_bcfjkkoorswz{{11379=?BCGJKORVWZ^^_cfgjknorsvwz{~11359;?BCGGJNRSVW[^_bcgjjknorvwzz~~11/1379=?BFGJKOSVVZ[^_cfggkknosvwz{{~11/1359;??CFGKNRSVZZ[_bcfgjknorsvwz{{~11-/157;=?CFGJNOSSWZ[^_cffjjknrsvvzz{~11-/137;==CCFJNORSWZ[^_bcfgjknosvvzz{~11/1357;=?BFGJKOSSVWZ[_bbfgjknrssvwz{~11/157;==BFGJKOSSVWZ[^_bfgjknorsvwwz~11/1379;=BFGGJNRSSVW[^__ffgjnorrvvwz{~11/113579;?CFGJNORRSWZ[^_ccfjknorssvwz{~1 13577;=BCFGKOORSVW[^^bcfgjnoorsvwz{~~11/113579=BCCFJNOORSWZ[[bbcfjknnrrsvwz{{11/13357;?BCFJNNORSVWZ[_bcfgjknorrswzz{11/1357;?BCFJKNNOSVWZ[__bfgjknoorsvwz{1 179;=?BCFKKNRSVWZ^^_cfgjkknosvww{{~1 179=?BCFKKNOSVWW^^_bfgjjknorvwwz{~1 1579;=BCCJJKORSVW[[^bcfgjjkorsvwzz{~ !!"##%&((+--0257::ACCGIKMPRRWW[]beknrw{  !""#%&'((--0257::AACEHKMPPRUWY]aejmrw{ > !"#%&'((+--0577:AACEHJMMPRUWY]acimquz  !""#&''(++-0257:>AAEHJMMPRUWY\acgkptx}  !""#%&'(++-02577>AAEHJMMPRTWY\acgjnrw}  !""#%&&'((+-0255:AAEHJMPRTWY]aegmquz  !"##%%&'(+-0027:>>ACHJKMPRUW\`cfjnrx  !"##&'(+-0057<>>AGIJMPRTW[^aeimqw}  !"##%%&'(+-027:<EHIJMPRTY\^afjnrz  !""#%%&(++-257:<>EHHJMPRTW\^aeimrx}  !!"##%&'(++0057<>ACCHJMPRUW\^bfintx}  !!"##%&'(++0027<>ACCGJMMPTW[]aeimrw}  !!"##%'((+-025:>AACGIKMPRUY]`cfkptz   "#%&'((+-057<>AAEIJMMRTW[^aeimqt  !!"#%&''++027:<>AEHJJMPRWY]`bfjnr  !!"%&&'(+-05:<<>CGIIKMPUW[]`cgkr  !"#%&&((+057:<>CGHIJMPTWY\^afip  !"#%&&'(+027:<>AEHHIKMTUY[]aeij  !"#%%&&'(-022::>CGHJJPRWY\`bfi  "##%%&'(+0227:AEHHJMPRTW[]a  !""#%&(+--227<>CGGJMPRRUY\^  !!""#&'(+-005:CCGIKMMPRU   !""#%&&'(-0025:>>CGHJMPRU !!"#%%&&(+002:>>AEHIKPRR   !!""#%%&'+--27<<>CGHJMPP  !"##%%&(++05::>AEHKM    !"##&''+0527:<AAC  ""#%&'((--027:<AEHIKKMPRTTWY\\]abcegjmnprtuwwxxz{zxwuttrqnmkkiigfcbaa<>AEGHIKMPRRTWYW[]`abegijmnqrrtuwutrqqpnmkjjggfecbaa^:<>ACEGIKMPPRTUUW[]]`beefijmnnpqrqpmkjiigeecbaa`]7:<>ACCGIJKMMPRRUWY[\^aabcfgijjkkmkmkjiigffeebbaa`^^\57:<>ACCGHIJJMPPRUWWY]^]^abeffijgiijiiggffeeccbb``^^]]\\[0257:<>CEGHIJKKPPRRTUWW\\]]^`aacceeffgeccbaa``^^]\[YYWY-0257::AACEGHIIPPRTUUYY[[\]]^``aabbcca`^^]]^]]\[YWWY(+-0255<<>ACEGGMMPRUWY[[\\] ^]\[\[YWW'(+-022::<>ACEEJJKMMPPRTUWWY[ \[Y[YYWWUW'(+-02277:<>ACCGHHIKMMPRTUWYWUTU&'(+-00557:<>AACCEGHIJKMMPPRRTUWUT#%&'(+-00257:<<>ACEGHHIJKKMMPRTUTUTR"#%&'((++-0257:<>ACEGHHIJKKMMPPR#%&''-02557<<>ACCEGGHIIJKKMMPRP"#%%&''((+--02277:<<>AACCEGHHIIJKKMP!"#%%&&'(++--2257::<<>>ACEEGGHHIIJJKKM!"##%%&'(++02257::<>AACEEGGHHIIJJKM !""##%%&'((++002577::<>ACCEGGHIJK !!""#%%&''((-0025577:<>AACEEGGHHIJIK !!"!""#%&&'(++-02252557::<<>AACCEEG HJ !! !!"#%%''((+-00-002577:<<>ACEHI !!""#%&&'(++-00257:<>ACEGHIH !!"#%%&%%&'((++-002557:<<>ACCEGH !!"##%#%%&'((+--0257:<>ACEG   ʿ ʾɼȺȸǷǵò±°ÿ¿롣⟠㜝ڸⲚ۱󹸸񞟟 ް 윝񭮕󠡢󡢣 󠡡                         xwutrrqpqpnppnmkkjjegcxwutrrqpqppnpnmkkjjgjcxwutrrqpnpnmkkjjepcbxwutrrqpnpnpnmkkjjbkgixwutrrqppnpnmppnmkkjjigmWn{zwtrqqp nmkjkqa]j{zwtrqqp nmkjgfbgj<{zwtrqqppn mkjjijccm^e{zwtrqqppn mkjikiejWi {zwtrqqppnn mkjifmffbaU{zwtrqqnnm kjiigkibgTr{zwtrqqnnm kjigmbkcbWc"{zwtrqqnnm kjigpUmiaiY`{wutrpnnmmkkj jigfeeca^{wttrpnmmk jigfeeca^{wtrrpmmkjjijjigfeccb`]azwtrqpmmkjijigfeccb`]`zutrqnmkkj igfeccb`]Pzurqqnkkjiigiigfecbba^\WRxurqpnkkjigigfcbba^\]^xurqpmkkjigigfecbba^\WPwrqpnmkkjiiggfecba`^]\TIurppnmjkjiggfecba`^]cWRuqpnnkjjigf fecba`]]bTUtqnnmkijigff ecba`^]\[YTrpmmkjiigffeececcba`^]\UcRrnmkkiggfeccec cba`^\\PeMCqnkkjifgfeccbcba`^]\\T^MRqnkkjgfgfeccbccbbcba`^]\[^]RWmkjiggc ba`a``^]]\\TY`Jmkiggffccb a`a``^]\\[YT`Mkjigffb a`^]]\[[]P[RHjigfeeba `^]\[[Y\WRT[igfecca `^]^]]\[YYWaJUTgfecbb` ^]\[[YWWTaJWJgecbaa` ^]\]\\[YWWUPWJfecaa`^ ]\[YWW\JWWPcba`^]^^]] \]\[YWRWWI(cba`^^]] \]\[YWWRUUI5ba``^]]\[\[YWUPRRHC`^]\ [\[[YWUPHJ^]\[ Y[YWUTPPMIM]\\[YWUTTRPRJJK\[[Y WYWUTRPRGMG[YWUTRPTEPCYWUTRMPAU<YWWUWUTRMKPEREWUWUTRPJRIKJWUTUTRPIRKAKUTRPIPK:GTRTRPMPKK<>RPMGKE7RPRRPMJMAJJ5PMKMEIE<:PMKEIGA> MPMKJIEHGGA MPMPMKJIGGCG<KMKJIEHC2E%IJKMKMKJIHG:I<0G%HI JKJIHGECC>-<%GH IJIHGEECAAE0:-++B3 |  J    a   Q B)W " S¿ &J 򶵵d 򶵵   " D 񳲲^ l   % F _>Pez~|yvl n ne[ SNN ;/ kS   1 v  7     #kCى 9ۄBv ՞  9oՔ ٤   ?sҖf~՟ֹҾԷԴӤ ӧ ӟ Տ ք{{ bO 5""###$%%%&&&&''')((())))****++++++,,,,,,,,,----------------------1 111122222233 3#3#3 444445455 5 5 6"6#6#778  8  899 ::: ;#;"<<==1'71-3111#53/3111!53/311155131113513112351511215-3112/3-3112)3-3112%3/3112!1/1131/113 13+;113';-113!7/1143114/3114)3114%114!/115/1/351--114'/1133//15313/1551/175-15-33-177-15!/5//57/16+91135116);3115116!;115-173-13/17'53//31837--718+7/-718!31/319+53/19'7711:1511:+3/1:/71;);1;!91</1<%1=1='1q 1) 1 1 1 2 2 2 2 2I 2 3 3 3 3q 3 4 4 44I45 5q666677788q999::q;;;<;<=I==q "$%&)**+//032778:;=>??@BCDFJJIMNPQRRSSVWXX[\^ "#$%&**.//03379:;=>>?@BDEFFIIMNPQRRSUWWXZ\\ "$%%))*+.//022389:;=>>?BCDEFJJIMNPQRRSVWVWZ[\ "#$%&)**+.//323789:;=>?@BDEEJJIMNPQQSUVVWX[["#$$&&)*+.//332389:;=>?@BCDEFJJINPPQQSUVVXZ[ "#&&)*+.//0323789;;=>?@BBEFJIMNNPPQQRUVVWZ "#%&)**.//023789;;=>?@BBEEFJIMNNPPQRSUVVX""%%&)*+..//032788:;;=?@@BDEEFIMMNNPQRSUVVX $$%&**++//02378::;=>?@@CDDEJIIMNNPQRSUUW ##$%)**./0323799:;=>??BCCDFJJIMNNPQRSUV""#$&)**+.//0233899:=>>?@BBCEFFJMMNPQRSSU  "$%&)*++./0323889:;=>>@@BCDEFFIIMNPQRSS  "#%&))++./0322889:;=>>?@@BCDEFIIMNPQRRS"$%%&**.//033789:;;??@BCDEFJJIMNPQQS"#$%%**+//0023789:;;??@BCDEEFJIMNPQQR "#$%))*+.//0223789::>>?@BCDDFFJIMNPPQ "$$&&)*+.//33237899==>?@BCDEEFJIMNNQ #$%%&**+./00323788;;=>?@BBDDEFJIMMN"#$$%)**+.//032377::;=>?@BCCDEFJIIN ##$%&)**+//032379::;>??@BBCDEFJIM "##$%)**+//0323399:;=>??BBCDEFJJI"#%&)**+.//0233789:;==>@@BCDEFFI"#$&)**++./03237789:;==?@BCDEFFJ "$%&)**+.//0323778:;;=??@BCDEEF #$%&)**+.//0323379::;>>?@BCDDF"#$%&)**+.//03223899:==>?@BCCD "#$%&)**+.//03327889;;=>?@BBD "#$%&)**.//00323788::;=>?@BC "#$%%&**+.//0032378::;=>?@@B! "#$%&**++//032337889:;=>??! #$%&)**+//03233889:;=>>?" "#$%&**.//32237789:;==>" "#$%)**+../033233789:;==  "#$&))*++./003223789::; "#%&&**+//03323789:: #$%%**+.//033278899 "$%%)**+.//003237889( "#%%&)**++//0323378( "#$%&)**++//032338)""$$%&)**.//32237) ##$%&)**+../03323* ""#$%&))*++./0032* "#$%&&**+//03% "#$%&**+.//0% "#$%%)**+.//0#& "#$%%&)**++/ ( "#$$%&)**++/*""$$%&)**.' ##$%&)**+&""#$%&))* ) "#$%&&*( "#$%&*& "#$%%)"' "#$%,"#$$#' "##+ "" + ) ('/0  .1579=?BCGGJNORSVZZ[_bcfggjknosvvwz{~1 1359;=?BFFGKNORSWWZ^_bcffgjkorsswwz{~113579=??CCFJKNORVVW[^_bcffgknorsvvwz{~11379;=?BCFGJKNOSVWZ[^_bcfgjkorrvvwz{~11359;==BBCFJKNOSSVW[^_bcfgjknorsvvw{~~113579;BBCFJKNOORSVWZ[^bbcfgjkkrsvwz{{~~113579;?BCFGKNNOORVWZ[^bbcfgjkkrrsvwz{{~~113599??BCGJKKNORSVZ[[_bbcgjjkorrswzz{{~113577==?BFGJJNNORVWZ[__bcfgjjnoorvwwz{{~11357;;=?CFGGKKNRSVWZ^^_bcfggknnosvvwz{{~113599;=BCFFJKNORVWW[^^_cffgjkknrssvzz{~1 1311379=?BCFJJKORSVW[[^_bcffjjknorsswwz{~1 1311/1133579;?BCCJJKNRSVV[[^_bcffgjjknorswwz{~11359=??BFFGKNORSWWZ[^_bbggjknorsvvwz{~11359;=??FFGJNORRVWZ[^_bbggjknorrsvwz{~11579;=?CCFJKNORVVWZ[^__ffgjknoossvwz{~~113579==BBCGJKNOSSVWZ[^^ccfgjknorrsvwz{{11311357;=??BFGJKNRRSVWZ[[bbcfgjkkoorsvwzz{11311359;==?CFGJKOORSVWZZ__bcfgjknnorsvww{1131//137;;=?BCFGJNNORSVWZ^__bfggjkknorsvwz1131/-/379;;=?CFGJNNORSVWW^^_bcfggkknorsvvw1139;?BCFGJKNORVWWZ[^_bccfjjknorssw1139;=BCFFJJKORSVWZZ[^_bccgjknorssv11379=?BCFGJKNORSVWZZ[_bbcggjknorrs11357;=?BCFGJKNORSVWWZ^__bffgjknoos11359;=?BCFGJKNORSVVW[^^_ccfgjknno1131379;=?BCFGJKNORSSVZ[[^bbcfgjkko113/13579;=?BCFGKNNRRSVWZ[[__bcfgjkn113/1379;=??BFGJKNORRSVWZ[__bcfgjjk1!13579;=?BFGJJNORSVWWZ[[^_bcfgg1!13577;=?BCFGJNNORSVWW[[^_bcffg1"13579;=?BFGGKNNOSVVWZZ[^_bccf1"135579;=?CFFJKKNRSSVWWZ[^_bcc1 1/133579;=BCCGJJKORRSVVWZ[^__b11/13579;?BBFGGJNOORSSVWZ[^__1131//13357;=??FFGJKNOORSSVZ[[^^1131//13579=??CFFGJKNORRSVWZ[[^1(13579;??BCFGJJNORSVWWZ[1(13579;=?BCFGJJNNORSVWW[1)13599==?BCFGGKNNOSVVWZ1)13577;;=?BCFFJKKNRSSVW1*135799;=?BCCGJJKORRSV1*135779;=?BBFGGJNOORS1%13113579;=?BFFGJKNOOR1%1311/11335579;=??CFFGJKNOR5;3-1531&1579;=??BCFGJJN-73-/1(13579;==?BCFGJJN13/-//1*13599==?BCFGGK+53//1'1/1357;;=?BCFFJ#353131&1/13399;=?BCCG+751)1/13779;=?BBF351/1(1/1335579;=?BF/3/31&13113579;=??C59//3551//1'13579;=?)55//1,1359;==-;1-3-/331'13133579;;551--1331+135799%7531331/1+13557/3553//1)1/135+57/3-31(1/133#35-3-51'1/153/35/1/1!35/-101 )7-331.1/ =<)<;;<;9:8I785)564 3              !  "  #  $  '   (   ) )    *   +  - .  / 0 112489;<==?^_`acddeejlmnoorrsuvvwyyzz{|}}~ڌ^^_`acddeejlmnoqqrrsuvvwwyz{{||}}~\^_`accddejlmnnoqqrssuuvwwyz{{||}~~󋌌[\^_`accdejlmnooqqrsuuvvwyyz{{|}~􆇇[\^_`aaccdejlmmnooqrssuvvwwyz{{|}~~򊋌Z[\^_``ccdejjlmmnnoqqrssuvvwyyzz{|}}~~͉Z[\^_``aacdeejjlmmnoqqrssuuvwwyzz{||}~~ƈXZ[\^__`aacdeejllmnnoqqrrsuvvwwyzz{|}}~~䇈WXZ[\^^_``acddejllmnoorsuvvwyyzz{|}}~VWXZ[\\^__`accdjjlmnnoqqrrsuvvwwyz{{||}~ÆUVWXZ[[\^^_`aaceejllmnnoqqrssuuvwwyz{{|{||}~ևSUVWXZ[\\^^_`aadeejlmmnooqqrsuuvvwyyz{{|}~SUVWXZZ[\\^_``deejllmmnooqrssuvvwwyz{{z{{|}~~SUVWXZZ[[\^_`aacdeejnnoqrrsuuvvwyzzyzz{|}}~~džSSUWXXZZ[[\_``a`aacdeejmmnoqqrrsuuvwyyzyyz{||}}~~RSUVWXXZ[\^_``accdeelmmnoqqrssuuvwwyyz{||}}~QRSUVWWXXZ[\^__`acddjllmnooqrrssuvwwyz{{||}}~PQRSUVVWXZ[\^^__`accdejjlmnnoqqrrsuuvvwwyz{{|}~NPQRSUUVVWXZ[\\^^_``accdeejlmmnooqqrsuuvvwwyz{{|}~~DŽMNPQRSSUUVWXZ[[\^^_`aacddeejlmmnnoqqrssuvvwyyzz{{||}~MNPQRSSUVWXZ[[\^^_``aacddejllnoqrrsuuvwwyzz{|}~~IMNPQRRSSUVWXZZ[\\^_``cdejjlmmnnoqrrsuvwwz{|}}~~؂IIMPQQRRSSUWXXZ[[\^^_``aacdeejjlmmnoqqrrsuuvwwyyz{||}}~~JIMNPQQRSUVWXXZZ[\^^__`aacdeejllmmnooqqrsuuvvwyyz{||}}~؀FJIMNPPQQRSUVWWXZZ[\\^^_``acddejjllmnooqrssuuvwwyz{{||}~~EFJIMNNPQRSUVVWWXZ[[\\^__`accdeejjlmmnnoqrrssuvvwyzz{{|}~DEFJIMMNNPQRSUUVWWXZZ[[\^^_`aacddeejlmmnoqqrrsuuvwyyzz{||}~CDEFJIIMMNPQRSSUVVWXZZ[\\^^_`aaccdeejllmnoqqrssuuvwyyz{|~CDEFJIIMNPQRSSUUVWXXZZ[\\^_``cdejjllmnooqqrssuvwwyz{|}@CDDFJIIMNPQRRSSUVWWX[[\^__`aaccdejjlmnoorsuvvwvwwyz{{|@CCDEJJIIMPQQRRSUVVWWZZ[\^^__`aacdeejjlmmnooqqrsuuvvwyyz{{|?BCBCEFFJIMNPQQRSUVVWXZZ[\^^_``aacddeejlmmnnoqqrsuuvuuvwyyzz{>@B@BDEFFJIMNPPQRSUUVWXXZ[\\^__``acddejllmmnooqrssusuuvwwyyz=?@?@CDDEFJIMNNPQRSSUVWWXZ[[\^^__`aaccdejjllmnnoqrrsrrsuvvwwy;>?>?BCDDEFJIMMNPQRRSUVVWXZZ[\\^^_`aacdeejjlmmnoqqrqrrsuuvvw;=>>@BCCDEFJIIMMNNPQRRUUVVWXZZ[[\^^_``acdeejllmmnoqqoqqrsuuvw:==>@BBCDEFJIIMNPQQSUUVWXX[\^__``acddeejllmnooqrssuuv89:;=>?@@BCDEFFIIMNPPQRRSSUVWWXXZ[\\^^_``acddejlmnnooqqrrssu89:;=>>?@BCDEFFJJIMNNPPQRRSUVVWXXZZ[\\^__`aacddejlmmnooqrs789:;==??@BCDEEFJJIMNNPQQRRSUUVWWXZZ[\\^^_`aaccddeejllmnnoqrs3789:;=>>?@BCDDEFFJIMMNPPQQRSUUVVWXXZ[[\^^_``aaccddejllmmnooqr23789::==>?@BCCDEEFJIIMNNPPQRRSUUVWWXZZ[[\^__``aaccdeejllmnoq323789:;;=>?@BBCDDEFJJIMMNNPQRRSSUVVWXXZ[[\^^__``aacdeejjlmmno3327889::;=>?@BCCDDEFJJIIMNNPQQRSSUVVWWXZZ[\^^__`aacddeejjllmmn0323788::;=>?@@BCCDEFFIMNPPQRRSSUVWWXXZ[\\^^__`accdeejlmn/032337789:;==>??@BCDEFFJIMMNNPQQRSUUWXZ[[\\^_``aaccdejjll//032337789:;==??@BCDEEFFJJIMMNPPQRRSUUVVWXZZ[[\\^^_``aacdeejjl//32233778:;;=>>?@BCDDEEFJJIMMNNPQRRSSUVVWXZZ[[\^^_``acdeejj../033223379::;==>?@BCDDEFFJIIMNNPQQRRSUUVWXXZZ[\\^__`acddee++./0033223899:;;=>?@BBCCDEEFJJIIMNPPQQRSSUVWWXXZ[[\^^_`accdd**+//0327889::;=>?@BBCDDEFFJIIMNNPPQRRSUVVWWXZZ[\\^_`aacc**+.//03237889::;>??@@BBCDDEEFJJIMNNPQQRRSUVVWXZZ[[\\^^_`aa*+.//03237899:;=>??@@BBCDEEFFJIMMNNPQQRSUUVWXZ[[\^_``a%&)**++//032337889:;;=>>?@BBCEEFJIIMPPQQRSUUSSUVWWXZZ[\\^__%&)**++.//022337889::==>?@@BBDDEFJJIIMMNPQQRRSUVVWWXZZ[\^^__$%&)**+../033232237889;==>?@@BCDDEFJJIJIIMNPPQQRRSUVVWWXXZ[\\^^##$%))**+.//0033233788:;;=>??@BCCDEFFJJIMNNPPQQRSUUVVWXZZ[[\ "#$%&&**+.//32337889::;=>>?@BBCDEEFFJJIMNNPQRSSUUVWXZZ[ "#$%%&))*+../03323778899:;==>?@@BCDDEEFFJIMMNMNNPQRRSRSSUVWWXZ "#$$%&&**++.//0332338899:;==??@@BCDDEFJIIMMNNPQRRQRRSUVVWX "#$%%&)**++.//03327889:;;>??@BCCBCDEEFFIMMNPQQRSSUVVX ""$$%&))**+.//0337889::;;=>??@@BCCDEFFJJIMMNPPQQRRSSUUV $$%%&))**+.//002337899:;;==>??@BBCDDEFFJIMNNPQQRSU##$$%&&)**+.//32237889::;;=>>?@@BCCDEEFJIMMNPPQRS𔖗斗㑔ˏ랟⏑➟ʎʌɉȇȆDŽDŽ枟Ƅ멬׆Ꙝ񡤤~嗙{~z{~z{~놇wz{~wwz~vwz{~၄svwz{~~rsvwz{{~򩬮ؾorsvwzz{{~󩬬ؽnorsvwwzz{~norsvwwz{~jnoosvwwz{~jnnorvvwwz~ꄆ󤦦gknknrssvwz{~넆ۡfjkjkorssvwz{~~쁄ܡcgjgjnoorsvwz{{~۞bfgfgknoorsvwzz{~瞟bcffjknnorsvwwzz{{~蜞_ccfjkknorsvwwz{~鬮[^_bcfgjjknorsswwz{~~Ť[^_bcffgjknorssvvwz{{~~ǯZ[^_bccggjknorrsvvwz{{~ƮWZ[^_bcffgjknoorssvwzz{~~ƬVWZ[^__ccfgjknnorrsvwwz{{~~ƩSVWZ[^_bbcfgjkknoorsvvwzz{{~ϧSSVZ[[^__bcfgjknnoorsvvwwz{{~ܗRSVWZ[[__bcfgjjknnorsswz{~~禧ORSVWWZZ[^_bccfggjknorssvwzz{{~ÞNORSVWWZZ[^_bccggjknorrssvvwzz{~~ʜNNOSVVWWZZ[_bbcffgjknoorrsvvwzz{{~㜞KKNRSSVVWWZ^__bccfgjknoorssvwwz{{~˙JJKORRSSVVW[^^_bbcfgjkknnorrsvvwwz{~~㗙GGJNOORRSSVZ[[^__bcfgjkknoorssvwwz{{~~̖FGJKNOORRSVWZ[[^__bfggjjkknoorrsvvwz{{~􌎎FGJKNOORRSVWZ[^^_bcfggjjkknorrssvwzz{{~?BCFGJJNNORSVWWZ[[^_bbcffgjkknrrsvwwz~~􆇉?BCFGJJKNNORVVWWZ[[^__ccfgjjkkoorsvvwwzz{~=?BCFGGJKKNRSSVSVVWZ[[^bccfgjjknoorsvvwvwwz{~~;;=?CCFGGJKNORRSSVWWZ[[_bbcfggjknnorssvvwz{{~~̉79;=?BBFFGJKNOOSSVWWZ[[^__bcffgjkknorrssvvwz{{~579;=??BCCFJKKNRSSVWZZ[[^^_bccfgjjknoorrssvwzz{z{{~3579;==?BBFGJJKOORSSVWW[[^^_bccggjjknoorsvwwzz{{~13579;=??BCFGJJKNNORSSVZ[[^_bbfggjknnknorrsswzz{~ʁ1355799==?BCCFFGJKNORSSWWZ[[^__bbcfggjjknnorssvvwzz{~~1135577==??BCCFGGJKNORRVWWZ[^^_bbccfggjkknoorssvwz{{~ц/113355;;==?BBCFFGJKNOOSVVWZ[[^__bbcffgjjknnorrsvwzz{~~ !"##"##%&''(++-0257:<>ACE !!"!""#%&&'((+-0257:<>AC !! !!"#%%&''(+-0257:<>A  !"#%%&&'((+-002577:<>A>  !"##&'(+-0257:<> !"#%&'(+-0257:<> !"##%&'(+-0257:< !!""#%&'(+-0257:< !"##%&''(+--0257: !"#%&'(+-0257 !!"#%%&'((+-025 !"#%&'(+-02 !"#%&'(+-0 !"#%&'(+-0 !"#%&'(+-  !"#%&'(+-   !"##%&'(+  !"#%&'(  !!"#%&'   !"#%&    !"#%     !"#%   !"#     !"#      !"     !                                                                                     "(*,4>?󑒓  򅆆~}~~}~|}}~~||}~~{|}~z{||}~yz{|}~wyz{||}}~~vwwyyzz{{||}}~~uvwyzz{{||}~uvwwyz{|}~suvwyyz{{|}~rsuvwwyyzz{|}~qrsuvvwyyz{|}~oqrsuuvvwwyz{|}~ noqqrssuvwyyzz{{|}~ noqrsuvwyz{|}~ lmmnnooqqrsuvvwwyyz{|}~lmnoqqrssuvwyz{|}~jjllmmnooqrsuuvwwyz{{|}~~eejllmnnoqrssuuvvwyz{|}~ddeejjlmmnoqrrsuuvwyyz{||}~cdeejllmnoqqrrssuvwyz{|}~accddeejjlmmnooqrsuvwyz{|}~~aaccddejjlmnoqrsuvwyz{|}~_``aacceejlmllmmnnooqqrsussuuvvwwyyz{|}_`acdeejlmnoqqrsuvwyz {|^__``aacddejjlmnoqrrsuvwyzy{\^^__``aaccddeejllmnoqrssuvwywy[\\^^__``acdejlmnoqrsuvwvZ[[\\^^_`acdeejejjllmmnoqqrqqrrsuvuZZ[[\\^_`acdedeejjllmnoqoqrsusXZZ[[\\^__`aacdeddejjlmmnoqooqrsrVWXZ[[\^_``accdejlmnoqoq rVWXZ[\^_`acdejlmnoqUVWWXZ[\^_`a``acdejlmno   ӿҿϼ     ០   񼑔 EGHIHHIHGECCA>>E+:2&+CEGHGHGECAA><<>+<7'!ACEGEGECA>><::72<2+ >ACEGCECA><::72:5&(>ACECECCA><::772A0 &>A>AA CA><:7527:�<>>A>A><:75227%#+<><> A><:7520(5"%":<:< ><:7:77520-'2"&7:7: <:7520-+&-"&5757 :7525220-+(%(##25 7520+(("##2525 7520-+('! "0 2520-+'&%"#!#-0020-+('%% - 020-+('&##+ -0-+('&#"!! ( +-+(&#"! !' (+('%#"!"& '('&#"! & '('&%##""!% &%&%##"#!  #%% &%#&%%##""! # %#%##""!! " #"! ! "!  !                                   !     #     # $%%-0 3x oX =+  |\ > + aM0 } ` 󔓓Q  { M )  e3󍌊l󌋊/􋊍 􊍌\ ~ 񌍌 񋌌N~}y򉊊wdzy}d{{2z{q~;}|~c }{zn8}{zwsq|ww|y; ~w}~ruwc ~}y|zqwd0~}|{uv{N ~}|{w}vqzn/ ~~|{zys{oosC!~}|zywsyjnj! }|{zwwvsroze*"|{zyzyvvsqlrm>#{zyywwvvwvuusqnevW#ywvuvussqnljj8$vwvususrroldjF$uvusrqoqomd`[*%srqoomlmld_[2&rqonmea[W'qoqoonm`jcZjX"'qonmlaodX`^3(onnmljjeedd_m[Xd?)   !שՌcJ !ռ ԑfJ +ϙzR ̽ ɗ  / ̼z C # şW!¤N  ¾5 ÿĿ Ŀ{ ƾȽĶ3V b[/b  R{ O n!5! F" f#/#[$s$G%V&'9'W(g),,,,,,,++++++*****))))(((')''&&&%%%$$###""!!     !!""#$$%$&'(()* .  / . / .  '"(# '""'# ('' '   "   " " # $  &' ) +$, .0 1348 # 8 ;= )//31.1- -71/1/ !3/1.1/ -1/1 -1.13 -373-3/31'1'5913-1(1-;71-/1'11993-1'11;71(1/531'1+51'1#71'1131//1311%-571/1311/73//1 1+331-11195-11#15311)711311)+/5773/73//15913-5//1331/11 #//-/33-/1331/11"+733/13311311#)1/5751--1511$13573-31711&#+35/-/311'!/73--/11)-773-3-15531-11+)5=1//13311,)773/-3-1311./1/-110'1751/111%/5513#-3114!-118-7;71//8#)/37/;)1/=) 2 3 1 0 10q-.-,*()((I&&#$)" ! )"#$&)')+,.0q 1I 3) 489)<= ""#$%%&))**+.//00323377899:;==>??@@BCCDDEFJJIIMNNPQR ""#$$%&&**++.//00323377899:;;=>>?@@BBCCDDEFJJIIMMNNPQ "##$$%&)**+.//0332337789::;;=>>?@@BCDEEFJJIMN ""##$%&)**+..//00322337899::;==>??@BCDDEFFJIM ##$%&)**++.//0322377889::;=>>??@BBCDDEEFFJJIIM #$%&)**+.//032233899:;==>?@BCCDDEFJI  "#$&&)**+..//0322377889::;;=>??@@CDDEFJ "#%%&))**++.//03322377899:;=>>?BCCDEEF "#$%%&)**+..//003323778899:;==>@@BBCCDDE "#$$%%&)**+..//3237889:;==?@BC  "##$%&&)**+.//0032237789:;;==>>??@@B  ""#$%%&))**+..//03322337789::;==>>??@  "##$%%&))**+./03237788;;=>>?@ "##$$%&))**+..//003223378899:;= ""#$$%%&))**+.//032237789::; #$%&&))*+.//03223378: ""#$%%&%&&)**+..//03322379 ""#$$%%&))**+.//02378 "##$$%%&)**+.//323  ""#$%&&))**+..//0332  ""#$$%&&)**./02% "##$%%&&))**+./0% ""#$%%&)*+./( #$%&*+& ""##$$&)*& "#$$%%&&))*/ #$%)- ""##$$%% "#$6 6 :6;9::/0/4/" 00 0       /L/1799;=??BCCFGJKNNRRSVWWZZ[^^_bccfggjjknnoorsvvwwz{{~//155799;==?BBFGJJKOORRSVWWZZ[^^_bbcffgjjkknnoorsvvwwzz{{~//3579;;==?BCFGJKNNORSSVWWZZ[^__bbcffgjjknorrsvvwz{1135799;;=?BCFGJKKNORRSVVWWZ[^^__bccfggjknoorssvwz3311/1135577;;=?BCFFJJKNNORRSVVWZZ[[^__bcffggjkknoorrssvvwwz1 1;=?BCFFGJJKNNOORSVVWW[^^_bccfgjknnoorsvw1 179;=BBCFFGJKKNOORRSVVWZZ[[^__bbcfggjjnoorsv1 1359;??BCCFGJJKNNOORSSVVWZZ[^^_bcffgknnorrs1 1/1359;=??BCFFGGJKKNORRSSVWZZ[[^^_bccfjjkknnoor1 1/1359;==??BCFFGGJKKNOOSSVVWZ[[^_bccgjkn1 1/13579;;=?BBCFFGGJKNNRRSVVWZZ[^_bbccffggjjk1 131135799;=??BCCFFGJKKNOORSSVVWWZZ[^__bccffggj1 153311379;;=??BCCFGGJJKKNORRSSVWZZ[[bbcffgj11579;;==?BCCFFJKKNORRSVVWWZ[[^^_bc1357799;==??BCCFGGJJKNNORRSVVWZZ[^__b11357;=?BBCCFGJJKNNOORSVVWWZ[_11/113799;=??B?BBCFGGJKKNNORSSVVWZ^11/15799;==??BCCFGGJJKNOORRVVWZ[113579;;==??BCFFGGJKNNOOSSVW 135799;=?BBCCFGGJKKOORSSV131/113557755799;==?BBCFFGGKKNNOORRV1%1579;;=??BBCCFFGJJKKNNR1%1357799;=??BCGJKN(1357;=?BFGJ&1/113799;;==BCFG&1/1579;==??BBCCG1/1357;=?C1-1/135799;;==?1%131-/1379;=613557613571:1361/;1-//91/:1/131:13/113/-/1351/1/133131/10131/-113531/-1/1+/131/--/41%-15531/-/1351/1)1597511301'+/3553101#/775101 +33557531/3351/ 1/--/5 !%+/357331/31/131/--//11-!%//135531/- /1/--//135!'+/11 31331//5535#%')+-/1135331/1/-+)'%#/L =I;9q5)4 0I+I'q!)IqޣqI)/LRSSUUVVWWXZ[\\^_`acdejljjlmQRSUVVWWXXZ[\^_`acdej ljPPQQRRSUVWXZ[[\^^__``acdejee jeNNPPQQRSUVWXZ[\^_`acdc dMNPPQRRSUVWWXXZZ[\^_`a`aacacIIMMNNPQQRSSUVWWXZ[[\^`a_ca`_JIIMMNNPPQRSUVWXZ[\^ _`_^\FJJIIMMNNPQRSUVWXZ[ \^\\[ZEEFFJJIMMNPQRSUVWXZ[ZXDDEEFFJIMNPQRSUVWXZXZXWBCCDDEEFFJIIMNPPQRSSUVWXWXWV@BBCCDDEEFFJJIMNPQRSUVUVUUS@BCDEEFFJJIMNPQRSURSUSRRQ=>?@CDDEFFJIMMIMMNP QRQPQQP=>?BCDEFJIMN PQPNMJ;;=>>?@BCDEJIM NPNMIJC9::;;==>?@BCDEFJI MIJIJFEE@8899::=>?@BCDCCDEF JFEJFEDDCCB778899;=>?@BCD EDCEDCB@??3789:;=>?@BC DCB@?>=;::922377877899:;==>??@B CB@>=;987700332233789;=> ?B@?B@??>;99>=2/288"//03323779:; =?>=?>==;98;83399*+..//03237789 :;:;:99:97373/02+*++..//032378 9:99878723.33.*+./03237 873220/..**+./032 3733230//*.&)*+./0 30/.+**)$"$%&)*+./+*)&%# "#$$%%&&)*+./.+**./%%)&"  "##$$%%&)*+*&)**&$"*&"  "#$%&)*)&$%$# $  "#$%%&%$$#" " "#$"    ""     "%'",$# /3 ~~ {{~~ z{~~wwzz{{~vwwzz{{~~ svvwwzz{{~ rrssvvwzz{~oorrssvwz{~knnoorrssvwwz{~~jkknnoorrssvvwz{~jknorrssvvwz{~cfgjnoorssvwzzwzz{~ ~~cfgknorsvwz{ ~~{zvbbcffgjknorvwz {~{zwvn^__bbccfgjknorsvw zwvwvsrrj[[^^__cfgjknonnors vsrvsroonnkZZ[[^^bcfgjkno ronronkjggWZ[^_bcfgjkn onkjgfcb__^VVWZZ[ZZ[^^_bccfggjk nkjfcb^[ZZRRSSVVWWZ[^bcf gkjgkjggfb^^fcVOV[[9OORSSVWZZ^_b cgfcgfccb^[b[SS^^F'JKKNNOORSVWZZ[^ _b_b_^^_^ZWZSORVJ!GJJKKNNORSVWZ[ ^_^^[Z[ZVSKSWK3GJKNORSVWZ [ZWVVRNKKF/FGJKNORSV WZWWVSROONGFK5BCFGJKNOR SRNKJGFC=93=?BCFGJKNONJGCB?;719;==??BBCFGJKNKJGFFGKN??CB9) 79;;==??BCFGJGBCGGFB=9FB9/# 579;=?BCFCB=?=;73=3# 133579;=??B?==;9533579#13579;=97577551/+) 135795531597/!1/1313133531/1-'311/13113/1131/5+1/11/-/-/35577--/3573/17531//13/%131135751//133/)!1311355//113355)1313551+%!1/11/--551+!"1-/331-)%#%1+/351+%'53-/191',-//11=;73/+'%/531-+%331-)%#!q;::8763 2) 0) .),ޣ+)q'&#I I"I)%I'q, qI/I3I)mledcaacXR^S)jedca`__dRWR"*eddca`_^\\[XW.+ca`__\[ZXXUS8,ca`^^\ZXWVVRB,_``__^\^ZX[XRRWB-^\[ZW^^WSSND.ZXWVV\XPRU=/XWVUSWSIFQJ#0WVSRQRNMMB)1VUUSQPNEMRE&2RQPNIJDJB)3QPNMJFEIC*4JFNPF@?F$5PD@CC?&6NI=;B:&7B?=@= 8=;>8#9>;3:8.;. ))9*K+[,󗔔k!,k)-􏎉{o-.􌉇~c3/􉇆wsv;0{zzkC1󇆆~{rzrB2~{wvovkC3~{zvsrwnF4vs{~sjgs=5~ojnngB6{wcbk_B7kgcjc78cbf[;9fbS-:[K';K+ )+,-,-/0 1 2 3 4 56789:;q; pp88 Background     \ )9IYiy )9IYiy )9IYiy )9IYiypp88pgsphere-1.5.1/doc/img/sbox.jpg000066400000000000000000000121151461140101500163220ustar00rootroot00000000000000JFIFHHoCreated with The GIMP CREATOR: XV Version 3.10a Rev: 12/29/94 (PNG patch 1.2) Quality = 75, Smoothing = 0 C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"D!1AQa"2q#BRb$3STrs&4ct0!1AQq"a2BRS ?袊(+$H^FTE,P( G`W`1S&Kʡ>lh:EVluMWSg6izcn# {p|L\iMf{E"6+tVٔ =6oWݜ ]J[+jGPh(( ((R~ζho륈n? c}yyޛ].ٯnw_dti仹!f 3$ n|g>'H;U+8p$wf{PK*wcGa~@P2$OD9y8MgFH`UuxX($}0 pEZΜ1 Kxhq1I8RtkK[(fc2۲ OuKZ+A}vr;s 4hӵZxgUc QnrdsN憒 uěG&b8'> *JlܕiP7[rh[:2\[]Wvy&5v=ݼUgFH3%  j|Z c $ ?A= Pv>\s6}Y$da#>F~xl܄q{k>ǂiQqmOCsP*)U]43]!8R6#šQ@QJ5U4m&[d!C;(\k0\:(?wx AmJ)` tؼ77c&9ܚc댎KWؤqng+NM:y'AbD[N]xzN53ySʢJ{CTn5ٜhHݿ*Fki61Eafy~v!~*#kZrF/8)ub:d 8,tQEV۫.ijc0?UVK]Bk˗OҔS<&!dXݲEHHtG[Tr̦͎AxV3ߌ+qp6I+wVW8Gv|N@z,m*7e0s Þr9Zb<ֹaT++7q/ P:{%wvڿOb'Oyn<e/_ڻ+;ML6&]IoEF7Zr ^NF#jɽe(]n{@u`Qn}Glr>X}Xkb^QK;E$ߴMIx.8&.1ܮۄtN=}'hk,nH*ބ!W9ͻJ]YD^\E-bݕā 8f'-V>j8JY5\{ꇷixHTDiUIi.ҺLarU?G_s1:O"QKwT}O?;!55yF&A#Pf/tE#l%5F{xl%9"nyqLr VJOtgSs {\\!1ɏħ*}*K.B SxБ$X}XYx5z7eD~{P#X3ڑ^68Y?C].Ge˗"!#eAڼ/IrZժq&J510Yvt\2-܆BJ`gؑ*FV \$Kx6E0K}Q}MU*qW%SױaV:9ա?v{4?585TCkezueէRE)0ĉ/Pqʦr $SP__Y V v#a"`ҥiG($TAT`uPf ei2!u#W#>;sswQ%`naxzXFOkZ-OE[B&b$x~ s#;r'lZJq}6gF}01G*vcZe){EUln}X<3ç}L<#ԒhΩMӛMnZ؀lMǤ>Pw>{t5'LLť c}F>x⦦CV0ƱăUF[紹3}PdO }פ 6#]Hn%0|&RWm#U;wx42`@I<3'OB,+2ݨA]rNCnA>T7F1cR^'x }M9<P$\pF#ҫzN0C1 bys>3Ocb ɚ4rIUhuUJ2Z`/]32Vaimֲ'YH׭jYӒMo`c0I:yKbt H^sxnAwm6d?ŸJ5B 6^FX`;FgW5CKQ }8"%(`=Mte]lE}ٝXwrݰF.UgwkхDGt8|%(90+Nq D'E.y?nҎ!|>&Ixypfc o, A }V& A62\!~7 vMΟ j167ٚ)"IchPȃPs)t=RLL Xg s(jݫiGLk׎@lZvm0,H߼*Pٹ+壺yTcUohR!cš^ 1žV瞔ϴdTn"%1哶}h>'V&k5["؜gjHHPp8@T-wM AZsI&;>Rבe)(e9dT5G펍gam ޠmP|3QfQ&6WrI ŠwA8TeZ Y"{3?i,BMF8ACnQFp6]kݠi ӛMVvTrn.$ֿIsp̥'8 mvۇ:9e$_>lMDoBh[q|88\d€q9yr:/f,rszm2NE<3ԭ7NҭV("c'dd j i1Mqā!NaI?ta )JܦV3N#Fwcշ}sw&YIp '4Qi%}]w>|9$8 lQ ܈x(~UF[(pA}<ϸtݼ+om(TPPQ@.}fŭn7G0EfڍΕt12|HkTWmn\r@eZyI-#&3/Ov+;{((>hzs*g!$z0>xxQ1@N!~B2\*7]DkHZf3X֤q܎pF'+?V5xPWbqtGPCa NgF;X" +{U% @xg|\^9ay!c$~U81Xx>9ղғ&oa̒go+Qq4_}LKk8p;cT=SRCEGNPQd;wiMAX"2c <TwwWz<řIsqL[nf6񷠹y!U* :WȢ(*(t (((RFȊXdvPd3h"НͻOUfPdf{}O LnRH\} \' WxEe >t?;wq,xFBAɌchil{En(8 P**\^7 Mp|-!-Sj2,GrNтP@W{ -Zy?9/EQEEPpgsphere-1.5.1/doc/img/scircle.jpg000066400000000000000000000115221461140101500167740ustar00rootroot00000000000000JFIFHHC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"B!1AQaq"2#3BRbrSs$&4Tc+!1QaA#2q" ?QEQEEȑ!yQd@eEV.:a{%Dxc5Zo= Xl}޴բܹ2.IugJrYR.D3DdžoxcTa\i. )3,=KVȺ+lK<7]N[#*GItQEQEEPQ@QU.kkvVܴQ7K7CEe6U^un[ A"WMzk<_R{9HJxaIU=yg5veӺ3v6[EGLw~PpT{.}(i-uKL'k+O@:l&ECIӰ#{X%u ׋Iވm:鉄I^%n#G1\ۯ&ߒi%^i-ם.n]G1r;~4Gmxbx;7S#ou#km? G}*Qu # k&rTm0+Jc6KlK0xv{WwpMA4V8$0ҍ*>E@$ێe5MQ2727HO5DU(cbW$d1O\v(*˳.ijc0lUKݝF{˗AOҔީyScosllxɌHHtG[$b\sSg˅X}f}Zi5"qJ3#;wsgCek ڄ)Uzf[n\B}庬h]m ):r4x"e.lnr9_1ؼ G-f [qI:?5L.+1;F0KS[:Eβ6omHWnjAi("x Z{xﭷݴb$(a9,Wom219Iӯl]`({z1ATeh-:_i-E_Iy4EwnQ?{o'5Q8˝iMav=;6Q7)<Lr FJOtgSsT < Mė|fluLrc)J˩쐂pT=I>tր\a>,|Jø|Wh< q{ovXOu1"9Lu㍎O{齞nǫ&&9}Re=ZHƉr" 3wc-=ی=18!V(ڪZP e@I6<zTPl @XU tR;{JN9 u]Jkufl R6jwU]eY(`I٪,J\YgWGU=N\:oXZ] 27wӋ1<ܶ1qx|~hpյ\9a>U\GA@^ѧ?Qn.g_\xf^Ru #:DCýύk`/t [7̤%Oo&(ni s }9cْK\ٷ\quǾk;jEslk-l}6cwv;~Ftncq8h5'۳'~Vron T.!6i B;P8$S⒪:',=W4 kO'=z?O Hip'1έ,vG%6FGȵT:jm5 *;{i'` $vߥ*Y so.ĪۉRǎ+4ZOߡ۾U:PmKo)un붺g@eVے>ɾȒxøu xUV}#VdXNO3Xk)lw#C9Eu{ʼrثUmZ]ZZ.%?rыmR}vB.=ݜ*6nFŸ U z ԞXwn܁wg +x(#H]Q@ʚe=W.ro[t5T`lD#f I o07U Me,/÷ ,3O D';x^i$h6A-ޡ22H!oe#(&&K1‡jRxLp^tv@i]c^ӂr{>Z{fgX(#NiWGHz ={5 tL>jՈb8lo!OjXK"GYHA(?0l,'գR-!>XN|3-v|:I[̶2urm>0ss M@%K+HFd\QR dac#₪DM.J!(:ƌnzSgLYhu*| WeqbF&$}z["ѢXoYoe%yօ!@Εo71#l]ާd𩋮ZuS0>u_EMb~o~pıDFT`[T$]jw$a暍Εtɴ1E _ں/{}bӪ)"UQ(MH h12r9JĠךwݬ1vZhrAߌ &()D# ڀND<*Dvv-hkFgdo7LK{{۸V %B|,8zOwIqu 3vIۼg|\^aw!cH JN;k\OՇ2KCi:BL?)}\S!s7y) !Y{}:MAF7(fv#6Dd6y=xSz=ыMb̍$%\cw N((pgsphere-1.5.1/doc/img/sellipse.jpg000066400000000000000000000113741461140101500171750ustar00rootroot00000000000000JFIFHHC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"A!1AQa"2q#3BRbr$Scs&4T+1Q!q"23Ab ?QEQEEȑ!yQd@eE(nY4VBBg5]~U Y`L{D{ݎnL0em|vC~HR}%nV=(vղ.26O-g5>Srp㊬( tQEQEEPQ@QU.kkvmnZ(륋qS~"]*ݯnw_[ AIKk:lBOD os]GjYg.8c{>"iktٞTʝXeoA>]Dڃꒀ<i{ⴈ 6qkD,Z֦t``ג[#EˁϟX"^ SۘOHokOdʲ,a0;;Xm!Gd44Xwc$ |xV;Mwى*51;7-v̌j0U]8|ijI}owo6{rp3xd#;  *zPumI ]Aͭt^Gq~?g*e `lT28j?}԰!2'#Ȋ=5>FYǪlG87P )}oi,M RA&qn##L(( (6-rBHw(\[0\2rP~D 5k+ԤJ 7T. f/#y4riZ2;,I_rAܳ@?IeͳVux'Aj E$lGj봠px8#žFUpUZ:q> @yFcP4]KI+ 7Kmcŏ&b'z:`܄lm#O?ϳ_@F}-4;ZH߭#SȎ`n#@ 2<),Nee9ZHPfG3lLL LR(Cqr9mrڂF눛e{H/{5 ɧ;kL#G17'p"{o}p_8NPP0@x]C)H#qɢ\[Pͥ1NC%s%<::Mi4iqqH#;[+ҀJ6Z5\s(yzmzwa 쑸 Ԛ@~VࣰQ\>8@Xho.̺9r]n3^\d }OvlŤOg9666 &ǎTDq%|~F%5<6|U@,gխlF^';QRjw37Rۇzِ{ 3OVBڃ"/5[D '%bx*M:}mZF<G2i<uˬ}q][&08*91:NE"yWxc m"Imd|*o'5Q8˝#iMav=;6Q7)x#ַ1-u)=әOS(67\i!1ɏ*m* .DzB S|hH|a}%XYxxޭ1EG$bE,rH,zR` O#K#mi#%HL. ΀kٌn0s<|4u="٦W Jw:Uwct/nBHKcGX4}CWo_ .y Pժb٧ae zwod:~k:և66ȕ"7'kI}KDs` ;m5++t HQ [+Ӯ.:)I4MiylPro؞\V'Z1ݮg,=@M G$6AYno+H?48@" yW]>ͯ5qHKg`G*[kv@xr8 ܣў;܍0AjтO mz孀LyN㻑:df--3OU5*!5$*0:g5D7 ;~`$Lw#IFNa3jMG%2wwx4FA ds<2l AȮ\˴Vkv,|P 㻘qCԟn8̞5곖P$\x#qq N 0χʀkڶ/ٛq{dg~ `f)myWR,>+iĝԞ.gs*Q*M<T2V~߶Vaimֲ'-Kl;I@ W<+gNK6us$ B0㊲k(ƩNt5:5u1KlebqML ᘃm H^sxnP6>$W6d?ҟ0*Inkʗ` sh/d\]퍁#>$n53YfZ$8ϣD4#WyMV4 kqI6D @?Jk횜&P+ziþw{-7cZMSXmse$`pW@)%W} " 4 ( I|XHǫ>IOvپi㷅Fi)=Y]#$XoX>  ֶڄs|8PCjOɟ8fyt 4Sr|>Y53%lӚUR=.z8Ύ:ɈnN=b};uc.s%܊K !cT$SVmʻ򭉦E+K!e{nԐ|u}qtZY{^~b7Яgf$'v𭵴pQ@pQ@QEWmߴ=a暍Εtɴ1E Hu_ŧu6RE!㨠96 69~%!A5CYceL$&3X(hI~6r Aض6ow#}?h b[°Da*a >}j%7 U#']8GΘ%?G@ZRqֵɫ[s$68ydaKpLKk8p;cP {އ4ςg*=tnQݦGRj ^d ğMf//4x#26-rmȪ@ (*(g@QEQEEPKG"+ aGگ`դ3"Нb'ÚftPB׬ ɍIˏ앮X!6&$^'csn.27˸lqmv^G֖\HvgW!<;#xSKkLp`op0H^0,6Ӂ{9gˁg*e `lT2sWR.BeNG{k}&<Jumz‰QKE{IbhnUb3%#b9m})QEE^ՓF%82lR}~ {GI-h.:(?~Q^HѨqԡ꾣p3olcr 5&$5DU(cW$d1Okb4x8%𝳾͞ 6ߛR5-4.>ڹ$;aE?mhOj$:UqH5~ځYKW#G+m.^̑GSqYZ66Y ?V8! #bA{쿓GO෰-et#T,Jq Vj5=ZqN *ϝeGw,cŸK W[Np̆9$eHFvZP e@I8=}}*z[jĶ):]m ˒$xry5vzkc6onxʐlo>yhQmlN{ ^(&8%19W+)ކ'ils7ğU/.~QaԮKaO+0;.*Q$ >b&W#FԊk/ZOIv2l2tګhA=K׭MΞF daݑl~9VΞ^sЖOiƷ#ts"!a gZ;X4K&8N̤%OF=nѽ,P \\8FF)̗Zͻ=\JK+cľ(bĐ55;e[{A rp8H~&?GhF0~Ƭr3^k`鰷I~|jN#%Kl@ w |'MJ(Hac )N3isQ<'|X&a25܎I&Y9l ޛRh-u}6?-Qws@d\\@I<3'OB,̻Efwj.l`\铐O#wshvqX#@s|J]|_w.ay} rIUhuUJU2ZǶ8_@Xz#-tDVR>Ū4z3Dtg[9 @+#x-ԟZƞf8dm ^sxnRwm6w2qOUe%:t[[ėUc7O,"< [$'5mn+[٣܍pn|+sQƐ;W]Q }IpEKqQ@ҥ$IJS[:kIs5؉aFA3/jI캅x_1pSSo`<T7Ոb9loBjXK"GYH؃P~9aY:R-!?\645 evi}Zvşҹ-I[IaJR9Yr$\cr [3\=[M7g}Se u@zL\8Jש?[ǚh/f\؜g& U &%2·6VAo @=qy2o.SPUvn]2[[%7q,Ab#<'E z}]wJҍ^jPzқuonNVE`F6'aÍ^gbr}o9qDj5Ηsw|"XpDdd <2R@dyWVΕ[Iq_\(kh- X,ClNNv؊;IӦL]K WY8G n5kTle|?r+ˣDBŞ.}<1!C~"G.m;XqF|<|MLW tP[H籍Zk$ s O# m^ }sw&YIp,O Ri.2KtEߺ@yxV-kFd2 '?!ϙTknУM>*(U(( jMbַ#r"=iON%qW^oZwSe$]~$?DUs3?;[ֶ>7_2<:_c5oO*'hx/ .0Up\4{-:)aYU^Ko!@ GOpTñڥˬGrN侀…(@W]'~ +\]o>G%TQ@QEQEpgsphere-1.5.1/doc/img/smoc.png000066400000000000000000001764561461140101500163370ustar00rootroot00000000000000PNG  IHDRxHgAMA a cHRMz&u0`:pQ<bKGD pHYs  tIME  7IDATxw$W}.UFmUB$ &pkl5`sm0BUfvvfvrN=9Tu- bl}>O?zfG=Uu{~PJ_z_!B/DAPקK! ?)N$EmؔӦ0OR %_o JA) C~M SdYa_aEmD0 ڶ[ɸr@Rj`P`Da(mSOo6|igZc `^'L2mFe1g,)d;dPتu xwٰ)e~7=]Ays~0xO[z!t1.+iC岫*_NEgv5`QlhǔW00C7Ѳhqoo%3EV)s~4 RرΖ$kSjd;!`V(Hǰa =[ȭZN531Wkf&N%om?G袶J Öx^WDgOfzi6C~y$%Eۅ[]5_{UfAK /\Mi &Ck6JK8,NF̉1͖/P*9Y[]F\e+ \ s9k }yU-0ftBը=6"LN2G tc/s\_-̄]?m3' 8UUqaGp][$o!g0e'8<<ݲ9tz-iGfR;8Gc뜪 ̈́$ƎYL'[eoMT`iff?zؔy!3h~% z!EpMj 2a.oQ*d/me9o}stdRd_541wwP:t!kR*:4עf)`P/r=cTh2 Ҟb45^M0 Nեx"^ڲP#t"\4YjJg1uuY(1ӅPPY#Uty뫜jM&Sg- ҲL +޳9\d2#Wf궶my=lMl eN,N%.yY/_#NxS O @yV$ǦW/ ϤV^SYl''ϐE/9%emmÈ6ikW631}|A,{ߧ}? c MAJفpF>[1$Vl^.2-5^i8!dzi5SMU95-@NJb.!79")h4 9,$29dV=s5Cͅʀ0wjޮ}2GZBCp,'g9e1OcSi͚a3%3ܞ}|&f=1+kq~ϻӣR=uilRy鼾&,lpk .#c`NAv9yvauZ=diAf|C(`98zpBK(Fm?KBVrm TCd 7ɬr{FdSE`v=9+X?kZC%Wff1=W-dV^8*e^$S,/6PWg{Ž0G^;~A朶m?bTHP[HvbI8#I,a"Z}-*E ,.Fk x9ic5{]mM (æ?]ɲ0[)g*S۠<=6zKG?|#$ׇRS<'+uꜶr)<#By%qTHx'7o4y7 7af#VG[Z xe\).ikJ[OqϿQTV`VN.TM ?/jS?76)3^o W(Q5+[VF֖FX]4Us$XYb )r[QBY C%ʼnz^q*WEN3jbF8\;K8Mʓ#N"[P,/ QHetfݽ❷(͢ѣ]p5>@P=^XqGz?$NszXZؽcz u4~̀g89":`IXZeԸi}[tf2{.s4"SQɄwݶY ِlwNOسQî_~]m)~rFYO5 xB{0x=3UݿEjIrP R!ů'>7lWoo8hJΣH"~yHgec `fάme"W"ds[drF&֖R46ѥ%RYSm̈..QLS[bit56Uܗ۶ۊ/q Cm«&Q7bjL$[ Ji@ 1O,-2,~3C=3% 5ğ!a3}|}@䣧 jK>pO?,޼ۈ 7+`uw,y|Ӻ㏒C/| {{&W嗤{:]w,,{U"69!9vY߱5q^T VZ>'Bs0-/[of "/| DEKv0 -&e W#]{<^ LRr )a Hz"tx v<^[II.]b `& tJ=+X]!;:řYՒɬzQh͘ܛYris%Enʓ˳yZpuld]LK|ժ.|dG-/'eeH !meWtk6, !:;ÉJ~["DŲYʪ+.80>;wFgkuZUgy ﻻŽm2 y}YIlvmE~Q 4%93nrp N A6өIFq&ǽ[2xF{;9>l XVty 4B* Z[LMWX( /}rmH.11(>I׷uVg jG,ʲ$'zMs}QXL}\tlҩlݶ.nP8 U*xZdtt2,clL.͈󛭭$a/\qzn=B"A- ~y[RkJy%%G@Q(`i !dQ48|vlRkA$o,I50 ݶ,T1p`G%~^O3IXNJ}◙vM2D"D_pI-&|wU5TT !oKX+I.-$ &Wz}me5Fʙ&%SS岵aEvc! dgNF%Ü۶ A[DNa-%UB2dmt53]w͛}[ZG4ܲxj,`X6eYrBind$ w͓d6sI5X*n_Kˍ@uA(E2p 6)=J g=rcfc~H2~e+.OQ$DfZ'Zի ar'zOIvI&Cފp<#P]ɓ!yuLgf*e ^\y(E8.LI|=Mk8xss$ PGFFzZnjgeH͢`u>9fFniZ-7ct0&&p nӱQQjR]">HIލh~?~r !bUQۺDL4s SJwNLs#ԡ/eAG!ehn&hnːE&̺#c-G[GJEJ: UE z71z.Sna= 7>NY2a͡HSIIT'buu+* F}ê\x]e~4ϰ{)v97D47 ie$B4?s)O:kHU%DP*lxcG)Oggjش ˈD Aƍ(p~Y[k!F8 ]Gy9BAsp,n9a88ySShNVT[58{ DM HNKO  ͦ+)\*=6tPyNe|Tb?|-/}HrxTT8J1= uZ@. %+B1gL~񋤺Q܇۵Je I"p:1?46@@'VMi!/0MTT@iX]6n$,G]n}EƯ\%#9F['OfV vǜ3:H;#MM0wISu )>O+RJm²?̡'{dLb w!sp:-o6&׵{±cqaxp:q:fbeAi͍`Y8H16)<*JZCS#19LAUrZvVE5<XXZBc#~׊SJ''%C[RۻhTؽ^$ ͂l얓#_kg2ŷ@/~`&(!_y8 >[[MO1a ""BN(:ـ[- Pl# (ia~};+4"48ǵkش w܁f,QyQ$ 8X[+n![6c|7t&FYJ tw:<1kK3 onQ5O|^2>iBtaE\\/00;GPL\ ʩ3S`ty'W~=rrk5x<0>s簸l}W,(!Ҷ={ALod<ݼݘ4 zLǤ#TM#ARYL}}F11!<ND8 IּNtJ9f@w7QTWcعU3l l܈;@gQ$r渎ʤؽ6ZWGɬ)O&W^兂dTU!# $y81˴wbN,u_ugXirK(Cїd=X%K[[t ؼ." L#y%^b NHh0rp]XAi6CĺKiX4# {{A45!C>O&2lq: ":::T &p<؁ڎm%c ҮS*M=fUD00LQWO"J@{[n' dX[uusϫK¦-(1lۆ[nhoG<5ES&cJvA*::@"*jV.(R|QscF~ Kׯӂ&έW~vj{]TU*Xz1[~~V8}o^:w5 Jȁ|UUطDW 3 !|<(fvPU6-\Ot:O:$8"n7( ݍZ55EC]^V]XY(bm y$-H%Xg<ǩ3v8-[wYF" #+l1 X#l&K]N25 & -Gmyv%6h[tE `dM甶lCEvLzXnhO]`QllymS!93wUܭHzׇp!x HE+DQ6`ZQ]y:馽4 ZLp:S Ph+P\HI AEU< r)$E( Zɤ, @sLmӌŎz/S&CCD҂X 51RzTlkfbNtWKӧɆ-2Ѳ[UZt~ͩ ~CC86o夋߰EGPSz̠A8{QT\ثVht9qSSwa`m q$#r&U_B4 Y]Zǎa|n7n<*NKS"۶RL(+P!u|͹fvBvX6z;7OmC b1繣ml Cy96l(eX^ˮMI2dU ݥ@X 8I.=50W-yͲ 04@H(à" 1hgYAp:q$6ofьP,.2{ėQtsXjffeupDY)RN}^i(/mcqE#(WCᬂ,$*ޝ,cd]oCzkl袦IXn֧ͯH*%~`f2<9KX]@lkd~|3A$xI<}]r&M=KN: T' 寐92$l44Pd#6Br[%<kzcgA4moxrbrzTW[:if̘䌜4/nZK7&ƖxW%= y5< NϝaRvFziB::s޾=߰j*$eS!Yzh4=dPqiЇP$X G Jg7$R}m 0 pm̾]ϫV62t|PȩdIZX&II6\&rԔϓ|N氰v} bd~tsIQ# sz$d.?6aE8lotbw(+;2㤼>\4VaD̼1fn(8ɦ[זlq濥_.jb9/4>uX_*r+&&6o.sM@jagOS,yVۍ\zY]ˉY3Vb[e;'zD07OAk,uCxcfąD 7{[:^\Hg5kTHk"/Z( AEz >{P_K+"Bctr5)T2 92[3tP [G՘ &tښflE7`aZ,lPmݴlmnڍ/b#2ܤC$ftP#ip86b!YI C!EueeBe%,U5Y0{:ݲak%ݮU~V*V??<)ر• w>~hlFfvCQַbn߆ߏ@mmlj?qqs ^;.tHjEeEBKj+US-pMZyȔTJ.] hk6 Dxov_Fq*yy, p HCl$$|Rȧ݊!y\*UIDY ٩:\B$RPB*[aٰX##{DbK!+H<#,.pA  N,pGUp6D"G(I B!hI ej^^C,+2/_k} 5`?1l8;;lk07;"`oMMĵ/^;NQQ|n7VVPS8h&\EPQu;>A]1=νN!T&R^Λ&fauzase[n0}Y4m4#/΋nK+ Q&y[9mg{ ,ݳ(ttl6m00@WFJD*Ob~KKXYA?z{QYd@$@.ǚKƧPVZ҅9s# :PX{55JgtKTVNM@LֹQX`Y@o`rq>uEݷ+dY!"kI5R"l:Qw*mP8( 7,qHIK ytS7Tq-Eqrp0:FF@iK#*jrZYt^25Emv6F7)o*~l0;/ ي}^@6n֭he}ea'XAgO_?"!v XZBG{1: wlr9eqb0x?|_nۍhĄƲY #H$J/ "%"ZJ{7@gb~<ЀjL|=qù@(._Fy94ǏӲr(i:2:t,vߝBfae<$p:؈m 9Ĭ& >KϦ--޽@ 'O7ZVmEv\.GC=l -6DOg &QÁ9¶1;|--lFd+feBZ[ߊ <VVshlD0o|zJn8}~v[[a[?S*}1Ƛ?~W*.'G]f&uZ|EA3U&ׇY<r945Dg'Z`rtnBEk+VW!CQ( FODD"o⧘VVՕI$<6IJq H&"BQ 4dK3ߣgϐe"Ο|K9rJ'??-O̧\v+ICMOE-0k;~?ƓOpX*uͻ<+L͡4}سհm s$@++x4{򄦒ǑJa`Y:X33Hap8~Wn]]ҙ4rf& , YFmm^z$!cD-uk/} ^o깶`_Y$G(F\d++غEveטgZ02Gu5GݻIov|nz߱/e#--|W᯳;wsgQP"_ƺv|xaJcy%?I5e똙iB `Y81tt{{;ۺ`E]80>O ǡ|\,A"A65j)P|6Ŝ2#P荬}Iia0Mtw(!++taZ4.^z^ܺ Diغl~Y_8wBx6?ˉ*ǂ_\}lh.| ]і?`c.?&+(hnM7Q.d>Bdn*d}Ng `>#ӉY44`e9|>twbNccuRX] LN"h*Y &a eq=hlσ㰴D7Ct]]d|BvIԈx΢6o.ſ8ND \ꚒO*T , ee(+CUv젆Iy.}kvϞSdf.s2d.)7IiS>*~)?a[a/<<3pʝ8Eׇ6ݱ!g8g޴)K$0 HgqL> ض X\@eCt O)ΞE,1,.֢ ,z!Jv414Kʁ?t_Pŵy>o gbvuvII._X{50( f0 (d$Az<r .mڎMH0JTS9lڄp>_B'}]"^@:}Xwމ-[07WU\`CCX_#)n9LL (!bf  8Atw5̒`t#)+A28i23KS ~|1-.15Crg[K ŧ<3ϐ} ߏ HIJM$Df&.P+" Cီ 7CUQfKF!"\.hiAc#~z$ B& p_G4dZjS'p J,i`Y\b^S=|`܉) 8|~?Ù3(+ `ؼy"TQ]Mjki[+ٿt˥7nډ <_*y˟;EǡC BjfO2o?]ԲF_ѧ, pض /ߙˮ_Dl!{r'ܘ`y ?02$z QD$o|tȹJo`YTWvBC" >ϣGo/9wnw_%Zۡi E.e|{FKD-[aV:1Nz$nq"uI,,簺ALFWv{9z A4Kx%c[ZuٻD=y,ĨVEqNO?Iv{xը"9=_44 ӲlF2Áhk0ZVV0=k)_c=؄fTW+ZEKbeai \.P^TN 3DӰv( K/H&HDZw/28tn,dr$b8w>LO#Ek+NիXY0<VV s=ەF";9È-DF.[ގE}8 CUE+\3;p@V.4(% Gcњ L8uxj"£rX/5'6c|2? <HO?t1U֠ .W)pDk(`yziIuX\D?QX\.ؼw4|xA0 pqmS|"B(h==$9zRG?]'N'**멉LsUdki& &&dhlדaX!EXp:j (CCH&1; W G gĊJlBߏD55AQ()JUԠ !a#QdUuMS4%x &&05 DPWPD/ pbyZQe|YYueeÀÁP7[!TVhl1n<>z4HtQ& 300#؁HiKK:xWA( UE,B!-od==x(pɠ?`ħ?@>d( E)E2hoe84 isnd@ uup8.]C ˂!Ʈ]rX\@UYOs kV}! Ud^Mt>1&#NUh[eGZ ,mع܂.ըdiH U hKyD͸%z)(frв|jdquu>HdB>+"t6ap+[3`fزeЍD}XhWɂH0`PU_Wz63ɷ7>} EH23g'Pnߎ) ׮!F !ٳhk#G<,=)7']w-uS/S^1mxP^$+hk/7;>I\r~;ۑBՅ 2X"q^HDVnk d&~^(/+k|gNxzO(srv5Z[R~Itvd"烦aeH&B{Djq*XUbA+(EAHDq|mڈTd t MgEɠ hoEA&gJk)ؓoQfm)Wga^("BW##NjJ$2HXVig!!&UUÅ H02vPU,-al ˘Ӊx,x,-Am -يL**aYH$ppm"4iul(;:PY剸~*)/3ׯc@>UX]-OQbqZY.d 7bww awI=~* B2.Ӫ2en?!]]_Dy9Suu]#?/ЪR5IJ A6bSTP81U~`=bNM)%EbDSp@ULGG10@nիp:}{Y旗cm,VsN92Bݍw FqBP^/5" ,/U44۷}{K- bEe3R|Mgc.MZ[QO!+uue µk^yǎA18T Dϣ6T3KSX_#CDma^ؤ~;MCU֍ŀ#D+`^ւ8$Ehh8qP(>ȏVF%IgW a[Ŧ}z0 x‹/A"˫y9(B!,,e҂; ^/8N'>BUaXZ>By9Fٜ1H>RQ9s'ŋ/@sV&WF9+{;vpnWS#MUH(/w#n WN7A]f;wAc?a#l;[[;~I$ ?%Ex>>{#|b!(֐͢~?B(,ӕ"uK~lFniWu2=MΝåK!lL]] .ae-9uB@()H$J |Vc,ty0P^N 9=;J> [uȃe iY[V*\sS5ndM++\f' ߏd!CtҐ_2$[Cϲme Q # +nɛ5|DK{,zi QP^CUJO>RJbn*t۵y2]v=l5G-bnq x"ij /b|4t"s=[q0qX\=xy q]t (\.:8pEZ[~{&RYJڠL{\BmTTBU A[+^wzZش [`rG>*A6[r5 ouz߯<ճ; @v󾷒TS).dT#3 fSK8K~휇' و7p8sDhkG($u\"|Cs߾x#as X^zLOC7b,}˞(?jF, ,qZ0x;:A p8P]X& C(b,/.!A.˗QQ\B!8@Οb1NcRX,/[uCX^ Pֆ{gFXMA񛿉 xel!<(X==hhe*tt$EDgxDmKU]} ]`kyѡtoh9p6#@OA{;y]I_;NHWJI2._FES|^dU'O  <YWD_s#?%jFQY T'&:Zff#{o\mYMdDAd./cFƫ9-µA$Rׯ-K,$/Rٺ*2 ۣcsɍODk+hzz-6'Dm] ѬnQbKx%[AAe8e"hChg? M>?Qݐ9->7IL |3K/o6=]P~"%};4yJ/N? U]H _PieeE|sŐJAUy3 .^ȒQ#ރ$'{6OnhF_$!1wR M+~QUdK%33#}#"c$˸:ZZH(DIX\c!{w}|PjՌkJjfjn5WWmɛxjfʠ.{nR6SZVS5S3O p ԰XDVyE$]G`by!PxS!T"(hdC'IjY0 %v#`d{`?m{2N/,] BgGP=trG;N:5eG1<] / Fq=ۦC_XB_^ybچv sQ<""n"5w(W|a갱m/j(+Ed U\q4Nc&\K>DWm)\4n7"PxP_J16habnkMmf8B S`A@Ʌt!#W.;'[ioebٴ(,KbR (E]z1:Z* a;RxK qQ 9Xtv;qز,ġяHmn*˅)%+*|y񬲺PC{OyZ(28DEKrYP>wK6,x+eؼ8b !hjcؽ[ b94M"jj0};]%[MmOY^஍dnsJ?C$o=K5vf?+vZH<7Fxcc% Ye!L XZBU%Rim M> w݅^9'y }{`qyIyD$k,FbqY*SR\jjr\V#WI[wJ5/,RyK-،PV5rerl.<]r4$ glGon@b~>_Ubz tDs'YP9<^|ܦv6K,S*\.vvB0;P[髯I SL0L!rK, #1A,0&Fp%K2J5T(%G"vQW}CN;Bmtbv*yReI}=뱼^mC]>ql/_%y!fHp<pe,$UW?8xHS#9q\Njj oO+t=Pm@Aҭ!cݣKٮFu5<6v1|V諈â+ _!;'+{EثE)s.>IH嵙wC2t{@6nD:QY Q͘i~xcX]/ x gpmo#đ8|^>cXtpkT04~!iUԍ7U$gzD;ߍ}נ9ng%6-[>=HPW^@؈'gFFN$܉3g oq<"aDذ /ʕׇ;`zqDxv~ԄaغE1Kز 5F/%®]C] /`j4ַ+2z.fYo*WQ7(!_4&]~N-!No6`FХ%Rx{SabvC0>U?O{7~., Gy9v@$UYB `y;7y1>F*+Q[{s'aqvyCi<,zz>0ʼ߳,A{; 9a}#G0:q@fe_h6M9p*˒o{[#.J ؆_Lހb~դYSyE~- z czJ5"͜㰸1; [3S`.d2P:JLMafز݈DJWB0xi47Ty[ضۍT øp}}8|]b:Ӊl ty3W9[EҍkޣhInΓ`>eAE9Ӣ55$-Ul%.]®]ph*ikjy MH"җRgJuuh p G4P۰ZaY\W^2Žρ[q0YS9QöQ]˗p]<#fWWT`Y%-n$\f{{B{$Aߏv- z#ìj+?+._~Rqݺ CU[Ǿf_4:`9Dϑ|%&G?r9>ݻK"4_ȸA< \.8Pקm`(+"qD"E&I4%26U>c!p ae$Àۍ&֢<'D4 Jim-9| PBtӉ ض ÃOG^zыn8fݍEY/JdUZ˙4(?= ocOzst./x::,2UbZF5HpSKdh,kKKIdػI"yz a}s}/|ssxq=+cJJfJ@cZ1:4DNOCq=RwѼ<. :vh}! Alg`e .^ i8 xFIؐRώ}"'Oaa!mCvm]ۢij4N8g"D$ؐ+._096eͷPM%Cɶ=)Aa <$&t|pٳث?; PuyB~t#яO= l؀D\v D6@Q04sb8}\NA)6سee75[E>  `v}~ mPj .Y } O> Y⥗PS 5?\6z Ud L2t8w<n܀ۍ-[ e҅l]24b6$~>C; #{ڀ|㨨@E|M1ߡM|AUdBe d*w^ZZPY Ea떌Q MDE'rApjβB"Q|ݝY|IHP۹ 0M\HxO4<HN'd[`vn#JM69 JEjTVbr˸&cyZ,,= xI+ЃQr?|\kqM-8wރ 8v 0QxvyVN rmm?sXTS[e-ReR:v3 y,.@UXQdTfZ*?;CT [ЋI(E\8/ff&.Y=H&#d҂p:`վ!c *161,NZW%y'l!~qC!xU iͧRbmLM);^rhh@*Ir?/Ǐ#]#C.n/hA:w‘qsv2:Fduuط{@Uq v$cqrt͵7;l o.Bkqux8q}']]dm U%79:y0lC3,.FC4q6pھYAo/RvvDg'pVV`%1jLN(Cױi9^As3RsEcZk2tظW.N0U-#dvx=?}$el^ vr9H\.ȧNAC0?wvnV$&1oFQY6`m qLg΀\Z_%?9,ΟDܶ tbC)2jjPA}K2VH ÈRFU emXp0hsyc7{&bqYl݊pR W%8s55 ^{ ׮pUi.!x3c,tԺ&!j(ߚ`f++v ?(Qhpmؼ^/ <"Ps 7`|_%g{qݻlق>OuuMmyx8{` s>CԶd9(!w33`Y`q ^/z hj7ʲg9D>ɎX^"ׇ2(^i:ֆKH`h .$ --xJXH$pZZy3jjp:t$0%ILTV^ aLO7~ X]Ŷm`ْɚƍB&DSb8B)ibӦҙLxZ;{c _QQkAJP9p-:!$o$N*V3=+PUlقEA*D|A@suc*+VccT ^!O;$N aLu% NMC*Jeeٲ^HNɓ ذEhRͽ9+o=E`V,ٳ^^5T%88zp+H"0ס(֭`ݥ#6 jfGEli-2RU[(/G]r$s:p*ilۆwx98n+B(,PSW"*v*`YX[we1; MÕ+0MFm#w 4n}+ٲ AiI̶7Bp8W.3[q ²!6QjrI)i=4JHI[D`5Ȑ94]^&[bdd A6KN?@etp<$g~|:GuYSB\J^- U$(Qȋ ұ)o xU C7CvJkhnF(Dy]uB>ǥZMFK%'? Bt45b~Ċ{8rho,Lrw :=L./sxn?PS3gt#q1ǁeqR`uJ9|ӈq4 BU%NZ:8H;3',GެFvKC@q8NxHPtRػ;v(E<kS~dPٱ "tߓL駱g tѕE-6EN雧*z'!d6;X9ճ^0-,,&&M7Xcd[dI>6?pb8/_Koq=vC`9(X]<tz w cJB6z\4!<υ"+ɚkQ# 39PNtua}:MYF$Kb%/* wtP淪E^-gkxF c8 txTX 嘙,# KlW=p \.44[Vl,YZ^@s3VWP[KHшy} bax_|*Wj(JmΪ&Ir/S',Ӄ/I, 45n7`YX_G4`7ZLvC ?2Y& #'2tU hk#}xn[ʕRmeX$SYRJ×768Ih*P'Ur``$,( (E0HWVB8aظrZ,hґ)MM5.Maa M.q2H1AYZZp8[mPTæ"]6l,o5u=4<ø|0q:\.;l)˗r;33P`i%Ȁ=Ae%8tv,J(xO|}R]ٱG汩SP߅aYp.(N45R+(/G6 ,A0XL"[nF MMY}=J8B R:4PI"#*76,TRnZ`KL`iU0lݰ 2κ:@g`Dس2̏Q"?b&rvVX,gB if^5/X WuR[`Yp8x@HnkFo/-$3f '5-H',T SSظB2P.!`.K(ǓlWM?E}5,hl؀E00P"<|OyD|'Nܬ<6LLI Lp8N!`yͻ2G<ͤAsL# L8BnrZ!#\-wIde1r2C 3_rY{f>4kVshyDYSZUeE{ jXM3p ׯ#(ePp"T Ic{Q]i9MO9(g "1{]}^w0Nd$4Ҍf$MιsWuUU3E};Ҷ6сy,>xKD?upXvthb"IiFۿC S I'M:Gg`I6TרNu =7Ds2B.N!΢|1ZX4"1R3Ddc89 $,BGjő/5RC+˖a.twO֩뽣tut/(īZLNPtft$9yee&!/w܁cQ^ Gnoڻ02M++H<A@e%IbA162F!'AM"%G{J<.mzZSYJ!* tO3)+˅::BN[l ъjD[W^a^}p`93{9TUcJed86.$iLLn%(G0HUtc~\x/`,ml$۹[>, DPSϋ6npXHKȐ!*`Tk}55@]ɔK ejJ(qd jk~=8==n TS ƾqA︍pv/B@)=՞X86ӠEN M͆fbDCΜ1zfȎ()AN/CfSY>$eTU@E8fL. 'Ů$Hht b%Cb(* BQN 1xRߊRC͝mf Zn,[v$;}Ǐc:D-A)EdW{9Ki*'Hr`=l8+`_I9!Ŝ( yWolGuj\8tmmğ5jxJK>YѣףO;pF4FN"z,*QZ+V!@_23tU">* LbrC0af"aASQUЉqG)KP]Kf0—`j@̓ߏ;p-Ek) ՅϣN'=dgcp$9yz{QR,rӃLX C2PN\EV^ƤT}jrfbZV&5*fADH=c>Mo~wC2?3(59,''14Haڅ矇χ;ڵh0JJWmo:0 LLiN]-K"7 ŖŋrD(-E~>B!lۆhyMt7=g%7I_zrE1t9OBSnWbc!Ē%zl܈,&GMi)qs8q]K&I%5ťHشɼm۰k# ' ֆRaNNfqE+*K/LoXJ4 56(Q9X3sĶ6ZYIVp:!hl(Nĺ:2R)tt 'I Q{:]'`PzqѰ|tCc$?q/Ik2C3:9 4&3a=r[=ɘ:t =z䗿ۍcr_ df1 ]]Xۯ!M~js0ԅzc= i6 T!"0⩘w0 t[Êut/Guj5鐑<,[1SZ4zAX}h,.Gmmu,XU=[o_f\MJylIt _xFC[ n aϫP?49d~?4 ŗz1 NqRY y&/o Q4% pX|ΰpBچlq`t]eo`f;TA[-%6+3Sᆲfg7߄ۅvXL56hIxeuh@j#Z[q$AWEggLc%czIDATjRr?4 EE0> 5PUmhy]phǎ2yp ZHx@[jZR^hnƁ,XnQݰ99tp;wǡDZs'HBqZ^{ X JJeEB306kEILK&3lʕife +jt99uSUj.T],Cz0MδD|:9!2@Yɑ72IX,(,MCn.X<>j~)kֹ(+C}=qb>9uVx<&\3NNՙp'dkÛo^WZEtwmDSD =!( Bv6s_]l4Pi^$iA/cdD½zeЮ7A{^)WZbڊ)*7dE/*aא q^yC 7#=gkI.?8 ݆SÛo"=6AQqDQB8 L,X-[u+ꐗj~+0 G4ʞh!3=tnlZZڊk1r1Fx'Dc9 TMoZlJ"ql+WŦIiehl@*uNFZج;#q8κuQ4M#cYh*"cJ&:DV2|olr7AYѐb=untr(|p{!?nmya|q h2-__B?ȼ|bevhcaQa j3}ДWcb8PdvtB@@F)RZwv&)C!0D{|[eF EqXzz4]WϤDG4FuLOဦa*Ss٘ƞ=QW)$˃{[?QZJd Jp1:N\oBTcwnں?&[_|{7h:[J\bJKq  6(Ocz*Dr, )(ҥ@}-pL?$QD#r_*g"ihkCYY02]pI5qрr٥4>~9y:;h?x0?PhTdhIv0 bqL^_4kfq]UL]=GM7gt,)u]i눬_mϽ"RHD[[Nz:Hf:d MÙ3f֦?998v bP" "-$CW`z`8`=H&LBgdJJ04dVg4 f_F٨]SI1o|BHN.9uZ(b8Mn֯g>Sؼp `Jh/G[\.ID#^B[ jxYTG&cN':!"th*rV8qKur Z"مq`bRk' @?@pbEd3EgPc*U(/V97E_ L%Ѝ]GJJLjK],|f6b Ʀ)xUdnKqT ]8OF,3?S7p%ZMarTT`DHӎP$3 GO)]hjJi) ;w`l GX8x>nSP?uũS3kF (a29IQR 3XMM'-A"4bx $aFlڄ&47SKrկbFc`y==ȀyoG~>vFs3xwXIv}gk-fRluwp.NVxR  :cv8eR%X ^/pv1C%wq VrDbh!tje8,Cs.Db0FT\, Xf\ c8 AS_,? jQwBiAo-]tx=sk0 [Q{ ֙t:l˶mfCАIY!$bصX 7 Gy?܊QUY0 en3`jj~=nH Y-šdC.[F MU+ץ~=LtQOZ{}&KW?4&>/ٶ j(Dx _`K_jR8,!KvXQURB)}M ݻ 4(t:0)M9Lw:7lt.㲖4܄0-U\ /4 CHI޸@:m]rI^o~HZq(};vNτN:wBx[k6hw̥h]9!`wuM'akzf{7gF^k䩒2GI XAd x/h~ CjȶȓMp:KW~: &m 7'|*Z]:1V,J|s0&  dfY.,,^CU6md@uL0CZ{]hrBKes @"a2Qスx~?lڃ!#$eq9-a,3Tu͠dD\feؘ <*ZXQ[򢥚NTt]a4Ԣuu5$Bb+VP6fM 5y"21=ŋr~FN闿T AL4&}KC >Sfq^>i6\.TTa )Co= c>"lDHNx<˰lU+ W-h~#m^g_V[VѴGJtuao[M𶦁ւ\@>#tn-K[S*Ӵ.q+ACIe(9Q%.e}܌o~e倀??q5d Jn]w  $ ?xd?8l܈:lJ|PĞk9Ƹ\H,qERS w4ƜBX&%| {-ceϟ^)(N*Xׯfd"oTUVI㜻;oGAh<pd>#'0pjwcS4. cn(q}t9ddka>M1+֑ӧ=i~tt`b^ozL'+.O<̟Ç1>o67w["QJLx,G4#uMis^|3x?疞TI"Q\>19ۛL@a 4djKɀ'6ZԺ;ᶢ0rsy.T\'c`ϲkn<\x9? >85UmC ~=3$ tw݅ᆱ-P1Nph?09#G/"/> x]ddÒhStpaBBnOSSL4&&6 7 *!˅~aJq;wb,X,_ۉ2<<'Z JHi4JK((^}7yi$=%KeQ_-[p0JJ`~,^ۡ˃cs\)a)qz]@|.896 /P2:5k(^-jv.%ۋRsK$ \ҺD fC18xccĨw{35ϛZ Gi)]cBQ~`<sU; BQ2#D֒sޚ{JaC?&&@.ݡ;D͆o}Tn̛ccW0>G~>:K^}~=Gy%r}8}JYX]]tZӟ/3郴VgFU#VWѶVzj)o/FM*٠*?|OEz{ϜǛp8xkM,Ͳe8}Na~,X`VvsUjldTc_ظMpTNr,Hb0ß'NF=]sX xɌ!֠ kaHz;4í32`PEaͥ i²xmGTr”fԀ_gݎ*dd'rnJ S4JfjTS.Nj.y cf\Bu).A"IUŸ械7VIJeDP[ӧMHXV܂m ϓ4!PUt|dT|;I"Izh)+#%먫PULLfòeFSz{QRa@OtfC8UL"岌ރ$;{^(a/˄BYZvEM e5)!#+4'^G9quu٠(g\.j~;55D 3 j2,mEA8qp<&cbV@>͚CS$j ~U#{v‘`z(/!pO W&Cug'jjv6 (.FQ~;:Rp`xʕ^bK7&% 7 ]dzϢJy3q99qHpftUػmmX}}B_TΜWh}_0gc0$IRMD$c T]A9'$0LcYB(sH.qFxYG"ł: PTez;5J[7:~,eYaBg͘dƠBW.{)ՊHg(/eL?zRò$"rx$DzO%KI<33av9cLJfm+"iBf 1Fٺu9ɵal< N/08h7n7{قASfCF$ _>q,]jRyO"'W&oFWox1^nPU3*ۇ`NI3:!xq\Er݈D٫V+nP\Á ܼTFM?cn,#re8fΛD O1)\^dgYNN&vX8H԰2G.:y7 QA 3WG{{˘ThjO?=fSD>f|% t]c/6(V+NDq1¥.$6B) Ӫ:E ˂RbhBM&wNj a oG/`" wQ"F>T ĢPRrF11nBu5nyy0%x&{QRb6;> ݍ=FӜ Od!),4A6y8V_6LMvO0:\s5-(.FG>ql؀c0oJK‹k^{'?!8~|SXp.qNdKpt%Q$zE7uP,ݚcf8!ג&kWklƒE$NF=eQsM$ Ov#/^}+._3#ACD)s)3v)=5N,3 jjkaĤ(7SgM8 C!DN9)Crsj+ 4x[ yLզ& av?!'cߏR!3Η2|c&#'~̛3*dn 6~ !'`Y݋W_Eg'`hm51GgΠ)X0qob|( Fڊf,X$=3~pH? ??rrjyUſLɬfJhͩg)Mb:hJS%k39Y)Uȸ'b,$/:@Yϥv9ۛ= eLԩcX KGGAu>X䗓׻ryp/7K]ѣ޽X Y e6_ ~aM x C,ƍ(*BK 4j3W~yB((@,fRyHYKjRV4;!>0ϔΧ0+P{Xs s1,aI5LL,OŌl.]:bQ|+AiE\u`!3X$t801Ax}dC#+'N`6@W6m-୷p`eY@`2C1<'@(l] 9_O Es^8JɔPPܒHZthu\#~^ee(/BD1SRu)f e.k+jz}&uB{QPpd&Ģ UWT*C Ndf=Nj>Db00.Fi`蒏F!I`y.~?%-cT-%krJS(9VV;/2f7o2m3󐕍+f5L.^P$5Lޢ[9.8mSQ@VXc#Jәs"eՑ(n7[Ԡ CH& #QXhrBN$ð+:DlϪ*"ำ>yt&3U NX"Ca5-e''/9wri0v0ƾ^p;/)T4 N%&rH5 oX|gB7 ESz;?<\.y@,1%F ^r$$%Vd҈̎#䈘v94YIєJLN'"r(zjX^z#9ITidfBeY2Ӊ4u "&҈j&2E4M*Y Vfp{-rqPp`m~hYHώa8US8N(&'?+_1.ar !:ը +*W:ʱ<=jF>!F{ dzWo$_2a{i¼yx5\ E`pY؄F"Do_yX/""ǰ:e-\Q!4]SuUUjFs39s^X[u|Ȁc檫8_f-$@|\!(b|1GٌlcY*UWSj%u' 2p ag<"/烬Щ)cΙw:ǃDu5|>hYGm*)S̩Z8I2 ,$,̳ ]fg#'2< >LZO s3i /0SjkPS) Q]jBg >֬4T ]M 9q1e%K#\}5,EgyEm is[C^Nbh#淾O=e/!p528㆔H unP2hĒt(q,xC1.?9Se;;TlQioZ>v+ZʡŗfFׅluaLWR(-E:5{Gq wStM)MIhXdvF"kh 5NQhu]3Z9YFp!(9Y6HU |HqgSP X$z{3s4:3P)5E/#0?cp?1 ҨRUQez]KɡCg"Lw+&8TyU:cBLȅZMi:(K骬'pfh2 t{!ȭ6S2X d_:jkj|ioJUuQ̹ oIq>IeϻBbVx5_x,ò`ѩS]k:d]MxlL J%4 CM73TJ)u*JPXzmP92TV KXVdC12o>de:@9ccR.n|"Y0Ӌy^g5gXvOb9=f.zf~\u &' /uf4"(/uסҁ~z̟QxKVt`By$Eцz &jqUN1ڞZO )@#9mIQM$!€!$p,o3^QhJ27fR8>BRpىXVVA ʾ'|h gT-4>p 3gqPK3((͒^0RJU<=`Hl/q OY%<4@q"Fg10z r>q8sx!2ɚ5(* .D.MQ k'j,sM9rrN  FieIQzn*1ᵥի[˯b\0P[L֮}8⩧02\wvăb"z>Gf&PcoJHo/ Y]g_: "8VP} ,XhXNe&6֬ۘK!x]bwJu oq)fJIE+.f]|89NN^ˊ /#]4:m aMmDHy]jT0>&bۍ1c?J{EYl&&'ԅeEHOGZEHϳdd[vthi5&ش%\um#=ȳe,EWnU!uh:9=ʾx_?|~9ӮΫ=D-1`ش ho…0=|N'ΜAE~Y&MMXt-ITVb43KXyyd^iBq *+q_s5I<+}gӏs~(tpX~B_xjNVpzѓɱ;nJwdzC uNjh>c\{<3A6@$a]N^y 9@LU\,qa4F'k0߄^~` ldL* Dw梫kvE@@)hF~eV+R* "Нq?QDV; !z1!ڵ&ࠩjw@NFtͨxSdJv ݝ»۵+4kK+ ߭/[fUtpRMJDfjf ox͘N'LM \>4|X,χ{QP>67srJAi\.S!7j*(6Fb1̛g*-\j?IBp$p8-$gKMMx1^)z=oꪄ6Kʲc~әQiOf4gG44ϒ͉4$|8 Df;w~N_x%֦âc2 13ZK;JՅJx=dg;p8!Ip};(,nχ.TWcx@Uy3qyc^,_qp4 @dgt?DCl3ش Baԡq^" 52є`C}7 ͇U|@uG/`y5|H_Ԙu 1 2KXDTQȺuxI,ZtlGl}*ͣ(5?Zt1 N6?p >1ȷҋDp0.IJg $.2r^s0 C8SҜ,2w͜AP?MOe,ϑ'z{D'|R!O|Yg3qUz p8ԄRPVSLLIRۇ&45!#v=kTuUd%9Bvĉx]h}556,+ x-"- 3&:;a,xvF;1)(nmm$H*5kb^hyp!}d(sk,uxS2 !T/moaF(PdAyƲ=ldb20H"gPWYJB&FR&b>3#E81T̙8'[N <!p4nڅ믿)D-@SG2pii(+{g;\)!(\dX=sS{G?`|nAE\zr%Rѐhnv@T/|X*0*s'xi,]{ݎ6^|8~ULEpMD $oCG~{cl 8qt|8Wx_n̍!NJH$pxOWP[M P?D~>@01Kx2ԣM{!+w[lGNbj~GWe̛^Hد|a'<%-MM"@ש(B2kBN%&'8z#²hm7'=70?ڠgY/2 LQ^Xt6t?.!Lfvrisny@DAe5JN*bNZ|ZIa)E/Q鶄b|DWĂy";AlXOc8ް>~20LvՊ QݟAeNę4%ނvhkC ),^G42&7 Bn'( &&p(+#Gi~ \؁\櫩 [bF".Ľ< I"/_oT %Jw2: 'qض p]]Pdl  omű&urc7+EcxPףH:D #HW]L-m;[Ɇ_øF22/L@xuJKJI &FUu݌,gϳK瑟o6\( IB @/+jdUNw'qeʰ۩("ɑ-ZCg濓e ߟ'E!=ۚ]ã>\,_'0:"Q?7h{:EB0/HtLQUE8:;a(˱pYEgY8X 4~c\ŸL2|@z:z{0oAUr%A =Y#s(N x) ?B؈;|9zzl)SF:bt?oi 綸GcwƵo344\.mQWOmV€C$j hN6.aR>PXv 6A@"f7cncu]>$v 08Եz G""}V,_M;<ө0V:eY"8@H$`kU!I"]pYId`"'-ZF!I>$eYA"'0}w24)_{BHmzNÖfcE,\zomJrÇIz'Da!jjֆ#G@)hYkAxVDu>A)ٳ$ZSSز.eV)Eo/Esٿl 716fҿűիͥ u߾KOX08q99L@276(kH|'."ĒQħ+Y#/Bhe%yw@AQq t)DB]4?>} 4|4: 88JW翠Jϖ-)TTFVF-%pTIJ<0LP_{]N\s5i!('D^,~?n˗M?"uk LLjEq1HA@CTt~t׼{7B!x=9֤SkzSRUo_b˥` v oXqlz(ࠑ)+e翔xXS4$}oHsЍצ}.o)%s!\n>;a{odFG D`]]SLe5 z{x1Mˡ!CvבH`,ؽ n7֬!%L&TOf0 C"ڙ\dZ |X9 ~#,Z,g(@Uů~E/"-gB_>HIs!ۗxx6(?+hlχGE(*#3Ko94lniKf3;vҒ$wmK.];d$ESU5SLH]=ٶj%H$6/`:×T ~?y4ԃy3zp6 RPHq|sP5,&b)n>UL1ZI2$pm]ĵr9f:op@U!BN^#>;gCc0:p'[cJnV^ ]*G6 17dx̙L(`YBuPS1idJIl܄bu26Ƿ, .Y>7Bi:M% aSu Z @Tqz$Jl6 $v;zzj P5w}KJ*+HJ&j2%xBM繋 Ƭo) U( 4;{vt$x5஻Bk .q|0 [b_s[ėTW^"%G~>|>|kӉw1fnv*_brZ`'NЌ 20$\~!yEB aXTR%>X%cӲ˪,^dԜ T顠ƳZIvtlt|ZYIO4Cɸz:7 SC_,52(;D ;)G_\I&Y6yb~sծ۬\g-'˼%bE KHՊm"j,_jH)k$V )^+w[`l jwG;=7~v?}6J G;c]tA6M:65UUH05EQY\y%D5&.ENs[.TXk$[FgsZMcM>ͼ5ĉt$xie/Pvw*>KxQ9LIIPUon(0 K[M,D,"+ K2 }4;( ֭#<,V+Rd!80 %=Y/?(0>NtH=[ LL+_C~\.( 0o֮C!gͩ'UD^lق4Z[G+In^}YaE9H`(A=7ӦjsV_gyX ^;%)ߎl7DG -:YHNK,{%b9ikcJ/ [B="+h:ݟ"EH$h0H|yJyN'\4BPQb:oDzePUdfS:2KO8x4~s_5yRY_iD8^8okC]s011WaՌt(|sX(s]a4:)+e 2 $?rȵi 0D94+XD(<,;{v\ ih:~38}. UU!C?n8/vS:e4K/>'.¤q?˗#5F㾩, ' X.=KWO: HS$J%[{,ϾhIЄtEB)']8xD+}\"ź=wȑä CpةI%"V!?'? —\*ƐO~!=6< B鉩1[x().'O>?W XRBU?WnH.*2)*Bu|y ɪnԤt8`0aZcyq9SS6ahs 7lLJq#;n#ٌn[ &\$QXHy9+A@⩘dך]m8sK"4/6 7 될!~V+C ]} (r۰\t_&-ZqU3w \Ġ9tk֠36Y2&&_[(ǑH`np# D[ n'?ǂFGq(/ $OhI8tNDh9Aqb8zuuho=`|=uPWKcQ:`j<7ւeH99(/As3VYKJri͆}pczo5V+rrPU@'N੧с5k¿|~$ށl|c$!wyKJqmiٺ㏑:Ci(DX5p [ `rp8.'0Zݍ}HJO [kjQٯ`.ԕ $+<).c~7 S1o7:P,#'>bsuvω.Bp0C}-#o%ɃW'cW5͘Z?}27]۽=?zO2hoa 3:~_WMeAdgɤ YjkC< Eoc|'NKwS24Ŗ>-όMPdg$6WEDAf  bl!xUTU?OքECneeΆ"A,\}5YWb_ٷV\D>Gzv?t'Ÿ3Q7d S9Ri.ѼavH'둎S`EXhjϣ²F)+&^{j쟹_Cy9z ~?z ^/*++@סZRM@8u W\2&VDzEn*~ *'ɧ>}/}}7e< Swݚi.?Dt jCϿN)}_8 0~lhkWrj#%]h2jAAz (+ɓX_ q# @`crjl Bt9,GK/㐙 ]]`Y\` ^/Q47Ϸ2kCC$,YwAU,=(,#Bm-Y {n6 )*Ǎ~ddF?a̟*АjkCCXd" ˜#ln֭ꟸcj2O~e eVb b}9Qq{⧃$@~>:qR'N"'LpDZgz{1>`H$RIU|ڇ:N'wcZ؁,Zۑ*U$04& l6RhiAQۑLbz=4 #7~?x7'ԻF&>չiա.[{Q> Ʃ|Y˒GGspZTk7ӉnǃNddA^^| aG]vAw7"z ),RFG,BMI C]֐,QPGOwW\Np`a x<p!N441z+jju;11dSY {z|9q0xDPUvQBs3DMu(COMIRO~:nq>0`BXH!8_VSϥ4]5?نM`jjhPF&&cJ*cjZVf2G~q bd7iqxIEAY$ H`>jj. gyUűjVa4 $ļyWpmr1|V]aR~q2']露V599ٴg7\{;0"u3/\$FI88ZZPWg"oSk~,Z^hi<46bD / f#mF 8f3%[GF` )bJ))`t}6usXN ocJ1aZ,][/~)CIe5DA޹-Iv"ދn=Y>󒕷Du62T]=68x%VQO=eXԱ#rrAS HE<(9aT2a)'G)!p0.ES̓$4_ci^X YYtL|˯'嵪"~]H-=MQEPхT3՗_Ufe0NZNi;g{^}lJ\bYrn%.RS~g8x==X<2vUEg'23܌m]{RqzxX[@],(+WEEDWǃ!hk!RId zz&Μd3KH"X Vu+E߀dm /6nWD=V[MhaeՖ˩$Ou*2,<7+f)?ei*8db22iK q3?ƚl6=Rҝ5q>8HZa=nPM;W{o! }eHy"Xg|ŋ&n.p47kȞ;L !]('X}xJ)T,DU*-zӭ+J>8 $&1+QG8h;!vQCNTJ ~ {-&1cjE$L+r Fy9FOBU\.RSIg |5,N47l3ǃ 3/"˨ߏ'ݴ4D0J!a|##RY?E8<8ބNv( 2>X^ΔV} ʋ}-k hJ,t&6$gl'M,.8$amZ^F>)*W4xO[lSZai g66cbjИz6*9ӘaUNY eZ Q pbB!$(* п>oOɣn#G06ՅUwC裘Dz:08Q#3e$#02vrNOvdanzY99CɉٻWTt[0nyg duk^:QSXV+9֌CB7^tݰH!$5p8C_?r0&ã0冪W_-1{4{ڵX KaٚФm%ed| d!֓ay+~`?@g>o?Z ,VO6eGHz:IO|n^Ax6J:>j.v²rRKDP49+*UUM8Ituk}ÉTҶpyuw5_-*HE多HH@,jAچK%m8p:l; JtNqvѩiE۞I,d4yWVTO{i}]8GDE6 о>xb: Yh}ZfXjiRkDO{`8WM>*Yi2XP5nfKDfOqz-S{r7hmƸ1 PSzai[e *=j4($? ``p5abTaVAyNє(bFGHB㉔ h0(*2(%&/EP'+jKVO-緈‡]0LD\uuQwΟG04mr,Z%8xw#O@lYC|>*a)[z-($?:&&'wQUftݷHP<-g*re|U{d$ 5ϕnW-Pf:9pBXX\+(4Cdg᭷ߏB`o@?QYD(_F@XcBccm7߄GBx3&G$8ŮN ʕX5T]D3v&q*v/I,Q酧yt{j9JŐ7(f"q gXUBdԲruI+1˰d*YfI,DO>I*+|9x{fKWLBa͚6UDŗ7fTh]a xE# XiyIfe]/_lE#?hj"X+kh,^#n7ZZHY9s&.-8 qt=`),Yim_orŲ%Z>IKyErX^idR:yF:%p8Y4b3oH !"Ao/)("NJXPRbtt--dp9=ռC򏿍a=_aU Ck}ᣄZu5?w j.5 %%t~? x1I2I aN urE J=%At̴W;(85nj)dh--Dp^ 2S 6!(mv4z җQ'ʧԹu>d YPfh%cL3n_] e8]khu3 ͧ׃:P7߄@k+^Ce2:Si֬;)<7tMO1:=%6P*KFp 4 ]GE9*15 ZO@DLjAe%tǕ}[Q_ 'N ݆FKxaw/a9e 7/h+^'.E6!R]͔j_B=v-s tX_z$'ii8p jk0ydea"Y|LO!Jm$ ya \ pxFIq؁R 60u:[{ر##p:1=ӧ !IPdP0<6{a@njPѩ/f8>׫wߋN8@嵞Ni{;Q<5܂3g`4m BPQd}׿MyP##_{WW^}_juK-eɖ7 ۀ`10+R`p0Œ2CI)RCU2*5` &[ț.[RZj{x-Cp%`!{y߽sfIBe3BS,z=(*Ҍ= 0`@hviiLtxUxZ!~:a,jjH:\9TQjՊƦMT_ϞyDǾPqԡ)aÑQļy Ǐ+V`F,XaBYYwZ|8`&8$Gc#G_{=10\e/)~JK_( . ,G}uaz׎S{+ݹĶXgiVu˱b|>lތ}ee‘#(/'e.'Lb ~;6mBg'Gu5l6TTh+ΟǴi :;ЀV8v]1KJ8f(*1 ~d<ʶ;+as^q=1\tV)ےE&=]I cdشblB5 0aՔFo{O'sMaDhiH$`0DZJAsL={0w.qYiFJ8!՟c,)/i@DS&gۖaS'ٯjȚUc!"mStk:Ț9AaxT1Z|H[Չ3gLb|Z塯SJgQRF#`<n`R V+0>* 79JK3-mf /V+êIZ2 2"Y1?cU/XhuNӴ~ 10&~opNήQCޗiѝj2mWdTznE=rEcː4^MWgď l&x 5eH*։{MeGPRb|,66*S}l;Jx0U[i'fUf0Jţo&rMJ+\T:;E76o`X%ǰl^VP4FhpMػ/O>/FjgYW W{cU#kd?#I7oI o⩴X,AN dNVҖ-SI-^1ʲ['{2lwBw9,YUwA$˂K Q>>7*&1oBwө&7PY{pɧKd1&4W]&x$WxSǖ,̲F+oH\UW7Gk+`ҿJxHeLQyd,'j'Y oPۄJ<>2uvҮh_Hw"a6?X){1 tԬݳ:/D"{W'zs=_}=b$ I 쏜9-eze;iB̞nl| ]]`!] ܹT\I˔L>܉j̟͙ÜNe Ç?+e3ꍓ2_>Dvi$ Fl6 az,Zn_#–-An.f" Iw$%%t83~66k]{$Yvw(0'yqn (v RPlbǭ7,V A:e/0 Bދ-=\`lTMMSpv;DC< H(dz{#Θv ̙ͷ ,8,3R ;ׁC"N,6J?VwˍVYRHnKf2#I`L$[!I^ܽN1M0? F68H^/s 걝vtw =*$=(+Ќ+8ݎHho6J~ޠ]qWe%%8s4RD5E;1VJ^[TiߙVPcl6Ujlpڊ?)Lj,AJs*.r?9"QYPbܮ.j')Wp &bׄ I__&/ӝ)fEOߓzL-A2b^=FGǬZGI ?zd~w2K0z5TKPހXCA6}:jj wnڤENĹ>ЗJx=w+香 Af@$| "8cnKG(0FVӨŢ)d#c݁O%%8ь|9$7==a"t0gƜUJ:ݩܙ-;FŨmq`tѮRvM8gWxlsܬ YF}J9i,VZ (Via5ǏwQWn :Cv S6sH{du,FcBP(곳g7$Xy9+.~?d \#Y:C3[oɴZkT5 """d\v.OӾa5a h69 ^/bqō7Hc:Y-йzMZ[ 8@ĤA5"U/4H.@i5,Iz%#4)̇PvdИ5)\a4I"A$ 283sׂ2Ou "L8e]"@gܤ+iO^1J),JFStILֺIi }q0u=]lOzTXtComment(u_o0 :a>-Uل?po vg|V4vnT]DڃG=:i{ⴈ 7hkZӐF!^Io7f=I'\Ni}ke c[vP{I\y)`Pe{/NPGn`U>Y!ѮZK\s?1S,Kdda#>Fnx79 ?9T OIdM*6b=- scsE/% ]U"D81EPR{VMHɲBHvQ@%$m`d"o۵aۊR%CT. f/#y4i..Gw\dwX%${t%S<6Zrif<}խQ$bޑ# Uc'W2#^-${{3z#t&&)ynCsr:mrF7 G#ʑZ_jO4v׈F'3s;)푵ى$cœUP`6u # Fk&rTmC>Vg6m9 ̖`1|=WwpN4A4جqH#<\+@a{HU}ċ-IJ7S=6=F;a yRiI_4E[+F8%rFOƀET]u;KPsYU.vu/ c.^2z> R;JR6*XfFuOySҜ{dcvxLdr*G*C8߾?qO.NUbk3ֶ#OGqrQy ;ΜPZmP#PܾLcݫCv_sڬh]mR<[iw2^6d6r:W^=]@Q$m^`n>h>|/'x#4Iqq-fXy$MoӚh剦y~Lw# ]-fԅvޡd07ҍb'ū[!iAy ̏y:qF"K\\́y1<|&>7 -#J4 :dO(|F'YiHdYo0B*z'ϐڙMWv<-GʠI __6~∑6\8n-ޓa)tߤ kԤNfu<;*0GIO͎ L~ҜL, 'OMBGԓMh _< x5qcUf@]5bb2 "I?} g#?lpcMkv=ܤ01NҖF/YF4K^!?zf2sݸS]2^7=AbBwdfiB$ݕ!$\Xo/R"I,Q){1X% |^GP3gq`c cGݖrCr$m" pMflk) Gԫ!`v ~Omui|b3FHn0B6I#X핱y^= bXRo?}dj +!ݞa{>dl=H)ٮYk,IE9PJq5roF-RGn%D 28=0v^E,gYn%ujĄbܳts"!a gZ;X4K&8-IJ+iOּPBwR( 3˞1{nl۾@9OUϮ+;#ZQpRo/4tK}v}+&u r/r$N ҕӿ٦xe&spk-l}61;)*㿂xIB깦PkZy8g oQY}nZȞGصFW}l4 -oKmR\ܕ#p6~euN\[~Hm-ʵl Tg- f`9C7ߗޓ]V-ZZHT8u; /[o_&h$]H 1*>9VG)WʹOc5[nSfffXS઒1哜 a(X#v k[n67OoԵU˨X_٥>j}P"ԓ |o 33KyewL[ba`{D|m pԞG?W]:^WFX 2OʀOcu] Kqvv~K@O3뱦UNӧ|Z G0SZ#IcxP)y1 " 'C_ڴj_t['M$wc:h6ϡI5 yNN4QLJ܌}: cr [3IR2$#2*DFL KSOUļn!?\S`h/ya@8N0'{i5ho#w N @nL."-f-ҩY gv8Ǯj_] b$yަr1fF\1\o@0-f[ m.v~mt6UD QGKJ`ҳ ((( d%ц #TWj[hNb'˪ftPB׬ AɍI 앮X!8&$_PGހ㓱x˱y^HC#6~91rݟћ,?gQiq@*./ݦ>)cKY$;5<䝻};}k PhOe*A8V>|3ҝQEQEEPpgsphere-1.5.1/doc/img/sphere.jpg000066400000000000000000000101221461140101500166310ustar00rootroot00000000000000JFIFHHC    $.' ",#(7),01444'9=82<.342 @!1AQa"2q#3BRbr$Ss&4cT?QEQEQEQEQEV/"DuDQpJoHuKw+!_eHf!N3К^]~U Y`|D|@֫WUͭƘaۈ b}Jn.4eiL-etVٔ azlsOv7RsU<7EQEQEA="+)ҭuEGy.nH{3L =8yXjkWq$-v:{$Cε5{V!U9`85RX"^ SۘOHokOdʲ,a0<ׯ#*4Xwc$8A3o9xV;Mwى*51;oȶ՛KkLp槸`G],a$aUY'Pk{+a!2'#ȊB{k}Y&<JemzYqv."gJFrۘU (#${ z̝]!ƶtyv─ P0E%S<6Zrif;|F)A0Iod׉AǴ\s<Dž?ZMvXY2^_[ll~95?pP[E|r:ZhwGVG?jG_Χ@؎exRX^7Pr=GV=jd &#1n\Te r5;_94K+oҍ*>E@$ߎU*cdn0ːxH؍A袦kڲhDgM?C4{$%vw$ѧ0Lwq۩bJ95UrUZ:q> @zFWF !l}B]j#CfӮ@P c)ou#km?K^UB)Ҙͧ!9]>TƓH&2 sp|{@I?dkFepQ(Hb(ژVtsyB 4hRjQ@__Y V v#aEzWF&um4{埍k`/t |nve'*{0Ipk-l}6cww;gLť c}>8ަG$q, Ubb2 I?]m$cDi_ ;촡ooAyunʀq.z,So/R" d-Ε:2өxcD8UWAr vRIUH * 0n Hk1{nl۶@9O5Ϟ)nVEY#9T\;Fxtr6it}]Z!5$*0:g5D7 |~`G%2wVh# .xgN>#vshQ+I_U'*~))ޕfKl&<Քj[V`of{r61SυLt֒k Q%h9$g`_#}ԂXMc"T4FS5JJ{6.nSZvc0Z.;<ձ4ȥ`Ix, y5Q\(`Tk Am#5i#$))r- 8Du_, ^P?'|O &7)$|.?pk ۼ}e<$d!ț?9yEp۴]\;TuHSI۴κ'}?JN.ϟ G%TQEQEQEkgN I"mVqh\ gw N Ph(pgsphere-1.5.1/doc/img/sphere.xcf000066400000000000000000001202061461140101500166360ustar00rootroot00000000000000gimp xcf fileBB o(xtext     4d2BRb0<;874= <;874= 9<<<<8 z9<<<<8 zg**V======6$8:<<:8T$8:<<+ * )====6PP((axis     `l, z W @P=>===>==>===>===>==>=== =>===>==>===>===>==>=======>==>==>===>==>===>==>===>==>===4}=>==>===>==>===>==>===>==>===4====>==>==>===>==>===>==>===>==>===4 ?<=<<<=<<<<=<<<=<<<<=<<< ?<=<<<=<<<<=<<<=<<<<=<<< ?<=<<<=<<<<=<<<=<<<<=<<< ==>===>==>===>==>==<83/ ,'# $)- 05<<=<<= ==>===>==>===>==>==<83/ ,'# $)- 05<<=<<= ==>===>==>===>==>==<83/ ,'# $)- 05<<=<<=   T +=;;;;<<;;<<<;<<<;<<<;<<<<<<=+==<<<<=<<<|<<|<<|<<<e+=;;;;<<;;<<<;<<<;<<<;<<<<<<=PP((help     5eu<< PP((Sphere       -LHVImhʮ5±}1ϱy.͒p,ۦ}~ϻt)q'8&ʄ꾛x#Ռ͒"zâwʅӋ!{kl~Ôqڂʰ~kjl~Ͷyknljjh顰ήpnmnkhܞnkr~ܮt|䟊Ȧlx۸⽑w騂nw֦z︀pv΢z׋s~xͥu殉pⱷ醜mƅtinzحĦyیxtzt̛j~rppѬzҌv㶆۞uwpoz}qu}v~{{}j|Ƭߏqo⠅|Ƞ؃ppt~Ȝ}ywowpȢ}ooߣiȷx~up kn|ov ᣁ̈}r n̶n~p }w|p d̘pp hȩ̳np |wƴzӶno ޟ|{ռtp ѐkn Ămrz ٓrqpmβxorrzɗtvwv˗mɽ|rorrsrqpp|rɰyqݗn{ɰntux󍢡msڵmrȼ~{ڒnn͙lvr{n{rfתlqĒӋf֏m~xlzpy؞onӭlʮ5±}1ϱy.͒p,ۦ}~ϻt)q'8&ʄ꾛x#Ռ͒"zâwʅӋ!{kl~Ôqڂʰ~kjl~Ͷyknljjh顰ήpnmnkhܞnkr~ܮt|䟊Ȧlx۸⽑w騂nw֦z︀pv΢z׋s~xͥu殉pⱷ醜mƅtinzحĦyیxtzt̛j~rppѬzҌv㶆۞uwpoz}qu}v~{{}j|Ƭߏqo⠅|Ƞ؃ppt~Ȝ}ywowpȢ}ooߣiȷx~up kn|ov ᣁ̈}r n̶n~p }w|p d̘pp hȩ̳np |wƴzӶno ޟ|{ռtp ѐkn Ămrz ٓrqpmβxorrzɗtvwv˗mɽ|rorrsrqpp|rɰyqݗn{ɰntux󍢡msڵmrȼ~{ڒnn͙lvr{n{rfתlqĒӋf֏m~xlzpy؞onӭlʮ5±}1ϱy.͒p,ۦ}~ϻt)q'8&ʄ꾛x#Ռ͒"zâwʅӋ!{kl~Ôqڂʰ~kjl~Ͷyknljjh顰ήpnmnkhܞnkr~ܮt|䟊Ȧlx۸⽑w騂nw֦z︀pv΢z׋s~xͥu殉pⱷ醜mƅtinzحĦyیxtzt̛j~rppѬzҌv㶆۞uwpoz}qu}v~{{}j|Ƭߏqo⠅|Ƞ؃ppt~Ȝ}ywowpȢ}ooߣiȷx~up kn|ov ᣁ̈}r n̶n~p }w|p d̘pp hȩ̳np |wƴzӶno ޟ|{ռtp ѐkn Ămrz ٓrqpmβxorrzɗtvwv˗mɽ|rorrsrqpp|rɰyqݗn{ɰntux󍢡msڵmrȼ~{ڒnn͙lvr{n{rfתlqĒӋf֏m~xlzpy؞onӭlz'Ɛɳ(װ$޵|!퐟ټu|ݴ꾐𾏏ƙ‚ܢ ԒΊ Ԏć w~~ᆋ{ϼ͗悷|tꇫ בw ĝÛ|xؤ󿒠 Π{xښ顏 Ѫ 贂ӛآy zኛȍ |y x|ώv zut֐ vȎ}qچڏ̀Ć|€ֲª֊wtֲx{~ ֲvs βΘyqy顇rvryДux |׆ w ꏨn~ x{ьtv~| rk΁ݾ ~͊~n uqo ~췅tzā{ ׳nsrwt}Ёޢ̱s  ~ ؘy{qΓ~rx܂|wrޅ~nz'Ɛɳ(װ$޵|!퐟ټu|ݴ꾐𾏏ƙ‚ܢ ԒΊ Ԏć w~~ᆋ{ϼ͗悷|tꇫ בw ĝÛ|xؤ󿒠 Π{xښ顏 Ѫ 贂ӛآy zኛȍ |y x|ώv zut֐ vȎ}qچڏ̀Ć|€ֲª֊wtֲx{~ ֲvs βΘyqy顇rvryДux |׆ w ꏨn~ x{ьtv~| rk΁ݾ ~͊~n uqo ~췅tzā{ ׳nsrwt}Ёޢ̱s  ~ ؘy{qΓ~rx܂|wrޅ~nz'Ɛɳ(װ$޵|!퐟ټu|ݴ꾐𾏏ƙ‚ܢ ԒΊ Ԏć w~~ᆋ{ϼ͗悷|tꇫ בw ĝÛ|xؤ󿒠 Π{xښ顏 Ѫ 贂ӛآy zኛȍ |y x|ώv zut֐ vȎ}qچڏ̀Ć|€ֲª֊wtֲx{~ ֲvs βΘyqy顇rvryДux |׆ w ꏨn~ x{ьtv~| rk΁ݾ ~͊~n uqo ~췅tzā{ ׳nsrwt}Ёޢ̱s  ~ ؘy{qΓ~rx܂|wrޅ~n ˰ ¼~ ˰ ¼~ ˰ ¼~ׂhҎlwoivu쬌y̑|gϾlzv|jΡlvtpvōlsk~jpwroiȺkr}nѤj|kv}բoijꌬxѢvjpgy餠̶wӥlyhh|znoiquӤj~yzvronoptz||omnҢjp}Ԥjohԣwjtrzդrmwvؤl~悬|m֤i䣔zmצi䪎{nפir|mئhj{iؤin}j~עyk|x}unڥqkႫsh}ۦlkvԚzhkkݪc֕th~kmmzؖydqhphu ڜhfxtg kjlfrڂ wr ۢjrjhj{ă x jqxihjprruz}~~}wuvvplji } jpͻn vv knh t kjᣤv {r qj㤧Ԋ pxj䦨Ҟ} ~ui䤦Юr ~ug㢣j qf椥p nf̊ zng|梡ʛ|nlx餥Ȭzykmj륨ǿxng 즧~flix죤hxjo}rݢpsxjhsmh~rhiilpw~|uonp}f zlx xjyfztsuhqhzrhqerh~o{ x|mznz qm{얎|oloz~i 򞑌~|{xwx||!nh#omiׂhҎlwoivu쬌y̑|gϾlzv|jΡlvtpvōlsk~jpwroiȺkr}nѤj|kv}բoijꌬxѢvjpgy餠̶wӥlyhh|znoiquӤj~yzvronoptz||omnҢjp}Ԥjohԣwjtrzդrmwvؤl~悬|m֤i䣔zmצi䪎{nפir|mئhj{iؤin}j~עyk|x}unڥqkႫsh}ۦlkvԚzhkkݪc֕th~kmmzؖydqhphu ڜhfxtg kjlfrڂ wr ۢjrjhj{ă x jqxihjprruz}~~}wuvvplji } jpͻn vv knh t kjᣤv {r qj㤧Ԋ pxj䦨Ҟ} ~ui䤦Юr ~ug㢣j qf椥p nf̊ zng|梡ʛ|nlx餥Ȭzykmj륨ǿxng 즧~flix죤hxjo}rݢpsxjhsmh~rhiilpw~|uonp}f zlx xjyfztsuhqhzrhqerh~o{ x|mznz qm{얎|oloz~i 򞑌~|{xwx||!nh#omiׂhҎlwoivu쬌y̑|gϾlzv|jΡlvtpvōlsk~jpwroiȺkr}nѤj|kv}բoijꌬxѢvjpgy餠̶wӥlyhh|znoiquӤj~yzvronoptz||omnҢjp}Ԥjohԣwjtrzդrmwvؤl~悬|m֤i䣔zmצi䪎{nפir|mئhj{iؤin}j~עyk|x}unڥqkႫsh}ۦlkvԚzhkkݪc֕th~kmmzؖydqhphu ڜhfxtg kjlfrڂ wr ۢjrjhj{ă x jqxihjprruz}~~}wuvvplji } jpͻn vv knh t kjᣤv {r qj㤧Ԋ pxj䦨Ҟ} ~ui䤦Юr ~ug㢣j qf椥p nf̊ zng|梡ʛ|nlx餥Ȭzykmj륨ǿxng 즧~flix죤hxjo}rݢpsxjhsmh~rhiilpw~|uonp}f zlx xjyfztsuhqhzrhqerh~o{ x|mznz qm{얎|oloz~i 򞑌~|{xwx||!nh#omi{uqpn̈؊uߍ |ߝpp ōpתwyn ʂ׳tvү}rs sײvntꚄnktt s ts դ| 􉼲r叉zzxq~؀јr y ݃ݩրq qrq ؠnyɑqyĄtǂȕtq~ɝwq~ⷓtq޾l|ryznwތ펵upr|ŀ{ʨnz˟؈ ~vlmvtv 얝vz 察r{z첔뻗|p ௒|׭x覞ըtꫠ衚z~࿓sy␴nʦwzwԇ殎kШ~pxtvؿzm术䞊xޒӼlx͂Ⴅn̵lv㾒ীޏiuoq~pۘmfjђkښ𸇄ؤ|tؕoبwzِ췭fթzy̌p̡yxŃ汴}uxӭ ٰjƪ~x͖Ė ޫfįsqϼȒ 䩪vĤqʶt 榨n}pǣnİ 楠dpvjŸ}ron|»~r퇄~jekjvzd|iqt񵶨xniyp{uqpn̈؊uߍ |ߝpp ōpתwyn ʂ׳tvү}rs sײvntꚄnktt s ts դ| 􉼲r叉zzxq~؀јr y ݃ݩրq qrq ؠnyɑqyĄtǂȕtq~ɝwq~ⷓtq޾l|ryznwތ펵upr|ŀ{ʨnz˟؈ ~vlmvtv 얝vz 察r{z첔뻗|p ௒|׭x覞ըtꫠ衚z~࿓sy␴nʦwzwԇ殎kШ~pxtvؿzm术䞊xޒӼlx͂Ⴅn̵lv㾒ীޏiuoq~pۘmfjђkښ𸇄ؤ|tؕoبwzِ췭fթzy̌p̡yxŃ汴}uxӭ ٰjƪ~x͖Ė ޫfįsqϼȒ 䩪vĤqʶt 榨n}pǣnİ 楠dpvjŸ}ron|»~r퇄~jekjvzd|iqt񵶨xniyp{uqpn̈؊uߍ |ߝpp ōpתwyn ʂ׳tvү}rs sײvntꚄnktt s ts դ| 􉼲r叉zzxq~؀јr y ݃ݩրq qrq ؠnyɑqyĄtǂȕtq~ɝwq~ⷓtq޾l|ryznwތ펵upr|ŀ{ʨnz˟؈ ~vlmvtv 얝vz 察r{z첔뻗|p ௒|׭x覞ըtꫠ衚z~࿓sy␴nʦwzwԇ殎kШ~pxtvؿzm术䞊xޒӼlx͂Ⴅn̵lv㾒ীޏiuoq~pۘmfjђkښ𸇄ؤ|tؕoبwzِ췭fթzy̌p̡yxŃ汴}uxӭ ٰjƪ~x͖Ė ޫfįsqϼȒ 䩪vĤqʶt 榨n}pǣnİ 楠dpvjŸ}ron|»~r퇄~jekjvzd|iqt񵶨xniypӴאְѥt Ӵאְѥt Ӵאְѥt %ߛhi'؋hz(kej*kx|,spxv.޷|{v1а4ɼrt:?%ߛhi'؋hz(kej*kx|,spxv.޷|{v1а4ɼrt:?%ߛhi'؋hz(kej*kx|,spxv.޷|{v1а4ɼrt:?i𨦔~vnsrmg힔sxmt~rxzp󟖇dytytnutx~dou!~vvm}#薔ppulq'{|}lnnmq|zz27i𨦔~vnsrmg힔sxmt~rxzp󟖇dytytnutx~dou!~vvm}#薔ppulq'{|}lnnmq|zz27i𨦔~vnsrmg힔sxmt~rxzp󟖇dytytnutx~dou!~vvm}#薔ppulq'{|}lnnmq|zz27GG## Background     nz.>N^PP((pgsphere-1.5.1/doc/img/spoint.jpg000066400000000000000000000105341461140101500166660ustar00rootroot00000000000000JFIFHHC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"@!1AQa"2q#3BRbr$Ss&4cT1!q ?(( (^D ꈣ% NZn`YD+ )zK˯ʡ>lZ W7c꺛 #cqLO_? ƒl)YEEKVȺ+lK=6ow9u;)ow 9 B(( (( (K mnmE}{?*c}yxEe6U^u~[ H%c5xfi8!'p9@h"GI-h.:(?CAmJ)` . f/#y4i..Gw\dvX${t]L;Eiɧ]OuV,%;W^%Ӄqr2J5nAg0Z0woҁ&Rlcecyɯ Z]Am qGj4ga P,ZhwGVG?jG_Χ@؎exRX^7Pr<|ZP3z#t&&)ynCsr: ev \D.x i3ߦfM>^"ar8F[ǮF?V'&SG>`*(>)WPAR2jvrh+ @V߼0#`siLfӐmf.qGwwlmmdIK9¸>=^F{a"FbROMQ27e<$lF 5$"G`#'|AEp]u;KPsY[:/=cH)KHةa?kb4x8%͞ 6߳R5-N>\㰄"ҡTk-4\x 2F9N~yMO}[p^NF#h7,Z\Ac㴓?G,M3̼/<^Ccښܭ@w37Rۗjݐ|@R5lE,'_=5^VcL|dm$cDi_ ;[N{{cp>(ڹ{-([Đ^][$K>T[jԶU^jПw> ԚR85T C:V뷰˫NRa^#WdiVC=c|HyK`izPL=MXqb%ROrc8qͯ7>Ր13nyD<<[_,k^k}sXEwS)^YE 2r|r n;94?R~;82xg,ΠH>NKMv.ay}(;8$O%r;x',>k]pEҬ?Imֲ'-KGc>mWҗΜl{!HdabO&X2Iq:dW m?Y5ǖtŰj|VG)W—C\^t?_WsMS(X#v U:kIs5؉aFA3/jA`rډ]B{~/1p3Oey 8I=O4L#A`*=Y]#$Xo$~b@>ڄs|8PCjO#џC٫z/ +,kpNO'AY53%jJ~K@O3籪r鞳|Z G0Suur(dpU<1 " 'Cڴj^t['U$wc:hm#֢j-h9u4nU#5/("IaYr>c"Az(aWP"ij.`Ҕ|Ӝk4M{OY`2)5ZVs:/f  quVbfCxV8P9V((5}&Yk[Ǽ9^iWOi|CH!WT_G-;).ʾ;ina an L21(5^Ѯ;6T MBH:a|qDE:Hd^~cP cj"b;;mC5s32q_;i@p.J XrWnuIqu 3xI߸x~rBH(:wֹ5kxd|/:L?)~.A{K뽙N#Hi%RSj 6Spgn2;ɤf #'/2~Tތ^_q]hG#dl % z*u4Yao{ x;\T`ұ(bB:VtQ@QEQAr"0V|+}VϢ܋Bw63>W5Adm~(O 5LnRH\~ ײV`t${AZͻظؖ]CΰFBAɌczz?7Xj-KlnA(<qx65W,=.]d8v%G 9_h">Tpqu|f9/Z((pgsphere-1.5.1/doc/img/spoly.jpg000066400000000000000000000116451461140101500165240ustar00rootroot00000000000000JFIFHHC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"A !1AQa"2q#BR3Sbrs$&c4T+!1A2QaqR ?袊(+ȑ!yQd@z7huKw+!_UHf!N3К.*,m^fk"= }hUnUu7skqG6>|!ʤO_? ƒl)YQI`%d]e%p7j}cx-5Y#( tQEQEEPQ@QU.kkvmnZ(~"]*ݯnw_E>);wsrC}ugNI@9|O*kvVp"&?IKX'ӠrTƎ-Ǎ'ʀ5WB+ȒPc=RP\5{V!U9`85m-kS:r00k-b5ǩ$˕I"ѭ/l`nx3)>ˁׯ#e,j }) $7׭dƙ?9VVE1F a;KH,cnm |FF%3D*$p/g#B9p?qlL, R6 `9XLP'}>&ђc4ً8\'9( T[&)uV 8R6#ʘPQ@QK5Y4m"[& !G zݶaIĈ knMWn)H @CmPt{%vw$ѧ0LwqߩbJ94]L;Eiɧ]O$:Sh+}`Yy*yTATph`ꚍƷ -;$i6cVo.ǛM|b'z:`p?O?ϳ_ڀZhwGVG?ZG_Χ@؎0:nyfӮ@P c(ew \D.y*Ei3ߦfM>^"ar8F[ǦF?F'&SG>*(U2T9]%P ^m)r-,c?|Mi4iqX G0xW€{HU}D-IJ)cdn0ːxH؍4$"G`#'Ɋ|@Xho.̺9`U]n3^\d }OvlŤҜ{dcvxLdr*G*C8߾?qO.*@P 5k[tׇǩ(̃`:QDkd-==/9a>1]n5hIk˙ZievHoMj!&UP[@HIpNk@]7+- iG($TAT`Zո9Μ,,EΔee [kz=#%W.cR@眍`OY8fcYOX0rJ6< SR+xRcXAª SsZ\TO3z >$Lw#IFN[gԚ5K]_MKiTdV. c$˞ᓇ'Emvt] .A'! #wshR~;8,ΠH>G.KMw.ay}( rIUhuUJ52ZǦ8_@Xz>,/4jn%`r88#xVau?_TmPjX '_G8 #wSFPIbMg+]Sv8= sMiZk[ż7w }k6e2qOPJ[MC-9,WKwhAR8ؑyUi s{5_ʻ5&MD o< 'mS8 uNk( kHu sq2 9$`qaCW@%9uY6 *F|Mj7Y@f@RO@S+'MHi۫kʔ_wxypfc o, A z,L7X?1 ,]bmBdC(x'|!yt=Nі58'' ֞Y53%i*)v=@Tg㱦UN鞓|Z G0)fuHX928*Fb㘆M\5/bٺ-ƒt汝xlߍ?6c'w'(Fv?XܡHuVT$aAe-@>+bsEl}!Q-ՔBo>\98ʊ o[Io2*uaA ÄfgܽF=/lm;I{j9f>`;&fێEia]-$f PG `퍁{X[kbE| !^\l+Zg}N5ס⭥̢q+ҮϳZiiZbD2Į$ߪN$z \[w5Ա|9$8 lQ x(~'D[(pA~xxQ1@N![U9 T[vѷ ;E|ڷ7LK{{۸V %B{,9|g4y8^n'"qmr\]Cy ^ b./_Խ?.Iñ;/ v\yb5kxdq&_B jb\YÁC0^}VUIlXTR96g{뽙#Hiǒ3{}:MAFnQݦG5m`Ɍp/ 2|'S{=ً+Mb̍$E\cnަDaZͭη3x\<ϐmȪ@ +QGKJ`ҽQ@QEQE#IchEta2U;U}Zq Ί-е {?BxdrcrG~GJ,ΜD/#@cx˱y׈$d!ț?9|kYnilţip7Zmm(?Ҁan\ HK}wñڥˬGrN:…(@W.}?JN.o>KTQ@QEQEpgsphere-1.5.1/doc/img/strans.jpg000066400000000000000000000127721461140101500166720ustar00rootroot00000000000000JFIFHHC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"D!1Q"Aaq#2BRbr3Cc5%4s.!1AQa2q"b ?(((Λ,_At"b8b$n:ȍEŽqm-ݬퟳ0A 7⳶տtCƟs)<\1YxB! >qRRI,hΔ95%~V| ]4UҚ;m:ta#`gw ؖ]fy'|[וo.EW!(( (((( (g[$y2h t_-7UuInVgANTq 5J&9*A&WH[vbIV8 >4[]WSon<1bU!|@%.|wEٙ"!vU`x q,VfK׈dMcOiU֤ou]5Yg@Q|J|0@8Siq@!P⋎߿p&p98" %r2AMགi IT;Nes أt"-W1H<3wP˼reN~č@Un&PA;25ajQEEP"EI#Dyל uyuI*d?<ϾŒ1r?Pc?RMg![[ ąD!@[̲wX#XZgGhѩ"Hx \@Kuk{;,Ms if/-ij n9Y"h@*.d9y椏h@  v cN4d"\Kw`pv|Ɵ։oge=}^<D=0NPֶS]?GZ?oNr}r}mOO5!SrO3YJ\ |FqΫ\hzͻE]m#.w$ V4BZ6$QsfDr$k¬? ~G\=k /NJwent*M΍.ZX1ފfv,ή"f dWbaHFghNuK8yT31dy,sĒ @#C /i)_yPRU%^`H(GCǺiW2Of,b8<4((λgq;@YzL"0!PpƧ#q~]J>v^ȇ?_^΀[©۵;K>awA:8=4wR;em=S@hdSdJߘYTN@.mൿբ%ʕP0 Hqi jؕUmlt Pnjq2/ji>IOaǘT+?ܥ<ێ4SKuxHu-%+:(HO:eXлUc*Rw~FE<0rjƦk&Tpq8sҔ^tjϖەVaN8F wO2j@|THTE 0c=yC!?Ec>J{?FªjPϠPYjCmÒG+峈{CynXX)?$Zdm19; uSO'a#ml|iEPQ@y$s,GMIptC|G{m\2̹\O5= }5^)Us-ׯ5gSKXQ12J Ia41u1#U j[+#늰h?bIVzJj ɦZkC~*|ͪ|)o%1u8ھj%\S2);JnfaB0#C1זkƼz-<+K~#9^5((O7Ϣ6|)j"^yڤ ]XV +NmW(kUb{nW6mޢn's0;x牃G"FȥZYӉ͒)fG ґiz ;J A`xʳ#|sYWG^ 5:MmO 8€lOyWI#L?7U ((ͻSd]\}BD?0RimČ$F1zN7ZT7qqcpg@kU _ptsFv9cZ -BlFu:0F]\~7|dx.b#l˅'?Z|ļRȨXVRGY݄LcWrjIrjF>45c GcpUo:ckN6Il?dCv0 *:pRW5J>WbMg` p;rH=i6YdKh/w\C Uo3_Icj :9e),t;h9i?xF+| Fv&zVWI:qqO'6.ہVluL}o5`wVS1J\5Ź~[.nrI`9*= ^ 9`;whq褁&]0:_+,^\ O6uEf '?NZV{K|Hi9 o12M#UB:j|v13%?6ֲi'#y[2NV:JYFn_T5/OcO-f#s/?]e6'}טtjϠܪɮ\=,N\rcUP,8y_| ,ƃVc@`e+/$o:lmZm[ 7[cٚqcÃyt^n-m/BuLj:]o^0NOPF/Xu{h+~o_\wپN&Z!6}qG>z6\SO8o.ؖ1y0#pc $B]' pP}j9uW$)1 oP*oi|@Q%cfI/"*u I2i- *|x! uL&RrzH|?0j0ۅLIY vgżb_b^iiV*xo!A}*՝iCT( ((v,ҫiGT ϥg{A4{/d>Dž$.'=<>yُjg6:|mB[9|;cΕSAb-9s2$Fu#aϕs)`K'z*NI߅^K:]mYi Indexes Spherical index pgSphere uses GiST and Block Range INdexing (BRIN) algorithms to create spherical indices. GiST indexes utilize an R-tree implementation for spherical objects, while BRIN indexes are based on the "summarization" of data blocks (pages) on physical storage in order to organize data searches on ranges of summarized data that can be easily skipped on the base of search filters (see PostgreSQL documentation for further details on BRIN indexes). As a consequence, BRIN indexes are very small indexes (up to 1000 times smaller than GiST ones), generally with lower performance compared with a GiST one, but up to 100 times faster than a full sequential scan of a table performed without any index. So BRIN indexes are particularly suitable in a big data context. An index speeds up the execution time of searches based on operators <@, @, &&, #, =, and !=. You can create a GiST index with the following spherical data types: point (spoint) circle (scircle) line (sline) ellipse (sellipse) polygon (spoly) path (spath) coordinates range (sbox) A GiST index can be also used for quickly finding the points closest to the given one when ordering by an expression with the <-> operator, as shown in an example below. BRIN indexing supports just spherical points (spoint) and spherical coordinates range (sbox) at the moment. Simple index of spherical points To find the points closest to a given spherical position, use the <-> operator: spoint (0.2, 0.3) LIMIT 10 ]]> BRIN index can be created through the following syntax: By default, BRIN indexes summarize blocks of 128 pages. The smaller the number of pages specified, the higher the granularity in searches, and the gap in performance between GiST indexes and BRIN indexes will be decreased. Note that the size of the BRIN indexes increases as well. Different summarizations can be specified with the following command: <type>smoc</type> index pgSphere uses GIN to create smoc indices. An index speeds up the execution time of operators <@, @>, &&, =, and <>. The index works by casting all contained smocs to a fixed level, and for each pixel at that level, storing which smocs overlap with that pixel. This is especially beneficial for "overlaps" queries using the && operator. The downside of that approach is that storing large smocs like "all sky" (0/0-11) produces a large number of index entries. The default opclass smoc_gin_ops defaults to working on level 5 with a resolution of 12288 pixels (12 * 4^5). An alternative granularity can be selected by setting the order parameter on the opclass (integer value between 0 and 12; option only available on PG 13 and later). The alternative smoc_gin_ops_fine opclass works on level 8 with 786432 pixels. Index of smoc coverage objects Hash index Values of type spoint can be indexed using a HASH index, supporting the = operator. The spoint_hash_ops operator class also enables DISTINCT queries on spoint. Hash index of spoints pgsphere-1.5.1/doc/install.sgm000066400000000000000000000063021461140101500162500ustar00rootroot00000000000000 Installation Download &pgsphere; is not the part of the &postgresql; software. You can download the latest release from the &pgsphere; Releases page. The source code can also be downloaded by cloning the repository with the appropriate release tag. The master branch is intended for development use and may contain the code in a transitional state. It is not recommended for use in production. Install It is assumed that &postgresql; is already installed. Depending on the system configuration, superuser (root) access rights may be required to complete the installation. The installation script uses &pg_config; utility. Make sure that the environment variable PATH includes path to &pg_config; utility. The path to &pg_config; can be also specified in make command: make PG_CONFIG=/path/to/pgconfig ...]]> Unpack the downloaded archive and enter the directory: tar -xzf path/to/pgsphere-X.X.X.tgz]]> cd pgsphere-X.X.X]]> Compile the code. By default, &pgsphere; is compiled with &healpix; support. make]]> or compile without &healpix; support: make USE_HEALPIX=0]]> Run regression tests optionally. If &pgsphere; was compiled without &healpix; support, USE_HEALPIX=0 should be specified in make command line. make test]]> Install &pgsphere; files to the installation directories. The installation directories are defined by &pg_config; utility. Superuser (root) access rights may be required. If &pgsphere; was compiled without &healpix; support, USE_HEALPIX=0 should be added after make. make install]]> Configure Extension We assume you have already created a database userdb, where userdb is the name of any database. Assume that the name of &postgresql;'s superuser is postgres. psql -U postgres -c 'CREATE EXTENSION pg_sphere' userdb]]> It may be necessary to give more psql options, like port or host name, depending on your system configuration. Please, take a look at the psql user manual for details. The psql user manual for the latest &postgresql; version can be found at &postgresql; site . To get the version of installed &pgsphere; software: SELECT pg_sphere_version();]]> pgsphere-1.5.1/doc/operators.sgm000066400000000000000000000517311461140101500166260ustar00rootroot00000000000000 Operators Casting pgSphere provides some casting operators. So, you can transform an object to another data type. A cast is done using a CAST(x AS typename), x::typename or typename(x) construct. Castings casting argument type target returns spoint scircle circle with center position spoint and radius 0.0 spoint sellipse an ellipse at position spoint and radius 0.0 spoint sline a line with length 0.0 at position spoint scircle sellipse the scircle as sellipse sline strans the Euler transformation of sline sellipse scircle the bounding circle of sellipse sellipse strans the Euler transformation of sellipse
Cast a spherical point as a circle SELECT CAST ( spoint '(10d,20d)' AS scircle );]]> ]]>
Equality All data types of pgSphere have equality operators. The equality operator is as in SQL =. Furthermore, there are two valid negators to indicate that two objects are not equal: != and <>. Equality of two spherical points SELECT spoint '(10d,20d)' = spoint '(370d,20d)' ;]]> Contain and overlap On the sphere, an equality relationship is rarely used. There are frequently questions like Is object a contained by object b? or Does object a overlap object b? pgSphere supports such queries using binary operators returning true or false: Contain and overlap operators operator operator returns true, if <@ or @ (deprecated, not for smoc) the left object is contained by the right object @> or ˜ (deprecated, not for smoc) the left object contains the right object !<@ or !@ (deprecated, not for smoc) the left object is not contained by the right object !@> or !˜ (deprecated, not for smoc) the left object does not contain the right object && the objects overlap each other !&& the objects do not overlap each other
An overlap or contain operator does not exist for all combinations of data types. For instance, scircle <@ spoint is useless because a spherical point can never contain a spherical circle. When one of the arguments of such an operator is a MOC and the other is an scircle or an spoly, the non-MOC argument is converted to a MOC of the order of the maximum order of the MOC. When comparing against a MOC-valued column, it is usually much faster to explicitly convert the geometry using the smoc constructor, as the conversion will then only happen once. Is the left circle contained by the right circle? SELECT scircle '<(0d,20d),2d>' <@ scircle '<(355d,20d),10d>' AS test ;]]> Are the circles overlapping? SELECT scircle '<(0d,20d),2d>' && scircle '<(199d,-10d),10d>' AS test ;]]> Overlaps between a circle and a moc SELECT scircle '<(37d, 5d), 0.25d>' <@ smoc('4/1117') AS test ;]]> Overlaps between a circle and a moc with explicit order SELECT scircle '<(37d, 5d), 0.25d>' <@ smoc('4/1117 5/') AS test ;]]> Overlaps between a circle and a moc with explicit cast (normally faster) SELECT smoc(5, scircle '<(37d, 5d), 0.25d>') <@ smoc('4/1117 5/') AS test ;]]>
Crossing of lines Another binary relationship is crossing. pgSphere supports only crossing of lines. The correlative operator is named #. Are the lines crossed? SELECT sline '(0d,0d,0d),10d' # sline '(90d,5d,5d,XYZ),10d' AS test ;]]> Distance The binary distance operator <-> is a non-boolean operator returning the distance between two objects in radians. Currently, pgSphere supports only distances between points, circles, between point and circle, and between point and line. If the objects are overlapping, the distance operator returns zero (0.0). Distance between two circles SELECT 180 * ( scircle '<(0d,20d),2d>' <-> scircle '<(0d,40d),2d>' )]]> Distance between point and line SELECT 180 * (sline '( 0d, 0d, 0d, XYZ ), 40d ' <-> spoint '( 0d, 90d )')]]> Length and circumference The length/circumference operator @-@ is a non-boolean unary operator returning the circumference or length of an object. In the current implementation, pgSphere supports only circumferences of circles, polygons, and boxes. It supports lengths of lines and paths too. Instead of using the operator, you can use the functions circum(object) or length(object). Circumference of a circle SELECT 180 * ( @-@ scircle '<(0d,20d),30d>' )/ pi() AS circ ;]]> Length of a line SELECT 180 * ( @-@ sline '(0d,0d,0d),30d' )/ pi() AS length ;]]> Center The center operator @@ is a non-boolean unary operator returning the center of an object. In the current implementation of pgSphere, only centers of circles and ellipses are supported. Instead of using the operator, you can use the function center(object). Center of a circle SELECT @@ scircle '<(0d,20d),30d>';]]> Change the direction The unary operator - changes the direction of sline or spath objects. You can use it with an Euler transformation object in the figurative sense, too (). Swap begin and end of a <type>sline</type> SELECT - sline (spoint '(0d,0d)', spoint '(10d,0d)');]]> Turn the path of a line The unary operator ! turns the path of sline objects, but preserves begin and end of the spherical line. The length of returned line will be 360° minus the line length of operator's argument. The operator ! returns NULL, if the length of sline argument is 0, because the path of returned sline is undefined. Return length and check if north pole on <type>sline</type>s SELECT set_sphere_output('DEG');]]> SELECT length ( sline ( spoint '(0d,0d)', spoint '(0d,10d)' ) ) *]]> SELECT spoint '(0d,90d)' @]]> SELECT length ( ! sline ( spoint '(0d,0d)', spoint '(0d,10d)' ) ) *]]> SELECT spoint '(0d,90d)' @]]> Transformation As in a plane, translations and rotations are needed to do object or coordinate transformations. With pgSphere, it is done using Euler transformations (strans). On a sphere, there aren't real translations. All movements on a sphere are rotations around axes. The general syntax for a transformation is always: object operator euler where operators are + for a usual transformation, - for an inverse transformation. You can transform any object having a pgSphere data type, except the data type sbox. Transformation of a point Rotate a spherical point counterclockwise, first 90° around the x-axis, second 90° around the z-axis, and last 40.5° around the x-axis. SELECT set_sphere_output('DEG');]]> SELECT spoint '(30d,0d)' + strans '90d, 90d, 40.5d, XZX AS spoint';]]> You can use the + and - operator as unary operators for transformations, too. +strans just returns the transformation itself, -strans returns the inverse transformation. An inverse transformation SELECT set_sphere_output('DEG');]]> SELECT - strans '20d, 50d, 80d, XYZ' AS inverted;]]> <type>smoc</type> operators A unique feature of MOCs compared to the other pgSphere objects is that their unions and intersections are again MOCs. Hence, smocs support two special operators which both yield smoc as output: Union: Intersection:
pgsphere-1.5.1/doc/pg_sphere.xml000066400000000000000000000033651461140101500165760ustar00rootroot00000000000000 &ohgr;"> &OHgr;"> &pgr;"> HEALPix"> pgSphere"> PostgreSQL"> pg_config"> ]> pgSphere &pg_sphere_version; pgSphere Development Team pgSphere &pg_sphere_version; &capWhatis; &capInstall; &capTypes; &capConstr; &capOperators; &capFunctions; &capIndices; &capExamples; pgsphere-1.5.1/doc/stylesheets/000077500000000000000000000000001461140101500164455ustar00rootroot00000000000000pgsphere-1.5.1/doc/stylesheets/stylesheet-common.xsl000066400000000000000000000074161461140101500226640ustar00rootroot00000000000000 1 0 yes 2 1 ? ? pgsphere-1.5.1/doc/stylesheets/stylesheet-fo.xsl000066400000000000000000000125251461140101500217750ustar00rootroot00000000000000 3 1.5em wrap solid 1pt black 12pt 12pt 6pt 6pt center left 1em 0.8em 1.2em , ISBN -3.5em -3.5em pgsphere-1.5.1/doc/stylesheets/stylesheet-html-common.xsl000066400000000000000000000372421461140101500236260ustar00rootroot00000000000000 %common.entities; ]> pgsql-docs@lists.postgresql.org 2 stylesheet.css.xml https://www.postgresql.org/media/css/docs-complete.css docContent container-fluid col-10 , ISBN appendix toc,title article/appendix nop article toc,title book toc,title chapter toc,title part toc,title preface toc,title qandadiv toc qandaset toc reference toc,title sect1 toc sect2 toc sect3 toc sect4 toc sect5 toc section toc set toc,title

| id- 6 clear: both # id_link # ERROR: id attribute missing on < > element under / [@ = ' '] pgsphere-1.5.1/doc/stylesheets/stylesheet-html-nochunk.xsl000066400000000000000000000015271461140101500240000ustar00rootroot00000000000000 pgsphere-1.5.1/doc/stylesheets/stylesheet-man.xsl000066400000000000000000000207551461140101500221500ustar00rootroot00000000000000 0 0 0 32 40 < > ^ ( ) 0 Note: Note: (soelim stub) : pgsphere-1.5.1/doc/stylesheets/stylesheet-speedup-common.xsl000066400000000000000000000100261461140101500243160ustar00rootroot00000000000000 en pgsphere-1.5.1/doc/stylesheets/stylesheet-speedup-xhtml.xsl000066400000000000000000000403611461140101500241670ustar00rootroot00000000000000 , Error: If you change $chunk.section.depth, then you must update the performance-optimized chunk-all-sections-template. pgsphere-1.5.1/doc/stylesheets/stylesheet-text.xsl000066400000000000000000000053401461140101500223520ustar00rootroot00000000000000
  • * *

    :




    pgsphere-1.5.1/doc/stylesheets/stylesheet.css000066400000000000000000000057631461140101500213630ustar00rootroot00000000000000/* doc/src/sgml/stylesheet.css */ /* color scheme similar to www.postgresql.org */ body { color: #000000; background: #FFFFFF; font-family: verdana, sans-serif; } a:link { color:#0066A2; } a:visited { color:#004E66; } a:active { color:#0066A2; } a:hover { color:#000000; } h1 { font-size: 1.4em; font-weight: bold; margin-top: 0em; margin-bottom: 0em; color: #EC5800; } h2 { font-size: 1.2em; margin: 1.2em 0em 1.2em 0em; font-weight: bold; color: #666; } .titlepage h2.title, .refnamediv h2 { color: #EC5800; } h3 { font-size: 1.1em; margin: 1.2em 0em 1.2em 0em; font-weight: bold; color: #666; } h4 { font-size: 0.95em; margin: 1.2em 0em 1.2em 0em; font-weight: normal; color: #666; } h5 { font-size: 0.9em; margin: 1.2em 0em 1.2em 0em; font-weight: normal; } h6 { font-size: 0.85em; margin: 1.2em 0em 1.2em 0em; font-weight: normal; } /* center some titles */ .book .title, .book .corpauthor, .book .copyright { text-align: center; } /* decoration for formal examples */ div.example { padding-left: 15px; border-style: solid; border-width: 0px; border-left-width: 2px; border-color: black; margin: 0.5ex; } /* Additional formatting for "simplelist" structures */ table.simplelist td { padding-left: 2em; padding-right: 2em; } /* formatting for entries in tables of functions: indent all but first line */ th.func_table_entry p, td.func_table_entry p { margin-top: 0.1em; margin-bottom: 0.1em; padding-left: 4em; text-align: left; } p.func_signature { text-indent: -3.5em; } td.func_table_entry pre.programlisting { margin-top: 0.1em; margin-bottom: 0.1em; padding-left: 4em; } /* formatting for entries in tables of catalog/view columns */ th.catalog_table_entry p, td.catalog_table_entry p { margin-top: 0.1em; margin-bottom: 0.1em; padding-left: 4em; text-align: left; } th.catalog_table_entry p.column_definition { text-indent: -3.5em; word-spacing: 0.25em; } td.catalog_table_entry p.column_definition { text-indent: -3.5em; } p.column_definition code.type { padding-left: 0.25em; padding-right: 0.25em; } td.catalog_table_entry pre.programlisting { margin-top: 0.1em; margin-bottom: 0.1em; padding-left: 4em; } /* Put these here instead of inside the HTML (see unsetting of admon.style in XSL) so that the web site stylesheet can set its own style. */ .tip, .note, .important, .caution, .warning { margin-left: 0.5in; margin-right: 0.5in; } /* miscellaneous */ pre.literallayout, .screen, .synopsis, .programlisting { margin-left: 4ex; } ul.itemizedlist { margin-left: 2.5rem; } .comment { color: red; } var { font-family: monospace; font-style: italic; } /* Konqueror's standard style for ACRONYM is italic. */ acronym { font-style: inherit; } .option { white-space: nowrap; } /* make images not too wide on larger screens */ @media (min-width: 800px) { .mediaobject { width: 75%; } } /* links to ids of headers and definition terms */ a.id_link { color: inherit; visibility: hidden; } *:hover > a.id_link { visibility: visible; } pgsphere-1.5.1/doc/stylesheets/stylesheet.css.xml000066400000000000000000000003151461140101500221460ustar00rootroot00000000000000 ]> pgsphere-1.5.1/doc/stylesheets/stylesheet.xsl000066400000000000000000000324621461140101500213750ustar00rootroot00000000000000 pgsphere-1.5.1/doc/types.sgm000066400000000000000000000674231461140101500157610ustar00rootroot00000000000000 Data Types Overview pgSphere provides spherical data types for storing with PostgreSQL. Furthermore, there is a data type to do transformations. Data types SQL type name spherical type spoint point (position) strans Euler transformation scircle circle sline line sellipse ellipse spoly polygon spath path sbox coordinate range smoc HEALPix Multi-Order Coverage map
    Point A spherical point is an object without expanse but with a position. Use cases are: sites on earth star positions on the sky sphere spherical positions on planets A spherical point (or position) is given by two values: longitude and latitude. Longitude is a floating point value between 0 and 2&pg_pgr;. Latitude is a floating point value, too, but between -&pg_pgr;/2 and &pg_pgr;/2. It is possible to give a spherical position in degrees (DEG) or with a triple value of degrees, minutes and seconds (DMS). Degrees and minutes are integer values. The seconds are represented using a floating point value. A fourth method is specifying a longitude value as a triple value of hours, minutes and seconds (HMS). But, you can not use it with latitude values. A position specified using longitude and latitude in radians SELECT spoint '(0.1,-0.2)';]]> A position specified using longitude and latitude in degrees SELECT spoint '( 10.1d, -90d)';]]> A position specified using longitude and latitude (<literal>DMS</literal>) SELECT spoint '( 10d 12m 11.3s, -13d 14m)';]]> A position specified using longitude in <literal>HMS</literal>, and latitude in <literal>RAD</literal> SELECT spoint '( 23h 44m 10s, -1.4321 )';]]> As you can see you can combine the input format for longitude and latitude. The value pairs are always enclosed within braces. Spaces are optional. Euler transformation An Euler transformation is done with three counterclockwise object rotations around following the axes: x-axis, y-axis, or z-axis. Use cases are: spherical object transformations spherical coordinates transformations The input syntax of an Euler transformation is: angle1, angle2, angle3 [, axes ] where axes is an optional 3 letter code with letters : X, Y, or Z. Default is ZXZ. angleN is any valid angle with the input format RAD, DEG, or DMS. To do a transformation, you have to use a transformation operator (see ). Create a transformation object Create a transformation object to rotate a spherical object counterclockwise, first 20° around the x-axis, second -270° around the z-axis and last 70.5° around the y-axis. SELECT strans '20d, -270d, 70.5d, XZY';]]> Create a second transformation object Create a transformation object to rotate a spherical object counterclockwise, first 2° 20' around the z-axis, second 10° around the x-axis, and last 0° around the z-axis. SELECT strans '2d 20m, 10d, 0';]]> Circle A spherical circle is an area around a point, where all points inside the circle have a distance less than or equal to the radius of the circle. Use cases are: sites on earth having a maximum distance from another site round cluster or nebula on sky sphere a position with an undirected position error A circle is specified using a spherical point (spoint) and a radius : < point , radius > Valid radius units are RAD, DEG, and DMS. The circle radius must be less than or equal to 90° and cannot be less than zero. A circle around the North Pole with a radius of 5°. SELECT scircle '< (0d, 90d), 5d >';]]> Line A spherical line is part of a great circle (meridian) that has a beginning and an end and hence, a direction. Use cases are: direct connection of two points meteors on the sky sphere To allow lines with a length larger than 180°, the input i syntax is a somewhat complex. A general located line with a length length is defined as a line starting at position (0d,0d) and ending at position (length,0d) transformed with an Euler transformation euler. The input syntax is : ( euler ), length For a simpler line input, use casting operators () or constructor functions (). If the length is larger than 360°, the line length is truncated to 360°. The transformation euler will always be converted to an Euler transformation using axes Z, X, and Z. A line input A line starting at position (200d,+20d) and ending at position (200d,-10d). SELECT sline '( -90d, -20d, 200d, XYZ ), 30d ';]]> Ellipses Within pgSphere, ellipses are defined as :
    If the center of any spherical ellipse is the North Pole, the perpendicular projection into the x-y-plane gives an ellipse as in two-dimensional space.
    Use cases are: cluster or nebula on the sky sphere where the `height' is lower than the `width' to describe a position error An ellipse always has: a major radius rad_1 a minor radius rad_2 a center center a position angle pos (inclination) Hence, the input syntax is: < { rad_1, rad_2 }, center, pos > The radii rad_1 and rad_2 have to be less than 90°. If rad_1 is less than rad_2 , the values will be swapped. The position angle pos is defined within pgSphere as a counterclockwise rotation around the ellipse center and is zero, if the ellipse is “parallel to the equator” Input of a spherical ellipse An ellipse has a center at 20° longitude and 0° latitude. The minor radius is part of the equator. The major radius is 10°, the minor radius is 5°. SELECT sellipse '< { 10d, 5d } , ( 20d, 0d ), 90d >';]]>
    Path A spherical path is a concatenation of spherical lines. Use cases are: rivers on earth trajectories of planets or comets on the sky plane Paths within pgSphere are simplified lists of positions. The input syntax is : {pos1,pos2[,pos3[,pos4[,...]]]} The distance between 2 sequent positions has to be less than 180° and greater than zero. At least 2 positions are required. Path input example A path going from (10d,0d) to (80d,30d) via (45d,15d). SELECT spath '{ (10d,0d),(45d,15d),(80d,30d) } ';]]> Polygon A spherical polygon is a closed spherical path where line segments cannot be crossed. One main use case are areas on the earth and sky sphere. Polygons within pgSphere have the same input syntax as paths: {pos1,pos2,pos3[,pos4[,... ]]} A spherical polygon has the same restrictions as a spherical path (see ). Except that a polygon needs at least 3 positions. The line segments can not be crossed. The maximum dimension of a polygon must be less than 180°. Input of polygon A polygon going from (270d,-10d). via (270d,30d) to (290d,10d) back to (270d,-10d) SELECT spoly '{ (270d,-10d), (270d,30d), (290d,10d) } ';]]> Coordinates range A spherical box is a coordinates range. Hence, you can select objects within a longitude range and latitude range. The box is represented using two spherical points: the southwest (pos_sw) and the northeast (pos_ne) edge of the box. The input syntax is: ( pos_sw, pos_ne ) or pos_sw, pos_ne If the latitude of the southwest edge is larger than the latitude of the northeast edge, pgSphere swaps the edges. If the longitude of the southwest edge is equal to the longitude of the northeast edge, pgSphere assumes a full latitude range, except that the latitudes are equal, too. Input of a full latitude range A full latitude range between +20° and +23°. SELECT sbox '( (0d,20d), (0d,23d) )';]]> A simple coordinates range A coordinate range between -10° and +10° in latitude and 350° and 10° in longitude. SELECT sbox '( (350d,-10d), (10d,+10d) )';]]> <type>smoc</type>: HEALPix Multi-Order Coverage map The datatype smoc allows one to define and manipulate any region of the sky in such a way that basic operations like union, intersection can be performed very efficiently. It is dedicated to VO applications or VO data servers for building efficient procedures for which mapping knowledge is required like generic catalog cross-match, computation of data set intersections, etc. This encoding method is called "Multi-Order Coverage map" or "MOC". The goal behind the MOC is to get a spherical geometry description for any sky region in order to provide very fast and accurate union, intersection and equality operations between them. In order to accomplish this task, we based the system on a regular and hierarchical partitioning of the sphere, a process called tessellation, yielding pixels of different size. At level 0, the sky is divided into 12 pixels numbered 0 to 11. At the maximally defined level 29, there are 12 * 4^29 = 3458764513820540928 pixels. The MOC standard is described at http://www.ivoa.net/documents/MOC/ level/pixel1-pixel2 [...] level/pixel1-pixel2 [...] The empty set SELECT smoc '0/';]]> The whole sky SELECT smoc '0/0-11';]]> A disk around the point (0, 0) with radius 1 at MOC level 2 SELECT smoc '0/4 1/0 2 12-13 34-35 45 47 2/4 6 12 14 56-57 60-61 88 90-91 116-117 119 130-131 134-135 177 179 185 187';]]>
    pgsphere-1.5.1/doc/whatis.sgm000066400000000000000000000044021461140101500161000ustar00rootroot00000000000000 Overview What is pgSphere? pgSphere is an extra module for PostgreSQL which adds spherical data types. It provides: input and output of data containing, overlapping, and other operators various input and converting functions and operators circumference and area of an object spherical transformation indexing of spherical data types several input and output formats Hence, you can do a fast search and analysis for objects with spherical attributes as used in geographical, astronomical, or other applications using PostgreSQL. For instance, you can manage data of geographical objects around the world and astronomical data like star and other catalogs conveniently using an SQL interface. The aim of pgSphere is to provide uniform access to spherical data. Because PostgreSQL itself supports a lot of software interfaces, you can now use the same database with different utilities and applications. pgsphere-1.5.1/expected/000077500000000000000000000000001461140101500151255ustar00rootroot00000000000000pgsphere-1.5.1/expected/bounding_box_gist.out000066400000000000000000000162301461140101500213630ustar00rootroot00000000000000SET extra_float_digits = 2; SET enable_seqscan=true; CREATE TABLE bbox_ellipse (e sellipse not null); INSERT INTO bbox_ellipse VALUES ('<{10d, 0.1d}, (0d,0d), 0d>'); SELECT spoint '(5d, 0d)' @ sellipse '<{10d, 0.1d}, (0d,0d), 0d>' AS inside; inside -------- t (1 row) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; QUERY PLAN ------------------------------------------------------------ Aggregate -> Seq Scan on bbox_ellipse Filter: ('(0.087266462599716474 , 0)'::spoint @ e) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; QUERY PLAN ------------------------------------------------------------- Aggregate -> Seq Scan on bbox_ellipse Filter: ('(0.087266462599716474 , 0)'::spoint <@ e) (3 rows) -- The ellipse has semi-major axis length of 10 degrees along the equator, -- so (lon,lat) = (5,0) should be inside. CREATE INDEX idx_bbox_ellipse ON bbox_ellipse USING gist (e); ANALYZE bbox_ellipse; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; QUERY PLAN ---------------------------------------------------------------- Aggregate -> Index Scan using idx_bbox_ellipse on bbox_ellipse Index Cond: ('(0.087266462599716474 , 0)'::spoint @ e) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; QUERY PLAN ----------------------------------------------------------------- Aggregate -> Index Scan using idx_bbox_ellipse on bbox_ellipse Index Cond: ('(0.087266462599716474 , 0)'::spoint <@ e) (3 rows) SET enable_seqscan=true; CREATE TABLE bbox_poly (p spoly not null); INSERT INTO bbox_poly VALUES ('{(40d,-40d), (0d,80d), (-40d,-40d)}'); SELECT spoint '(0d, 0d)' @ spoly '{(40d,-40d), (0d,80d), (-40d,-40d)}' AS inside; inside -------- t (1 row) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; QUERY PLAN ----------------------------------------- Aggregate -> Seq Scan on bbox_poly Filter: ('(0 , 0)'::spoint @ p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN ------------------------------------------ Aggregate -> Seq Scan on bbox_poly Filter: ('(0 , 0)'::spoint <@ p) (3 rows) CREATE INDEX idx_bbox_poly ON bbox_poly USING gist (p); ANALYZE bbox_poly; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_poly on bbox_poly Index Cond: ('(0 , 0)'::spoint @ p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_poly on bbox_poly Index Cond: ('(0 , 0)'::spoint <@ p) (3 rows) SET enable_seqscan=true; CREATE TABLE bbox_path (p spath not null); INSERT INTO bbox_path VALUES ('{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}'); SELECT sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && spath '{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}' AS crossing; crossing ---------- t (1 row) SELECT spoint '(0d, 0d)' @ spath '{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}' AS inside; inside -------- t (1 row) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; QUERY PLAN --------------------------------------------------------------------------------------------------------- Aggregate -> Seq Scan on bbox_path Filter: ('( 6.1086523819801535, 1.5707963267948966, 0, ZXZ ), 0.34906585039886584'::sline && p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; QUERY PLAN ----------------------------------------- Aggregate -> Seq Scan on bbox_path Filter: ('(0 , 0)'::spoint @ p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN ------------------------------------------ Aggregate -> Seq Scan on bbox_path Filter: ('(0 , 0)'::spoint <@ p) (3 rows) CREATE INDEX idx_bbox_path ON bbox_path USING gist (p); ANALYZE bbox_path; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; QUERY PLAN ------------------------------------------------------------------------------------------------------------- Aggregate -> Index Scan using idx_bbox_path on bbox_path Index Cond: ('( 6.1086523819801535, 1.5707963267948966, 0, ZXZ ), 0.34906585039886584'::sline && p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_path on bbox_path Index Cond: ('(0 , 0)'::spoint @ p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_path on bbox_path Index Cond: ('(0 , 0)'::spoint <@ p) (3 rows) pgsphere-1.5.1/expected/bounding_box_gist_1.out000066400000000000000000000162141461140101500216050ustar00rootroot00000000000000SET extra_float_digits = 2; SET enable_seqscan=true; CREATE TABLE bbox_ellipse (e sellipse not null); INSERT INTO bbox_ellipse VALUES ('<{10d, 0.1d}, (0d,0d), 0d>'); SELECT spoint '(5d, 0d)' @ sellipse '<{10d, 0.1d}, (0d,0d), 0d>' AS inside; inside -------- t (1 row) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; QUERY PLAN ----------------------------------------------------------- Aggregate -> Seq Scan on bbox_ellipse Filter: ('(0.08726646259971647 , 0)'::spoint @ e) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; QUERY PLAN ------------------------------------------------------------ Aggregate -> Seq Scan on bbox_ellipse Filter: ('(0.08726646259971647 , 0)'::spoint <@ e) (3 rows) -- The ellipse has semi-major axis length of 10 degrees along the equator, -- so (lon,lat) = (5,0) should be inside. CREATE INDEX idx_bbox_ellipse ON bbox_ellipse USING gist (e); ANALYZE bbox_ellipse; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; QUERY PLAN --------------------------------------------------------------- Aggregate -> Index Scan using idx_bbox_ellipse on bbox_ellipse Index Cond: (e ~ '(0.08726646259971647 , 0)'::spoint) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; QUERY PLAN ---------------------------------------------------------------- Aggregate -> Index Scan using idx_bbox_ellipse on bbox_ellipse Index Cond: (e @> '(0.08726646259971647 , 0)'::spoint) (3 rows) SET enable_seqscan=true; CREATE TABLE bbox_poly (p spoly not null); INSERT INTO bbox_poly VALUES ('{(40d,-40d), (0d,80d), (-40d,-40d)}'); SELECT spoint '(0d, 0d)' @ spoly '{(40d,-40d), (0d,80d), (-40d,-40d)}' AS inside; inside -------- t (1 row) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; QUERY PLAN ----------------------------------------- Aggregate -> Seq Scan on bbox_poly Filter: ('(0 , 0)'::spoint @ p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN ------------------------------------------ Aggregate -> Seq Scan on bbox_poly Filter: ('(0 , 0)'::spoint <@ p) (3 rows) CREATE INDEX idx_bbox_poly ON bbox_poly USING gist (p); ANALYZE bbox_poly; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_poly on bbox_poly Index Cond: (p ~ '(0 , 0)'::spoint) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_poly on bbox_poly Index Cond: (p @> '(0 , 0)'::spoint) (3 rows) SET enable_seqscan=true; CREATE TABLE bbox_path (p spath not null); INSERT INTO bbox_path VALUES ('{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}'); SELECT sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && spath '{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}' AS crossing; crossing ---------- t (1 row) SELECT spoint '(0d, 0d)' @ spath '{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}' AS inside; inside -------- t (1 row) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; QUERY PLAN --------------------------------------------------------------------------------------------------------- Aggregate -> Seq Scan on bbox_path Filter: ('( 6.1086523819801535, 1.5707963267948966, 0, ZXZ ), 0.34906585039886584'::sline && p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; QUERY PLAN ----------------------------------------- Aggregate -> Seq Scan on bbox_path Filter: ('(0 , 0)'::spoint @ p) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN ------------------------------------------ Aggregate -> Seq Scan on bbox_path Filter: ('(0 , 0)'::spoint <@ p) (3 rows) CREATE INDEX idx_bbox_path ON bbox_path USING gist (p); ANALYZE bbox_path; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; count ------- 1 (1 row) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; count ------- 1 (1 row) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; QUERY PLAN ------------------------------------------------------------------------------------------------------------- Aggregate -> Index Scan using idx_bbox_path on bbox_path Index Cond: (p && '( 6.1086523819801535, 1.5707963267948966, 0, ZXZ ), 0.34906585039886584'::sline) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_path on bbox_path Index Cond: (p ~ '(0 , 0)'::spoint) (3 rows) EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using idx_bbox_path on bbox_path Index Cond: (p @> '(0 , 0)'::spoint) (3 rows) pgsphere-1.5.1/expected/box.out000066400000000000000000001252661461140101500164620ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- -- sbox and spoint -- SELECT spoint '(0d,90d)' @ sbox '((0d,80d),(360d,90d))' ; ?column? ---------- t (1 row) SELECT sbox '((309d,309d),(313d,313d))' ~ spoint '(310d,310d)' ; ?column? ---------- t (1 row) SELECT spoint '(310d,310d)' @ sbox '((309d,309d),(313d,313d))' ; ?column? ---------- t (1 row) SELECT sbox '((309d,309d),(313d,313d))' ~ spoint '(10d,10d)' ; ?column? ---------- f (1 row) SELECT spoint '(10d,10d)' @ sbox '((309d,309d),(313d,313d))' ; ?column? ---------- f (1 row) SELECT sbox '((309d,309d),(313d,313d))' !~ spoint '(310d,310d)' ; ?column? ---------- f (1 row) SELECT spoint '(310d,310d)' !@ sbox '((309d,309d),(313d,313d))' ; ?column? ---------- f (1 row) SELECT sbox '((309d,309d),(313d,313d))' !~ spoint '(10d,10d)' ; ?column? ---------- t (1 row) SELECT spoint '(10d,10d)' !@ sbox '((309d,309d),(313d,313d))' ; ?column? ---------- t (1 row) SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(10d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(10d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(20d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(20d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(310d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(310d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(320d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(320d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(310d,15d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(315d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(315d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(320d,15d)'; ?column? ---------- t (1 row) SELECT spoint '(320d, 15d)' @ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- t (1 row) SELECT spoint '(140d,-15d)' @ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(300d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(300d,15d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(300d,20d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(330d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(330d,15d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(330d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(0d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(0d,15d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(0d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(10d,10d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(10d,15d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(10d,20d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(30d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(30d,15d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(30d,20d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(180d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(180d,15d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(180d,20d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(300d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(320d,-80d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(320d,-85d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(320d,-90d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(180d,-90d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(180d,-89.99d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(300d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(320d,80d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(320d,85d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(320d,90d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(180d,90d)'; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(180d,89.99d)'; ?column? ---------- f (1 row) SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(300d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(320d,-80d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(320d,-85d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(320d,-90d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(180d,-90d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(180d,-89.99d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(300d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(320d,80d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(320d,85d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(320d,90d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(180d,90d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(180d,89.99d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d,-11d)'; ?column? ---------- f (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d,-10d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, -5d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 0d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 5d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 20d)'; ?column? ---------- t (1 row) SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 21d)'; ?column? ---------- f (1 row) SELECT spoint '(320d, 15d)' !@ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- f (1 row) SELECT spoint '(140d,-15d)' !@ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- t (1 row) SELECT sbox '((10d,10d),(20d,20d))' !~ spoint '(10d,10d)'; ?column? ---------- f (1 row) SELECT sbox '((270d,-10d),(300d,20d))' !~ spoint '(10d,10d)'; ?column? ---------- t (1 row) -- -- sbox (as point) and spoint -- SELECT sbox '((310d,310d),(310d,310d))' ~ spoint '(310d,310d)' ; ?column? ---------- t (1 row) SELECT spoint '(310d,310d)' @ sbox '((310d,310d),(310d,310d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,310d),(310d,310d))' ~ spoint '(10d,10d)' ; ?column? ---------- f (1 row) SELECT spoint '(11d,11d)' @ sbox '((310d,310d),(310d,310d))' ; ?column? ---------- f (1 row) -- -- sbox and circle -- -- Check negators / commutators SELECT scircle '<(0d, 70d),1d>' && sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- t (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' && scircle '<(0d, 70d),1d>'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 70d),1d>' !&& sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- f (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' !&& scircle '<(0d, 70d),1d>'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 50d),1d>' && sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- f (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' && scircle '<(0d, 50d),1d>'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 50d),1d>' !&& sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- t (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' !&& scircle '<(0d, 50d),1d>'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 70d),1d>' @ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- t (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' @ scircle '<(0d, 70d),1d>'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 70d),1d>' !@ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- f (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' !@ scircle '<(0d, 70d),1d>'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 50d),1d>' @ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- f (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' @ scircle '<(0d, 50d),1d>'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 50d),1d>' !@ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- t (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' !@ scircle '<(0d, 50d),1d>'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 70d),1d>' ~ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- f (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' ~ scircle '<(0d, 70d),1d>'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 70d),1d>' !~ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- t (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' !~ scircle '<(0d, 70d),1d>'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 50d),1d>' ~ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- f (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' ~ scircle '<(0d, 50d),1d>'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 50d),1d>' !~ sbox '((-10d, 60d),(10d, 80d))'; ?column? ---------- t (1 row) SELECT sbox '((-10d, 60d),(10d, 80d))' !~ scircle '<(0d, 50d),1d>'; ?column? ---------- t (1 row) -- Other Checks SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(360d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(360d,-90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(360d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(360d,-90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(360d, 89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(360d,-89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(360d, 89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(360d,-89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(360d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(360d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(360d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(360d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(270d, 90d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(270d,-90d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(270d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(270d,-90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(270d, 89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(270d,-89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(270d, 89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(270d,-89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(270d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(270d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(270d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(270d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(90d, 90d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(90d,-90d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(90d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(90d,-90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(90d, 89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(90d,-89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(90d, 89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(90d,-89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(90d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(90d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(90d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(90d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 89d),1d>' @ sbox '((0d, 80d),(90d, 90d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-89d),1d>' @ sbox '((0d,-80d),(90d,-90d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 89d),1d>' && sbox '((0d, 80d),(90d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-89d),1d>' && sbox '((0d,-80d),(90d,-90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 89d),1d>' @ sbox '((0d, 80d),(90d, 89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-89d),1d>' @ sbox '((0d,-80d),(90d,-89d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 89d),1d>' && sbox '((0d, 80d),(90d, 89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-89d),1d>' && sbox '((0d,-80d),(90d,-89d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 89d),1d>' @ sbox '((0d, 80d),(90d, 88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d,-89d),1d>' @ sbox '((0d,-80d),(90d,-88d))'; ?column? ---------- f (1 row) SELECT scircle '<(0d, 89d),1d>' && sbox '((0d, 80d),(90d, 88d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d,-89d),1d>' && sbox '((0d,-80d),(90d,-88d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),10d>' @ sbox '((0d, 80d),(360d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),10d>' ~ sbox '((0d, 80d),(360d, 90d))'; ?column? ---------- t (1 row) SELECT scircle '<(0d, 90d),10d>' && sbox '((0d, 80d),(360d, 90d))'; ?column? ---------- t (1 row) -- -- sbox and line -- SELECT sline( spoint '(0d,0d)', spoint '(0d,10d)' ) @ sbox '((0d,0d),(10d,10d))'; ?column? ---------- t (1 row) SELECT sline( spoint '(0d,0d)', spoint '(0d,0d)' ) @ sbox '((0d,0d),(10d,10d))'; ?column? ---------- t (1 row) SELECT sline( spoint '(0d,10d)', spoint '(10d,10d)' ) @ sbox '((0d,0d),(10d,10d))'; ?column? ---------- f (1 row) SELECT sline( spoint '(0d,0d)', spoint '(0d,10d)' ) && sbox '((0d,0d),(10d,10d))'; ?column? ---------- t (1 row) SELECT sline( spoint '(0d,0d)', spoint '(0d,0d)' ) && sbox '((0d,0d),(10d,10d))'; ?column? ---------- t (1 row) SELECT sline( spoint '(0d,10d)', spoint '(10d,10d)' ) && sbox '((0d,0d),(10d,10d))'; ?column? ---------- t (1 row) -- sbox is point, sline is point SELECT sbox '((310d,310d),(310d,310d))' ~ sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) @ sbox '((310d,310d),(310d,310d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,310d),(310d,310d))' ~ sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,11d)' , spoint '(11d,11d)' ) @ sbox '((310d,310d),(310d,310d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) @ sbox '((310d,90d),(310d,90d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,90d),(310d,90d))' ~ sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,310d),(310d,310d))' && sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) && sbox '((310d,310d),(310d,310d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,310d),(310d,310d))' && sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,11d)' , spoint '(11d,11d)' ) && sbox '((310d,310d),(310d,310d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) && sbox '((310d,90d),(310d,90d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,90d),(310d,90d))' && sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; ?column? ---------- t (1 row) -- sbox is point only SELECT sbox '((310d,10d),(310d,10d))' ~ sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(310d,10d))' && sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) @ sbox '((310d,10d),(310d,10d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) && sbox '((310d,10d),(310d,10d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(310d,10d))' ~ sline ( spoint '(10d,10d)', spoint '(10d,20d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(310d,10d))' && sline ( spoint '(10d,10d)', spoint '(10d,20d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,11d)' , spoint '(21d,11d)' ) @ sbox '((310d,10d),(310d,10d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,11d)' , spoint '(21d,11d)' ) && sbox '((310d,10d),(310d,10d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) @ sbox '((310d,90d),(310d,90d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) && sbox '((310d,90d),(310d,90d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,90d),(310d,90d))' ~ sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((310d,90d),(310d,90d))' && sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) ; ?column? ---------- t (1 row) -- sline is point only SELECT sbox '((310d,10d),(320d,20d))' ~ sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' && sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' && sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) @ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- t (1 row) SELECT sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) && sbox '((310d,10d),(320d,20d))' ; ?column? ---------- t (1 row) SELECT sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) @ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- t (1 row) SELECT sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) && sbox '((310d,10d),(320d,20d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,10d),(320d,20d))' ~ sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((310d,10d),(320d,20d))' && sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d, 11d)' , spoint '(11d,11d)' ) @ sbox '((310d,10d),(320d,20d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d, 11d)' , spoint '(11d,11d)' ) && sbox '((310d,10d),(320d,20d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d, 90d)' , spoint '(11d,90d)' ) @ sbox '((310d,80d),(320d,90d))' ; ?column? ---------- t (1 row) SELECT sline ( spoint '(11d, 90d)' , spoint '(11d,90d)' ) && sbox '((310d,80d),(320d,90d))' ; ?column? ---------- t (1 row) SELECT sline ( spoint '(11d, 85d)' , spoint '(11d,85d)' ) @ sbox '((310d,80d),(320d,90d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(11d, 85d)' , spoint '(11d,85d)' ) && sbox '((310d,80d),(320d,90d))' ; ?column? ---------- f (1 row) SELECT sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) @ sbox '((310d,80d),(320d,90d))' ; ?column? ---------- t (1 row) SELECT sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) && sbox '((310d,80d),(320d,90d))' ; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(320d,90d))' ~ sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(320d,90d))' && sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(320d,90d))' ~ sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((310d,80d),(320d,90d))' && sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) ; ?column? ---------- t (1 row) -- sline / sbox near pole SELECT sbox '((20d,80d),(200d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,85d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((20d,80d),(200d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,85d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((10d,80d),(210d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((10d,80d),(210d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((10d,80d),(211d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((10d,80d),(211d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(199d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((190d,80d),(199d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(200d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(200d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(210d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(210d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,80d),(210d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,80d),(210d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((210d,80d),(220d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((210d,80d),(220d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(199d,88d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((190d,80d),(199d,88d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((190d,80d),(200d,88d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((190d,80d),(200d,88d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((190d,80d),(210d,88d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((190d,80d),(210d,88d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,80d),(210d,88d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,80d),(210d,88d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((210d,80d),(220d,88d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((210d,80d),(220d,88d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; ?column? ---------- f (1 row) -- sbox near equator SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,85d)', spoint '( 20d, 85d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,85d)', spoint '( 20d, 85d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(190d, 0d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(190d, 0d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(205d, 0d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(205d, 0d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(202d, 0d)', spoint '(207d, 0d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(202d, 0d)', spoint '(207d, 0d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,-5d)', spoint '(200d, 5d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,-5d)', spoint '(200d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d,-5d)', spoint '(205d, 5d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d,-5d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(200d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(200d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(200d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(200d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d, 0d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d, 0d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d, 0d)', spoint '(205d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d, 0d)', spoint '(205d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,-5d)', spoint '(200d, 15d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,-5d)', spoint '(200d, 15d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d,-5d)', spoint '(205d, 15d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d,-5d)', spoint '(205d, 15d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(210d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(210d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(211d, 11d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(211d, 11d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(211d, 11d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(211d, 11d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(210d, 10d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(210d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(209d, 9d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(209d, 9d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(201d, 1d)', spoint '(211d, 11d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(201d, 1d)', spoint '(211d, 11d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(201d, 0d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(201d, 0d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(201d, 1d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(201d, 1d)', spoint '(205d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,10d)', spoint '(210d, 10d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,10d)', spoint '(210d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,10d)', spoint '(205d, 10d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,10d)', spoint '(205d, 10d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(200d, 0d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(200d, 0d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,10d)', spoint '(200d, 20d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,10d)', spoint '(200d, 20d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d,10d)', spoint '(205d, 20d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d,10d)', spoint '(205d, 20d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(210d,10d)', spoint '(210d, 20d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(210d,10d)', spoint '(210d, 20d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(200d, -5d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(200d, -5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d, 0d)', spoint '(205d, -5d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d, 0d)', spoint '(205d, -5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(210d, 0d)', spoint '(210d, -5d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(210d, 0d)', spoint '(210d, -5d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((200d,0d),(210d,10d))' ~ sline '( -10d, -10d, 200d, ZXZ ), 20d' ; ?column? ---------- f (1 row) SELECT sbox '((200d,0d),(210d,10d))' && sline '( -10d, -10d, 200d, ZXZ ), 20d' ; ?column? ---------- t (1 row) -- general position SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, 0d)', spoint '(190d, 0d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, 0d)', spoint '(190d, 0d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(190d, -40d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(190d, -40d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -50d)', spoint '(190d, -50d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -50d)', spoint '(190d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -40d)', spoint '(189d, -40d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -40d)', spoint '(189d, -40d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -50d)', spoint '(189d, -50d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -50d)', spoint '(189d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -40d)', spoint '(191d, -40d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -40d)', spoint '(191d, -40d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -50d)', spoint '(191d, -50d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -50d)', spoint '(191d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(170d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(170d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(170d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(170d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(170d, -51d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(170d, -51d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(190d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(190d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -41d)', spoint '(189d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -41d)', spoint '(189d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -39d)', spoint '(180d, -51d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -39d)', spoint '(180d, -51d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(180d, -51d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(180d, -51d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(180d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(180d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(180d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(180d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(180d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(180d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -39d)', spoint '(182d, -51d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -39d)', spoint '(182d, -51d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(182d, -51d)' ) ; ?column? ---------- f (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(182d, -51d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(182d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(182d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(182d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(182d, -50d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(182d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(182d, -49d)' ) ; ?column? ---------- t (1 row) SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(190d, -40d)' ) ; ?column? ---------- t (1 row) -- all less/equals/greater permutations of spoint coordinates with respect to a fixed sbox select 'f' as expected, spoint(0.50, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(0.50, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(0.50, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(0.50, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(0.50, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(0.75, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 't' as expected, spoint(0.75, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 't' as expected, spoint(0.75, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 't' as expected, spoint(0.75, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 'f' as expected, spoint(0.75, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.00, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 't' as expected, spoint(1.00, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 't' as expected, spoint(1.00, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 't' as expected, spoint(1.00, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 'f' as expected, spoint(1.00, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.25, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 't' as expected, spoint(1.25, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 't' as expected, spoint(1.25, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 't' as expected, spoint(1.25, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- t | t (1 row) select 'f' as expected, spoint(1.25, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.50, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.50, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.50, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.50, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) select 'f' as expected, spoint(1.50, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; expected | actual ----------+-------- f | f (1 row) -- wide spherical boxes pgsphere-1.5.1/expected/circle.out000066400000000000000000000354671461140101500171360ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- Input/Output --- SELECT scircle_deg(spoint(10,10), 90); scircle_deg ------------------------------------------ <(0.57522204 , -0.57522204) , 1.5707963> (1 row) SELECT scircle_deg(spoint(10,10), 91); ERROR: radius must not be greater than 90 degrees or less than 0 SELECT scircle_deg(spoint(0,0), 0); scircle_deg --------------- <(0 , 0) , 0> (1 row) SELECT scircle_deg(spoint(10,10), -1); ERROR: radius must not be greater than 90 degrees or less than 0 SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; scircle ------------------------------------------- <(0.2727077 , 0.018180513) , 0.017453293> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; scircle ------------------------------------------- <(0.2727077 , 0.018180513) , 0.026179939> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; scircle ----------------------------------- <(0.2727077 , 0.018180513) , 0.1> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; scircle ----------------------------------------- <(0.2727077 , 0.018180513) , 1.5707963> (1 row) SELECT set_sphere_output( 'DEG' ); set_sphere_output ------------------- SET DEG (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; scircle ------------------------------- <(15.625d , 1.0416667d) , 1d> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; scircle --------------------------------- <(15.625d , 1.0416667d) , 1.5d> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; scircle -------------------------------------- <(15.625d , 1.0416667d) , 5.729578d> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; scircle -------------------------------- <(15.625d , 1.0416667d) , 90d> (1 row) SELECT set_sphere_output( 'DMS' ); set_sphere_output ------------------- SET DMS (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; scircle ---------------------------------------------- <( 15d 37m 30s , + 1d 2m 30s) , 1d 0m 0s> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; scircle ---------------------------------------------- <( 15d 37m 30s , + 1d 2m 30s) , 1d 30m 0s> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; scircle ------------------------------------------------------ <( 15d 37m 30s , + 1d 2m 30s) , 5d 43m 46.480625s> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; scircle ---------------------------------------------- <( 15d 37m 30s , + 1d 2m 30s) , 90d 0m 0s> (1 row) SELECT set_sphere_output( 'HMS' ); set_sphere_output ------------------- SET HMS (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; scircle ---------------------------------------------- <( 1h 2m 30s , + 1d 2m 30s) , 1d 0m 0s> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; scircle ---------------------------------------------- <( 1h 2m 30s , + 1d 2m 30s) , 1d 30m 0s> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; scircle ------------------------------------------------------ <( 1h 2m 30s , + 1d 2m 30s) , 5d 43m 46.480625s> (1 row) SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; scircle ---------------------------------------------- <( 1h 2m 30s , + 1d 2m 30s) , 90d 0m 0s> (1 row) SELECT set_sphere_output( 'DMS' ); set_sphere_output ------------------- SET DMS (1 row) -- Functions -- checking spherical circle operators SELECT scircle '<(0, 90d),1>' = '<(0, 90d),1>' ; ?column? ---------- t (1 row) SELECT scircle '<(0,-90d),1>' <> '<(0, 90d),1>' ; ?column? ---------- t (1 row) -- float8 dist(scircle,scircle) SELECT 180.0*dist('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle,'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); ?column? ---------- 19.8 (1 row) SELECT 180.0*dist('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 13 (1 row) SELECT 180.0*dist('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 20 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 0.5 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 0 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 87 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 178 (1 row) -- spoint center(scircle) SELECT center('< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle); center ------------------------------- ( 15d 37m 30s , + 1d 2m 30s) (1 row) SELECT center('< (1h 2m 30s , +90d 0m 0s), 1.0d >'::scircle); center ------------------------------ ( 15d 37m 30s , +90d 0m 0s) (1 row) -- scircle scircle(spoint) SELECT scircle('(0d,0d)'::spoint); scircle -------------------------------------------- <( 0d 0m 0s , + 0d 0m 0s) , 0d 0m 0s> (1 row) SELECT scircle('(0d,90d)'::spoint); scircle -------------------------------------------- <( 0d 0m 0s , +90d 0m 0s) , 0d 0m 0s> (1 row) SELECT scircle('(0d,-90d)'::spoint); scircle -------------------------------------------- <( 0d 0m 0s , -90d 0m 0s) , 0d 0m 0s> (1 row) -- Operators -- = operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (25h 0m 0s,+1d), 1d 30m >'::scircle ; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle='< (13h 0m 0s,+85d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle='< (13h 0m 0s,-85d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle='< (2h 0m 0s,+90d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle='< (2h 0m 0s,-90d), 1.5d >'::scircle ; ?column? ---------- t (1 row) -- should be "false" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,-1d), 1.5d >'::scircle ; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 2.5d >'::scircle ; ?column? ---------- f (1 row) -- <> operator -- should be "false" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 1.5d >'::scircle ; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (25h 0m 0s,+1d), 1d 30m >'::scircle ; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle <> '< (13h 0m 0s,+85d), 1.5d >'::scircle ; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle <> '< (13h 0m 0s,-85d), 1.5d >'::scircle ; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle <> '< (2h 0m 0s,+90d), 1.5d >'::scircle ; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle <> '< (2h 0m 0s,-90d), 1.5d >'::scircle ; ?column? ---------- f (1 row) -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,-1d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 2.5d >'::scircle ; ?column? ---------- t (1 row) -- && operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 0.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,-1d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0s,0d), 15d >'::scircle; ?column? ---------- t (1 row) SELECT '< (2h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0.1s,0d), 15d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (23h 0m 0.1s,0d), 15d >'::scircle; ?column? ---------- t (1 row) -- should be "false" SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle && '< (1h 0m 0s,-1d), 0.5d >'::scircle; ?column? ---------- f (1 row) SELECT '< (1d 0m 0s,+1d), 1.0d >'::scircle && '< (0d 0m 0s,0d), 0.1d >'::scircle; ?column? ---------- f (1 row) -- @@ operator SELECT @@ '< (1h 2m 3s , +1d 2m 3s), 1.0d >'::scircle; ?column? ------------------------------ ( 15d 30m 45s , + 1d 2m 3s) (1 row) SELECT @@ '< (1h 2m 3s , +90d 0m 0s), 1.0d >'::scircle; ?column? ------------------------------ ( 15d 30m 45s , +90d 0m 0s) (1 row) -- <-> operator SELECT 180.0*('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle<->'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); ?column? ---------- 19.8 (1 row) SELECT 180.0*('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 13 (1 row) SELECT 180.0*('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 20 (1 row) SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 0.5 (1 row) SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 0 (1 row) SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 87 (1 row) SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 178 (1 row) -- scircle @ scircle operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (2d 0m 0s,+1d), 0.5d >'::scircle @ '< (1d 0m 0s,0d), 3.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; ?column? ---------- t (1 row) -- should be "false" SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (2h 0m 0s,+1d), 1.5d >'::scircle; ?column? ---------- f (1 row) SELECT '< (2d 0m 0s,+1d), 1.5d >'::scircle @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; ?column? ---------- f (1 row) -- scircle ~ scircle operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1d 0m 0s,0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 0.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; ?column? ---------- t (1 row) -- should be "false" SELECT '< (2h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; ?column? ---------- f (1 row) SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 1.5d >'::scircle; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; ?column? ---------- f (1 row) -- spoint @ scircle operator -- should be "true" SELECT '(1h 0m 0s,+1d) '::spoint @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '(2d 0m 0s,+1d) '::spoint @ '< (1d 0m 0s, 0d), 3.5d >'::scircle; ?column? ---------- t (1 row) SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; ?column? ---------- t (1 row) SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; ?column? ---------- t (1 row) SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; ?column? ---------- t (1 row) -- should be "false" SELECT '(1h 0m 0s,+1d )'::spoint @ '< (2h 0m 0s,-1d), 1.5d >'::scircle; ?column? ---------- f (1 row) SELECT '(3d 30m 0s,+1d )'::spoint @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; ?column? ---------- f (1 row) SELECT '(1h 0m 0s,+88.99d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; ?column? ---------- f (1 row) SELECT '(1h 0m 0s,-88.99d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; ?column? ---------- f (1 row) -- spoint ~ scircle operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d) '::spoint; ?column? ---------- t (1 row) SELECT '< (1d 0m 0s, 0d), 3.5d >'::scircle ~ '(2d 0m 0s,+1d) '::spoint; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; ?column? ---------- t (1 row) SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; ?column? ---------- t (1 row) -- should be "false" SELECT '< (2h 0m 0s,-1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d )'::spoint; ?column? ---------- f (1 row) SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '(3d 30m 0s,+1d )'::spoint; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+88.99d)'::spoint; ?column? ---------- f (1 row) SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-88.99d)'::spoint; ?column? ---------- f (1 row) pgsphere-1.5.1/expected/circle_extended.out000066400000000000000000000123411461140101500210000ustar00rootroot00000000000000-- indexed operations..... SET enable_indexscan=off; select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; count ------- 13 (1 row) select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; count ------- 13 (1 row) select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; count ------- 1 (1 row) select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; count ------- 1 (1 row) select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; count ------- 13 (1 row) select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; count ------- 13 (1 row) select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; count ------- 13 (1 row) SET enable_indexscan=on; select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; count ------- 361 (1 row) select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; count ------- 13 (1 row) select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; count ------- 13 (1 row) select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; count ------- 1 (1 row) select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; count ------- 1 (1 row) select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; count ------- 361 (1 row) select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; count ------- 13 (1 row) select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; count ------- 13 (1 row) select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; count ------- 13 (1 row) -- "Cross-correlation" about 30 seconds on PIII-750 select count(spoint_data.sp) from spoint_data,scircle_data where spoint_data.sp @ scircle_data.sc; count ------- 78842 (1 row) pgsphere-1.5.1/expected/contains.out000066400000000000000000000217751461140101500175100ustar00rootroot00000000000000/* This set of tests is designed to verify the compliance of the contain operation with the DE-9IM model */ -- sline vs spoint -- the point lies far beyond the line select 'sline ~ spoint', 'f' as expected, sline(spoint'(270d,10d)', spoint'(270d,30d)') ~ spoint'(0d, 50d)' as actual; ?column? | expected | actual ----------------+----------+-------- sline ~ spoint | f | f (1 row) -- the point lies in the boundary of line select 'sline ~ spoint', 'f' as expected, sline(spoint'(270d,10d)', spoint'(270d,30d)') ~ spoint'(270d, 10d)' as actual; ?column? | expected | actual ----------------+----------+-------- sline ~ spoint | f | t (1 row) -- the point lies in the interior of line select 'sline ~ spoint', 't' as expected, sline(spoint'(270d,10d)', spoint'(270d,30d)') ~ spoint'(270d, 20d)' as actual; ?column? | expected | actual ----------------+----------+-------- sline ~ spoint | t | t (1 row) -- the point and line that degenerated into the point coincide select 'sline ~ spoint', 't' as expected, sline(spoint'(270d,10d)', spoint'(270d,10d)') ~ spoint'(270d, 10d)' as actual; ?column? | expected | actual ----------------+----------+-------- sline ~ spoint | t | t (1 row) -- the point and line that degenerated into the point do not coincide select 'sline ~ spoint', 'f' as expected, sline(spoint'(270d,10d)', spoint'(270d,10d)') ~ spoint'(270d, 20d)' as actual; ?column? | expected | actual ----------------+----------+-------- sline ~ spoint | f | f (1 row) -- spoint vs scircle -- the point lies far beyond the circle select 'spoint @ scircle', 'f' as expected, spoint'(0d,0d)' @ scircle'<(0d,90d),50d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | f | f (1 row) -- the point lies in the boundary of circle select 'spoint @ scircle', 'f' as expected, spoint'(0d,80d)' @ scircle'<(0d,90d),10d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | f | t (1 row) -- the point lies in the interior of circle select 'spoint @ scircle', 't' as expected, spoint'(0d,80d)' @ scircle'<(0d,90d),50d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | t | t (1 row) -- the point and circle that degenerated into the point coincide select 'spoint @ scircle', 't' as expected, spoint'(0d,90d)' @ scircle'<(0d,90d),0d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | t | t (1 row) -- the point and circle that degenerated into the point do not coincide select 'spoint @ scircle', 'f' as expected, spoint'(0d,50d)' @ scircle'<(0d,90d),0d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | f | f (1 row) -- sellipse vs spoint -- the point lies far beyond the ellipse select 'sellipse ~ spoint', 'f' as expected, sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' ~ spoint'(0d, 0d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | f | f (1 row) -- the point lies in the boundary of ellipse select 'sellipse ~ spoint', 'f' as expected, sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' ~ spoint'(0d, 70d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | f | t (1 row) -- the point lies in the interior of ellipse select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' ~ spoint'(90d, 65d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | t | t (1 row) -- the point lies in the boundary of ellipse that degenerated into the line select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 10d , 0d }, (0d , 0d) , 0d>' ~ spoint'(10d, 0d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | t | t (1 row) -- the point lies in the interior of ellipse that degenerated into the line select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 10d , 0d }, (0d , 0d) , 0d>' ~ spoint'(0d, 0d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | t | t (1 row) -- the point and ellipse that degenerated into the point coincide select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 0d , 0d }, (0d , 90d) , 0d>' ~ spoint'(0d, 90d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | t | t (1 row) -- the point and ellipse that degenerated into the point do not coincide select 'sellipse ~ spoint', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 90d) , 0d>' ~ spoint'(0d, 91d)' as actual; ?column? | expected | actual -------------------+----------+-------- sellipse ~ spoint | f | f (1 row) -- spath vs spoint -- the point lies far beyond the opened path select 'spath ~ spoint', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d) }' ~ spoint'(0d, 90d)' as actual; ?column? | expected | actual ----------------+----------+-------- spath ~ spoint | f | f (1 row) -- the point lies in the boundary of opened path select 'spath ~ spoint', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d) }' ~ spoint'(-10d, 0d)' as actual; ?column? | expected | actual ----------------+----------+-------- spath ~ spoint | f | t (1 row) -- the point lies in the boundary of unsimple opened path select 'spath ~ spoint', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d),(-5d, 0d) }' ~ spoint'(-5d, 0d)' as actual; ?column? | expected | actual ----------------+----------+-------- spath ~ spoint | f | t (1 row) -- the point lies in the interior of opened path select 'spath ~ spoint', 't' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d) }' ~ spoint'(9d, 0d)' as actual; ?column? | expected | actual ----------------+----------+-------- spath ~ spoint | t | t (1 row) -- the point lies in the interior of closed path select 'spath ~ spoint', 't' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d),(-10d, 0d) }' ~ spoint'(-10d, 0d)' as actual; ?column? | expected | actual ----------------+----------+-------- spath ~ spoint | t | t (1 row) -- spoly vs spoint -- the point lies far beyond the polygon select 'spoly ~ spoint', 'f' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(0d, 90d)' as actual; ?column? | expected | actual ----------------+----------+-------- spoly ~ spoint | f | f (1 row) -- the point lies in the boundary of polygon select 'spoly ~ spoint', 'f' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(5d, 0d)' as actual; ?column? | expected | actual ----------------+----------+-------- spoly ~ spoint | f | t (1 row) -- the point lies in the boundary of polygon select 'spoly ~ spoint', 'f' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(20d, 20d)' as actual; ?column? | expected | actual ----------------+----------+-------- spoly ~ spoint | f | t (1 row) -- the point lies in the interior of polygon select 'spoly ~ spoint', 't' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(5d, 5d)' as actual; ?column? | expected | actual ----------------+----------+-------- spoly ~ spoint | t | t (1 row) -- sbox vs spoint -- the point lies far beyond the box select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(0d, 90d)' as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | f | f (1 row) -- the point lies in the boundary of box select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(0d, 5d)' as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | f | t (1 row) -- the point lies in the boundary of box select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(0d, 0d)' as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | f | t (1 row) -- the point lies in the interior of box select 'sbox ~ spoint', 't' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(5d, 5d)' as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | t | t (1 row) -- the point and box that degenerated into the point coincide select 'sbox ~ spoint', 't' as expected, sbox'( (0d,0d), (0d,0d) )' ~ spoint'(0d, 0d)' as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | t | t (1 row) -- the point and box that degenerated into the point do not coincide select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (0d,0d) )' ~ spoint'(0d, 1d)' as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | f | f (1 row) pgsphere-1.5.1/expected/contains_ops.out000066400000000000000000000652261461140101500203700ustar00rootroot00000000000000-- scircle vs spoint select 'scircle @> spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) @> spoint(1.0,1.0) as actual; ?column? | expected | actual -------------------+----------+-------- scircle @> spoint | t | t (1 row) select 'scircle @> spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) @> spoint(2.0,2.0) as actual; ?column? | expected | actual -------------------+----------+-------- scircle @> spoint | f | f (1 row) select 'spoint <@ scircle', 't' as expected, spoint(1.0,1.0) <@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- spoint <@ scircle | t | t (1 row) select 'spoint <@ scircle', 'f' as expected, spoint(2.0,2.0) <@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- spoint <@ scircle | f | f (1 row) select 'scircle !@> spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !@> spoint(1.0,1.0) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !@> spoint | f | f (1 row) select 'scircle !@> spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) !@> spoint(2.0,2.0) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !@> spoint | t | t (1 row) select 'spoint !<@ scircle', 'f' as expected, spoint(1.0,1.0) !<@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- spoint !<@ scircle | f | f (1 row) select 'spoint !<@ scircle', 't' as expected, spoint(2.0,2.0) !<@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- spoint !<@ scircle | t | t (1 row) -- sbox vs spoint select 'sbox @> spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> spoint(1.1,1.1) as actual; ?column? | expected | actual ----------------+----------+-------- sbox @> spoint | t | t (1 row) select 'sbox @> spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> spoint(2.0,2.0) as actual; ?column? | expected | actual ----------------+----------+-------- sbox @> spoint | f | f (1 row) select 'spoint <@ sbox', 't' as expected, spoint(1.1,1.1) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- spoint <@ sbox | t | t (1 row) select 'spoint <@ sbox', 'f' as expected, spoint(2.0,2.0) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- spoint <@ sbox | f | f (1 row) select 'sbox !@> spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> spoint(1.1,1.1) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !@> spoint | f | f (1 row) select 'sbox !@> spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> spoint(2.0,2.0) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !@> spoint | t | t (1 row) select 'spoint !<@ sbox', 'f' as expected, spoint(1.1,1.1) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- spoint !<@ sbox | f | f (1 row) select 'spoint !<@ sbox', 't' as expected, spoint(2.0,2.0) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- spoint !<@ sbox | t | t (1 row) -- spoly vs spoint select 'spoly @> spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> spoint(1.1,1.1) as actual; ?column? | expected | actual -----------------+----------+-------- spoly @> spoint | t | t (1 row) select 'spoly @> spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> spoint(2.0,2.0) as actual; ?column? | expected | actual -----------------+----------+-------- spoly @> spoint | f | f (1 row) select 'spoint <@ spoly', 't' as expected, spoint(1.1,1.1) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoint <@ spoly | t | t (1 row) select 'spoint <@ spoly', 'f' as expected, spoint(2.0,2.0) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoint <@ spoly | f | f (1 row) select 'spoly !@> spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> spoint(1.1,1.1) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !@> spoint | f | f (1 row) select 'spoly !@> spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> spoint(2.0,2.0) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !@> spoint | t | t (1 row) select 'spoint !<@ spoly', 'f' as expected, spoint(1.1,1.1) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- spoint !<@ spoly | f | f (1 row) select 'spoint !<@ spoly', 't' as expected, spoint(2.0,2.0) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- spoint !<@ spoly | t | t (1 row) -- scircle vs scircle select 'scircle @> scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) @> scircle(spoint(1.0,1.0),0.05) as actual; ?column? | expected | actual --------------------+----------+-------- scircle @> scircle | t | t (1 row) select 'scircle @> scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) @> scircle(spoint(2.0,2.0),0.05) as actual; ?column? | expected | actual --------------------+----------+-------- scircle @> scircle | f | f (1 row) select 'scircle @> scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) @> scircle(spoint(1.0,1.0),0.2) as actual; ?column? | expected | actual --------------------+----------+-------- scircle @> scircle | f | f (1 row) select 'scircle <@ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.05) <@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- scircle <@ scircle | t | t (1 row) select 'scircle <@ scircle', 'f' as expected, scircle(spoint(2.0,2.0),0.05) <@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- scircle <@ scircle | f | f (1 row) select 'scircle <@ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.2) <@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- scircle <@ scircle | f | f (1 row) select 'scircle !@> scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !@> scircle(spoint(1.0,1.0),0.05) as actual; ?column? | expected | actual ---------------------+----------+-------- scircle !@> scircle | f | f (1 row) select 'scircle !@> scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !@> scircle(spoint(2.0,2.0),0.05) as actual; ?column? | expected | actual ---------------------+----------+-------- scircle !@> scircle | t | t (1 row) select 'scircle !@> scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !@> scircle(spoint(1.0,1.0),0.2) as actual; ?column? | expected | actual ---------------------+----------+-------- scircle !@> scircle | t | t (1 row) select 'scircle !<@ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.05) !<@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual ---------------------+----------+-------- scircle !<@ scircle | f | f (1 row) select 'scircle !<@ scircle', 't' as expected, scircle(spoint(2.0,2.0),0.05) !<@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual ---------------------+----------+-------- scircle !<@ scircle | t | t (1 row) select 'scircle !<@ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.2) !<@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual ---------------------+----------+-------- scircle !<@ scircle | t | t (1 row) -- sbox vs scircle select 'sbox @> scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- sbox @> scircle | t | t (1 row) select 'sbox @> scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> scircle(spoint(2.0,2.0),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- sbox @> scircle | f | f (1 row) select 'sbox @> scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- sbox @> scircle | f | f (1 row) select 'scircle <@ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle <@ sbox | t | t (1 row) select 'scircle <@ sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.01) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle <@ sbox | f | f (1 row) select 'scircle <@ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle <@ sbox | f | f (1 row) select 'sbox !@> scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual ------------------+----------+-------- sbox !@> scircle | f | f (1 row) select 'sbox !@> scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> scircle(spoint(2.0,2.0),0.01) as actual; ?column? | expected | actual ------------------+----------+-------- sbox !@> scircle | t | t (1 row) select 'sbox !@> scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- sbox !@> scircle | t | t (1 row) select 'scircle !<@ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ------------------+----------+-------- scircle !<@ sbox | f | f (1 row) select 'scircle !<@ sbox', 't' as expected, scircle(spoint(2.0,2.0),0.01) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ------------------+----------+-------- scircle !<@ sbox | t | t (1 row) select 'scircle !<@ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ------------------+----------+-------- scircle !<@ sbox | t | t (1 row) -- select 'scircle @> sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) @> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle @> sbox | t | t (1 row) select 'scircle @> sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.2) @> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle @> sbox | f | f (1 row) select 'scircle @> sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) @> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle @> sbox | f | f (1 row) select 'sbox <@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) <@ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- sbox <@ scircle | t | t (1 row) select 'sbox <@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) <@ scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- sbox <@ scircle | f | f (1 row) select 'sbox <@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) <@ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- sbox <@ scircle | f | f (1 row) select 'scircle !@> sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) !@> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ------------------+----------+-------- scircle !@> sbox | f | f (1 row) select 'scircle !@> sbox', 't' as expected, scircle(spoint(2.0,2.0),0.2) !@> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ------------------+----------+-------- scircle !@> sbox | t | t (1 row) select 'scircle !@> sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) !@> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ------------------+----------+-------- scircle !@> sbox | t | t (1 row) select 'sbox !<@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !<@ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- sbox !<@ scircle | f | f (1 row) select 'sbox !<@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !<@ scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- sbox !<@ scircle | t | t (1 row) select 'sbox !<@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !<@ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual ------------------+----------+-------- sbox !<@ scircle | t | t (1 row) -- spoly vs scircle select 'spoly @> scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual ------------------+----------+-------- spoly @> scircle | t | t (1 row) select 'spoly @> scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- spoly @> scircle | f | f (1 row) select 'spoly @> scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- spoly @> scircle | f | f (1 row) select 'scircle <@ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.01) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle <@ spoly | t | t (1 row) select 'scircle <@ spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.01) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle <@ spoly | f | f (1 row) select 'scircle <@ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.2) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle <@ spoly | f | f (1 row) select 'spoly !@> scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual -------------------+----------+-------- spoly !@> scircle | f | f (1 row) select 'spoly !@> scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual -------------------+----------+-------- spoly !@> scircle | t | t (1 row) select 'spoly !@> scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual -------------------+----------+-------- spoly !@> scircle | t | t (1 row) select 'scircle !<@ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -------------------+----------+-------- scircle !<@ spoly | f | f (1 row) select 'scircle !<@ spoly', 't' as expected, scircle(spoint(2.0,2.0),0.01) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -------------------+----------+-------- scircle !<@ spoly | t | t (1 row) select 'scircle !<@ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.2) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -------------------+----------+-------- scircle !<@ spoly | t | t (1 row) -- select 'scircle @> spoly', 't' as expected, scircle(spoint(1.1,1.1),0.5) @> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle @> spoly | t | t (1 row) select 'scircle @> spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.5) @> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle @> spoly | f | f (1 row) select 'scircle @> spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.05) @> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle @> spoly | f | f (1 row) select 'spoly <@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly <@ scircle(spoint(1.1,1.1),0.5) as actual; ?column? | expected | actual ------------------+----------+-------- spoly <@ scircle | t | t (1 row) select 'spoly <@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly <@ scircle(spoint(2.0,2.0),0.5) as actual; ?column? | expected | actual ------------------+----------+-------- spoly <@ scircle | f | f (1 row) select 'spoly <@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly <@ scircle(spoint(1.1,1.1),0.05) as actual; ?column? | expected | actual ------------------+----------+-------- spoly <@ scircle | f | f (1 row) select 'scircle !@> spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.5) !@> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -------------------+----------+-------- scircle !@> spoly | f | f (1 row) select 'scircle !@> spoly', 't' as expected, scircle(spoint(2.0,2.0),0.5) !@> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -------------------+----------+-------- scircle !@> spoly | t | t (1 row) select 'scircle !@> spoly', 't' as expected, scircle(spoint(1.1,1.1),0.05) !@> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -------------------+----------+-------- scircle !@> spoly | t | t (1 row) select 'spoly !<@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !<@ scircle(spoint(1.1,1.1),0.5) as actual; ?column? | expected | actual -------------------+----------+-------- spoly !<@ scircle | f | f (1 row) select 'spoly !<@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !<@ scircle(spoint(2.0,2.0),0.5) as actual; ?column? | expected | actual -------------------+----------+-------- spoly !<@ scircle | t | t (1 row) select 'spoly !<@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !<@ scircle(spoint(1.1,1.1),0.05) as actual; ?column? | expected | actual -------------------+----------+-------- spoly !<@ scircle | t | t (1 row) -- sbox vs spoly select 'sbox @> spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) @> '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- sbox @> spoly | t | t (1 row) select 'sbox @> spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) @> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- sbox @> spoly | f | f (1 row) select 'sbox @> spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) @> '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- sbox @> spoly | f | f (1 row) select 'spoly <@ sbox', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly <@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ---------------+----------+-------- spoly <@ sbox | t | t (1 row) select 'spoly <@ sbox', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly <@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ---------------+----------+-------- spoly <@ sbox | f | f (1 row) select 'spoly <@ sbox', 'f' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly <@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ---------------+----------+-------- spoly <@ sbox | f | f (1 row) select 'sbox !@> spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !@> '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- sbox !@> spoly | f | f (1 row) select 'sbox !@> spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !@> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- sbox !@> spoly | t | t (1 row) select 'sbox !@> spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !@> '{(0.9,0.9),(1.1,0.9),(1.1,1.1),(0.9,1.1)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- sbox !@> spoly | t | t (1 row) select 'spoly !<@ sbox', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !<@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ----------------+----------+-------- spoly !<@ sbox | f | f (1 row) select 'spoly !<@ sbox', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !<@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ----------------+----------+-------- spoly !<@ sbox | t | t (1 row) select 'spoly !<@ sbox', 't' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly !<@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ----------------+----------+-------- spoly !<@ sbox | t | t (1 row) -- spoly vs spoly select 'spoly @> spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @> '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly @> spoly | t | t (1 row) select 'spoly @> spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly @> spoly | f | f (1 row) select 'spoly @> spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @> '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly @> spoly | f | f (1 row) select 'spoly <@ spoly', 't' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly <@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly <@ spoly | t | t (1 row) select 'spoly <@ spoly', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly <@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly <@ spoly | f | f (1 row) select 'spoly <@ spoly', 'f' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly <@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly <@ spoly | f | f (1 row) select 'spoly !@> spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@> '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoly !@> spoly | f | f (1 row) select 'spoly !@> spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoly !@> spoly | t | t (1 row) select 'spoly !@> spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@> '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoly !@> spoly | t | t (1 row) select 'spoly !<@ spoly', 'f' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly !<@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoly !<@ spoly | f | f (1 row) select 'spoly !<@ spoly', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !<@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoly !<@ spoly | t | t (1 row) select 'spoly !<@ spoly', 't' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly !<@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoly !<@ spoly | t | t (1 row) pgsphere-1.5.1/expected/contains_ops_compat.out000066400000000000000000000641721461140101500217320ustar00rootroot00000000000000-- scircle vs spoint select 'scircle ~ spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) ~ spoint(1.0,1.0) as actual; ?column? | expected | actual ------------------+----------+-------- scircle ~ spoint | t | t (1 row) select 'scircle ~ spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) ~ spoint(2.0,2.0) as actual; ?column? | expected | actual ------------------+----------+-------- scircle ~ spoint | f | f (1 row) select 'spoint @ scircle', 't' as expected, spoint(1.0,1.0) @ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | t | t (1 row) select 'spoint @ scircle', 'f' as expected, spoint(2.0,2.0) @ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual ------------------+----------+-------- spoint @ scircle | f | f (1 row) select 'scircle !~ spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !~ spoint(1.0,1.0) as actual; ?column? | expected | actual -------------------+----------+-------- scircle !~ spoint | f | f (1 row) select 'scircle !~ spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) !~ spoint(2.0,2.0) as actual; ?column? | expected | actual -------------------+----------+-------- scircle !~ spoint | t | t (1 row) select 'spoint !@ scircle', 'f' as expected, spoint(1.0,1.0) !@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- spoint !@ scircle | f | f (1 row) select 'spoint !@ scircle', 't' as expected, spoint(2.0,2.0) !@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- spoint !@ scircle | t | t (1 row) -- sbox vs spoint select 'sbox ~ spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ spoint(1.1,1.1) as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | t | t (1 row) select 'sbox ~ spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ spoint(2.0,2.0) as actual; ?column? | expected | actual ---------------+----------+-------- sbox ~ spoint | f | f (1 row) select 'spoint @ sbox', 't' as expected, spoint(1.1,1.1) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ---------------+----------+-------- spoint @ sbox | t | t (1 row) select 'spoint @ sbox', 'f' as expected, spoint(2.0,2.0) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ---------------+----------+-------- spoint @ sbox | f | f (1 row) select 'sbox !~ spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ spoint(1.1,1.1) as actual; ?column? | expected | actual ----------------+----------+-------- sbox !~ spoint | f | f (1 row) select 'sbox !~ spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ spoint(2.0,2.0) as actual; ?column? | expected | actual ----------------+----------+-------- sbox !~ spoint | t | t (1 row) select 'spoint !@ sbox', 'f' as expected, spoint(1.1,1.1) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- spoint !@ sbox | f | f (1 row) select 'spoint !@ sbox', 't' as expected, spoint(2.0,2.0) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- spoint !@ sbox | t | t (1 row) -- spoly vs spoint select 'spoly ~ spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ spoint(1.1,1.1) as actual; ?column? | expected | actual ----------------+----------+-------- spoly ~ spoint | t | t (1 row) select 'spoly ~ spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ spoint(2.0,2.0) as actual; ?column? | expected | actual ----------------+----------+-------- spoly ~ spoint | f | f (1 row) select 'spoint @ spoly', 't' as expected, spoint(1.1,1.1) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoint @ spoly | t | t (1 row) select 'spoint @ spoly', 'f' as expected, spoint(2.0,2.0) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoint @ spoly | f | f (1 row) select 'spoly !~ spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ spoint(1.1,1.1) as actual; ?column? | expected | actual -----------------+----------+-------- spoly !~ spoint | f | f (1 row) select 'spoly !~ spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ spoint(2.0,2.0) as actual; ?column? | expected | actual -----------------+----------+-------- spoly !~ spoint | t | t (1 row) select 'spoint !@ spoly', 'f' as expected, spoint(1.1,1.1) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoint !@ spoly | f | f (1 row) select 'spoint !@ spoly', 't' as expected, spoint(2.0,2.0) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- spoint !@ spoly | t | t (1 row) -- scircle vs scircle select 'scircle ~ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) ~ scircle(spoint(1.0,1.0),0.05) as actual; ?column? | expected | actual -------------------+----------+-------- scircle ~ scircle | t | t (1 row) select 'scircle ~ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) ~ scircle(spoint(2.0,2.0),0.05) as actual; ?column? | expected | actual -------------------+----------+-------- scircle ~ scircle | f | f (1 row) select 'scircle ~ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) ~ scircle(spoint(1.0,1.0),0.2) as actual; ?column? | expected | actual -------------------+----------+-------- scircle ~ scircle | f | f (1 row) select 'scircle @ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.05) @ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- scircle @ scircle | t | t (1 row) select 'scircle @ scircle', 'f' as expected, scircle(spoint(2.0,2.0),0.05) @ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- scircle @ scircle | f | f (1 row) select 'scircle @ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.2) @ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual -------------------+----------+-------- scircle @ scircle | f | f (1 row) select 'scircle !~ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !~ scircle(spoint(1.0,1.0),0.05) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !~ scircle | f | f (1 row) select 'scircle !~ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !~ scircle(spoint(2.0,2.0),0.05) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !~ scircle | t | t (1 row) select 'scircle !~ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !~ scircle(spoint(1.0,1.0),0.2) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !~ scircle | t | t (1 row) select 'scircle !@ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.05) !@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !@ scircle | f | f (1 row) select 'scircle !@ scircle', 't' as expected, scircle(spoint(2.0,2.0),0.05) !@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !@ scircle | t | t (1 row) select 'scircle !@ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.2) !@ scircle(spoint(1.0,1.0),0.1) as actual; ?column? | expected | actual --------------------+----------+-------- scircle !@ scircle | t | t (1 row) -- sbox vs scircle select 'sbox ~ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual ----------------+----------+-------- sbox ~ scircle | t | t (1 row) select 'sbox ~ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ scircle(spoint(2.0,2.0),0.01) as actual; ?column? | expected | actual ----------------+----------+-------- sbox ~ scircle | f | f (1 row) select 'sbox ~ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual ----------------+----------+-------- sbox ~ scircle | f | f (1 row) select 'scircle @ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- scircle @ sbox | t | t (1 row) select 'scircle @ sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.01) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- scircle @ sbox | f | f (1 row) select 'scircle @ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- scircle @ sbox | f | f (1 row) select 'sbox !~ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !~ scircle | f | f (1 row) select 'sbox !~ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ scircle(spoint(2.0,2.0),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !~ scircle | t | t (1 row) select 'sbox !~ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !~ scircle | t | t (1 row) select 'scircle !@ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle !@ sbox | f | f (1 row) select 'scircle !@ sbox', 't' as expected, scircle(spoint(2.0,2.0),0.01) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle !@ sbox | t | t (1 row) select 'scircle !@ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle !@ sbox | t | t (1 row) -- select 'scircle ~ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) ~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- scircle ~ sbox | t | t (1 row) select 'scircle ~ sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.2) ~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- scircle ~ sbox | f | f (1 row) select 'scircle ~ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) ~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual ----------------+----------+-------- scircle ~ sbox | f | f (1 row) select 'sbox @ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual ----------------+----------+-------- sbox @ scircle | t | t (1 row) select 'sbox @ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @ scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual ----------------+----------+-------- sbox @ scircle | f | f (1 row) select 'sbox @ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual ----------------+----------+-------- sbox @ scircle | f | f (1 row) select 'scircle !~ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) !~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle !~ sbox | f | f (1 row) select 'scircle !~ sbox', 't' as expected, scircle(spoint(2.0,2.0),0.2) !~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle !~ sbox | t | t (1 row) select 'scircle !~ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) !~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; ?column? | expected | actual -----------------+----------+-------- scircle !~ sbox | t | t (1 row) select 'sbox !@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !@ scircle | f | f (1 row) select 'sbox !@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@ scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !@ scircle | t | t (1 row) select 'sbox !@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- sbox !@ scircle | t | t (1 row) -- spoly vs scircle select 'spoly ~ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual -----------------+----------+-------- spoly ~ scircle | t | t (1 row) select 'spoly ~ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- spoly ~ scircle | f | f (1 row) select 'spoly ~ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual -----------------+----------+-------- spoly ~ scircle | f | f (1 row) select 'scircle @ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.01) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- scircle @ spoly | t | t (1 row) select 'scircle @ spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.01) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- scircle @ spoly | f | f (1 row) select 'scircle @ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.2) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- scircle @ spoly | f | f (1 row) select 'spoly !~ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ scircle(spoint(1.1,1.1),0.01) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !~ scircle | f | f (1 row) select 'spoly !~ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ scircle(spoint(2.0,2.0),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !~ scircle | t | t (1 row) select 'spoly !~ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ scircle(spoint(1.1,1.1),0.2) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !~ scircle | t | t (1 row) select 'scircle !@ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle !@ spoly | f | f (1 row) select 'scircle !@ spoly', 't' as expected, scircle(spoint(2.0,2.0),0.01) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle !@ spoly | t | t (1 row) select 'scircle !@ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.2) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle !@ spoly | t | t (1 row) -- select 'scircle ~ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.5) ~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- scircle ~ spoly | t | t (1 row) select 'scircle ~ spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.5) ~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- scircle ~ spoly | f | f (1 row) select 'scircle ~ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.05) ~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual -----------------+----------+-------- scircle ~ spoly | f | f (1 row) select 'spoly @ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @ scircle(spoint(1.1,1.1),0.5) as actual; ?column? | expected | actual -----------------+----------+-------- spoly @ scircle | t | t (1 row) select 'spoly @ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @ scircle(spoint(2.0,2.0),0.5) as actual; ?column? | expected | actual -----------------+----------+-------- spoly @ scircle | f | f (1 row) select 'spoly @ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @ scircle(spoint(1.1,1.1),0.05) as actual; ?column? | expected | actual -----------------+----------+-------- spoly @ scircle | f | f (1 row) select 'scircle !~ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.5) !~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle !~ spoly | f | f (1 row) select 'scircle !~ spoly', 't' as expected, scircle(spoint(2.0,2.0),0.5) !~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle !~ spoly | t | t (1 row) select 'scircle !~ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.05) !~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; ?column? | expected | actual ------------------+----------+-------- scircle !~ spoly | t | t (1 row) select 'spoly !@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@ scircle(spoint(1.1,1.1),0.5) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !@ scircle | f | f (1 row) select 'spoly !@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@ scircle(spoint(2.0,2.0),0.5) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !@ scircle | t | t (1 row) select 'spoly !@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@ scircle(spoint(1.1,1.1),0.05) as actual; ?column? | expected | actual ------------------+----------+-------- spoly !@ scircle | t | t (1 row) -- sbox vs spoly select 'sbox ~ spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) ~ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual --------------+----------+-------- sbox ~ spoly | t | t (1 row) select 'sbox ~ spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) ~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual --------------+----------+-------- sbox ~ spoly | f | f (1 row) select 'sbox ~ spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) ~ '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly as actual; ?column? | expected | actual --------------+----------+-------- sbox ~ spoly | f | f (1 row) select 'spoly @ sbox', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual --------------+----------+-------- spoly @ sbox | t | t (1 row) select 'spoly @ sbox', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly @ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual --------------+----------+-------- spoly @ sbox | f | f (1 row) select 'spoly @ sbox', 'f' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly @ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual --------------+----------+-------- spoly @ sbox | f | f (1 row) select 'sbox !~ spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !~ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- sbox !~ spoly | f | f (1 row) select 'sbox !~ spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- sbox !~ spoly | t | t (1 row) select 'sbox !~ spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !~ '{(0.9,0.9),(1.1,0.9),(1.1,1.1),(0.9,1.1)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- sbox !~ spoly | t | t (1 row) select 'spoly !@ sbox', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ---------------+----------+-------- spoly !@ sbox | f | f (1 row) select 'spoly !@ sbox', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ---------------+----------+-------- spoly !@ sbox | t | t (1 row) select 'spoly !@ sbox', 't' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly !@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; ?column? | expected | actual ---------------+----------+-------- spoly !@ sbox | t | t (1 row) -- spoly vs spoly select 'spoly ~ spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly ~ '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- spoly ~ spoly | t | t (1 row) select 'spoly ~ spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly ~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- spoly ~ spoly | f | f (1 row) select 'spoly ~ spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly ~ '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- spoly ~ spoly | f | f (1 row) select 'spoly @ spoly', 't' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly @ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- spoly @ spoly | t | t (1 row) select 'spoly @ spoly', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly @ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- spoly @ spoly | f | f (1 row) select 'spoly @ spoly', 'f' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly @ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ---------------+----------+-------- spoly @ spoly | f | f (1 row) select 'spoly !~ spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !~ '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly !~ spoly | f | f (1 row) select 'spoly !~ spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly !~ spoly | t | t (1 row) select 'spoly !~ spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !~ '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly !~ spoly | t | t (1 row) select 'spoly !@ spoly', 'f' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly !@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly !@ spoly | f | f (1 row) select 'spoly !@ spoly', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly !@ spoly | t | t (1 row) select 'spoly !@ spoly', 't' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly !@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; ?column? | expected | actual ----------------+----------+-------- spoly !@ spoly | t | t (1 row) pgsphere-1.5.1/expected/ellipse.out000066400000000000000000000627151461140101500173260ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- ellipse tests --equal operator SELECT sellipse '<{0d,0d},(170d,-12d),0d>' = sellipse '<{0d,0d},(170d,-12d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{0d,0d},(170d,-12d),0d>' = sellipse '<{0d,0d},(170d,-12d),-2d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,5d},(170d,-12d),0d>' = sellipse '<{5d,5d},(170d,-12d),-2d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,2d},(170d,-12d),0d>' = sellipse '<{5d,2d},(170d,-12d),-2d>'; ?column? ---------- f (1 row) -- not equal SELECT sellipse '<{5d,2d},(170d,-12d),0d>' != sellipse '<{5d,2d},(170d,-12d),-2d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,2d},(170d,-12d),0d>' != sellipse '<{5d,2d},(170d,-12d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d, 5d},(300d,0d), 0d>' = sellipse '<{10d,5d},(300d,0d), 180d>' ; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},(300d,0d), 90d>' = sellipse '<{10d,5d},(300d,0d), 270d>' ; ?column? ---------- t (1 row) -- ellipse and point SELECT spoint '(280d,-20d)' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoint '(280d,-10d)' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoint '(280d,-9.9d)' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoint '(280d,-10d)' ; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoint '(280d, -9d)' ; ?column? ---------- f (1 row) SELECT spoint '(280d,-10d)' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoint '(280d,-9.9d)' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoint '(280d,-10d)' ; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoint '(280d, -9d)' ; ?column? ---------- t (1 row) SELECT spoint '(0d, 90d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- f (1 row) SELECT spoint '(0d, -90d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- f (1 row) SELECT spoint '(0d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- t (1 row) SELECT spoint '(90d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- f (1 row) SELECT spoint '(180d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- f (1 row) SELECT spoint '(270d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- f (1 row) SELECT spoint '(9d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- t (1 row) SELECT spoint '(0d, 9d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- f (1 row) SELECT spoint '(0d, 4d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; ?column? ---------- t (1 row) -- --ellipse and circle (@,&&) -- -- negators and commutators SELECT scircle '<(280d,-10d),0d>' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d, -9d),0d>' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-10d),0d>' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d, -9d),0d>' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ scircle '<(280d,-10d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ scircle '<(280d, -9d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ scircle '<(280d,-10d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ scircle '<(280d, -9d),0d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d,-10d),2d>' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d, 0d),2d>' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-10d),2d>' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d, 0d),2d>' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && scircle '<(280d,-10d),2d>' ; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && scircle '<(280d, 0d),2d>' ; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& scircle '<(280d,-10d),2d>' ; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& scircle '<(280d, 0d),2d>' ; ?column? ---------- t (1 row) SELECT scircle '<(280d,-10d),0d>' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) -- ellipse is circle SELECT scircle '<(280d,-10d),2d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),2d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d,-16d),2d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),15d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-10d),2d>' ; ?column? ---------- f (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-18d),2d>' ; ?column? ---------- f (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-16d),2d>' ; ?column? ---------- f (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-18d),15d>' ; ?column? ---------- t (1 row) SELECT scircle '<(280d,-10d),2d>' && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),2d>' && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d,-16d),2d>' && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) -- ellipse is line SELECT scircle '<(280d,-10d),0d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),0d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d,-16d),0d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d,-18d),15d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-10d),0d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),0d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT scircle '<(280d,-10d),2d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),2d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-16d),2d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-10d),2d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT scircle '<(280d,-18d),2d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,0d},(280d,-20d),90d>' @ scircle '<(280d,-18d),15d>' ; ?column? ---------- t (1 row) -- --ellipse and line (@,&&) -- -- negators and commutators SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); ?column? ---------- f (1 row) -- line is point , ellipse is point SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{0d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{0d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- line is point , ellipse is circle SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{5d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{5d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- line is point , ellipse is a real ellipse SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{10d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{10d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- line is a real line , ellipse is point SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{0d,0d},(280d, -8d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{0d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- line is a real line , ellipse is circle SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- line is a real line , ellipse is line SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- line is a real line , ellipse is a real ellipse SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{10d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{10d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- -- ellipse and ellipse -- -- check @ SELECT sellipse '<{10d, 5d},(300d,0d), 0d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},(300d,0d), 90d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d, 5d},(300d,0d),180d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},(300d,0d),270d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) -- negators , commutator @,&& SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' && sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' && sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' && sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' !@ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' !@ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' !@ sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' !&& sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' !&& sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' !&& sellipse '<{10d,5d},(50d,5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' ~ sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' ~ sellipse '<{10d, 5d},( 52d,6d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' ~ sellipse '<{10d, 5d},( 90d,9d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' && sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' && sellipse '<{10d, 5d},( 52d,6d), 0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' && sellipse '<{10d, 5d},( 90d,9d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' !~ sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' !~ sellipse '<{10d, 5d},( 52d,6d), 0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' !~ sellipse '<{10d, 5d},( 90d,9d), 0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' !&& sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' !&& sellipse '<{10d, 5d},( 52d,6d), 0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(50d,5d),45d>' !&& sellipse '<{10d, 5d},( 90d,9d), 0d>'; ?column? ---------- t (1 row) -- left ellipse is point right ellipse is point SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' @ sellipse '<{0d,0d},(50d,-5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' @ sellipse '<{0d,0d},(50d,-5d),45d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' && sellipse '<{0d,0d},(50d,-5d),45d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' && sellipse '<{0d,0d},(50d,-5d),45d>'; ?column? ---------- f (1 row) -- left ellipse is line right ellipse is point SELECT sellipse '<{ 5d, 0d},( 50d, -2d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 0d},( 50d,-12d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 0d},( 50d, -2d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 0d},( 50d,-12d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) -- left ellipse is circle right ellipse is point SELECT sellipse '<{ 5d, 5d},( 50d, -2d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 5d},( 50d,-12d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 5d},( 50d, -2d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 5d},( 50d,-12d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) -- left ellipse is real ellipse right ellipse is point SELECT sellipse '<{ 5d, 3d},( 50d, -2d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 3d},( 50d,-12d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 3d},( 50d, -2d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 3d},( 50d,-12d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; ?column? ---------- f (1 row) -- left ellipse is point right ellipse is line SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) -- left ellipse is line right ellipse is line SELECT sellipse '<{ 3d, 0d},( 50d,-5d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 0d},( 50d,-8d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 0d},( 50d,-6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 0d},( 50d, 6d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 0d},( 50d,-5d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 0d},( 50d,-8d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 0d},( 50d,-6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 0d},( 50d, 6d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) -- left ellipse is circle right ellipse is line SELECT sellipse '<{ 3d, 3d},( 50d,-5d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 3d},( 50d,-8d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 3d},( 50d,-6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 3d},( 50d, 6d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 3d},( 50d,-5d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 3d},( 50d,-8d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 3d},( 50d,-6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 3d, 3d},( 50d, 6d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; ?column? ---------- f (1 row) -- left ellipse is point right ellipse is circle SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) -- left ellipse is line right ellipse is circle SELECT sellipse '<{ 5d, 0d},( 50d,-5d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 0d},( 50d,-6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 0d},( 50d, 6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 0d},( 50d,-5d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 0d},( 50d,-6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 0d},( 50d, 6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) -- left ellipse is circle right ellipse is circle SELECT sellipse '<{ 3d, 3d},( 50d,-4d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 5d},( 50d,-5d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 5d},( 50d,-6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 5d, 5d},( 50d, 6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{ 3d, 3d},( 50d,-4d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 5d},( 50d,-5d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 5d},( 50d,-6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{ 5d, 5d},( 50d, 6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; ?column? ---------- f (1 row) pgsphere-1.5.1/expected/epochprop.out000066400000000000000000000106031461140101500176550ustar00rootroot00000000000000SET extra_float_digits = 2; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 546.9759, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- 269.4742714391 | 4.4072939987 | 543.624 | -791.442 | 10235.412 | -110.450 (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 0, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+---------+----------+------------+--------- 269.4744079540 | 4.4055337210 | | -801.210 | 10361.762 | (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), NULL, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+---------+----------+------------+--------- 269.4744079540 | 4.4055337210 | | -801.210 | 10361.762 | (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 23, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), NULL, 20) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- 269.4476085384 | 4.7509315989 | 23.000 | -801.617 | 10361.984 | 2.159 (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 23, NULL, RADIANS(10362/3.6e6), -110, 120) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- 269.4520769500 | 5.0388680565 | 23.007 | -.000 | 10368.061 | -97.120 (1 row) SELECT epoch_prop(NULL, 23, 0.01 , RADIANS(10362/3.6e6), -110, 120); ERROR: NULL position not supported in epoch propagation SELECT epoch_prop_pos(spoint(radians(269.45207695), radians(4.693364966)), 23, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, 20) AS tp; tp --------------------------------------------- (4.7027479265831289 , 0.082919450934599334) (1 row) SELECT epoch_prop_pos(spoint(radians(269.45207695), radians(4.693364966)), RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), 20) AS tp; tp --------------------------------------------- (4.7027479306195161 , 0.082919398938087627) (1 row) pgsphere-1.5.1/expected/epochprop_1.out000066400000000000000000000105671461140101500201060ustar00rootroot00000000000000SET extra_float_digits = 2; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 546.9759, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- 269.4742714391 | 4.4072939987 | 543.624 | -791.442 | 10235.412 | -110.450 (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 0, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+---------+----------+------------+--------- 269.4744079540 | 4.4055337210 | | -801.210 | 10361.762 | (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), NULL, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+---------+----------+------------+--------- 269.4744079540 | 4.4055337210 | | -801.210 | 10361.762 | (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 23, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), NULL, 20) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- 269.4476085384 | 4.7509315989 | 23.000 | -801.617 | 10361.984 | 2.159 (1 row) SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 23, NULL, RADIANS(10362/3.6e6), -110, 120) AS tp) AS q; to_char | to_char | to_char | to_char | to_char | to_char -----------------+-----------------+----------+----------+------------+---------- 269.4520769500 | 5.0388680565 | 23.007 | -.000 | 10368.061 | -97.120 (1 row) SELECT epoch_prop(NULL, 23, 0.01 , RADIANS(10362/3.6e6), -110, 120); ERROR: NULL position not supported in epoch propagation SELECT epoch_prop_pos(spoint(radians(269.45207695), radians(4.693364966)), 23, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, 20) AS tp; tp ------------------------------------------- (4.702747926583129 , 0.08291945093459933) (1 row) SELECT epoch_prop_pos(spoint(radians(269.45207695), radians(4.693364966)), RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), 20) AS tp; tp ------------------------------------------- (4.702747930619516 , 0.08291939893808763) (1 row) pgsphere-1.5.1/expected/euler.out000066400000000000000000000060551461140101500170000ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- checking Euler transformation operators SELECT strans '-10d,0d,10d,ZZZ' = '-10d,0d,10d,XXX' ; ?column? ---------- t (1 row) SELECT strans '-40d,0d,40d,ZZZ' <> '-40d,0d,40d,XXX' ; ?column? ---------- f (1 row) SELECT strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ); strans --------------------------------------- 0.34906585, 1.5707963, 1.2304571, XZY (1 row) SELECT theta( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) ); theta --------------- 1.57079632679 (1 row) SELECT psi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) ); psi --------------- 1.23045712266 (1 row) SELECT phi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) ); phi ---------------- 0.349065850399 (1 row) SELECT theta( strans( '20d, 30d, 40d, XZY' ) ); theta ---------------- 0.523598775598 (1 row) SELECT psi( strans( '20d, 30d, 40d, XZY' ) ); psi ---------------- 0.698131700798 (1 row) SELECT phi( strans( '20d, 30d, 40d, XZY' ) ); phi ---------------- 0.349065850399 (1 row) SELECT strans( '2d 20m, 10d, 0' ); strans --------------------------------- 0.040724349, 0.17453293, 0, ZXZ (1 row) SELECT theta( strans( '2d 20m, 10d, 0' ) ); theta ---------------- 0.174532925199 (1 row) SELECT psi( strans( '2d 20m, 10d, 0' ) ); psi ----- 0 (1 row) SELECT phi( strans( '2d 20m, 10d, 0' ) ); phi ----------------- 0.0407243492132 (1 row) SELECT strans ( '10d, 90d, 270d, ZXZ' ); strans -------------------------------------- 0.17453293, 1.5707963, 4.712389, ZXZ (1 row) SELECT theta( strans ( '10d, 90d, 270d, ZXZ' ) ); theta --------------- 1.57079632679 (1 row) SELECT psi( strans ( '10d, 90d, 270d, ZXZ' ) ); psi --------------- 4.71238898038 (1 row) SELECT phi( strans ( '10d, 90d, 270d, ZXZ' ) ); phi ---------------- 0.174532925199 (1 row) SELECT - strans ( '20d, 50d, 80d, XYZ' ); ?column? -------------------------------------- 4.8869219, 5.4105207, 5.9341195, ZYX (1 row) SELECT theta( - strans ( '20d, 50d, 80d, XYZ' ) ); theta ----------------- -0.872664625997 (1 row) SELECT psi( - strans ( '20d, 50d, 80d, XYZ' ) ); psi ----------------- -0.349065850399 (1 row) SELECT phi( - strans ( '20d, 50d, 80d, XYZ' ) ); phi --------------- -1.3962634016 (1 row) SELECT strans( '90d, 60d, 30d' ); strans --------------------------------------- 1.5707963, 1.0471976, 0.52359878, ZXZ (1 row) SELECT theta( strans( '90d, 60d, 30d' ) ); theta -------------- 1.0471975512 (1 row) SELECT psi( strans( '90d, 60d, 30d' ) ); psi ---------------- 0.523598775598 (1 row) SELECT phi( strans( '90d, 60d, 30d' ) ); phi --------------- 1.57079632679 (1 row) pgsphere-1.5.1/expected/gist_support.out000066400000000000000000000236441461140101500204310ustar00rootroot00000000000000-- spoint_dwithin function selectivity set jit = off; -- suppress extra planning output select explain('select * from spoint10k where spoint_dwithin(star, spoint(1,1), 1)'); explain ----------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=2298 width=16) (actual rows=3009 loops=1) Filter: spoint_dwithin(star, '(1 , 1)'::spoint, '1'::double precision) Rows Removed by Filter: 1560 Heap Blocks: exact=55 -> Bitmap Index Scan on spoint10k_star_idx (rows=2298 width=0) (actual rows=4569 loops=1) Index Cond: (star <@ '<(1 , 1) , 1>'::scircle) (6 rows) select explain('select * from spoint10k where spoint_dwithin(star, spoint(1,1), .1)'); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=25 width=16) (actual rows=29 loops=1) Filter: spoint_dwithin(star, '(1 , 1)'::spoint, '0.1'::double precision) Rows Removed by Filter: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) (6 rows) select explain('select * from spoint10k where spoint_dwithin(star, spoint(1,1), .01)'); explain --------------------------------------------------------------------------------------------- Index Scan using spoint10k_star_idx on spoint10k (rows=1 width=16) (actual rows=1 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.01>'::scircle) (2 rows) select explain('select * from spoint10k where spoint_dwithin(spoint(1,1), star, 1)'); explain ----------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=2298 width=16) (actual rows=3009 loops=1) Filter: spoint_dwithin('(1 , 1)'::spoint, star, '1'::double precision) Rows Removed by Filter: 1560 Heap Blocks: exact=55 -> Bitmap Index Scan on spoint10k_star_idx (rows=2298 width=0) (actual rows=4569 loops=1) Index Cond: (star <@ '<(1 , 1) , 1>'::scircle) (6 rows) select explain('select * from spoint10k where spoint_dwithin(spoint(1,1), star, .1)'); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=25 width=16) (actual rows=29 loops=1) Filter: spoint_dwithin('(1 , 1)'::spoint, star, '0.1'::double precision) Rows Removed by Filter: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) (6 rows) select explain('select * from spoint10k where spoint_dwithin(spoint(1,1), star, .01)'); explain --------------------------------------------------------------------------------------------- Index Scan using spoint10k_star_idx on spoint10k (rows=1 width=16) (actual rows=1 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.01>'::scircle) (2 rows) select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, 1)', do_analyze := 'false'); explain --------------------------------------------------------------------------------------- Nested Loop (rows=22984885 width=32) -> Seq Scan on spoint10k a (rows=10000 width=16) -> Index Scan using spoint10k_star_idx on spoint10k b (rows=2298 width=16) Index Cond: (star OPERATOR(public.<@) scircle(a.star, '1'::double precision)) (4 rows) select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .1)'); explain ----------------------------------------------------------------------------------------------------------- Nested Loop (rows=249792 width=32) (actual rows=505342 loops=1) -> Seq Scan on spoint10k a (rows=10000 width=16) (actual rows=10000 loops=1) -> Index Scan using spoint10k_star_idx on spoint10k b (rows=25 width=16) (actual rows=51 loops=10000) Index Cond: (star OPERATOR(public.<@) scircle(a.star, '0.1'::double precision)) Rows Removed by Index Recheck: 31 (5 rows) select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01)'); explain --------------------------------------------------------------------------------------------------------- Nested Loop (rows=2500 width=32) (actual rows=17614 loops=1) -> Seq Scan on spoint10k a (rows=10000 width=16) (actual rows=10000 loops=1) -> Index Scan using spoint10k_star_idx on spoint10k b (rows=1 width=16) (actual rows=2 loops=10000) Index Cond: (star OPERATOR(public.<@) scircle(a.star, '0.01'::double precision)) Rows Removed by Index Recheck: 1 (5 rows) -- spoint_dwithin is symmetric in the first two arguments select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01) where spoint_dwithin(a.star, spoint(1,1), .1)'); explain ------------------------------------------------------------------------------------------------------ Nested Loop (rows=6 width=32) (actual rows=33 loops=1) -> Bitmap Heap Scan on spoint10k a (rows=25 width=16) (actual rows=29 loops=1) Filter: spoint_dwithin(star, '(1 , 1)'::spoint, '0.1'::double precision) Rows Removed by Filter: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) -> Index Scan using spoint10k_star_idx on spoint10k b (rows=1 width=16) (actual rows=1 loops=29) Index Cond: (star OPERATOR(public.<@) scircle(a.star, '0.01'::double precision)) Rows Removed by Index Recheck: 0 (10 rows) select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(b.star, a.star, .01) where spoint_dwithin(a.star, spoint(1,1), .1)'); explain ------------------------------------------------------------------------------------------------------ Nested Loop (rows=6 width=32) (actual rows=33 loops=1) -> Bitmap Heap Scan on spoint10k a (rows=25 width=16) (actual rows=29 loops=1) Filter: spoint_dwithin(star, '(1 , 1)'::spoint, '0.1'::double precision) Rows Removed by Filter: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) -> Index Scan using spoint10k_star_idx on spoint10k b (rows=1 width=16) (actual rows=1 loops=29) Index Cond: (star OPERATOR(public.<@) scircle(a.star, '0.01'::double precision)) Rows Removed by Index Recheck: 0 (10 rows) -- both sides indexable, check if the planner figures out the better choice select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01) where spoint_dwithin(a.star, spoint(1,1), .1) and spoint_dwithin(b.star, spoint(1,1), .05)'); explain ------------------------------------------------------------------------------------------------------------------------------------- Nested Loop (rows=1 width=32) (actual rows=16 loops=1) -> Bitmap Heap Scan on spoint10k b (rows=6 width=16) (actual rows=12 loops=1) Filter: spoint_dwithin(star, '(1 , 1)'::spoint, '0.05'::double precision) Rows Removed by Filter: 4 Heap Blocks: exact=14 -> Bitmap Index Scan on spoint10k_star_idx (rows=6 width=0) (actual rows=16 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.05>'::scircle) -> Index Scan using spoint10k_star_idx on spoint10k a (rows=1 width=16) (actual rows=1 loops=12) Index Cond: ((star OPERATOR(public.<@) scircle(b.star, '0.01'::double precision)) AND (star <@ '<(1 , 1) , 0.1>'::scircle)) Rows Removed by Index Recheck: 0 (10 rows) select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01) where spoint_dwithin(a.star, spoint(1,1), .05) and spoint_dwithin(b.star, spoint(1,1), .1)'); explain ------------------------------------------------------------------------------------------------------------------------------------- Nested Loop (rows=1 width=32) (actual rows=16 loops=1) -> Bitmap Heap Scan on spoint10k a (rows=6 width=16) (actual rows=12 loops=1) Filter: spoint_dwithin(star, '(1 , 1)'::spoint, '0.05'::double precision) Rows Removed by Filter: 4 Heap Blocks: exact=14 -> Bitmap Index Scan on spoint10k_star_idx (rows=6 width=0) (actual rows=16 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.05>'::scircle) -> Index Scan using spoint10k_star_idx on spoint10k b (rows=1 width=16) (actual rows=1 loops=12) Index Cond: ((star OPERATOR(public.<@) scircle(a.star, '0.01'::double precision)) AND (star <@ '<(1 , 1) , 0.1>'::scircle)) Rows Removed by Index Recheck: 0 (10 rows) pgsphere-1.5.1/expected/gnomo.out000066400000000000000000000672401461140101500170060ustar00rootroot00000000000000SET extra_float_digits TO -3; SELECT set_sphere_output_precision(12); set_sphere_output_precision ----------------------------- SET 12 (1 row) select gnomonic_proj(spoint '(0.95, -0.455)', spoint '(1, -0.45)'); gnomonic_proj -------------------------------------- (-0.0449403289896,-0.00549389025232) (1 row) select gnomonic_proj(spoint '(0.95, -0.45)', spoint '(1, -0.45)'); gnomonic_proj --------------------------------------- (-0.0450492463284,-0.000489973819396) (1 row) select gnomonic_proj(spoint '(0.95, -0.445)', spoint '(1, -0.45)'); gnomonic_proj ------------------------------------- (-0.0451581642008,0.00451396713168) (1 row) select gnomonic_proj(spoint '(1, -0.455)', spoint '(1, -0.45)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(1, -0.45)', spoint '(1, -0.45)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(1, -0.445)', spoint '(1, -0.45)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(1.05, -0.455)', spoint '(1, -0.45)'); gnomonic_proj ------------------------------------- (0.0449403289896,-0.00549389025232) (1 row) select gnomonic_proj(spoint '(1.05, -0.45)', spoint '(1, -0.45)'); gnomonic_proj -------------------------------------- (0.0450492463284,-0.000489973819396) (1 row) select gnomonic_proj(spoint '(1.05, -0.445)', spoint '(1, -0.45)'); gnomonic_proj ------------------------------------ (0.0451581642008,0.00451396713168) (1 row) select gnomonic_proj(spoint '(0.95, 0.045)', spoint '(1, 0.05)'); gnomonic_proj -------------------------------------- (-0.0499915339465,-0.00494380775197) (1 row) select gnomonic_proj(spoint '(0.95, 0.05)', spoint '(1, 0.05)'); gnomonic_proj -------------------------------------- (-0.0499790130537,6.24607520336e-05) (1 row) select gnomonic_proj(spoint '(0.95, 0.055)', spoint '(1, 0.05)'); gnomonic_proj ------------------------------------- (-0.0499664921686,0.00506872612906) (1 row) select gnomonic_proj(spoint '(1, 0.045)', spoint '(1, 0.05)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(1, 0.05)', spoint '(1, 0.05)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(1, 0.055)', spoint '(1, 0.05)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(1.05, 0.045)', spoint '(1, 0.05)'); gnomonic_proj ------------------------------------- (0.0499915339465,-0.00494380775197) (1 row) select gnomonic_proj(spoint '(1.05, 0.05)', spoint '(1, 0.05)'); gnomonic_proj ------------------------------------- (0.0499790130537,6.24607520336e-05) (1 row) select gnomonic_proj(spoint '(1.05, 0.055)', spoint '(1, 0.05)'); gnomonic_proj ------------------------------------ (0.0499664921686,0.00506872612906) (1 row) select gnomonic_proj(spoint '(0.95, 0.545)', spoint '(1, 0.55)'); gnomonic_proj -------------------------------------- (-0.0427780606339,-0.00444549618887) (1 row) select gnomonic_proj(spoint '(0.95, 0.55)', spoint '(1, 0.55)'); gnomonic_proj -------------------------------------- (-0.0426472042059,0.000557394853467) (1 row) select gnomonic_proj(spoint '(0.95, 0.555)', spoint '(1, 0.55)'); gnomonic_proj ------------------------------------- (-0.0425163485073,0.00556025800979) (1 row) select gnomonic_proj(spoint '(1, 0.545)', spoint '(1, 0.55)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(1, 0.55)', spoint '(1, 0.55)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(1, 0.555)', spoint '(1, 0.55)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(1.05, 0.545)', spoint '(1, 0.55)'); gnomonic_proj ------------------------------------- (0.0427780606339,-0.00444549618887) (1 row) select gnomonic_proj(spoint '(1.05, 0.55)', spoint '(1, 0.55)'); gnomonic_proj ------------------------------------- (0.0426472042059,0.000557394853467) (1 row) select gnomonic_proj(spoint '(1.05, 0.555)', spoint '(1, 0.55)'); gnomonic_proj ------------------------------------ (0.0425163485073,0.00556025800979) (1 row) select gnomonic_proj(spoint '(2.95, -0.455)', spoint '(3, -0.45)'); gnomonic_proj -------------------------------------- (-0.0449403289896,-0.00549389025232) (1 row) select gnomonic_proj(spoint '(2.95, -0.45)', spoint '(3, -0.45)'); gnomonic_proj --------------------------------------- (-0.0450492463284,-0.000489973819396) (1 row) select gnomonic_proj(spoint '(2.95, -0.445)', spoint '(3, -0.45)'); gnomonic_proj ------------------------------------- (-0.0451581642008,0.00451396713168) (1 row) select gnomonic_proj(spoint '(3, -0.455)', spoint '(3, -0.45)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(3, -0.45)', spoint '(3, -0.45)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(3, -0.445)', spoint '(3, -0.45)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(3.05, -0.455)', spoint '(3, -0.45)'); gnomonic_proj ------------------------------------- (0.0449403289896,-0.00549389025232) (1 row) select gnomonic_proj(spoint '(3.05, -0.45)', spoint '(3, -0.45)'); gnomonic_proj -------------------------------------- (0.0450492463284,-0.000489973819396) (1 row) select gnomonic_proj(spoint '(3.05, -0.445)', spoint '(3, -0.45)'); gnomonic_proj ------------------------------------ (0.0451581642008,0.00451396713168) (1 row) select gnomonic_proj(spoint '(2.95, 0.045)', spoint '(3, 0.05)'); gnomonic_proj -------------------------------------- (-0.0499915339465,-0.00494380775197) (1 row) select gnomonic_proj(spoint '(2.95, 0.05)', spoint '(3, 0.05)'); gnomonic_proj -------------------------------------- (-0.0499790130537,6.24607520336e-05) (1 row) select gnomonic_proj(spoint '(2.95, 0.055)', spoint '(3, 0.05)'); gnomonic_proj ------------------------------------- (-0.0499664921686,0.00506872612906) (1 row) select gnomonic_proj(spoint '(3, 0.045)', spoint '(3, 0.05)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(3, 0.05)', spoint '(3, 0.05)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(3, 0.055)', spoint '(3, 0.05)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(3.05, 0.045)', spoint '(3, 0.05)'); gnomonic_proj ------------------------------------- (0.0499915339465,-0.00494380775197) (1 row) select gnomonic_proj(spoint '(3.05, 0.05)', spoint '(3, 0.05)'); gnomonic_proj ------------------------------------- (0.0499790130537,6.24607520336e-05) (1 row) select gnomonic_proj(spoint '(3.05, 0.055)', spoint '(3, 0.05)'); gnomonic_proj ------------------------------------ (0.0499664921686,0.00506872612906) (1 row) select gnomonic_proj(spoint '(2.95, 0.545)', spoint '(3, 0.55)'); gnomonic_proj -------------------------------------- (-0.0427780606339,-0.00444549618887) (1 row) select gnomonic_proj(spoint '(2.95, 0.55)', spoint '(3, 0.55)'); gnomonic_proj -------------------------------------- (-0.0426472042059,0.000557394853467) (1 row) select gnomonic_proj(spoint '(2.95, 0.555)', spoint '(3, 0.55)'); gnomonic_proj ------------------------------------- (-0.0425163485073,0.00556025800979) (1 row) select gnomonic_proj(spoint '(3, 0.545)', spoint '(3, 0.55)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(3, 0.55)', spoint '(3, 0.55)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(3, 0.555)', spoint '(3, 0.55)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(3.05, 0.545)', spoint '(3, 0.55)'); gnomonic_proj ------------------------------------- (0.0427780606339,-0.00444549618887) (1 row) select gnomonic_proj(spoint '(3.05, 0.55)', spoint '(3, 0.55)'); gnomonic_proj ------------------------------------- (0.0426472042059,0.000557394853467) (1 row) select gnomonic_proj(spoint '(3.05, 0.555)', spoint '(3, 0.55)'); gnomonic_proj ------------------------------------ (0.0425163485073,0.00556025800979) (1 row) select gnomonic_proj(spoint '(4.95, -0.455)', spoint '(5, -0.45)'); gnomonic_proj -------------------------------------- (-0.0449403289896,-0.00549389025232) (1 row) select gnomonic_proj(spoint '(4.95, -0.45)', spoint '(5, -0.45)'); gnomonic_proj --------------------------------------- (-0.0450492463284,-0.000489973819396) (1 row) select gnomonic_proj(spoint '(4.95, -0.445)', spoint '(5, -0.45)'); gnomonic_proj ------------------------------------- (-0.0451581642008,0.00451396713168) (1 row) select gnomonic_proj(spoint '(5, -0.455)', spoint '(5, -0.45)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(5, -0.45)', spoint '(5, -0.45)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(5, -0.445)', spoint '(5, -0.45)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(5.05, -0.455)', spoint '(5, -0.45)'); gnomonic_proj ------------------------------------- (0.0449403289896,-0.00549389025232) (1 row) select gnomonic_proj(spoint '(5.05, -0.45)', spoint '(5, -0.45)'); gnomonic_proj -------------------------------------- (0.0450492463284,-0.000489973819396) (1 row) select gnomonic_proj(spoint '(5.05, -0.445)', spoint '(5, -0.45)'); gnomonic_proj ------------------------------------ (0.0451581642008,0.00451396713168) (1 row) select gnomonic_proj(spoint '(4.95, 0.045)', spoint '(5, 0.05)'); gnomonic_proj -------------------------------------- (-0.0499915339465,-0.00494380775197) (1 row) select gnomonic_proj(spoint '(4.95, 0.05)', spoint '(5, 0.05)'); gnomonic_proj -------------------------------------- (-0.0499790130537,6.24607520336e-05) (1 row) select gnomonic_proj(spoint '(4.95, 0.055)', spoint '(5, 0.05)'); gnomonic_proj ------------------------------------- (-0.0499664921686,0.00506872612906) (1 row) select gnomonic_proj(spoint '(5, 0.045)', spoint '(5, 0.05)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(5, 0.05)', spoint '(5, 0.05)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(5, 0.055)', spoint '(5, 0.05)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(5.05, 0.045)', spoint '(5, 0.05)'); gnomonic_proj ------------------------------------- (0.0499915339465,-0.00494380775197) (1 row) select gnomonic_proj(spoint '(5.05, 0.05)', spoint '(5, 0.05)'); gnomonic_proj ------------------------------------- (0.0499790130537,6.24607520336e-05) (1 row) select gnomonic_proj(spoint '(5.05, 0.055)', spoint '(5, 0.05)'); gnomonic_proj ------------------------------------ (0.0499664921686,0.00506872612906) (1 row) select gnomonic_proj(spoint '(4.95, 0.545)', spoint '(5, 0.55)'); gnomonic_proj -------------------------------------- (-0.0427780606339,-0.00444549618887) (1 row) select gnomonic_proj(spoint '(4.95, 0.55)', spoint '(5, 0.55)'); gnomonic_proj -------------------------------------- (-0.0426472042059,0.000557394853467) (1 row) select gnomonic_proj(spoint '(4.95, 0.555)', spoint '(5, 0.55)'); gnomonic_proj ------------------------------------- (-0.0425163485073,0.00556025800979) (1 row) select gnomonic_proj(spoint '(5, 0.545)', spoint '(5, 0.55)'); gnomonic_proj ----------------------- (0,-0.00500004166708) (1 row) select gnomonic_proj(spoint '(5, 0.55)', spoint '(5, 0.55)'); gnomonic_proj --------------- (0,0) (1 row) select gnomonic_proj(spoint '(5, 0.555)', spoint '(5, 0.55)'); gnomonic_proj ---------------------- (0,0.00500004166708) (1 row) select gnomonic_proj(spoint '(5.05, 0.545)', spoint '(5, 0.55)'); gnomonic_proj ------------------------------------- (0.0427780606339,-0.00444549618887) (1 row) select gnomonic_proj(spoint '(5.05, 0.55)', spoint '(5, 0.55)'); gnomonic_proj ------------------------------------- (0.0426472042059,0.000557394853467) (1 row) select gnomonic_proj(spoint '(5.05, 0.555)', spoint '(5, 0.55)'); gnomonic_proj ------------------------------------ (0.0425163485073,0.00556025800979) (1 row) select gnomonic_inv(point '(0.95, -0.455)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.93404045604 , -0.620644470397) (1 row) select gnomonic_inv(point '(0.95, -0.45)', spoint '(1, -0.45)'); gnomonic_inv --------------------------------- (1.93256213345 , -0.6176011915) (1 row) select gnomonic_inv(point '(0.95, -0.445)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.93108704609 , -0.614550369264) (1 row) select gnomonic_inv(point '(1, -0.455)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.95836918132 , -0.604764854006) (1 row) select gnomonic_inv(point '(1, -0.45)', spoint '(1, -0.45)'); gnomonic_inv --------------------------------- (1.956914533 , -0.601789767222) (1 row) select gnomonic_inv(point '(1, -0.445)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.95546286092 , -0.598807609319) (1 row) select gnomonic_inv(point '(1.05, -0.455)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.98112232487 , -0.589335241812) (1 row) select gnomonic_inv(point '(1.05, -0.45)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.97969293971 , -0.586426792177) (1 row) select gnomonic_inv(point '(1.05, -0.445)', spoint '(1, -0.45)'); gnomonic_inv ----------------------------------- (1.97826629181 , -0.583511718073) (1 row) select gnomonic_inv(point '(0.95, 0.045)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.76151307432 , 0.0688368263878) (1 row) select gnomonic_inv(point '(0.95, 0.05)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.76163833436 , 0.0724553691159) (1 row) select gnomonic_inv(point '(0.95, 0.055)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.76176362732 , 0.0760729610951) (1 row) select gnomonic_inv(point '(1, 0.045)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.78715062848 , 0.0671371183392) (1 row) select gnomonic_inv(point '(1, 0.05)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.78727603001 , 0.0706664479787) (1 row) select gnomonic_inv(point '(1, 0.055)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.78740146287 , 0.0741948953969) (1 row) select gnomonic_inv(point '(1.05, 0.045)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.81153380434 , 0.0654793685341) (1 row) select gnomonic_inv(point '(1.05, 0.05)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.81165903459 , 0.0689216776286) (1 row) select gnomonic_inv(point '(1.05, 0.055)', spoint '(1, 0.05)'); gnomonic_inv ----------------------------------- (1.81178429461 , 0.0723631680984) (1 row) select gnomonic_inv(point '(0.95, 0.545)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.03218995407 , 0.728455908477) (1 row) select gnomonic_inv(point '(0.95, 0.55)', spoint '(1, 0.55)'); gnomonic_inv --------------------------------- (2.03421959002 , 0.73119792829) (1 row) select gnomonic_inv(point '(0.95, 0.555)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.03625413817 , 0.733931067146) (1 row) select gnomonic_inv(point '(1, 0.545)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.05449576075 , 0.709476159185) (1 row) select gnomonic_inv(point '(1, 0.55)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.05647450328 , 0.712160401141) (1 row) select gnomonic_inv(point '(1, 0.555)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.05845768052 , 0.714836300149) (1 row) select gnomonic_inv(point '(1.05, 0.545)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.07517654321 , 0.691081532871) (1 row) select gnomonic_inv(point '(1.05, 0.55)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.07710459256 , 0.693709435824) (1 row) select gnomonic_inv(point '(1.05, 0.555)', spoint '(1, 0.55)'); gnomonic_inv ---------------------------------- (2.07903665116 , 0.696329506692) (1 row) select gnomonic_inv(point '(2.95, -0.455)', spoint '(3, -0.45)'); gnomonic_inv ---------------------------------- (4.33700283527 , -0.27165319266) (1 row) select gnomonic_inv(point '(2.95, -0.45)', spoint '(3, -0.45)'); gnomonic_inv ----------------------------------- (4.33630528922 , -0.270232089821) (1 row) select gnomonic_inv(point '(2.95, -0.445)', spoint '(3, -0.45)'); gnomonic_inv ----------------------------------- (4.33560797557 , -0.268810216042) (1 row) select gnomonic_inv(point '(3, -0.455)', spoint '(3, -0.45)'); gnomonic_inv ----------------------------------- (4.34076229378 , -0.267566262208) (1 row) select gnomonic_inv(point '(3, -0.45)', spoint '(3, -0.45)'); gnomonic_inv ----------------------------------- (4.34007515086 , -0.266165779414) (1 row) select gnomonic_inv(point '(3, -0.445)', spoint '(3, -0.45)'); gnomonic_inv ---------------------------------- (4.3393882297 , -0.264764558966) (1 row) select gnomonic_inv(point '(3.05, -0.455)', spoint '(3, -0.45)'); gnomonic_inv ----------------------------------- (4.34440480094 , -0.263594269354) (1 row) select gnomonic_inv(point '(3.05, -0.45)', spoint '(3, -0.45)'); gnomonic_inv ----------------------------------- (4.34372777472 , -0.262213858104) (1 row) select gnomonic_inv(point '(3.05, -0.445)', spoint '(3, -0.45)'); gnomonic_inv ---------------------------------- (4.34305096026 , -0.26083274066) (1 row) select gnomonic_inv(point '(2.95, 0.045)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.24503385176 , 0.0304755271062) (1 row) select gnomonic_inv(point '(2.95, 0.05)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.24510988812 , 0.0320785494309) (1 row) select gnomonic_inv(point '(2.95, 0.055)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.24518592839 , 0.0336814889852) (1 row) select gnomonic_inv(point '(3, 0.045)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.25009578006 , 0.0300187358568) (1 row) select gnomonic_inv(point '(3, 0.05)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.25017080308 , 0.0315977381062) (1 row) select gnomonic_inv(point '(3, 0.055)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.25024582985 , 0.0331766612496) (1 row) select gnomonic_inv(point '(3.05, 0.045)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.25500799412 , 0.0295747078489) (1 row) select gnomonic_inv(point '(3.05, 0.05)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.25508202643 , 0.0311303608536) (1 row) select gnomonic_inv(point '(3.05, 0.055)', spoint '(3, 0.05)'); gnomonic_inv ----------------------------------- (4.25515606233 , 0.0326859382093) (1 row) select gnomonic_inv(point '(2.95, 0.545)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38069288002 , 0.317532355075) (1 row) select gnomonic_inv(point '(2.95, 0.55)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38154729845 , 0.318861246744) (1 row) select gnomonic_inv(point '(2.95, 0.555)', spoint '(3, 0.55)'); gnomonic_inv --------------------------------- (4.38240199663 , 0.32018919076) (1 row) select gnomonic_inv(point '(3, 0.545)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38378731662 , 0.312753597658) (1 row) select gnomonic_inv(point '(3, 0.55)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38462848315 , 0.314063671577) (1 row) select gnomonic_inv(point '(3, 0.555)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38546991631 , 0.315372838396) (1 row) select gnomonic_inv(point '(3.05, 0.545)', spoint '(3, 0.55)'); gnomonic_inv --------------------------------- (4.38678374836 , 0.30810938986) (1 row) select gnomonic_inv(point '(3.05, 0.55)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38761205219 , 0.309401127485) (1 row) select gnomonic_inv(point '(3.05, 0.555)', spoint '(3, 0.55)'); gnomonic_inv ---------------------------------- (4.38844061031 , 0.310691996365) (1 row) select gnomonic_inv(point '(4.95, -0.455)', spoint '(5, -0.45)'); gnomonic_inv ---------------------------------- (6.42981110208 , -0.16736666225) (1 row) select gnomonic_inv(point '(4.95, -0.45)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.42938044467 , -0.166481000773) (1 row) select gnomonic_inv(point '(4.95, -0.445)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.42894984006 , -0.165595153928) (1 row) select gnomonic_inv(point '(5, -0.455)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.43120262006 , -0.165755596923) (1 row) select gnomonic_inv(point '(5, -0.45)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.43077610111 , -0.164878340453) (1 row) select gnomonic_inv(point '(5, -0.445)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.43034963344 , -0.164000903857) (1 row) select gnomonic_inv(point '(5.05, -0.455)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.43256711154 , -0.164174672255) (1 row) select gnomonic_inv(point '(5.05, -0.45)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.43214465391 , -0.163305666876) (1 row) select gnomonic_inv(point '(5.05, -0.445)', spoint '(5, -0.45)'); gnomonic_inv ----------------------------------- (6.43172224608 , -0.162436486422) (1 row) select gnomonic_inv(point '(4.95, 0.045)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37213822757 , 0.0187969806712) (1 row) select gnomonic_inv(point '(4.95, 0.05)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37218674577 , 0.0197858028573) (1 row) select gnomonic_inv(point '(4.95, 0.055)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37223526492 , 0.0207746056121) (1 row) select gnomonic_inv(point '(5, 0.045)', spoint '(5, 0.05)'); gnomonic_inv ---------------------------------- (6.37407370398 , 0.018616268731) (1 row) select gnomonic_inv(point '(5, 0.05)', spoint '(5, 0.05)'); gnomonic_inv ---------------------------------- (6.37412177425 , 0.019595585605) (1 row) select gnomonic_inv(point '(5, 0.055)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37416984544 , 0.0205748836027) (1 row) select gnomonic_inv(point '(5.05, 0.045)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37597230446 , 0.0184389309028) (1 row) select gnomonic_inv(point '(5.05, 0.05)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37601993463 , 0.0194089199093) (1 row) select gnomonic_inv(point '(5.05, 0.055)', spoint '(5, 0.05)'); gnomonic_inv ----------------------------------- (6.37606756569 , 0.0203788905738) (1 row) select gnomonic_inv(point '(4.95, 0.545)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45661633464 , 0.195624197626) (1 row) select gnomonic_inv(point '(4.95, 0.55)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45713747936 , 0.196458682014) (1 row) select gnomonic_inv(point '(4.95, 0.555)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45765868608 , 0.197292936568) (1 row) select gnomonic_inv(point '(5, 0.545)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45774838305 , 0.193741168464) (1 row) select gnomonic_inv(point '(5, 0.55)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45826444902 , 0.194567808878) (1 row) select gnomonic_inv(point '(5, 0.555)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45878057519 , 0.195394225934) (1 row) select gnomonic_inv(point '(5.05, 0.545)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45885829716 , 0.191893369946) (1 row) select gnomonic_inv(point '(5.05, 0.55)', spoint '(5, 0.55)'); gnomonic_inv --------------------------------- (6.45936938113 , 0.19271230794) (1 row) select gnomonic_inv(point '(5.05, 0.555)', spoint '(5, 0.55)'); gnomonic_inv ---------------------------------- (6.45988052356 , 0.193531028815) (1 row) pgsphere-1.5.1/expected/healpix.out000066400000000000000000012116721461140101500173220ustar00rootroot00000000000000SELECT set_sphere_output_precision(9); set_sphere_output_precision ----------------------------- SET 9 (1 row) select nside2order(1); nside2order ------------- 0 (1 row) select nside2order(2); nside2order ------------- 1 (1 row) select nside2order(4); nside2order ------------- 2 (1 row) select nside2order(8); nside2order ------------- 3 (1 row) select nside2order(16); nside2order ------------- 4 (1 row) select nside2order(32); nside2order ------------- 5 (1 row) select nside2order(64); nside2order ------------- 6 (1 row) select nside2order(128); nside2order ------------- 7 (1 row) select nside2order(256); nside2order ------------- 8 (1 row) select nside2order(512); nside2order ------------- 9 (1 row) select nside2order(1024); nside2order ------------- 10 (1 row) select nside2order(2048); nside2order ------------- 11 (1 row) select nside2order(4096); nside2order ------------- 12 (1 row) select nside2order(8192); nside2order ------------- 13 (1 row) select nside2order(16384); nside2order ------------- 14 (1 row) select nside2order(32768); nside2order ------------- 15 (1 row) select nside2order(65536); nside2order ------------- 16 (1 row) select nside2order(131072); nside2order ------------- 17 (1 row) select nside2order(262144); nside2order ------------- 18 (1 row) select nside2order(524288); nside2order ------------- 19 (1 row) select nside2order(1048576); nside2order ------------- 20 (1 row) select nside2order(2097152); nside2order ------------- 21 (1 row) select nside2order(4194304); nside2order ------------- 22 (1 row) select nside2order(8388608); nside2order ------------- 23 (1 row) select nside2order(16777216); nside2order ------------- 24 (1 row) select nside2order(33554432); nside2order ------------- 25 (1 row) select nside2order(67108864); nside2order ------------- 26 (1 row) select nside2order(134217728); nside2order ------------- 27 (1 row) select nside2order(268435456); nside2order ------------- 28 (1 row) select nside2order(536870912); nside2order ------------- 29 (1 row) select order2nside(0); order2nside ------------- 1 (1 row) select order2nside(1); order2nside ------------- 2 (1 row) select order2nside(2); order2nside ------------- 4 (1 row) select order2nside(3); order2nside ------------- 8 (1 row) select order2nside(4); order2nside ------------- 16 (1 row) select order2nside(5); order2nside ------------- 32 (1 row) select order2nside(6); order2nside ------------- 64 (1 row) select order2nside(7); order2nside ------------- 128 (1 row) select order2nside(8); order2nside ------------- 256 (1 row) select order2nside(9); order2nside ------------- 512 (1 row) select order2nside(10); order2nside ------------- 1024 (1 row) select order2nside(11); order2nside ------------- 2048 (1 row) select order2nside(12); order2nside ------------- 4096 (1 row) select order2nside(13); order2nside ------------- 8192 (1 row) select order2nside(14); order2nside ------------- 16384 (1 row) select order2nside(15); order2nside ------------- 32768 (1 row) select order2nside(16); order2nside ------------- 65536 (1 row) select order2nside(17); order2nside ------------- 131072 (1 row) select order2nside(18); order2nside ------------- 262144 (1 row) select order2nside(19); order2nside ------------- 524288 (1 row) select order2nside(20); order2nside ------------- 1048576 (1 row) select order2nside(21); order2nside ------------- 2097152 (1 row) select order2nside(22); order2nside ------------- 4194304 (1 row) select order2nside(23); order2nside ------------- 8388608 (1 row) select order2nside(24); order2nside ------------- 16777216 (1 row) select order2nside(25); order2nside ------------- 33554432 (1 row) select order2nside(26); order2nside ------------- 67108864 (1 row) select order2nside(27); order2nside ------------- 134217728 (1 row) select order2nside(28); order2nside ------------- 268435456 (1 row) select order2nside(29); order2nside ------------- 536870912 (1 row) select nside2npix(1); nside2npix ------------ 12 (1 row) select nside2npix(2); nside2npix ------------ 48 (1 row) select nside2npix(4); nside2npix ------------ 192 (1 row) select nside2npix(8); nside2npix ------------ 768 (1 row) select nside2npix(16); nside2npix ------------ 3072 (1 row) select nside2npix(32); nside2npix ------------ 12288 (1 row) select nside2npix(64); nside2npix ------------ 49152 (1 row) select nside2npix(128); nside2npix ------------ 196608 (1 row) select nside2npix(256); nside2npix ------------ 786432 (1 row) select nside2npix(512); nside2npix ------------ 3145728 (1 row) select nside2npix(1024); nside2npix ------------ 12582912 (1 row) select nside2npix(2048); nside2npix ------------ 50331648 (1 row) select nside2npix(4096); nside2npix ------------ 201326592 (1 row) select nside2npix(8192); nside2npix ------------ 805306368 (1 row) select nside2npix(16384); nside2npix ------------ 3221225472 (1 row) select nside2npix(32768); nside2npix ------------- 12884901888 (1 row) select nside2npix(65536); nside2npix ------------- 51539607552 (1 row) select nside2npix(131072); nside2npix -------------- 206158430208 (1 row) select nside2npix(262144); nside2npix -------------- 824633720832 (1 row) select nside2npix(524288); nside2npix --------------- 3298534883328 (1 row) select nside2npix(1048576); nside2npix ---------------- 13194139533312 (1 row) select nside2npix(2097152); nside2npix ---------------- 52776558133248 (1 row) select nside2npix(4194304); nside2npix ----------------- 211106232532992 (1 row) select nside2npix(8388608); nside2npix ----------------- 844424930131968 (1 row) select nside2npix(16777216); nside2npix ------------------ 3377699720527872 (1 row) select nside2npix(33554432); nside2npix ------------------- 13510798882111488 (1 row) select nside2npix(67108864); nside2npix ------------------- 54043195528445952 (1 row) select nside2npix(134217728); nside2npix -------------------- 216172782113783808 (1 row) select nside2npix(268435456); nside2npix -------------------- 864691128455135232 (1 row) select nside2npix(536870912); nside2npix --------------------- 3458764513820540928 (1 row) select npix2nside(12); npix2nside ------------ 1 (1 row) select npix2nside(48); npix2nside ------------ 2 (1 row) select npix2nside(192); npix2nside ------------ 4 (1 row) select npix2nside(768); npix2nside ------------ 8 (1 row) select npix2nside(3072); npix2nside ------------ 16 (1 row) select npix2nside(12288); npix2nside ------------ 32 (1 row) select npix2nside(49152); npix2nside ------------ 64 (1 row) select npix2nside(196608); npix2nside ------------ 128 (1 row) select npix2nside(786432); npix2nside ------------ 256 (1 row) select npix2nside(3145728); npix2nside ------------ 512 (1 row) select npix2nside(12582912); npix2nside ------------ 1024 (1 row) select npix2nside(50331648); npix2nside ------------ 2048 (1 row) select npix2nside(201326592); npix2nside ------------ 4096 (1 row) select npix2nside(805306368); npix2nside ------------ 8192 (1 row) select npix2nside(3221225472); npix2nside ------------ 16384 (1 row) select npix2nside(12884901888); npix2nside ------------ 32768 (1 row) select npix2nside(51539607552); npix2nside ------------ 65536 (1 row) select npix2nside(206158430208); npix2nside ------------ 131072 (1 row) select npix2nside(824633720832); npix2nside ------------ 262144 (1 row) select npix2nside(3298534883328); npix2nside ------------ 524288 (1 row) select npix2nside(13194139533312); npix2nside ------------ 1048576 (1 row) select npix2nside(52776558133248); npix2nside ------------ 2097152 (1 row) select npix2nside(211106232532992); npix2nside ------------ 4194304 (1 row) select npix2nside(844424930131968); npix2nside ------------ 8388608 (1 row) select npix2nside(3377699720527872); npix2nside ------------ 16777216 (1 row) select npix2nside(13510798882111488); npix2nside ------------ 33554432 (1 row) select npix2nside(54043195528445952); npix2nside ------------ 67108864 (1 row) select npix2nside(216172782113783808); npix2nside ------------ 134217728 (1 row) select npix2nside(864691128455135232); npix2nside ------------ 268435456 (1 row) select npix2nside(3458764513820540928); npix2nside ------------ 536870912 (1 row) select healpix_nest(0, '(0d, -90d)'); healpix_nest -------------- 8 (1 row) select healpix_ring(0, '(0d, -45d)'); healpix_ring -------------- 8 (1 row) select healpix_ring(0, '(0d, 0.0001)'); healpix_ring -------------- 4 (1 row) select healpix_ring(0, '(0d, 45d)'); healpix_ring -------------- 3 (1 row) select healpix_ring(0, '(0d, 90d)'); healpix_ring -------------- 7 (1 row) select healpix_ring(0, '(90d, -90d)'); healpix_ring -------------- 9 (1 row) select healpix_ring(0, '(90d, -45d)'); healpix_ring -------------- 9 (1 row) select healpix_ring(0, '(90d, 0.0001)'); healpix_ring -------------- 5 (1 row) select healpix_ring(0, '(90d, 45d)'); healpix_ring -------------- 3 (1 row) select healpix_nest(0, '(90d, 90d)'); healpix_nest -------------- 4 (1 row) select healpix_nest(0, '(180d, -90d)'); healpix_nest -------------- 10 (1 row) select healpix_ring(0, '(180d, -45d)'); healpix_ring -------------- 10 (1 row) select healpix_ring(0, '(180d, 0.0001)'); healpix_ring -------------- 6 (1 row) select healpix_nest(0, '(180d, 45d)'); healpix_nest -------------- 4 (1 row) select healpix_nest(0, '(180d, 90d)'); healpix_nest -------------- 5 (1 row) select healpix_nest(0, '(270d, -90d)'); healpix_nest -------------- 11 (1 row) select healpix_nest(0, '(270d, -45d)'); healpix_nest -------------- 11 (1 row) select healpix_ring(0, '(270d, 0.0001)'); healpix_ring -------------- 7 (1 row) select healpix_nest(0, '(270d, 45d)'); healpix_nest -------------- 5 (1 row) select healpix_nest(0, '(270d, 90d)'); healpix_nest -------------- 6 (1 row) select healpix_nest(0, '(360d, -90d)'); healpix_nest -------------- 8 (1 row) select healpix_ring(0, '(360d, -45d)'); healpix_ring -------------- 8 (1 row) select healpix_nest(0, '(360d, 0.0001)'); healpix_nest -------------- 4 (1 row) select healpix_nest(0, '(360d, 45d)'); healpix_nest -------------- 2 (1 row) select healpix_ring(0, '(360d, 90d)'); healpix_ring -------------- 7 (1 row) select healpix_nest(5, '(0d, -90d)'); healpix_nest -------------- 8192 (1 row) select healpix_ring(5, '(0d, -67.5d)'); healpix_ring -------------- 11744 (1 row) select healpix_nest(5, '(0d, -45d)'); healpix_nest -------------- 8866 (1 row) select healpix_nest(5, '(0d, -22.5d)'); healpix_nest -------------- 4156 (1 row) select healpix_nest(5, '(0d, 0.0001)'); healpix_nest -------------- 4864 (1 row) select healpix_nest(5, '(0d, 22.5d)'); healpix_nest -------------- 5059 (1 row) select healpix_ring(5, '(0d, 45d)'); healpix_ring -------------- 1751 (1 row) select healpix_ring(5, '(0d, 67.5d)'); healpix_ring -------------- 547 (1 row) select healpix_ring(5, '(0d, 90d)'); healpix_ring -------------- 131 (1 row) select healpix_nest(5, '(45d, -90d)'); healpix_nest -------------- 8192 (1 row) select healpix_nest(5, '(45d, -67.5d)'); healpix_nest -------------- 8255 (1 row) select healpix_nest(5, '(45d, -45d)'); healpix_nest -------------- 8444 (1 row) select healpix_ring(5, '(45d, -22.5d)'); healpix_ring -------------- 8528 (1 row) select healpix_ring(5, '(45d, 0.0001)'); healpix_ring -------------- 5968 (1 row) select healpix_nest(5, '(45d, 22.5d)'); healpix_nest -------------- 195 (1 row) select healpix_nest(5, '(45d, 45d)'); healpix_nest -------------- 771 (1 row) select healpix_ring(5, '(45d, 67.5d)'); healpix_ring -------------- 427 (1 row) select healpix_nest(5, '(45d, 90d)'); healpix_nest -------------- 3072 (1 row) select healpix_ring(5, '(90d, -90d)'); healpix_ring -------------- 12285 (1 row) select healpix_nest(5, '(90d, -67.5d)'); healpix_nest -------------- 9386 (1 row) select healpix_nest(5, '(90d, -45d)'); healpix_nest -------------- 9890 (1 row) select healpix_ring(5, '(90d, -22.5d)'); healpix_ring -------------- 8544 (1 row) select healpix_ring(5, '(90d, 0.0001)'); healpix_ring -------------- 5984 (1 row) select healpix_ring(5, '(90d, 22.5d)'); healpix_ring -------------- 3680 (1 row) select healpix_ring(5, '(90d, 45d)'); healpix_ring -------------- 1652 (1 row) select healpix_nest(5, '(90d, 67.5d)'); healpix_nest -------------- 3328 (1 row) select healpix_nest(5, '(90d, 90d)'); healpix_nest -------------- 4096 (1 row) select healpix_ring(5, '(135d, -90d)'); healpix_ring -------------- 12285 (1 row) select healpix_ring(5, '(135d, -67.5d)'); healpix_ring -------------- 11830 (1 row) select healpix_nest(5, '(135d, -45d)'); healpix_nest -------------- 9468 (1 row) select healpix_nest(5, '(135d, -22.5d)'); healpix_nest -------------- 10044 (1 row) select healpix_nest(5, '(135d, 0.0001)'); healpix_nest -------------- 1024 (1 row) select healpix_ring(5, '(135d, 22.5d)'); healpix_ring -------------- 3696 (1 row) select healpix_nest(5, '(135d, 45d)'); healpix_nest -------------- 1795 (1 row) select healpix_ring(5, '(135d, 67.5d)'); healpix_ring -------------- 442 (1 row) select healpix_ring(5, '(135d, 90d)'); healpix_ring -------------- 130 (1 row) select healpix_ring(5, '(180d, -90d)'); healpix_ring -------------- 12286 (1 row) select healpix_nest(5, '(180d, -67.5d)'); healpix_nest -------------- 10410 (1 row) select healpix_nest(5, '(180d, -45d)'); healpix_nest -------------- 10914 (1 row) select healpix_ring(5, '(180d, -22.5d)'); healpix_ring -------------- 8576 (1 row) select healpix_ring(5, '(180d, 0.0001)'); healpix_ring -------------- 6016 (1 row) select healpix_nest(5, '(180d, 22.5d)'); healpix_nest -------------- 7107 (1 row) select healpix_ring(5, '(180d, 45d)'); healpix_ring -------------- 1681 (1 row) select healpix_ring(5, '(180d, 67.5d)'); healpix_ring -------------- 449 (1 row) select healpix_ring(5, '(180d, 90d)'); healpix_ring -------------- 129 (1 row) select healpix_nest(5, '(225d, -90d)'); healpix_nest -------------- 10240 (1 row) select healpix_ring(5, '(225d, -67.5d)'); healpix_ring -------------- 11845 (1 row) select healpix_ring(5, '(225d, -45d)'); healpix_ring -------------- 10620 (1 row) select healpix_nest(5, '(225d, -22.5d)'); healpix_nest -------------- 11068 (1 row) select healpix_nest(5, '(225d, 0.0001)'); healpix_nest -------------- 2048 (1 row) select healpix_nest(5, '(225d, 22.5d)'); healpix_nest -------------- 2243 (1 row) select healpix_nest(5, '(225d, 45d)'); healpix_nest -------------- 2819 (1 row) select healpix_ring(5, '(225d, 67.5d)'); healpix_ring -------------- 457 (1 row) select healpix_ring(5, '(225d, 90d)'); healpix_ring -------------- 129 (1 row) select healpix_ring(5, '(270d, -90d)'); healpix_ring -------------- 12287 (1 row) select healpix_ring(5, '(270d, -67.5d)'); healpix_ring -------------- 11792 (1 row) select healpix_ring(5, '(270d, -45d)'); healpix_ring -------------- 10518 (1 row) select healpix_nest(5, '(270d, -22.5d)'); healpix_nest -------------- 7228 (1 row) select healpix_nest(5, '(270d, 0.0001)'); healpix_nest -------------- 7936 (1 row) select healpix_nest(5, '(270d, 22.5d)'); healpix_nest -------------- 8131 (1 row) select healpix_ring(5, '(270d, 45d)'); healpix_ring -------------- 1710 (1 row) select healpix_ring(5, '(270d, 67.5d)'); healpix_ring -------------- 464 (1 row) select healpix_ring(5, '(270d, 90d)'); healpix_ring -------------- 128 (1 row) select healpix_ring(5, '(315d, -90d)'); healpix_ring -------------- 12287 (1 row) select healpix_nest(5, '(315d, -67.5d)'); healpix_nest -------------- 11327 (1 row) select healpix_ring(5, '(315d, -45d)'); healpix_ring -------------- 10649 (1 row) select healpix_nest(5, '(315d, -22.5d)'); healpix_nest -------------- 12092 (1 row) select healpix_nest(5, '(315d, 0.0001)'); healpix_nest -------------- 3072 (1 row) select healpix_nest(5, '(315d, 22.5d)'); healpix_nest -------------- 3267 (1 row) select healpix_nest(5, '(315d, 45d)'); healpix_nest -------------- 3843 (1 row) select healpix_ring(5, '(315d, 67.5d)'); healpix_ring -------------- 472 (1 row) select healpix_ring(5, '(315d, 90d)'); healpix_ring -------------- 128 (1 row) select healpix_nest(5, '(360d, -90d)'); healpix_nest -------------- 8192 (1 row) select healpix_nest(5, '(360d, -67.5d)'); healpix_nest -------------- 8362 (1 row) select healpix_nest(5, '(360d, -45d)'); healpix_nest -------------- 8866 (1 row) select healpix_ring(5, '(360d, -22.5d)'); healpix_ring -------------- 8512 (1 row) select healpix_nest(5, '(360d, 0.0001)'); healpix_nest -------------- 4864 (1 row) select healpix_ring(5, '(360d, 22.5d)'); healpix_ring -------------- 3648 (1 row) select healpix_nest(5, '(360d, 45d)'); healpix_nest -------------- 2052 (1 row) select healpix_nest(5, '(360d, 67.5d)'); healpix_nest -------------- 2304 (1 row) select healpix_nest(5, '(360d, 90d)'); healpix_nest -------------- 3072 (1 row) select healpix_ring(10, '(0d, -90d)'); healpix_ring -------------- 12582908 (1 row) select healpix_ring(10, '(0d, -78.75d)'); healpix_ring -------------- 12461388 (1 row) select healpix_ring(10, '(0d, -67.5d)'); healpix_ring -------------- 12101732 (1 row) select healpix_nest(10, '(0d, -56.25d)'); healpix_nest -------------- 8954496 (1 row) select healpix_nest(10, '(0d, -45d)'); healpix_nest -------------- 9079466 (1 row) select healpix_nest(10, '(0d, -33.75d)'); healpix_nest -------------- 4207411 (1 row) select healpix_ring(10, '(0d, -22.5d)'); healpix_ring -------------- 8693760 (1 row) select healpix_nest(10, '(0d, -11.25d)'); healpix_nest -------------- 4406476 (1 row) select healpix_ring(10, '(0d, 0.0001)'); healpix_ring -------------- 6285312 (1 row) select healpix_nest(10, '(0d, 11.25d)'); healpix_nest -------------- 5030707 (1 row) select healpix_ring(10, '(0d, 22.5d)'); healpix_ring -------------- 3885056 (1 row) select healpix_ring(10, '(0d, 33.75d)'); healpix_ring -------------- 2795520 (1 row) select healpix_ring(10, '(0d, 45d)'); healpix_ring -------------- 1841539 (1 row) select healpix_ring(10, '(0d, 56.25d)'); healpix_ring -------------- 1062607 (1 row) select healpix_nest(10, '(0d, 67.5d)'); healpix_nest -------------- 2359572 (1 row) select healpix_nest(10, '(0d, 78.75d)'); healpix_nest -------------- 2424900 (1 row) select healpix_nest(10, '(0d, 90d)'); healpix_nest -------------- 3145728 (1 row) select healpix_nest(10, '(22.5d, -90d)'); healpix_nest -------------- 8388608 (1 row) select healpix_nest(10, '(22.5d, -78.75d)'); healpix_nest -------------- 8425425 (1 row) select healpix_nest(10, '(22.5d, -67.5d)'); healpix_nest -------------- 8535534 (1 row) select healpix_ring(10, '(22.5d, -56.25d)'); healpix_ring -------------- 11518754 (1 row) select healpix_nest(10, '(22.5d, -45d)'); healpix_nest -------------- 8975615 (1 row) select healpix_nest(10, '(22.5d, -33.75d)'); healpix_nest -------------- 9122611 (1 row) select healpix_nest(10, '(22.5d, -22.5d)'); healpix_nest -------------- 9171916 (1 row) select healpix_ring(10, '(22.5d, -11.25d)'); healpix_ring -------------- 7514368 (1 row) select healpix_nest(10, '(22.5d, 0.0001)'); healpix_nest -------------- 4653056 (1 row) select healpix_ring(10, '(22.5d, 11.25d)'); healpix_ring -------------- 5064960 (1 row) select healpix_ring(10, '(22.5d, 22.5d)'); healpix_ring -------------- 3885312 (1 row) select healpix_ring(10, '(22.5d, 33.75d)'); healpix_ring -------------- 2795776 (1 row) select healpix_nest(10, '(22.5d, 45d)'); healpix_nest -------------- 722688 (1 row) select healpix_ring(10, '(22.5d, 56.25d)'); healpix_ring -------------- 1061606 (1 row) select healpix_ring(10, '(22.5d, 67.5d)'); healpix_ring -------------- 479342 (1 row) select healpix_nest(10, '(22.5d, 78.75d)'); healpix_nest -------------- 1028125 (1 row) select healpix_nest(10, '(22.5d, 90d)'); healpix_nest -------------- 3145728 (1 row) select healpix_nest(10, '(45d, -90d)'); healpix_nest -------------- 8388608 (1 row) select healpix_ring(10, '(45d, -78.75d)'); healpix_ring -------------- 12462494 (1 row) select healpix_nest(10, '(45d, -67.5d)'); healpix_nest -------------- 8453936 (1 row) select healpix_ring(10, '(45d, -56.25d)'); healpix_ring -------------- 11518936 (1 row) select healpix_nest(10, '(45d, -45d)'); healpix_nest -------------- 8647679 (1 row) select healpix_ring(10, '(45d, -33.75d)'); healpix_ring -------------- 9783808 (1 row) select healpix_nest(10, '(45d, -22.5d)'); healpix_nest -------------- 9237452 (1 row) select healpix_nest(10, '(45d, -11.25d)'); healpix_nest -------------- 9387212 (1 row) select healpix_nest(10, '(45d, 0.0001)'); healpix_nest -------------- 0 (1 row) select healpix_nest(10, '(45d, 11.25d)'); healpix_nest -------------- 49971 (1 row) select healpix_nest(10, '(45d, 22.5d)'); healpix_nest -------------- 199731 (1 row) select healpix_nest(10, '(45d, 33.75d)'); healpix_nest -------------- 249036 (1 row) select healpix_nest(10, '(45d, 45d)'); healpix_nest -------------- 789504 (1 row) select healpix_nest(10, '(45d, 56.25d)'); healpix_nest -------------- 836367 (1 row) select healpix_ring(10, '(45d, 67.5d)'); healpix_ring -------------- 477508 (1 row) select healpix_ring(10, '(45d, 78.75d)'); healpix_ring -------------- 119682 (1 row) select healpix_ring(10, '(45d, 90d)'); healpix_ring -------------- 4099 (1 row) select healpix_nest(10, '(67.5d, -90d)'); healpix_nest -------------- 8388608 (1 row) select healpix_nest(10, '(67.5d, -78.75d)'); healpix_nest -------------- 8409058 (1 row) select healpix_nest(10, '(67.5d, -67.5d)'); healpix_nest -------------- 8470237 (1 row) select healpix_nest(10, '(67.5d, -56.25d)'); healpix_nest -------------- 8687148 (1 row) select healpix_nest(10, '(67.5d, -45d)'); healpix_nest -------------- 8714495 (1 row) select healpix_nest(10, '(67.5d, -33.75d)'); healpix_nest -------------- 8860467 (1 row) select healpix_nest(10, '(67.5d, -22.5d)'); healpix_nest -------------- 8909772 (1 row) select healpix_nest(10, '(67.5d, -11.25d)'); healpix_nest -------------- 5782732 (1 row) select healpix_ring(10, '(67.5d, 0.0001)'); healpix_ring -------------- 6286080 (1 row) select healpix_ring(10, '(67.5d, 11.25d)'); healpix_ring -------------- 5065472 (1 row) select healpix_ring(10, '(67.5d, 22.5d)'); healpix_ring -------------- 3885824 (1 row) select healpix_nest(10, '(67.5d, 33.75d)'); healpix_nest -------------- 314572 (1 row) select healpix_nest(10, '(67.5d, 45d)'); healpix_nest -------------- 461568 (1 row) select healpix_ring(10, '(67.5d, 56.25d)'); healpix_ring -------------- 1061970 (1 row) select healpix_nest(10, '(67.5d, 67.5d)'); healpix_nest -------------- 901649 (1 row) select healpix_nest(10, '(67.5d, 78.75d)'); healpix_nest -------------- 1011758 (1 row) select healpix_nest(10, '(67.5d, 90d)'); healpix_nest -------------- 3145728 (1 row) select healpix_nest(10, '(90d, -90d)'); healpix_nest -------------- 9437184 (1 row) select healpix_nest(10, '(90d, -78.75d)'); healpix_nest -------------- 9480738 (1 row) select healpix_ring(10, '(90d, -67.5d)'); healpix_ring -------------- 12102222 (1 row) select healpix_ring(10, '(90d, -56.25d)'); healpix_ring -------------- 11519301 (1 row) select healpix_nest(10, '(90d, -45d)'); healpix_nest -------------- 10128042 (1 row) select healpix_ring(10, '(90d, -33.75d)'); healpix_ring -------------- 9784320 (1 row) select healpix_ring(10, '(90d, -22.5d)'); healpix_ring -------------- 8694784 (1 row) select healpix_nest(10, '(90d, -11.25d)'); healpix_nest -------------- 5455052 (1 row) select healpix_nest(10, '(90d, 0.0001)'); healpix_nest -------------- 6029312 (1 row) select healpix_ring(10, '(90d, 11.25d)'); healpix_ring -------------- 5065728 (1 row) select healpix_nest(10, '(90d, 22.5d)'); healpix_nest -------------- 6229043 (1 row) select healpix_ring(10, '(90d, 33.75d)'); healpix_ring -------------- 2796544 (1 row) select healpix_nest(10, '(90d, 45d)'); healpix_nest -------------- 3149824 (1 row) select healpix_nest(10, '(90d, 56.25d)'); healpix_nest -------------- 3212309 (1 row) select healpix_nest(10, '(90d, 67.5d)'); healpix_nest -------------- 3408148 (1 row) select healpix_ring(10, '(90d, 78.75d)'); healpix_ring -------------- 119804 (1 row) select healpix_nest(10, '(90d, 90d)'); healpix_nest -------------- 4194304 (1 row) select healpix_nest(10, '(112.5d, -90d)'); healpix_nest -------------- 9437184 (1 row) select healpix_nest(10, '(112.5d, -78.75d)'); healpix_nest -------------- 9474001 (1 row) select healpix_ring(10, '(112.5d, -67.5d)'); healpix_ring -------------- 12102344 (1 row) select healpix_ring(10, '(112.5d, -56.25d)'); healpix_ring -------------- 11519483 (1 row) select healpix_ring(10, '(112.5d, -45d)'); healpix_ring -------------- 10742830 (1 row) select healpix_ring(10, '(112.5d, -33.75d)'); healpix_ring -------------- 9784576 (1 row) select healpix_ring(10, '(112.5d, -22.5d)'); healpix_ring -------------- 8695040 (1 row) select healpix_nest(10, '(112.5d, -11.25d)'); healpix_nest -------------- 5520588 (1 row) select healpix_nest(10, '(112.5d, 0.0001)'); healpix_nest -------------- 5701632 (1 row) select healpix_nest(10, '(112.5d, 11.25d)'); healpix_nest -------------- 5751603 (1 row) select healpix_ring(10, '(112.5d, 22.5d)'); healpix_ring -------------- 3886336 (1 row) select healpix_nest(10, '(112.5d, 33.75d)'); healpix_nest -------------- 1625292 (1 row) select healpix_nest(10, '(112.5d, 45d)'); healpix_nest -------------- 1771264 (1 row) select healpix_ring(10, '(112.5d, 56.25d)'); healpix_ring -------------- 1062335 (1 row) select healpix_ring(10, '(112.5d, 67.5d)'); healpix_ring -------------- 479832 (1 row) select healpix_nest(10, '(112.5d, 78.75d)'); healpix_nest -------------- 2076701 (1 row) select healpix_ring(10, '(112.5d, 90d)'); healpix_ring -------------- 4098 (1 row) select healpix_nest(10, '(135d, -90d)'); healpix_nest -------------- 9437184 (1 row) select healpix_ring(10, '(135d, -78.75d)'); healpix_ring -------------- 12462739 (1 row) select healpix_ring(10, '(135d, -67.5d)'); healpix_ring -------------- 12104425 (1 row) select healpix_nest(10, '(135d, -56.25d)'); healpix_nest -------------- 9649392 (1 row) select healpix_ring(10, '(135d, -45d)'); healpix_ring -------------- 10743070 (1 row) select healpix_ring(10, '(135d, -33.75d)'); healpix_ring -------------- 9784832 (1 row) select healpix_nest(10, '(135d, -22.5d)'); healpix_nest -------------- 10286028 (1 row) select healpix_nest(10, '(135d, -11.25d)'); healpix_nest -------------- 10435788 (1 row) select healpix_nest(10, '(135d, 0.0001)'); healpix_nest -------------- 1048576 (1 row) select healpix_nest(10, '(135d, 11.25d)'); healpix_nest -------------- 1098547 (1 row) select healpix_nest(10, '(135d, 22.5d)'); healpix_nest -------------- 1248307 (1 row) select healpix_ring(10, '(135d, 33.75d)'); healpix_ring -------------- 2797056 (1 row) select healpix_ring(10, '(135d, 45d)'); healpix_ring -------------- 1838882 (1 row) select healpix_ring(10, '(135d, 56.25d)'); healpix_ring -------------- 1062517 (1 row) select healpix_nest(10, '(135d, 67.5d)'); healpix_nest -------------- 2031823 (1 row) select healpix_ring(10, '(135d, 78.75d)'); healpix_ring -------------- 119927 (1 row) select healpix_ring(10, '(135d, 90d)'); healpix_ring -------------- 4098 (1 row) select healpix_ring(10, '(157.5d, -90d)'); healpix_ring -------------- 12582909 (1 row) select healpix_nest(10, '(157.5d, -78.75d)'); healpix_nest -------------- 9457634 (1 row) select healpix_ring(10, '(157.5d, -67.5d)'); healpix_ring -------------- 12102589 (1 row) select healpix_ring(10, '(157.5d, -56.25d)'); healpix_ring -------------- 11519847 (1 row) select healpix_nest(10, '(157.5d, -45d)'); healpix_nest -------------- 9763071 (1 row) select healpix_nest(10, '(157.5d, -33.75d)'); healpix_nest -------------- 9909043 (1 row) select healpix_ring(10, '(157.5d, -22.5d)'); healpix_ring -------------- 8695552 (1 row) select healpix_nest(10, '(157.5d, -11.25d)'); healpix_nest -------------- 6831308 (1 row) select healpix_nest(10, '(157.5d, 0.0001)'); healpix_nest -------------- 7012352 (1 row) select healpix_ring(10, '(157.5d, 11.25d)'); healpix_ring -------------- 5066496 (1 row) select healpix_ring(10, '(157.5d, 22.5d)'); healpix_ring -------------- 3886848 (1 row) select healpix_nest(10, '(157.5d, 33.75d)'); healpix_nest -------------- 1363148 (1 row) select healpix_nest(10, '(157.5d, 45d)'); healpix_nest -------------- 1510144 (1 row) select healpix_ring(10, '(157.5d, 56.25d)'); healpix_ring -------------- 1062699 (1 row) select healpix_ring(10, '(157.5d, 67.5d)'); healpix_ring -------------- 480077 (1 row) select healpix_nest(10, '(157.5d, 78.75d)'); healpix_nest -------------- 2060334 (1 row) select healpix_ring(10, '(157.5d, 90d)'); healpix_ring -------------- 4098 (1 row) select healpix_nest(10, '(180d, -90d)'); healpix_nest -------------- 10485760 (1 row) select healpix_ring(10, '(180d, -78.75d)'); healpix_ring -------------- 12461880 (1 row) select healpix_nest(10, '(180d, -67.5d)'); healpix_nest -------------- 10659970 (1 row) select healpix_ring(10, '(180d, -56.25d)'); healpix_ring -------------- 11520030 (1 row) select healpix_ring(10, '(180d, -45d)'); healpix_ring -------------- 10739712 (1 row) select healpix_ring(10, '(180d, -33.75d)'); healpix_ring -------------- 9785344 (1 row) select healpix_nest(10, '(180d, -22.5d)'); healpix_nest -------------- 6353868 (1 row) select healpix_ring(10, '(180d, -11.25d)'); healpix_ring -------------- 7516160 (1 row) select healpix_nest(10, '(180d, 0.0001)'); healpix_nest -------------- 7077888 (1 row) select healpix_nest(10, '(180d, 11.25d)'); healpix_nest -------------- 7127859 (1 row) select healpix_ring(10, '(180d, 22.5d)'); healpix_ring -------------- 3887104 (1 row) select healpix_nest(10, '(180d, 33.75d)'); healpix_nest -------------- 7326924 (1 row) select healpix_nest(10, '(180d, 45d)'); healpix_nest -------------- 4198400 (1 row) select healpix_nest(10, '(180d, 56.25d)'); healpix_nest -------------- 4260885 (1 row) select healpix_ring(10, '(180d, 67.5d)'); healpix_ring -------------- 478241 (1 row) select healpix_ring(10, '(180d, 78.75d)'); healpix_ring -------------- 120049 (1 row) select healpix_nest(10, '(180d, 90d)'); healpix_nest -------------- 5242880 (1 row) select healpix_nest(10, '(202.5d, -90d)'); healpix_nest -------------- 10485760 (1 row) select healpix_ring(10, '(202.5d, -78.75d)'); healpix_ring -------------- 12461941 (1 row) select healpix_nest(10, '(202.5d, -67.5d)'); healpix_nest -------------- 10632686 (1 row) select healpix_nest(10, '(202.5d, -56.25d)'); healpix_nest -------------- 11029788 (1 row) select healpix_nest(10, '(202.5d, -45d)'); healpix_nest -------------- 11072767 (1 row) select healpix_nest(10, '(202.5d, -33.75d)'); healpix_nest -------------- 11219763 (1 row) select healpix_nest(10, '(202.5d, -22.5d)'); healpix_nest -------------- 11269068 (1 row) select healpix_nest(10, '(202.5d, -11.25d)'); healpix_nest -------------- 6569164 (1 row) select healpix_nest(10, '(202.5d, 0.0001)'); healpix_nest -------------- 6750208 (1 row) select healpix_ring(10, '(202.5d, 11.25d)'); healpix_ring -------------- 5067008 (1 row) select healpix_ring(10, '(202.5d, 22.5d)'); healpix_ring -------------- 3887360 (1 row) select healpix_ring(10, '(202.5d, 33.75d)'); healpix_ring -------------- 2797824 (1 row) select healpix_nest(10, '(202.5d, 45d)'); healpix_nest -------------- 2819840 (1 row) select healpix_nest(10, '(202.5d, 56.25d)'); healpix_nest -------------- 2847187 (1 row) select healpix_nest(10, '(202.5d, 67.5d)'); healpix_nest -------------- 3064098 (1 row) select healpix_nest(10, '(202.5d, 78.75d)'); healpix_nest -------------- 3125277 (1 row) select healpix_nest(10, '(202.5d, 90d)'); healpix_nest -------------- 5242880 (1 row) select healpix_ring(10, '(225d, -90d)'); healpix_ring -------------- 12582910 (1 row) select healpix_nest(10, '(225d, -78.75d)'); healpix_nest -------------- 10502092 (1 row) select healpix_nest(10, '(225d, -67.5d)'); healpix_nest -------------- 10551088 (1 row) select healpix_nest(10, '(225d, -56.25d)'); healpix_nest -------------- 10697968 (1 row) select healpix_ring(10, '(225d, -45d)'); healpix_ring -------------- 10744029 (1 row) select healpix_nest(10, '(225d, -33.75d)'); healpix_nest -------------- 11285299 (1 row) select healpix_ring(10, '(225d, -22.5d)'); healpix_ring -------------- 8696320 (1 row) select healpix_ring(10, '(225d, -11.25d)'); healpix_ring -------------- 7516672 (1 row) select healpix_ring(10, '(225d, 0.0001)'); healpix_ring -------------- 6287872 (1 row) select healpix_ring(10, '(225d, 11.25d)'); healpix_ring -------------- 5067264 (1 row) select healpix_nest(10, '(225d, 22.5d)'); healpix_nest -------------- 2296883 (1 row) select healpix_nest(10, '(225d, 33.75d)'); healpix_nest -------------- 2346188 (1 row) select healpix_nest(10, '(225d, 45d)'); healpix_nest -------------- 2886656 (1 row) select healpix_nest(10, '(225d, 56.25d)'); healpix_nest -------------- 2933519 (1 row) select healpix_nest(10, '(225d, 67.5d)'); healpix_nest -------------- 3080399 (1 row) select healpix_nest(10, '(225d, 78.75d)'); healpix_nest -------------- 3129395 (1 row) select healpix_ring(10, '(225d, 90d)'); healpix_ring -------------- 4097 (1 row) select healpix_nest(10, '(247.5d, -90d)'); healpix_nest -------------- 10485760 (1 row) select healpix_ring(10, '(247.5d, -78.75d)'); healpix_ring -------------- 12462064 (1 row) select healpix_ring(10, '(247.5d, -67.5d)'); healpix_ring -------------- 12103079 (1 row) select healpix_ring(10, '(247.5d, -56.25d)'); healpix_ring -------------- 11520576 (1 row) select healpix_ring(10, '(247.5d, -45d)'); healpix_ring -------------- 10744269 (1 row) select healpix_ring(10, '(247.5d, -33.75d)'); healpix_ring -------------- 9786112 (1 row) select healpix_nest(10, '(247.5d, -22.5d)'); healpix_nest -------------- 11006924 (1 row) select healpix_ring(10, '(247.5d, -11.25d)'); healpix_ring -------------- 7516928 (1 row) select healpix_nest(10, '(247.5d, 0.0001)'); healpix_nest -------------- 8060928 (1 row) select healpix_nest(10, '(247.5d, 11.25d)'); healpix_nest -------------- 8110899 (1 row) select healpix_nest(10, '(247.5d, 22.5d)'); healpix_nest -------------- 2362419 (1 row) select healpix_nest(10, '(247.5d, 33.75d)'); healpix_nest -------------- 2411724 (1 row) select healpix_nest(10, '(247.5d, 45d)'); healpix_nest -------------- 2558720 (1 row) select healpix_nest(10, '(247.5d, 56.25d)'); healpix_nest -------------- 2601699 (1 row) select healpix_nest(10, '(247.5d, 67.5d)'); healpix_nest -------------- 2998801 (1 row) select healpix_ring(10, '(247.5d, 78.75d)'); healpix_ring -------------- 121216 (1 row) select healpix_nest(10, '(247.5d, 90d)'); healpix_nest -------------- 5242880 (1 row) select healpix_nest(10, '(270d, -90d)'); healpix_nest -------------- 11534336 (1 row) select healpix_ring(10, '(270d, -78.75d)'); healpix_ring -------------- 12462126 (1 row) select healpix_ring(10, '(270d, -67.5d)'); healpix_ring -------------- 12103202 (1 row) select healpix_ring(10, '(270d, -56.25d)'); healpix_ring -------------- 11520759 (1 row) select healpix_nest(10, '(270d, -45d)'); healpix_nest -------------- 12225194 (1 row) select healpix_ring(10, '(270d, -33.75d)'); healpix_ring -------------- 9786368 (1 row) select healpix_nest(10, '(270d, -22.5d)'); healpix_nest -------------- 7402444 (1 row) select healpix_nest(10, '(270d, -11.25d)'); healpix_nest -------------- 7552204 (1 row) select healpix_nest(10, '(270d, 0.0001)'); healpix_nest -------------- 8126464 (1 row) select healpix_nest(10, '(270d, 11.25d)'); healpix_nest -------------- 8176435 (1 row) select healpix_nest(10, '(270d, 22.5d)'); healpix_nest -------------- 8326195 (1 row) select healpix_ring(10, '(270d, 33.75d)'); healpix_ring -------------- 2798592 (1 row) select healpix_ring(10, '(270d, 45d)'); healpix_ring -------------- 1840320 (1 row) select healpix_ring(10, '(270d, 56.25d)'); healpix_ring -------------- 1060695 (1 row) select healpix_ring(10, '(270d, 67.5d)'); healpix_ring -------------- 478730 (1 row) select healpix_ring(10, '(270d, 78.75d)'); healpix_ring -------------- 120294 (1 row) select healpix_nest(10, '(270d, 90d)'); healpix_nest -------------- 6291456 (1 row) select healpix_nest(10, '(292.5d, -90d)'); healpix_nest -------------- 11534336 (1 row) select healpix_ring(10, '(292.5d, -78.75d)'); healpix_ring -------------- 12462187 (1 row) select healpix_nest(10, '(292.5d, -67.5d)'); healpix_nest -------------- 11681262 (1 row) select healpix_nest(10, '(292.5d, -56.25d)'); healpix_nest -------------- 12078364 (1 row) select healpix_ring(10, '(292.5d, -45d)'); healpix_ring -------------- 10744748 (1 row) select healpix_ring(10, '(292.5d, -33.75d)'); healpix_ring -------------- 9786624 (1 row) select healpix_ring(10, '(292.5d, -22.5d)'); healpix_ring -------------- 8697088 (1 row) select healpix_ring(10, '(292.5d, -11.25d)'); healpix_ring -------------- 7517440 (1 row) select healpix_nest(10, '(292.5d, 0.0001)'); healpix_nest -------------- 7798784 (1 row) select healpix_ring(10, '(292.5d, 11.25d)'); healpix_ring -------------- 5068032 (1 row) select healpix_ring(10, '(292.5d, 22.5d)'); healpix_ring -------------- 3888384 (1 row) select healpix_nest(10, '(292.5d, 33.75d)'); healpix_nest -------------- 3722444 (1 row) select healpix_nest(10, '(292.5d, 45d)'); healpix_nest -------------- 3868416 (1 row) select healpix_nest(10, '(292.5d, 56.25d)'); healpix_nest -------------- 3895763 (1 row) select healpix_ring(10, '(292.5d, 67.5d)'); healpix_ring -------------- 480812 (1 row) select healpix_nest(10, '(292.5d, 78.75d)'); healpix_nest -------------- 4173853 (1 row) select healpix_ring(10, '(292.5d, 90d)'); healpix_ring -------------- 4096 (1 row) select healpix_nest(10, '(315d, -90d)'); healpix_nest -------------- 11534336 (1 row) select healpix_nest(10, '(315d, -78.75d)'); healpix_nest -------------- 11550668 (1 row) select healpix_ring(10, '(315d, -67.5d)'); healpix_ring -------------- 12105403 (1 row) select healpix_ring(10, '(315d, -56.25d)'); healpix_ring -------------- 11521123 (1 row) select healpix_nest(10, '(315d, -45d)'); healpix_nest -------------- 11793407 (1 row) select healpix_ring(10, '(315d, -33.75d)'); healpix_ring -------------- 9786880 (1 row) select healpix_nest(10, '(315d, -22.5d)'); healpix_nest -------------- 12383180 (1 row) select healpix_ring(10, '(315d, -11.25d)'); healpix_ring -------------- 7517696 (1 row) select healpix_nest(10, '(315d, 0.0001)'); healpix_nest -------------- 3145728 (1 row) select healpix_nest(10, '(315d, 11.25d)'); healpix_nest -------------- 3195699 (1 row) select healpix_ring(10, '(315d, 22.5d)'); healpix_ring -------------- 3888640 (1 row) select healpix_ring(10, '(315d, 33.75d)'); healpix_ring -------------- 2799104 (1 row) select healpix_nest(10, '(315d, 45d)'); healpix_nest -------------- 3935232 (1 row) select healpix_nest(10, '(315d, 56.25d)'); healpix_nest -------------- 3982095 (1 row) select healpix_ring(10, '(315d, 67.5d)'); healpix_ring -------------- 478975 (1 row) select healpix_ring(10, '(315d, 78.75d)'); healpix_ring -------------- 120417 (1 row) select healpix_ring(10, '(315d, 90d)'); healpix_ring -------------- 4096 (1 row) select healpix_nest(10, '(337.5d, -90d)'); healpix_nest -------------- 11534336 (1 row) select healpix_ring(10, '(337.5d, -78.75d)'); healpix_ring -------------- 12462310 (1 row) select healpix_nest(10, '(337.5d, -67.5d)'); healpix_nest -------------- 11615965 (1 row) select healpix_ring(10, '(337.5d, -56.25d)'); healpix_ring -------------- 11521305 (1 row) select healpix_nest(10, '(337.5d, -45d)'); healpix_nest -------------- 11860223 (1 row) select healpix_ring(10, '(337.5d, -33.75d)'); healpix_ring -------------- 9787136 (1 row) select healpix_nest(10, '(337.5d, -22.5d)'); healpix_nest -------------- 12055500 (1 row) select healpix_ring(10, '(337.5d, -11.25d)'); healpix_ring -------------- 7517952 (1 row) select healpix_nest(10, '(337.5d, 0.0001)'); healpix_nest -------------- 4915200 (1 row) select healpix_ring(10, '(337.5d, 11.25d)'); healpix_ring -------------- 5068544 (1 row) select healpix_ring(10, '(337.5d, 22.5d)'); healpix_ring -------------- 3888896 (1 row) select healpix_nest(10, '(337.5d, 33.75d)'); healpix_nest -------------- 3460300 (1 row) select healpix_nest(10, '(337.5d, 45d)'); healpix_nest -------------- 3607296 (1 row) select healpix_ring(10, '(337.5d, 56.25d)'); healpix_ring -------------- 1064157 (1 row) select healpix_ring(10, '(337.5d, 67.5d)'); healpix_ring -------------- 481057 (1 row) select healpix_ring(10, '(337.5d, 78.75d)'); healpix_ring -------------- 121462 (1 row) select healpix_ring(10, '(337.5d, 90d)'); healpix_ring -------------- 4096 (1 row) select healpix_nest(10, '(360d, -90d)'); healpix_nest -------------- 8388608 (1 row) select healpix_nest(10, '(360d, -78.75d)'); healpix_nest -------------- 8432162 (1 row) select healpix_ring(10, '(360d, -67.5d)'); healpix_ring -------------- 12101732 (1 row) select healpix_ring(10, '(360d, -56.25d)'); healpix_ring -------------- 11518572 (1 row) select healpix_ring(10, '(360d, -45d)'); healpix_ring -------------- 10737792 (1 row) select healpix_ring(10, '(360d, -33.75d)'); healpix_ring -------------- 9783296 (1 row) select healpix_nest(10, '(360d, -22.5d)'); healpix_nest -------------- 4256716 (1 row) select healpix_ring(10, '(360d, -11.25d)'); healpix_ring -------------- 7514112 (1 row) select healpix_nest(10, '(360d, 0.0001)'); healpix_nest -------------- 4980736 (1 row) select healpix_nest(10, '(360d, 11.25d)'); healpix_nest -------------- 5030707 (1 row) select healpix_nest(10, '(360d, 22.5d)'); healpix_nest -------------- 5180467 (1 row) select healpix_ring(10, '(360d, 33.75d)'); healpix_ring -------------- 2795520 (1 row) select healpix_nest(10, '(360d, 45d)'); healpix_nest -------------- 2101248 (1 row) select healpix_nest(10, '(360d, 56.25d)'); healpix_nest -------------- 2163733 (1 row) select healpix_ring(10, '(360d, 67.5d)'); healpix_ring -------------- 481359 (1 row) select healpix_ring(10, '(360d, 78.75d)'); healpix_ring -------------- 123655 (1 row) select healpix_nest(10, '(360d, 90d)'); healpix_nest -------------- 3145728 (1 row) select healpix_ring(15, '(0d, -90d)'); healpix_ring -------------- 12884901884 (1 row) select healpix_ring(15, '(0d, -84.375d)'); healpix_ring -------------- 12853862568 (1 row) select healpix_nest(15, '(0d, -78.75d)'); healpix_nest -------------- 8634534538 (1 row) select healpix_nest(15, '(0d, -73.125d)'); healpix_nest -------------- 8735162370 (1 row) select healpix_nest(15, '(0d, -67.5d)'); healpix_nest -------------- 8768325768 (1 row) select healpix_nest(15, '(0d, -61.875d)'); healpix_nest -------------- 9137293480 (1 row) select healpix_nest(15, '(0d, -56.25d)'); healpix_nest -------------- 9169403914 (1 row) select healpix_ring(15, '(0d, -50.625d)'); healpix_ring -------------- 11422416444 (1 row) select healpix_ring(15, '(0d, -45d)'); healpix_ring -------------- 10997772276 (1 row) select healpix_ring(15, '(0d, -39.375d)'); healpix_ring -------------- 10529341440 (1 row) select healpix_nest(15, '(0d, -33.75d)'); healpix_nest -------------- 4308389068 (1 row) select healpix_nest(15, '(0d, -28.125d)'); healpix_nest -------------- 4346138620 (1 row) select healpix_ring(15, '(0d, -22.5d)'); healpix_ring -------------- 8907718656 (1 row) select healpix_ring(15, '(0d, -16.875d)'); healpix_ring -------------- 8312651776 (1 row) select healpix_nest(15, '(0d, -11.25d)'); healpix_nest -------------- 4512231475 (1 row) select healpix_nest(15, '(0d, -5.625d)'); healpix_nest -------------- 4550607679 (1 row) select healpix_ring(15, '(0d, 0.0001)'); healpix_ring -------------- 6441730048 (1 row) select healpix_ring(15, '(0d, 5.625d)'); healpix_ring -------------- 5811011584 (1 row) select healpix_ring(15, '(0d, 11.25d)'); healpix_ring -------------- 5185536000 (1 row) select healpix_ring(15, '(0d, 16.875d)'); healpix_ring -------------- 4572119040 (1 row) select healpix_ring(15, '(0d, 22.5d)'); healpix_ring -------------- 3977052160 (1 row) select healpix_nest(15, '(0d, 28.125d)'); healpix_nest -------------- 5317537795 (1 row) select healpix_nest(15, '(0d, 33.75d)'); healpix_nest -------------- 5355287347 (1 row) select healpix_nest(15, '(0d, 39.375d)'); healpix_nest -------------- 5367725116 (1 row) select healpix_nest(15, '(0d, 45d)'); healpix_nest -------------- 2151677957 (1 row) select healpix_nest(15, '(0d, 50.625d)'); healpix_nest -------------- 2165576021 (1 row) select healpix_nest(15, '(0d, 56.25d)'); healpix_nest -------------- 2215662928 (1 row) select healpix_nest(15, '(0d, 61.875d)'); healpix_nest -------------- 2231718145 (1 row) select healpix_nest(15, '(0d, 67.5d)'); healpix_nest -------------- 2416202001 (1 row) select healpix_ring(15, '(0d, 73.125d)'); healpix_ring -------------- 277502975 (1 row) select healpix_ring(15, '(0d, 78.75d)'); healpix_ring -------------- 123894715 (1 row) select healpix_nest(15, '(0d, 84.375d)'); healpix_nest -------------- 2499821905 (1 row) select healpix_nest(15, '(0d, 90d)'); healpix_nest -------------- 3221225472 (1 row) select healpix_ring(15, '(11.25d, -90d)'); healpix_ring -------------- 12884901884 (1 row) select healpix_ring(15, '(11.25d, -84.375d)'); healpix_ring -------------- 12853863060 (1 row) select healpix_ring(15, '(11.25d, -78.75d)'); healpix_ring -------------- 12761107759 (1 row) select healpix_nest(15, '(11.25d, -73.125d)'); healpix_nest -------------- 8733683714 (1 row) select healpix_ring(15, '(11.25d, -67.5d)'); healpix_ring -------------- 12394463965 (1 row) select healpix_ring(15, '(11.25d, -61.875d)'); healpix_ring -------------- 12124209313 (1 row) select healpix_nest(15, '(11.25d, -56.25d)'); healpix_nest -------------- 9142508554 (1 row) select healpix_ring(15, '(11.25d, -50.625d)'); healpix_ring -------------- 11422419824 (1 row) select healpix_nest(15, '(11.25d, -45d)'); healpix_nest -------------- 9274982389 (1 row) select healpix_nest(15, '(11.25d, -39.375d)'); healpix_nest -------------- 9312338883 (1 row) select healpix_ring(15, '(11.25d, -33.75d)'); healpix_ring -------------- 10021572608 (1 row) select healpix_ring(15, '(11.25d, -28.125d)'); healpix_ring -------------- 9479458816 (1 row) select healpix_nest(15, '(11.25d, -22.5d)'); healpix_nest -------------- 4375654415 (1 row) select healpix_ring(15, '(11.25d, -16.875d)'); healpix_ring -------------- 8312655872 (1 row) select healpix_ring(15, '(11.25d, -11.25d)'); healpix_ring -------------- 7699238912 (1 row) select healpix_ring(15, '(11.25d, -5.625d)'); healpix_ring -------------- 7073763328 (1 row) select healpix_ring(15, '(11.25d, 0.0001)'); healpix_ring -------------- 6441734144 (1 row) select healpix_nest(15, '(11.25d, 5.625d)'); healpix_nest -------------- 4760747200 (1 row) select healpix_ring(15, '(11.25d, 11.25d)'); healpix_ring -------------- 5185540096 (1 row) select healpix_ring(15, '(11.25d, 16.875d)'); healpix_ring -------------- 4572123136 (1 row) select healpix_ring(15, '(11.25d, 22.5d)'); healpix_ring -------------- 3977056256 (1 row) select healpix_nest(15, '(11.25d, 28.125d)'); healpix_nest -------------- 5233651715 (1 row) select healpix_nest(15, '(11.25d, 33.75d)'); healpix_nest -------------- 674444083 (1 row) select healpix_nest(15, '(11.25d, 39.375d)'); healpix_nest -------------- 686881852 (1 row) select healpix_ring(15, '(11.25d, 45d)'); healpix_ring -------------- 1886887719 (1 row) select healpix_ring(15, '(11.25d, 50.625d)'); healpix_ring -------------- 1462380660 (1 row) select healpix_ring(15, '(11.25d, 56.25d)'); healpix_ring -------------- 1085736312 (1 row) select healpix_ring(15, '(11.25d, 61.875d)'); healpix_ring -------------- 760619441 (1 row) select healpix_ring(15, '(11.25d, 67.5d)'); healpix_ring -------------- 490379201 (1 row) select healpix_ring(15, '(11.25d, 73.125d)'); healpix_ring -------------- 277420484 (1 row) select healpix_nest(15, '(11.25d, 78.75d)'); healpix_nest -------------- 1051789776 (1 row) select healpix_nest(15, '(11.25d, 84.375d)'); healpix_nest -------------- 1068253771 (1 row) select healpix_ring(15, '(11.25d, 90d)'); healpix_ring -------------- 131075 (1 row) select healpix_nest(15, '(22.5d, -90d)'); healpix_nest -------------- 8589934592 (1 row) select healpix_nest(15, '(22.5d, -84.375d)'); healpix_nest -------------- 8599359938 (1 row) select healpix_ring(15, '(22.5d, -78.75d)'); healpix_ring -------------- 12761108742 (1 row) select healpix_nest(15, '(22.5d, -73.125d)'); healpix_nest -------------- 8729247744 (1 row) select healpix_nest(15, '(22.5d, -67.5d)'); healpix_nest -------------- 8740386884 (1 row) select healpix_ring(15, '(22.5d, -61.875d)'); healpix_ring -------------- 12124133739 (1 row) select healpix_nest(15, '(22.5d, -56.25d)'); healpix_nest -------------- 9147019272 (1 row) select healpix_ring(15, '(22.5d, -50.625d)'); healpix_ring -------------- 11422423204 (1 row) select healpix_nest(15, '(22.5d, -45d)'); healpix_nest -------------- 9191030775 (1 row) select healpix_nest(15, '(22.5d, -39.375d)'); healpix_nest -------------- 9329116099 (1 row) select healpix_nest(15, '(22.5d, -33.75d)'); healpix_nest -------------- 9341553868 (1 row) select healpix_nest(15, '(22.5d, -28.125d)'); healpix_nest -------------- 9379303420 (1 row) select healpix_ring(15, '(22.5d, -22.5d)'); healpix_ring -------------- 8907726848 (1 row) select healpix_ring(15, '(22.5d, -16.875d)'); healpix_ring -------------- 8312659968 (1 row) select healpix_ring(15, '(22.5d, -11.25d)'); healpix_ring -------------- 7699243008 (1 row) select healpix_ring(15, '(22.5d, -5.625d)'); healpix_ring -------------- 7073767424 (1 row) select healpix_ring(15, '(22.5d, 0.0001)'); healpix_ring -------------- 6441738240 (1 row) select healpix_ring(15, '(22.5d, 5.625d)'); healpix_ring -------------- 5811019776 (1 row) select healpix_ring(15, '(22.5d, 11.25d)'); healpix_ring -------------- 5185544192 (1 row) select healpix_ring(15, '(22.5d, 16.875d)'); healpix_ring -------------- 4572127232 (1 row) select healpix_ring(15, '(22.5d, 22.5d)'); healpix_ring -------------- 3977060352 (1 row) select healpix_nest(15, '(22.5d, 28.125d)'); healpix_nest -------------- 552808451 (1 row) select healpix_ring(15, '(22.5d, 33.75d)'); healpix_ring -------------- 2863210496 (1 row) select healpix_ring(15, '(22.5d, 39.375d)'); healpix_ring -------------- 2355437568 (1 row) select healpix_nest(15, '(22.5d, 45d)'); healpix_nest -------------- 740032516 (1 row) select healpix_nest(15, '(22.5d, 50.625d)'); healpix_nest -------------- 757256767 (1 row) select healpix_ring(15, '(22.5d, 56.25d)'); healpix_ring -------------- 1085646028 (1 row) select healpix_ring(15, '(22.5d, 61.875d)'); healpix_ring -------------- 760699887 (1 row) select healpix_ring(15, '(22.5d, 67.5d)'); healpix_ring -------------- 490381158 (1 row) select healpix_nest(15, '(22.5d, 73.125d)'); healpix_nest -------------- 997277695 (1 row) select healpix_ring(15, '(22.5d, 78.75d)'); healpix_ring -------------- 123765610 (1 row) select healpix_ring(15, '(22.5d, 84.375d)'); healpix_ring -------------- 31008796 (1 row) select healpix_ring(15, '(22.5d, 90d)'); healpix_ring -------------- 131075 (1 row) select healpix_nest(15, '(33.75d, -90d)'); healpix_nest -------------- 8589934592 (1 row) select healpix_nest(15, '(33.75d, -84.375d)'); healpix_nest -------------- 8599622322 (1 row) select healpix_ring(15, '(33.75d, -78.75d)'); healpix_ring -------------- 12761078254 (1 row) select healpix_ring(15, '(33.75d, -73.125d)'); healpix_ring -------------- 12607487292 (1 row) select healpix_nest(15, '(33.75d, -67.5d)'); healpix_nest -------------- 8744886152 (1 row) select healpix_ring(15, '(33.75d, -61.875d)'); healpix_ring -------------- 12124136177 (1 row) select healpix_nest(15, '(33.75d, -56.25d)'); healpix_nest -------------- 8833510409 (1 row) select healpix_nest(15, '(33.75d, -50.625d)'); healpix_nest -------------- 9195831664 (1 row) select healpix_nest(15, '(33.75d, -45d)'); healpix_nest -------------- 9208135670 (1 row) select healpix_nest(15, '(33.75d, -39.375d)'); healpix_nest -------------- 9245230019 (1 row) select healpix_nest(15, '(33.75d, -33.75d)'); healpix_nest -------------- 9257667788 (1 row) select healpix_ring(15, '(33.75d, -28.125d)'); healpix_ring -------------- 9479467008 (1 row) select healpix_ring(15, '(33.75d, -22.5d)'); healpix_ring -------------- 8907730944 (1 row) select healpix_nest(15, '(33.75d, -16.875d)'); healpix_nest -------------- 9582939139 (1 row) select healpix_nest(15, '(33.75d, -11.25d)'); healpix_nest -------------- 9595727923 (1 row) select healpix_ring(15, '(33.75d, -5.625d)'); healpix_ring -------------- 7073771520 (1 row) select healpix_nest(15, '(33.75d, 0.0001)'); healpix_nest -------------- 4680843276 (1 row) select healpix_nest(15, '(33.75d, 5.625d)'); healpix_nest -------------- 4693638336 (1 row) select healpix_ring(15, '(33.75d, 11.25d)'); healpix_ring -------------- 5185548288 (1 row) select healpix_nest(15, '(33.75d, 16.875d)'); healpix_nest -------------- 147846140 (1 row) select healpix_ring(15, '(33.75d, 22.5d)'); healpix_ring -------------- 3977064448 (1 row) select healpix_ring(15, '(33.75d, 28.125d)'); healpix_ring -------------- 3405328384 (1 row) select healpix_ring(15, '(33.75d, 33.75d)'); healpix_ring -------------- 2863214592 (1 row) select healpix_nest(15, '(33.75d, 39.375d)'); healpix_nest -------------- 619772988 (1 row) select healpix_ring(15, '(33.75d, 45d)'); healpix_ring -------------- 1886895398 (1 row) select healpix_ring(15, '(33.75d, 50.625d)'); healpix_ring -------------- 1462387420 (1 row) select healpix_nest(15, '(33.75d, 56.25d)'); healpix_nest -------------- 850895865 (1 row) select healpix_ring(15, '(33.75d, 61.875d)'); healpix_ring -------------- 760702325 (1 row) select healpix_ring(15, '(33.75d, 67.5d)'); healpix_ring -------------- 490383116 (1 row) select healpix_ring(15, '(33.75d, 73.125d)'); healpix_ring -------------- 277376320 (1 row) select healpix_nest(15, '(33.75d, 78.75d)'); healpix_nest -------------- 1047558854 (1 row) select healpix_ring(15, '(33.75d, 84.375d)'); healpix_ring -------------- 31009288 (1 row) select healpix_nest(15, '(33.75d, 90d)'); healpix_nest -------------- 3221225472 (1 row) select healpix_ring(15, '(45d, -90d)'); healpix_ring -------------- 12884901884 (1 row) select healpix_nest(15, '(45d, -84.375d)'); healpix_nest -------------- 8594116355 (1 row) select healpix_nest(15, '(45d, -78.75d)'); healpix_nest -------------- 8606659571 (1 row) select healpix_nest(15, '(45d, -73.125d)'); healpix_nest -------------- 8644395008 (1 row) select healpix_ring(15, '(45d, -67.5d)'); healpix_ring -------------- 12394469837 (1 row) select healpix_nest(15, '(45d, -61.875d)'); healpix_nest -------------- 8795194175 (1 row) select healpix_ring(15, '(45d, -56.25d)'); healpix_ring -------------- 11799180137 (1 row) select healpix_nest(15, '(45d, -50.625d)'); healpix_nest -------------- 8844800768 (1 row) select healpix_nest(15, '(45d, -45d)'); healpix_nest -------------- 8855224316 (1 row) select healpix_nest(15, '(45d, -39.375d)'); healpix_nest -------------- 9396224963 (1 row) select healpix_ring(15, '(45d, -33.75d)'); healpix_ring -------------- 10021584896 (1 row) select healpix_ring(15, '(45d, -28.125d)'); healpix_ring -------------- 9479471104 (1 row) select healpix_ring(15, '(45d, -22.5d)'); healpix_ring -------------- 8907735040 (1 row) select healpix_nest(15, '(45d, -16.875d)'); healpix_nest -------------- 9599716355 (1 row) select healpix_ring(15, '(45d, -11.25d)'); healpix_ring -------------- 7699251200 (1 row) select healpix_nest(15, '(45d, -5.625d)'); healpix_nest -------------- 9650881343 (1 row) select healpix_ring(15, '(45d, 0.0001)'); healpix_ring -------------- 6441746432 (1 row) select healpix_nest(15, '(45d, 5.625d)'); healpix_nest -------------- 12795072 (1 row) select healpix_ring(15, '(45d, 11.25d)'); healpix_ring -------------- 5185552384 (1 row) select healpix_nest(15, '(45d, 16.875d)'); healpix_nest -------------- 63960060 (1 row) select healpix_ring(15, '(45d, 22.5d)'); healpix_ring -------------- 3977068544 (1 row) select healpix_nest(15, '(45d, 28.125d)'); healpix_nest -------------- 217264131 (1 row) select healpix_ring(15, '(45d, 33.75d)'); healpix_ring -------------- 2863218688 (1 row) select healpix_nest(15, '(45d, 39.375d)'); healpix_nest -------------- 267451452 (1 row) select healpix_ring(15, '(45d, 45d)'); healpix_ring -------------- 1887022102 (1 row) select healpix_ring(15, '(45d, 50.625d)'); healpix_ring -------------- 1462390800 (1 row) select healpix_nest(15, '(45d, 56.25d)'); healpix_nest -------------- 856440828 (1 row) select healpix_ring(15, '(45d, 61.875d)'); healpix_ring -------------- 760704763 (1 row) select healpix_ring(15, '(45d, 67.5d)'); healpix_ring -------------- 490385073 (1 row) select healpix_nest(15, '(45d, 73.125d)'); healpix_nest -------------- 1019281407 (1 row) select healpix_ring(15, '(45d, 78.75d)'); healpix_ring -------------- 123767577 (1 row) select healpix_nest(15, '(45d, 84.375d)'); healpix_nest -------------- 1069560060 (1 row) select healpix_nest(15, '(45d, 90d)'); healpix_nest -------------- 3221225472 (1 row) select healpix_nest(15, '(56.25d, -90d)'); healpix_nest -------------- 8589934592 (1 row) select healpix_ring(15, '(56.25d, -84.375d)'); healpix_ring -------------- 12853880785 (1 row) select healpix_nest(15, '(56.25d, -78.75d)'); healpix_nest -------------- 8616117561 (1 row) select healpix_ring(15, '(56.25d, -73.125d)'); healpix_ring -------------- 12607490236 (1 row) select healpix_nest(15, '(56.25d, -67.5d)'); healpix_nest -------------- 8694574916 (1 row) select healpix_nest(15, '(56.25d, -61.875d)'); healpix_nest -------------- 8706704211 (1 row) select healpix_nest(15, '(56.25d, -56.25d)'); healpix_nest -------------- 8812780550 (1 row) select healpix_ring(15, '(56.25d, -50.625d)'); healpix_ring -------------- 11422433344 (1 row) select healpix_ring(15, '(56.25d, -45d)'); healpix_ring -------------- 10997914341 (1 row) select healpix_ring(15, '(56.25d, -39.375d)'); healpix_ring -------------- 10529361920 (1 row) select healpix_nest(15, '(56.25d, -33.75d)'); healpix_nest -------------- 9056341196 (1 row) select healpix_ring(15, '(56.25d, -28.125d)'); healpix_ring -------------- 9479475200 (1 row) select healpix_nest(15, '(56.25d, -22.5d)'); healpix_nest -------------- 9475928079 (1 row) select healpix_nest(15, '(56.25d, -16.875d)'); healpix_nest -------------- 9515830275 (1 row) select healpix_nest(15, '(56.25d, -11.25d)'); healpix_nest -------------- 9528619059 (1 row) select healpix_ring(15, '(56.25d, -5.625d)'); healpix_ring -------------- 7073779712 (1 row) select healpix_nest(15, '(56.25d, 0.0001)'); healpix_nest -------------- 6090129420 (1 row) select healpix_ring(15, '(56.25d, 5.625d)'); healpix_ring -------------- 5811032064 (1 row) select healpix_ring(15, '(56.25d, 11.25d)'); healpix_ring -------------- 5185556480 (1 row) select healpix_ring(15, '(56.25d, 16.875d)'); healpix_ring -------------- 4572139520 (1 row) select healpix_nest(15, '(56.25d, 22.5d)'); healpix_nest -------------- 120639472 (1 row) select healpix_ring(15, '(56.25d, 28.125d)'); healpix_ring -------------- 3405336576 (1 row) select healpix_nest(15, '(56.25d, 33.75d)'); healpix_nest -------------- 406008627 (1 row) select healpix_nest(15, '(56.25d, 39.375d)'); healpix_nest -------------- 418446396 (1 row) select healpix_nest(15, '(56.25d, 45d)'); healpix_nest -------------- 455540745 (1 row) select healpix_nest(15, '(56.25d, 50.625d)'); healpix_nest -------------- 467844751 (1 row) select healpix_nest(15, '(56.25d, 56.25d)'); healpix_nest -------------- 830166006 (1 row) select healpix_nest(15, '(56.25d, 61.875d)'); healpix_nest -------------- 906312796 (1 row) select healpix_ring(15, '(56.25d, 67.5d)'); healpix_ring -------------- 490387030 (1 row) select healpix_nest(15, '(56.25d, 73.125d)'); healpix_nest -------------- 1012813823 (1 row) select healpix_ring(15, '(56.25d, 78.75d)'); healpix_ring -------------- 123800029 (1 row) select healpix_nest(15, '(56.25d, 84.375d)'); healpix_nest -------------- 1064054093 (1 row) select healpix_nest(15, '(56.25d, 90d)'); healpix_nest -------------- 3221225472 (1 row) select healpix_ring(15, '(67.5d, -90d)'); healpix_ring -------------- 12884901884 (1 row) select healpix_ring(15, '(67.5d, -84.375d)'); healpix_ring -------------- 12853881277 (1 row) select healpix_ring(15, '(67.5d, -78.75d)'); healpix_ring -------------- 12761112676 (1 row) select healpix_ring(15, '(67.5d, -73.125d)'); healpix_ring -------------- 12607491708 (1 row) select healpix_ring(15, '(67.5d, -67.5d)'); healpix_ring -------------- 12394473752 (1 row) select healpix_ring(15, '(67.5d, -61.875d)'); healpix_ring -------------- 12124143491 (1 row) select healpix_ring(15, '(67.5d, -56.25d)'); healpix_ring -------------- 11799185962 (1 row) select healpix_nest(15, '(67.5d, -50.625d)'); healpix_nest -------------- 8906419648 (1 row) select healpix_ring(15, '(67.5d, -45d)'); healpix_ring -------------- 10997795313 (1 row) select healpix_nest(15, '(67.5d, -39.375d)'); healpix_nest -------------- 9060680643 (1 row) select healpix_ring(15, '(67.5d, -33.75d)'); healpix_ring -------------- 10021593088 (1 row) select healpix_nest(15, '(67.5d, -28.125d)'); healpix_nest -------------- 9110867964 (1 row) select healpix_ring(15, '(67.5d, -22.5d)'); healpix_ring -------------- 8907743232 (1 row) select healpix_ring(15, '(67.5d, -16.875d)'); healpix_ring -------------- 8312676352 (1 row) select healpix_ring(15, '(67.5d, -11.25d)'); healpix_ring -------------- 7699259392 (1 row) select healpix_ring(15, '(67.5d, -5.625d)'); healpix_ring -------------- 7073783808 (1 row) select healpix_ring(15, '(67.5d, 0.0001)'); healpix_ring -------------- 6441754624 (1 row) select healpix_nest(15, '(67.5d, 5.625d)'); healpix_nest -------------- 6119701696 (1 row) select healpix_nest(15, '(67.5d, 11.25d)'); healpix_nest -------------- 6158077900 (1 row) select healpix_nest(15, '(67.5d, 16.875d)'); healpix_nest -------------- 6170866684 (1 row) select healpix_nest(15, '(67.5d, 22.5d)'); healpix_nest -------------- 271634416 (1 row) select healpix_ring(15, '(67.5d, 28.125d)'); healpix_ring -------------- 3405340672 (1 row) select healpix_ring(15, '(67.5d, 33.75d)'); healpix_ring -------------- 2863226880 (1 row) select healpix_nest(15, '(67.5d, 39.375d)'); healpix_nest -------------- 334560316 (1 row) select healpix_ring(15, '(67.5d, 45d)'); healpix_ring -------------- 1887029781 (1 row) select healpix_nest(15, '(67.5d, 50.625d)'); healpix_nest -------------- 504488255 (1 row) select healpix_nest(15, '(67.5d, 56.25d)'); healpix_nest -------------- 516657143 (1 row) select healpix_nest(15, '(67.5d, 61.875d)'); healpix_nest -------------- 880342960 (1 row) select healpix_nest(15, '(67.5d, 67.5d)'); healpix_nest -------------- 923289531 (1 row) select healpix_nest(15, '(67.5d, 73.125d)'); healpix_nest -------------- 934428671 (1 row) select healpix_nest(15, '(67.5d, 78.75d)'); healpix_nest -------------- 1036040971 (1 row) select healpix_ring(15, '(67.5d, 84.375d)'); healpix_ring -------------- 31010765 (1 row) select healpix_nest(15, '(67.5d, 90d)'); healpix_nest -------------- 3221225472 (1 row) select healpix_nest(15, '(78.75d, -90d)'); healpix_nest -------------- 8589934592 (1 row) select healpix_nest(15, '(78.75d, -84.375d)'); healpix_nest -------------- 8595422644 (1 row) select healpix_nest(15, '(78.75d, -78.75d)'); healpix_nest -------------- 8611886639 (1 row) select healpix_ring(15, '(78.75d, -73.125d)'); healpix_ring -------------- 12607446069 (1 row) select healpix_ring(15, '(78.75d, -67.5d)'); healpix_ring -------------- 12394475709 (1 row) select healpix_ring(15, '(78.75d, -61.875d)'); healpix_ring -------------- 12124223940 (1 row) select healpix_ring(15, '(78.75d, -56.25d)'); healpix_ring -------------- 11799095675 (1 row) select healpix_ring(15, '(78.75d, -50.625d)'); healpix_ring -------------- 11422440104 (1 row) select healpix_ring(15, '(78.75d, -45d)'); healpix_ring -------------- 10997922020 (1 row) select healpix_nest(15, '(78.75d, -39.375d)'); healpix_nest -------------- 8976794563 (1 row) select healpix_nest(15, '(78.75d, -33.75d)'); healpix_nest -------------- 8989232332 (1 row) select healpix_ring(15, '(78.75d, -28.125d)'); healpix_ring -------------- 9479483392 (1 row) select healpix_nest(15, '(78.75d, -22.5d)'); healpix_nest -------------- 5516505103 (1 row) select healpix_nest(15, '(78.75d, -16.875d)'); healpix_nest -------------- 5556407299 (1 row) select healpix_ring(15, '(78.75d, -11.25d)'); healpix_ring -------------- 7699263488 (1 row) select healpix_ring(15, '(78.75d, -5.625d)'); healpix_ring -------------- 7073787904 (1 row) select healpix_nest(15, '(78.75d, 0.0001)'); healpix_nest -------------- 6023020556 (1 row) select healpix_nest(15, '(78.75d, 5.625d)'); healpix_nest -------------- 6035815616 (1 row) select healpix_nest(15, '(78.75d, 11.25d)'); healpix_nest -------------- 6309072844 (1 row) select healpix_nest(15, '(78.75d, 16.875d)'); healpix_nest -------------- 6321861628 (1 row) select healpix_ring(15, '(78.75d, 22.5d)'); healpix_ring -------------- 3977080832 (1 row) select healpix_ring(15, '(78.75d, 28.125d)'); healpix_ring -------------- 3405344768 (1 row) select healpix_ring(15, '(78.75d, 33.75d)'); healpix_ring -------------- 2863230976 (1 row) select healpix_ring(15, '(78.75d, 39.375d)'); healpix_ring -------------- 2355458048 (1 row) select healpix_nest(15, '(78.75d, 45d)'); healpix_nest -------------- 388694026 (1 row) select healpix_nest(15, '(78.75d, 50.625d)'); healpix_nest -------------- 487510607 (1 row) select healpix_ring(15, '(78.75d, 56.25d)'); healpix_ring -------------- 1085753787 (1 row) select healpix_nest(15, '(78.75d, 61.875d)'); healpix_nest -------------- 532035438 (1 row) select healpix_ring(15, '(78.75d, 67.5d)'); healpix_ring -------------- 490390945 (1 row) select healpix_ring(15, '(78.75d, 73.125d)'); healpix_ring -------------- 277429317 (1 row) select healpix_ring(15, '(78.75d, 78.75d)'); healpix_ring -------------- 123770527 (1 row) select healpix_ring(15, '(78.75d, 84.375d)'); healpix_ring -------------- 31027010 (1 row) select healpix_ring(15, '(78.75d, 90d)'); healpix_ring -------------- 131075 (1 row) select healpix_ring(15, '(90d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_ring(15, '(90d, -84.375d)'); healpix_ring -------------- 12853866507 (1 row) select healpix_nest(15, '(90d, -78.75d)'); healpix_nest -------------- 9708276362 (1 row) select healpix_nest(15, '(90d, -73.125d)'); healpix_nest -------------- 9808904194 (1 row) select healpix_ring(15, '(90d, -67.5d)'); healpix_ring -------------- 12394477667 (1 row) select healpix_nest(15, '(90d, -61.875d)'); healpix_nest -------------- 10211035304 (1 row) select healpix_nest(15, '(90d, -56.25d)'); healpix_nest -------------- 10243145738 (1 row) select healpix_ring(15, '(90d, -50.625d)'); healpix_ring -------------- 11422443485 (1 row) select healpix_nest(15, '(90d, -45d)'); healpix_nest -------------- 10371115680 (1 row) select healpix_nest(15, '(90d, -39.375d)'); healpix_nest -------------- 5369693123 (1 row) select healpix_ring(15, '(90d, -33.75d)'); healpix_ring -------------- 10021601280 (1 row) select healpix_nest(15, '(90d, -28.125d)'); healpix_nest -------------- 5419880444 (1 row) select healpix_ring(15, '(90d, -22.5d)'); healpix_ring -------------- 8907751424 (1 row) select healpix_nest(15, '(90d, -16.875d)'); healpix_nest -------------- 5573184515 (1 row) select healpix_ring(15, '(90d, -11.25d)'); healpix_ring -------------- 7699267584 (1 row) select healpix_ring(15, '(90d, -5.625d)'); healpix_ring -------------- 7073792000 (1 row) select healpix_nest(15, '(90d, 0.0001)'); healpix_nest -------------- 6174015500 (1 row) select healpix_ring(15, '(90d, 5.625d)'); healpix_ring -------------- 5811044352 (1 row) select healpix_nest(15, '(90d, 11.25d)'); healpix_nest -------------- 6225186764 (1 row) select healpix_nest(15, '(90d, 16.875d)'); healpix_nest -------------- 6237975548 (1 row) select healpix_nest(15, '(90d, 22.5d)'); healpix_nest -------------- 6378541040 (1 row) select healpix_nest(15, '(90d, 28.125d)'); healpix_nest -------------- 6391279619 (1 row) select healpix_nest(15, '(90d, 33.75d)'); healpix_nest -------------- 6429029171 (1 row) select healpix_nest(15, '(90d, 39.375d)'); healpix_nest -------------- 6441466940 (1 row) select healpix_nest(15, '(90d, 45d)'); healpix_nest -------------- 3225419781 (1 row) select healpix_nest(15, '(90d, 50.625d)'); healpix_nest -------------- 3239317845 (1 row) select healpix_nest(15, '(90d, 56.25d)'); healpix_nest -------------- 3289404752 (1 row) select healpix_ring(15, '(90d, 61.875d)'); healpix_ring -------------- 760636505 (1 row) select healpix_ring(15, '(90d, 67.5d)'); healpix_ring -------------- 490330269 (1 row) select healpix_nest(15, '(90d, 73.125d)'); healpix_nest -------------- 3506525524 (1 row) select healpix_nest(15, '(90d, 78.75d)'); healpix_nest -------------- 3556839440 (1 row) select healpix_ring(15, '(90d, 84.375d)'); healpix_ring -------------- 31011749 (1 row) select healpix_nest(15, '(90d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_ring(15, '(101.25d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_nest(15, '(101.25d, -84.375d)'); healpix_nest -------------- 9674391160 (1 row) select healpix_ring(15, '(101.25d, -78.75d)'); healpix_ring -------------- 12761115626 (1 row) select healpix_nest(15, '(101.25d, -73.125d)'); healpix_nest -------------- 9807425538 (1 row) select healpix_ring(15, '(101.25d, -67.5d)'); healpix_ring -------------- 12394479624 (1 row) select healpix_nest(15, '(101.25d, -61.875d)'); healpix_nest -------------- 10205382801 (1 row) select healpix_ring(15, '(101.25d, -56.25d)'); healpix_ring -------------- 11799101500 (1 row) select healpix_nest(15, '(101.25d, -50.625d)'); healpix_nest -------------- 10249907632 (1 row) select healpix_nest(15, '(101.25d, -45d)'); healpix_nest -------------- 10348724213 (1 row) select healpix_ring(15, '(101.25d, -39.375d)'); healpix_ring -------------- 10529378304 (1 row) select healpix_ring(15, '(101.25d, -33.75d)'); healpix_ring -------------- 10021605376 (1 row) select healpix_ring(15, '(101.25d, -28.125d)'); healpix_ring -------------- 9479491584 (1 row) select healpix_ring(15, '(101.25d, -22.5d)'); healpix_ring -------------- 8907755520 (1 row) select healpix_nest(15, '(101.25d, -16.875d)'); healpix_nest -------------- 5489298435 (1 row) select healpix_nest(15, '(101.25d, -11.25d)'); healpix_nest -------------- 5502087219 (1 row) select healpix_nest(15, '(101.25d, -5.625d)'); healpix_nest -------------- 5775344447 (1 row) select healpix_nest(15, '(101.25d, 0.0001)'); healpix_nest -------------- 5821693964 (1 row) select healpix_nest(15, '(101.25d, 5.625d)'); healpix_nest -------------- 5834489024 (1 row) select healpix_ring(15, '(101.25d, 11.25d)'); healpix_ring -------------- 5185572864 (1 row) select healpix_nest(15, '(101.25d, 16.875d)'); healpix_nest -------------- 6254752764 (1 row) select healpix_ring(15, '(101.25d, 22.5d)'); healpix_ring -------------- 3977089024 (1 row) select healpix_ring(15, '(101.25d, 28.125d)'); healpix_ring -------------- 3405352960 (1 row) select healpix_nest(15, '(101.25d, 33.75d)'); healpix_nest -------------- 1748185907 (1 row) select healpix_ring(15, '(101.25d, 39.375d)'); healpix_ring -------------- 2355466240 (1 row) select healpix_nest(15, '(101.25d, 45d)'); healpix_nest -------------- 1796669445 (1 row) select healpix_ring(15, '(101.25d, 50.625d)'); healpix_ring -------------- 1462407701 (1 row) select healpix_ring(15, '(101.25d, 56.25d)'); healpix_ring -------------- 1085759612 (1 row) select healpix_nest(15, '(101.25d, 61.875d)'); healpix_nest -------------- 1870216093 (1 row) select healpix_ring(15, '(101.25d, 67.5d)'); healpix_ring -------------- 490394860 (1 row) select healpix_nest(15, '(101.25d, 73.125d)'); healpix_nest -------------- 2073907198 (1 row) select healpix_nest(15, '(101.25d, 78.75d)'); healpix_nest -------------- 2125531600 (1 row) select healpix_ring(15, '(101.25d, 84.375d)'); healpix_ring -------------- 31027995 (1 row) select healpix_nest(15, '(101.25d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_ring(15, '(112.5d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_ring(15, '(112.5d, -84.375d)'); healpix_ring -------------- 12853883246 (1 row) select healpix_ring(15, '(112.5d, -78.75d)'); healpix_ring -------------- 12761116609 (1 row) select healpix_ring(15, '(112.5d, -73.125d)'); healpix_ring -------------- 12607497597 (1 row) select healpix_ring(15, '(112.5d, -67.5d)'); healpix_ring -------------- 12394481581 (1 row) select healpix_nest(15, '(112.5d, -61.875d)'); healpix_nest -------------- 9857075279 (1 row) select healpix_nest(15, '(112.5d, -56.25d)'); healpix_nest -------------- 10220761096 (1 row) select healpix_nest(15, '(112.5d, -50.625d)'); healpix_nest -------------- 10232929984 (1 row) select healpix_nest(15, '(112.5d, -45d)'); healpix_nest -------------- 10264772599 (1 row) select healpix_ring(15, '(112.5d, -39.375d)'); healpix_ring -------------- 10529382400 (1 row) select healpix_ring(15, '(112.5d, -33.75d)'); healpix_ring -------------- 10021609472 (1 row) select healpix_ring(15, '(112.5d, -28.125d)'); healpix_ring -------------- 9479495680 (1 row) select healpix_nest(15, '(112.5d, -22.5d)'); healpix_nest -------------- 10465783823 (1 row) select healpix_nest(15, '(112.5d, -16.875d)'); healpix_nest -------------- 5640293379 (1 row) select healpix_nest(15, '(112.5d, -11.25d)'); healpix_nest -------------- 5653082163 (1 row) select healpix_nest(15, '(112.5d, -5.625d)'); healpix_nest -------------- 5691458367 (1 row) select healpix_ring(15, '(112.5d, 0.0001)'); healpix_ring -------------- 6441771008 (1 row) select healpix_nest(15, '(112.5d, 5.625d)'); healpix_nest -------------- 5851266240 (1 row) select healpix_nest(15, '(112.5d, 11.25d)'); healpix_nest -------------- 5889642444 (1 row) select healpix_ring(15, '(112.5d, 16.875d)'); healpix_ring -------------- 4572160000 (1 row) select healpix_ring(15, '(112.5d, 22.5d)'); healpix_ring -------------- 3977093120 (1 row) select healpix_nest(15, '(112.5d, 28.125d)'); healpix_nest -------------- 1626550275 (1 row) select healpix_ring(15, '(112.5d, 33.75d)'); healpix_ring -------------- 2863243264 (1 row) select healpix_nest(15, '(112.5d, 39.375d)'); healpix_nest -------------- 1676737596 (1 row) select healpix_ring(15, '(112.5d, 45d)'); healpix_ring -------------- 1887045140 (1 row) select healpix_nest(15, '(112.5d, 50.625d)'); healpix_nest -------------- 1830998591 (1 row) select healpix_ring(15, '(112.5d, 56.25d)'); healpix_ring -------------- 1085669327 (1 row) select healpix_nest(15, '(112.5d, 61.875d)'); healpix_nest -------------- 2025126768 (1 row) select healpix_nest(15, '(112.5d, 67.5d)'); healpix_nest -------------- 2063895415 (1 row) select healpix_nest(15, '(112.5d, 73.125d)'); healpix_nest -------------- 2071019519 (1 row) select healpix_ring(15, '(112.5d, 78.75d)'); healpix_ring -------------- 123773477 (1 row) select healpix_ring(15, '(112.5d, 84.375d)'); healpix_ring -------------- 31012734 (1 row) select healpix_ring(15, '(112.5d, 90d)'); healpix_ring -------------- 131074 (1 row) select healpix_ring(15, '(123.75d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_nest(15, '(123.75d, -84.375d)'); healpix_nest -------------- 9673364146 (1 row) select healpix_nest(15, '(123.75d, -78.75d)'); healpix_nest -------------- 9702427190 (1 row) select healpix_nest(15, '(123.75d, -73.125d)'); healpix_nest -------------- 9724604416 (1 row) select healpix_ring(15, '(123.75d, -67.5d)'); healpix_ring -------------- 12394483539 (1 row) select healpix_nest(15, '(123.75d, -61.875d)'); healpix_nest -------------- 9831105443 (1 row) select healpix_ring(15, '(123.75d, -56.25d)'); healpix_ring -------------- 11799107325 (1 row) select healpix_nest(15, '(123.75d, -50.625d)'); healpix_nest -------------- 10269573488 (1 row) select healpix_nest(15, '(123.75d, -45d)'); healpix_nest -------------- 10281877494 (1 row) select healpix_ring(15, '(123.75d, -39.375d)'); healpix_ring -------------- 10529386496 (1 row) select healpix_nest(15, '(123.75d, -33.75d)'); healpix_nest -------------- 10331409612 (1 row) select healpix_nest(15, '(123.75d, -28.125d)'); healpix_nest -------------- 10604040188 (1 row) select healpix_nest(15, '(123.75d, -22.5d)'); healpix_nest -------------- 10616778767 (1 row) select healpix_nest(15, '(123.75d, -16.875d)'); healpix_nest -------------- 10656680963 (1 row) select healpix_ring(15, '(123.75d, -11.25d)'); healpix_ring -------------- 7699279872 (1 row) select healpix_ring(15, '(123.75d, -5.625d)'); healpix_ring -------------- 7073804288 (1 row) select healpix_ring(15, '(123.75d, 0.0001)'); healpix_ring -------------- 6441775104 (1 row) select healpix_nest(15, '(123.75d, 5.625d)'); healpix_nest -------------- 5767380160 (1 row) select healpix_ring(15, '(123.75d, 11.25d)'); healpix_ring -------------- 5185581056 (1 row) select healpix_nest(15, '(123.75d, 16.875d)'); healpix_nest -------------- 1221587964 (1 row) select healpix_ring(15, '(123.75d, 22.5d)'); healpix_ring -------------- 3977097216 (1 row) select healpix_ring(15, '(123.75d, 28.125d)'); healpix_ring -------------- 3405361152 (1 row) select healpix_nest(15, '(123.75d, 33.75d)'); healpix_nest -------------- 1681077043 (1 row) select healpix_ring(15, '(123.75d, 39.375d)'); healpix_ring -------------- 2355474432 (1 row) select healpix_nest(15, '(123.75d, 45d)'); healpix_nest -------------- 1729822726 (1 row) select healpix_nest(15, '(123.75d, 50.625d)'); healpix_nest -------------- 1741782351 (1 row) select healpix_nest(15, '(123.75d, 56.25d)'); healpix_nest -------------- 1924637689 (1 row) select healpix_ring(15, '(123.75d, 61.875d)'); healpix_ring -------------- 760721828 (1 row) select healpix_ring(15, '(123.75d, 67.5d)'); healpix_ring -------------- 490398775 (1 row) select healpix_ring(15, '(123.75d, 73.125d)'); healpix_ring -------------- 277388097 (1 row) select healpix_nest(15, '(123.75d, 78.75d)'); healpix_nest -------------- 2121300678 (1 row) select healpix_nest(15, '(123.75d, 84.375d)'); healpix_nest -------------- 2140937870 (1 row) select healpix_nest(15, '(123.75d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_ring(15, '(135d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_nest(15, '(135d, -84.375d)'); healpix_nest -------------- 9667858179 (1 row) select healpix_nest(15, '(135d, -78.75d)'); healpix_nest -------------- 9680401395 (1 row) select healpix_nest(15, '(135d, -73.125d)'); healpix_nest -------------- 9718136832 (1 row) select healpix_nest(15, '(135d, -67.5d)'); healpix_nest -------------- 9730573107 (1 row) select healpix_ring(15, '(135d, -61.875d)'); healpix_ring -------------- 12124158118 (1 row) select healpix_nest(15, '(135d, -56.25d)'); healpix_nest -------------- 9880977411 (1 row) select healpix_ring(15, '(135d, -50.625d)'); healpix_ring -------------- 11422457005 (1 row) select healpix_nest(15, '(135d, -45d)'); healpix_nest -------------- 9928966140 (1 row) select healpix_ring(15, '(135d, -39.375d)'); healpix_ring -------------- 10529390592 (1 row) select healpix_nest(15, '(135d, -33.75d)'); healpix_nest -------------- 10482404556 (1 row) select healpix_ring(15, '(135d, -28.125d)'); healpix_ring -------------- 9479503872 (1 row) select healpix_ring(15, '(135d, -22.5d)'); healpix_ring -------------- 8907767808 (1 row) select healpix_ring(15, '(135d, -16.875d)'); healpix_ring -------------- 8312700928 (1 row) select healpix_nest(15, '(135d, -11.25d)'); healpix_nest -------------- 10686246963 (1 row) select healpix_ring(15, '(135d, -5.625d)'); healpix_ring -------------- 7073808384 (1 row) select healpix_ring(15, '(135d, 0.0001)'); healpix_ring -------------- 6441779200 (1 row) select healpix_ring(15, '(135d, 5.625d)'); healpix_ring -------------- 5811060736 (1 row) select healpix_ring(15, '(135d, 11.25d)'); healpix_ring -------------- 5185585152 (1 row) select healpix_nest(15, '(135d, 16.875d)'); healpix_nest -------------- 1137701884 (1 row) select healpix_nest(15, '(135d, 22.5d)'); healpix_nest -------------- 1278267376 (1 row) select healpix_nest(15, '(135d, 28.125d)'); healpix_nest -------------- 1291005955 (1 row) select healpix_ring(15, '(135d, 33.75d)'); healpix_ring -------------- 2863251456 (1 row) select healpix_nest(15, '(135d, 39.375d)'); healpix_nest -------------- 1341193276 (1 row) select healpix_nest(15, '(135d, 45d)'); healpix_nest -------------- 1882193923 (1 row) select healpix_ring(15, '(135d, 50.625d)'); healpix_ring -------------- 1462417841 (1 row) select healpix_nest(15, '(135d, 56.25d)'); healpix_nest -------------- 1930182652 (1 row) select healpix_ring(15, '(135d, 61.875d)'); healpix_ring -------------- 760724266 (1 row) select healpix_ring(15, '(135d, 67.5d)'); healpix_ring -------------- 490400732 (1 row) select healpix_nest(15, '(135d, 73.125d)'); healpix_nest -------------- 2093023231 (1 row) select healpix_ring(15, '(135d, 78.75d)'); healpix_ring -------------- 123775444 (1 row) select healpix_nest(15, '(135d, 84.375d)'); healpix_nest -------------- 2143301884 (1 row) select healpix_nest(15, '(135d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_ring(15, '(146.25d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_ring(15, '(146.25d, -84.375d)'); healpix_ring -------------- 12853884723 (1 row) select healpix_nest(15, '(146.25d, -78.75d)'); healpix_nest -------------- 9689859385 (1 row) select healpix_ring(15, '(146.25d, -73.125d)'); healpix_ring -------------- 12607502013 (1 row) select healpix_nest(15, '(146.25d, -67.5d)'); healpix_nest -------------- 9768316740 (1 row) select healpix_ring(15, '(146.25d, -61.875d)'); healpix_ring -------------- 12124160556 (1 row) select healpix_ring(15, '(146.25d, -56.25d)'); healpix_ring -------------- 11799113150 (1 row) select healpix_ring(15, '(146.25d, -50.625d)'); healpix_ring -------------- 11422460385 (1 row) select healpix_ring(15, '(146.25d, -45d)'); healpix_ring -------------- 10997945057 (1 row) select healpix_ring(15, '(146.25d, -39.375d)'); healpix_ring -------------- 10529394688 (1 row) select healpix_nest(15, '(146.25d, -33.75d)'); healpix_nest -------------- 10130083020 (1 row) select healpix_nest(15, '(146.25d, -28.125d)'); healpix_nest -------------- 10536931324 (1 row) select healpix_ring(15, '(146.25d, -22.5d)'); healpix_ring -------------- 8907771904 (1 row) select healpix_ring(15, '(146.25d, -16.875d)'); healpix_ring -------------- 8312705024 (1 row) select healpix_nest(15, '(146.25d, -11.25d)'); healpix_nest -------------- 10602360883 (1 row) select healpix_ring(15, '(146.25d, -5.625d)'); healpix_ring -------------- 7073812480 (1 row) select healpix_ring(15, '(146.25d, 0.0001)'); healpix_ring -------------- 6441783296 (1 row) select healpix_ring(15, '(146.25d, 5.625d)'); healpix_ring -------------- 5811064832 (1 row) select healpix_ring(15, '(146.25d, 11.25d)'); healpix_ring -------------- 5185589248 (1 row) select healpix_nest(15, '(146.25d, 16.875d)'); healpix_nest -------------- 1154479100 (1 row) select healpix_ring(15, '(146.25d, 22.5d)'); healpix_ring -------------- 3977105408 (1 row) select healpix_ring(15, '(146.25d, 28.125d)'); healpix_ring -------------- 3405369344 (1 row) select healpix_ring(15, '(146.25d, 33.75d)'); healpix_ring -------------- 2863255552 (1 row) select healpix_ring(15, '(146.25d, 39.375d)'); healpix_ring -------------- 2355482624 (1 row) select healpix_ring(15, '(146.25d, 45d)'); healpix_ring -------------- 1886933793 (1 row) select healpix_nest(15, '(146.25d, 50.625d)'); healpix_nest -------------- 1541586575 (1 row) select healpix_nest(15, '(146.25d, 56.25d)'); healpix_nest -------------- 1903907830 (1 row) select healpix_nest(15, '(146.25d, 61.875d)'); healpix_nest -------------- 1980054620 (1 row) select healpix_nest(15, '(146.25d, 67.5d)'); healpix_nest -------------- 1992532087 (1 row) select healpix_ring(15, '(146.25d, 73.125d)'); healpix_ring -------------- 277391041 (1 row) select healpix_nest(15, '(146.25d, 78.75d)'); healpix_nest -------------- 2108732873 (1 row) select healpix_ring(15, '(146.25d, 84.375d)'); healpix_ring -------------- 31014211 (1 row) select healpix_nest(15, '(146.25d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_ring(15, '(157.5d, -90d)'); healpix_ring -------------- 12884901885 (1 row) select healpix_nest(15, '(157.5d, -84.375d)'); healpix_nest -------------- 9668911809 (1 row) select healpix_nest(15, '(157.5d, -78.75d)'); healpix_nest -------------- 9684617464 (1 row) select healpix_ring(15, '(157.5d, -73.125d)'); healpix_ring -------------- 12607503485 (1 row) select healpix_ring(15, '(157.5d, -67.5d)'); healpix_ring -------------- 12394489411 (1 row) select healpix_nest(15, '(157.5d, -61.875d)'); healpix_nest -------------- 9786033295 (1 row) select healpix_nest(15, '(157.5d, -56.25d)'); healpix_nest -------------- 9969381380 (1 row) select healpix_ring(15, '(157.5d, -50.625d)'); healpix_ring -------------- 11422463765 (1 row) select healpix_ring(15, '(157.5d, -45d)'); healpix_ring -------------- 10997826030 (1 row) select healpix_nest(15, '(157.5d, -39.375d)'); healpix_nest -------------- 10134422467 (1 row) select healpix_nest(15, '(157.5d, -33.75d)'); healpix_nest -------------- 10146860236 (1 row) select healpix_nest(15, '(157.5d, -28.125d)'); healpix_nest -------------- 10184609788 (1 row) select healpix_ring(15, '(157.5d, -22.5d)'); healpix_ring -------------- 8907776000 (1 row) select healpix_nest(15, '(157.5d, -16.875d)'); healpix_nest -------------- 6982470659 (1 row) select healpix_nest(15, '(157.5d, -11.25d)'); healpix_nest -------------- 6995259443 (1 row) select healpix_nest(15, '(157.5d, -5.625d)'); healpix_nest -------------- 7033635647 (1 row) select healpix_ring(15, '(157.5d, 0.0001)'); healpix_ring -------------- 6441787392 (1 row) select healpix_nest(15, '(157.5d, 5.625d)'); healpix_nest -------------- 7193443520 (1 row) select healpix_nest(15, '(157.5d, 11.25d)'); healpix_nest -------------- 7231819724 (1 row) select healpix_ring(15, '(157.5d, 16.875d)'); healpix_ring -------------- 4572176384 (1 row) select healpix_nest(15, '(157.5d, 22.5d)'); healpix_nest -------------- 1345376240 (1 row) select healpix_ring(15, '(157.5d, 28.125d)'); healpix_ring -------------- 3405373440 (1 row) select healpix_nest(15, '(157.5d, 33.75d)'); healpix_nest -------------- 1395864371 (1 row) select healpix_ring(15, '(157.5d, 39.375d)'); healpix_ring -------------- 2355486720 (1 row) select healpix_nest(15, '(157.5d, 45d)'); healpix_nest -------------- 1546387464 (1 row) select healpix_nest(15, '(157.5d, 50.625d)'); healpix_nest -------------- 1578230079 (1 row) select healpix_ring(15, '(157.5d, 56.25d)'); healpix_ring -------------- 1085680977 (1 row) select healpix_ring(15, '(157.5d, 61.875d)'); healpix_ring -------------- 760729142 (1 row) select healpix_ring(15, '(157.5d, 67.5d)'); healpix_ring -------------- 490404647 (1 row) select healpix_nest(15, '(157.5d, 73.125d)'); healpix_nest -------------- 2008170495 (1 row) select healpix_ring(15, '(157.5d, 78.75d)'); healpix_ring -------------- 123777411 (1 row) select healpix_nest(15, '(157.5d, 84.375d)'); healpix_nest -------------- 2138058301 (1 row) select healpix_nest(15, '(157.5d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_nest(15, '(168.75d, -90d)'); healpix_nest -------------- 9663676416 (1 row) select healpix_ring(15, '(168.75d, -84.375d)'); healpix_ring -------------- 12853869953 (1 row) select healpix_nest(15, '(168.75d, -78.75d)'); healpix_nest -------------- 9685628463 (1 row) select healpix_ring(15, '(168.75d, -73.125d)'); healpix_ring -------------- 12607457847 (1 row) select healpix_nest(15, '(168.75d, -67.5d)'); healpix_nest -------------- 9751480371 (1 row) select healpix_ring(15, '(168.75d, -61.875d)'); healpix_ring -------------- 12124243442 (1 row) select healpix_nest(15, '(168.75d, -56.25d)'); healpix_nest -------------- 9946754053 (1 row) select healpix_nest(15, '(168.75d, -50.625d)'); healpix_nest -------------- 9964756592 (1 row) select healpix_nest(15, '(168.75d, -45d)'); healpix_nest -------------- 10014490618 (1 row) select healpix_nest(15, '(168.75d, -39.375d)'); healpix_nest -------------- 10050536387 (1 row) select healpix_ring(15, '(168.75d, -33.75d)'); healpix_ring -------------- 10021629952 (1 row) select healpix_ring(15, '(168.75d, -28.125d)'); healpix_ring -------------- 9479516160 (1 row) select healpix_ring(15, '(168.75d, -22.5d)'); healpix_ring -------------- 8907780096 (1 row) select healpix_ring(15, '(168.75d, -16.875d)'); healpix_ring -------------- 8312713216 (1 row) select healpix_ring(15, '(168.75d, -11.25d)'); healpix_ring -------------- 7699296256 (1 row) select healpix_nest(15, '(168.75d, -5.625d)'); healpix_nest -------------- 7050412863 (1 row) select healpix_nest(15, '(168.75d, 0.0001)'); healpix_nest -------------- 7096762380 (1 row) select healpix_ring(15, '(168.75d, 5.625d)'); healpix_ring -------------- 5811073024 (1 row) select healpix_ring(15, '(168.75d, 11.25d)'); healpix_ring -------------- 5185597440 (1 row) select healpix_ring(15, '(168.75d, 16.875d)'); healpix_ring -------------- 4572180480 (1 row) select healpix_ring(15, '(168.75d, 22.5d)'); healpix_ring -------------- 3977113600 (1 row) select healpix_nest(15, '(168.75d, 28.125d)'); healpix_nest -------------- 7448244227 (1 row) select healpix_ring(15, '(168.75d, 33.75d)'); healpix_ring -------------- 2863263744 (1 row) select healpix_ring(15, '(168.75d, 39.375d)'); healpix_ring -------------- 2355490816 (1 row) select healpix_nest(15, '(168.75d, 45d)'); healpix_nest -------------- 1462435850 (1 row) select healpix_ring(15, '(168.75d, 50.625d)'); healpix_ring -------------- 1462427981 (1 row) select healpix_ring(15, '(168.75d, 56.25d)'); healpix_ring -------------- 1085777087 (1 row) select healpix_ring(15, '(168.75d, 61.875d)'); healpix_ring -------------- 760653570 (1 row) select healpix_nest(15, '(168.75d, 67.5d)'); healpix_nest -------------- 1976056780 (1 row) select healpix_ring(15, '(168.75d, 73.125d)'); healpix_ring -------------- 277441095 (1 row) select healpix_nest(15, '(168.75d, 78.75d)'); healpix_nest -------------- 2104624864 (1 row) select healpix_ring(15, '(168.75d, 84.375d)'); healpix_ring -------------- 31030949 (1 row) select healpix_nest(15, '(168.75d, 90d)'); healpix_nest -------------- 4294967296 (1 row) select healpix_nest(15, '(180d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_ring(15, '(180d, -84.375d)'); healpix_ring -------------- 12853870446 (1 row) select healpix_nest(15, '(180d, -78.75d)'); healpix_nest -------------- 10782018186 (1 row) select healpix_ring(15, '(180d, -73.125d)'); healpix_ring -------------- 12607459320 (1 row) select healpix_nest(15, '(180d, -67.5d)'); healpix_nest -------------- 10915809416 (1 row) select healpix_ring(15, '(180d, -61.875d)'); healpix_ring -------------- 12124167870 (1 row) select healpix_ring(15, '(180d, -56.25d)'); healpix_ring -------------- 11799121888 (1 row) select healpix_ring(15, '(180d, -50.625d)'); healpix_ring -------------- 11422470526 (1 row) select healpix_ring(15, '(180d, -45d)'); healpix_ring -------------- 10997833710 (1 row) select healpix_nest(15, '(180d, -39.375d)'); healpix_nest -------------- 6443434947 (1 row) select healpix_nest(15, '(180d, -33.75d)'); healpix_nest -------------- 6455872716 (1 row) select healpix_ring(15, '(180d, -28.125d)'); healpix_ring -------------- 9479520256 (1 row) select healpix_nest(15, '(180d, -22.5d)'); healpix_nest -------------- 6506360847 (1 row) select healpix_nest(15, '(180d, -16.875d)'); healpix_nest -------------- 6646926339 (1 row) select healpix_nest(15, '(180d, -11.25d)'); healpix_nest -------------- 6659715123 (1 row) select healpix_nest(15, '(180d, -5.625d)'); healpix_nest -------------- 6698091327 (1 row) select healpix_nest(15, '(180d, 0.0001)'); healpix_nest -------------- 7247757324 (1 row) select healpix_ring(15, '(180d, 5.625d)'); healpix_ring -------------- 5811077120 (1 row) select healpix_ring(15, '(180d, 11.25d)'); healpix_ring -------------- 5185601536 (1 row) select healpix_nest(15, '(180d, 16.875d)'); healpix_nest -------------- 7311717372 (1 row) select healpix_nest(15, '(180d, 22.5d)'); healpix_nest -------------- 7452282864 (1 row) select healpix_ring(15, '(180d, 28.125d)'); healpix_ring -------------- 3405381632 (1 row) select healpix_ring(15, '(180d, 33.75d)'); healpix_ring -------------- 2863267840 (1 row) select healpix_nest(15, '(180d, 39.375d)'); healpix_nest -------------- 7515208764 (1 row) select healpix_ring(15, '(180d, 45d)'); healpix_ring -------------- 1886945311 (1 row) select healpix_ring(15, '(180d, 50.625d)'); healpix_ring -------------- 1462323199 (1 row) select healpix_ring(15, '(180d, 56.25d)'); healpix_ring -------------- 1085686801 (1 row) select healpix_nest(15, '(180d, 61.875d)'); healpix_nest -------------- 4379201793 (1 row) select healpix_nest(15, '(180d, 67.5d)'); healpix_nest -------------- 4563685649 (1 row) select healpix_nest(15, '(180d, 73.125d)'); healpix_nest -------------- 4580267348 (1 row) select healpix_ring(15, '(180d, 78.75d)'); healpix_ring -------------- 123779377 (1 row) select healpix_nest(15, '(180d, 84.375d)'); healpix_nest -------------- 4647305553 (1 row) select healpix_nest(15, '(180d, 90d)'); healpix_nest -------------- 5368709120 (1 row) select healpix_nest(15, '(191.25d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_ring(15, '(191.25d, -84.375d)'); healpix_ring -------------- 12853870938 (1 row) select healpix_ring(15, '(191.25d, -78.75d)'); healpix_ring -------------- 12761123493 (1 row) select healpix_ring(15, '(191.25d, -73.125d)'); healpix_ring -------------- 12607460792 (1 row) select healpix_ring(15, '(191.25d, -67.5d)'); healpix_ring -------------- 12394495283 (1 row) select healpix_nest(15, '(191.25d, -61.875d)'); healpix_nest -------------- 11279124625 (1 row) select healpix_nest(15, '(191.25d, -56.25d)'); healpix_nest -------------- 11289992202 (1 row) select healpix_nest(15, '(191.25d, -50.625d)'); healpix_nest -------------- 11323649456 (1 row) select healpix_ring(15, '(191.25d, -45d)'); healpix_ring -------------- 10997960415 (1 row) select healpix_ring(15, '(191.25d, -39.375d)'); healpix_ring -------------- 10529411072 (1 row) select healpix_ring(15, '(191.25d, -33.75d)'); healpix_ring -------------- 10021638144 (1 row) select healpix_nest(15, '(191.25d, -28.125d)'); healpix_nest -------------- 6510399484 (1 row) select healpix_ring(15, '(191.25d, -22.5d)'); healpix_ring -------------- 8907788288 (1 row) select healpix_nest(15, '(191.25d, -16.875d)'); healpix_nest -------------- 6563040259 (1 row) select healpix_nest(15, '(191.25d, -11.25d)'); healpix_nest -------------- 6575829043 (1 row) select healpix_ring(15, '(191.25d, -5.625d)'); healpix_ring -------------- 7073828864 (1 row) select healpix_ring(15, '(191.25d, 0.0001)'); healpix_ring -------------- 6441799680 (1 row) select healpix_nest(15, '(191.25d, 5.625d)'); healpix_nest -------------- 6908230848 (1 row) select healpix_ring(15, '(191.25d, 11.25d)'); healpix_ring -------------- 5185605632 (1 row) select healpix_ring(15, '(191.25d, 16.875d)'); healpix_ring -------------- 4572188672 (1 row) select healpix_nest(15, '(191.25d, 22.5d)'); healpix_nest -------------- 7368396784 (1 row) select healpix_nest(15, '(191.25d, 28.125d)'); healpix_nest -------------- 7381135363 (1 row) select healpix_ring(15, '(191.25d, 33.75d)'); healpix_ring -------------- 2863271936 (1 row) select healpix_nest(15, '(191.25d, 39.375d)'); healpix_nest -------------- 2834365500 (1 row) select healpix_nest(15, '(191.25d, 45d)'); healpix_nest -------------- 2870411269 (1 row) select healpix_nest(15, '(191.25d, 50.625d)'); healpix_nest -------------- 2920145295 (1 row) select healpix_ring(15, '(191.25d, 56.25d)'); healpix_ring -------------- 1085782912 (1 row) select healpix_ring(15, '(191.25d, 61.875d)'); healpix_ring -------------- 760658445 (1 row) select healpix_ring(15, '(191.25d, 67.5d)'); healpix_ring -------------- 490410519 (1 row) select healpix_nest(15, '(191.25d, 73.125d)'); healpix_nest -------------- 3147649022 (1 row) select healpix_ring(15, '(191.25d, 78.75d)'); healpix_ring -------------- 123780361 (1 row) select healpix_nest(15, '(191.25d, 84.375d)'); healpix_nest -------------- 3215737419 (1 row) select healpix_ring(15, '(191.25d, 90d)'); healpix_ring -------------- 131073 (1 row) select healpix_ring(15, '(202.5d, -90d)'); healpix_ring -------------- 12884901886 (1 row) select healpix_nest(15, '(202.5d, -84.375d)'); healpix_nest -------------- 10746843586 (1 row) select healpix_ring(15, '(202.5d, -78.75d)'); healpix_ring -------------- 12761124476 (1 row) select healpix_nest(15, '(202.5d, -73.125d)'); healpix_nest -------------- 10876731392 (1 row) select healpix_ring(15, '(202.5d, -67.5d)'); healpix_ring -------------- 12394497240 (1 row) select healpix_nest(15, '(202.5d, -61.875d)'); healpix_nest -------------- 10930817103 (1 row) select healpix_nest(15, '(202.5d, -56.25d)'); healpix_nest -------------- 11294502920 (1 row) select healpix_ring(15, '(202.5d, -50.625d)'); healpix_ring -------------- 11422477286 (1 row) select healpix_ring(15, '(202.5d, -45d)'); healpix_ring -------------- 10997841389 (1 row) select healpix_ring(15, '(202.5d, -39.375d)'); healpix_ring -------------- 10529415168 (1 row) select healpix_nest(15, '(202.5d, -33.75d)'); healpix_nest -------------- 11489037516 (1 row) select healpix_ring(15, '(202.5d, -28.125d)'); healpix_ring -------------- 9479528448 (1 row) select healpix_nest(15, '(202.5d, -22.5d)'); healpix_nest -------------- 11539525647 (1 row) select healpix_nest(15, '(202.5d, -16.875d)'); healpix_nest -------------- 6714035203 (1 row) select healpix_nest(15, '(202.5d, -11.25d)'); healpix_nest -------------- 6726823987 (1 row) select healpix_nest(15, '(202.5d, -5.625d)'); healpix_nest -------------- 6765200191 (1 row) select healpix_ring(15, '(202.5d, 0.0001)'); healpix_ring -------------- 6441803776 (1 row) select healpix_ring(15, '(202.5d, 5.625d)'); healpix_ring -------------- 5811085312 (1 row) select healpix_ring(15, '(202.5d, 11.25d)'); healpix_ring -------------- 5185609728 (1 row) select healpix_ring(15, '(202.5d, 16.875d)'); healpix_ring -------------- 4572192768 (1 row) select healpix_nest(15, '(202.5d, 22.5d)'); healpix_nest -------------- 2687553520 (1 row) select healpix_nest(15, '(202.5d, 28.125d)'); healpix_nest -------------- 2700292099 (1 row) select healpix_nest(15, '(202.5d, 33.75d)'); healpix_nest -------------- 2738041651 (1 row) select healpix_ring(15, '(202.5d, 39.375d)'); healpix_ring -------------- 2355503104 (1 row) select healpix_nest(15, '(202.5d, 45d)'); healpix_nest -------------- 2887516164 (1 row) select healpix_ring(15, '(202.5d, 50.625d)'); healpix_ring -------------- 1462438122 (1 row) select healpix_nest(15, '(202.5d, 56.25d)'); healpix_nest -------------- 2915520507 (1 row) select healpix_nest(15, '(202.5d, 61.875d)'); healpix_nest -------------- 3098868592 (1 row) select healpix_nest(15, '(202.5d, 67.5d)'); healpix_nest -------------- 3137637239 (1 row) select healpix_nest(15, '(202.5d, 73.125d)'); healpix_nest -------------- 3144761343 (1 row) select healpix_ring(15, '(202.5d, 78.75d)'); healpix_ring -------------- 123781344 (1 row) select healpix_ring(15, '(202.5d, 84.375d)'); healpix_ring -------------- 31016672 (1 row) select healpix_ring(15, '(202.5d, 90d)'); healpix_ring -------------- 131073 (1 row) select healpix_nest(15, '(213.75d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_ring(15, '(213.75d, -84.375d)'); healpix_ring -------------- 12853887676 (1 row) select healpix_ring(15, '(213.75d, -78.75d)'); healpix_ring -------------- 12761093990 (1 row) select healpix_nest(15, '(213.75d, -73.125d)'); healpix_nest -------------- 10798346240 (1 row) select healpix_nest(15, '(213.75d, -67.5d)'); healpix_nest -------------- 10892369800 (1 row) select healpix_nest(15, '(213.75d, -61.875d)'); healpix_nest -------------- 10904847267 (1 row) select healpix_ring(15, '(213.75d, -56.25d)'); healpix_ring -------------- 11799130625 (1 row) select healpix_ring(15, '(213.75d, -50.625d)'); healpix_ring -------------- 11422480666 (1 row) select healpix_nest(15, '(213.75d, -45d)'); healpix_nest -------------- 11355619318 (1 row) select healpix_nest(15, '(213.75d, -39.375d)'); healpix_nest -------------- 11392713667 (1 row) select healpix_ring(15, '(213.75d, -33.75d)'); healpix_ring -------------- 10021646336 (1 row) select healpix_ring(15, '(213.75d, -28.125d)'); healpix_ring -------------- 9479532544 (1 row) select healpix_ring(15, '(213.75d, -22.5d)'); healpix_ring -------------- 8907796480 (1 row) select healpix_ring(15, '(213.75d, -16.875d)'); healpix_ring -------------- 8312729600 (1 row) select healpix_nest(15, '(213.75d, -11.25d)'); healpix_nest -------------- 11743211571 (1 row) select healpix_ring(15, '(213.75d, -5.625d)'); healpix_ring -------------- 7073837056 (1 row) select healpix_nest(15, '(213.75d, 0.0001)'); healpix_nest -------------- 6828326924 (1 row) select healpix_nest(15, '(213.75d, 5.625d)'); healpix_nest -------------- 6841121984 (1 row) select healpix_nest(15, '(213.75d, 11.25d)'); healpix_nest -------------- 2282541004 (1 row) select healpix_nest(15, '(213.75d, 16.875d)'); healpix_nest -------------- 2295329788 (1 row) select healpix_ring(15, '(213.75d, 22.5d)'); healpix_ring -------------- 3977129984 (1 row) select healpix_nest(15, '(213.75d, 28.125d)'); healpix_nest -------------- 2347970563 (1 row) select healpix_ring(15, '(213.75d, 33.75d)'); healpix_ring -------------- 2863280128 (1 row) select healpix_ring(15, '(213.75d, 39.375d)'); healpix_ring -------------- 2355507200 (1 row) select healpix_ring(15, '(213.75d, 45d)'); healpix_ring -------------- 1886956830 (1 row) select healpix_ring(15, '(213.75d, 50.625d)'); healpix_ring -------------- 1462441502 (1 row) select healpix_nest(15, '(213.75d, 56.25d)'); healpix_nest -------------- 2998379513 (1 row) select healpix_ring(15, '(213.75d, 61.875d)'); healpix_ring -------------- 760741331 (1 row) select healpix_nest(15, '(213.75d, 67.5d)'); healpix_nest -------------- 3116585147 (1 row) select healpix_nest(15, '(213.75d, 73.125d)'); healpix_nest -------------- 3165491199 (1 row) select healpix_ring(15, '(213.75d, 78.75d)'); healpix_ring -------------- 123813798 (1 row) select healpix_ring(15, '(213.75d, 84.375d)'); healpix_ring -------------- 31017164 (1 row) select healpix_nest(15, '(213.75d, 90d)'); healpix_nest -------------- 5368709120 (1 row) select healpix_nest(15, '(225d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_ring(15, '(225d, -84.375d)'); healpix_ring -------------- 12853872415 (1 row) select healpix_ring(15, '(225d, -78.75d)'); healpix_ring -------------- 12761126443 (1 row) select healpix_ring(15, '(225d, -73.125d)'); healpix_ring -------------- 12607512318 (1 row) select healpix_ring(15, '(225d, -67.5d)'); healpix_ring -------------- 12394501155 (1 row) select healpix_nest(15, '(225d, -61.875d)'); healpix_nest -------------- 10942677823 (1 row) select healpix_nest(15, '(225d, -56.25d)'); healpix_nest -------------- 10954719235 (1 row) select healpix_ring(15, '(225d, -50.625d)'); healpix_ring -------------- 11422484046 (1 row) select healpix_nest(15, '(225d, -45d)'); healpix_nest -------------- 11002707964 (1 row) select healpix_nest(15, '(225d, -39.375d)'); healpix_nest -------------- 11543708611 (1 row) select healpix_ring(15, '(225d, -33.75d)'); healpix_ring -------------- 10021650432 (1 row) select healpix_ring(15, '(225d, -28.125d)'); healpix_ring -------------- 9479536640 (1 row) select healpix_nest(15, '(225d, -22.5d)'); healpix_nest -------------- 11606634511 (1 row) select healpix_ring(15, '(225d, -16.875d)'); healpix_ring -------------- 8312733696 (1 row) select healpix_nest(15, '(225d, -11.25d)'); healpix_nest -------------- 11759988787 (1 row) select healpix_nest(15, '(225d, -5.625d)'); healpix_nest -------------- 11798364991 (1 row) select healpix_ring(15, '(225d, 0.0001)'); healpix_ring -------------- 6441811968 (1 row) select healpix_nest(15, '(225d, 5.625d)'); healpix_nest -------------- 2160278720 (1 row) select healpix_ring(15, '(225d, 11.25d)'); healpix_ring -------------- 5185617920 (1 row) select healpix_nest(15, '(225d, 16.875d)'); healpix_nest -------------- 2211443708 (1 row) select healpix_nest(15, '(225d, 22.5d)'); healpix_nest -------------- 2352009200 (1 row) select healpix_ring(15, '(225d, 28.125d)'); healpix_ring -------------- 3405398016 (1 row) select healpix_ring(15, '(225d, 33.75d)'); healpix_ring -------------- 2863284224 (1 row) select healpix_nest(15, '(225d, 39.375d)'); healpix_nest -------------- 2414935100 (1 row) select healpix_nest(15, '(225d, 45d)'); healpix_nest -------------- 2955935747 (1 row) select healpix_nest(15, '(225d, 50.625d)'); healpix_nest -------------- 2966359295 (1 row) select healpix_ring(15, '(225d, 56.25d)'); healpix_ring -------------- 1085698451 (1 row) select healpix_ring(15, '(225d, 61.875d)'); healpix_ring -------------- 760743769 (1 row) select healpix_ring(15, '(225d, 67.5d)'); healpix_ring -------------- 490416391 (1 row) select healpix_ring(15, '(225d, 73.125d)'); healpix_ring -------------- 277401346 (1 row) select healpix_nest(15, '(225d, 78.75d)'); healpix_nest -------------- 3204500492 (1 row) select healpix_ring(15, '(225d, 84.375d)'); healpix_ring -------------- 31033411 (1 row) select healpix_nest(15, '(225d, 90d)'); healpix_nest -------------- 5368709120 (1 row) select healpix_nest(15, '(236.25d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_ring(15, '(236.25d, -84.375d)'); healpix_ring -------------- 12853888661 (1 row) select healpix_nest(15, '(236.25d, -78.75d)'); healpix_nest -------------- 10763601209 (1 row) select healpix_nest(15, '(236.25d, -73.125d)'); healpix_nest -------------- 10793152512 (1 row) select healpix_ring(15, '(236.25d, -67.5d)'); healpix_ring -------------- 12394503112 (1 row) select healpix_nest(15, '(236.25d, -61.875d)'); healpix_nest -------------- 10854187859 (1 row) select healpix_ring(15, '(236.25d, -56.25d)'); healpix_ring -------------- 11799136450 (1 row) select healpix_nest(15, '(236.25d, -50.625d)'); healpix_nest -------------- 11143119536 (1 row) select healpix_nest(15, '(236.25d, -45d)'); healpix_nest -------------- 11155079161 (1 row) select healpix_ring(15, '(236.25d, -39.375d)'); healpix_ring -------------- 10529427456 (1 row) select healpix_ring(15, '(236.25d, -33.75d)'); healpix_ring -------------- 10021654528 (1 row) select healpix_nest(15, '(236.25d, -28.125d)'); healpix_nest -------------- 11610673148 (1 row) select healpix_ring(15, '(236.25d, -22.5d)'); healpix_ring -------------- 8907804672 (1 row) select healpix_ring(15, '(236.25d, -16.875d)'); healpix_ring -------------- 8312737792 (1 row) select healpix_ring(15, '(236.25d, -11.25d)'); healpix_ring -------------- 7699320832 (1 row) select healpix_ring(15, '(236.25d, -5.625d)'); healpix_ring -------------- 7073845248 (1 row) select healpix_nest(15, '(236.25d, 0.0001)'); healpix_nest -------------- 8237613068 (1 row) select healpix_nest(15, '(236.25d, 5.625d)'); healpix_nest -------------- 8250408128 (1 row) select healpix_nest(15, '(236.25d, 11.25d)'); healpix_nest -------------- 2215432140 (1 row) select healpix_nest(15, '(236.25d, 16.875d)'); healpix_nest -------------- 2228220924 (1 row) select healpix_nest(15, '(236.25d, 22.5d)'); healpix_nest -------------- 2268123120 (1 row) select healpix_ring(15, '(236.25d, 28.125d)'); healpix_ring -------------- 3405402112 (1 row) select healpix_ring(15, '(236.25d, 33.75d)'); healpix_ring -------------- 2863288320 (1 row) select healpix_ring(15, '(236.25d, 39.375d)'); healpix_ring -------------- 2355515392 (1 row) select healpix_nest(15, '(236.25d, 45d)'); healpix_nest -------------- 2603024393 (1 row) select healpix_nest(15, '(236.25d, 50.625d)'); healpix_nest -------------- 2615328399 (1 row) select healpix_nest(15, '(236.25d, 56.25d)'); healpix_nest -------------- 2977649654 (1 row) select healpix_nest(15, '(236.25d, 61.875d)'); healpix_nest -------------- 3053796444 (1 row) select healpix_ring(15, '(236.25d, 67.5d)'); healpix_ring -------------- 490418348 (1 row) select healpix_ring(15, '(236.25d, 73.125d)'); healpix_ring -------------- 277402818 (1 row) select healpix_nest(15, '(236.25d, 78.75d)'); healpix_nest -------------- 3182474697 (1 row) select healpix_ring(15, '(236.25d, 84.375d)'); healpix_ring -------------- 31018149 (1 row) select healpix_ring(15, '(236.25d, 90d)'); healpix_ring -------------- 131073 (1 row) select healpix_nest(15, '(247.5d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_nest(15, '(247.5d, -84.375d)'); healpix_nest -------------- 10742653633 (1 row) select healpix_ring(15, '(247.5d, -78.75d)'); healpix_ring -------------- 12761128410 (1 row) select healpix_nest(15, '(247.5d, -73.125d)'); healpix_nest -------------- 10813882368 (1 row) select healpix_ring(15, '(247.5d, -67.5d)'); healpix_ring -------------- 12394505070 (1 row) select healpix_nest(15, '(247.5d, -61.875d)'); healpix_nest -------------- 10859775119 (1 row) select healpix_ring(15, '(247.5d, -56.25d)'); healpix_ring -------------- 11799232560 (1 row) select healpix_ring(15, '(247.5d, -50.625d)'); healpix_ring -------------- 11422490806 (1 row) select healpix_nest(15, '(247.5d, -45d)'); healpix_nest -------------- 11071127547 (1 row) select healpix_ring(15, '(247.5d, -39.375d)'); healpix_ring -------------- 10529431552 (1 row) select healpix_nest(15, '(247.5d, -33.75d)'); healpix_nest -------------- 11220602060 (1 row) select healpix_nest(15, '(247.5d, -28.125d)'); healpix_nest -------------- 11258351612 (1 row) select healpix_ring(15, '(247.5d, -22.5d)'); healpix_ring -------------- 8907808768 (1 row) select healpix_nest(15, '(247.5d, -16.875d)'); healpix_nest -------------- 8056212483 (1 row) select healpix_ring(15, '(247.5d, -11.25d)'); healpix_ring -------------- 7699324928 (1 row) select healpix_nest(15, '(247.5d, -5.625d)'); healpix_nest -------------- 8107377471 (1 row) select healpix_nest(15, '(247.5d, 0.0001)'); healpix_nest -------------- 8254390284 (1 row) select healpix_ring(15, '(247.5d, 5.625d)'); healpix_ring -------------- 5811101696 (1 row) select healpix_ring(15, '(247.5d, 11.25d)'); healpix_ring -------------- 5185626112 (1 row) select healpix_ring(15, '(247.5d, 16.875d)'); healpix_ring -------------- 4572209152 (1 row) select healpix_ring(15, '(247.5d, 22.5d)'); healpix_ring -------------- 3977142272 (1 row) select healpix_ring(15, '(247.5d, 28.125d)'); healpix_ring -------------- 3405406208 (1 row) select healpix_ring(15, '(247.5d, 33.75d)'); healpix_ring -------------- 2863292416 (1 row) select healpix_ring(15, '(247.5d, 39.375d)'); healpix_ring -------------- 2355519488 (1 row) select healpix_ring(15, '(247.5d, 45d)'); healpix_ring -------------- 1887091215 (1 row) select healpix_nest(15, '(247.5d, 50.625d)'); healpix_nest -------------- 2651971903 (1 row) select healpix_nest(15, '(247.5d, 56.25d)'); healpix_nest -------------- 2664140791 (1 row) select healpix_nest(15, '(247.5d, 61.875d)'); healpix_nest -------------- 3027826608 (1 row) select healpix_nest(15, '(247.5d, 67.5d)'); healpix_nest -------------- 3070773179 (1 row) select healpix_nest(15, '(247.5d, 73.125d)'); healpix_nest -------------- 3081912319 (1 row) select healpix_ring(15, '(247.5d, 78.75d)'); healpix_ring -------------- 123785278 (1 row) select healpix_nest(15, '(247.5d, 84.375d)'); healpix_nest -------------- 3211800125 (1 row) select healpix_nest(15, '(247.5d, 90d)'); healpix_nest -------------- 5368709120 (1 row) select healpix_nest(15, '(258.75d, -90d)'); healpix_nest -------------- 10737418240 (1 row) select healpix_nest(15, '(258.75d, -84.375d)'); healpix_nest -------------- 10742906292 (1 row) select healpix_nest(15, '(258.75d, -78.75d)'); healpix_nest -------------- 10759370287 (1 row) select healpix_nest(15, '(258.75d, -73.125d)'); healpix_nest -------------- 10810994689 (1 row) select healpix_nest(15, '(258.75d, -67.5d)'); healpix_nest -------------- 10825222195 (1 row) select healpix_ring(15, '(258.75d, -61.875d)'); healpix_ring -------------- 12124262944 (1 row) select healpix_ring(15, '(258.75d, -56.25d)'); healpix_ring -------------- 11799142275 (1 row) select healpix_ring(15, '(258.75d, -50.625d)'); healpix_ring -------------- 11422494186 (1 row) select healpix_nest(15, '(258.75d, -45d)'); healpix_nest -------------- 11088232442 (1 row) select healpix_nest(15, '(258.75d, -39.375d)'); healpix_nest -------------- 11124278211 (1 row) select healpix_ring(15, '(258.75d, -33.75d)'); healpix_ring -------------- 10021662720 (1 row) select healpix_nest(15, '(258.75d, -28.125d)'); healpix_nest -------------- 7651250172 (1 row) select healpix_ring(15, '(258.75d, -22.5d)'); healpix_ring -------------- 8907812864 (1 row) select healpix_ring(15, '(258.75d, -16.875d)'); healpix_ring -------------- 8312745984 (1 row) select healpix_nest(15, '(258.75d, -11.25d)'); healpix_nest -------------- 7716679731 (1 row) select healpix_nest(15, '(258.75d, -5.625d)'); healpix_nest -------------- 8124154687 (1 row) select healpix_ring(15, '(258.75d, 0.0001)'); healpix_ring -------------- 6441824256 (1 row) select healpix_ring(15, '(258.75d, 5.625d)'); healpix_ring -------------- 5811105792 (1 row) select healpix_nest(15, '(258.75d, 11.25d)'); healpix_nest -------------- 8456556492 (1 row) select healpix_nest(15, '(258.75d, 16.875d)'); healpix_nest -------------- 8469345276 (1 row) select healpix_nest(15, '(258.75d, 22.5d)'); healpix_nest -------------- 8509247472 (1 row) select healpix_nest(15, '(258.75d, 28.125d)'); healpix_nest -------------- 8521986051 (1 row) select healpix_ring(15, '(258.75d, 33.75d)'); healpix_ring -------------- 2863296512 (1 row) select healpix_nest(15, '(258.75d, 39.375d)'); healpix_nest -------------- 2498821180 (1 row) select healpix_nest(15, '(258.75d, 45d)'); healpix_nest -------------- 2536177674 (1 row) select healpix_nest(15, '(258.75d, 50.625d)'); healpix_nest -------------- 2634994255 (1 row) select healpix_ring(15, '(258.75d, 56.25d)'); healpix_ring -------------- 1085800387 (1 row) select healpix_ring(15, '(258.75d, 61.875d)'); healpix_ring -------------- 760673072 (1 row) select healpix_ring(15, '(258.75d, 67.5d)'); healpix_ring -------------- 490422263 (1 row) select healpix_nest(15, '(258.75d, 73.125d)'); healpix_nest -------------- 3077476349 (1 row) select healpix_ring(15, '(258.75d, 78.75d)'); healpix_ring -------------- 123786261 (1 row) select healpix_nest(15, '(258.75d, 84.375d)'); healpix_nest -------------- 3210510727 (1 row) select healpix_ring(15, '(258.75d, 90d)'); healpix_ring -------------- 131073 (1 row) select healpix_ring(15, '(270d, -90d)'); healpix_ring -------------- 12884901887 (1 row) select healpix_nest(15, '(270d, -84.375d)'); healpix_nest -------------- 11822311432 (1 row) select healpix_ring(15, '(270d, -78.75d)'); healpix_ring -------------- 12761098908 (1 row) select healpix_nest(15, '(270d, -73.125d)'); healpix_nest -------------- 11956387842 (1 row) select healpix_ring(15, '(270d, -67.5d)'); healpix_ring -------------- 12394508985 (1 row) select healpix_ring(15, '(270d, -61.875d)'); healpix_ring -------------- 12124187373 (1 row) select healpix_nest(15, '(270d, -56.25d)'); healpix_nest -------------- 12390629386 (1 row) select healpix_nest(15, '(270d, -50.625d)'); healpix_nest -------------- 12490803200 (1 row) select healpix_nest(15, '(270d, -45d)'); healpix_nest -------------- 12518599328 (1 row) select healpix_nest(15, '(270d, -39.375d)'); healpix_nest -------------- 7517176771 (1 row) select healpix_ring(15, '(270d, -33.75d)'); healpix_ring -------------- 10021666816 (1 row) select healpix_nest(15, '(270d, -28.125d)'); healpix_nest -------------- 7567364092 (1 row) select healpix_ring(15, '(270d, -22.5d)'); healpix_ring -------------- 8907816960 (1 row) select healpix_nest(15, '(270d, -16.875d)'); healpix_nest -------------- 7720668163 (1 row) select healpix_ring(15, '(270d, -11.25d)'); healpix_ring -------------- 7699333120 (1 row) select healpix_nest(15, '(270d, -5.625d)'); healpix_nest -------------- 7771833151 (1 row) select healpix_ring(15, '(270d, 0.0001)'); healpix_ring -------------- 6441828352 (1 row) select healpix_nest(15, '(270d, 5.625d)'); healpix_nest -------------- 8334294208 (1 row) select healpix_ring(15, '(270d, 11.25d)'); healpix_ring -------------- 5185634304 (1 row) select healpix_ring(15, '(270d, 16.875d)'); healpix_ring -------------- 4572217344 (1 row) select healpix_nest(15, '(270d, 22.5d)'); healpix_nest -------------- 8526024688 (1 row) select healpix_nest(15, '(270d, 28.125d)'); healpix_nest -------------- 8538763267 (1 row) select healpix_ring(15, '(270d, 33.75d)'); healpix_ring -------------- 2863300608 (1 row) select healpix_nest(15, '(270d, 39.375d)'); healpix_nest -------------- 8588950588 (1 row) select healpix_nest(15, '(270d, 45d)'); healpix_nest -------------- 5372903429 (1 row) select healpix_ring(15, '(270d, 50.625d)'); healpix_ring -------------- 1462350239 (1 row) select healpix_ring(15, '(270d, 56.25d)'); healpix_ring -------------- 1085710100 (1 row) select healpix_nest(15, '(270d, 61.875d)'); healpix_nest -------------- 5452943617 (1 row) select healpix_ring(15, '(270d, 67.5d)'); healpix_ring -------------- 490361585 (1 row) select healpix_nest(15, '(270d, 73.125d)'); healpix_nest -------------- 5654009172 (1 row) select healpix_nest(15, '(270d, 78.75d)'); healpix_nest -------------- 5704323088 (1 row) select healpix_nest(15, '(270d, 84.375d)'); healpix_nest -------------- 5721047377 (1 row) select healpix_nest(15, '(270d, 90d)'); healpix_nest -------------- 6442450944 (1 row) select healpix_ring(15, '(281.25d, -90d)'); healpix_ring -------------- 12884901887 (1 row) select healpix_nest(15, '(281.25d, -84.375d)'); healpix_nest -------------- 11821874808 (1 row) select healpix_nest(15, '(281.25d, -78.75d)'); healpix_nest -------------- 11854018847 (1 row) select healpix_ring(15, '(281.25d, -73.125d)'); healpix_ring -------------- 12607472570 (1 row) select healpix_ring(15, '(281.25d, -67.5d)'); healpix_ring -------------- 12394510942 (1 row) select healpix_nest(15, '(281.25d, -61.875d)'); healpix_nest -------------- 12352866449 (1 row) select healpix_ring(15, '(281.25d, -56.25d)'); healpix_ring -------------- 11799148100 (1 row) select healpix_ring(15, '(281.25d, -50.625d)'); healpix_ring -------------- 11422500947 (1 row) select healpix_ring(15, '(281.25d, -45d)'); healpix_ring -------------- 10997991131 (1 row) select healpix_ring(15, '(281.25d, -39.375d)'); healpix_ring -------------- 10529443840 (1 row) select healpix_ring(15, '(281.25d, -33.75d)'); healpix_ring -------------- 10021670912 (1 row) select healpix_nest(15, '(281.25d, -28.125d)'); healpix_nest -------------- 7584141308 (1 row) select healpix_nest(15, '(281.25d, -22.5d)'); healpix_nest -------------- 7596879887 (1 row) select healpix_ring(15, '(281.25d, -16.875d)'); healpix_ring -------------- 8312754176 (1 row) select healpix_nest(15, '(281.25d, -11.25d)'); healpix_nest -------------- 7649570867 (1 row) select healpix_ring(15, '(281.25d, -5.625d)'); healpix_ring -------------- 7073861632 (1 row) select healpix_nest(15, '(281.25d, 0.0001)'); healpix_nest -------------- 7969177612 (1 row) select healpix_ring(15, '(281.25d, 5.625d)'); healpix_ring -------------- 5811113984 (1 row) select healpix_ring(15, '(281.25d, 11.25d)'); healpix_ring -------------- 5185638400 (1 row) select healpix_nest(15, '(281.25d, 16.875d)'); healpix_nest -------------- 8402236412 (1 row) select healpix_nest(15, '(281.25d, 22.5d)'); healpix_nest -------------- 8442138608 (1 row) select healpix_ring(15, '(281.25d, 28.125d)'); healpix_ring -------------- 3405418496 (1 row) select healpix_nest(15, '(281.25d, 33.75d)'); healpix_nest -------------- 3895669555 (1 row) select healpix_ring(15, '(281.25d, 39.375d)'); healpix_ring -------------- 2355531776 (1 row) select healpix_ring(15, '(281.25d, 45d)'); healpix_ring -------------- 1886979867 (1 row) select healpix_nest(15, '(281.25d, 50.625d)'); healpix_nest -------------- 3993887119 (1 row) select healpix_ring(15, '(281.25d, 56.25d)'); healpix_ring -------------- 1085806212 (1 row) select healpix_nest(15, '(281.25d, 61.875d)'); healpix_nest -------------- 4017699741 (1 row) select healpix_ring(15, '(281.25d, 67.5d)'); healpix_ring -------------- 490426178 (1 row) select healpix_nest(15, '(281.25d, 73.125d)'); healpix_nest -------------- 4221390846 (1 row) select healpix_nest(15, '(281.25d, 78.75d)'); healpix_nest -------------- 4273015248 (1 row) select healpix_nest(15, '(281.25d, 84.375d)'); healpix_nest -------------- 4289479243 (1 row) select healpix_ring(15, '(281.25d, 90d)'); healpix_ring -------------- 131072 (1 row) select healpix_nest(15, '(292.5d, -90d)'); healpix_nest -------------- 11811160064 (1 row) select healpix_ring(15, '(292.5d, -84.375d)'); healpix_ring -------------- 12853891122 (1 row) select healpix_nest(15, '(292.5d, -78.75d)'); healpix_nest -------------- 11848860916 (1 row) select healpix_nest(15, '(292.5d, -73.125d)'); healpix_nest -------------- 11950473216 (1 row) select healpix_ring(15, '(292.5d, -67.5d)'); healpix_ring -------------- 12394512899 (1 row) select healpix_nest(15, '(292.5d, -61.875d)'); healpix_nest -------------- 12004558927 (1 row) select healpix_nest(15, '(292.5d, -56.25d)'); healpix_nest -------------- 12368244744 (1 row) select healpix_ring(15, '(292.5d, -50.625d)'); healpix_ring -------------- 11422504327 (1 row) select healpix_nest(15, '(292.5d, -45d)'); healpix_nest -------------- 12412256247 (1 row) select healpix_ring(15, '(292.5d, -39.375d)'); healpix_ring -------------- 10529447936 (1 row) select healpix_nest(15, '(292.5d, -33.75d)'); healpix_nest -------------- 12562779340 (1 row) select healpix_ring(15, '(292.5d, -28.125d)'); healpix_ring -------------- 9479561216 (1 row) select healpix_nest(15, '(292.5d, -22.5d)'); healpix_nest -------------- 12613267471 (1 row) select healpix_nest(15, '(292.5d, -16.875d)'); healpix_nest -------------- 7787777027 (1 row) select healpix_nest(15, '(292.5d, -11.25d)'); healpix_nest -------------- 7800565811 (1 row) select healpix_ring(15, '(292.5d, -5.625d)'); healpix_ring -------------- 7073865728 (1 row) select healpix_nest(15, '(292.5d, 0.0001)'); healpix_nest -------------- 7985954828 (1 row) select healpix_ring(15, '(292.5d, 5.625d)'); healpix_ring -------------- 5811118080 (1 row) select healpix_nest(15, '(292.5d, 11.25d)'); healpix_nest -------------- 8037126092 (1 row) select healpix_ring(15, '(292.5d, 16.875d)'); healpix_ring -------------- 4572225536 (1 row) select healpix_nest(15, '(292.5d, 22.5d)'); healpix_nest -------------- 3761295344 (1 row) select healpix_ring(15, '(292.5d, 28.125d)'); healpix_ring -------------- 3405422592 (1 row) select healpix_ring(15, '(292.5d, 33.75d)'); healpix_ring -------------- 2863308800 (1 row) select healpix_ring(15, '(292.5d, 39.375d)'); healpix_ring -------------- 2355535872 (1 row) select healpix_nest(15, '(292.5d, 45d)'); healpix_nest -------------- 3961257988 (1 row) select healpix_ring(15, '(292.5d, 50.625d)'); healpix_ring -------------- 1462465163 (1 row) select healpix_nest(15, '(292.5d, 56.25d)'); healpix_nest -------------- 3989262331 (1 row) select healpix_ring(15, '(292.5d, 61.875d)'); healpix_ring -------------- 760758396 (1 row) select healpix_ring(15, '(292.5d, 67.5d)'); healpix_ring -------------- 490428135 (1 row) select healpix_ring(15, '(292.5d, 73.125d)'); healpix_ring -------------- 277410179 (1 row) select healpix_nest(15, '(292.5d, 78.75d)'); healpix_nest -------------- 4274026247 (1 row) select healpix_ring(15, '(292.5d, 84.375d)'); healpix_ring -------------- 31020610 (1 row) select healpix_ring(15, '(292.5d, 90d)'); healpix_ring -------------- 131072 (1 row) select healpix_ring(15, '(303.75d, -90d)'); healpix_ring -------------- 12884901887 (1 row) select healpix_nest(15, '(303.75d, -84.375d)'); healpix_nest -------------- 11820847794 (1 row) select healpix_nest(15, '(303.75d, -78.75d)'); healpix_nest -------------- 11849910838 (1 row) select healpix_ring(15, '(303.75d, -73.125d)'); healpix_ring -------------- 12607522623 (1 row) select healpix_nest(15, '(303.75d, -67.5d)'); healpix_nest -------------- 11966111624 (1 row) select healpix_nest(15, '(303.75d, -61.875d)'); healpix_nest -------------- 11978589091 (1 row) select healpix_ring(15, '(303.75d, -56.25d)'); healpix_ring -------------- 11799153925 (1 row) select healpix_ring(15, '(303.75d, -50.625d)'); healpix_ring -------------- 11422507707 (1 row) select healpix_nest(15, '(303.75d, -45d)'); healpix_nest -------------- 12429361142 (1 row) select healpix_nest(15, '(303.75d, -39.375d)'); healpix_nest -------------- 12466455491 (1 row) select healpix_nest(15, '(303.75d, -33.75d)'); healpix_nest -------------- 12478893260 (1 row) select healpix_ring(15, '(303.75d, -28.125d)'); healpix_ring -------------- 9479565312 (1 row) select healpix_ring(15, '(303.75d, -22.5d)'); healpix_ring -------------- 8907829248 (1 row) select healpix_ring(15, '(303.75d, -16.875d)'); healpix_ring -------------- 8312762368 (1 row) select healpix_nest(15, '(303.75d, -11.25d)'); healpix_nest -------------- 12816953395 (1 row) select healpix_nest(15, '(303.75d, -5.625d)'); healpix_nest -------------- 7855719231 (1 row) select healpix_nest(15, '(303.75d, 0.0001)'); healpix_nest -------------- 7902068748 (1 row) select healpix_ring(15, '(303.75d, 5.625d)'); healpix_ring -------------- 5811122176 (1 row) select healpix_nest(15, '(303.75d, 11.25d)'); healpix_nest -------------- 3356282828 (1 row) select healpix_ring(15, '(303.75d, 16.875d)'); healpix_ring -------------- 4572229632 (1 row) select healpix_ring(15, '(303.75d, 22.5d)'); healpix_ring -------------- 3977162752 (1 row) select healpix_ring(15, '(303.75d, 28.125d)'); healpix_ring -------------- 3405426688 (1 row) select healpix_nest(15, '(303.75d, 33.75d)'); healpix_nest -------------- 3828560691 (1 row) select healpix_nest(15, '(303.75d, 39.375d)'); healpix_nest -------------- 3840998460 (1 row) select healpix_nest(15, '(303.75d, 45d)'); healpix_nest -------------- 3877306374 (1 row) select healpix_ring(15, '(303.75d, 50.625d)'); healpix_ring -------------- 1462468543 (1 row) select healpix_nest(15, '(303.75d, 56.25d)'); healpix_nest -------------- 4072121337 (1 row) select healpix_nest(15, '(303.75d, 61.875d)'); healpix_nest -------------- 4178197676 (1 row) select healpix_ring(15, '(303.75d, 67.5d)'); healpix_ring -------------- 490430093 (1 row) select healpix_ring(15, '(303.75d, 73.125d)'); healpix_ring -------------- 277411651 (1 row) select healpix_nest(15, '(303.75d, 78.75d)'); healpix_nest -------------- 4268784326 (1 row) select healpix_nest(15, '(303.75d, 84.375d)'); healpix_nest -------------- 4288421518 (1 row) select healpix_nest(15, '(303.75d, 90d)'); healpix_nest -------------- 6442450944 (1 row) select healpix_nest(15, '(315d, -90d)'); healpix_nest -------------- 11811160064 (1 row) select healpix_nest(15, '(315d, -84.375d)'); healpix_nest -------------- 11815341827 (1 row) select healpix_ring(15, '(315d, -78.75d)'); healpix_ring -------------- 12761134310 (1 row) select healpix_ring(15, '(315d, -73.125d)'); healpix_ring -------------- 12607524095 (1 row) select healpix_ring(15, '(315d, -67.5d)'); healpix_ring -------------- 12394516814 (1 row) select healpix_nest(15, '(315d, -61.875d)'); healpix_nest -------------- 12016419647 (1 row) select healpix_ring(15, '(315d, -56.25d)'); healpix_ring -------------- 11799250034 (1 row) select healpix_nest(15, '(315d, -50.625d)'); healpix_nest -------------- 12066026240 (1 row) select healpix_nest(15, '(315d, -45d)'); healpix_nest -------------- 12076449788 (1 row) select healpix_nest(15, '(315d, -39.375d)'); healpix_nest -------------- 12617450435 (1 row) select healpix_nest(15, '(315d, -33.75d)'); healpix_nest -------------- 12629888204 (1 row) select healpix_ring(15, '(315d, -28.125d)'); healpix_ring -------------- 9479569408 (1 row) select healpix_nest(15, '(315d, -22.5d)'); healpix_nest -------------- 12680376335 (1 row) select healpix_ring(15, '(315d, -16.875d)'); healpix_ring -------------- 8312766464 (1 row) select healpix_nest(15, '(315d, -11.25d)'); healpix_nest -------------- 12833730611 (1 row) select healpix_ring(15, '(315d, -5.625d)'); healpix_ring -------------- 7073873920 (1 row) select healpix_ring(15, '(315d, 0.0001)'); healpix_ring -------------- 6441844736 (1 row) select healpix_nest(15, '(315d, 5.625d)'); healpix_nest -------------- 3234020544 (1 row) select healpix_nest(15, '(315d, 11.25d)'); healpix_nest -------------- 3272396748 (1 row) select healpix_nest(15, '(315d, 16.875d)'); healpix_nest -------------- 3285185532 (1 row) select healpix_ring(15, '(315d, 22.5d)'); healpix_ring -------------- 3977166848 (1 row) select healpix_nest(15, '(315d, 28.125d)'); healpix_nest -------------- 3438489603 (1 row) select healpix_nest(15, '(315d, 33.75d)'); healpix_nest -------------- 3476239155 (1 row) select healpix_nest(15, '(315d, 39.375d)'); healpix_nest -------------- 3488676924 (1 row) select healpix_nest(15, '(315d, 45d)'); healpix_nest -------------- 4029677571 (1 row) select healpix_nest(15, '(315d, 50.625d)'); healpix_nest -------------- 4040101119 (1 row) select healpix_ring(15, '(315d, 56.25d)'); healpix_ring -------------- 1085721750 (1 row) select healpix_ring(15, '(315d, 61.875d)'); healpix_ring -------------- 760763272 (1 row) select healpix_nest(15, '(315d, 67.5d)'); healpix_nest -------------- 4228070604 (1 row) select healpix_nest(15, '(315d, 73.125d)'); healpix_nest -------------- 4240506879 (1 row) select healpix_nest(15, '(315d, 78.75d)'); healpix_nest -------------- 4278242316 (1 row) select healpix_nest(15, '(315d, 84.375d)'); healpix_nest -------------- 4290785532 (1 row) select healpix_ring(15, '(315d, 90d)'); healpix_ring -------------- 131072 (1 row) select healpix_ring(15, '(326.25d, -90d)'); healpix_ring -------------- 12884901887 (1 row) select healpix_nest(15, '(326.25d, -84.375d)'); healpix_nest -------------- 11817705841 (1 row) select healpix_ring(15, '(326.25d, -78.75d)'); healpix_ring -------------- 12761103825 (1 row) select healpix_ring(15, '(326.25d, -73.125d)'); healpix_ring -------------- 12607525567 (1 row) select healpix_ring(15, '(326.25d, -67.5d)'); healpix_ring -------------- 12394518771 (1 row) select healpix_ring(15, '(326.25d, -61.875d)'); healpix_ring -------------- 12124199562 (1 row) select healpix_nest(15, '(326.25d, -56.25d)'); healpix_nest -------------- 12034006022 (1 row) select healpix_nest(15, '(326.25d, -50.625d)'); healpix_nest -------------- 12216861360 (1 row) select healpix_nest(15, '(326.25d, -45d)'); healpix_nest -------------- 12228820985 (1 row) select healpix_ring(15, '(326.25d, -39.375d)'); healpix_ring -------------- 10529460224 (1 row) select healpix_nest(15, '(326.25d, -33.75d)'); healpix_nest -------------- 12277566668 (1 row) select healpix_ring(15, '(326.25d, -28.125d)'); healpix_ring -------------- 9479573504 (1 row) select healpix_ring(15, '(326.25d, -22.5d)'); healpix_ring -------------- 8907837440 (1 row) select healpix_ring(15, '(326.25d, -16.875d)'); healpix_ring -------------- 8312770560 (1 row) select healpix_nest(15, '(326.25d, -11.25d)'); healpix_nest -------------- 12749844531 (1 row) select healpix_ring(15, '(326.25d, -5.625d)'); healpix_ring -------------- 7073878016 (1 row) select healpix_ring(15, '(326.25d, 0.0001)'); healpix_ring -------------- 6441848832 (1 row) select healpix_nest(15, '(326.25d, 5.625d)'); healpix_nest -------------- 5029182656 (1 row) select healpix_ring(15, '(326.25d, 11.25d)'); healpix_ring -------------- 5185654784 (1 row) select healpix_ring(15, '(326.25d, 16.875d)'); healpix_ring -------------- 4572237824 (1 row) select healpix_ring(15, '(326.25d, 22.5d)'); healpix_ring -------------- 3977170944 (1 row) select healpix_nest(15, '(326.25d, 28.125d)'); healpix_nest -------------- 3354603523 (1 row) select healpix_ring(15, '(326.25d, 33.75d)'); healpix_ring -------------- 2863321088 (1 row) select healpix_nest(15, '(326.25d, 39.375d)'); healpix_nest -------------- 3639671868 (1 row) select healpix_nest(15, '(326.25d, 45d)'); healpix_nest -------------- 3676766217 (1 row) select healpix_ring(15, '(326.25d, 50.625d)'); healpix_ring -------------- 1462475303 (1 row) select healpix_ring(15, '(326.25d, 56.25d)'); healpix_ring -------------- 1085817862 (1 row) select healpix_ring(15, '(326.25d, 61.875d)'); healpix_ring -------------- 760765710 (1 row) select healpix_ring(15, '(326.25d, 67.5d)'); healpix_ring -------------- 490434007 (1 row) select healpix_nest(15, '(326.25d, 73.125d)'); healpix_nest -------------- 4234039295 (1 row) select healpix_ring(15, '(326.25d, 78.75d)'); healpix_ring -------------- 123823633 (1 row) select healpix_ring(15, '(326.25d, 84.375d)'); healpix_ring -------------- 31022087 (1 row) select healpix_ring(15, '(326.25d, 90d)'); healpix_ring -------------- 131072 (1 row) select healpix_ring(15, '(337.5d, -90d)'); healpix_ring -------------- 12884901887 (1 row) select healpix_nest(15, '(337.5d, -84.375d)'); healpix_nest -------------- 11816395457 (1 row) select healpix_nest(15, '(337.5d, -78.75d)'); healpix_nest -------------- 11832101112 (1 row) select healpix_ring(15, '(337.5d, -73.125d)'); healpix_ring -------------- 12607527039 (1 row) select healpix_ring(15, '(337.5d, -67.5d)'); healpix_ring -------------- 12394520729 (1 row) select healpix_ring(15, '(337.5d, -61.875d)'); healpix_ring -------------- 12124202000 (1 row) select healpix_ring(15, '(337.5d, -56.25d)'); healpix_ring -------------- 11799255859 (1 row) select healpix_ring(15, '(337.5d, -50.625d)'); healpix_ring -------------- 11422517847 (1 row) select healpix_ring(15, '(337.5d, -45d)'); healpix_ring -------------- 10997887464 (1 row) select healpix_ring(15, '(337.5d, -39.375d)'); healpix_ring -------------- 10529464320 (1 row) select healpix_nest(15, '(337.5d, -33.75d)'); healpix_nest -------------- 12294343884 (1 row) select healpix_ring(15, '(337.5d, -28.125d)'); healpix_ring -------------- 9479577600 (1 row) select healpix_ring(15, '(337.5d, -22.5d)'); healpix_ring -------------- 8907841536 (1 row) select healpix_nest(15, '(337.5d, -16.875d)'); healpix_nest -------------- 4834987011 (1 row) select healpix_ring(15, '(337.5d, -11.25d)'); healpix_ring -------------- 7699357696 (1 row) select healpix_ring(15, '(337.5d, -5.625d)'); healpix_ring -------------- 7073882112 (1 row) select healpix_nest(15, '(337.5d, 0.0001)'); healpix_nest -------------- 5033164812 (1 row) select healpix_ring(15, '(337.5d, 5.625d)'); healpix_ring -------------- 5811134464 (1 row) select healpix_nest(15, '(337.5d, 11.25d)'); healpix_nest -------------- 5084336076 (1 row) select healpix_nest(15, '(337.5d, 16.875d)'); healpix_nest -------------- 5097124860 (1 row) select healpix_ring(15, '(337.5d, 22.5d)'); healpix_ring -------------- 3977175040 (1 row) select healpix_nest(15, '(337.5d, 28.125d)'); healpix_nest -------------- 3505598467 (1 row) select healpix_nest(15, '(337.5d, 33.75d)'); healpix_nest -------------- 3543348019 (1 row) select healpix_nest(15, '(337.5d, 39.375d)'); healpix_nest -------------- 3555785788 (1 row) select healpix_ring(15, '(337.5d, 45d)'); healpix_ring -------------- 1887121932 (1 row) select healpix_nest(15, '(337.5d, 50.625d)'); healpix_nest -------------- 3725713727 (1 row) select healpix_ring(15, '(337.5d, 56.25d)'); healpix_ring -------------- 1085727575 (1 row) select healpix_nest(15, '(337.5d, 61.875d)'); healpix_nest -------------- 4101568432 (1 row) select healpix_nest(15, '(337.5d, 67.5d)'); healpix_nest -------------- 4144515003 (1 row) select healpix_ring(15, '(337.5d, 73.125d)'); healpix_ring -------------- 277416067 (1 row) select healpix_ring(15, '(337.5d, 78.75d)'); healpix_ring -------------- 123793145 (1 row) select healpix_ring(15, '(337.5d, 84.375d)'); healpix_ring -------------- 31022579 (1 row) select healpix_nest(15, '(337.5d, 90d)'); healpix_nest -------------- 6442450944 (1 row) select healpix_nest(15, '(348.75d, -90d)'); healpix_nest -------------- 11811160064 (1 row) select healpix_ring(15, '(348.75d, -84.375d)'); healpix_ring -------------- 12853877831 (1 row) select healpix_nest(15, '(348.75d, -78.75d)'); healpix_nest -------------- 11833112111 (1 row) select healpix_nest(15, '(348.75d, -73.125d)'); healpix_nest -------------- 11884736513 (1 row) select healpix_ring(15, '(348.75d, -67.5d)'); healpix_ring -------------- 12394522686 (1 row) select healpix_nest(15, '(348.75d, -61.875d)'); healpix_nest -------------- 12088427618 (1 row) select healpix_nest(15, '(348.75d, -56.25d)'); healpix_nest -------------- 12094237701 (1 row) select healpix_nest(15, '(348.75d, -50.625d)'); healpix_nest -------------- 12112240240 (1 row) select healpix_ring(15, '(348.75d, -45d)'); healpix_ring -------------- 10998014168 (1 row) select healpix_ring(15, '(348.75d, -39.375d)'); healpix_ring -------------- 10529468416 (1 row) select healpix_ring(15, '(348.75d, -33.75d)'); healpix_ring -------------- 10021695488 (1 row) select healpix_ring(15, '(348.75d, -28.125d)'); healpix_ring -------------- 9479581696 (1 row) select healpix_nest(15, '(348.75d, -22.5d)'); healpix_nest -------------- 4442763279 (1 row) select healpix_nest(15, '(348.75d, -16.875d)'); healpix_nest -------------- 4482665475 (1 row) select healpix_ring(15, '(348.75d, -11.25d)'); healpix_ring -------------- 7699361792 (1 row) select healpix_ring(15, '(348.75d, -5.625d)'); healpix_ring -------------- 7073886208 (1 row) select healpix_ring(15, '(348.75d, 0.0001)'); healpix_ring -------------- 6441857024 (1 row) select healpix_ring(15, '(348.75d, 5.625d)'); healpix_ring -------------- 5811138560 (1 row) select healpix_ring(15, '(348.75d, 11.25d)'); healpix_ring -------------- 5185662976 (1 row) select healpix_nest(15, '(348.75d, 16.875d)'); healpix_nest -------------- 5248119804 (1 row) select healpix_nest(15, '(348.75d, 22.5d)'); healpix_nest -------------- 5288022000 (1 row) select healpix_ring(15, '(348.75d, 28.125d)'); healpix_ring -------------- 3405443072 (1 row) select healpix_ring(15, '(348.75d, 33.75d)'); healpix_ring -------------- 2863329280 (1 row) select healpix_ring(15, '(348.75d, 39.375d)'); healpix_ring -------------- 2355556352 (1 row) select healpix_ring(15, '(348.75d, 45d)'); healpix_ring -------------- 1887002904 (1 row) select healpix_ring(15, '(348.75d, 50.625d)'); healpix_ring -------------- 1462482063 (1 row) select healpix_ring(15, '(348.75d, 56.25d)'); healpix_ring -------------- 1085823687 (1 row) select healpix_ring(15, '(348.75d, 61.875d)'); healpix_ring -------------- 760692574 (1 row) select healpix_ring(15, '(348.75d, 67.5d)'); healpix_ring -------------- 490437922 (1 row) select healpix_nest(15, '(348.75d, 73.125d)'); healpix_nest -------------- 4151218173 (1 row) select healpix_ring(15, '(348.75d, 78.75d)'); healpix_ring -------------- 123794128 (1 row) select healpix_ring(15, '(348.75d, 84.375d)'); healpix_ring -------------- 31038827 (1 row) select healpix_nest(15, '(348.75d, 90d)'); healpix_nest -------------- 6442450944 (1 row) select healpix_nest(15, '(360d, -90d)'); healpix_nest -------------- 8589934592 (1 row) select healpix_ring(15, '(360d, -84.375d)'); healpix_ring -------------- 12853862568 (1 row) select healpix_ring(15, '(360d, -78.75d)'); healpix_ring -------------- 12761075304 (1 row) select healpix_ring(15, '(360d, -73.125d)'); healpix_ring -------------- 12607435764 (1 row) select healpix_ring(15, '(360d, -67.5d)'); healpix_ring -------------- 12394462008 (1 row) select healpix_nest(15, '(360d, -61.875d)'); healpix_nest -------------- 9137293480 (1 row) select healpix_nest(15, '(360d, -56.25d)'); healpix_nest -------------- 9169403914 (1 row) select healpix_nest(15, '(360d, -50.625d)'); healpix_nest -------------- 9269577728 (1 row) select healpix_ring(15, '(360d, -45d)'); healpix_ring -------------- 10997772276 (1 row) select healpix_ring(15, '(360d, -39.375d)'); healpix_ring -------------- 10529341440 (1 row) select healpix_ring(15, '(360d, -33.75d)'); healpix_ring -------------- 10021568512 (1 row) select healpix_ring(15, '(360d, -28.125d)'); healpix_ring -------------- 9479454720 (1 row) select healpix_ring(15, '(360d, -22.5d)'); healpix_ring -------------- 8907718656 (1 row) select healpix_ring(15, '(360d, -16.875d)'); healpix_ring -------------- 8312651776 (1 row) select healpix_ring(15, '(360d, -11.25d)'); healpix_ring -------------- 7699234816 (1 row) select healpix_ring(15, '(360d, -5.625d)'); healpix_ring -------------- 7073759232 (1 row) select healpix_ring(15, '(360d, 0.0001)'); healpix_ring -------------- 6441730048 (1 row) select healpix_ring(15, '(360d, 5.625d)'); healpix_ring -------------- 5811011584 (1 row) select healpix_nest(15, '(360d, 11.25d)'); healpix_nest -------------- 5151444940 (1 row) select healpix_ring(15, '(360d, 16.875d)'); healpix_ring -------------- 4572119040 (1 row) select healpix_nest(15, '(360d, 22.5d)'); healpix_nest -------------- 5304799216 (1 row) select healpix_ring(15, '(360d, 28.125d)'); healpix_ring -------------- 3405316096 (1 row) select healpix_nest(15, '(360d, 33.75d)'); healpix_nest -------------- 5355287347 (1 row) select healpix_nest(15, '(360d, 39.375d)'); healpix_nest -------------- 5367725116 (1 row) select healpix_ring(15, '(360d, 45d)'); healpix_ring -------------- 1887014951 (1 row) select healpix_nest(15, '(360d, 50.625d)'); healpix_nest -------------- 2165576021 (1 row) select healpix_nest(15, '(360d, 56.25d)'); healpix_nest -------------- 2215662928 (1 row) select healpix_nest(15, '(360d, 61.875d)'); healpix_nest -------------- 2231718145 (1 row) select healpix_ring(15, '(360d, 67.5d)'); healpix_ring -------------- 490445683 (1 row) select healpix_nest(15, '(360d, 73.125d)'); healpix_nest -------------- 2432783700 (1 row) select healpix_nest(15, '(360d, 78.75d)'); healpix_nest -------------- 2483097616 (1 row) select healpix_nest(15, '(360d, 84.375d)'); healpix_nest -------------- 2499821905 (1 row) select healpix_nest(15, '(360d, 90d)'); healpix_nest -------------- 3221225472 (1 row) select centre_of_healpix_ring(28, 537730339933102080); centre_of_healpix_ring ------------------------------ (0.850448536 , -0.246231908) (1 row) select centre_of_healpix_nest(27, 201388984497553152); centre_of_healpix_nest ---------------------------- (5.24503559 , -1.02984255) (1 row) select centre_of_healpix_nest(21, 44196118059124); centre_of_healpix_nest ---------------------------- (3.85961802 , -1.32052524) (1 row) select centre_of_healpix_ring(27, 194581447837049088); centre_of_healpix_ring ----------------------------- (3.94202087 , -0.927695373) (1 row) select centre_of_healpix_nest(13, 419722720); centre_of_healpix_nest ----------------------------- (3.59986941 , -0.268430115) (1 row) select centre_of_healpix_nest(20, 6132786714249); centre_of_healpix_nest ------------------------------ (1.36433734 , -0.0210815786) (1 row) select centre_of_healpix_ring(20, 8227328938956); centre_of_healpix_ring ----------------------------- (3.61551557 , -0.249705529) (1 row) select centre_of_healpix_nest(27, 54798618660893952); centre_of_healpix_nest ---------------------------- (5.32613887 , 0.180033741) (1 row) select centre_of_healpix_nest(15, 6392603127); centre_of_healpix_nest ---------------------------- (1.68320836 , 0.458185821) (1 row) select centre_of_healpix_ring(22, 115555464150489); centre_of_healpix_ring ------------------------------ (5.60802759 , -0.0949036098) (1 row) select centre_of_healpix_nest(26, 9823337059771008); centre_of_healpix_nest ---------------------------- (3.70207585 , 0.427257269) (1 row) select centre_of_healpix_nest(24, 2278117826957604); centre_of_healpix_nest ---------------------------- (1.24801521 , -1.07136669) (1 row) select centre_of_healpix_ring(12, 26680361); centre_of_healpix_ring ---------------------------- (5.78833285 , 0.825689616) (1 row) select centre_of_healpix_ring(11, 9637138); centre_of_healpix_ring ---------------------------- (5.70832601 , 0.665163137) (1 row) select centre_of_healpix_nest(14, 2792184976); centre_of_healpix_nest ----------------------------- (4.19371173 , -0.701421635) (1 row) select centre_of_healpix_ring(4, 2732); centre_of_healpix_ring ----------------------------- (2.96034692 , -0.894582592) (1 row) select centre_of_healpix_ring(24, 3110211681589728); centre_of_healpix_ring ---------------------------- (3.50331157 , -1.00026709) (1 row) select centre_of_healpix_ring(4, 2307); centre_of_healpix_ring ----------------------------- (3.48520435 , -0.523598776) (1 row) select centre_of_healpix_nest(5, 9269); centre_of_healpix_nest ---------------------------- (2.55254403 , -1.26340128) (1 row) select centre_of_healpix_nest(21, 19605219971363); centre_of_healpix_nest ----------------------------- (0.525800378 , 0.148357742) (1 row) select centre_of_healpix_ring(10, 2683217); centre_of_healpix_ring ---------------------------- (3.65854418 , 0.610854583) (1 row) select centre_of_healpix_nest(23, 184729963468995); centre_of_healpix_nest ---------------------------- (3.33106625 , 0.537739496) (1 row) select centre_of_healpix_nest(6, 3622); centre_of_healpix_nest ---------------------------- (0.412334036 , 1.05477994) (1 row) select centre_of_healpix_nest(28, 534942473612104704); centre_of_healpix_nest ----------------------------- (4.93527937 , 0.0597943699) (1 row) select centre_of_healpix_ring(27, 146758529656356864); centre_of_healpix_ring ----------------------------- (5.48321433 , -0.365899243) (1 row) select centre_of_healpix_ring(23, 382135742340279); centre_of_healpix_ring ------------------------------ (0.559745507 , 0.0950638341) (1 row) select centre_of_healpix_nest(27, 152634205458995712); centre_of_healpix_nest ----------------------------- (1.14147804 , -0.559745986) (1 row) select centre_of_healpix_ring(28, 713459420104516608); centre_of_healpix_ring ---------------------------- (3.23838325 , -0.70785608) (1 row) select centre_of_healpix_ring(8, 405421); centre_of_healpix_ring ------------------------------ (2.63537899 , -0.0312550885) (1 row) select centre_of_healpix_ring(6, 30504); centre_of_healpix_ring ----------------------------- (4.12334036 , -0.241936663) (1 row) select centre_of_healpix_ring(7, 87548); centre_of_healpix_ring ---------------------------- (3.09250527 , 0.109594256) (1 row) select centre_of_healpix_ring(13, 776006567); centre_of_healpix_ring --------------------------- (6.1648011 , -1.18690667) (1 row) select centre_of_healpix_ring(25, 12950711827228800); centre_of_healpix_ring ---------------------------- (2.44279174 , -1.16072017) (1 row) select centre_of_healpix_ring(22, 111992516070519); centre_of_healpix_ring ------------------------------ (4.00795306 , -0.0610441334) (1 row) select centre_of_healpix_ring(20, 3830060322857); centre_of_healpix_ring ----------------------------- (0.251635017 , 0.432817085) (1 row) select centre_of_healpix_ring(23, 184752358124289); centre_of_healpix_ring --------------------------- (5.2697515 , 0.597307896) (1 row) select centre_of_healpix_ring(14, 2747491487); centre_of_healpix_ring ------------------------------ (0.101606741 , -0.783672814) (1 row) select centre_of_healpix_nest(28, 26976689329032192); centre_of_healpix_nest ---------------------------- (1.56477015 , 0.923577707) (1 row) select centre_of_healpix_nest(10, 10982692); centre_of_healpix_nest ----------------------------- (4.30588407 , -0.530377918) (1 row) select centre_of_healpix_ring(28, 861417470205514752); centre_of_healpix_ring ---------------------------- (3.58224657 , -1.44765876) (1 row) select centre_of_healpix_nest(19, 1025023444235); centre_of_healpix_nest ---------------------------- (4.73803044 , 0.937826209) (1 row) select centre_of_healpix_nest(14, 250621829); centre_of_healpix_nest ---------------------------- (0.237644756 , 1.27207226) (1 row) select centre_of_healpix_nest(23, 518845461144234); centre_of_healpix_nest ---------------------------- (5.27855082 , 0.118458715) (1 row) select centre_of_healpix_nest(25, 3407207856299664); centre_of_healpix_nest ---------------------------- (5.53067588 , 0.178079587) (1 row) select centre_of_healpix_ring(24, 82744934806992); centre_of_healpix_ring --------------------------- (5.01275595 , 1.25647091) (1 row) select centre_of_healpix_nest(18, 136362875895); centre_of_healpix_nest --------------------------- (1.63787053 , 1.46319115) (1 row) select centre_of_healpix_ring(26, 29151516978609024); centre_of_healpix_ring ------------------------------ (5.56602232 , -0.0789046919) (1 row) select centre_of_healpix_nest(26, 41053381175033664); centre_of_healpix_nest --------------------------- (2.73305216 , -1.0485831) (1 row) select centre_of_healpix_ring(24, 1095683934718560); centre_of_healpix_ring ---------------------------- (2.69391894 , 0.358878902) (1 row) select centre_of_healpix_nest(13, 704265631); centre_of_healpix_nest ----------------------------- (4.24720931 , -0.432373099) (1 row) select centre_of_healpix_ring(14, 268093232); centre_of_healpix_ring ---------------------------- (2.20064794 , 0.985487492) (1 row) select centre_of_healpix_nest(7, 146796); centre_of_healpix_nest ------------------------------ (0.908116626 , -0.162168197) (1 row) select centre_of_healpix_nest(7, 178782); centre_of_healpix_nest ----------------------------- (3.69996166 , -0.328809638) (1 row) select centre_of_healpix_ring(25, 469938201269808); centre_of_healpix_ring --------------------------- (2.24598878 , 1.19559857) (1 row) select centre_of_healpix_ring(17, 53330314920); centre_of_healpix_ring ------------------------------ (0.0204271114 , 0.503649784) (1 row) select centre_of_healpix_nest(16, 23042297401); centre_of_healpix_nest ----------------------------- (2.22253443 , 0.0882901167) (1 row) select centre_of_healpix_nest(8, 488194); centre_of_healpix_nest ---------------------------- (5.1020201 , 0.0886577656) (1 row) select centre_of_healpix_ring(20, 2248184383981); centre_of_healpix_ring ---------------------------- (2.67906898 , 0.719773878) (1 row) select centre_of_healpix_nest(19, 842672017628); centre_of_healpix_nest ---------------------------- (5.69136234 , 0.223152013) (1 row) select centre_of_healpix_nest(22, 170265834015278); centre_of_healpix_nest ----------------------------- (1.79211107 , -0.616517316) (1 row) select centre_of_healpix_nest(21, 5910543280040); centre_of_healpix_nest ---------------------------- (2.84465427 , 0.638096042) (1 row) select centre_of_healpix_nest(13, 184266675); centre_of_healpix_nest --------------------------- (3.14240857 , 1.08636162) (1 row) select centre_of_healpix_ring(14, 2667648192); centre_of_healpix_ring ----------------------------- (3.65087428 , -0.715891988) (1 row) select centre_of_healpix_nest(22, 93236373840563); centre_of_healpix_nest ----------------------------- (1.96815278 , -0.117707872) (1 row) select centre_of_healpix_nest(16, 34092166004); centre_of_healpix_nest --------------------------- (4.7144263 , 0.355276411) (1 row) select centre_of_healpix_nest(21, 12547642479303); centre_of_healpix_nest --------------------------- (4.09921721 , 1.16661945) (1 row) select centre_of_healpix_nest(14, 1920063540); centre_of_healpix_nest ----------------------------- (4.62811591 , -0.313243751) (1 row) select centre_of_healpix_nest(18, 819693553060); centre_of_healpix_nest ----------------------------- (5.33069709 , -0.255205181) (1 row) select centre_of_healpix_nest(5, 2787); centre_of_healpix_nest -------------------------- (3.29867229 , 0.9215662) (1 row) select centre_of_healpix_ring(28, 210546639978286080); centre_of_healpix_ring ---------------------------- (2.01825732 , 0.538691299) (1 row) select centre_of_healpix_ring(20, 11287795966293); centre_of_healpix_ring --------------------------- (2.07814743 , -0.7909646) (1 row) select centre_of_healpix_nest(26, 1160601853988160); centre_of_healpix_nest ---------------------------- (1.22051419 , 0.463787807) (1 row) select centre_of_healpix_ring(20, 7896584759340); centre_of_healpix_ring ------------------------------ (0.113580492 , -0.198280663) (1 row) select centre_of_healpix_nest(8, 200830); centre_of_healpix_nest ---------------------------- (5.71561242 , 0.225874089) (1 row) select centre_of_healpix_ring(17, 94199292826); centre_of_healpix_ring ----------------------------- (2.46541872 , 0.0862529445) (1 row) select centre_of_healpix_nest(6, 13985); centre_of_healpix_nest ---------------------------- (5.55914638 , 0.702114276) (1 row) select centre_of_healpix_ring(11, 41386383); centre_of_healpix_ring ----------------------------- (3.44800532 , -0.700410041) (1 row) select centre_of_healpix_ring(21, 35625085172533); centre_of_healpix_ring ----------------------------- (3.72972224 , -0.357607822) (1 row) select centre_of_healpix_ring(10, 3660152); centre_of_healpix_ring ----------------------------- (0.577543767 , 0.431208244) (1 row) select centre_of_healpix_ring(12, 141456730); centre_of_healpix_ring ----------------------------- (2.09637649 , -0.417277913) (1 row) select centre_of_healpix_nest(13, 785134104); centre_of_healpix_nest ----------------------------- (5.10374583 , -0.607778161) (1 row) select centre_of_healpix_nest(13, 724995839); centre_of_healpix_nest ----------------------------- (3.93772868 , -0.431297826) (1 row) select centre_of_healpix_ring(23, 478718004930834); centre_of_healpix_ring ----------------------------- (5.12546471 , -0.134234743) (1 row) select centre_of_healpix_nest(18, 700095158103); centre_of_healpix_nest ---------------------------- (3.92250084 , -1.13921951) (1 row) select centre_of_healpix_nest(28, 537172777510268928); centre_of_healpix_nest ---------------------------- (5.20887707 , 0.128728701) (1 row) select centre_of_healpix_ring(5, 1792); centre_of_healpix_ring ---------------------------- (2.74889357 , 0.785291352) (1 row) select centre_of_healpix_nest(15, 3421616616); centre_of_healpix_nest ---------------------------- (5.30397826 , 0.489511145) (1 row) select centre_of_healpix_ring(20, 10960258772104); centre_of_healpix_ring ----------------------------- (5.17125297 , -0.722660713) (1 row) select centre_of_healpix_nest(16, 26152664735); centre_of_healpix_nest ---------------------------- (3.4021297 , -0.320877264) (1 row) select centre_of_healpix_nest(6, 27586); centre_of_healpix_nest ---------------------------- (2.73662173 , 0.188616386) (1 row) select centre_of_healpix_nest(14, 1130732644); centre_of_healpix_nest ------------------------------- (0.0831225839 , -0.166829102) (1 row) select centre_of_healpix_nest(8, 750730); centre_of_healpix_nest ----------------------------- (5.95491342 , -0.584860811) (1 row) select centre_of_healpix_nest(11, 3757411); centre_of_healpix_nest --------------------------- (0.776203258 , 1.1592512) (1 row) select centre_of_healpix_ring(11, 5147858); centre_of_healpix_ring ---------------------------- (5.32200289 , 0.919883365) (1 row) select centre_of_healpix_nest(9, 2517930); centre_of_healpix_nest ----------------------------- (1.98957308 , -0.702114276) (1 row) select centre_of_healpix_nest(5, 1693); centre_of_healpix_nest ---------------------------- (1.85877565 , 0.785291352) (1 row) select centre_of_healpix_nest(14, 1441523729); centre_of_healpix_nest ----------------------------- (2.08185161 , 0.0980574565) (1 row) select centre_of_healpix_nest(11, 17237236); centre_of_healpix_nest ------------------------------ (0.209388378 , -0.319537604) (1 row) select centre_of_healpix_ring(8, 418930); centre_of_healpix_ring ------------------------------ (3.84108789 , -0.0651502458) (1 row) select centre_of_healpix_nest(24, 1668265634339076); centre_of_healpix_nest ---------------------------- (1.45642722 , 0.421331337) (1 row) select centre_of_healpix_ring(7, 115506); centre_of_healpix_ring ------------------------------ (0.619728238 , -0.178022154) (1 row) select centre_of_healpix_nest(22, 23361295754004); centre_of_healpix_nest ---------------------------- (2.94408177 , 0.712628624) (1 row) select centre_of_healpix_nest(26, 27153318689347968); centre_of_healpix_nest ----------------------------- (3.26359103 , -0.460765107) (1 row) select centre_of_healpix_nest(21, 29427698655517); centre_of_healpix_nest ----------------------------- (2.72677856 , 0.0635071631) (1 row) select centre_of_healpix_nest(9, 410791); centre_of_healpix_nest ---------------------------- (2.19359253 , 0.598982114) (1 row) select centre_of_healpix_ring(25, 13499743064536176); centre_of_healpix_ring --------------------------- (6.13085157 , -1.5135768) (1 row) select centre_of_healpix_nest(8, 551129); centre_of_healpix_nest ------------------------------ (0.896240646 , -0.757592599) (1 row) select centre_of_healpix_nest(21, 44016257494674); centre_of_healpix_nest ---------------------------- (3.65482381 , -1.49431913) (1 row) select centre_of_healpix_nest(14, 207841802); centre_of_healpix_nest ----------------------------- (0.850264195 , 0.934382262) (1 row) select centre_of_healpix_ring(12, 199193395); centre_of_healpix_ring ---------------------------- (4.63407726 , -1.36451257) (1 row) select centre_of_healpix_ring(9, 1626029); centre_of_healpix_ring ------------------------------ (2.88848582 , -0.0338606367) (1 row) select centre_of_healpix_ring(20, 8358926913920); centre_of_healpix_ring ------------------------------ (-0.14055099 , -0.270347488) (1 row) select centre_of_healpix_nest(21, 14462892588205); centre_of_healpix_nest ---------------------------- (5.85021511 , 0.549240298) (1 row) select centre_of_healpix_ring(28, 553448975120317440); centre_of_healpix_ring ----------------------------- (5.82672416 , -0.283906513) (1 row) select centre_of_healpix_nest(27, 182451037576376832); centre_of_healpix_nest ---------------------------- (3.31191372 , -1.30501942) (1 row) select centre_of_healpix_nest(25, 11258086296039696); centre_of_healpix_nest ----------------------------- (2.3474255 , -0.0296466663) (1 row) select centre_of_healpix_nest(12, 39036434); centre_of_healpix_nest --------------------------- (4.4828671 , 0.673048267) (1 row) select centre_of_healpix_nest(23, 32255266892451); centre_of_healpix_nest ---------------------------- (1.53967237 , 0.943085812) (1 row) select centre_of_healpix_ring(10, 9398705); centre_of_healpix_ring ------------------------------ (0.664213681 , -0.516846064) (1 row) select centre_of_healpix_nest(4, 1138); centre_of_healpix_nest ------------------------------ (0.343611696 , 0.0834300866) (1 row) select centre_of_healpix_ring(12, 77447327); centre_of_healpix_ring --------------------------- (3.20256839 , 0.23272664) (1 row) select centre_of_healpix_nest(15, 5690698366); centre_of_healpix_nest ----------------------------- (1.96711464 , -0.117334476) (1 row) select centre_of_healpix_ring(23, 228379414182522); centre_of_healpix_ring ---------------------------- (2.69033753 , 0.476969343) (1 row) select centre_of_healpix_ring(25, 13421573206491024); centre_of_healpix_ring ---------------------------- (1.70346583 , -1.40808658) (1 row) select centre_of_healpix_nest(19, 3237029635046); centre_of_healpix_nest ----------------------------- (5.51628629 , -0.517232235) (1 row) select centre_of_healpix_nest(23, 653047493772363); centre_of_healpix_nest ----------------------------- (2.95896579 , -0.878747633) (1 row) select centre_of_healpix_ring(5, 8453); centre_of_healpix_ring ----------------------------- (3.41157327 , -0.384396774) (1 row) select centre_of_healpix_nest(6, 17707); centre_of_healpix_nest ------------------------------- (0.515417545 , -0.0729814361) (1 row) select centre_of_healpix_ring(20, 3656306695019); centre_of_healpix_ring ---------------------------- (5.95008827 , 0.462032434) (1 row) select centre_of_healpix_nest(23, 633776380932543); centre_of_healpix_nest ---------------------------- (2.39383524 , -1.47013318) (1 row) select centre_of_healpix_ring(10, 10559717); centre_of_healpix_ring ---------------------------- (4.51174551 , -0.74542263) (1 row) select centre_of_healpix_nest(27, 174358006860603648); centre_of_healpix_nest ---------------------------- (1.81738645 , -0.60896621) (1 row) select centre_of_healpix_ring(7, 95598); centre_of_healpix_ring ---------------------------- (1.34990309 , 0.026044611) (1 row) select centre_of_healpix_ring(25, 12720646885101360); centre_of_healpix_ring --------------------------- (4.5723578 , -1.08228823) (1 row) select centre_of_healpix_nest(17, 32055127047); centre_of_healpix_nest --------------------------- (2.88763792 , 1.26020491) (1 row) select centre_of_healpix_ring(19, 1507606380069); centre_of_healpix_ring ----------------------------- (1.52028581 , 0.0859989615) (1 row) select centre_of_healpix_ring(28, 164123870569021440); centre_of_healpix_ring ---------------------------- (1.22018585 , 0.669236414) (1 row) select centre_of_healpix_nest(27, 172300653110093568); centre_of_healpix_nest ----------------------------- (2.06807949 , -0.909021311) (1 row) select centre_of_healpix_ring(22, 6910463642626); centre_of_healpix_ring --------------------------- (5.57649407 , 1.20693882) (1 row) select centre_of_healpix_nest(26, 22492624630493760); centre_of_healpix_nest ------------------------------- (-0.0761942975 , 0.617002784) (1 row) select centre_of_healpix_nest(25, 6659060140801344); centre_of_healpix_nest ---------------------------- (1.23550824 , 0.314553088) (1 row) select centre_of_healpix_ring(20, 2203649323698); centre_of_healpix_ring ---------------------------- (2.76833498 , 0.728787201) (1 row) select centre_of_healpix_nest(9, 2235150); centre_of_healpix_nest ------------------------------ (0.332283838 , -0.938368604) (1 row) select centre_of_healpix_nest(11, 10617249); centre_of_healpix_nest ---------------------------- (3.43803444 , 0.440544779) (1 row) select centre_of_healpix_ring(17, 64938630037); centre_of_healpix_ring ----------------------------- (0.673669235 , 0.379020189) (1 row) select centre_of_healpix_ring(11, 40883797); centre_of_healpix_ring ----------------------------- (1.24329143 , -0.674714602) (1 row) select centre_of_healpix_nest(12, 19282855); centre_of_healpix_nest ---------------------------- (2.20087894 , 0.331734651) (1 row) select centre_of_healpix_nest(23, 623780293601457); centre_of_healpix_nest ---------------------------- (1.0528165 , -0.260632293) (1 row) select centre_of_healpix_ring(9, 3072501); centre_of_healpix_ring ----------------------------- (0.966327583 , -1.26501492) (1 row) select centre_of_healpix_ring(8, 307021); centre_of_healpix_ring ---------------------------- (2.04633037 , 0.220533261) (1 row) select centre_of_healpix_nest(27, 151738271099917824); centre_of_healpix_nest ----------------------------- (1.02420678 , -0.678071198) (1 row) select centre_of_healpix_ring(23, 538441050048837); centre_of_healpix_ring ----------------------------- (1.63566797 , -0.278885736) (1 row) select centre_of_healpix_ring(8, 575044); centre_of_healpix_ring ------------------------------ (0.420310736 , -0.481988066) (1 row) select centre_of_healpix_nest(6, 30763); centre_of_healpix_nest ----------------------------- (4.24605882 , -0.241936663) (1 row) select centre_of_healpix_nest(17, 52812136219); centre_of_healpix_nest ---------------------------- (5.64966323 , 0.284974538) (1 row) select centre_of_healpix_ring(22, 40208698630502); centre_of_healpix_ring --------------------------- (4.39038709 , 0.66755376) (1 row) select centre_of_healpix_ring(5, 8535); centre_of_healpix_ring ----------------------------- (1.12900986 , -0.406975126) (1 row) select centre_of_healpix_ring(23, 232628212281579); centre_of_healpix_ring ---------------------------- (3.00894732 , 0.465674644) (1 row) select centre_of_healpix_ring(7, 110204); centre_of_healpix_ring ---------------------------- (4.6633016 , -0.120080035) (1 row) select centre_of_healpix_nest(13, 622800234); centre_of_healpix_nest ---------------------------- (2.9407492 , -0.877652952) (1 row) select centre_of_healpix_ring(8, 585024); centre_of_healpix_ring ----------------------------- (5.10508806 , -0.508627753) (1 row) select centre_of_healpix_ring(9, 2601756); centre_of_healpix_ring ----------------------------- (5.58522405 , -0.712391904) (1 row) select centre_of_healpix_ring(13, 746326751); centre_of_healpix_ring ----------------------------- (0.301864819 , -1.02275549) (1 row) select centre_of_healpix_nest(25, 1757052529154064); centre_of_healpix_nest ---------------------------- (1.94068428 , 0.657065615) (1 row) select centre_of_healpix_nest(8, 32662); centre_of_healpix_nest -------------------------- (1.4671674 , 1.10738145) (1 row) select centre_of_healpix_ring(26, 117149321094336); centre_of_healpix_ring --------------------------- (5.82315565 , 1.47764557) (1 row) select centre_of_healpix_ring(26, 15298421910153600); centre_of_healpix_ring ---------------------------- (1.40537507 , 0.448755572) (1 row) select centre_of_healpix_nest(14, 2518871769); centre_of_healpix_nest ----------------------------- (2.50993989 , -0.858544967) (1 row) select centre_of_healpix_ring(17, 103077161842); centre_of_healpix_ring ------------------------------- (3.66758628 , 2.03450521e-05) (1 row) select centre_of_healpix_nest(27, 63784668416739072); centre_of_healpix_nest --------------------------- (4.97216147 , 0.53189801) (1 row) select centre_of_healpix_nest(18, 631098472239); centre_of_healpix_nest ---------------------------- (2.05654731 , -1.04133181) (1 row) select centre_of_healpix_ring(13, 48600095); centre_of_healpix_ring ----------------------------- (0.0495454014 , 1.07434059) (1 row) select centre_of_healpix_nest(23, 400344733238772); centre_of_healpix_nest ----------------------------- (1.20063227 , 0.0456150393) (1 row) select centre_of_healpix_nest(10, 4023574); centre_of_healpix_nest --------------------------- (6.06115929 , 1.15314016) (1 row) select centre_of_healpix_ring(15, 12166851947); centre_of_healpix_ring ---------------------------- (3.42904971 , -1.09416058) (1 row) select centre_of_healpix_ring(12, 35645541); centre_of_healpix_ring ----------------------------- (0.824322926 , 0.702114276) (1 row) select centre_of_healpix_nest(25, 6029463767298432); centre_of_healpix_nest ----------------------------- (2.01209762 , 0.0254930651) (1 row) select centre_of_healpix_ring(23, 293379976031151); centre_of_healpix_ring ----------------------------- (0.802832027 , 0.310081868) (1 row) select centre_of_healpix_nest(8, 425016); centre_of_healpix_nest ---------------------------- (3.52815581 , 0.196576077) (1 row) select centre_of_healpix_ring(24, 1819410423699780); centre_of_healpix_ring ------------------------------ (3.14986818 , -0.0773845948) (1 row) select centre_of_healpix_ring(18, 248548350469); centre_of_healpix_ring ---------------------------- (4.26143159 , 0.408454416) (1 row) select centre_of_healpix_ring(21, 21784662328254); centre_of_healpix_ring ---------------------------- (3.89089321 , 0.175354197) (1 row) select centre_of_healpix_ring(24, 1919910867680472); centre_of_healpix_ring ----------------------------- (5.13415805 , -0.137246054) (1 row) select centre_of_healpix_nest(11, 49569053); centre_of_healpix_nest ---------------------------- (5.77582116 , -0.42048486) (1 row) select centre_of_healpix_ring(4, 2302); centre_of_healpix_ring ---------------------------- (2.9943305 , -0.523598776) (1 row) select centre_of_healpix_ring(18, 755357167125); centre_of_healpix_ring ----------------------------- (5.57471324 , -0.982669795) (1 row) select centre_of_healpix_nest(14, 2953072407); centre_of_healpix_nest ---------------------------- (6.17881696 , -1.53366712) (1 row) select centre_of_healpix_nest(7, 120833); centre_of_healpix_nest ----------------------------- (4.91487444 , -0.156892871) (1 row) select centre_of_healpix_nest(23, 412827339199236); centre_of_healpix_nest ---------------------------- (1.82261504 , 0.455859386) (1 row) select centre_of_healpix_ring(22, 5521330266978); centre_of_healpix_ring --------------------------- (2.77830455 , 1.24592388) (1 row) select centre_of_healpix_nest(27, 168370330808286720); centre_of_healpix_nest ----------------------------- (2.83275322 , -0.774333961) (1 row) select centre_of_healpix_nest(17, 83339807644); centre_of_healpix_nest ----------------------------- (0.158551295 , 0.363159778) (1 row) select centre_of_healpix_nest(6, 9178); centre_of_healpix_nest ---------------------------- (3.93926266 , 0.622826585) (1 row) select centre_of_healpix_nest(10, 499837); centre_of_healpix_nest ---------------------------- (1.10440557 , 0.913147232) (1 row) select centre_of_healpix_nest(27, 114801840312943104); centre_of_healpix_nest ---------------------------- (3.73744972 , 0.130639461) (1 row) select centre_of_healpix_ring(8, 359324); centre_of_healpix_ring ----------------------------- (2.52800034 , 0.0860436315) (1 row) select centre_of_healpix_nest(8, 243307); centre_of_healpix_nest ---------------------------- (5.04546359 , 0.951777289) (1 row) select centre_of_healpix_ring(13, 331571919); centre_of_healpix_ring ---------------------------- (1.70866285 , 0.177443375) (1 row) select centre_of_healpix_ring(4, 996); centre_of_healpix_ring ----------------------------- (0.441786467 , 0.339836909) (1 row) select centre_of_healpix_nest(22, 152304766469933); centre_of_healpix_nest ------------------------------ (0.0903871962 , -0.78824168) (1 row) select centre_of_healpix_ring(23, 213842515389360); centre_of_healpix_ring ----------------------------- (0.526715766 , 0.516131359) (1 row) select centre_of_healpix_ring(25, 7605691185820272); centre_of_healpix_ring ----------------------------- (4.24282832 , -0.126203204) (1 row) select centre_of_healpix_ring(17, 17344372343); centre_of_healpix_ring ----------------------------- (0.461219537 , 0.982227183) (1 row) select centre_of_healpix_ring(28, 552893874565555200); centre_of_healpix_ring ----------------------------- (1.56778229 , -0.282569306) (1 row) select centre_of_healpix_ring(8, 163219); centre_of_healpix_ring ---------------------------- (5.61436968 , 0.626036473) (1 row) select centre_of_healpix_nest(28, 856163252610493440); centre_of_healpix_nest ----------------------------- (5.32613578 , -0.419481498) (1 row) select centre_of_healpix_ring(8, 673143); centre_of_healpix_ring ----------------------------- (3.13829266 , -0.792191037) (1 row) select centre_of_healpix_nest(26, 48909027540191040); centre_of_healpix_nest ----------------------------- (4.10552628 , -0.322557278) (1 row) select centre_of_healpix_ring(22, 64899608502222); centre_of_healpix_ring ---------------------------- (3.83800139 , 0.395367553) (1 row) select centre_of_healpix_ring(9, 768037); centre_of_healpix_ring ---------------------------- (3.25510723 , 0.537184118) (1 row) select centre_of_healpix_ring(21, 32654589766489); centre_of_healpix_ring ------------------------------- (-0.335299513 , -0.239755926) (1 row) select centre_of_healpix_nest(9, 1053660); centre_of_healpix_nest ------------------------------ (0.104310694 , -0.534155758) (1 row) select centre_of_healpix_nest(13, 96616303); centre_of_healpix_nest ---------------------------- (2.74863834 , 0.783888651) (1 row) select centre_of_healpix_nest(19, 575871286060); centre_of_healpix_nest --------------------------- (4.05943448 , 0.29062509) (1 row) select centre_of_healpix_ring(25, 2625975271359840); centre_of_healpix_ring ---------------------------- (5.68499724 , 0.657673883) (1 row) select centre_of_healpix_ring(6, 21866); centre_of_healpix_ring ----------------------------- (-0.539961237 , 0.11483556) (1 row) select centre_of_healpix_nest(27, 108902701335429120); centre_of_healpix_nest ----------------------------- (3.02615611 , -0.475646986) (1 row) select centre_of_healpix_nest(24, 1747788089627100); centre_of_healpix_nest ----------------------------- (3.26506406 , -0.167985505) (1 row) select centre_of_healpix_nest(25, 9387397184945568); centre_of_healpix_nest --------------------------- (1.4454594 , -0.72233534) (1 row) select centre_of_healpix_nest(16, 21290390211); centre_of_healpix_nest ----------------------------- (0.149371379 , 0.481655163) (1 row) select centre_of_healpix_ring(23, 602118262698276); centre_of_healpix_ring ------------------------------ (0.505501348 , -0.440180271) (1 row) select centre_of_healpix_ring(22, 121019813893770); centre_of_healpix_ring ----------------------------- (3.25420018 , -0.147059483) (1 row) select centre_of_healpix_ring(23, 670925558888478); centre_of_healpix_ring ----------------------------- (1.91096228 , -0.629908667) (1 row) select centre_of_healpix_nest(8, 476579); centre_of_healpix_nest ----------------------------- (5.21553468 , -0.170089779) (1 row) select centre_of_healpix_nest(21, 1296612819316); centre_of_healpix_nest ---------------------------- (1.10126413 , 0.582484751) (1 row) select centre_of_healpix_nest(18, 744415163816); centre_of_healpix_nest ----------------------------- (4.25459758 , -0.361503471) (1 row) select centre_of_healpix_ring(7, 158513); centre_of_healpix_ring ------------------------------ (0.607456392 , -0.661857664) (1 row) select centre_of_healpix_nest(26, 8283332720144448); centre_of_healpix_nest --------------------------- (2.89059046 , 1.18574065) (1 row) select centre_of_healpix_nest(8, 443510); centre_of_healpix_nest ---------------------------- (3.26737908 , 0.135833991) (1 row) select centre_of_healpix_ring(20, 10243296680507); centre_of_healpix_ring ----------------------------- (4.64881791 , -0.585605216) (1 row) select centre_of_healpix_nest(14, 524948749); centre_of_healpix_nest --------------------------- (2.56426974 , 1.30800842) (1 row) select centre_of_healpix_nest(8, 268356); centre_of_healpix_nest ------------------------------ (0.128854386 , -0.398483204) (1 row) select centre_of_healpix_ring(25, 9927317814361344); centre_of_healpix_ring ------------------------------- (-0.080569944 , -0.488767699) (1 row) select centre_of_healpix_nest(8, 420848); centre_of_healpix_nest ----------------------------- (3.23976742 , 0.0651502458) (1 row) select centre_of_healpix_nest(18, 91891787035); centre_of_healpix_nest ---------------------------- (3.02918662 , 0.724475301) (1 row) select centre_of_healpix_nest(7, 190630); centre_of_healpix_nest ---------------------------- (4.7474514 , -0.840222582) (1 row) select centre_of_healpix_ring(14, 700837772); centre_of_healpix_ring ---------------------------- (2.73782015 , 0.600263617) (1 row) select centre_of_healpix_ring(16, 7300830501); centre_of_healpix_ring ---------------------------- (1.04558998 , 0.799040629) (1 row) select centre_of_healpix_ring(6, 31387); centre_of_healpix_ring --------------------------- (0.6626797 , -0.28509644) (1 row) select centre_of_healpix_nest(12, 131514460); centre_of_healpix_nest ---------------------------- (4.96012688 , 0.342773207) (1 row) select centre_of_healpix_nest(28, 724400904310972416); centre_of_healpix_nest ---------------------------- (4.03223505 , -1.26273169) (1 row) select centre_of_healpix_nest(20, 6284135401219); centre_of_healpix_nest --------------------------- (1.2612438 , 0.185760792) (1 row) select centre_of_healpix_ring(21, 19581388019467); centre_of_healpix_ring ---------------------------- (5.36721527 , 0.260901263) (1 row) select centre_of_healpix_ring(17, 40559382784); centre_of_healpix_ring ---------------------------- (2.40834984 , 0.651678283) (1 row) select centre_of_healpix_ring(26, 16374282674949888); centre_of_healpix_ring --------------------------- (5.6125421 , 0.405012029) (1 row) select centre_of_healpix_ring(16, 21632474274); centre_of_healpix_ring --------------------------- (5.2807768 , 0.161250874) (1 row) select centre_of_healpix_nest(13, 151449648); centre_of_healpix_nest ---------------------------- (4.34423359 , 0.442074833) (1 row) select centre_of_healpix_ring(17, 42728762216); centre_of_healpix_ring ----------------------------- (0.918566871 , 0.625465423) (1 row) select centre_of_healpix_nest(28, 352305614184480768); centre_of_healpix_nest ----------------------------- (-0.22612622 , 0.291978139) (1 row) select centre_of_healpix_nest(21, 20095018204721); centre_of_healpix_nest -------------------------------- (-0.183891565 , -0.0767475569) (1 row) select centre_of_healpix_ring(10, 11340177); centre_of_healpix_ring ----------------------------- (1.45418264 , -0.931653257) (1 row) select centre_of_healpix_nest(26, 32893681947418176); centre_of_healpix_nest ------------------------------ (5.14556394 , -0.0746361856) (1 row) select centre_of_healpix_ring(15, 6287458078); centre_of_healpix_ring -------------------------------- (-0.0108337393 , 0.0240705209) (1 row) select centre_of_healpix_ring(23, 595068892059339); centre_of_healpix_ring ----------------------------- (2.91565612 , -0.421803193) (1 row) select centre_of_healpix_ring(8, 554008); centre_of_healpix_ring ----------------------------- (3.28885481 , -0.421198138) (1 row) select centre_of_healpix_ring(11, 24063730); centre_of_healpix_ring ------------------------------- (-0.207087406 , 0.0439594693) (1 row) select centre_of_healpix_nest(27, 175949729925654528); centre_of_healpix_nest ---------------------------- (2.47666909 , -0.57256852) (1 row) select centre_of_healpix_nest(25, 9751323561149424); centre_of_healpix_nest ------------------------------ (0.134307251 , -0.749587792) (1 row) select centre_of_healpix_ring(22, 76010226825232); centre_of_healpix_ring ----------------------------- (0.434889545 , 0.283675783) (1 row) select centre_of_healpix_ring(17, 192235443426); centre_of_healpix_ring ---------------------------- (5.87914334 , -1.04500658) (1 row) select centre_of_healpix_nest(25, 13353203720119488); centre_of_healpix_nest ----------------------------- (5.67291787 , -0.317564339) (1 row) select centre_of_healpix_nest(4, 188); centre_of_healpix_nest ---------------------------- (0.214199499 , 1.00181067) (1 row) select centre_of_healpix_ring(17, 150113787375); centre_of_healpix_ring ----------------------------- (5.19692318 , -0.473825595) (1 row) select centre_of_healpix_ring(28, 575022982193206272); centre_of_healpix_ring ----------------------------- (4.64482792 , -0.336311861) (1 row) select centre_of_healpix_nest(23, 38337620048880); centre_of_healpix_nest ---------------------------- (0.31138312 , 0.582041438) (1 row) select centre_of_healpix_nest(18, 105399907547); centre_of_healpix_nest ---------------------------- (1.83704386 , 0.475183618) (1 row) select centre_of_healpix_ring(10, 3599087); centre_of_healpix_ring ---------------------------- (1.15201957 , 0.441984799) (1 row) select centre_of_healpix_nest(17, 37005340465); centre_of_healpix_nest --------------------------- (3.8399434 , 0.386032339) (1 row) select centre_of_healpix_nest(25, 8529145197921600); centre_of_healpix_nest ------------------------------ (4.54335579 , -0.0467204728) (1 row) select centre_of_healpix_ring(8, 206512); centre_of_healpix_ring ---------------------------- (1.08299044 , 0.493780678) (1 row) select centre_of_healpix_ring(4, 1640); centre_of_healpix_ring ------------------------------- (0.834485549 , -0.0834300866) (1 row) select centre_of_healpix_ring(24, 91000974883188); centre_of_healpix_ring --------------------------- (2.59554689 , 1.24102555) (1 row) select centre_of_healpix_ring(28, 655076657276510208); centre_of_healpix_ring ----------------------------- (3.30031173 , -0.541204981) (1 row) select centre_of_healpix_nest(8, 354326); centre_of_healpix_nest ------------------------------ (1.68431091 , -0.0625407618) (1 row) select centre_of_healpix_ring(28, 437289273741232128); centre_of_healpix_ring ------------------------------ (4.85323958 , -0.0114348738) (1 row) select centre_of_healpix_nest(10, 1810016); centre_of_healpix_nest ---------------------------- (1.73127687 , 0.972671223) (1 row) select centre_of_healpix_nest(16, 5043389430); centre_of_healpix_nest ---------------------------- (2.14758509 , 0.385055261) (1 row) select centre_of_healpix_nest(20, 4890174394743); centre_of_healpix_nest ----------------------------- (0.340898768 , 0.082269617) (1 row) select centre_of_healpix_ring(16, 7585288994); centre_of_healpix_ring --------------------------- (5.9698244 , 0.783349041) (1 row) select centre_of_healpix_nest(7, 35117); centre_of_healpix_nest ---------------------------- (3.81040828 , 0.306877333) (1 row) select centre_of_healpix_nest(23, 469154380672512); centre_of_healpix_nest ----------------------------- (2.40916926 , 0.0086887976) (1 row) select centre_of_healpix_ring(21, 51124579290395); centre_of_healpix_ring ---------------------------- (5.64484838 , -1.21507981) (1 row) select centre_of_healpix_nest(21, 43061741590241); centre_of_healpix_nest ----------------------------- (2.19357343 , -0.533491813) (1 row) select centre_of_healpix_nest(6, 45011); centre_of_healpix_nest ----------------------------- (3.9760782 , -0.0938878751) (1 row) select centre_of_healpix_ring(10, 11818725); centre_of_healpix_ring ---------------------------- (2.28121311 , -1.07290096) (1 row) select centre_of_healpix_nest(7, 82812); centre_of_healpix_nest ----------------------------- (1.61988371 , -0.401310437) (1 row) select centre_of_healpix_nest(11, 2973688); centre_of_healpix_nest ----------------------------- (0.478045328 , 0.973088407) (1 row) select centre_of_healpix_nest(26, 13177197635570496); centre_of_healpix_nest -------------------------- (3.5737814 , 1.22535151) (1 row) select centre_of_healpix_ring(7, 104005); centre_of_healpix_ring ------------------------------ (3.98835005 , -0.0573230548) (1 row) select centre_of_healpix_nest(13, 515003732); centre_of_healpix_nest ----------------------------- (4.12314861 , 0.0415972816) (1 row) select centre_of_healpix_ring(23, 616923614077794); centre_of_healpix_ring ----------------------------- (5.87684265 , -0.479311767) (1 row) select centre_of_healpix_nest(12, 145580625); centre_of_healpix_nest ----------------------------- (0.25713353 , -0.629656527) (1 row) select centre_of_healpix_nest(13, 221832964); centre_of_healpix_nest ---------------------------- (5.83852263 , 0.610357939) (1 row) select centre_of_healpix_nest(27, 43743530156299008); centre_of_healpix_nest ---------------------------- (4.15874605 , 0.830677204) (1 row) select centre_of_healpix_ring(6, 11149); centre_of_healpix_ring ---------------------------- (0.33133985 , 0.572418572) (1 row) select centre_of_healpix_ring(24, 1986386821013076); centre_of_healpix_ring ----------------------------- (4.48148485 , -0.177101611) (1 row) select centre_of_healpix_nest(22, 89030521328388); centre_of_healpix_nest ----------------------------- (1.55676317 , -0.393570634) (1 row) select centre_of_healpix_nest(7, 104492); centre_of_healpix_nest ---------------------------- (3.3133985 , -0.120080035) (1 row) select centre_of_healpix_ring(24, 1890512933187240); centre_of_healpix_ring ----------------------------- (2.86812842 , -0.119694127) (1 row) select centre_of_healpix_ring(11, 42718289); centre_of_healpix_ring ----------------------------- (2.69354132 , -0.771894998) (1 row) select centre_of_healpix_ring(11, 37314260); centre_of_healpix_ring ----------------------------- (2.91149554 , -0.503789167) (1 row) select centre_of_healpix_ring(7, 16319); centre_of_healpix_ring ---------------------------- (5.22726111 , 0.988505591) (1 row) select centre_of_healpix_ring(16, 17063806146); centre_of_healpix_ring ---------------------------- (4.74158255 , 0.344620763) (1 row) select centre_of_healpix_nest(19, 482933093069); centre_of_healpix_nest ---------------------------- (2.41960897 , 0.849454938) (1 row) select centre_of_healpix_nest(13, 17886230); centre_of_healpix_nest ---------------------------- (1.27061546 , 0.465162127) (1 row) select centre_of_healpix_ring(14, 1659230217); centre_of_healpix_ring ------------------------------ (2.16075575 , -0.0301966462) (1 row) select centre_of_healpix_nest(23, 556582830569202); centre_of_healpix_nest ---------------------------- (4.43278643 , 0.316652147) (1 row) select centre_of_healpix_nest(10, 9747713); centre_of_healpix_nest ----------------------------- (2.72671762 , -0.879348224) (1 row) select centre_of_healpix_ring(27, 53474052047600640); centre_of_healpix_ring ----------------------------- (0.981352231 , 0.529689753) (1 row) select centre_of_healpix_ring(9, 64472); centre_of_healpix_ring ---------------------------- (0.283616003 , 1.28275199) (1 row) select centre_of_healpix_nest(28, 230638103844280320); centre_of_healpix_nest ---------------------------- (5.51516961 , 0.471282472) (1 row) select centre_of_healpix_nest(26, 6737794664028480); centre_of_healpix_nest -------------------------- (2.9660207 , 1.10521615) (1 row) select centre_of_healpix_ring(27, 88027640762867712); centre_of_healpix_ring --------------------------- (3.5512614 , 0.186662816) (1 row) select centre_of_healpix_ring(11, 47786973); centre_of_healpix_ring ---------------------------- (3.27179607 , -1.11720685) (1 row) select centre_of_healpix_nest(7, 69760); centre_of_healpix_nest ------------------------------ (0.343611696 , -0.290528204) (1 row) select centre_of_healpix_nest(18, 63097617165); centre_of_healpix_nest --------------------------- (0.15942855 , 1.17900295) (1 row) select centre_of_healpix_nest(25, 6285710215264320); centre_of_healpix_nest ------------------------------ (1.52950112 , -0.0121454801) (1 row) select centre_of_healpix_ring(6, 13394); centre_of_healpix_ring ---------------------------- (5.16644729 , 0.476119061) (1 row) select centre_of_healpix_ring(26, 22939779420643200); centre_of_healpix_ring ---------------------------- (1.41106759 , 0.151638084) (1 row) select centre_of_healpix_ring(9, 266389); centre_of_healpix_ring ---------------------------- (2.88122778 , 0.980176464) (1 row) select centre_of_healpix_nest(27, 122009553180272640); centre_of_healpix_nest ---------------------------- (3.29996287 , 0.190039106) (1 row) select centre_of_healpix_nest(16, 24853447555); centre_of_healpix_nest ---------------------------- (1.53541889 , 0.161292099) (1 row) select centre_of_healpix_ring(9, 2529982); centre_of_healpix_ring ----------------------------- (5.29530168 , -0.653630907) (1 row) select centre_of_healpix_ring(17, 192098743383); centre_of_healpix_ring --------------------------- (2.12705914 , -1.0423741) (1 row) select centre_of_healpix_nest(5, 7854); centre_of_healpix_nest ----------------------------- (4.00062189 , 0.0416787324) (1 row) select centre_of_healpix_nest(18, 785919798058); centre_of_healpix_nest ----------------------------- (5.69881353 , -0.557747642) (1 row) select centre_of_healpix_nest(8, 395617); centre_of_healpix_nest ----------------------------- (3.10784508 , -0.529623355) (1 row) select centre_of_healpix_nest(6, 6044); centre_of_healpix_nest ---------------------------- (2.82409127 , 0.961814935) (1 row) select centre_of_healpix_nest(21, 34513392528579); centre_of_healpix_nest ---------------------------- (4.81135471 , 0.322717256) (1 row) select centre_of_healpix_nest(18, 148005059466); centre_of_healpix_nest ---------------------------- (3.86473576 , 0.387767884) (1 row) select centre_of_healpix_nest(8, 715649); centre_of_healpix_nest ----------------------------- (3.61099077 , -0.312345682) (1 row) select centre_of_healpix_nest(23, 351381100291209); centre_of_healpix_nest -------------------------------- (-0.00990280847 , 0.614844491) (1 row) select centre_of_healpix_nest(25, 4783646356031808); centre_of_healpix_nest --------------------------------- (-0.0357701025 , -0.0374297869) (1 row) select centre_of_healpix_ring(22, 85496057792022); centre_of_healpix_ring ---------------------------- (4.11165218 , 0.191181147) (1 row) select centre_of_healpix_nest(19, 1207760446960); centre_of_healpix_nest ------------------------------- (0.305621704 , -0.0291267887) (1 row) select centre_of_healpix_ring(12, 4537051); centre_of_healpix_ring -------------------------- (4.16323608 , 1.2694514) (1 row) select centre_of_healpix_ring(25, 10113085274651520); centre_of_healpix_ring ----------------------------- (2.65373283 , -0.520181168) (1 row) select centre_of_healpix_ring(9, 59013); centre_of_healpix_ring --------------------------- (1.73061572 , 1.29563729) (1 row) select centre_of_healpix_ring(21, 18299648502817); centre_of_healpix_ring ---------------------------- (3.75137511 , 0.311538711) (1 row) select centre_of_healpix_nest(25, 522136150124304); centre_of_healpix_nest --------------------------- (1.3448217 , 0.958163886) (1 row) select centre_of_healpix_ring(27, 58005231034801152); centre_of_healpix_ring ---------------------------- (4.50500197 , 0.481764783) (1 row) select centre_of_healpix_ring(16, 21324213405); centre_of_healpix_ring ------------------------------ (-0.511654498 , 0.173383265) (1 row) select centre_of_healpix_ring(18, 681197524109); centre_of_healpix_ring ------------------------------ (0.522398356 , -0.710380786) (1 row) select centre_of_healpix_nest(4, 2747); centre_of_healpix_nest ----------------------------- (3.43611696 , -0.476119061) (1 row) select centre_of_healpix_ring(12, 63242546); centre_of_healpix_ring -------------------------- (3.25913393 , 0.3808878) (1 row) select centre_of_healpix_nest(23, 266330939391735); centre_of_healpix_nest ---------------------------- (5.35034895 , 0.915356422) (1 row) select centre_of_healpix_nest(9, 2527310); centre_of_healpix_nest ----------------------------- (1.82409573 , -0.816263948) (1 row) select centre_of_healpix_nest(6, 10625); centre_of_healpix_nest ---------------------------- (3.64473835 , 0.648719678) (1 row) select centre_of_healpix_ring(12, 108698312); centre_of_healpix_ring -------------------------------- (-0.512157836 , -0.0798373912) (1 row) select centre_of_healpix_ring(13, 448405209); centre_of_healpix_ring ----------------------------- (4.65591931 , -0.113852579) (1 row) select centre_of_healpix_ring(28, 171484986911913984); centre_of_healpix_ring ----------------------------- (0.117529297 , 0.647709373) (1 row) select centre_of_healpix_nest(9, 2931469); centre_of_healpix_nest ---------------------------- (5.11472485 , -1.04487756) (1 row) select centre_of_healpix_nest(11, 48351965); centre_of_healpix_nest ----------------------------- (5.10216111 , -0.917358217) (1 row) select centre_of_healpix_ring(9, 2852237); centre_of_healpix_ring ----------------------------- (2.68019687 , -0.950102789) (1 row) select centre_of_healpix_ring(9, 2124465); centre_of_healpix_ring ----------------------------- (5.25541818 , -0.357849118) (1 row) select centre_of_healpix_ring(20, 7920766156877); centre_of_healpix_ring ----------------------------- (1.96361151 , -0.202020615) (1 row) select centre_of_healpix_ring(15, 9477540416); centre_of_healpix_ring ----------------------------- (2.48200488 , -0.490548782) (1 row) select centre_of_healpix_ring(5, 5817); centre_of_healpix_ring ------------------------------- (-0.343611696 , 0.0625407618) (1 row) select centre_of_healpix_ring(25, 364214521001568); centre_of_healpix_ring -------------------------- (5.12921686 , 1.2409293) (1 row) select centre_of_healpix_nest(9, 1500146); centre_of_healpix_nest ---------------------------- (1.07838849 , 0.159529974) (1 row) select centre_of_healpix_nest(9, 318689); centre_of_healpix_nest ---------------------------- (2.44976732 , 0.557004462) (1 row) select centre_of_healpix_nest(24, 3013812035436828); centre_of_healpix_nest ----------------------------- (3.67499946 , -0.555996952) (1 row) select centre_of_healpix_ring(15, 8625053502); centre_of_healpix_ring ----------------------------- (2.73961778 , -0.345626088) (1 row) select centre_of_healpix_nest(23, 301762129114665); centre_of_healpix_nest ----------------------------- (0.34572195 , -0.150742801) (1 row) select centre_of_healpix_ring(14, 1360364144); centre_of_healpix_ring ------------------------------ (0.0598731876 , 0.155986622) (1 row) select centre_of_healpix_ring(21, 28831684353487); centre_of_healpix_ring ------------------------------- (0.680667273 , -0.0927272911) (1 row) select centre_of_healpix_nest(7, 104120); centre_of_healpix_nest ----------------------------- (3.57110727 , 0.0156256359) (1 row) select centre_of_healpix_ring(14, 2059339503); centre_of_healpix_ring ----------------------------- (3.31176865 , -0.282341441) (1 row) select centre_of_healpix_nest(22, 24116353817334); centre_of_healpix_nest ---------------------------- (2.99975138 , 0.871054816) (1 row) select centre_of_healpix_ring(8, 331229); centre_of_healpix_ring ----------------------------- (-0.21475731 , 0.159529974) (1 row) select centre_of_healpix_ring(5, 1301); centre_of_healpix_ring ----------------------------- (0.090622865 , 0.894582592) (1 row) select centre_of_healpix_ring(6, 32102); centre_of_healpix_ring ---------------------------- (5.6450493 , -0.306877333) (1 row) select centre_of_healpix_ring(12, 78593144); centre_of_healpix_ring -------------------------- (2.794913 , 0.221033689) (1 row) select centre_of_healpix_nest(4, 1274); centre_of_healpix_nest ------------------------------ (-0.147262156 , 0.523598776) (1 row) select centre_of_healpix_nest(26, 2951121583832448); centre_of_healpix_nest ----------------------------- (0.260351866 , 0.789397131) (1 row) select centre_of_healpix_ring(8, 177721); centre_of_healpix_ring ----------------------------- (0.352815581 , 0.578627051) (1 row) select centre_of_healpix_ring(15, 5126307896); centre_of_healpix_ring ---------------------------- (0.78808263 , 0.205732909) (1 row) select centre_of_healpix_nest(8, 336496); centre_of_healpix_nest ----------------------------- (1.34990309 , -0.426912623) (1 row) select centre_of_healpix_ring(5, 1433); centre_of_healpix_ring ---------------------------- (1.71624043 , 0.867470357) (1 row) select centre_of_healpix_nest(4, 2205); centre_of_healpix_nest ------------------------------ (0.638136008 , -0.622826585) (1 row) select centre_of_healpix_ring(8, 433554); centre_of_healpix_ring ----------------------------- (5.60823376 , -0.101737917) (1 row) select centre_of_healpix_nest(28, 763891381271079936); centre_of_healpix_nest ----------------------------- (3.66829241 , -0.707068264) (1 row) select centre_of_healpix_nest(4, 552); centre_of_healpix_nest ---------------------------- (3.63246651 , 0.295968803) (1 row) select centre_of_healpix_ring(16, 36844526833); centre_of_healpix_ring ----------------------------- (1.35567949 , -0.444225531) (1 row) select centre_of_healpix_nest(28, 304600187742953472); centre_of_healpix_nest ------------------------------- (-0.163923786 , -0.192224989) (1 row) select centre_of_healpix_ring(4, 1070); centre_of_healpix_ring ---------------------------- (1.37444679 , 0.295968803) (1 row) select centre_of_healpix_ring(14, 1439319910); centre_of_healpix_ring ---------------------------- (4.89402189 , 0.106565515) (1 row) select centre_of_healpix_nest(26, 51738357988210752); centre_of_healpix_nest ----------------------------- (5.89052489 , -0.439398918) (1 row) select centre_of_healpix_ring(24, 3357764546304816); centre_of_healpix_ring ---------------------------- (5.82497848 , -1.41699585) (1 row) select centre_of_healpix_nest(14, 497728405); centre_of_healpix_nest --------------------------- (2.36539232 , 1.16373015) (1 row) select centre_of_healpix_nest(5, 153); centre_of_healpix_nest --------------------------- (0.6626797 , 0.339836909) (1 row) select centre_of_healpix_ring(15, 5946373304); centre_of_healpix_ring ----------------------------- (4.57394721 , 0.0770823326) (1 row) select centre_of_healpix_ring(28, 696282245114216448); centre_of_healpix_ring ----------------------------- (4.26513771 , -0.656661698) (1 row) select centre_of_healpix_nest(10, 8775651); centre_of_healpix_nest ----------------------------- (1.34683513 , -0.604510478) (1 row) select centre_of_healpix_ring(7, 33605); centre_of_healpix_ring ---------------------------- (0.852893318 , 0.71583806) (1 row) select centre_of_healpix_nest(28, 546743161722971136); centre_of_healpix_nest ------------------------------- (4.57731768 , 0.000271084411) (1 row) select centre_of_healpix_ring(19, 1530804674464); centre_of_healpix_ring ------------------------------ (0.318780382 , 0.0718888391) (1 row) select centre_of_healpix_nest(5, 11024); centre_of_healpix_nest ----------------------------- (4.02516559 , -0.597406417) (1 row) select centre_of_healpix_nest(18, 638767380106); centre_of_healpix_nest ----------------------------- (2.69835908 , -0.900298117) (1 row) select centre_of_healpix_nest(18, 200627300011); centre_of_healpix_nest --------------------------- (3.30609818 , 1.21003428) (1 row) select centre_of_healpix_ring(24, 2465246686601184); centre_of_healpix_ring ----------------------------- (4.77297827 , -0.477679047) (1 row) select centre_of_healpix_ring(16, 49149556174); centre_of_healpix_ring --------------------------- (2.23936967 , -1.1367097) (1 row) select centre_of_healpix_ring(7, 64840); centre_of_healpix_ring ----------------------------- (0.883572934 , 0.345366615) (1 row) select centre_of_healpix_nest(18, 548367336389); centre_of_healpix_nest ---------------------------- (4.57779115 , 0.546076076) (1 row) select centre_of_healpix_ring(15, 8439007258); centre_of_healpix_ring ------------------------------- (0.0994211298 , -0.315104869) (1 row) select centre_of_healpix_ring(10, 5853741); centre_of_healpix_ring ---------------------------- (3.99601995 , 0.069717923) (1 row) select centre_of_healpix_nest(25, 11843978463310176); centre_of_healpix_nest ----------------------------- (3.57069489 , -0.996284492) (1 row) select centre_of_healpix_ring(12, 127899067); centre_of_healpix_ring ---------------------------- (5.27516818 , -0.27392047) (1 row) select centre_of_healpix_ring(10, 3447899); centre_of_healpix_ring ---------------------------- (1.71115557 , 0.468807666) (1 row) select centre_of_healpix_ring(27, 105385457032640256); centre_of_healpix_ring ----------------------------- (5.28626258 , 0.0249912626) (1 row) select centre_of_healpix_ring(7, 56074); centre_of_healpix_ring ----------------------------- (0.128854386 , 0.441264667) (1 row) select centre_of_healpix_nest(16, 6080447868); centre_of_healpix_nest ---------------------------- (2.41995047 , 0.732415481) (1 row) select centre_of_healpix_nest(26, 9443360004995328); centre_of_healpix_nest ---------------------------- (4.01581621 , 0.308927355) (1 row) select centre_of_healpix_ring(5, 7358); centre_of_healpix_ring -------------------------------- (-0.0981747704 , -0.188616386) (1 row) select centre_of_healpix_nest(22, 83115008093623); centre_of_healpix_nest ----------------------------- (-0.42537819 , 0.179806187) (1 row) select centre_of_healpix_nest(22, 119661787861931); centre_of_healpix_nest ---------------------------- (3.21187751 , 0.248708498) (1 row) select centre_of_healpix_ring(10, 1741511); centre_of_healpix_ring ---------------------------- (4.03979184 , 0.808538935) (1 row) select centre_of_healpix_nest(28, 233601830524124160); centre_of_healpix_nest ---------------------------- (5.52607853 , 0.651361859) (1 row) select centre_of_healpix_nest(26, 25542715168258176); centre_of_healpix_nest ------------------------------ (0.872259357 , 0.0705634574) (1 row) select centre_of_healpix_nest(25, 11683039506655248); centre_of_healpix_nest ----------------------------- (4.17350581 , -0.894467731) (1 row) select centre_of_healpix_nest(9, 2703723); centre_of_healpix_nest ----------------------------- (4.68413725 , -0.892891916) (1 row) select centre_of_healpix_ring(15, 2350431080); centre_of_healpix_ring ---------------------------- (5.44143732 , 0.688231872) (1 row) select centre_of_healpix_nest(20, 2167291092838); centre_of_healpix_nest -------------------------- (1.9956603 , 1.31859881) (1 row) select centre_of_healpix_ring(25, 9924289250746704); centre_of_healpix_ring ---------------------------- (2.7009724 , -0.488260009) (1 row) select centre_of_healpix_ring(7, 39352); centre_of_healpix_ring --------------------------- (2.25801972 , 0.64219966) (1 row) select centre_of_healpix_nest(6, 40574); centre_of_healpix_nest ----------------------------- (2.24574787 , -0.274258613) (1 row) select centre_of_healpix_ring(8, 165301); centre_of_healpix_ring --------------------------- (5.82299107 , 0.61962408) (1 row) select centre_of_healpix_nest(12, 181533311); centre_of_healpix_nest ----------------------------- (4.16475784 , -0.394424937) (1 row) select centre_of_healpix_ring(15, 3425067326); centre_of_healpix_ring ---------------------------- (4.33493383 , 0.487437587) (1 row) select centre_of_healpix_nest(25, 1221534201635760); centre_of_healpix_nest ---------------------------- (2.67005067 , 0.356334187) (1 row) select centre_of_healpix_ring(13, 507906418); centre_of_healpix_ring ----------------------------- (3.60533422 , -0.264465335) (1 row) select centre_of_healpix_ring(23, 287308029832317); centre_of_healpix_ring ----------------------------- (0.186210325 , 0.325220622) (1 row) select centre_of_healpix_ring(26, 53135871436457472); centre_of_healpix_ring ---------------------------- (4.44489172 , -1.31092194) (1 row) select centre_of_healpix_nest(19, 1090670601536); centre_of_healpix_nest --------------------------- (6.07758004 , 1.42513851) (1 row) select centre_of_healpix_ring(20, 3867641411341); centre_of_healpix_ring ----------------------------- (0.438355234 , 0.426550844) (1 row) select centre_of_healpix_ring(9, 2065273); centre_of_healpix_ring ------------------------------- (-0.412640832 , -0.317823704) (1 row) select centre_of_healpix_ring(12, 135779992); centre_of_healpix_ring ----------------------------- (5.35972887 , -0.356285661) (1 row) select centre_of_healpix_ring(20, 10935521542147); centre_of_healpix_ring ------------------------------- (0.0490926283 , -0.717673036) (1 row) select centre_of_healpix_nest(19, 114949887864); centre_of_healpix_nest ----------------------------- (0.882777202 , 0.749152764) (1 row) select centre_of_healpix_ring(5, 10883); centre_of_healpix_ring ----------------------------- (6.25409649 , -0.867470357) (1 row) select centre_of_healpix_ring(9, 391580); centre_of_healpix_ring ---------------------------- (6.17123942 , 0.850456831) (1 row) select centre_of_healpix_ring(26, 50284229585712576); centre_of_healpix_ring ---------------------------- (2.01528677 , -1.03701696) (1 row) select centre_of_healpix_ring(8, 210966); centre_of_healpix_ring ---------------------------- (3.27965092 , 0.481988066) (1 row) select centre_of_healpix_nest(6, 25485); centre_of_healpix_nest ----------------------------- (3.05568973 , -0.188616386) (1 row) select centre_of_healpix_nest(16, 40277340625); centre_of_healpix_nest ----------------------------- (2.57205448 , -0.877149568) (1 row) select centre_of_healpix_nest(27, 124500430430571264); centre_of_healpix_nest ---------------------------- (2.92321367 , 0.325020271) (1 row) select centre_of_healpix_ring(4, 2050); centre_of_healpix_ring ----------------------------- (3.38702958 , -0.339836909) (1 row) select centre_of_healpix_ring(15, 6278179983); centre_of_healpix_ring ----------------------------- (1.33221438 , 0.0254951121) (1 row) select centre_of_healpix_ring(21, 19865305926466); centre_of_healpix_ring ---------------------------- (3.18056685 , 0.249781313) (1 row) select centre_of_healpix_ring(12, 42611685); centre_of_healpix_ring ---------------------------- (1.95314104 , 0.614634749) (1 row) select centre_of_healpix_ring(8, 425777); centre_of_healpix_ring ------------------------------ (1.87452452 , -0.0834300866) (1 row) select centre_of_healpix_nest(5, 8088); centre_of_healpix_nest ---------------------------- (4.56512682 , 0.317823704) (1 row) select centre_of_healpix_ring(9, 1394154); centre_of_healpix_ring ---------------------------- (1.50330117 , 0.113524943) (1 row) select centre_of_healpix_ring(17, 70106593390); centre_of_healpix_ring ---------------------------- (1.35122735 , 0.325597639) (1 row) select centre_of_healpix_nest(25, 7468662076615776); centre_of_healpix_nest ----------------------------- (2.4962707 , -0.0991841942) (1 row) select centre_of_healpix_nest(18, 308025039646); centre_of_healpix_nest ----------------------------- (0.312269952 , 0.222895153) (1 row) select centre_of_healpix_nest(26, 49821874966440960); centre_of_healpix_nest ---------------------------- (6.19613031 , -1.34962504) (1 row) select centre_of_healpix_ring(23, 322203559978023); centre_of_healpix_ring ---------------------------- (5.45963677 , 0.239141556) (1 row) select centre_of_healpix_ring(22, 173896119291346); centre_of_healpix_ring ----------------------------- (5.76909296 , -0.704266384) (1 row) select centre_of_healpix_ring(16, 693814171); centre_of_healpix_ring --------------------------- (5.91812802 , 1.33822835) (1 row) select centre_of_healpix_ring(13, 298804590); centre_of_healpix_ring ---------------------------- (1.83732549 , 0.260841709) (1 row) select centre_of_healpix_nest(9, 896428); centre_of_healpix_nest ---------------------------- (5.60928417 , 0.787017194) (1 row) select centre_of_healpix_ring(18, 182043356873); centre_of_healpix_ring ---------------------------- (3.60606226 , 0.592560642) (1 row) select centre_of_healpix_ring(25, 12141108247773648); centre_of_healpix_ring ----------------------------- (0.463867721 , -0.92271761) (1 row) select centre_of_healpix_nest(18, 706452677992); centre_of_healpix_nest ----------------------------- (4.48826925 , -0.873415811) (1 row) select centre_of_healpix_ring(28, 10821196959267840); centre_of_healpix_ring -------------------------- (5.9946488 , 1.34659036) (1 row) select centre_of_healpix_nest(6, 42704); centre_of_healpix_nest ----------------------------- (4.17242774 , -0.661857664) (1 row) select centre_of_healpix_nest(28, 83146726739002368); centre_of_healpix_nest ---------------------------- (2.27812335 , 0.383438942) (1 row) select centre_of_healpix_ring(19, 1818721106330); centre_of_healpix_ring ----------------------------- (1.90950198 , -0.102926692) (1 row) select centre_of_healpix_ring(21, 43567771002648); centre_of_healpix_ring ----------------------------- (3.32089463 , -0.708937128) (1 row) select centre_of_healpix_ring(4, 285); centre_of_healpix_ring ---------------------------- (2.81434342 , 0.948427838) (1 row) select centre_of_healpix_nest(12, 108829729); centre_of_healpix_nest --------------------------- (3.52144465 , 0.21086917) (1 row) select centre_of_healpix_ring(7, 121332); centre_of_healpix_ring ---------------------------- (2.9943305 , -0.236575611) (1 row) select centre_of_healpix_nest(21, 13214198507927); centre_of_healpix_nest ----------------------------- (5.52474491 , 0.0639273145) (1 row) select centre_of_healpix_nest(18, 818459787178); centre_of_healpix_nest ----------------------------- (5.25307227 , -0.383036459) (1 row) select centre_of_healpix_nest(15, 286984387); centre_of_healpix_nest ---------------------------- (1.28777687 , 0.477286853) (1 row) select centre_of_healpix_ring(28, 330620058047385600); centre_of_healpix_ring ---------------------------- (1.13229354 , 0.237514359) (1 row) select centre_of_healpix_nest(24, 2927095447682220); centre_of_healpix_nest ----------------------------- (4.16808196 , -0.751745024) (1 row) select centre_of_healpix_nest(15, 5976562503); centre_of_healpix_nest ----------------------------- (1.36318161 , -0.101472061) (1 row) select centre_of_healpix_nest(6, 47262); centre_of_healpix_nest -------------------------- (4.9165925 , -0.9215662) (1 row) select centre_of_healpix_nest(8, 706033); centre_of_healpix_nest ----------------------------- (4.07732093 , -0.493780678) (1 row) select centre_of_healpix_ring(9, 439829); centre_of_healpix_ring ---------------------------- (2.83178741 , 0.804242097) (1 row) select centre_of_healpix_ring(22, 105872067443080); centre_of_healpix_ring ------------------------------ (2.9630307 , -0.00302172167) (1 row) select centre_of_healpix_nest(22, 186380323353200); centre_of_healpix_nest ----------------------------- (3.60415394 , -0.807834029) (1 row) select centre_of_healpix_ring(22, 18009694346571); centre_of_healpix_ring ---------------------------- (1.59259913 , 0.977993211) (1 row) select centre_of_healpix_ring(24, 1849489461497676); centre_of_healpix_ring ------------------------------- (0.578677399 , -0.0952617827) (1 row) select centre_of_healpix_ring(26, 6448642685073792); centre_of_healpix_ring -------------------------- (2.4996558 , 0.86539633) (1 row) select centre_of_healpix_ring(15, 3626703168); centre_of_healpix_ring ----------------------------- (0.309888088 , 0.452318899) (1 row) select centre_of_healpix_ring(5, 2626); centre_of_healpix_ring ------------------------------ (0.0981747704 , 0.597406417) (1 row) select centre_of_healpix_ring(11, 9697428); centre_of_healpix_ring --------------------------- (1.6846944 , 0.661857664) (1 row) select centre_of_healpix_ring(13, 711811032); centre_of_healpix_ring ----------------------------- (1.71772104 , -0.875427119) (1 row) select centre_of_healpix_nest(25, 3493846776138384); centre_of_healpix_nest --------------------------- (5.5512895 , 0.337239093) (1 row) select centre_of_healpix_nest(28, 738579839670079488); centre_of_healpix_nest ----------------------------- (3.93179602 , -0.742969403) (1 row) select centre_of_healpix_ring(19, 205996276047); centre_of_healpix_ring -------------------------- (4.5858009 , 1.06563931) (1 row) select centre_of_healpix_nest(8, 221921); centre_of_healpix_nest --------------------------- (5.63584541 , 0.64219966) (1 row) select centre_of_healpix_ring(28, 225046655046448128); centre_of_healpix_ring ---------------------------- (4.31315251 , 0.500056414) (1 row) select centre_of_healpix_ring(26, 38756175364167168); centre_of_healpix_ring ----------------------------- (3.70469544 , -0.449223945) (1 row) select centre_of_healpix_ring(5, 6369); centre_of_healpix_ring ----------------------------- (1.6444274 , -0.0416787324) (1 row) select centre_of_healpix_ring(15, 5622641090); centre_of_healpix_ring ---------------------------- (5.32300921 , 0.127604313) (1 row) select centre_of_healpix_ring(13, 268460119); centre_of_healpix_ring ---------------------------- (1.58747837 , 0.339750594) (1 row) select centre_of_healpix_nest(23, 386756705319996); centre_of_healpix_nest ---------------------------- (1.96498145 , 0.259490087) (1 row) select centre_of_healpix_nest(24, 1868157948872844); centre_of_healpix_nest ------------------------------ (2.57111171 , -0.0650516098) (1 row) select centre_of_healpix_nest(16, 42113264243); centre_of_healpix_nest ----------------------------- (2.30432676 , -0.452782657) (1 row) select centre_of_healpix_nest(8, 76545); centre_of_healpix_nest ---------------------------- (2.06473814 , 0.345366615) (1 row) select centre_of_healpix_ring(20, 2286133036507); centre_of_healpix_ring ----------------------------- (0.566750474 , 0.712149142) (1 row) select centre_of_healpix_ring(13, 600991966); centre_of_healpix_ring ----------------------------- (2.00606338 , -0.515068429) (1 row) select centre_of_healpix_nest(16, 47302719492); centre_of_healpix_nest ---------------------------- (5.63289535 , -1.40591743) (1 row) select centre_of_healpix_ring(16, 35315710213); centre_of_healpix_ring ----------------------------- (1.52796471 , -0.379474641) (1 row) select centre_of_healpix_ring(11, 30531997); centre_of_healpix_ring ----------------------------- (3.45835969 , -0.214865626) (1 row) select centre_of_healpix_ring(20, 9467064114415); centre_of_healpix_ring ---------------------------- (2.98088345 , -0.45008358) (1 row) select centre_of_healpix_nest(8, 365891); centre_of_healpix_nest ------------------------------ (1.54625263 , -0.0130212013) (1 row) select centre_of_healpix_ring(20, 497243183126); centre_of_healpix_ring --------------------------- (1.17054128 , 1.18005396) (1 row) select centre_of_healpix_ring(12, 29572415); centre_of_healpix_ring ---------------------------- (4.92502864 , 0.784212387) (1 row) select centre_of_healpix_nest(17, 123666065789); centre_of_healpix_nest ----------------------------- (4.66824509 , -0.244588386) (1 row) select centre_of_healpix_nest(22, 174709815316048); centre_of_healpix_nest ----------------------------- (2.14785998 , -0.249136539) (1 row) select centre_of_healpix_ring(18, 348731659907); centre_of_healpix_ring ---------------------------- (-0.456338312 , 0.1548334) (1 row) select centre_of_healpix_ring(23, 275824916311884); centre_of_healpix_ring --------------------------- (3.63473377 , 0.35406698) (1 row) select centre_of_healpix_nest(24, 2164146544751052); centre_of_healpix_nest ---------------------------- (4.3478356 , 0.0334142633) (1 row) select centre_of_healpix_ring(21, 16310692827216); centre_of_healpix_ring ---------------------------- (3.79512876 , 0.391847286) (1 row) select centre_of_healpix_ring(28, 799536742754669568); centre_of_healpix_ring ---------------------------- (1.61843407 , -1.01465829) (1 row) select centre_of_healpix_ring(27, 93052091697524736); centre_of_healpix_ring ---------------------------- (4.56277792 , 0.139547686) (1 row) select centre_of_healpix_ring(19, 1091612438753); centre_of_healpix_ring ---------------------------- (5.48618941 , 0.344922052) (1 row) select centre_of_healpix_nest(13, 8074557); centre_of_healpix_nest ----------------------------- (0.937358135 , 0.446852144) (1 row) select centre_of_healpix_ring(9, 2819977); centre_of_healpix_ring ----------------------------- (5.79133943 , -0.914831988) (1 row) select centre_of_healpix_ring(5, 10805); centre_of_healpix_ring ----------------------------- (1.71624043 , -0.867470357) (1 row) select centre_of_healpix_nest(10, 5501413); centre_of_healpix_nest ------------------------------ (1.58230118 , -0.0573230548) (1 row) select centre_of_healpix_nest(26, 37392938530485120); centre_of_healpix_nest ----------------------------- (1.25964023 , -0.851637691) (1 row) select centre_of_healpix_ring(14, 831021220); centre_of_healpix_ring ---------------------------- (5.51355838 , 0.505276582) (1 row) select centre_of_healpix_nest(26, 31258268057869824); centre_of_healpix_nest ---------------------------- (3.15087799 , 0.404200718) (1 row) select centre_of_healpix_nest(7, 57069); centre_of_healpix_nest -------------------------- (5.9087513 , 1.01508993) (1 row) select centre_of_healpix_ring(22, 101667031522612); centre_of_healpix_ring ----------------------------- (5.02198495 , 0.0368247603) (1 row) select centre_of_healpix_ring(18, 608913542939); centre_of_healpix_ring ----------------------------- (4.44103617 , -0.497021099) (1 row) select centre_of_healpix_ring(6, 18471); centre_of_healpix_ring ---------------------------- (4.11106851 , 0.252680255) (1 row) select centre_of_healpix_nest(21, 31527810935340); centre_of_healpix_nest ----------------------------- (4.39917377 , -0.318254431) (1 row) select centre_of_healpix_ring(22, 92078063934181); centre_of_healpix_ring ---------------------------- (4.97881234 , 0.128010714) (1 row) select centre_of_healpix_nest(13, 164187661); centre_of_healpix_nest --------------------------- (4.35759816 , 0.83573881) (1 row) select centre_of_healpix_nest(24, 279431807745024); centre_of_healpix_nest --------------------------- (0.45010295 , 1.43912755) (1 row) select centre_of_healpix_nest(28, 601827277442571264); centre_of_healpix_nest ----------------------------- (1.24497906 , -0.750037266) (1 row) select centre_of_healpix_ring(5, 8219); centre_of_healpix_ring ----------------------------- (4.49149575 , -0.339836909) (1 row) select centre_of_healpix_ring(10, 6154916); centre_of_healpix_ring ----------------------------- (1.03697101 , 0.0214860281) (1 row) select centre_of_healpix_nest(14, 695675771); centre_of_healpix_nest ---------------------------- (3.84303464 , 0.793322083) (1 row) select centre_of_healpix_ring(22, 94858604681754); centre_of_healpix_ring ----------------------------- (-0.402468472 , 0.10149299) (1 row) select centre_of_healpix_nest(26, 22385669837084544); centre_of_healpix_nest ------------------------------- (-0.0808954843 , 0.488250999) (1 row) select centre_of_healpix_nest(26, 19446327774759744); centre_of_healpix_nest ------------------------------ (0.661913927 , -0.083974225) (1 row) select centre_of_healpix_ring(11, 12201331); centre_of_healpix_ring ---------------------------- (5.78234058 , 0.541357059) (1 row) select centre_of_healpix_nest(17, 34462086549); centre_of_healpix_nest ----------------------------- (3.95565109 , 0.0733078297) (1 row) select centre_of_healpix_nest(11, 31630711); centre_of_healpix_nest ----------------------------- (4.17012677 , -0.165797617) (1 row) select centre_of_healpix_nest(27, 113694813714710784); centre_of_healpix_nest ------------------------------ (3.51173003 , -0.0342129801) (1 row) select centre_of_healpix_nest(23, 667784128403820); centre_of_healpix_nest ----------------------------- (2.80792075 , -0.435108407) (1 row) select centre_of_healpix_ring(11, 44687061); centre_of_healpix_ring ----------------------------- (3.34121469 , -0.887816858) (1 row) select centre_of_healpix_ring(18, 274977429575); centre_of_healpix_ring ---------------------------- (2.58978501 , 0.339580668) (1 row) select centre_of_healpix_nest(9, 2838773); centre_of_healpix_nest ----------------------------- (4.22611707 , -0.390021535) (1 row) select centre_of_healpix_ring(5, 1710); centre_of_healpix_ring ---------------------------- (4.68530629 , 0.812832076) (1 row) select centre_of_healpix_nest(6, 39938); centre_of_healpix_nest ----------------------------- (2.34392264 , -0.702114276) (1 row) select centre_of_healpix_ring(13, 238449072); centre_of_healpix_ring ---------------------------- (2.43902945 , 0.420039176) (1 row) select centre_of_healpix_nest(21, 23730825026814); centre_of_healpix_nest ------------------------------- (1.95196621 , -0.00650092571) (1 row) select centre_of_healpix_ring(19, 1796609073007); centre_of_healpix_ring ------------------------------ (2.92026649 , -0.0894569329) (1 row) select centre_of_healpix_ring(20, 6327661430434); centre_of_healpix_ring ----------------------------- (3.43866137 , 0.0408489652) (1 row) select centre_of_healpix_nest(7, 195671); centre_of_healpix_nest ----------------------------- (5.58369007 , -0.247304816) (1 row) select centre_of_healpix_nest(14, 129747966); centre_of_healpix_nest --------------------------- (1.18831591 , 1.01995956) (1 row) select centre_of_healpix_ring(15, 4335858267); centre_of_healpix_ring ---------------------------- (2.97417303 , 0.333112147) (1 row) select centre_of_healpix_ring(27, 131412997211631360); centre_of_healpix_ring ----------------------------- (1.89844205 , -0.217525871) (1 row) select centre_of_healpix_nest(22, 81837808796668); centre_of_healpix_nest ------------------------------ (-0.544035874 , 0.020681743) (1 row) select centre_of_healpix_ring(25, 6572063630925072); centre_of_healpix_ring ----------------------------- (1.69846505 , 0.0271424797) (1 row) select centre_of_healpix_ring(12, 99696856); centre_of_healpix_ring ------------------------------ (3.22442762 , 0.00960301218) (1 row) select centre_of_healpix_ring(13, 185847849); centre_of_healpix_ring ---------------------------- (0.793355689 , 0.56855087) (1 row) select centre_of_healpix_nest(14, 905417853); centre_of_healpix_nest -------------------------- (6.2658135 , 0.90756301) (1 row) select centre_of_healpix_nest(6, 22452); centre_of_healpix_nest ---------------------------- (1.88986433 , 0.199232087) (1 row) select centre_of_healpix_ring(16, 49817464016); centre_of_healpix_ring ---------------------------- (2.98830833 , -1.20313959) (1 row) select centre_of_healpix_ring(28, 393892648199740416); centre_of_healpix_ring ----------------------------- (4.67149281 , 0.0890579131) (1 row) select centre_of_healpix_ring(14, 754240326); centre_of_healpix_ring ---------------------------- (1.84748811 , 0.560603703) (1 row) select centre_of_healpix_ring(24, 2816806896339684); centre_of_healpix_ring ----------------------------- (1.06284653 , -0.731363077) (1 row) select centre_of_healpix_nest(25, 8832214882961472); centre_of_healpix_nest ---------------------------- (4.81289412 , 0.284768692) (1 row) select centre_of_healpix_ring(14, 2251720605); centre_of_healpix_ring ------------------------------ (0.186858035 , -0.409413414) (1 row) select centre_of_healpix_ring(27, 152665212339125760); centre_of_healpix_ring ----------------------------- (4.52255287 , -0.425127513) (1 row) select centre_of_healpix_ring(13, 530729975); centre_of_healpix_ring ------------------------------ (0.587322894 , -0.323740782) (1 row) select centre_of_healpix_nest(6, 37419); centre_of_healpix_nest ---------------------------- (1.66504411 , -1.25048478) (1 row) select centre_of_healpix_nest(14, 2254665264); centre_of_healpix_nest ----------------------------- (1.04084061 , -0.740578255) (1 row) select centre_of_healpix_nest(21, 31472886052600); centre_of_healpix_nest ----------------------------- (4.61589724 , -0.263934803) (1 row) select centre_of_healpix_ring(14, 715531452); centre_of_healpix_ring -------------------------- (4.0432378 , 0.58925936) (1 row) select centre_of_healpix_ring(20, 6288770027214); centre_of_healpix_ring ------------------------------ (0.717445361 , 0.0467496115) (1 row) select centre_of_healpix_nest(11, 37491732); centre_of_healpix_nest ------------------------------ (0.824514673 , -0.304487917) (1 row) select centre_of_healpix_ring(6, 27598); centre_of_healpix_ring ----------------------------- (1.92667987 , -0.125327831) (1 row) select centre_of_healpix_nest(15, 10939572103); centre_of_healpix_nest --------------------------- (3.9238863 , -1.12587157) (1 row) select centre_of_healpix_ring(11, 16055639); centre_of_healpix_ring ---------------------------- (2.61965569 , 0.370390166) (1 row) select centre_of_healpix_nest(24, 3284556376079004); centre_of_healpix_nest ----------------------------- (4.83277408 , -0.689335353) (1 row) select centre_of_healpix_nest(5, 4359); centre_of_healpix_nest ------------------------------ (0.441786467 , -0.231221479) (1 row) select centre_of_healpix_ring(10, 3378928); centre_of_healpix_ring --------------------------- (2.72434988 , 0.48125346) (1 row) select centre_of_healpix_nest(26, 27634141140706560); centre_of_healpix_nest ----------------------------- (2.90937863 , -0.412204148) (1 row) select centre_of_healpix_ring(17, 10803296647); centre_of_healpix_ring --------------------------- (2.55631628 , 1.10886622) (1 row) select centre_of_healpix_nest(26, 23709435232142208); centre_of_healpix_nest ----------------------------- (1.93455791 , -0.199004662) (1 row) select centre_of_healpix_nest(10, 1296378); centre_of_healpix_nest ---------------------------- (2.37843721 , 0.594260075) (1 row) select centre_of_healpix_nest(19, 1575245828144); centre_of_healpix_nest ---------------------------- (1.08078534 , 0.187716769) (1 row) select centre_of_healpix_nest(11, 2726999); centre_of_healpix_nest ----------------------------- (0.271080311 , 0.737145965) (1 row) select centre_of_healpix_nest(24, 3099636690545736); centre_of_healpix_nest -------------------------- (5.525041 , -1.44279445) (1 row) select centre_of_healpix_nest(15, 6264223126); centre_of_healpix_nest ---------------------------- (1.89401087 , 0.324685165) (1 row) select centre_of_healpix_nest(24, 2619536815491696); centre_of_healpix_nest ----------------------------- (2.78017992 , -0.829523799) (1 row) select centre_of_healpix_ring(18, 493881847077); centre_of_healpix_ring ------------------------------- (-0.421620012 , -0.199133499) (1 row) select centre_of_healpix_ring(6, 14889); centre_of_healpix_ring --------------------------- (4.1601559 , 0.406975126) (1 row) select centre_of_healpix_ring(21, 14870365099456); centre_of_healpix_ring ----------------------------- (0.998190435 , 0.451680696) (1 row) select centre_of_healpix_ring(17, 18052950446); centre_of_healpix_ring ---------------------------- (1.65886098 , 0.969958867) (1 row) select centre_of_healpix_ring(9, 3095970); centre_of_healpix_ring ---------------------------- (4.83666084 , -1.31815926) (1 row) select centre_of_healpix_nest(27, 49656729287612928); centre_of_healpix_nest ---------------------------- (3.92963961 , 0.838047803) (1 row) select centre_of_healpix_ring(16, 2535747372); centre_of_healpix_ring --------------------------- (4.48596968 , 1.12345704) (1 row) select centre_of_healpix_ring(13, 103964507); centre_of_healpix_ring --------------------------- (2.33713143 , 0.83573881) (1 row) select centre_of_healpix_ring(21, 27737721561370); centre_of_healpix_ring ------------------------------ (3.65108587 , -0.0511602388) (1 row) select centre_of_healpix_nest(21, 12512002615129); centre_of_healpix_nest --------------------------- (4.13372954 , 1.09785864) (1 row) select centre_of_healpix_nest(18, 165757354571); centre_of_healpix_nest ---------------------------- (4.09754772 , 0.749436435) (1 row) select centre_of_healpix_nest(7, 146565); centre_of_healpix_nest ------------------------------ (0.754718548 , -0.274258613) (1 row) select centre_of_healpix_ring(4, 2742); centre_of_healpix_ring ----------------------------- (4.16865179 , -0.894582592) (1 row) select centre_of_healpix_ring(13, 320301716); centre_of_healpix_ring ---------------------------- (2.09004882 , 0.205961531) (1 row) select centre_of_healpix_ring(17, 131409270184); centre_of_healpix_ring ----------------------------- (4.97517906 , -0.278419361) (1 row) select centre_of_healpix_ring(14, 3094170600); centre_of_healpix_ring ----------------------------- (0.565348716 , -1.17095319) (1 row) select centre_of_healpix_nest(27, 75391023158022912); centre_of_healpix_nest ------------------------------- (-0.162437555 , -0.202845048) (1 row) select centre_of_healpix_nest(11, 27166235); centre_of_healpix_nest ---------------------------- (3.39393249 , 0.144052378) (1 row) select centre_of_healpix_ring(24, 565545348837204); centre_of_healpix_ring ---------------------------- (5.68913519 , 0.727667763) (1 row) select centre_of_healpix_nest(25, 2126640087028992); centre_of_healpix_nest -------------------------- (1.95396242 , 1.0955672) (1 row) select centre_of_healpix_nest(25, 199961835361392); centre_of_healpix_nest ----------------------------- (0.670217216 , 0.443921043) (1 row) select centre_of_healpix_ring(9, 559379); centre_of_healpix_ring ---------------------------- (3.98528209 , 0.700410041) (1 row) select centre_of_healpix_ring(19, 2853546998659); centre_of_healpix_ring ----------------------------- (5.43215039 , -0.818600239) (1 row) select centre_of_healpix_nest(16, 47315822096); centre_of_healpix_nest ---------------------------- (6.03042978 , -1.42568658) (1 row) select centre_of_healpix_ring(22, 33960314204286); centre_of_healpix_ring ----------------------------- (0.742754847 , 0.745396491) (1 row) select centre_of_healpix_ring(28, 5868928751941632); centre_of_healpix_ring ---------------------------- (0.967096103 , 1.40583907) (1 row) select centre_of_healpix_ring(16, 1454567511); centre_of_healpix_ring ------------------------- (4.39177016 , 1.233208) (1 row) select centre_of_healpix_nest(15, 9769337559); centre_of_healpix_nest --------------------------- (2.6729028 , -1.18139693) (1 row) select centre_of_healpix_nest(16, 1623946482); centre_of_healpix_nest ----------------------------- (0.977517273 , 0.588696605) (1 row) select centre_of_healpix_nest(25, 12005065586729760); centre_of_healpix_nest ----------------------------- (3.24424634 , -0.735797571) (1 row) select centre_of_healpix_nest(16, 49124069891); centre_of_healpix_nest ----------------------------- (5.90026535 , -0.714719623) (1 row) select centre_of_healpix_nest(25, 2230922650209216); centre_of_healpix_nest --------------------------- (2.00967019 , 1.39580065) (1 row) select centre_of_healpix_ring(28, 342152606020439040); centre_of_healpix_ring ---------------------------- (2.82963729 , 0.210156667) (1 row) select centre_of_healpix_ring(26, 52426357665414528); centre_of_healpix_ring ---------------------------- (4.19822619 , -1.22311419) (1 row) select centre_of_healpix_nest(20, 5222772019166); centre_of_healpix_nest ------------------------------- (0.0102607436 , 0.0109013491) (1 row) select centre_of_healpix_ring(27, 1751055573934080); centre_of_healpix_ring --------------------------- (1.87635629 , 1.39054954) (1 row) select centre_of_healpix_ring(24, 998003082512988); centre_of_healpix_ring ---------------------------- (1.91312234 , 0.421427486) (1 row) select centre_of_healpix_ring(24, 2469632848212456); centre_of_healpix_ring ----------------------------- (4.15214819 , -0.480605757) (1 row) select centre_of_healpix_nest(5, 5228); centre_of_healpix_nest ---------------------------- (1.6689711 , -0.317823704) (1 row) select centre_of_healpix_nest(10, 9270552); centre_of_healpix_nest ----------------------------- (1.11827199 , -0.302100295) (1 row) select centre_of_healpix_ring(22, 185551039603602); centre_of_healpix_ring ------------------------------ (0.606120041 , -0.860076745) (1 row) select centre_of_healpix_ring(19, 13530914066); centre_of_healpix_ring --------------------------- (5.64446444 , 1.44261396) (1 row) select centre_of_healpix_nest(28, 597319441282249728); centre_of_healpix_nest ----------------------------- (1.13118418 , -0.972928195) (1 row) select centre_of_healpix_nest(10, 5425090); centre_of_healpix_nest ----------------------------- (1.39822349 , -0.283739856) (1 row) select centre_of_healpix_ring(15, 8121234206); centre_of_healpix_ring ----------------------------- (3.76891889 , -0.263622316) (1 row) select centre_of_healpix_ring(27, 1168408328913408); centre_of_healpix_ring -------------------------- (1.7010344 , 1.42362649) (1 row) select centre_of_healpix_nest(16, 36161313850); centre_of_healpix_nest ------------------------------ (0.899643779 , -0.679988626) (1 row) select centre_of_healpix_nest(24, 31553009213232); centre_of_healpix_nest ----------------------------- (0.952772844 , 0.389072111) (1 row) select centre_of_healpix_ring(25, 3364032823619376); centre_of_healpix_ring ---------------------------- (1.15028413 , 0.525936431) (1 row) select centre_of_healpix_nest(13, 113854346); centre_of_healpix_nest ---------------------------- (1.89898833 , 0.834670675) (1 row) select centre_of_healpix_ring(12, 19181269); centre_of_healpix_ring ---------------------------- (2.35619449 , 0.943190702) (1 row) select centre_of_healpix_ring(21, 49860077119959); centre_of_healpix_ring ---------------------------- (1.29221964 , -1.09620209) (1 row) select centre_of_healpix_nest(5, 2942); centre_of_healpix_nest --------------------------- (4.47676953 , 1.31494387) (1 row) select centre_of_healpix_nest(24, 1057202692327464); centre_of_healpix_nest ---------------------------- (5.53447241 , 0.825390677) (1 row) select centre_of_healpix_nest(23, 436114855314633); centre_of_healpix_nest ----------------------------- (3.07943338 , -0.255313927) (1 row) select centre_of_healpix_ring(20, 1063390092871); centre_of_healpix_ring ---------------------------- (4.53821114 , 0.995091569) (1 row) select centre_of_healpix_nest(16, 21420634573); centre_of_healpix_nest ------------------------------- (0.00633965497 , 0.583763177) (1 row) select centre_of_healpix_ring(10, 12110604); centre_of_healpix_ring ---------------------------- (3.41470436 , -1.18081278) (1 row) select centre_of_healpix_nest(13, 346081569); centre_of_healpix_nest ----------------------------- (1.27445041 , -0.402194642) (1 row) select centre_of_healpix_nest(19, 1183542884248); centre_of_healpix_nest ------------------------------- (0.364359386 , -0.0988560527) (1 row) select centre_of_healpix_nest(18, 683574460932); centre_of_healpix_nest ---------------------------- (2.28290496 , -0.26643928) (1 row) select centre_of_healpix_ring(5, 6590); centre_of_healpix_ring --------------------------------- (-0.0981747704 , -0.0625407618) (1 row) select centre_of_healpix_nest(19, 420140468418); centre_of_healpix_nest ---------------------------- (2.08424696 , 0.559382052) (1 row) select centre_of_healpix_ring(22, 207184398224823); centre_of_healpix_ring ---------------------------- (6.17812757 , -1.29734617) (1 row) select centre_of_healpix_ring(23, 444693866890563); centre_of_healpix_ring ------------------------------ (3.04673817 , -0.0532718501) (1 row) select centre_of_healpix_ring(12, 8875280); centre_of_healpix_ring ---------------------------- (0.444698628 , 1.14763684) (1 row) select centre_of_healpix_ring(11, 17715426); centre_of_healpix_ring ----------------------------- (0.173339829 , 0.300395938) (1 row) select centre_of_healpix_nest(22, 20268640037856); centre_of_healpix_nest ---------------------------- (2.20531834 , 0.367274637) (1 row) select centre_of_healpix_ring(21, 17615203451411); centre_of_healpix_ring ---------------------------- (2.44249552 , 0.338911853) (1 row) select centre_of_healpix_ring(22, 36062207977702); centre_of_healpix_ring ---------------------------- (3.74683421 , 0.718624779) (1 row) select centre_of_healpix_nest(18, 218572946343); centre_of_healpix_nest ---------------------------- (5.25337487 , 0.427138939) (1 row) select centre_of_healpix_ring(15, 1434908109); centre_of_healpix_ring ---------------------------- (5.23283072 , 0.890328524) (1 row) select centre_of_healpix_nest(13, 750839184); centre_of_healpix_nest ---------------------------- (5.49427855 , -1.12078624) (1 row) select centre_of_healpix_nest(17, 198155809389); centre_of_healpix_nest ----------------------------- (4.78910257 , -0.998266075) (1 row) select centre_of_healpix_nest(23, 113668850797485); centre_of_healpix_nest --------------------------- (2.1693884 , 0.827075762) (1 row) select centre_of_healpix_ring(13, 161765910); centre_of_healpix_ring ---------------------------- (1.28049046 , 0.641285337) (1 row) select centre_of_healpix_ring(12, 129503779); centre_of_healpix_ring ---------------------------- (4.9223526 , -0.290528204) (1 row) select centre_of_healpix_ring(20, 6226959808163); centre_of_healpix_ring ----------------------------- (2.57349695 , 0.0561315884) (1 row) select centre_of_healpix_ring(24, 2536325237566980); centre_of_healpix_ring ----------------------------- (4.42970546 , -0.525685677) (1 row) select centre_of_healpix_nest(26, 5557614260288256); centre_of_healpix_nest ---------------------------- (2.24181218 , 0.599435606) (1 row) select centre_of_healpix_nest(21, 46324118055801); centre_of_healpix_nest ---------------------------- (3.22324324 , -1.00008892) (1 row) select centre_of_healpix_nest(4, 1057); centre_of_healpix_nest ------------------------------- (-0.147262156 , -0.429775431) (1 row) select centre_of_healpix_nest(6, 29624); centre_of_healpix_nest ----------------------------- (4.58967052 , -0.135833991) (1 row) select centre_of_healpix_ring(16, 29183080758); centre_of_healpix_ring ----------------------------- (0.743740998 , -0.13284687) (1 row) select centre_of_healpix_nest(27, 95935114026059520); centre_of_healpix_nest ------------------------------ (2.19883956 , -0.0456068401) (1 row) select centre_of_healpix_nest(16, 44182642748); centre_of_healpix_nest ----------------------------- (4.40446178 , -0.928962407) (1 row) select centre_of_healpix_ring(23, 538679612339817); centre_of_healpix_ring ------------------------------- (-0.184537402 , -0.279473465) (1 row) select centre_of_healpix_nest(10, 5996383); centre_of_healpix_nest --------------------------- (1.2854759 , 0.243948878) (1 row) select centre_of_healpix_ring(21, 5758595135923); centre_of_healpix_ring ---------------------------- (5.06552329 , 0.897506655) (1 row) select centre_of_healpix_ring(6, 19258); centre_of_healpix_ring ---------------------------- (4.56512682 , 0.220533261) (1 row) select centre_of_healpix_ring(7, 119182); centre_of_healpix_ring ---------------------------- (1.74260218 , -0.21519882) (1 row) select centre_of_healpix_ring(25, 125860990243200); centre_of_healpix_ring --------------------------- (5.20951035 , 1.37746081) (1 row) select centre_of_healpix_ring(21, 39057667543386); centre_of_healpix_ring ---------------------------- (1.8809196 , -0.500785009) (1 row) select centre_of_healpix_nest(10, 919012); centre_of_healpix_nest --------------------------- (0.54876457 , 1.00762348) (1 row) select centre_of_healpix_nest(24, 2147335846674756); centre_of_healpix_nest ------------------------------ (4.12594215 , -0.0886566885) (1 row) select centre_of_healpix_nest(28, 822724412295081984); centre_of_healpix_nest ---------------------------- (5.5421857 , -0.697374196) (1 row) select centre_of_healpix_nest(28, 225127735760489472); centre_of_healpix_nest --------------------------- (5.7075152 , 0.491777941) (1 row) select centre_of_healpix_ring(9, 2310825); centre_of_healpix_ring ----------------------------- (5.23240847 , -0.487875148) (1 row) select centre_of_healpix_nest(17, 137170290591); centre_of_healpix_nest ------------------------- (4.613615 , 0.61774477) (1 row) select centre_of_healpix_ring(26, 20422921971689472); centre_of_healpix_ring ---------------------------- (3.69061396 , 0.246694693) (1 row) select centre_of_healpix_ring(5, 9545); centre_of_healpix_ring ------------------------------ (0.441786467 , -0.597406417) (1 row) select centre_of_healpix_ring(6, 39409); centre_of_healpix_ring ----------------------------- (2.78570911 , -0.648719678) (1 row) select centre_of_healpix_nest(27, 97747641148455168); centre_of_healpix_nest ----------------------------- (1.82894692 , 0.0611287759) (1 row) select centre_of_healpix_ring(12, 23639076); centre_of_healpix_ring ---------------------------- (2.86220291 , 0.871291044) (1 row) select centre_of_healpix_ring(12, 156589092); centre_of_healpix_ring ----------------------------- (5.90429205 , -0.588965722) (1 row) select centre_of_healpix_nest(10, 7898846); centre_of_healpix_nest ----------------------------- (4.23608795 , -0.203218782) (1 row) select centre_of_healpix_nest(26, 8575286206583616); centre_of_healpix_nest --------------------------- (2.17893481 , 1.21968151) (1 row) select centre_of_healpix_ring(7, 50755); centre_of_healpix_ring ---------------------------- (3.96380636 , 0.505648627) (1 row) select centre_of_healpix_nest(17, 198580473642); centre_of_healpix_nest ---------------------------- (5.0837076 , -0.816424759) (1 row) select centre_of_healpix_ring(7, 126763); centre_of_healpix_ring ------------------------------ (0.533825314 , -0.295968803) (1 row) select centre_of_healpix_ring(19, 1731132978273); centre_of_healpix_ring ------------------------------- (0.187436274 , -0.0496585193) (1 row) select centre_of_healpix_nest(15, 4727946330); centre_of_healpix_nest ------------------------------ (0.285536143 , 0.0328835302) (1 row) select centre_of_healpix_nest(8, 202866); centre_of_healpix_nest ---------------------------- (5.61743765 , 0.301418444) (1 row) select centre_of_healpix_ring(5, 1684); centre_of_healpix_ring ---------------------------- (3.27700613 , 0.812832076) (1 row) select centre_of_healpix_nest(6, 30592); centre_of_healpix_nest ----------------------------- (5.00691329 , 0.0938878751) (1 row) select centre_of_healpix_nest(17, 18895710150); centre_of_healpix_nest -------------------------- (2.494834 , 0.334425684) (1 row) select centre_of_healpix_nest(16, 36556541); centre_of_healpix_nest ----------------------------- (0.72692713 , 0.0688817688) (1 row) select centre_of_healpix_nest(6, 37672); centre_of_healpix_nest -------------------------- (2.235364 , -1.06796306) (1 row) select centre_of_healpix_ring(8, 334602); centre_of_healpix_ring ---------------------------- (1.63215556 , 0.148988081) (1 row) select centre_of_healpix_ring(9, 1620472); centre_of_healpix_ring ------------------------------ (4.68784529 , -0.0299523951) (1 row) select centre_of_healpix_nest(18, 334249431051); centre_of_healpix_nest ---------------------------- (0.236802292 , 0.41106904) (1 row) select centre_of_healpix_ring(4, 775); centre_of_healpix_ring ---------------------------- (3.87790343 , 0.523598776) (1 row) select centre_of_healpix_ring(6, 19692); centre_of_healpix_ring --------------------------- (2.6507188 , 0.199232087) (1 row) select centre_of_healpix_ring(19, 1938502919617); centre_of_healpix_ring ----------------------------- (4.54499782 , -0.176283414) (1 row) select centre_of_healpix_ring(27, 158155499442294528); centre_of_healpix_ring ----------------------------- (2.26439234 , -0.481638965) (1 row) select centre_of_healpix_nest(24, 3156659896819272); centre_of_healpix_nest ----------------------------- (5.56646283 , -0.906098828) (1 row) select centre_of_healpix_ring(15, 12868132370); centre_of_healpix_ring ---------------------------- (5.37330587 , -1.49861959) (1 row) select centre_of_healpix_nest(9, 1297166); centre_of_healpix_nest ----------------------------- (-0.050621366 , 0.43838658) (1 row) select centre_of_healpix_nest(4, 1132); centre_of_healpix_nest ------------------------------ (0.196349541 , 0.0416787324) (1 row) select centre_of_healpix_ring(15, 9446349215); centre_of_healpix_ring ----------------------------- (2.67063658 , -0.485067307) (1 row) select centre_of_healpix_nest(5, 269); centre_of_healpix_nest ---------------------------- (1.20264094 , 0.476119061) (1 row) select centre_of_healpix_nest(26, 12978495580532736); centre_of_healpix_nest --------------------------- (3.64538437 , 1.07723675) (1 row) select centre_of_healpix_ring(10, 3320172); centre_of_healpix_ring ----------------------------- (0.558369007 , 0.491563918) (1 row) select centre_of_healpix_nest(13, 183816574); centre_of_healpix_nest -------------------------- (3.4062215 , 1.03888848) (1 row) select centre_of_healpix_ring(11, 2159036); centre_of_healpix_ring --------------------------- (3.13327756 , 1.15354769) (1 row) select centre_of_healpix_ring(22, 15660794913993); centre_of_healpix_ring --------------------------- (1.47527183 , 1.01908945) (1 row) select centre_of_healpix_nest(26, 53218345157724864); centre_of_healpix_nest ----------------------------- (5.75579196 , -0.448569531) (1 row) select centre_of_healpix_nest(24, 3214377331206264); centre_of_healpix_nest ---------------------------- (5.6277878 , -0.662677436) (1 row) select centre_of_healpix_nest(17, 58757355986); centre_of_healpix_nest ---------------------------- (5.57754534 , 0.777557918) (1 row) select centre_of_healpix_nest(6, 25793); centre_of_healpix_nest ----------------------------- (3.54656358 , -0.146355259) (1 row) select centre_of_healpix_ring(22, 143504477729511); centre_of_healpix_ring ----------------------------- (5.77264796 , -0.367782872) (1 row) select centre_of_healpix_ring(20, 4252777630460); centre_of_healpix_ring ---------------------------- (4.39753343 , 0.363292409) (1 row) select centre_of_healpix_ring(8, 45524); centre_of_healpix_ring --------------------------- (2.33538924 , 1.08441072) (1 row) select centre_of_healpix_ring(21, 21991618730082); centre_of_healpix_ring ---------------------------- (4.68024879 , 0.167394883) (1 row) select centre_of_healpix_nest(10, 5661014); centre_of_healpix_nest ------------------------------ (1.83847597 , -0.0208348407) (1 row) select centre_of_healpix_ring(9, 177472); centre_of_healpix_ring --------------------------- (2.42735473 , 1.09098033) (1 row) select centre_of_healpix_ring(23, 94151018134101); centre_of_healpix_ring ---------------------------- (6.00049465 , 0.889894949) (1 row) select centre_of_healpix_nest(24, 3251841897559872); centre_of_healpix_nest ----------------------------- (5.06239819 , -0.856932504) (1 row) select centre_of_healpix_nest(12, 22593063); centre_of_healpix_nest ---------------------------- (2.81907319 , 0.693829088) (1 row) select centre_of_healpix_nest(16, 50581110835); centre_of_healpix_nest ----------------------------- (5.55454443 , -0.495132814) (1 row) select centre_of_healpix_ring(26, 14476441975155264); centre_of_healpix_ring ---------------------------- (2.17582142 , 0.482803475) (1 row) select centre_of_healpix_nest(23, 500109778740276); centre_of_healpix_nest ---------------------------- (4.82156246 , -0.29927969) (1 row) select centre_of_healpix_ring(12, 28726413); centre_of_healpix_ring --------------------------- (2.4011632 , 0.796067817) (1 row) select centre_of_healpix_nest(12, 85695251); centre_of_healpix_nest ----------------------------- (1.65133032 , -0.294777907) (1 row) select centre_of_healpix_nest(6, 37729); centre_of_healpix_nest ----------------------------- (2.44156386 , -0.975173929) (1 row) select centre_of_healpix_ring(22, 145885972453206); centre_of_healpix_ring ------------------------------ (0.413344343 , -0.392078095) (1 row) select centre_of_healpix_ring(17, 33609987894); centre_of_healpix_ring ---------------------------- (3.62606713 , 0.739529776) (1 row) select centre_of_healpix_ring(27, 47656973132542464); centre_of_healpix_ring ---------------------------- (2.08828116 , 0.593281103) (1 row) select centre_of_healpix_nest(25, 10560880425416976); centre_of_healpix_nest ----------------------------- (2.67944682 , -0.858995527) (1 row) select centre_of_healpix_nest(11, 8655639); centre_of_healpix_nest ---------------------------- (4.15018502 , 0.202221804) (1 row) select centre_of_healpix_ring(13, 607290142); centre_of_healpix_ring ----------------------------- (3.29460724 , -0.533116013) (1 row) select centre_of_healpix_nest(28, 541123539656103936); centre_of_healpix_nest ----------------------------- (4.30106726 , -0.242404008) (1 row) select centre_of_healpix_nest(6, 3386); centre_of_healpix_nest --------------------------- (1.06901417 , 1.10738145) (1 row) select centre_of_healpix_ring(13, 384622849); centre_of_healpix_ring ---------------------------- (1.62017133 , 0.044774073) (1 row) select centre_of_healpix_nest(25, 7428787477467504); centre_of_healpix_nest ------------------------------ (2.91098227 , -0.0180502004) (1 row) select centre_of_healpix_ring(21, 26510317798031); centre_of_healpix_ring ------------------------------ (4.0870158 , -0.00462470114) (1 row) select centre_of_healpix_ring(27, 80940625510037760); centre_of_healpix_ring ------------------------------ (-0.113152056 , 0.253866897) (1 row) select centre_of_healpix_ring(8, 12430); centre_of_healpix_ring --------------------------- (2.11759252 , 1.31815926) (1 row) select centre_of_healpix_nest(4, 1604); centre_of_healpix_nest ----------------------------- (3.63246651 , -0.209870592) (1 row) select centre_of_healpix_ring(24, 3127655356275960); centre_of_healpix_ring ---------------------------- (4.03177356 , -1.01968666) (1 row) select centre_of_healpix_nest(26, 35903941340341056); centre_of_healpix_nest ---------------------------- (4.60895098 , 0.501365753) (1 row) select centre_of_healpix_nest(23, 220156505312616); centre_of_healpix_nest ---------------------------- (5.28740576 , 0.234501561) (1 row) select centre_of_healpix_ring(15, 6410546556); centre_of_healpix_ring ------------------------------ (0.558177259 , 0.0049438678) (1 row) select centre_of_healpix_ring(12, 70870934); centre_of_healpix_ring ---------------------------- (0.74493942 , 0.300395938) (1 row) select centre_of_healpix_nest(18, 796344875135); centre_of_healpix_nest ----------------------------- (5.33933172 , -0.722575103) (1 row) select centre_of_healpix_nest(26, 32943386695570176); centre_of_healpix_nest ----------------------------- (5.29436766 , -0.119669223) (1 row) select centre_of_healpix_nest(24, 796828862563788); centre_of_healpix_nest --------------------------- (4.42403795 , 1.11921749) (1 row) select centre_of_healpix_nest(4, 2611); centre_of_healpix_nest ---------------------------- (3.92699082 , -1.00181067) (1 row) select centre_of_healpix_nest(14, 1435532044); centre_of_healpix_nest ----------------------------- (2.11535951 , -0.028446219) (1 row) select centre_of_healpix_ring(7, 54677); centre_of_healpix_ring --------------------------- (1.8285051 , 0.458616879) (1 row) select centre_of_healpix_ring(11, 37188057); centre_of_healpix_ring ------------------------------ (0.363169952 , -0.498222163) (1 row) select centre_of_healpix_ring(18, 717699494335); centre_of_healpix_ring ----------------------------- (5.85414929 , -0.834036367) (1 row) select centre_of_healpix_nest(17, 88295259690); centre_of_healpix_nest ---------------------------- (1.3474643 , -0.375502334) (1 row) select centre_of_healpix_nest(26, 50295206460953856); centre_of_healpix_nest ---------------------------- (4.86378318 , -1.12394913) (1 row) select centre_of_healpix_nest(13, 604197507); centre_of_healpix_nest ---------------------------- (2.53669639 , -1.49792144) (1 row) select centre_of_healpix_ring(7, 53681); centre_of_healpix_ring --------------------------- (2.1721168 , 0.470267765) (1 row) select centre_of_healpix_nest(26, 29553050609915712); centre_of_healpix_nest ------------------------------ (2.74722599 , -0.0199864402) (1 row) select centre_of_healpix_nest(23, 573802897123704); centre_of_healpix_nest ----------------------------- (0.647756435 , -1.09077481) (1 row) select centre_of_healpix_ring(16, 2916385746); centre_of_healpix_ring --------------------------- (4.97435977 , 1.09044161) (1 row) select centre_of_healpix_ring(28, 713181272405919744); centre_of_healpix_ring ----------------------------- (1.78834596 , -0.707009609) (1 row) select centre_of_healpix_nest(9, 2802397); centre_of_healpix_nest ----------------------------- (3.51741795 , -0.658560681) (1 row) select centre_of_healpix_ring(22, 111842661570519); centre_of_healpix_ring ------------------------------ (3.85564554 , -0.0596218423) (1 row) select centre_of_healpix_nest(10, 848225); centre_of_healpix_nest ------------------------- (0.812436461 , 1.07948) (1 row) select centre_of_healpix_ring(17, 38106811811); centre_of_healpix_ring ---------------------------- (2.98708004 , 0.681959082) (1 row) select centre_of_healpix_nest(14, 925009876); centre_of_healpix_nest ---------------------------- (5.85764921 , 0.810632301) (1 row) select centre_of_healpix_nest(18, 156616712796); centre_of_healpix_nest ---------------------------- (4.44795706 , 0.578532888) (1 row) select centre_of_healpix_nest(5, 1044); centre_of_healpix_nest ---------------------------- (2.50345665 , 0.146355259) (1 row) select centre_of_healpix_ring(25, 3879154053677472); centre_of_healpix_ring ---------------------------- (2.66914607 , 0.439812532) (1 row) select centre_of_healpix_ring(6, 9534); centre_of_healpix_ring --------------------------- (4.6633016 , 0.661857664) (1 row) select centre_of_healpix_ring(14, 1567279613); centre_of_healpix_ring ----------------------------- (1.81594563 , 0.0268994027) (1 row) select centre_of_healpix_nest(16, 28086844830); centre_of_healpix_nest ----------------------------- (2.60789917 , -0.186276406) (1 row) select centre_of_healpix_nest(15, 5923434133); centre_of_healpix_nest ---------------------------- (1.30194223 , -0.22520613) (1 row) select centre_of_healpix_nest(17, 157931199308); centre_of_healpix_nest --------------------------- (2.4807579 , -1.05057173) (1 row) select centre_of_healpix_nest(13, 730302836); centre_of_healpix_nest ----------------------------- (3.76688157 , -0.412387184) (1 row) select centre_of_healpix_ring(20, 7843334530499); centre_of_healpix_ring ----------------------------- (1.09440391 , -0.190054154) (1 row) select centre_of_healpix_nest(7, 33271); centre_of_healpix_nest ---------------------------- (4.03743743 , 0.236575611) (1 row) select centre_of_healpix_ring(15, 8059818847); centre_of_healpix_ring ------------------------------ (0.237743054 , -0.253773048) (1 row) select centre_of_healpix_nest(25, 2822353174832832); centre_of_healpix_nest ---------------------------- (3.54877055 , 0.441084694) (1 row) select centre_of_healpix_ring(15, 7002952372); centre_of_healpix_ring ------------------------------ (4.94193482 , -0.0871055514) (1 row) select centre_of_healpix_ring(13, 621203432); centre_of_healpix_ring ------------------------------ (0.780892095 , -0.573774544) (1 row) select centre_of_healpix_ring(14, 2077789940); centre_of_healpix_ring ------------------------------ (0.367004904 , -0.294310173) (1 row) select centre_of_healpix_nest(15, 8709767142); centre_of_healpix_nest ---------------------------- (1.12044586 , -1.11086257) (1 row) select centre_of_healpix_ring(21, 37201393479632); centre_of_healpix_ring ----------------------------- (1.17499371 , -0.422201572) (1 row) select centre_of_healpix_ring(17, 100556860212); centre_of_healpix_ring ----------------------------- (3.07778864 , 0.0244724541) (1 row) select centre_of_healpix_ring(5, 6087); centre_of_healpix_ring ------------------------ (0.368155389 , 0) (1 row) select centre_of_healpix_nest(20, 9305529977729); centre_of_healpix_nest ----------------------------- (1.21488357 , -0.519414821) (1 row) select centre_of_healpix_ring(28, 672180696943881216); centre_of_healpix_ring ---------------------------- (4.9298008 , -0.588038639) (1 row) select centre_of_healpix_ring(8, 154370); centre_of_healpix_ring ---------------------------- (1.58306817 , 0.651991787) (1 row) select centre_of_healpix_ring(27, 204140869291867392); centre_of_healpix_ring ---------------------------- (4.86002199 , -1.09446364) (1 row) select centre_of_healpix_nest(23, 584838544598424); centre_of_healpix_nest ----------------------------- (1.17412517 , -0.792110344) (1 row) select centre_of_healpix_ring(15, 5391830951); centre_of_healpix_ring ---------------------------- (5.68989427 , 0.163817663) (1 row) select centre_of_healpix_nest(25, 10247294107160352); centre_of_healpix_nest ---------------------------- (2.63736837 , -1.11971325) (1 row) select centre_of_healpix_ring(23, 433805540837073); centre_of_healpix_ring ------------------------------- (0.512676341 , -0.0274614039) (1 row) select centre_of_healpix_nest(8, 753337); centre_of_healpix_nest ----------------------------- (5.81378719 , -0.418346386) (1 row) select centre_of_healpix_ring(12, 163316508); centre_of_healpix_ring ----------------------------- (3.44704658 , -0.671799967) (1 row) select centre_of_healpix_nest(24, 132313761289944); centre_of_healpix_nest ---------------------------- (1.19503968 , 0.895084776) (1 row) select centre_of_healpix_nest(11, 22447029); centre_of_healpix_nest ------------------------------ (2.01066532 , -0.0247421077) (1 row) select centre_of_healpix_nest(15, 328716562); centre_of_healpix_nest ---------------------------- (1.16781478 , 0.631419726) (1 row) select centre_of_healpix_ring(8, 409496); centre_of_healpix_ring ------------------------------ (2.50652461 , -0.0416787324) (1 row) select centre_of_healpix_nest(25, 7923715822875552); centre_of_healpix_nest ---------------------------- (4.6326966 , -0.524296784) (1 row) select centre_of_healpix_nest(13, 247418948); centre_of_healpix_nest ---------------------------- (4.77458307 , 0.915989978) (1 row) select centre_of_healpix_nest(14, 1195779886); centre_of_healpix_nest ----------------------------- (0.501372033 , 0.120489898) (1 row) select centre_of_healpix_nest(11, 27193973); centre_of_healpix_nest ---------------------------- (3.43419949 , 0.221867862) (1 row) select centre_of_healpix_ring(19, 7947332529); centre_of_healpix_ring --------------------------- (3.28590896 , 1.47258659) (1 row) select centre_of_healpix_nest(5, 6451); centre_of_healpix_nest ----------------------------- (3.53429174 , -0.104355973) (1 row) select centre_of_healpix_nest(10, 8181427); centre_of_healpix_nest ---------------------------- (4.76761229 , 0.254697961) (1 row) select centre_of_healpix_nest(11, 14129363); centre_of_healpix_nest ---------------------------- (6.12750116 , 0.836379585) (1 row) select centre_of_healpix_ring(22, 58668935737888); centre_of_healpix_ring ---------------------------- (3.60659256 , 0.460254566) (1 row) select centre_of_healpix_nest(19, 2478922471255); centre_of_healpix_nest ---------------------------- (2.68580781 , -1.41252811) (1 row) select centre_of_healpix_nest(16, 49343427381); centre_of_healpix_nest ----------------------------- (5.94574549 , -0.453767076) (1 row) select centre_of_healpix_ring(23, 90087677211315); centre_of_healpix_ring ---------------------------- (1.09219568 , 0.905330889) (1 row) select centre_of_healpix_ring(6, 61); centre_of_healpix_ring ---------------------------- (0.392699082 , 1.49423107) (1 row) select centre_of_healpix_nest(7, 183325); centre_of_healpix_nest ---------------------------- (5.55085459 , -1.09426315) (1 row) select centre_of_healpix_ring(10, 3956521); centre_of_healpix_ring ---------------------------- (2.81255377 , 0.380186598) (1 row) select centre_of_healpix_nest(24, 1618756661694108); centre_of_healpix_nest ----------------------------- (1.59496158 , 0.0223496685) (1 row) select centre_of_healpix_ring(9, 471411); centre_of_healpix_ring ---------------------------- (6.25565589 , 0.776652844) (1 row) select centre_of_healpix_nest(8, 81944); centre_of_healpix_nest --------------------------- (2.7550295 , 0.359239626) (1 row) select centre_of_healpix_nest(21, 50336408282729); centre_of_healpix_nest ----------------------------- (5.94185773 , -0.582861274) (1 row) select centre_of_healpix_ring(7, 105426); centre_of_healpix_ring ------------------------------ (2.58322365 , -0.0729814361) (1 row) select centre_of_healpix_ring(8, 551619); centre_of_healpix_ring ----------------------------- (1.19650501 , -0.415498246) (1 row) select centre_of_healpix_ring(6, 10826); centre_of_healpix_ring ---------------------------- (4.97009775 , 0.597406417) (1 row) select centre_of_healpix_ring(19, 456144295505); centre_of_healpix_ring ---------------------------- (3.12838178 , 0.808752002) (1 row) select centre_of_healpix_ring(8, 86919); centre_of_healpix_ring ---------------------------- (6.09816362 , 0.894582592) (1 row) select centre_of_healpix_nest(12, 32821840); centre_of_healpix_nest --------------------------- (2.73466774 , 1.33362428) (1 row) select centre_of_healpix_nest(11, 10260771); centre_of_healpix_nest ---------------------------- (4.34347037 , 0.822692434) (1 row) select centre_of_healpix_nest(15, 12140314131); centre_of_healpix_nest ---------------------------- (5.9061695 , -0.824218005) (1 row) select centre_of_healpix_ring(15, 5585571293); centre_of_healpix_ring ----------------------------- (0.170128057 , 0.133390827) (1 row) select centre_of_healpix_nest(6, 10998); centre_of_healpix_nest ---------------------------- (3.21711171 , 0.894582592) (1 row) select centre_of_healpix_nest(23, 117828408342789); centre_of_healpix_nest ---------------------------- (1.68761528 , 0.780574579) (1 row) select centre_of_healpix_ring(27, 59064740134010880); centre_of_healpix_ring ---------------------------- (1.26419192 , 0.470734902) (1 row) select centre_of_healpix_nest(21, 33803177399951); centre_of_healpix_nest ---------------------------- (4.10078904 , 0.125163465) (1 row) select centre_of_healpix_nest(24, 1826775614454120); centre_of_healpix_nest ---------------------------- (3.61366859 , 0.258234093) (1 row) select centre_of_healpix_nest(28, 212880669794460672); centre_of_healpix_nest --------------------------- (4.32645116 , 1.31034562) (1 row) select centre_of_healpix_nest(15, 3359620743); centre_of_healpix_nest --------------------------- (5.29784234 , 0.24925676) (1 row) select centre_of_healpix_nest(19, 1127731680822); centre_of_healpix_nest ------------------------------- (0.0668495046 , -0.354554975) (1 row) select centre_of_healpix_nest(22, 89212640176039); centre_of_healpix_nest ----------------------------- (1.72059127 , -0.438945415) (1 row) select centre_of_healpix_nest(12, 89747364); centre_of_healpix_nest ------------------------------ (2.12111193 , 0.00764981419) (1 row) select centre_of_healpix_ring(6, 10409); centre_of_healpix_ring --------------------------- (1.0062914 , 0.610060035) (1 row) select centre_of_healpix_nest(5, 11776); centre_of_healpix_nest ---------------------------- (4.75858887 , -1.13355791) (1 row) select centre_of_healpix_nest(11, 8686187); centre_of_healpix_nest ---------------------------- (4.05661219 , 0.231555913) (1 row) select centre_of_healpix_nest(10, 10876624); centre_of_healpix_nest ---------------------------- (4.53137925 , -0.56855087) (1 row) select centre_of_healpix_nest(24, 1894683396160176); centre_of_healpix_nest ---------------------------- (2.65854188 , 0.196615013) (1 row) select centre_of_healpix_nest(22, 182735075763924); centre_of_healpix_nest ----------------------------- (4.14108734 , -0.813849691) (1 row) select centre_of_healpix_ring(23, 590933913725286); centre_of_healpix_ring ----------------------------- (3.18346067 , -0.411094268) (1 row) select centre_of_healpix_ring(23, 104194933696725); centre_of_healpix_ring ---------------------------- (6.26492939 , 0.852939013) (1 row) select centre_of_healpix_nest(6, 22093); centre_of_healpix_nest ------------------------------ (1.87759248 , -0.0208348407) (1 row) select centre_of_healpix_nest(14, 426353707); centre_of_healpix_nest ---------------------------- (2.18870296 , 0.728472756) (1 row) select centre_of_healpix_ring(23, 697517322959850); centre_of_healpix_ring ----------------------------- (3.95747466 , -0.710288959) (1 row) select centre_of_healpix_ring(6, 20934); centre_of_healpix_ring ---------------------------- (1.73033033 , 0.146355259) (1 row) select centre_of_healpix_ring(22, 162988335867693); centre_of_healpix_ring ----------------------------- (2.27404768 , -0.575358647) (1 row) select centre_of_healpix_nest(21, 18903077968495); centre_of_healpix_nest ------------------------------ (0.420366163 , -0.129347052) (1 row) select centre_of_healpix_ring(4, 1433); centre_of_healpix_ring ------------------------------- (-0.638136008 , 0.0834300866) (1 row) select centre_of_healpix_nest(26, 4534086012358464); centre_of_healpix_nest ----------------------------- (2.37196283 , 0.0961574581) (1 row) select centre_of_healpix_ring(20, 2044035672759); centre_of_healpix_ring ---------------------------- (3.00417212 , 0.761710199) (1 row) select centre_of_healpix_nest(4, 2374); centre_of_healpix_nest ----------------------------- (2.94524311 , -0.948427838) (1 row) select centre_of_healpix_ring(24, 1742464464305352); centre_of_healpix_ring ------------------------------ (2.24413679 , -0.0317515634) (1 row) select centre_of_healpix_ring(4, 1875); centre_of_healpix_ring ----------------------------- (5.00691329 , -0.209870592) (1 row) select centre_of_healpix_nest(20, 6380933467350); centre_of_healpix_nest --------------------------- (1.5882491 , 0.257447742) (1 row) select centre_of_healpix_nest(21, 47966645501850); centre_of_healpix_nest ---------------------------- (3.6344293 , -0.417417008) (1 row) select centre_of_healpix_nest(16, 5566476229); centre_of_healpix_nest ---------------------------- (2.64538582 , 0.585495363) (1 row) select centre_of_healpix_nest(15, 11667645314); centre_of_healpix_nest ----------------------------- (4.16454212 , -0.245081192) (1 row) select centre_of_healpix_ring(28, 260837993758162944); centre_of_healpix_ring ---------------------------- (2.54084743 , 0.407909203) (1 row) select centre_of_healpix_ring(7, 42769); centre_of_healpix_ring ---------------------------- (0.21475731 , 0.597406417) (1 row) select centre_of_healpix_ring(16, 40700063880); centre_of_healpix_ring ----------------------------- (5.79558315 , -0.617950685) (1 row) select centre_of_healpix_nest(19, 1506495333618); centre_of_healpix_nest ---------------------------- (1.86018989 , 0.175947613) (1 row) select centre_of_healpix_nest(17, 175826983607); centre_of_healpix_nest ----------------------------- (3.92906989 , -0.934139588) (1 row) select centre_of_healpix_nest(27, 108957779962841856); centre_of_healpix_nest ----------------------------- (3.15110869 , -0.483741426) (1 row) select centre_of_healpix_nest(23, 540667416984510); centre_of_healpix_nest ---------------------------- (4.06268436 , 0.112856111) (1 row) select centre_of_healpix_nest(23, 137825919779085); centre_of_healpix_nest -------------------------- (2.96333939 , 1.3630492) (1 row) select centre_of_healpix_nest(4, 1097); centre_of_healpix_nest ------------------------------ (0.343611696 , -0.167448079) (1 row) select centre_of_healpix_ring(10, 11095051); centre_of_healpix_ring ---------------------------- (6.19490765 , -0.86831963) (1 row) select centre_of_healpix_nest(26, 10898162737721472); centre_of_healpix_nest ---------------------------- (4.06336282 , 0.804144822) (1 row) select centre_of_healpix_ring(24, 525708146363268); centre_of_healpix_ring -------------------------- (3.13791277 , 0.7597197) (1 row) select centre_of_healpix_nest(25, 7869751756360896); centre_of_healpix_nest ---------------------------- (3.22870299 , 0.634339142) (1 row) select centre_of_healpix_nest(26, 32666533368757440); centre_of_healpix_nest ----------------------------- (5.09212113 , -0.281775306) (1 row) select centre_of_healpix_nest(24, 630079962106392); centre_of_healpix_nest ---------------------------- (3.97851484 , 0.592857625) (1 row) select centre_of_healpix_ring(22, 73518473039645); centre_of_healpix_ring ------------------------------ (-0.188764463 , 0.308356623) (1 row) select centre_of_healpix_nest(7, 21748); centre_of_healpix_nest ---------------------------- (2.95751496 , 0.695311946) (1 row) select centre_of_healpix_nest(27, 209387279675877120); centre_of_healpix_nest ---------------------------- (5.2876975 , -0.577659112) (1 row) select centre_of_healpix_ring(16, 43658314709); centre_of_healpix_ring ----------------------------- (5.85423467 , -0.767254202) (1 row) select centre_of_healpix_nest(20, 12244529311815); centre_of_healpix_nest -------------------------- (4.875806 , -1.23623055) (1 row) select centre_of_healpix_ring(8, 232218); centre_of_healpix_ring ---------------------------- (1.73033033 , 0.421198138) (1 row) select centre_of_healpix_nest(14, 3101754484); centre_of_healpix_nest ----------------------------- (4.98349235 , -0.878341719) (1 row) select centre_of_healpix_nest(9, 2876664); centre_of_healpix_nest ----------------------------- (3.87483547 , -0.174054584) (1 row) select centre_of_healpix_nest(11, 14885587); centre_of_healpix_nest ---------------------------- (5.07594243 , 0.562767153) (1 row) select centre_of_healpix_nest(9, 1715953); centre_of_healpix_nest ----------------------------- (2.62770909 , -0.112214521) (1 row) select centre_of_healpix_ring(13, 239458991); centre_of_healpix_ring ---------------------------- (1.30992372 , 0.417277913) (1 row) select centre_of_healpix_nest(21, 27799228047781); centre_of_healpix_nest ----------------------------- (3.66964419 , -0.111446786) (1 row) select centre_of_healpix_ring(4, 1082); centre_of_healpix_ring ---------------------------- (2.55254403 , 0.295968803) (1 row) select centre_of_healpix_nest(13, 611734915); centre_of_healpix_nest ---------------------------- (2.74559229 , -1.05529533) (1 row) select centre_of_healpix_ring(6, 15137); centre_of_healpix_ring ---------------------------- (3.95153451 , 0.395659332) (1 row) select centre_of_healpix_nest(21, 10705018741137); centre_of_healpix_nest ---------------------------- (4.18049472 , 0.873451437) (1 row) select centre_of_healpix_ring(23, 359597207691333); centre_of_healpix_ring ---------------------------- (2.59704249 , 0.148851787) (1 row) select centre_of_healpix_ring(10, 10645781); centre_of_healpix_ring ----------------------------- (2.15425777 , -0.764532542) (1 row) select centre_of_healpix_nest(20, 3923787457880); centre_of_healpix_nest ---------------------------- (5.33882389 , 0.621924356) (1 row) select centre_of_healpix_nest(5, 11063); centre_of_healpix_nest ---------------------------- (3.9760782 , -0.406975126) (1 row) select centre_of_healpix_ring(7, 99385); centre_of_healpix_ring ------------------------------ (3.84722382 , -0.0104168551) (1 row) select centre_of_healpix_ring(13, 715189606); centre_of_healpix_ring ----------------------------- (5.94401217 , -0.888557255) (1 row) select centre_of_healpix_nest(4, 1659); centre_of_healpix_nest ---------------------------- (3.43611696 , 0.209870592) (1 row) select centre_of_healpix_nest(23, 433381862541534); centre_of_healpix_nest ----------------------------- (2.80866817 , -0.390148537) (1 row) select centre_of_healpix_nest(15, 12381569215); centre_of_healpix_nest ----------------------------- (5.15820925 , -0.846434796) (1 row) select centre_of_healpix_ring(28, 545178676896473088); centre_of_healpix_ring ----------------------------- (3.09562117 , -0.264036209) (1 row) select centre_of_healpix_ring(19, 721948443643); centre_of_healpix_ring ---------------------------- (2.16289943 , 0.597117312) (1 row) select centre_of_healpix_nest(25, 11785044488625696); centre_of_healpix_nest ----------------------------- (4.40014103 , -0.471188971) (1 row) select centre_of_healpix_ring(5, 3026); centre_of_healpix_ring ----------------------------- (0.908116626 , 0.523598776) (1 row) select centre_of_healpix_nest(4, 755); centre_of_healpix_nest --------------------------- (3.92699082 , 1.31494387) (1 row) select centre_of_healpix_nest(4, 1006); centre_of_healpix_nest --------------------------- (4.84328867 , 1.26340128) (1 row) select centre_of_healpix_ring(8, 589428); centre_of_healpix_ring ------------------------------ (0.714835047 , -0.523598776) (1 row) select centre_of_healpix_nest(8, 476910); centre_of_healpix_nest ----------------------------- (5.13883564 , -0.141092659) (1 row) select centre_of_healpix_nest(26, 20215913898550272); centre_of_healpix_nest ----------------------------- (0.437104755 , 0.227807779) (1 row) select centre_of_healpix_ring(8, 263230); centre_of_healpix_ring ---------------------------- (3.52201989 , 0.337076117) (1 row) select centre_of_healpix_nest(26, 23224023091153536); centre_of_healpix_nest ----------------------------- (1.26086114 , -0.414876464) (1 row) select centre_of_healpix_nest(4, 2775); centre_of_healpix_nest ----------------------------- (4.22151513 , -0.295968803) (1 row) select centre_of_healpix_nest(21, 50855213552015); centre_of_healpix_nest ---------------------------- (5.2253348 , -0.920633222) (1 row) select centre_of_healpix_nest(16, 22739550370); centre_of_healpix_nest ----------------------------- (1.87436873 , -0.133062395) (1 row) select centre_of_healpix_nest(21, 41537481248278); centre_of_healpix_nest ----------------------------- (2.79677842 , -0.606406442) (1 row) select centre_of_healpix_ring(13, 786405969); centre_of_healpix_ring ---------------------------- (2.40243947 , -1.26319956) (1 row) select centre_of_healpix_ring(6, 33657); centre_of_healpix_ring ------------------------------- (-0.171805848 , -0.373185298) (1 row) select centre_of_healpix_ring(25, 4747485722356464); centre_of_healpix_ring ---------------------------- (3.18659267 , 0.301791209) (1 row) select centre_of_healpix_nest(12, 45443918); centre_of_healpix_nest ---------------------------- (3.60825991 , 0.951358706) (1 row) select centre_of_healpix_nest(18, 442269984503); centre_of_healpix_nest ---------------------------- (3.33358593 , 0.124704989) (1 row) select centre_of_healpix_nest(20, 5883419355687); centre_of_healpix_nest ----------------------------- (2.12965519 , 0.0225397757) (1 row) select centre_of_healpix_ring(24, 2889283911166860); centre_of_healpix_ring ----------------------------- (4.38899059 , -0.790634527) (1 row) select centre_of_healpix_ring(5, 4263); centre_of_healpix_ring ---------------------------- (5.05600068 , 0.317823704) (1 row) select centre_of_healpix_ring(7, 60803); centre_of_healpix_ring ---------------------------- (1.60761187 , 0.390021535) (1 row) select centre_of_healpix_ring(7, 126414); centre_of_healpix_ring ----------------------------- (2.52800034 , -0.290528204) (1 row) select centre_of_healpix_ring(15, 5240814494); centre_of_healpix_ring ---------------------------- (4.65862775 , 0.187622285) (1 row) select centre_of_healpix_nest(15, 4679860430); centre_of_healpix_nest ------------------------------ (0.496985807 , 0.0473402716) (1 row) select centre_of_healpix_ring(24, 2724511556131044); centre_of_healpix_ring ---------------------------- (2.33991734 , -0.66014946) (1 row) select centre_of_healpix_ring(12, 24290244); centre_of_healpix_ring --------------------------- (3.0489675 , 0.861309162) (1 row) select centre_of_healpix_nest(23, 443737179389067); centre_of_healpix_nest ------------------------------ (3.50822511 , -0.0881001535) (1 row) select centre_of_healpix_nest(16, 24595100522); centre_of_healpix_nest --------------------------- (1.1244199 , 0.202387953) (1 row) select centre_of_healpix_ring(12, 150216911); centre_of_healpix_ring ------------------------------- (0.0793835058 , -0.514787913) (1 row) select centre_of_healpix_nest(17, 166706256311); centre_of_healpix_nest ---------------------------- (2.07649467 , -0.58952246) (1 row) select centre_of_healpix_ring(19, 3012569586741); centre_of_healpix_ring ------------------------------ (0.222135185 , -0.973059075) (1 row) select centre_of_healpix_nest(5, 1184); centre_of_healpix_nest ---------------------------- (2.06167018 , 0.274258613) (1 row) select centre_of_healpix_ring(10, 4281154); centre_of_healpix_ring ---------------------------- (4.42093263 , 0.325372178) (1 row) select centre_of_healpix_ring(13, 524180690); centre_of_healpix_ring ----------------------------- (1.41471378 , -0.306621238) (1 row) select centre_of_healpix_nest(6, 42972); centre_of_healpix_nest ----------------------------- (4.36877728 , -0.418346386) (1 row) select centre_of_healpix_ring(21, 30787249416012); centre_of_healpix_ring ----------------------------- (3.95906997 , -0.167483543) (1 row) select centre_of_healpix_nest(27, 141057070214657280); centre_of_healpix_nest ---------------------------- (4.97105602 , 0.284814469) (1 row) select centre_of_healpix_nest(10, 9233852); centre_of_healpix_nest ------------------------------ (0.766990394 , -0.426197504) (1 row) select centre_of_healpix_nest(16, 5349298807); centre_of_healpix_nest ---------------------------- (2.32620996 , 0.653284984) (1 row) select centre_of_healpix_nest(26, 27966244521661056); centre_of_healpix_nest ----------------------------- (3.26167955 , -0.162003667) (1 row) select centre_of_healpix_nest(25, 3637003355050128); centre_of_healpix_nest ---------------------------- (5.36194436 , 0.560770669) (1 row) select centre_of_healpix_nest(28, 495823041389678592); centre_of_healpix_nest ---------------------------- (2.97694794 , 0.239698169) (1 row) select centre_of_healpix_ring(5, 4310); centre_of_healpix_ring ---------------------------- (1.10446617 , 0.295968803) (1 row) select centre_of_healpix_ring(9, 711781); centre_of_healpix_ring --------------------------- (0.3113981 , 0.578627051) (1 row) select centre_of_healpix_ring(16, 6353025132); centre_of_healpix_ring ----------------------------- (0.368235952 , 0.853318345) (1 row) select centre_of_healpix_ring(27, 194339818944215040); centre_of_healpix_ring ----------------------------- (4.71622738 , -0.923976741) (1 row) select centre_of_healpix_nest(11, 22810257); centre_of_healpix_nest --------------------------- (1.956209 , 0.0306037353) (1 row) select centre_of_healpix_nest(22, 156788698513444); centre_of_healpix_nest ------------------------------ (0.527832827 , -0.342556017) (1 row) select centre_of_healpix_nest(12, 84681028); centre_of_healpix_nest ----------------------------- (1.56350992 , -0.506579074) (1 row) select centre_of_healpix_ring(22, 41816477699847); centre_of_healpix_ring --------------------------- (5.02062605 , 0.64830326) (1 row) select centre_of_healpix_nest(7, 191852); centre_of_healpix_nest ----------------------------- (5.22780653 , -0.517595079) (1 row) select centre_of_healpix_nest(21, 40736166015669); centre_of_healpix_nest ---------------------------- (2.93052005 , -1.03298337) (1 row) select centre_of_healpix_ring(8, 751918); centre_of_healpix_ring ----------------------------- (0.845352222 , -1.14987933) (1 row) select centre_of_healpix_ring(27, 197271692919226368); centre_of_healpix_ring ---------------------------- (6.01984351 , -0.97043191) (1 row) select centre_of_healpix_nest(26, 10155744003415488); centre_of_healpix_nest ---------------------------- (4.38886378 , 0.417638546) (1 row) select centre_of_healpix_nest(10, 8220217); centre_of_healpix_nest ---------------------------- (4.94478707 , 0.359239626) (1 row) select centre_of_healpix_nest(18, 303100606235); centre_of_healpix_nest ------------------------------- (0.136626156 , -0.0242307849) (1 row) select centre_of_healpix_nest(24, 2785698734739600); centre_of_healpix_nest ----------------------------- (2.30124963 , -0.344552665) (1 row) select centre_of_healpix_nest(15, 7220087672); centre_of_healpix_nest ---------------------------- (2.71759078 , 0.169160921) (1 row) select centre_of_healpix_nest(27, 95141763424132608); centre_of_healpix_nest ----------------------------- (1.85731546 , -0.238864501) (1 row) select centre_of_healpix_ring(6, 48255); centre_of_healpix_ring ---------------------------- (2.05699519 , -1.30207559) (1 row) select centre_of_healpix_ring(23, 491080541059656); centre_of_healpix_ring ------------------------------ (0.647065753 , -0.163844487) (1 row) select centre_of_healpix_nest(20, 11176720369538); centre_of_healpix_nest ---------------------------- (3.25338588 , -1.17557132) (1 row) select centre_of_healpix_ring(23, 741909774374946); centre_of_healpix_ring ----------------------------- (4.56116354 , -0.859008533) (1 row) select centre_of_healpix_ring(22, 57419407468784); centre_of_healpix_ring ---------------------------- (5.56307121 , 0.473511419) (1 row) select centre_of_healpix_nest(8, 704709); centre_of_healpix_nest ---------------------------- (3.9361947 , -0.661857664) (1 row) select centre_of_healpix_nest(19, 893781667229); centre_of_healpix_nest ---------------------------- (5.90536614 , 0.383214683) (1 row) select centre_of_healpix_ring(12, 71752063); centre_of_healpix_ring -------------------------- (5.6446658 , 0.29137771) (1 row) select centre_of_healpix_nest(16, 36831449562); centre_of_healpix_nest ------------------------------ (0.617133413 , -0.789065833) (1 row) select centre_of_healpix_nest(8, 55238); centre_of_healpix_nest --------------------------- (1.49080207 , 1.22461074) (1 row) select centre_of_healpix_ring(15, 4319593095); centre_of_healpix_ring ---------------------------- (2.38723363 , 0.335782917) (1 row) select centre_of_healpix_ring(13, 352692945); centre_of_healpix_ring ---------------------------- (5.24333808 , 0.124425623) (1 row) select centre_of_healpix_nest(28, 116686047875343360); centre_of_healpix_nest ---------------------------- (2.05666772 , 0.833582186) (1 row) select centre_of_healpix_nest(10, 7721095); centre_of_healpix_nest ----------------------------- (5.34592305 , 0.0501512286) (1 row) select centre_of_healpix_ring(6, 20913); centre_of_healpix_ring ---------------------------- (1.21491278 , 0.146355259) (1 row) select centre_of_healpix_nest(17, 176710528483); centre_of_healpix_nest ----------------------------- (4.40374317 , -0.969913217) (1 row) select centre_of_healpix_ring(11, 41896412); centre_of_healpix_ring ---------------------------- (5.0778599 , -0.727110325) (1 row) select centre_of_healpix_nest(25, 11056931037767040); centre_of_healpix_nest ----------------------------- (2.50144273 , -0.459845485) (1 row) select centre_of_healpix_nest(27, 21050182967750400); centre_of_healpix_nest ---------------------------- (2.05603722 , 0.358196174) (1 row) select centre_of_healpix_nest(11, 13996192); centre_of_healpix_nest --------------------------- (6.1558649 , 0.707670111) (1 row) select centre_of_healpix_ring(16, 37213909794); centre_of_healpix_ring ----------------------------- (1.88455532 , -0.460160365) (1 row) select centre_of_healpix_nest(8, 624154); centre_of_healpix_nest ----------------------------- (1.88239451 , -0.975173929) (1 row) select centre_of_healpix_nest(20, 10928438563696); centre_of_healpix_nest ----------------------------- (2.37599842 , -0.284682387) (1 row) select centre_of_healpix_nest(13, 439438363); centre_of_healpix_nest ----------------------------- (2.78590086 , -0.129840424) (1 row) select centre_of_healpix_nest(23, 4300717187877); centre_of_healpix_nest ----------------------------- (0.759470199 , 0.296030619) (1 row) select centre_of_healpix_ring(23, 159114204510432); centre_of_healpix_ring ---------------------------- (2.00610532 , 0.672753451) (1 row) select centre_of_healpix_nest(10, 12068875); centre_of_healpix_nest --------------------------- (4.71623269 , -1.0770135) (1 row) select centre_of_healpix_nest(26, 46385801361653376); centre_of_healpix_nest ---------------------------- (4.3605251 , -0.881190757) (1 row) select centre_of_healpix_nest(20, 723689301477); centre_of_healpix_nest ----------------------------- (0.122609856 , 0.698289825) (1 row) select centre_of_healpix_nest(27, 72600036203185152); centre_of_healpix_nest ------------------------------- (0.0838350836 , -0.464642003) (1 row) select centre_of_healpix_ring(28, 519031082337119232); centre_of_healpix_ring ----------------------------- (2.56143034 , -0.201868807) (1 row) select centre_of_healpix_nest(24, 1452520726872312); centre_of_healpix_nest ----------------------------- (1.32826548 , -0.364693479) (1 row) select centre_of_healpix_ring(7, 14867); centre_of_healpix_ring --------------------------- (4.52060571 , 1.01508993) (1 row) select centre_of_healpix_ring(12, 191787536); centre_of_healpix_ring ---------------------------- (3.61376655 , -1.13192416) (1 row) select centre_of_healpix_nest(9, 2530133); centre_of_healpix_nest ----------------------------- (1.83924296 , -0.702114276) (1 row) select centre_of_healpix_ring(21, 49860599721652); centre_of_healpix_ring ---------------------------- (2.53075784 , -1.09624535) (1 row) select centre_of_healpix_nest(27, 205171330321572096); centre_of_healpix_nest ----------------------------- (5.66158938 , -0.786356902) (1 row) select centre_of_healpix_ring(26, 33220039743394560); centre_of_healpix_ring ----------------------------- (1.70014807 , -0.231449318) (1 row) select centre_of_healpix_ring(9, 1015262); centre_of_healpix_ring ---------------------------- (1.46801961 , 0.362022825) (1 row) select centre_of_healpix_ring(7, 178213); centre_of_healpix_ring ----------------------------- (3.75518497 , -0.948427838) (1 row) select centre_of_healpix_nest(20, 7184631071659); centre_of_healpix_nest ----------------------------- (2.65435152 , -0.194387351) (1 row) select centre_of_healpix_ring(26, 38703172787616768); centre_of_healpix_ring --------------------------- (3.8038649 , -0.44704755) (1 row) select centre_of_healpix_nest(8, 480072); centre_of_healpix_nest ------------------------------ (5.31984537 , -0.0547147959) (1 row) select centre_of_healpix_ring(22, 185067465977314); centre_of_healpix_ring ----------------------------- (1.56289432 , -0.853082578) (1 row) select centre_of_healpix_nest(13, 515966125); centre_of_healpix_nest ----------------------------- (4.34624694 , 0.0249049182) (1 row) select centre_of_healpix_nest(14, 1246677573); centre_of_healpix_nest -------------------------------- (-0.504919364 , -0.0183929641) (1 row) select centre_of_healpix_nest(11, 20023987); centre_of_healpix_nest ------------------------------ (0.0276116542 , 0.147342447) (1 row) select centre_of_healpix_nest(12, 75575650); centre_of_healpix_nest ------------------------------- (-0.339968492 , -0.269189819) (1 row) select centre_of_healpix_ring(5, 8969); centre_of_healpix_ring ----------------------------- (3.60792281 , -0.476119061) (1 row) select centre_of_healpix_ring(23, 170547538414200); centre_of_healpix_ring --------------------------- (1.39642436 , 0.63858797) (1 row) select centre_of_healpix_nest(6, 21202); centre_of_healpix_nest ----------------------------- (1.41126232 , -0.274258613) (1 row) select centre_of_healpix_ring(26, 41344020049933440); centre_of_healpix_ring ----------------------------- (1.83112066 , -0.558643139) (1 row) select centre_of_healpix_ring(15, 880827815); centre_of_healpix_ring --------------------------- (3.39784069 , 1.04172874) (1 row) select centre_of_healpix_ring(14, 1398400204); centre_of_healpix_ring --------------------------- (2.47397545 , 0.13213876) (1 row) select centre_of_healpix_ring(13, 667594394); centre_of_healpix_ring ---------------------------- (5.4291415 , -0.718105222) (1 row) select centre_of_healpix_ring(19, 2955926820093); centre_of_healpix_ring ----------------------------- (3.69344488 , -0.914514488) (1 row) select centre_of_healpix_nest(16, 44426836500); centre_of_healpix_nest ----------------------------- (4.46609795 , -0.822384588) (1 row) select centre_of_healpix_nest(16, 51295516247); centre_of_healpix_nest ----------------------------- (5.57331173 , -0.243938395) (1 row) select centre_of_healpix_nest(18, 577743854748); centre_of_healpix_nest ------------------------------ (0.920378947 , -0.801605086) (1 row) select centre_of_healpix_ring(12, 75117969); centre_of_healpix_ring ---------------------------- (2.11727698 , 0.256548456) (1 row) select centre_of_healpix_ring(9, 2765628); centre_of_healpix_ring ----------------------------- (3.47484646 , -0.860671396) (1 row) select centre_of_healpix_nest(19, 419893029776); centre_of_healpix_nest -------------------------- (2.0599864 , 0.54118644) (1 row) select centre_of_healpix_ring(9, 461229); centre_of_healpix_ring ---------------------------- (4.54712812 , 0.785291352) (1 row) select centre_of_healpix_ring(21, 26237298069973); centre_of_healpix_ring ------------------------------ (1.02198287 , 0.00572144133) (1 row) select centre_of_healpix_nest(13, 585099177); centre_of_healpix_nest ------------------------------ (0.486559531 , -0.439825136) (1 row) select centre_of_healpix_ring(28, 745902712931622912); centre_of_healpix_ring ----------------------------- (3.58965156 , -0.811392496) (1 row) select centre_of_healpix_nest(19, 2425745544581); centre_of_healpix_nest ------------------------------ (0.972512361 , -0.405917485) (1 row) select centre_of_healpix_nest(17, 167545986422); centre_of_healpix_nest ----------------------------- (2.32298021 , -0.682424333) (1 row) select centre_of_healpix_nest(9, 2167450); centre_of_healpix_nest ---------------------------- (1.44807786 , -1.00181067) (1 row) select centre_of_healpix_nest(20, 5524610276077); centre_of_healpix_nest ----------------------------- (1.64501238 , -0.532163966) (1 row) select centre_of_healpix_ring(19, 3108844000319); centre_of_healpix_ring --------------------------- (3.9515063 , -1.08646108) (1 row) select centre_of_healpix_nest(6, 27800); centre_of_healpix_nest ---------------------------- (3.06796158 , 0.156892871) (1 row) select centre_of_healpix_nest(27, 64863365879469312); centre_of_healpix_nest ---------------------------- (5.24796451 , 0.739642025) (1 row) select centre_of_healpix_nest(9, 380480); centre_of_healpix_nest ---------------------------- (2.81666434 , 0.882737218) (1 row) select centre_of_healpix_nest(20, 7179614470088); centre_of_healpix_nest ----------------------------- (2.80919669 , -0.130177051) (1 row) select centre_of_healpix_nest(24, 2252994948242088); centre_of_healpix_nest ---------------------------- (1.49791378 , -1.49525971) (1 row) select centre_of_healpix_ring(27, 121984399434180864); centre_of_healpix_ring ----------------------------- (2.43742657 , -0.128939389) (1 row) select centre_of_healpix_ring(14, 1343000756); centre_of_healpix_ring ----------------------------- (0.409956366 , 0.166911629) (1 row) select centre_of_healpix_ring(13, 350114120); centre_of_healpix_ring ---------------------------- (0.848291376 , 0.13082534) (1 row) select centre_of_healpix_ring(11, 6980524); centre_of_healpix_ring ---------------------------- (4.55135713 , 0.807679864) (1 row) select centre_of_healpix_nest(5, 1336); centre_of_healpix_nest ---------------------------- (2.69980619 , 0.597406417) (1 row) select centre_of_healpix_ring(5, 9037); centre_of_healpix_ring ------------------------------ (0.638136008 , -0.499705041) (1 row) select centre_of_healpix_nest(28, 849774482713525248); centre_of_healpix_nest ----------------------------- (5.40349339 , -0.517736101) (1 row) select centre_of_healpix_nest(4, 2221); centre_of_healpix_nest ------------------------------ (0.245436926 , -0.622826585) (1 row) select centre_of_healpix_nest(24, 320364357078852); centre_of_healpix_nest ---------------------------- (2.19119615 , 0.301284413) (1 row) select centre_of_healpix_nest(15, 9112365641); centre_of_healpix_nest ---------------------------- (1.1479689 , -0.482079912) (1 row) select centre_of_healpix_nest(8, 520786); centre_of_healpix_nest ---------------------------- (4.69704917 , 0.424053538) (1 row) select centre_of_healpix_nest(24, 3081263809215192); centre_of_healpix_nest ----------------------------- (3.89379835 , -0.255641209) (1 row) select centre_of_healpix_nest(26, 43803863391312192); centre_of_healpix_nest ----------------------------- (1.91799346 , -0.489176996) (1 row) select centre_of_healpix_ring(8, 687400); centre_of_healpix_ring ----------------------------- (6.14582868 , -0.843636209) (1 row) select centre_of_healpix_nest(26, 52219904624154048); centre_of_healpix_nest ---------------------------- (5.21490957 , -0.78259516) (1 row) select centre_of_healpix_ring(7, 31551); centre_of_healpix_ring ----------------------------- (0.642031832 , 0.743681425) (1 row) select centre_of_healpix_nest(15, 10308012275); centre_of_healpix_nest --------------------------- (2.09771873 , -0.7211622) (1 row) select centre_of_healpix_ring(22, 194616343973793); centre_of_healpix_ring ---------------------------- (2.51051913 , -1.00428119) (1 row) select centre_of_healpix_nest(11, 15195578); centre_of_healpix_nest ---------------------------- (5.28407008 , 0.909776266) (1 row) select centre_of_healpix_ring(11, 18602747); centre_of_healpix_ring ------------------------- (2.15601 , 0.263790904) (1 row) select centre_of_healpix_ring(4, 2235); centre_of_healpix_ring ---------------------------- (2.6507188 , -0.476119061) (1 row) select centre_of_healpix_nest(5, 6590); centre_of_healpix_nest --------------------------- (3.3133985 , 0.125327831) (1 row) select centre_of_healpix_nest(18, 678177580256); centre_of_healpix_nest ----------------------------- (2.50756723 , -0.256072604) (1 row) select centre_of_healpix_nest(17, 165747513538); centre_of_healpix_nest ----------------------------- (1.93223456 , -0.705623683) (1 row) select centre_of_healpix_nest(8, 747464); centre_of_healpix_nest ----------------------------- (5.78617553 , -0.665163137) (1 row) select centre_of_healpix_ring(24, 2546103820703280); centre_of_healpix_ring ----------------------------- (5.96004716 , -0.532392658) (1 row) select centre_of_healpix_nest(21, 37918915769211); centre_of_healpix_nest ------------------------------ (0.569971984 , -0.593306972) (1 row) select centre_of_healpix_nest(16, 31646135441); centre_of_healpix_nest ----------------------------- (5.27877543 , 0.0682291942) (1 row) select centre_of_healpix_ring(28, 656590948524413952); centre_of_healpix_ring ------------------------------ (0.936045863 , -0.545296537) (1 row) select centre_of_healpix_ring(19, 2018901411087); centre_of_healpix_ring ---------------------------- (4.47083195 , -0.22603979) (1 row) select centre_of_healpix_ring(16, 50083935998); centre_of_healpix_ring ----------------------------- (0.429147985 , -1.23308161) (1 row) select centre_of_healpix_ring(4, 2755); centre_of_healpix_ring ----------------------------- (5.73944812 , -0.894582592) (1 row) select centre_of_healpix_ring(11, 9976702); centre_of_healpix_ring --------------------------- (2.25686923 , 0.64790292) (1 row) select centre_of_healpix_ring(16, 32927310045); centre_of_healpix_ring ---------------------------- (1.3797558 , -0.281451835) (1 row) select centre_of_healpix_nest(11, 34556490); centre_of_healpix_nest ----------------------------- (0.824121391 , -0.86916877) (1 row) select centre_of_healpix_ring(21, 13836070822576); centre_of_healpix_ring ---------------------------- (4.22816675 , 0.495729743) (1 row) select centre_of_healpix_nest(1, 13); centre_of_healpix_nest ---------------------------- (5.89048623 , 0.729727656) (1 row) select centre_of_healpix_nest(2, 57); centre_of_healpix_nest --------------------------- (5.3014376 , 0.729727656) (1 row) select centre_of_healpix_nest(1, 44); centre_of_healpix_nest ---------------------------- (5.49778714 , -1.15965846) (1 row) select centre_of_healpix_nest(2, 154); centre_of_healpix_nest ----------------------------- (1.76714587 , -0.729727656) (1 row) select centre_of_healpix_ring(2, 131); centre_of_healpix_ring ----------------------------- (4.51603944 , -0.339836909) (1 row) select centre_of_healpix_ring(2, 136); centre_of_healpix_ring ------------------------ (0 , -0.523598776) (1 row) select centre_of_healpix_ring(3, 214); centre_of_healpix_ring ---------------------------- (1.17809725 , 0.429775431) (1 row) select centre_of_healpix_ring(1, 5); centre_of_healpix_ring ---------------------------- (1.17809725 , 0.729727656) (1 row) select centre_of_healpix_ring(2, 39); centre_of_healpix_ring ---------------------------- (6.08683577 , 0.729727656) (1 row) select centre_of_healpix_nest(0, 3); centre_of_healpix_nest ---------------------------- (5.49778714 , 0.729727656) (1 row) select centre_of_healpix_ring(1, 10); centre_of_healpix_ring ---------------------------- (5.10508806 , 0.729727656) (1 row) select centre_of_healpix_ring(1, 3); centre_of_healpix_ring --------------------------- (5.49778714 , 1.15965846) (1 row) select centre_of_healpix_ring(3, 422); centre_of_healpix_ring ----------------------------- (4.3196899 , -0.0834300866) (1 row) select centre_of_healpix_nest(3, 260); centre_of_healpix_nest ------------------------------ (0.196349541 , -0.429775431) (1 row) select centre_of_healpix_ring(1, 33); centre_of_healpix_ring ----------------------------- (3.92699082 , -0.339836909) (1 row) select centre_of_healpix_nest(2, 69); centre_of_healpix_nest ------------------------ (0.589048623 , 0) (1 row) select centre_of_healpix_nest(0, 8); centre_of_healpix_nest ------------------------------ (0.785398163 , -0.729727656) (1 row) select centre_of_healpix_ring(1, 2); centre_of_healpix_ring --------------------------- (3.92699082 , 1.15965846) (1 row) select centre_of_healpix_nest(3, 648); centre_of_healpix_nest ---------------------------- (3.40339204 , -1.26340128) (1 row) select centre_of_healpix_ring(2, 95); centre_of_healpix_ring ------------------------ (2.94524311 , 0) (1 row) select centre_of_healpix_ring(2, 184); centre_of_healpix_ring ---------------------------- (3.53429174 , -1.15965846) (1 row) select centre_of_healpix_ring(3, 510); centre_of_healpix_ring ----------------------------- (2.84706834 , -0.339836909) (1 row) select centre_of_healpix_nest(1, 10); centre_of_healpix_nest ---------------------------- (3.53429174 , 0.729727656) (1 row) select nside2order(-1); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(-2); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(0); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(-15); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(3); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(5); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(7); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(9); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(15); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(17); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(31); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(65); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(129); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(255); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(519); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(1022); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(2049); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(4095); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(8191); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(16387); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(32767); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(65535); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(131071); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(262145); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(524289); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(1048546); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(2093151); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(4194303); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(8388609); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(16777217); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(33554430); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(67108860); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(134217722); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(268435457); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2order(536870911); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select order2nside(-1); ERROR: Healpix level out of valid range [0..29] select order2nside(30); ERROR: Healpix level out of valid range [0..29] select order2nside(31); ERROR: Healpix level out of valid range [0..29] select order2nside(-29); ERROR: Healpix level out of valid range [0..29] select nside2npix(-1); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(3); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(5); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(11); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(17); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(33); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(63); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(129); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(257); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(511); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(1023); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(2049); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(4097); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(8191); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(16383); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(32769); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(65535); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(131071); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(262104); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(524208); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(1048076); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(2097052); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(4194301); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(8388607); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(16777217); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(33554431); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(67108865); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(134217727); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(268430456); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select nside2npix(536870913); ERROR: nside value invalid HINT: Valid nside values are only order2nside(level), for level in [0..29]. select npix2nside(-12); ERROR: npix value must be at least 12 select npix2nside(49); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(-2192); ERROR: npix value must be at least 12 select npix2nside(767); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(3071); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(12280); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(49150); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(196607); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(786431); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(3145723); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(12582911); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(50331647); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(201326591); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(805306369); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(3221225473); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(12884901808); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(51539607551); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(206158430209); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(824633720831); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(3298534883327); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(13194139533311); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(52776558133247); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(211106232532991); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(844424930131969); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(3377699720527873); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(13510798882111487); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(54043195528445951); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(216172782113783807); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(864691128455135231); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select npix2nside(3458764513820540929); ERROR: npix value invalid HINT: Valid npix values are only nside2npix(order2nside(level)), for level in [0..29]. select centre_of_healpix_ring(1, 18471); ERROR: Healpix index out of range HINT: Use nside2npix(order2nside(level)) to calculate the respective limit for Healpix indices. Use healpix_convert(idx, from_level, to_level) to move indices to another level. select centre_of_healpix_nest(6, -0); centre_of_healpix_nest ------------------------------ (0.785398163 , 0.0104168551) (1 row) select centre_of_healpix_ring(6, -1); ERROR: Healpix index out of range HINT: Use nside2npix(order2nside(level)) to calculate the respective limit for Healpix indices. Use healpix_convert(idx, from_level, to_level) to move indices to another level. select centre_of_healpix_nest(6, -49151); ERROR: Healpix index out of range HINT: Use nside2npix(order2nside(level)) to calculate the respective limit for Healpix indices. Use healpix_convert(idx, from_level, to_level) to move indices to another level. select centre_of_healpix_ring(6, 49151); centre_of_healpix_ring ---------------------------- (5.49778714 , -1.55803848) (1 row) select centre_of_healpix_ring(6, 49152); ERROR: Healpix index out of range HINT: Use nside2npix(order2nside(level)) to calculate the respective limit for Healpix indices. Use healpix_convert(idx, from_level, to_level) to move indices to another level. select centre_of_healpix_nest(6, 49153); ERROR: Healpix index out of range HINT: Use nside2npix(order2nside(level)) to calculate the respective limit for Healpix indices. Use healpix_convert(idx, from_level, to_level) to move indices to another level. -- examples taken from Figure 4 of Healpix article (page 764) select healpix_convert_nest(1, 2, 111); healpix_convert_nest ---------------------- 27 (1 row) select healpix_convert_nest(1, 2, 91); healpix_convert_nest ---------------------- 22 (1 row) select healpix_convert_nest(2, 1, 31); healpix_convert_nest ---------------------- 124 (1 row) select healpix_convert_nest(1, 2, 123); healpix_convert_nest ---------------------- 30 (1 row) select healpix_convert_ring(1, 2, 123); healpix_convert_ring ---------------------- 30 (1 row) select healpix_convert_nest(1, 2, 124); healpix_convert_nest ---------------------- 31 (1 row) select healpix_convert_nest(1, 2, 122); healpix_convert_nest ---------------------- 30 (1 row) select healpix_convert_ring(1, 2, 122); healpix_convert_ring ---------------------- 29 (1 row) select healpix_convert_ring(2, 1, 46); healpix_convert_ring ---------------------- 190 (1 row) select healpix_convert_nest(2, 1, 46); healpix_convert_nest ---------------------- 184 (1 row) select healpix_convert_ring(2, 1, 42); healpix_convert_ring ---------------------- 177 (1 row) select nest2ring(1, 11); nest2ring ----------- 2 (1 row) select nest2ring(1, 19); nest2ring ----------- 12 (1 row) select nest2ring(2, 87); nest2ring ----------- 77 (1 row) select nest2ring(2, 177); nest2ring ----------- 187 (1 row) select nest2ring(2, 0); nest2ring ----------- 74 (1 row) select ring2nest(1, 21); ring2nest ----------- 22 (1 row) select ring2nest(1, 3); ring2nest ----------- 15 (1 row) select ring2nest(1, 17); ring2nest ----------- 8 (1 row) select ring2nest(2, 117); ring2nest ----------- 116 (1 row) select ring2nest(2, 103); ring2nest ----------- 73 (1 row) select ring2nest(2, 186); ring2nest ----------- 178 (1 row) pgsphere-1.5.1/expected/index.out000066400000000000000000000123271461140101500167720ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- without idx SELECT count(*) FROM spheretmp1 WHERE p @ scircle '<(1,1),0.3>'; count ------- 32 (1 row) SELECT count(*) FROM spheretmp1 WHERE p = spoint '(3.09 , 1.25)' ; count ------- 4 (1 row) SELECT count(*) FROM spheretmp2 WHERE c @ scircle '<(1,1),0.3>'; count ------- 12 (1 row) SELECT count(*) FROM spheretmp2 WHERE c && scircle '<(1,1),0.3>'; count ------- 48 (1 row) SELECT count(*) FROM spheretmp3 WHERE b && scircle '<(1,1),0.3>'; count ------- 28 (1 row) SELECT count(*) FROM spheretmp3 WHERE spoint '(3.09 , 1.25)' @ b ; count ------- 1 (1 row) SELECT count(*) FROM spheretmp4 WHERE l @ scircle '<(1,1),0.3>'; count ------- 8 (1 row) SELECT count(*) FROM spheretmp4 WHERE l && scircle '<(1,1),0.3>'; count ------- 40 (1 row) -- create idx CREATE TABLE spheretmp1b AS TABLE spheretmp1; ANALYZE spheretmp1; CREATE INDEX aaaidx ON spheretmp1 USING gist ( p ); CREATE INDEX spoint3_idx ON spheretmp1b USING gist (p spoint3); CREATE INDEX bbbidx ON spheretmp2 USING gist ( c ); CREATE INDEX cccidx ON spheretmp3 USING gist ( b ); CREATE INDEX dddidx ON spheretmp4 USING gist ( l ); --with idx SET enable_seqscan = OFF ; SELECT count(*) FROM spheretmp1 WHERE p @ scircle '<(1,1),0.3>'; count ------- 32 (1 row) SELECT count(*) FROM spheretmp1b WHERE p @ scircle '<(1,1),0.3>'; count ------- 32 (1 row) SELECT count(*) FROM spheretmp1 WHERE p <@ scircle '<(1,1),0.3>'; count ------- 32 (1 row) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; count ------- 32 (1 row) SELECT count(*) FROM spheretmp1 WHERE p = spoint '(3.09 , 1.25)' ; count ------- 4 (1 row) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)' ; count ------- 4 (1 row) SELECT count(*) FROM spheretmp2 WHERE c @ scircle '<(1,1),0.3>' ; count ------- 12 (1 row) SELECT count(*) FROM spheretmp2 WHERE c && scircle '<(1,1),0.3>' ; count ------- 48 (1 row) SELECT count(*) FROM spheretmp3 WHERE b && scircle '<(1,1),0.3>'; count ------- 28 (1 row) SELECT count(*) FROM spheretmp3 WHERE spoint '(3.09 , 1.25)' @ b ; count ------- 1 (1 row) SELECT count(*) FROM spheretmp4 WHERE l @ scircle '<(1,1),0.3>' ; count ------- 8 (1 row) SELECT count(*) FROM spheretmp4 WHERE l && scircle '<(1,1),0.3>' ; count ------- 40 (1 row) -- test spoint3 operator class with and without index-only scan SET enable_bitmapscan = OFF; SET enable_indexonlyscan = ON; EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; QUERY PLAN -------------------------------------------------------- Aggregate -> Index Only Scan using spoint3_idx on spheretmp1b Index Cond: (p <@ '<(1 , 1) , 0.3>'::scircle) (3 rows) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; count ------- 32 (1 row) EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; QUERY PLAN -------------------------------------------------------- Aggregate -> Index Only Scan using spoint3_idx on spheretmp1b Index Cond: (p = '(3.09 , 1.25)'::spoint) (3 rows) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; count ------- 4 (1 row) SET enable_indexonlyscan = OFF; EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; QUERY PLAN ------------------------------------------------------- Aggregate -> Index Scan using spoint3_idx on spheretmp1b Index Cond: (p <@ '<(1 , 1) , 0.3>'::scircle) (3 rows) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; count ------- 32 (1 row) EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; QUERY PLAN --------------------------------------------------- Aggregate -> Index Scan using spoint3_idx on spheretmp1b Index Cond: (p = '(3.09 , 1.25)'::spoint) (3 rows) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; count ------- 4 (1 row) -- test hash opclass CREATE TABLE spheretmp1c AS TABLE spheretmp1; SELECT p FROM spheretmp1c WHERE p <@ scircle '<(1,1),0.2>' ORDER BY p::text; p --------------- (0.67 , 0.97) (0.67 , 0.97) (0.67 , 0.97) (0.67 , 0.97) (1.07 , 1.09) (1.07 , 1.09) (1.07 , 1.09) (1.07 , 1.09) (1.24 , 0.95) (1.24 , 0.95) (1.24 , 0.95) (1.24 , 0.95) (12 rows) WITH points AS (SELECT DISTINCT p FROM spheretmp1c WHERE p <@ scircle '<(1,1),0.2>') SELECT p FROM points ORDER BY p::text; p --------------- (0.67 , 0.97) (1.07 , 1.09) (1.24 , 0.95) (3 rows) CREATE INDEX spheretmp1c_hash_idx ON spheretmp1c USING hash(p); EXPLAIN (COSTS OFF) SELECT * FROM spheretmp1c WHERE p = '(0.67 , 0.97)'; QUERY PLAN ------------------------------------------------------ Index Scan using spheretmp1c_hash_idx on spheretmp1c Index Cond: (p = '(0.67 , 0.97)'::spoint) (2 rows) pgsphere-1.5.1/expected/init.out000066400000000000000000000000771461140101500166250ustar00rootroot00000000000000-- -- Initialize the extension. -- CREATE EXTENSION pg_sphere; pgsphere-1.5.1/expected/init_extended.out000066400000000000000000000013671461140101500205100ustar00rootroot00000000000000-- indexed operations..... -- spoint_data and scircle_data tables have to be created and indexed using \! testsuite/gen_point.pl 1 > results/gen_point_1.sql \i results/gen_point_1.sql CREATE TABLE spoint_data (sp spoint); COPY spoint_data (sp) FROM stdin; CREATE INDEX sp_idx ON spoint_data USING gist (sp); -- and \! testsuite/gen_circle.pl 1 0.1 > results/gen_circle_1_0.1.sql \i results/gen_circle_1_0.1.sql CREATE TABLE scircle_data (sc scircle); COPY scircle_data (sc) FROM stdin; CREATE INDEX sc_idx ON scircle_data USING gist (sc); -- \! testsuite/gen_poly.pl 1 0.1 4 > results/gen_poly_1_0.1_4.sql \i results/gen_poly_1_0.1_4.sql CREATE TABLE spoly_data (sp spoly); COPY spoly_data (sp) FROM stdin; CREATE INDEX spl_idx ON spoly_data USING gist (sp); pgsphere-1.5.1/expected/init_test.out000066400000000000000000000000631461140101500176570ustar00rootroot00000000000000SET client_min_messages TO WARNING; \set ECHO none pgsphere-1.5.1/expected/knn.out000066400000000000000000000037431461140101500164530ustar00rootroot00000000000000CREATE TABLE points (id int, p spoint, pos int); INSERT INTO points (id, p) SELECT x, spoint(random()*6.28, (2*random()-1)*1.57) FROM generate_series(1,314159) x; CREATE INDEX i ON points USING gist (p); SET enable_indexscan = true; EXPLAIN (costs off) SELECT p <-> spoint (0.2, 0.3) FROM points ORDER BY 1 LIMIT 100; QUERY PLAN ------------------------------------------------- Limit -> Index Scan using i on points Order By: (p <-> '(0.2 , 0.3)'::spoint) (3 rows) UPDATE points SET pos = n FROM (SELECT id, row_number() OVER (ORDER BY p <-> spoint (0.2, 0.3)) n FROM points ORDER BY p <-> spoint (0.2, 0.3) LIMIT 100) sel WHERE points.id = sel.id; SET enable_indexscan = false; SELECT pos, row_number() OVER (ORDER BY p <-> spoint (0.2, 0.3)) n FROM points ORDER BY p <-> spoint (0.2, 0.3) LIMIT 100; pos | n -----+----- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | 11 12 | 12 13 | 13 14 | 14 15 | 15 16 | 16 17 | 17 18 | 18 19 | 19 20 | 20 21 | 21 22 | 22 23 | 23 24 | 24 25 | 25 26 | 26 27 | 27 28 | 28 29 | 29 30 | 30 31 | 31 32 | 32 33 | 33 34 | 34 35 | 35 36 | 36 37 | 37 38 | 38 39 | 39 40 | 40 41 | 41 42 | 42 43 | 43 44 | 44 45 | 45 46 | 46 47 | 47 48 | 48 49 | 49 50 | 50 51 | 51 52 | 52 53 | 53 54 | 54 55 | 55 56 | 56 57 | 57 58 | 58 59 | 59 60 | 60 61 | 61 62 | 62 63 | 63 64 | 64 65 | 65 66 | 66 67 | 67 68 | 68 69 | 69 70 | 70 71 | 71 72 | 72 73 | 73 74 | 74 75 | 75 76 | 76 77 | 77 78 | 78 79 | 79 80 | 80 81 | 81 82 | 82 83 | 83 84 | 84 85 | 85 86 | 86 87 | 87 88 | 88 89 | 89 90 | 90 91 | 91 92 | 92 93 | 93 94 | 94 95 | 95 96 | 96 97 | 97 98 | 98 99 | 99 100 | 100 (100 rows) DROP TABLE points; pgsphere-1.5.1/expected/line.out000066400000000000000000000075231461140101500166140ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) SET extra_float_digits TO -3; -- checking spherical line operators SELECT sline ( spoint '(0, 90d)', spoint '(0, -89d)' ) = sline ( spoint '(0, 90d)', spoint '(0, -89d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 90d)', spoint '(0, -89d)' ) <> sline ( spoint '(0, -89d)', spoint '(0, 90d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(5d, 5d)', spoint '(5d, -5d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, 5d)', spoint '(10d, -5d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(15d, 5d)', spoint '(15d, -5d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, 0d)', spoint '(10d, -5d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(5d, -5d)', spoint '(5d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, -5d)', spoint '(10d, 5d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(15d, -5d)', spoint '(15d, 5d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, 0d)', spoint '(10d, 5d)' ) ; ?column? ---------- f (1 row) -- check small lines SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000005d, 0.0000005d)', spoint '(0.0000005d, -0.0000005d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, 0.0000005d)', spoint '(0.000001d, -0.0000005d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000015d, 0.0000005d)', spoint '(0.0000015d, -0.0000005d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, 0d)', spoint '(0.000001d, -0.0000005d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000005d, -0.0000005d)', spoint '(0.0000005d, 0.0000005d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, -0.0000005d)', spoint '(0.000001d, 0.0000005d)' ) ; ?column? ---------- t (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000015d, -0.0000005d)', spoint '(0.0000015d, 0.0000005d)' ) ; ?column? ---------- f (1 row) SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, 0d)', spoint '(0.000001d, 0.0000005d)' ) ; ?column? ---------- f (1 row) -- checking the distance between a line and a point SELECT sline '( 90d, 0d, 0d, XYZ ), 40d ' <-> spoint '( 0d, 90d )'; ?column? ---------------- 0.872664625997 (1 row) SELECT sline '( 90d, 0d, 0d, XYZ ), 40d ' <-> spoint '( 0d, 90d )' = spoint '( 0d, 90d )' <-> sline '( 90d, 0d, 0d, XYZ ), 40d '; ?column? ---------- t (1 row) SELECT sline '( 0d, 0d, 0d, XYZ ), 0d ' <-> spoint '( 0d, 90d )'; ?column? --------------- 1.57079632679 (1 row) SELECT sline '( 0d, 0d, 0d, XYZ ), 0d ' <-> spoint '( 0d, 0d )'; ?column? ---------- 0 (1 row) SELECT sline '( 0d, 0d, 0d, XYZ ), 30d ' <-> spoint '( 0d, 30d )'; ?column? ---------------- 0.523598775598 (1 row) pgsphere-1.5.1/expected/moc.out000066400000000000000000000465571461140101500164550ustar00rootroot00000000000000SET client_min_messages = 'notice'; SET extra_float_digits = 0; -- make results compatible with 9.6 .. 11 SELECT smoc(''); -- expected: '0/' smoc ------ 0/ (1 row) SELECT '0/'::smoc; -- expected: '0/' smoc ------ 0/ (1 row) SELECT '29/'::smoc; -- expected: '29/' smoc ------ 29/ (1 row) SELECT '0/0-3,7'::smoc; -- expected: '0/0-3,7' smoc --------- 0/0-3 7 (1 row) SELECT '0/0,1,2,3,7'::smoc; -- expected: '0/0-3,7' smoc --------- 0/0-3 7 (1 row) SELECT smoc_info('0/'::smoc); smoc_info -------------------------------------------------------------------------------------------- version: 0, order: 0, depth: 1, first: 0, last: 0, area: 0, tree_begin: 36, data_begin: 56 (1 row) SELECT smoc_info('0/1-2'::smoc); smoc_info ----------------------------------------------------------------------------------------------------------------------------------------------- version: 0, order: 0, depth: 1, first: 288230376151711744, last: 864691128455135232, area: 576460752303423488, tree_begin: 48, data_begin: 72 (1 row) SELECT area('0/'::smoc); area ------ 0 (1 row) SET extra_float_digits = -1; -- last digit deviating on i386 SELECT area('29/1'::smoc); area --------------------- 3.6331963520923e-18 (1 row) SET extra_float_digits = 0; SELECT area('0/1-3'::smoc); area ------------------ 3.14159265358979 (1 row) SELECT area('0/0-11'::smoc); area ------------------ 12.5663706143592 (1 row) SELECT '(0.78, 0.81)'::spoint <@ '7/123-456,10000-20000'::smoc; ?column? ---------- t (1 row) SELECT '(0.78, 0.81)'::spoint <@ '7/123-456,1000-2000'::smoc; ?column? ---------- f (1 row) SELECT '0/'::smoc = '1/'::smoc AS eq; eq ---- f (1 row) SELECT '0/1,3,7'::smoc = '0/1,3,7' AS eq; eq ---- t (1 row) SELECT '0/1,4,7'::smoc = '0/1,3,7' AS eq; eq ---- f (1 row) SELECT '0/1,2,3'::smoc <> '0/1-3'::smoc AS neq; neq ----- f (1 row) SELECT '0/4-6'::smoc && '0/3,7-8'::smoc AS overlap; overlap --------- f (1 row) SELECT '0/4-6'::smoc && '0/3,6-8'::smoc AS overlap; overlap --------- t (1 row) SELECT '0/4-6'::smoc !&& '0/6'::smoc AS not_overlap; not_overlap ------------- f (1 row) SELECT 1 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339,0-1')); ?column? ---------- t (1 row) SELECT 1 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); ?column? ---------- f (1 row) SELECT 2 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); ?column? ---------- t (1 row) SELECT 6 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); ?column? ---------- f (1 row) SELECT 29 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); ?column? ---------- t (1 row) SELECT 333 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); ?column? ---------- t (1 row) SELECT 555 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); ?column? ---------- f (1 row) SELECT set_smoc_output_type(1); set_smoc_output_type --------------------------------------- Set output type to MOC intervals (1). (1 row) SELECT '29/0-3,7'::smoc; smoc ----------------- {[0, 4) [7, 8)} (1 row) SELECT '29/0,1,2,3,7'::smoc; smoc ----------------- {[0, 4) [7, 8)} (1 row) SELECT '29/3-11,70-88,22-34'::smoc; smoc ----------------------------- {[3, 12) [22, 35) [70, 89)} (1 row) SELECT '29/5-11,70-88,2-4'::smoc; smoc -------------------- {[2, 12) [70, 89)} (1 row) SELECT '29/11-18,22-27,31-35,42-55,62-69,100-111,15-49'::smoc; smoc -------------------------------- {[11, 56) [62, 70) [100, 112)} (1 row) SELECT '29/1-3,20-30,7-17'::smoc; smoc --------------------------- {[1, 4) [7, 18) [20, 31)} (1 row) SELECT '29/16-32,10-20'::smoc; smoc ------------ {[10, 33)} (1 row) SELECT '29/1-3,11-14,17-21,40-50,9-33'::smoc; smoc --------------------------- {[1, 4) [9, 34) [40, 51)} (1 row) SELECT '29/10-20,16-32'::smoc; smoc ------------ {[10, 33)} (1 row) SELECT '29/20-30,64-72,89-93,26-100'::smoc; smoc ------------- {[20, 101)} (1 row) SELECT '29/3-11,20-30,64-72,89-93,26-100'::smoc; smoc --------------------- {[3, 12) [20, 101)} (1 row) SELECT '29/3-11,20-30,64-72,89-93,222-333,26-100'::smoc; smoc -------------------------------- {[3, 12) [20, 101) [222, 334)} (1 row) SELECT '29/20-30,64-72,89-93,222-333,26-100'::smoc; smoc ------------------------ {[20, 101) [222, 334)} (1 row) SELECT smoc(-1); -- expected: error ERROR: function smoc(integer) does not exist LINE 1: SELECT smoc(-1); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT smoc(15); -- expected: error ERROR: function smoc(integer) does not exist LINE 1: SELECT smoc(15); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT smoc(0); -- expected: '0/' ERROR: function smoc(integer) does not exist LINE 1: SELECT smoc(0); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT smoc(''); smoc ------ {} (1 row) SELECT smoc('abc'); -- expected: error ERROR: [c.0] Incorrect MOC syntax: unsupported character 'a'. LINE 1: SELECT smoc('abc'); ^ HINT: Expected syntax: '{healpix_order}/{healpix_index}[,...] ...', where {healpix_order} is between 0 and 29. Example: '1/0 2/3,5-10'. SELECT smoc('-1/'); -- expected: error ERROR: [c.2] Healpix order must not be negative. LINE 1: SELECT smoc('-1/'); ^ HINT: Expected syntax: '{healpix_order}/{healpix_index}[,...] ...', where {healpix_order} is between 0 and 29. Example: '1/0 2/3,5-10'. SELECT smoc('30/'); -- expected: error ERROR: [c.2] Incorrect Healpix order 30. LINE 1: SELECT smoc('30/'); ^ HINT: A valid Healpix order must be an integer between 0 and 29. SELECT smoc('0/'); smoc ------ {} (1 row) SELECT smoc('0/0-3,7'); smoc ----------------------------------------------------------------------- {[0, 1152921504606846976) [2017612633061982208, 2305843009213693952)} (1 row) SELECT smoc('0/0,1,2,3,7'); smoc ----------------------------------------------------------------------- {[0, 1152921504606846976) [2017612633061982208, 2305843009213693952)} (1 row) select set_smoc_output_type(0); set_smoc_output_type ----------------------------------- Set output type to MOC-ASCII (0). (1 row) SELECT ''::smoc; smoc ------ 0/ (1 row) SELECT 'abc'::smoc; -- expected: error ERROR: [c.0] Incorrect MOC syntax: unsupported character 'a'. LINE 1: SELECT 'abc'::smoc; ^ HINT: Expected syntax: '{healpix_order}/{healpix_index}[,...] ...', where {healpix_order} is between 0 and 29. Example: '1/0 2/3,5-10'. SELECT '-1/'::smoc; -- expected: error ERROR: [c.2] Healpix order must not be negative. LINE 1: SELECT '-1/'::smoc; ^ HINT: Expected syntax: '{healpix_order}/{healpix_index}[,...] ...', where {healpix_order} is between 0 and 29. Example: '1/0 2/3,5-10'. SELECT '30/'::smoc; -- expected: error ERROR: [c.2] Incorrect Healpix order 30. LINE 1: SELECT '30/'::smoc; ^ HINT: A valid Healpix order must be an integer between 0 and 29. SELECT '0/'::smoc; -- expected: '0/' smoc ------ 0/ (1 row) SELECT '0/0-3,7'::smoc; -- expected: '0/0-3,7' smoc --------- 0/0-3 7 (1 row) SELECT '0/0,1,2,3,7'::smoc; -- expected: '0/0-3,7' smoc --------- 0/0-3 7 (1 row) select set_smoc_output_type(1); set_smoc_output_type --------------------------------------- Set output type to MOC intervals (1). (1 row) SELECT smoc('2/0,1,2,3,7 4/17,21-33,111'); smoc ------------------------------------------------------------------- {[0, 72057594037927936) [124974889659531264, 144115188075855872)} (1 row) SELECT smoc('2/0,1,2,3,7 0/17,21-33,111'); ERROR: [c.16] Incorrect Healpix index 17. LINE 1: SELECT smoc('2/0,1,2,3,7 0/17,21-33,111'); ^ HINT: At order 0, a Healpix index must be an integer between 0 and 11. SELECT max_order(smoc('')); max_order ----------- 0 (1 row) SELECT max_order(smoc('1/')); max_order ----------- 1 (1 row) SELECT max_order(smoc('1/1')); max_order ----------- 1 (1 row) SELECT max_order(smoc('1/10-3')); ERROR: [c.5] Incorrect Healpix range 10-3. LINE 1: SELECT max_order(smoc('1/10-3')); ^ HINT: The first value of a range (here 10) must be less than the second one (here 3). SELECT max_order(smoc('1/0-3')); max_order ----------- 1 (1 row) SELECT max_order(smoc('1/0-1')); max_order ----------- 1 (1 row) SELECT max_order(smoc('29/0-1')); max_order ----------- 29 (1 row) SELECT max_order(smoc('29/0-3')); max_order ----------- 29 (1 row) SELECT max_order(smoc('29/0-7')); max_order ----------- 29 (1 row) SELECT max_order(smoc('29/0-15')); max_order ----------- 29 (1 row) select set_smoc_output_type(0); set_smoc_output_type ----------------------------------- Set output type to MOC-ASCII (0). (1 row) SELECT smoc('29/32-63'); smoc ------------ 27/2-3 29/ (1 row) SELECT smoc('29/64-127'); smoc ---------- 26/1 29/ (1 row) SELECT smoc('0/0-11'); smoc -------- 0/0-11 (1 row) SELECT smoc('0/1-3'); smoc ------- 0/1-3 (1 row) SELECT smoc('0/1'); smoc ------ 0/1 (1 row) SELECT smoc('0/3-5'); smoc ------- 0/3-5 (1 row) SELECT smoc('0/3-11'); smoc -------- 0/3-11 (1 row) SELECT smoc('0/0,3-11'); smoc ---------- 0/0 3-11 (1 row) SELECT smoc('1/0,3-42'); smoc ------------------- 0/1-9 1/0 3 40-42 (1 row) SELECT smoc('29/3-42'); smoc ---------------------------- 27/1 28/1-3 8-9 29/3 40-42 (1 row) SELECT smoc('29/1'); smoc ------ 29/1 (1 row) SELECT smoc('28/1'); smoc ------ 28/1 (1 row) SELECT smoc('24/1'); smoc ------ 24/1 (1 row) SELECT smoc('24/1 29/1'); smoc ----------- 24/1 29/1 (1 row) SELECT smoc('24/1 11/1 29/1'); smoc ---------------- 11/1 24/1 29/1 (1 row) SELECT smoc('24/1 11/1 29/1,3'); smoc ------------------ 11/1 24/1 29/1 3 (1 row) SELECT smoc('24/1 11/1 29/1,3 2/22-33'); smoc -------------------------------------- 1/6-7 2/22-23 32-33 11/1 24/1 29/1 3 (1 row) SELECT smoc('2/22-33'); smoc --------------------- 1/6-7 2/22-23 32-33 (1 row) SELECT smoc('24/1 11/1 29/1,3 2/22-33'); smoc -------------------------------------- 1/6-7 2/22-23 32-33 11/1 24/1 29/1 3 (1 row) SELECT smoc(''); smoc ------ 0/ (1 row) SELECT smoc('1/6-7 2/22-23,32-33 11/1 24/1 29/1,3'); smoc -------------------------------------- 1/6-7 2/22-23 32-33 11/1 24/1 29/1 3 (1 row) SELECT smoc('5/1-127,999-1103'); smoc -------------------------------------------- 2/1 16 3/1-3 63 68 4/1-3 250-251 5/1-3 999 (1 row) SELECT smoc('5/1024-1103'); smoc -------------- 2/16 3/68 5/ (1 row) SELECT smoc('28/1101-1103'); smoc -------------- 28/1101-1103 (1 row) SELECT smoc_union('1/1,4-6', '1/3-5 2/8'); smoc_union ------------- 1/1 3-6 2/8 (1 row) SELECT '1/1'::smoc | '1/2' AS union; union ------- 1/1-2 (1 row) SELECT sum(moc) FROM (VALUES ('0/1'::smoc), ('0/2'), ('0/4')) sub(moc); sum --------- 0/1-2 4 (1 row) SELECT smoc_intersection('1/1,4-6', '1/3-5 2/8'); smoc_intersection ------------------- 1/4-5 2/ (1 row) SELECT '0/1'::smoc & '1/3,5,7,9' AS intersection; intersection -------------- 1/5 7 (1 row) SELECT '1/9,11,13,15'::smoc & '0/1,2' AS intersection; intersection -------------- 1/9 11 (1 row) SELECT intersection(moc) FROM (VALUES ('0/1-4'::smoc), ('0/2-5'), (NULL)) sub(moc); intersection -------------- 0/2-4 (1 row) SELECT smoc_degrade(6, '7/1,3,5,9'); smoc_degrade -------------- 6/0-2 (1 row) SELECT smoc_degrade(5, '7/1,3,5,9'); smoc_degrade -------------- 5/0 (1 row) SELECT smoc_degrade(0, '1/0'); smoc_degrade -------------- 0/0 (1 row) SELECT smoc_degrade(0, '1/47'); smoc_degrade -------------- 0/11 (1 row) WITH mocs(x) AS (VALUES ('0/'::smoc), ('0/1'), ('0/2'), ('0/4'), ('0/1,3'), ('0/1-3'), ('0/2-4')) SELECT a.x AS a, b.x AS b, a.x = b.x AS "=", a.x <> b.x AS "<>", a.x && b.x AS "&&", a.x <@ b.x AS "<@", a.x !<@ b.x AS "!<@", a.x !@> b.x AS "!@>", a.x @> b.x AS "@>", a.x | b.x AS "|", a.x & b.x AS "&" FROM mocs a, mocs b; a | b | = | <> | && | <@ | !<@ | !@> | @> | | | & -------+-------+---+----+----+----+-----+-----+----+---------+------- 0/ | 0/ | t | f | f | t | f | f | t | 0/ | 0/ 0/ | 0/1 | f | t | f | t | f | t | f | 0/1 | 0/ 0/ | 0/2 | f | t | f | t | f | t | f | 0/2 | 0/ 0/ | 0/4 | f | t | f | t | f | t | f | 0/4 | 0/ 0/ | 0/1 3 | f | t | f | t | f | t | f | 0/1 3 | 0/ 0/ | 0/1-3 | f | t | f | t | f | t | f | 0/1-3 | 0/ 0/ | 0/2-4 | f | t | f | t | f | t | f | 0/2-4 | 0/ 0/1 | 0/ | f | t | f | f | t | f | t | 0/1 | 0/ 0/1 | 0/1 | t | f | t | t | f | f | t | 0/1 | 0/1 0/1 | 0/2 | f | t | f | f | t | t | f | 0/1-2 | 0/ 0/1 | 0/4 | f | t | f | f | t | t | f | 0/1 4 | 0/ 0/1 | 0/1 3 | f | t | t | t | f | t | f | 0/1 3 | 0/1 0/1 | 0/1-3 | f | t | t | t | f | t | f | 0/1-3 | 0/1 0/1 | 0/2-4 | f | t | f | f | t | t | f | 0/1-4 | 0/ 0/2 | 0/ | f | t | f | f | t | f | t | 0/2 | 0/ 0/2 | 0/1 | f | t | f | f | t | t | f | 0/1-2 | 0/ 0/2 | 0/2 | t | f | t | t | f | f | t | 0/2 | 0/2 0/2 | 0/4 | f | t | f | f | t | t | f | 0/2 4 | 0/ 0/2 | 0/1 3 | f | t | f | f | t | t | f | 0/1-3 | 0/ 0/2 | 0/1-3 | f | t | t | t | f | t | f | 0/1-3 | 0/2 0/2 | 0/2-4 | f | t | t | t | f | t | f | 0/2-4 | 0/2 0/4 | 0/ | f | t | f | f | t | f | t | 0/4 | 0/ 0/4 | 0/1 | f | t | f | f | t | t | f | 0/1 4 | 0/ 0/4 | 0/2 | f | t | f | f | t | t | f | 0/2 4 | 0/ 0/4 | 0/4 | t | f | t | t | f | f | t | 0/4 | 0/4 0/4 | 0/1 3 | f | t | f | f | t | t | f | 0/1 3-4 | 0/ 0/4 | 0/1-3 | f | t | f | f | t | t | f | 0/1-4 | 0/ 0/4 | 0/2-4 | f | t | t | t | f | t | f | 0/2-4 | 0/4 0/1 3 | 0/ | f | t | f | f | t | f | t | 0/1 3 | 0/ 0/1 3 | 0/1 | f | t | t | f | t | f | t | 0/1 3 | 0/1 0/1 3 | 0/2 | f | t | f | f | t | t | f | 0/1-3 | 0/ 0/1 3 | 0/4 | f | t | f | f | t | t | f | 0/1 3-4 | 0/ 0/1 3 | 0/1 3 | t | f | t | t | f | f | t | 0/1 3 | 0/1 3 0/1 3 | 0/1-3 | f | t | t | t | f | t | f | 0/1-3 | 0/1 3 0/1 3 | 0/2-4 | f | t | t | f | t | t | f | 0/1-4 | 0/3 0/1-3 | 0/ | f | t | f | f | t | f | t | 0/1-3 | 0/ 0/1-3 | 0/1 | f | t | t | f | t | f | t | 0/1-3 | 0/1 0/1-3 | 0/2 | f | t | t | f | t | f | t | 0/1-3 | 0/2 0/1-3 | 0/4 | f | t | f | f | t | t | f | 0/1-4 | 0/ 0/1-3 | 0/1 3 | f | t | t | f | t | f | t | 0/1-3 | 0/1 3 0/1-3 | 0/1-3 | t | f | t | t | f | f | t | 0/1-3 | 0/1-3 0/1-3 | 0/2-4 | f | t | t | f | t | t | f | 0/1-4 | 0/2-3 0/2-4 | 0/ | f | t | f | f | t | f | t | 0/2-4 | 0/ 0/2-4 | 0/1 | f | t | f | f | t | t | f | 0/1-4 | 0/ 0/2-4 | 0/2 | f | t | t | f | t | f | t | 0/2-4 | 0/2 0/2-4 | 0/4 | f | t | t | f | t | f | t | 0/2-4 | 0/4 0/2-4 | 0/1 3 | f | t | t | f | t | t | f | 0/1-4 | 0/3 0/2-4 | 0/1-3 | f | t | t | f | t | t | f | 0/1-4 | 0/2-3 0/2-4 | 0/2-4 | t | f | t | t | f | f | t | 0/2-4 | 0/2-4 (49 rows) SELECT smoc_disc(0, 0, 0, 1); smoc_disc ---------------- 0/0 3-5 7-8 11 (1 row) SELECT smoc_disc(1, 0, 0, 1); smoc_disc ---------------------- 0/0 3-4 8 11 1/22 29 (1 row) SELECT smoc_disc(2, 0, 0, 1); smoc_disc ---------------------------------------------------------------------------------------------------------- 0/4 1/0 2 12-13 34-35 45 47 2/4 6 12 14 56-57 60-61 88 90-91 116-117 119 130-131 134-135 177 179 185 187 (1 row) SELECT smoc_disc(0, 0, 0, 3.2); smoc_disc ----------- 0/0-11 (1 row) SELECT smoc_disc(2, 0, 0, 3.2); smoc_disc ----------- 0/0-11 2/ (1 row) SELECT smoc(6, '(0,0)'::spoint); smoc --------- 6/19456 (1 row) SELECT smoc(1, '<(1,1),1>'::scircle); smoc --------------------------- 0/0-1 3 5 1/9-11 17-19 35 (1 row) SELECT smoc(3, '<(0,1.3),.5>'::scircle); smoc --------------------------------------------------------------------------------------------------------- 1/3 15 2/11 31 47 55 3/27 30-31 38-39 41-43 111 119 121-123 159 181-183 187 213-215 217 219 231 237 239 (1 row) SELECT smoc(5, '{(.1,.1), (.2,.1), (.2,.2), (.1, .2)}'::spoly); smoc ----------------------------------------------------------------- 4/1135 1220-1221 1223 1232 5/4534 4537-4539 4586 4869 4889 4936 (1 row) SELECT smoc(3, '{(.1,.1), (-1,.1), (-1,-1), (.1, -1)}'::spoly); smoc ---------------------------------------------------------------------------------------------------------------------------------------- 1/45 47 2/64 66-67 72-74 117 179 185 3/192-194 260 262-263 280 282-283 300-302 304-306 465 477 544 546 552 554-555 709-711 715 737 749 (1 row) SELECT smoc(3, '{(.1,.1), (.1,-1), (-1,-1), (-1, .1)}'::spoly); smoc ---------------------------------------------------------------------------------------------------------------------------------------- 1/45 47 2/64 66-67 72-74 117 179 185 3/192-194 260 262-263 280 282-283 300-302 304-306 465 477 544 546 552 554-555 709-711 715 737 749 (1 row) CREATE TABLE g (p spoly); INSERT INTO g (p) VALUES (spoly '{(1.48062434277764d , -0.112757492761271d),(1.48062583213677d , -0.0763898467955446d),(1.44427278313068d, -0.0762453395638312d),(1.44413625055362d , -0.112726631135703d)}'); SELECT smoc(6, p) FROM g; smoc ----------- 5/4522 6/ (1 row) -- lswscans/data/part1/Bruceplatten/FITS/B3558b.fits SELECT smoc(6, '{(1.28867804735846 , 0.421769766439468),(1.40564002826964 , 0.201070262502835),(1.27597340819331 , 0.210561432516079),(1.28707379974056 , 0.351693515652388)}'::spoly); ERROR: MOC processing error: polygon is not convex pgsphere-1.5.1/expected/moc1.out000066400000000000000000002577371461140101500165420ustar00rootroot00000000000000CREATE TABLE moc1 ( ivoid text, coverage smoc, ref_system_name text ); INSERT INTO moc1 VALUES ( 'ivo://cds.vizier/j/apjs/241/12', '4/994,2432-2433 5/279,324-325,333,353,381-382,429,485,514,531,541,576,579,604,630-631,662,669,704,716,726,728,757,766-767,778,791,802,817,822,971,974,988,996,1003,1018,1032,1335,1417,1532,1653,1677,1701-1702,1712,1766,1933,1975,2007,2027,2034,2041,2128,2311,2369,2387,2389,2391,2398,2418,2428,2468,2482,2509,2514,2518-2519,2537,2547,2549,2551,2554,2557,2648,2849,2900,2907,2909-2910,2929,2931,2933-2935,2939,2941,2973,2977,2996,3001,3010,3029-3030,3067,3085-3086,3098,3102,3127,3140,3192,3205,3216,3247,3264,3270,3287,3306,3456,3490,3492,3544,3583,3608,3619,3625,3628,3631,3645,3647-3648,3651,3675,3680,3685-3686,3688,3693-3694,3696-3697,3699,3704,3706,3713,3724,3726,3731,3738,3741,3743,3749,3753,3758,3762,3771,3773,3776,3788,3791-3793,3798-3802,3805,3810,3813,3816,3818,3820-3822,3825-3826,3829-3831,3833-3836,3838-3839,3850,3881-3882,3919,3923,3929,3933,3939-3940,3942-3943,3948-3950,3956,3961,3963-3965,3967-3968,3971,3990,4002,4007,4010,4012-4014,4018-4022,4024,4026-4027,4029-4030,4032,4034,4041,4052,4055,4063,4068,4072-4073,4077,4084,4092,4110,4257,4437,4768,4776,4806,4828,5028,5116,5124,5135,5139,5189,5192,5194,5224,5239,5299,5315,5324,5333,5337,5370,5379,5384,5421,5467,5510,5512,5518,5552,5564,5577,5604,5620,5706,5715,5729,5740,5850,5900,5912,5915,5928,5938,5949,5954,6032,6156,6174,6216,6237,6314,6487,6522,6691,6831,6969,7152,7169,7185,7188,7190,7286,7352,7410,7423,7451,7484,7557,7559,7571,7588,7612,7625,7648,7694,7718,7768,7773,7797,7904,7940,7946,7950,8006,8019,8022,8061,8085,8156,8160,8190,8195,8207-8208,8210,8212-8213,8217,8222,8234,8244,8259-8260,8265,8269,8271-8272,8285,8287,8317-8318,8321,8330,8448-8449,8451-8453,8455-8456,8461,8471,8473,8475,8482,8496,8500,8503,8507,8520,8522,8531,8539,8546-8547,8549,8565,8576,8593,9045,9049,9123,9220,9232,9234,9246,9267-9268,9272,9275-9276,9294,9309-9310,9312,9315,9319,9322-9323,9330-9331,9349-9350,9352,9355-9356,9361-9362,9364,9377-9379,9387,9389-9390,9400-9401,9404,9423,9450,9452-9453,9466,9477-9478,9482,9484,9487,9494,9505,9512,9565,9736-9737,9741,9752-9753,9755,9757-9761,9764-9765,9767-9768,9770,9772,9776,9778,9789,9802,9823,9828,9837,9839,9851,9853,9856,9858,9861,9864,9869-9870,9884,9893-9894,9898,9921,9924-9925,9931,9935-9936,9945,9947,9963,9984,9992,9994,10011,10051,10071,10099,10122,10140,10156,10167,10204,10216,10248,10266,10310,10346,10349,10362-10363,10370,10402,10404,10412,10480,10509,10516,10570,10579,10587,10631,10650,10655,10681,10687,10777,10779,10782,10794,10826,10846,10863,10877,10883,10908,10920,10954,10987,11027,11037,11040,11057,11265,11285,11319,11341,11349,11352,11448,11461,11487,11505,11579,11605,11614,11686,11784,11795-11796,11833,11852,11882,11910,11922,11937,11946-11947,11958,12086,12099,12106,12255,12274 6/0,7-8,10-12,14,16,20,22,24,29,31,33,39,41,48-50,54,56-57,60,62,71,73,75,77,79,81,89,93,95,107-108,110,120,129-130,132,134,140,142,145,150,160,192,257,259-260,277,288,491,495,500,506,508-509,511,622,632-634,636,638,653,655,666,668-669,671,678-679,681-684,686,690-692,696-697,703,706,710,713-714,716-717,719-720,722,724-725,727-728,732-733,738,740-741,744,746,750-753,755,757-758,760,766,787,789,794,798,801-802,808,811-812,815-817,823,826-829,831-832,837,843,845-846,848-849,852-853,856,861-863,868,870,872,875,878,881,883-884,886,890,892,895-896,901-902,907-908,912,916-917,919,922,924,929,932,934,936-937,944,946,948,951,953-954,956,958,960,963,965-966,968,971,973,977,979,984,986-988,990,992-993,998-999,1001-1003,1005,1008-1010,1015,1021,1079,1084,1087,1102,1108,1112,1115,1122,1124,1127-1130,1134,1138-1140,1146,1148-1150,1162,1166-1167,1169,1171,1177-1178,1181-1184,1186,1190-1191,1208,1214,1216,1219,1221,1223-1224,1227,1229-1232,1237-1238,1241-1242,1244,1246-1248,1252,1258,1262-1263,1265-1266,1271,1274-1276,1280-1282,1286,1289-1290,1293,1309-1310,1312,1314-1318,1321,1323,1331,1336-1337,1339-1342,1344,1347,1349-1352,1354-1355,1358,1364,1366-1367,1369,1371,1375,1378,1381,1383,1387-1389,1391-1392,1394,1396-1397,1399,1401,1404-1405,1407,1416,1418-1420,1422,1424-1425,1428,1431,1436,1438,1440-1441,1443-1445,1447,1449,1452,1455,1457-1458,1463-1464,1466,1468,1470-1474,1476-1477,1479,1481-1482,1484,1486,1488-1489,1495-1496,1498,1500,1502,1507,1511-1512,1514-1515,1517-1518,1520,1523,1540,1542-1543,1545,1547,1549-1550,1552,1556,1564-1565,1568,1570-1571,1573,1575,1577-1578,1580-1582,1588,1591,1594,1597,1603,1606-1607,1610,1617,1620,1623,1625,1627-1629,1633,1637,1642,1646,1650,1654-1655,1662-1664,1668,1670,1673-1677,1679-1680,1682,1684-1685,1687,1689-1692,1694,1696-1697,1702-1703,1706-1709,1711-1712,1722-1723,1725,1729,1731,1735,1737-1740,1742,1752,1755-1757,1765,1768-1769,1773,1775,1778-1782,1784,1787-1790,1792,1794,1796,1801,1807-1809,1811,1817-1819,1822-1823,1825,1827,1829,1834-1838,1852,1855,1857,1859-1861,1863,1865,1870-1871,1874,1876,1880,1883,1885,1887-1888,1890-1892,1894,1897-1898,1903,1907-1908,1911,1914-1915,1918,1922,1925,1927-1929,1932,1934,1936,1939,1948,1950,1955,1958-1960,1963,1965,1968-1970,1973,1977,1980-1981,1983-1985,2002,2004-2006,2010-2012,2014-2015,2021,2027-2028,2034-2036,2038,2040,2042-2043,2052-2053,2060,2062,2064-2065,2073,2075-2076,2080-2082,2086,2088,2090,2093-2094,2100,2102,2105,2107-2108,2110,2113-2114,2116-2117,2120-2121,2128,2130-2131,2135,2137,2139-2140,2143,2151-2153,2160,2162-2163,2169-2172,2177,2183,2186,2191,2196,2201,2210-2211,2213,2215,2219,2226-2229,2231-2233,2235,2237,2239-2240,2243-2244,2246-2248,2253-2254,2256,2258-2260,2262,2264,2270,2274-2277,2279-2280,2282-2285,2289,2292-2294,2299-2302,2308-2309,2311,2313,2315,2320-2321,2324-2325,2327,2331,2333-2336,2339,2342,2344,2346-2347,2349-2352,2354,2356-2357,2360,2362,2364-2365,2368,2370-2371,2373,2375-2378,2381-2384,2386-2387,2389,2391,2393,2395-2397,2402-2403,2405-2407,2409,2411,2421-2424,2426-2430,2433-2438,2441,2443,2447,2449-2452,2454-2456,2459,2461-2462,2464-2465,2467-2470,2472,2476,2479-2480,2483-2484,2488-2489,2493-2494,2496,2498-2500,2502-2506,2508,2510-2512,2515,2517,2519,2528,2530,2532-2533,2535-2537,2540,2544-2545,2547-2548,2550-2551,2562-2563,2565-2567,2570,2572,2577-2581,2583-2586,2592,2594,2596,2601,2606-2607,2609,2611,2614,2616,2624,2626,2628-2630,2633-2636,2638,2641,2645-2647,2652,2658-2661,2663,2665-2668,2671,2673-2675,2680-2682,2685-2689,2691,2693,2698-2701,2703-2704,2706,2709-2711,2714,2716-2717,2720,2723,2732-2733,2735-2736,2738-2739,2742-2744,2747-2749,2751,2753-2756,2758,2766,2768-2769,2772,2776,2779-2780,2783-2784,2789,2792,2795,2797,2801-2802,2804-2805,2813,2815,2821-2823,2825-2827,2829,2832-2834,2837,2839,2841,2845,2847-2848,2852-2853,2856-2857,2860,2862,2869-2872,2874,2877,2879-2881,2885,2888,2890,2893-2894,2896,2900-2902,2908-2909,2919,2921-2923,2930,2938,2940,2946,2950,2955,2958,2960,2970,2974,2976-2977,2980,2984,2988,2995-2996,2998,3002,3004-3006,3014,3017,3020,3024-3025,3027,3032-3034,3036-3037,3039,3041-3044,3047,3049,3051-3054,3056-3058,3060-3061,3063,3072-3074,3076,3079,3081,3083-3085,3087-3088,3090,3092,3094-3095,3097,3102,3105-3106,3109-3110,3117-3122,3127,3129-3130,3132,3139,3142,3144,3146-3148,3154,3170,3174,3178,3183,3185,3191,3195-3197,3199,3201-3203,3218,3228,3230,3232,3234,3236,3238,3242-3243,3245-3246,3249,3255,3257-3258,3260-3262,3264,3266,3278,3280,3282,3286,3292-3293,3295-3296,3298-3299,3303-3304,3307-3310,3312,3314,3318-3319,3326-3328,3332,3336,3338-3341,3349,3351-3352,3354-3355,3360-3361,3366-3368,3370-3371,3374-3375,3377-3379,3381,3387,3389,3394,3396,3399,3405,3407-3408,3410-3411,3418,3431,3433,3435-3436,3440-3441,3443,3446-3449,3452-3453,3456-3457,3463-3465,3468-3470,3483-3484,3488,3490,3495-3497,3499-3502,3504-3505,3507,3510,3513-3514,3516,3518-3519,3522,3525,3527,3531,3533,3542,3549-3552,3554,3560,3565-3566,3568,3570-3571,3573,3577,3581-3583,3591,3595,3598,3601,3605-3606,3609,3617,3626,3636,3638,3641,3645-3647,3649,3653,3660,3662-3665,3667,3669-3670,3676,3679,3681,3684,3689,3697,3699,3702,3706-3707,3711-3713,3716,3718-3719,3721-3722,3724,3726-3727,3729-3732,3737-3738,3741-3743,3748-3749,3751,3754-3755,3757-3760,3762-3765,3768-3770,3772,3777-3781,3783-3785,3787,3790,3792,3795-3797,3800-3802,3804-3805,3807-3808,3810,3815-3816,3818,3820-3821,3827,3829-3831,3835-3837,3839,3841,3848,3851-3854,3859,3862-3863,3865,3867-3868,3870,3872-3874,3876-3877,3880-3881,3888,3892-3893,3895,3900,3905-3906,3909,3911,3913-3914,3916,3918,3920,3926,3929,3932,3942-3943,3945-3946,3949,3957,3962,3967-3969,3973-3974,3976,3980,3982-3983,3989,3991-3993,3995,3997-3998,4000,4003,4005,4009,4011,4017-4019,4022,4025,4028-4029,4031,4035-4036,4039-4040,4042-4044,4047-4048,4053-4054,4058,4060,4062,4064-4066,4068-4069,4077,4081-4082,4084,4086,4090-4093,4095-4097,4099,4101,4105,4107,4109-4110,4113-4114,4117,4119,4124,4126,4132,4135,4141-4144,4153,4157-4158,4160-4161,4164,4167,4169,4171-4172,4194,4198,4226-4227,4231,4234,4238-4239,4242,4253-4254,4264,4268-4270,4274,4280-4281,4290,4296,4429,4437-4438,4441,4452,4454,4461,4464-4465,4468,4470,4475,4479,4509,4535,4537-4539,4545-4546,4553,4558,4560,4568-4570,4572-4574,4577,4581-4583,4586,4590,4598,4600,4602,4609-4610,4612,4620,4622,4640-4641,4644,4830,4854-4855,4860,4880,4882-4886,4892,4895,4901,4903,4909,4914,4917,4920,4922,4925,4929,4932,4936-4937,4939-4940,4944,4962-4963,4965,4967,4983,4990,4994,4996,5002-5005,5008,5013,5015,5018,5026-5027,5036,5043-5044,5046,5048,5054,5065,5070,5072,5081,5088,5091-5092,5094,5098,5101-5102,5105,5108-5109,5115,5118-5119,5121,5123-5124,5132,5134,5137-5138,5141,5147-5148,5151-5152,5154-5156,5158,5163,5167,5170,5176,5180,5182,5186-5187,5189-5190,5194-5197,5201-5202,5204,5209-5210,5212-5214,5216-5217,5220-5221,5225-5226,5233-5235,5237,5241-5242,5245,5248,5251,5254,5257-5259,5262-5263,5265-5266,5277-5278,5280,5289,5294-5297,5299,5302-5304,5306,5310,5312-5313,5316-5318,5323,5325,5327,5330,5333-5334,5336,5338-5339,5345,5348,5353,5360,5366,5368-5369,5371-5372,5375,5378,5382,5387,5392,5394-5395,5398-5399,5406-5407,5415,5418,5423,5425,5429,5434,5438,5440,5442,5444-5445,5449,5455,5457-5458,5464,5467-5468,5474,5476,5478,5482,5484,5486,5490-5492,5494,5497-5498,5503-5505,5508,5515-5516,5520-5522,5527-5528,5531,5535,5541,5543,5545,5547,5549,5553-5556,5558,5562,5564,5568,5570,5572,5576,5578,5580-5582,5589,5591,5593,5602,5605,5610,5612,5615-5616,5618,5627,5629,5636,5639,5644,5649,5652-5653,5659,5675,5682-5683,5688-5689,5695,5699,5704-5706,5709,5711-5712,5718,5721,5724,5726-5727,5729,5731,5733,5736,5742,5748,5750,5753,5758-5759,5762-5763,5771,5774,5777,5783-5785,5792-5793,5796,5802,5805,5814-5815,5817-5818,5820,5823,5826,5828,5830,5833,5836,5839,5852-5853,5856,5859,5862,5864-5866,5871,5877,5880-5881,5885,5887,5891,5895,5904,5907,5909-5910,5919,5925,5927,5930,5946,5949-5950,5952,5954,5956,5959,5964,5973-5974,5983,5986-5987,5993-5995,6003,6007,6009,6015-6016,6019,6021,6023,6025-6026,6028,6034,6038,6047,6052,6056,6060-6061,6066,6071,6073,6080,6089,6094,6103,6106,6109,6115-6116,6119,6122,6124,6139,6204-6205,6207,6214,6224-6225,6227,6235,6237,6242-6245,6247,6249,6253,6261-6262,6266-6269,6287,6289-6290,6294-6295,6297-6299,6301-6302,6308,6311-6312,6315-6316,6318-6319,6321,6325-6326,6330-6331,6333-6335,6338-6339,6341-6342,6344-6345,6347-6348,6350-6351,6353-6355,6357,6360,6364,6368-6369,6371-6372,6375-6377,6382-6385,6387,6389-6390,6392-6393,6397,6403-6404,6406-6408,6410-6413,6417-6418,6421-6423,6425,6429-6430,6432-6433,6435-6438,6440,6443,6453,6456-6457,6461,6463,6471,6473,6477,6479-6480,6483,6491,6494,6498-6499,6503,6506,6508,6516,6521,6524,6526,6529,6533,6537,6539,6541,6543,6546,6549-6550,6553,6560,6562,6565,6568,6570,6572,6574,6578,6581-6582,6584-6586,6588,6590,6592-6593,6601,6603-6604,6608-6609,6616,6621,6625-6626,6628-6629,6635,6640,6643-6645,6647-6650,6655-6657,6660-6661,6665-6668,6670-6671,6674,6676,6678,6680-6681,6683-6686,6688,6690-6691,6693,6697,6703,6706,6712,6715,6718,6722,6724,6726-6729,6732,6735,6737,6739,6743,6745-6746,6748,6750,6753,6755,6757-6760,6762,6764,6766-6767,6771-6772,6779,6781-6783,6789,6791-6793,6797,6802,6813,6816,6818-6819,6821-6824,6826-6827,6830,6834,6839,6841-6842,6846-6847,6853,6857,6865,6869-6870,6872-6873,6875,6877,6881-6885,6887-6890,6892-6893,6895-6897,6906-6908,6910,6913,6921,6923,6926,6929-6930,6932-6933,6935,6938,6941,6944,6946,6948,6950-6951,6954-6955,6958,6960,6965,6968,6974,6979-6980,6987-6988,6992-6993,6997-6999,7001,7005,7007-7008,7011,7013,7015,7017-7018,7021-7022,7030-7031,7035-7037,7042-7045,7047,7049,7051-7052,7054-7057,7060,7062-7063,7071-7073,7075-7076,7078-7080,7082-7084,7089,7091-7092,7094,7096,7098-7099,7102,7106,7109-7110,7112-7114,7116-7117,7122-7123,7128,7130-7134,7136,7138,7140,7146,7148,7152,7155-7156,7159,7161,7163,7165,7167,7169,7178-7179,7184,7186,7188-7189,7191-7192,7194,7196,7198,7202,7205,7209,7211-7212,7214,7220-7221,7224,7228,7237-7238,7248,7253-7254,7256,7258,7262,7265-7268,7272,7274-7275,7282,7291-7292,7298-7299,7302,7305,7313-7315,7325,7330-7333,7335,7337,7339-7340,7342-7344,7348,7351,7355,7361-7363,7372,7374-7376,7380,7390,7392,7410-7411,7413,7424-7425,7429-7430,7433-7434,7436,7444,7449,7456,7458,7461-7462,7465-7466,7468,7472,7477,7492,7497,7500,7506-7508,7511,7515,7517,7523,7530,7537,7540,7544-7545,7550-7552,7558,7560,7563,7565,7568-7569,7573,7575-7577,7580-7581,7586,7589,7591-7593,7595,7598,7600-7601,7604,7606,7608,7610-7611,7613,7620-7621,7632-7634,7639,7642,7644-7645,7648,7651,7653-7654,7657,7659,7661-7665,7668-7669,7671-7672,7674-7675,7678,7681,7685,7690-7691,7693,7695-7696,7698-7700,7703-7704,7707-7708,7711-7712,7715,7717-7718,7720-7721,7723,7725,7739,7741,7746-7747,7750,7753-7754,7756-7757,7759-7761,7763-7764,7769,7777,7781-7782,7794,7796,7799,7802-7803,7807,7809,7813,7815,7817,7821,7824,7826-7828,7834-7836,7838-7839,7841-7842,7845,7847-7849,7851-7852,7855-7857,7880,7885,7887,7890,7894-7897,7905-7906,7908,7910-7911,7914,7916,7918-7919,7922-7923,7926,7933-7934,7938,7943,7949,7952,7954,7958,7960,7962,7964,7971,7974,7976-7977,7983-7985,7988-7990,7992,7994,8004,8006,8008,8013,8016-8017,8019-8020,8023,8025-8026,8033,8035-8036,8039-8040,8049,8054-8055,8058,8060,8062,8065,8067,8070-8073,8076-8077,8080,8087,8090,8093-8094,8101-8102,8112,8114-8117,8119-8122,8124-8126,8129,8131-8132,8134,8141-8142,8144-8145,8148,8150,8152-8154,8156,8158,8162,8170,8173,8176-8178,8183,8185-8186,8190-8192,8194-8195,8199-8200,8204,8206-8210,8212,8214-8215,8219,8222,8224-8225,8228,8230,8233,8237-8238,8241,8249,8251,8256-8257,8260,8266,8271,8274-8275,8277,8282,8287,8289,8292,8301-8302,8305,8311,8319-8320,8324,8327-8328,8330,8332,8337-8338,8340-8341,8344,8348,8350,8353-8354,8356-8358,8365-8366,8378,8384-8385,8392,8397,8399,8401,8403-8404,8406,8408,8410,8419-8421,8423,8425,8427,8429,8433,8438,8441,8453,8456,8458-8459,8461,8463-8465,8467,8472-8473,8476,8478,8481,8485-8487,8489-8490,8493,8498,8501,8504,8509,8519,8521,8524-8525,8530,8533,8543-8544,8546-8547,8549,8556,8561,8565,8567-8569,8571,8583,8585-8586,8588,8590-8593,8602-8603,8606,8622,8626,8631,8640,8645,8647,8652,8667,8669,8672,8674,8677,8679,8692,8701,8705-8708,8716-8717,8724-8725,8728-8729,8733,8735,8740,8743,8748,8750,8755,8757-8759,8761-8762,8764,8766,8777,8779-8781,8786,8792,8798,8802-8803,8811,8816,8827,8832,8837,8843,8845-8847,8852,8856,8860,8862,8890,8894-8896,8905,8917-8918,8923,8935-8938,8946-8948,8950,8959,8961,8965,8975,8985,8987-8988,8995,9000,9008-9009,9011,9015,9019,9021,9024,9032,9037,9044-9045,9055,9059,9061,9065,9071-9072,9077,9083,9089,9092,9097,9100,9102,9105,9111,9116-9117,9125,9127,9130,9133,9137,9139,9145,9155,9159,9162,9165-9166,9171,9177,9179-9181,9187-9189,9191,9198-9199,9206,9208-9209,9211-9212,9214,9218-9219,9221,9224-9225,9227,9229,9231,9233-9234,9241,9248,9253,9257,9259,9261,9264,9271,9274-9275,9277-9278,9283,9285-9286,9291-9294,9297-9298,9300-9301,9303-9304,9306,9308,9312,9317,9321,9323-9324,9327,9330-9332,9336,9343,9345,9348,9350-9352,9359,9361-9362,9365,9372,9377,9379,9381,9389,9393,9395-9396,9398,9400,9402-9403,9408-9409,9412,9415-9416,9425,9429-9430,9435,9440,9442-9443,9447-9448,9450,9459-9460,9463,9467-9468,9470-9471,9473,9480,9483,9485,9489-9490,9492,9494-9495,9497-9498,9501-9503,9510,9514,9519,9521-9524,9528,9532,9535-9536,9538-9542,9545-9546,9552-9553,9560,9571-9572,9578-9579,9581,9585,9589-9591,9599,9601-9602,9604,9607-9608,9610-9612,9615,9617-9619,9621,9623-9625,9628-9630,9634-9635,9637,9640,9642-9643,9646,9648,9651,9653,9656,9659-9662,9665-9667,9669-9671,9676,9680,9682,9684-9685,9687-9688,9690-9691,9693,9695,9698-9700,9702-9705,9707-9708,9710,9717,9719-9721,9724,9729-9730,9736,9744,9759,9762,9764-9765,9767,9769,9774,9776,9781,9787,9793,9795-9796,9799,9807-9810,9812-9813,9818,9820,9828,9830-9831,9833-9836,9839-9841,9849-9852,9854,9857-9858,9861,9863,9866,9869,9876,9882,9886,9891,9893,9895,9898-9899,9902-9903,9905,9910,9912-9913,9916,9918-9922,9925-9926,9933-9934,9940,9944,9948,9951,9954-9955,9963,9965,9967,9969-9970,9972-9974,9976-9977,9982,9984,9986,9994-9995,10000,10002,10005-10006,10012-10014,10016,10019-10021,10023-10024,10027-10028,10031-10034,10041-10044,10047,10049-10053,10055,10061,10063-10064,10068-10070,10080,10082-10085,10089-10094,10096-10097,10099-10102,10105,10108,10110-10112,10114-10116,10118,10120,10122-10123,10129,10132-10134,10138-10142,10145-10146,10154-10155,10157,10159-10160,10164-10165,10168,10170-10173,10175-10177,10179-10181,10183-10184,10187,10192,10194-10195,10200-10201,10203,10208-10209,10211,10213-10215,10220-10221,10223,10225,10227,10232-10234,10236-10238,10250,10254,10275,10277,10283,10285,10290,10292,10296-10297,10300,10302,10305,10310,10312,10314,10324,10330,10332,10336,10343,10346,10351,10354,10356,10361,10363-10365,10375,10379-10382,10384-10385,10391,10397,10399-10402,10407,10410,10412,10420,10425-10426,10429,10436,10440,10444-10445,10447-10449,10458,10470,10474,10477,10479,10481,10488,10496,10500,10502,10504,10511,10525-10526,10533,10540,10549,10551,10555-10556,10559,10562,10569,10573,10576,10581,10583,10585,10590,10596,10598-10599,10601,10608-10609,10612-10614,10620,10627,10634,10639,10643,10649,10657,10663-10664,10667,10672-10673,10678,10680,10683,10685-10686,10695,10702-10703,10710,10712-10713,10716-10717,10724-10725,10729,10735,10737,10740-10741,10744-10746,10749-10751,10762,10764,10766,10772-10773,10776,10780,10783,10789-10790,10792,10796,10812,10817,10820,10824,10826-10828,10832,10835,10839-10840,10849-10850,10853,10858-10859,10863,10872,10890,10897,10899-10900,10906-10907,10911,10920,10922-10924,10926,10930,10936,10938,10941,10948,10950,10955,10959,10962,10967,10970,10987,11000,11004,11006,11016,11018,11024,11026,11028,11040,11051,11057,11059-11060,11064,11070-11071,11078,11081-11083,11087,11089,11093,11102,11106,11119,11130,11134-11135,11137,11140,11146,11154,11162-11163,11170,11174,11176,11181,11186,11188,11194-11197,11204-11205,11207-11208,11218-11220,11223,11225,11231,11235,11258-11260,11263,11265-11266,11269-11270,11274,11276,11279-11280,11287,11290,11292-11293,11296-11297,11299,11301-11303,11306,11309,11311,11314-11315,11317,11319,11322-11323,11326-11328,11330-11332,11335,11338-11339,11341-11342,11345-11347,11354,11357,11359-11360,11362,11364,11367-11369,11376-11377,11381,11383,11385,11389,11391-11392,11394-11395,11402-11403,11409,11415,11419-11420,11425-11427,11430,11434-11435,11440,11449-11450,11454,11456-11457,11460,11465-11467,11470,11475,11478,11480-11481,11484,11488,11496-11497,11500,11502,11508,11513-11514,11517-11518,11521,11523,11525-11527,11530-11532,11534-11536,11540-11541,11543,11545-11548,11551,11554,11556,11561,11563,11572-11573,11576,11579,11581,11584-11585,11587-11590,11592-11594,11597,11604,11608,11611,11613-11616,11620,11624,11633-11635,11644,11652,11657-11658,11663,11669,11673,11676-11678,11691,11693,11696-11697,11699,11701-11704,11706,11708,11710-11713,11715,11720-11721,11723,11728-11729,11731,11745-11747,11749-11753,11755,11760-11761,11768-11770,11772-11774,11777,11780,11782,11789,11791,11794-11796,11798-11802,11804,11806-11807,11809,11811-11813,11816,11819,11821,11826,11829,11838-11839,11844-11846,11848,11853-11854,11856,11858-11862,11864,11870,11875,11877-11879,11885-11887,11889-11890,11897-11902,11906-11907,11912,11917,11920,11926-11927,11929-11930,11932-11933,11937-11939,11941,11945,11951,11953,11955,11958,11963-11964,11967,11970,11973,11975-11977,11979-11981,11989,11996,11998-12000,12008,12011,12014-12015,12017,12019-12021,12026,12031,12034-12035,12044-12045,12047,12049,12051-12052,12055,12057-12059,12062-12064,12066,12070,12074-12075,12080,12086,12089-12090,12092-12093,12095-12098,12100,12102-12103,12107-12110,12112,12114-12115,12124-12125,12129-12131,12135,12137-12139,12142-12144,12147-12148,12151-12153,12155-12158,12160,12162,12168,12171-12172,12175,12177,12181-12183,12185-12186,12189,12192,12197,12200-12201,12204-12205,12208,12214,12217-12221,12223,12226,12229-12232,12234,12236-12238,12242-12246,12253-12255,12257,12259-12260,12264,12266,12274-12275,12280,12282-12283,12285,12289,12294,12296,12299-12300,12303-12304,12309,12312-12314,12317-12318,12321,12323,12326,12329-12331,12335-12337,12339,12348-12349,12353,12359,12362-12363,12365,12368-12369,12377,12380,12384,12390-12391,12397,12399-12401,12404,12406,12412,12414-12415,12418-12419,12421,12423-12425,12427-12428,12434-12436,12439-12440,12442,12445,12449-12451,12453-12454,12456-12457,12460,12464-12466,12470-12471,12473,12476-12477,12481-12483,12487-12488,12492,12494-12495,12497-12498,12501,12503,12507,12512,12516-12518,12521,12523-12524,12526,12528-12529,12531,12533,12537,12539,12541,12545,12548,12550-12554,12556,12558,12564,12567,12569,12575,12578,12584,12586,12594-12595,12597-12599,12602-12603,12606-12608,12610,12613,12615-12616,12619-12620,12625-12627,12629,12634,12637,12639,12642,12644-12646,12649,12652-12654,12660-12661,12664,12666,12668-12670,12673,12675,12678-12682,12684,12686-12687,12690-12691,12693,12695,12697,12699,12701-12703,12705,12707,12709-12710,12713-12717,12721,12723-12725,12727,12729,12731-12732,12735,12740,12742-12743,12745,12754,12756,12759,12761-12764,12766,12773,12776,12778,12781,12784-12785,12787,12789,12792,12795-12796,12798,12800-12801,12803,12806,12808,12810,12812-12813,12815-12816,12824,12827-12828,12830,12832,12834,12837,12840-12841,12846,12848,12850,12853-12855,12860,12868,12872-12874,12878-12881,12883,12886-12887,12890-12893,12899-12900,12902-12903,12905,12907,12909-12914,12916,12918-12921,12923-12924,12926,12928-12930,12934-12935,12938-12939,12946,12948,12951,12954,12964,12968-12969,12973,12975-12977,12979,12981-12983,12992,12996,12999-13000,13008-13009,13013-13014,13018-13020,13023,13025-13027,13031-13032,13034,13036-13038,13041-13046,13049-13050,13052,13054,13061-13062,13065,13067-13070,13074,13078-13079,13085-13087,13090,13092,13094,13098-13101,13105-13107,13109-13111,13118-13120,13122,13126-13127,13129,13131,13134-13136,13138,13140-13141,13143,13145-13146,13153,13157-13158,13160-13162,13165-13166,13168-13170,13172-13173,13175,13177,13179,13181,13184,13187,13191,13196,13198-13200,13206,13208,13212-13213,13216-13218,13220,13223,13229,13235-13237,13243,13246,13248,13251,13257,13260,13264-13265,13267,13269-13270,13274-13276,13284,13286-13290,13297-13298,13300-13301,13303,13305,13308,13310-13314,13316,13319-13320,13324-13325,13328,13330-13331,13334,13338,13342,13345-13347,13350,13352-13353,13365,13372,13383,13386,13390,13405,13408,13417,13421,13423,13438-13440,13442-13443,13445,13447,13449-13450,13453,13455,13459,13465-13466,13469,13474-13475,13478-13479,13481,13483-13484,13486-13487,13495-13496,13498,13505,13508,13515,13517,13522,13526,13535,13538-13539,13541,13545,13550,13552,13554,13557-13558,13562,13565,13567,13571,13573,13576,13581,13583-13585,13590,13593,13598-13599,13602-13603,13605,13607-13608,13611,13614-13615,13620,13624-13626,13633-13634,13636,13639,13645,13647,13649,13652-13654,13658-13659,13661-13662,13667,13670,13672-13673,13675,13678,13680,13683,13688,13697-13698,13706,13710,13713,13715,13719,13722,13725,13727,13730,13736,13741-13743,13749-13750,13755,13762,13765,13768,13770,13773,13776,13785,13787,13794-13795,13799-13800,13805-13806,13808,13811,13814-13817,13823,13828,13832,13836,13840,13843,13849-13851,13853,13855,13857-13858,13862,13864,13870-13872,13877,13881,13883-13885,13887,13892,13895,13898,13904-13906,13910,13925-13927,13929-13930,13936,13942,13947,13953,13955,13958,13966-13967,13973-13976,13978,13984,13986-13988,13990-13991,13995,14003-14004,14006-14009,14013,14015-14016,14019-14020,14029-14031,14039-14041,14045,14052,14063,14073,14078,14086,14089,14092,14097,14104,14107,14109-14112,14118-14119,14122,14124-14125,14131,14134-14135,14138-14139,14141-14144,14146,14149,14151,14155,14159-14160,14162,14165-14166,14169,14172-14174,14180-14181,14183,14185-14187,14192,14194,14196,14198,14201,14203-14206,14213,14221,14227,14229-14231,14233-14234,14237,14239,14243-14245,14250,14254,14256,14259-14261,14263,14265-14268,14271-14272,14274-14275,14280,14282,14286-14287,14289,14292-14294,14297-14299,14301-14305,14308,14311,14316,14318,14320,14323,14329,14339,14346,14348-14349,14351,14353,14356,14358-14359,14361-14362,14367-14368,14370-14372,14375-14377,14379,14382-14385,14387,14390,14392-14393,14396,14400-14401,14403-14404,14406,14408-14409,14412,14416-14417,14419-14421,14427,14431,14437,14439-14440,14445-14450,14453-14457,14459,14461,14463-14464,14468-14470,14472,14475,14481-14483,14488,14491-14492,14494,14496-14497,14499,14504,14508,14516,14518,14521-14522,14528-14529,14531-14533,14535-14538,14542,14545-14547,14549-14554,14557-14560,14562,14565-14566,14568,14570,14572-14573,14576,14579,14585-14587,14596-14597,14599,14602,14608,14611-14612,14614,14617-14621,14624,14626-14630,14632,14634-14637,14639,14641-14642,14645,14648-14650,14652,14654-14655,14657,14662,14666-14668,14670,14674,14678,14682,14684-14685,14688-14690,14692,14694,14698-14699,14704,14706,14711,14714-14715,14718,14725-14728,14731,14734-14735,14739,14748-14750,14756-14757,14759-14760,14762-14763,14766-14768,14770,14780,14782,14793-14795,14800,14802,14806-14809,14812-14813,14815,14821-14822,14829-14833,14835,14837-14840,14842-14843,14845-14846,14849,14851,14856-14857,14859-14862,14865,14867,14871,14873,14875-14878,14883-14884,14887-14889,14893,14895,14901,14903,14909-14912,14915-14916,14918-14920,14922-14923,14928,14930-14931,14933,14935-14937,14939-14940,14942,14946-14948,14950-14951,14957-14959,14961-14963,14968-14970,14976-14977,14979-14982,14984-14986,14990,14992,14994,15001-15004,15007-15009,15011,15016,15019-15021,15023,15025-15030,15036,15039-15041,15044,15046-15047,15052,15054,15058-15059,15062,15064-15065,15068,15070-15073,15075-15078,15080,15082,15089,15091,15096,15098,15101-15103,15108,15110-15114,15117-15119,15121-15124,15126-15128,15130-15133,15135-15136,15138-15139,15141-15145,15147-15148,15151,15156-15158,15161-15162,15176-15178,15181-15183,15185-15187,15189,15212-15213,15215-15218,15225-15227,15230-15231,15233-15235,15237,15245-15246,15248-15250,15256,15258-15260,15263,15271,15276,15278-15279,15292-15293,15296,15298-15299,15309,15311-15312,15314-15315,15328-15330,15348-15349,15351,15360,15363-15364,15367,15369,15372,15374-15375,15378-15379,15383-15384,15387,15396-15397,15404,15407,15409,15411,15416-15418,15433-15434,15438,15445,15448,15450,15452,15457,15466,15468,15482-15483,15485-15487,15489,15492-15494,15496,15498,15500,15502-15506,15513-15514,15519-15522,15533-15536,15549,15551,15554-15555,15557,15560,15562-15563,15574-15575,15578,15585,15593-15595,15598,15600,15604,15606-15607,15614,15616-15617,15619-15620,15622,15630-15631,15633-15636,15638-15642,15646,15649,15652-15653,15659-15661,15665-15670,15672-15674,15683,15685,15687,15691,15698-15699,15705-15710,15713,15715,15720-15722,15726-15729,15731,15736-15738,15745,15747-15749,15751,15754-15755,15764,15766-15767,15777-15779,15781,15785-15786,15789,15805,15807-15808,15811-15812,15815-15817,15819,15821-15823,15829-15830,15833,15835-15836,15838-15839,15841,15848-15849,15851,15864-15866,15876-15878,15881-15883,15888,15890,15892,15894,15920,15923-15924,15931,15934,15936,15938-15940,15944,15950-15951,15954-15956,15958,15964,15971-15972,15975-15976,15979,15981-15982,15984-15986,15988-15990,15993-15994,15997-16000,16002-16006,16012-16013,16015-16017,16027,16032,16034-16035,16044,16046-16047,16060,16062-16063,16066-16067,16070,16092-16093,16095,16100-16102,16112-16114,16124,16132-16134,16141,16144,16148,16152-16154,16160,16162-16163,16168,16170-16173,16175,16177,16179-16180,16182-16183,16185,16188-16189,16191-16194,16200,16202,16205,16212,16214-16215,16217,16219,16224,16226-16227,16229,16232,16234-16237,16239,16241-16244,16247,16251,16256,16259-16261,16264-16266,16268,16270,16279-16281,16285-16287,16296,16298-16300,16302-16305,16307,16312,16314-16315,16317-16322,16324-16326,16331,16334-16335,16341-16342,16344,16346-16347,16349-16353,16356-16358,16361-16362,16365,16372,16376-16378,16380,16382-16383,16385-16386,16391-16392,16395-16396,16398-16399,16402,16410,16412,16414-16415,16417,16422-16423,16428,16433,16444,16446,16450,16452-16453,16459,16469,16475,16482,16484-16485,16494,16497,16511-16513,16516,16519-16520,16522,16524,16527,16531-16532,16536-16537,16544-16546,16548,16552-16554,16557,16560-16561,16565,16569-16570,16572,16574,16581-16582,16588,16592,16599,16601,16604,16606,16609-16611,16617-16619,16624,16626-16627,16629,16631,16634-16635,16639,16641,16644,16650,16665,16678-16682,16685,16695,16697-16698,16718-16719,16726,16749,16751-16752,16757,16763,16769,16771-16772,16776,16779,16781-16784,16788,16790-16792,16794,16797-16798,16801,16807,16810,16814,16818,16823-16824,16826,16830,16837,16842,16844,16849,16857,16859,16862-16863,16865,16871-16873,16880,16883,16891-16892,16897-16898,16904,16908,16917-16920,16922,16924-16926,16929-16930,16937,16940,16943,16945-16947,16949,16953,16955-16957,16960-16961,16964,16970-16973,16982,16987,16996,16998-16999,17003-17004,17011,17016,17018,17020,17023-17024,17035-17037,17045-17046,17051-17053,17056,17061-17062,17065-17066,17068,17072,17075,17079-17081,17083-17084,17089-17091,17095,17098-17099,17102,17106-17107,17114-17115,17121-17122,17130,17137,17144,17161,17163-17164,17171,17174,17177-17178,17184,17188,17193,17196-17198,17200-17201,17206,17208,17211-17212,17215,17217,17222-17223,17225,17229-17230,17237,17243,17248,17260,17270,17272,17276,17280,17290,17296-17297,17301,17316,17328,17349,17360,17410-17412,17417,17419,17421,17426-17427,17437,17439,17441,17443,17447,17451,17456,17458,17462,17465-17466,17468,17472,17477-17478,17482,17486-17487,17490-17492,17496,17502,17504-17506,17513,17518,17531,17533-17534,17543,17545,17551-17552,17555-17556,17576,17578-17579,17582-17584,17588-17589,17601,17605-17606,17611,17631,17635,17638,17640-17642,17645,17650,17654-17655,17657-17658,17664,17666-17667,17669,17671,17677,17679,17682,17686-17687,17689,17691-17692,17695,17698,17702-17704,17707-17708,17710,17720-17721,17723-17725,17730,17735,17737-17740,17743-17745,17752,17754,17759,17761,17768,17770,17773,17775,17780,17785,17790,17792-17793,17796-17797,17802,17804,17808,17810,17813,17817,17820,17822,17827,17832,17838-17840,17844,17847,17852,17859-17862,17864,17866,17869,17872,17878,17881,17883,17888-17890,17893,17895,17900,17909,17912-17913,17925,17928,17931-17933,17938,17944,17948,17953,17962-17965,17970,17991,17994,17996,17998,18002,18004-18006,18009,18017,18178-18179,18192-18193,18196,18413-18414,18421-18422,18425,18427-18428,18434-18436,18438,18441,18449-18450,18452-18453,18670,18679,18682,18685,18687,18843-18844,18847,18849,18851-18852,18856,18860,18862,18868,18870,18877,18887,18889,18891,18894,18898,18907,18909,18912,18914,18923-18924,18927-18928,18932,18957,18959,18963-18966,18973-18975,18985-18986,18988,18990-18992,18996,19001-19002,19006,19012,19016,19021-19022,19024-19025,19027,19030,19032,19034,19036,19041,19043,19048-19049,19053,19056,19059,19063,19070-19071,19079,19081,19084-19085,19090,19092-19093,19096,19100-19101,19111,19114-19115,19117,19120-19121,19123,19125,19129-19130,19133,19135,19137-19139,19144,19146,19148,19153,19155,19157-19158,19160,19162,19164-19166,19168,19172,19174-19175,19178-19179,19181,19184-19185,19188-19189,19193,19195,19200-19201,19203,19205,19213,19215-19216,19219-19220,19229-19230,19235-19237,19241,19244-19245,19250-19251,19256-19257,19260,19262,19268,19272,19275-19277,19282-19283,19288,19294-19295,19309-19310,19316-19317,19320,19322-19323,19332,19336-19337,19339-19342,19345,19348-19350,19354-19355,19357,19362-19363,19367-19368,19371-19372,19374,19376-19378,19380-19382,19385-19386,19388,19390-19393,19396-19397,19399-19401,19406-19407,19410-19413,19417,19419-19420,19431,19434-19435,19438-19439,19443,19445,19448,19451-19454,19497,19507,19511,19517,19547,19556,19563,19566-19567,19569-19570,19578,19585-19586,19589,19592,19596,19599-19600,19619,19622,19626,19634,19641,19661-19662,19673-19675,19687,19699-19700,19702-19703,19724,19726-19728,19733,19736,19741-19742,19745-19747,19750,19755,19759-19760,19764,19766-19767,19770,19777-19778,19785,19788,19791,19793,19796-19797,19799,19805-19808,19813,19816-19817,19820,19826,19830,19833,19837,19840,19842-19843,19847-19849,19851,19853-19854,19858-19859,19863,19867,19872-19873,19878,19881-19882,19899,19901,19905,19907-19908,19912-19914,19917,19919,19922-19924,19926-19927,19929,19933-19934,19942-19943,19945,19947,19950,19954,19957,19961-19962,19965,19976,19979-19980,19983,19985-19986,19989,19993-19994,19998,20005,20008-20009,20015,20022-20023,20025,20033,20039,20043,20047-20048,20054,20056,20059,20067,20078-20079,20082,20093-20094,20104,20108,20110,20118,20120,20124-20125,20128-20129,20134,20137,20140,20142,20145,20149,20152,20162,20186,20188,20190,20198-20200,20206,20212,20214,20219,20221,20223,20225,20228,20231-20234,20236-20237,20239,20242,20244,20253-20254,20257,20264,20268-20269,20273,20275,20279,20285-20286,20290-20291,20293-20296,20298-20300,20307-20309,20313,20319-20321,20323,20325,20330-20331,20335-20336,20338-20340,20342,20345,20347,20351,20358,20365,20370,20372-20373,20382,20386,20389,20391-20392,20397,20399-20400,20409,20413,20416,20418,20422-20424,20428,20431,20434,20440,20442,20445-20447,20449-20450,20454,20459,20461,20468-20469,20472,20476,20481-20486,20489,20495,20501,20505-20507,20509-20510,20512-20513,20516,20518,20522-20524,20528,20530,20534-20536,20546-20548,20550-20554,20561-20563,20570-20572,20574,20576,20579-20581,20583-20584,20586,20588-20589,20591,20593,20597,20601,20603-20605,20607-20608,20613-20614,20616-20617,20621-20622,20625-20627,20629,20631,20641,20643-20644,20646,20648,20650,20652,20657,20659,20661,20665-20666,20673-20674,20688,20690-20691,20693,20696,20701,20703,20711,20713,20716,20726-20727,20732,20735-20736,20742,20744,20746-20748,20750,20753,20755,20760,20764,20766-20767,20772,20775,20783,20786,20792-20793,20798,20802,20804-20805,20807,20816-20817,20819-20820,20823-20824,20826-20828,20831,20835,20838,20840,20842,20844,20849,20851,20856,20864,20867,20869,20872,20874,20880,20887,20891,20893-20894,20903,20912-20913,20915-20916,20920,20922,20926,20934,20939,20942,20947,20950,20953-20955,20960,20962-20963,20966,20975,20977-20978,20981-20984,20988-20989,20994-20995,20997,21001,21003,21005,21010,21019,21023,21025,21027-21029,21039,21046,21048,21055,21058,21060,21062,21073-21077,21080-21082,21086-21087,21089,21091,21094-21095,21097,21099,21101-21102,21106-21107,21109,21115,21118-21119,21121,21128,21131-21133,21141-21142,21144,21151,21153,21157,21159-21160,21162-21163,21165,21168,21170-21171,21174-21176,21179,21182,21185-21186,21190,21194,21200,21205-21206,21212-21214,21219,21221-21222,21225-21229,21232,21235,21240-21241,21246-21247,21250,21253,21256,21265-21266,21270,21275,21278-21279,21281-21283,21285-21286,21288-21289,21294-21295,21302,21311-21312,21314-21316,21319,21323,21325,21327-21329,21331,21338,21342,21344-21346,21352,21354,21357,21359,21361-21363,21366,21369-21371,21373-21375,21377,21379,21381,21384,21391,21393,21395-21396,21398,21400-21401,21403-21406,21409-21410,21413-21418,21420-21421,21424,21426,21430-21431,21434-21435,21438,21441,21443-21445,21447-21448,21451-21454,21458-21459,21461-21465,21469,21471,21476,21479,21489-21491,21494,21496-21498,21501-21503,21505,21507-21508,21510-21511,21513-21515,21520,21522,21524,21526,21531,21540,21542-21543,21547-21548,21552,21556,21559,21564,21566,21568-21569,21571,21574-21575,21577-21578,21580-21581,21587-21588,21591,21600,21603,21614-21615,21618,21620-21621,21623,21625-21627,21631,21634-21635,21637-21638,21641-21644,21646,21648,21650,21652-21654,21656-21657,21661-21665,21668,21670-21671,21673,21677,21681,21690,21693-21694,21696,21699-21700,21702,21704-21705,21708-21709,21712-21714,21717,21719,21721,21724-21725,21728-21729,21731-21732,21735-21737,21740,21743-21744,21746-21747,21749-21750,21752,21754-21756,21758-21761,21763,21765,21767,21769,21771-21772,21775-21778,21780-21781,21784-21785,21789-21790,21797,21803,21809,21811-21813,21815,21818,21825,21827-21830,21834-21836,21841,21843,21847-21848,21851-21852,21860,21863-21866,21872-21873,21875,21882,21884,21887,21890,21893-21894,21900,21904,21906,21908-21909,21920,21924,21929,21931,21937,21939,21941-21943,21952,21955,21957-21959,21961,21964,21969,21977-21978,21982,21987,21989-21991,21998,22006-22007,22010-22011,22014,22017-22022,22024,22026,22029,22031-22032,22035,22037,22039,22045-22047,22052,22054-22055,22057,22059,22062-22066,22069,22076-22077,22081,22083-22084,22088,22090,22093-22094,22098,22100,22105-22106,22110,22113-22114,22116,22118-22119,22121-22122,22125-22128,22131-22132,22134,22136-22138,22142,22145-22146,22148,22150-22153,22155-22157,22159-22162,22165-22168,22170,22172,22175-22178,22180,22182,22184-22185,22189-22190,22193,22197-22200,22202-22206,22214-22215,22217-22219,22221-22222,22224-22225,22231,22235-22236,22238-22240,22242-22245,22248-22249,22252-22253,22260,22262-22264,22268-22269,22271-22272,22278,22280,22285,22287,22289,22293-22294,22296,22300,22302-22303,22307,22312-22314,22316-22318,22323-22324,22326-22330,22332,22336,22339-22340,22346-22347,22349,22354-22355,22358,22367,22369-22374,22376,22381,22383,22385,22388,22391,22397,22400-22402,22404,22406,22409,22412,22415,22422-22423,22425,22427-22429,22432,22434-22436,22439-22442,22444,22446-22448,22452-22453,22455-22456,22458,22461,22463-22465,22470,22474,22476-22477,22479,22484,22486,22490,22498-22500,22502-22503,22505-22507,22510,22529-22530,22537,22542-22543,22546,22550,22558-22559,22576,22590-22591,22594,22601,22605-22606,22608-22609,22618,22625-22627,22636,22639-22642,22649-22651,22654-22655,22660,22662-22663,22665,22667,22669,22671,22678,22683,22685,22687,22689,22691,22696,22702,22704,22706-22707,22714,22716-22717,22722,22730-22731,22736,22741,22743,22746,22748,22755,22757-22758,22762,22773,22775,22778-22780,22785-22788,22793-22794,22796,22799-22800,22803,22807,22809-22810,22812-22813,22815-22816,22819-22820,22822-22823,22828-22829,22831,22834-22835,22838,22840-22842,22844-22845,22847-22849,22851,22854,22856-22858,22864,22867,22869,22874-22875,22878-22879,22882,22887-22888,22892,22894-22895,22900,22902-22903,22909,22915,22920-22922,22925-22929,22932-22933,22935,22937-22938,22941,22946-22949,22953-22955,22958,22965-22966,22969-22970,22972,22976-22977,22980,22982,22984,22986-22989,22991-22992,22995,22998-22999,23001-23004,23006,23008,23014,23017-23018,23021,23024,23027,23029-23030,23035-23037,23039,23041,23048,23052,23054,23061,23065-23066,23070,23073,23076-23077,23080-23081,23084,23086,23093-23095,23097,23099,23105-23106,23113,23118-23120,23124,23126,23129,23132,23139-23141,23145,23147,23150,23155,23159,23161,23165,23168,23172-23174,23182-23183,23190-23192,23198,23201,23203,23205,23213-23214,23221,23223,23226,23228,23236-23237,23242,23244,23247,23261,23268,23270-23271,23273,23275-23276,23278,23281-23283,23287,23294,23301,23304,23306,23310,23312-23314,23318,23321-23322,23325-23327,23331,23338-23339,23342,23344,23351,23356-23357,23360-23361,23365,23367,23369,23372,23375,23377-23379,23382-23383,23387,23389,23391,23393-23396,23398,23408,23410,23413-23414,23417-23418,23423-23425,23431,23435,23441,23443,23445-23446,23455,23463-23464,23469-23470,23472,23478-23479,23485-23487,23491,23494,23496,23500-23501,23503,23505-23506,23508,23511,23514-23515,23517-23518,23520,23522,23525-23526,23530,23536,23553,23555-23557,23562-23563,23572-23573,23575,23586,23588,23592-23593,23604,23606,23608,23613-23618,23620,23623,23625,23627,23629-23632,23635,23639-23640,23643-23644,23646-23647,23655-23656,23664-23666,23668,23670,23674-23675,23677-23682,23684,23686,23691-23694,23696-23698,23701,23705-23707,23709-23711,23716,23718,23720,23722,23726,23728,23731-23732,23734,23738,23740,23744,23746-23749,23751,23757-23759,23761,23765-23766,23768,23770-23771,23775,23780-23781,23784-23785,23789-23790,23792-23794,23800,23808,23812,23814,23820-23821,23824,23826-23827,23829-23832,23834,23837,23840-23841,23843,23847,23849,23852-23853,23855-23856,23858,23862,23865-23866,23873-23874,23936-23938,23940-23942,23945-23946,24064-24065,24067-24069,24071-24072,24075,24080,24083,24086,24089-24090,24093-24097,24099-24100,24102,24105,24108,24113,24120-24122,24133-24134,24138,24193,24196,24405,24409-24410,24412,24414-24415,24421,24423-24424,24428-24430,24432-24433,24438-24439,24442,24447,24467,24469,24476-24478,24484,24487,24490,24494-24495,24502-24503,24506,24508-24510,24512-24514,24516,24518-24519,24521,24523,24526,24528,24530,24532,24534-24536,24543,24545,24547-24548,24550-24553,24556,24558-24559,24562,24568-24570,24574-24576,24579,24582-24584,24587,24591,24594,24596,24602-24604,24612,24617-24618,24620,24628-24629,24633-24635,24638-24639,24642,24645,24650-24651,24653-24654,24656,24658,24661-24662,24666,24669,24675,24681,24685,24689-24690,24700-24701,24707-24708,24711,24714,24719,24721,24727,24730-24732,24735,24737,24742-24744,24747,24751,24754,24763,24768,24773-24774,24793,24795,24797-24798,24807,24810,24813,24815,24818,24820,24825-24826,24828,24834-24835,24838,24841-24842,24845,24847-24848,24852,24854,24869-24870,24872-24874,24886,24888-24890,24893,24895-24897,24900-24901,24904-24906,24908,24910,24913,24923-24925,24927,24929,24932,24934-24936,24938,24940,24942-24944,24946-24947,24953,24964,24974-24977,24981-24982,24986,24989,24991,24993,24995,25001,25006-25009,25011-25012,25020,25023-25025,25030,25034,25036,25039,25043,25050,25052,25056,25058,25063-25064,25068,25074,25078,25082,25091,25096,25098,25120,25123,25133,25135,25142-25143,25159,25163,25172,25174,25183-25184,25186,25193,25198,25203,25209-25211,25215-25218,25222,25227,25229,25231-25232,25235,25237,25241,25248,25250,25253-25255,25262-25264,25269,25271-25273,25278-25279,25285,25291,25295,25307,25309,25311,25314,25318,25321,25326,25328,25331,25334,25336,25339-25340,25348,25359-25360,25365,25370,25372-25373,25375,25377-25378,25384,25394,25397-25398,25401-25402,25404-25405,25410,25415,25442,25445-25447,25452-25454,25473,25475,25482,25490-25491,25499,25505,25513,25515,25518-25519,25523,25526,25528,25531,25534,25537-25539,25546,25548,25571,25600-25601,25604,25610,25634,25813,25844,25851,25853,25860,25869-25871,25874,25878-25879,25882,25892-25893,25896,25902,25907,25913-25914,25919,25924,25929,25931,25934,25940,25943-25944,25952,25954,25957,25962,25965,25971-25972,25974-25975,25980-25982,25985,25996,26000-26001,26003,26009,26014,26024,26030-26031,26033,26036,26050-26051,26053,26060-26061,26063,26066,26068-26069,26071,26077,26082,26084,26092,26095,26097-26098,26101,26106,26110,26191,26197,26200,26204,26221,26224,26227,26229-26231,26309-26311,26317,26325,26334,26337,26345-26347,26350-26351,26357,26364,26366,26371,26378,26386,26389-26391,26398,26402,26412,26416,26420,26423,26427,26437-26438,26440-26441,26443,26445,26449,26451,26455,26465,26468-26469,26471,26477,26480-26482,26486-26487,26489,26491-26494,26499,26501,26504,26510,26521,26526,26529,26532,26538,26543,26546,26575-26576,26581-26583,26586-26587,26589,26597,26599-26600,26604,26615,26617,26619,26627-26628,26630-26631,26638,26644-26645,26648,26651,26656-26657,26660,26668-26669,26671,26674-26676,26678-26679,26692,26696,26700-26701,26704,26707,26716,26718,26723,26727-26729,26734,26739,26742-26743,26745,26749,26753-26754,26758-26759,26769-26770,26773-26774,26778-26782,26784-26786,26788,26791-26793,26795-26797,26802-26803,26806,26810-26811,26813,26817,26821-26822,26832,26834,26839,26843-26844,26851,26854,26857-26858,26862,26864,26866,26870,26873,26876-26877,26891,26893,26898,26901,26912,26914,26921,26934,26938,27008-27009,27014,27019,27021-27022,27032,27040-27041,27043,27045,27047-27048,27056,27136-27137,27140,27143-27144,27150,27155,27159-27160,27165-27166,27170-27172,27176,27178-27179,27182,27185,27187,27192,27195-27197,27201-27202,27205,27207-27210,27214,27216,27219,27222,27224,27227,27233,27236-27237,27242-27243,27246-27247,27249,27251,27253,27255,27259,27262,27265,27267-27268,27270-27272,27279,27281,27286,27288,27290,27292-27294,27296,27298-27299,27301-27306,27312-27313,27315,27318-27321,27329,27332,27337,27345-27348,27350,27352-27353,27356,27361-27363,27365,27375,27378,27380,27384,27386,27396,27403,27424,27434,27605,27614-27615,27641-27643,27647,27670,27676,27678,27709,27714-27715,27720,27729,27732,27734,27737,27741,27749,27755,27764,27766,27775,27793,27796,27799,27802-27803,27807,27813-27814,27821-27824,27827,27833,27838,27842,27846,27850,27853,27856,27858,27861,27863,27865,27867,27874,27882-27886,27892,27895-27896,27898,27900,27902,27911,27915,27920,27922,27929,27931,27935,27937,27943-27944,27948,27951-27952,27955,27958-27960,27964,27967-27969,27973,27978,27980,27984-27985,27991-27992,28001,28008-28010,28013,28016-28017,28019,28021,28023,28025-28026,28030,28041,28046,28048,28052-28054,28059,28061,28063,28076,28078,28085,28089,28093,28111,28116,28129-28130,28136,28140,28146,28152-28153,28159,28164,28166,28172,28174,28177-28179,28187,28189-28191,28193-28194,28199,28202,28207-28208,28210,28212,28214-28215,28218,28223,28233-28234,28237,28241-28243,28247-28248,28252-28253,28255,28258,28269-28272,28278,28281,28285,28289,28291-28292,28294,28301,28306,28312-28313,28316,28321-28322,28330-28332,28336-28337,28341,28348-28350,28352,28360,28362,28372,28374,28378,28380-28381,28384,28386,28392-28393,28395,28397,28401,28405,28409,28411,28423,28425,28430,28433-28434,28439-28440,28448,28450-28451,28453,28457-28458,28470-28472,28478-28480,28482,28492,28494,28496-28497,28502,28504,28511,28513-28514,28517,28519,28531,28533,28538,28544-28545,28549,28555-28558,28560,28567-28570,28579-28580,28582,28585,28593-28595,28598,28601,28603,28605,28614,28618,28625,28630,28635,28643,28645,28647,28650,28652-28653,28657,28659,28666,28670,28672,28675,28684,28686,28688,28690,28692-28694,28697-28699,28701,28703,28706,28708,28710,28714-28716,28719,28725,28730-28733,28738,28744,28746-28747,28749,28759,28769-28770,28773-28774,28776,28800-28801,28803,28812-28813,28815-28816,28819,28824,28838,28841-28843,29051,29054-29055,29113-29114,29118,29127,29131,29135-29136,29142-29143,29148,29156-29157,29159,29163,29167-29168,29172,29174,29176,29178-29179,29184,29299,29301,29308-29309,29311,29372,29381,29387-29389,29393-29398,29400,29402,29406-29407,29413-29414,29416,29428,29430-29431,29434,29437,29439,29447,29449,29453,29457-29458,29461-29462,29464-29465,29471,29474,29476-29477,29479,29482-29483,29488-29489,29491-29492,29498-29501,29509-29510,29515-29516,29518,29520,29522,29525,29529,29536,29541,29548,29553-29554,29557,29561-29562,29564,29566,29568,29571,29577,29579-29580,29588,29592-29593,29598,29604,29606,29608-29609,29612,29616,29620-29621,29625,29630-29631,29633,29636,29638,29647,29656-29658,29661,29667,29670,29674,29678-29681,29684,29687-29688,29711,29715-29717,29720-29721,29723,29726-29730,29732-29733,29735,29737-29740,29747-29750,29753-29757,29759,29766,29769,29772,29774-29775,29784-29785,29788,29795-29796,29800-29801,29803,29810-29811,29814,29818,29823-29825,29829,29831,29833,29835,29837,29840,29846,29849-29850,29854,29857,29859,29861-29862,29869,29872,29874,29876-29877,29881-29883,29885,29887,29889,29894-29896,29898-29901,29903,29907,29911,29913,29919-29922,29926,29930,29932,29934-29935,29940,29943,29945-29946,29950,29953-29954,29958,29961,29963,29966,29968,29974,29977,29980,29982,29987,29992,29995-29996,30001,30007-30008,30014-30015,30017-30018,30024,30026,30036,30040,30042-30043,30048,30052-30054,30056-30057,30059,30063,30065,30067-30068,30072-30074,30081,30087,30089,30091,30099-30101,30107,30114,30123,30125,30128-30130,30137,30141-30142,30144,30150,30152,30154,30156,30159,30161,30164-30166,30170-30173,30175,30181,30183,30187,30189-30191,30193,30195,30197,30200,30204,30206-30209,30212,30216,30218,30220,30224,30233,30241-30242,30244,30247-30249,30253,30264,30270,30272-30274,30277-30278,30280,30289,30291,30293,30295-30297,30299-30301,30303,30305-30306,30308,30310,30312,30315,30318-30319,30321,30324,30326,30328-30330,30332,30334-30337,30342,30348-30349,30358-30359,30364-30365,30367,30369-30371,30373-30376,30378,30380-30381,30385-30386,30393-30394,30396,30402,30405-30407,30410-30413,30417,30421,30424-30425,30427,30429,30431,30434-30435,30437-30439,30442,30444-30445,30447,30453,30458-30459,30462,30466,30468-30469,30471,30473,30475-30476,30478-30479,30483,30485-30486,30488,30492-30493,30495,30497-30498,30504,30508,30510,30513,30515,30522,30529,30533,30535,30539,30542,30544,30548-30550,30552-30553,30557-30558,30561,30565,30568,30570-30571,30574,30576,30578-30579,30581-30582,30584,30586,30588,30590,30597,30604-30606,30608-30609,30611,30614,30616-30618,30621,30627,30631,30633,30636-30637,30641-30642,30646-30648,30650-30652,30661-30663,30665-30666,30668,30670,30672,30675,30679-30682,30691,30693,30699-30700,30702,30704-30705,30707-30708,30711,30714-30716,30719,30737,30742,30745,30747,30759,30762,30765,30770-30773,30780-30782,30784-30785,30788,30790,30795,30797,30802,30804-30806,30809,30825-30826,30829-30830,30833-30836,30838,30840-30842,30847-30848,30852-30853,30855,30863-30864,30866,30871,30878,30887,30896,30898,30901,30904,30906,30911,30915-30917,30924,30926,30928,30930,30933,30937-30938,30941,30943,30951-30952,30956-30958,30965-30966,30968,30974-30975,30980-30981,30987,30989,30993,30995,31001,31003,31005-31006,31008,31013,31015,31020,31026-31027,31031,31036-31038,31043,31047-31048,31058,31060,31062,31066,31071,31076,31078,31082-31083,31086,31098,31108-31109,31113-31115,31119,31122,31125,31133-31135,31138-31140,31142-31144,31149,31151,31153-31154,31157-31158,31160,31162-31163,31169-31172,31175,31177,31181,31183,31187,31195,31199-31200,31204-31205,31207-31208,31210-31211,31214,31216,31218,31220-31222,31224-31225,31228,31231,31237,31241,31250,31252-31253,31255,31258,31265,31268,31270,31272-31274,31277,31284,31287-31289,31293,31298-31301,31303,31309-31310,31317,31319,31322,31324-31325,31328,31337-31338,31342,31346,31349,31352,31354,31356,31364-31365,31369,31374,31380,31383,31387,31389-31392,31394-31396,31400,31405-31407,31409,31416,31418,31420,31430,31432,31437,31439,31450,31458,31461,31463,31472,31474,31476,31478,31480-31481,31486,31491-31492,31494,31499-31500,31504-31505,31510,31512-31513,31517-31518,31521,31524,31526,31528-31529,31532,31534-31536,31538-31539,31541,31553,31556-31557,31561-31565,31569,31575,31577,31579,31582,31584-31585,31589,31592,31594,31599-31601,31603,31608,31613,31615,31625,31629-31630,31633,31636-31637,31642-31644,31659-31660,31662,31666,31668,31670,31672,31675,31679,31685-31686,31693,31695,31698,31700-31701,31707,31710,31712,31724,31728,31730,31732-31733,31736,31739-31740,31742,31745-31746,31748-31749,31751,31753-31754,31756,31758,31765-31767,31769,31774,31777-31781,31788-31790,31794-31795,31798-31799,31804-31806,31811,31813-31816,31818,31820-31821,31823,31826-31827,31830,31832,31841,31843,31845,31850-31852,31857,31860-31862,31864-31865,31872-31874,31877,31879,31884-31886,31889-31890,31894-31895,31900-31901,31903-31904,31907,31909,31911,31915,31920,31923-31924,31926,31929,31932-31933,31936,31938-31940,31944-31946,31948-31949,31953,31955,31961-31962,31966-31970,31974-31975,31977,31979-31980,31984-31986,31989-31990,31994,31998-32000,32002-32005,32008-32009,32012-32014,32016-32018,32020,32022,32028,32033,32036,32038,32044,32049,32052,32056-32058,32060,32064-32065,32067-32068,32070,32072,32074-32075,32081,32083-32084,32086-32087,32093,32095,32100,32106-32107,32111-32113,32115-32117,32120,32122,32124-32125,32128-32129,32134-32138,32140-32141,32146-32147,32150,32152,32155,32158-32159,32161,32163-32164,32166,32171-32172,32175-32176,32179,32181,32192-32193,32196,32207-32208,32210,32212-32213,32216,32219-32222,32225,32227,32230-32231,32233,32239,32241-32242,32248,32251-32254,32256,32259-32260,32266,32270-32271,32273,32277-32280,32282-32285,32289,32291,32293-32297,32299-32300,32304,32306,32308-32310,32312-32314,32316-32317,32321-32323,32325,32328,32331-32334,32336,32347-32348,32355-32358,32372,32375,32378,32380,32382,32385-32386,32391,32396,32398,32403,32409,32411,32413,32419,32421-32422,32428-32429,32436,32438,32440-32441,32444,32446-32448,32450-32451,32453,32456,32459,32461,32463,32465-32466,32468,32470-32472,32475,32477,32484-32485,32488,32493,32495,32497,32499,32502,32505-32507,32512-32513,32515,32518,32520-32522,32533,32535-32536,32540,32547,32552,32555-32556,32559-32560,32564,32570-32572,32578,32580,32583,32586-32587,32589,32593-32594,32599,32601,32603,32607-32608,32610,32612,32617-32622,32630-32631,32633,32639,32644-32646,32650,32653-32655,32657-32658,32660,32666,32668,32670,32672,32676,32682-32686,32690,32694,32696,32700-32701,32703-32704,32708-32709,32711-32713,32715-32716,32718,32720-32721,32723,32726-32727,32730-32732,32735-32736,32738-32739,32741-32742,32746-32749,32753,32755-32756,32758-32759,32765-32766,32768,32770-32772,32774,32778,32785-32787,32790-32791,32793-32796,32798,32800,32802,32805-32806,32809-32813,32815-32816,32818,32821-32822,32824,32836-32837,32839,32844,32847,32857,32859,32862,32864,32867,32874-32876,32878,32880,32884,32886,32893-32894,32896,32898,32900-32901,32903,32905,32908,32910,32913-32915,32917,32919,32921-32924,32926-32927,32929-32930,32933-32935,32941,32945-32949,32951-32953,32955-32957,32960,32962-32963,32965-32968,32970-32971,32973-32974,32980-32981,32986,32988,32993,32995,32998-32999,33002-33003,33005-33006,33010,33013,33016,33021-33022,33025,33027-33028,33030-33031,33033-33034,33044-33045,33047-33048,33050,33053,33055,33057,33059,33064-33065,33067,33069,33072-33073,33082,33092-33093,33095-33097,33102,33105,33107,33119-33120,33122-33123,33129-33130,33137,33144,33147,33153-33154,33157,33160-33161,33166-33168,33172,33175-33176,33178,33184-33186,33188-33190,33192-33193,33195-33196,33198,33202,33211,33214-33216,33219,33224,33227-33228,33232,33236-33238,33240-33241,33243,33245-33249,33251,33257-33258,33264-33265,33267,33279,33281-33283,33291-33294,33298-33299,33301,33305-33306,33308,33310-33311,33318-33319,33329-33331,33333-33334,33336,33338,33340,33342,33347,33350-33351,33353-33354,33364,33366,33368,33371-33373,33378,33380,33384,33386-33387,33389-33390,33393-33394,33402,33404-33405,33409,33411,33415-33418,33421-33422,33424,33428,33432,33436,33442-33443,33447,33449-33452,33454-33455,33457-33459,33461,33465,33468-33470,33474-33475,33483,33486-33489,33492,33496,33498-33499,33507,33509,33514,33517-33519,33521,33525-33526,33531,33535,33537-33538,33540-33541,33545,33552,33554,33556-33557,33559,33561-33562,33564,33568,33572,33575-33576,33578,33581,33583-33584,33589-33590,33595,33598-33600,33604,33606,33616-33618,33620-33621,33623-33626,33631-33632,33639,33641,33643,33645,33648-33649,33653,33655-33657,33659,33663,33665-33667,33674,33677-33678,33682-33684,33689,33691,33694,33704,33710-33711,33715-33718,33720-33721,33724-33725,33731,33733,33741,33743-33744,33748,33755-33756,33758-33759,33762,33768,33774,33778,33780,33782-33783,33785,33787-33789,33803,33816-33818,33829,33831-33832,33834,33838-33839,33841-33843,33849,33852-33854,33856,33858,33860-33861,33863,33865-33866,33868,33871,33873-33876,33878-33880,33882,33889-33890,33896-33897,33899,33905,33907-33910,33912-33913,33915-33916,33918,33920,33922-33923,33925,33927,33932-33934,33937-33938,33941,33943-33944,33946-33949,33951-33952,33954-33957,33959-33960,33962,33964-33965,33968-33970,33972-33974,33976,33980,33983,33988,33995-33997,33999,34004,34006-34010,34017,34019-34021,34023,34026,34032,34036,34044,34048-34049,34051,34054,34057,34060,34062,34064,34066-34067,34069-34070,34073-34075,34077-34079,34084,34093-34094,34096,34101,34109-34110,34112-34114,34116-34118,34120-34121,34123,34128-34129,34131,34134-34135,34138,34140-34141,34145-34146,34148,34152,34154-34155,34160,34163-34164,34167,34174,34178-34179,34182,34195,34201,34203-34204,34206,34211,34213,34215,34217,34219,34221-34222,34225,34233,34238-34242,34245,34248,34251-34253,34255,34257,34265,34274,34279,34286,34288,34290-34291,34293-34294,34296,34300,34303,34308,34311,34315-34316,34321,34323,34325-34329,34331,34337,34340-34342,34345,34347-34348,34350,34352-34353,34356-34357,34359-34361,34369-34371,34376-34377,34380,34384,34386,34388-34390,34392,34398-34399,34403,34405-34410,34412-34413,34416,34426,34431,34435,34439-34440,34444,34450,34453-34455,34457,34460,34464,34467,34475,34484,34490,34495-34497,34499-34500,34502,34504,34514,34517,34519,34522,34526-34527,34532,34535-34537,34540-34541,34548,34553,34556,34558,34561-34562,34570-34572,34576-34577,34582-34583,34586,34589-34591,34594,34599-34600,34606,34617,34621-34623,34626,34630,34632,34636-34637,34641,34644-34645,34650,34652,34660-34661,34664-34665,34667,34669,34671,34685,34688-34689,34695-34696,34702-34703,34709,34711,34714,34718,34724-34725,34730,34732,34736,34739,34744-34745,34747-34748,34754-34755,34759,34764-34765,34768-34769,34774,34776,34779,34781,34784-34785,34790,34793-34794,34798,34812,34814,34817,34819,34822,34824-34825,34827-34828,34832,34835-34836,34839,34841,34845,34849,34851,34854,34856,34864,34866,34870-34872,34876,34888-34890,34899,34905,34907,34912,34914-34915,34923,34928,34936-34937,34941,34947,34953,34955,34959-34961,34968,34972,34976-34977,34979,34981,34985,34994,34997,35004,35010,35014,35022,35025-35026,35029,35032,35034,35036,35038,35044,35053,35064-35066,35070,35075-35076,35080-35081,35086,35093,35100-35101,35108,35123,35126,35128-35129,35133,35137,35152,35158-35159,35161-35162,35164,35166,35174,35180,35183-35184,35196,35204-35205,35209-35210,35212,35223,35228,35235,35237,35251,35257,35260,35262,35267,35282,35286,35302,35304,35311,35318,35327,35330-35331,35333,35338,35343,35346-35347,35350,35353-35354,35362-35363,35371,35373-35375,35378,35380-35381,35386,35389-35390,35392,35395,35399,35404,35417-35419,35422,35424,35429,35435,35442,35450,35454,35465,35471-35474,35479-35480,35482-35483,35490,35496,35498-35499,35502,35505,35507,35509,35515-35516,35519,35525-35526,35530-35531,35547-35548,35552-35554,35558,35566,35571,35576,35583-35585,35594,35596,35598-35600,35611,35626-35627,35634,35643,35645,35651,35655,35663-35664,35666-35667,35675,35681,35684,35686,35690,35694,35700,35706,35717,35723,35733-35734,35736,35740,35742,35749,35752,35769,35779,35787,35796-35797,35799-35800,35811,35820,35822,35826,35828,35833-35834,35838,35841,35844,35848,35851,35854,35856,35858,35860-35861,35863,35865,35869,35871-35872,35877,35882,35884,35891,35897,35902-35903,35908-35909,35912,35916-35918,35921,35923,35925-35928,35934,35941,35948-35949,35952,35954,35963-35966,35968,35971,35978,35981-35982,35990,35993-35994,35997,36006,36009,36013,36017,36028-36029,36034-36035,36042,36047,36049-36050,36052,36066,36072,36074-36075,36084,36087,36091,36094-36095,36097-36098,36106-36108,36112,36115,36120,36126,36133,36136,36142-36143,36145,36149,36151,36153,36164,36172,36177-36178,36185,36189,36192,36201,36209,36215,36219-36220,36222,36224,36226,36229,36232,36238,36242-36243,36253,36256,36263,36269,36274,36277,36280,36286,36288,36297,36305,36308,36311-36313,36321,36323,36326,36329-36330,36338,36341,36343,36345,36347,36352,36354-36355,36360,36366,36368,36374,36378-36380,36386,36389-36391,36394-36395,36398,36400-36401,36403-36404,36410,36418,36421-36422,36429,36445-36446,36448,36452-36454,36462,36465,36467-36468,36471,36476,36484,36487,36502,36516,36524-36526,36530,36541-36543,36545,36549,36552,36559-36562,36564-36565,36569-36570,36573-36574,36576,36586,36588,36595-36596,36600,36607-36609,36612,36621-36622,36634-36637,36641-36642,36648,36650,36652,36655,36660-36661,36663-36665,36670-36672,36677,36684,36687-36688,36690-36691,36693,36695,36698,36702,36707,36710-36711,36713,36715-36717,36720,36723,36725,36728,36735,36737,36739,36742,36745-36746,36756,36759-36760,36762,36769-36771,36773,36775-36778,36781,36783-36784,36786,36789-36793,36800,36802-36803,36805,36808,36812,36824,36828,36830,36832,36835-36837,36841-36842,36844,36847-36849,36851-36852,36855,36857,36859-36860,36863,36867,36869,36871-36872,36874,36876-36877,36879,36884,36886-36889,36891-36892,36894-36895,36897,36900-36901,36906,36908,36912,36915-36916,36918-36919,36922-36924,36932-36933,36940,36942,36947,36950-36951,36953,36955,36959,36964-36965,36970-36971,36979-36981,36983,36988,36990-36991,36993-36996,36998,37000-37001,37003,37005,37008-37010,37013,37017,37020,37022-37026,37029-37031,37033,37035,37037-37038,37040-37041,37043,37045,37047-37050,37055,37057-37058,37060,37063-37064,37067,37077-37082,37084-37086,37092,37094-37095,37097-37099,37110-37112,37116-37117,37119-37120,37123-37126,37128,37131-37132,37134-37135,37137-37142,37144-37146,37148,37150-37153,37155,37157-37160,37162-37165,37167-37170,37173,37175,37180-37181,37183-37184,37186-37188,37190-37191,37193,37195-37196,37200-37201,37203,37205-37207,37209,37211,37214-37218,37220-37221,37224,37226-37228,37230-37231,37234,37244-37246,37252-37254,37256,37265-37267,37270-37274,37280-37282,37284-37285,37287,37298-37300,37303-37306,37308,37312,37314-37316,37318-37319,37329-37331,37333,37336,37339-37340,37342-37345,37347,37349-37350,37352-37354,37357-37358,37360,37363-37366,37370-37371,37376-37377,37380,37382,37384,37386-37388,37390-37391,37394,37404-37405,37407,37412-37414,37416,37418-37419,37428-37430,37432,37434-37438,37440-37441,37443,37452,37455,37460-37461,37463,37465-37466,37468-37469,37473,37480,37483,37487-37488,37491,37494,37504-37505,37507,37520-37521,37523-37524,37528,37531,37535-37538,37544-37545,37547,37555,37565-37567,37569-37570,37572-37573,37575,37577,37583,37585,37587-37589,37591,37595-37596,37598-37599,37609-37613,37615,37622-37624,37628-37629,37631-37632,37637,37643,37645-37646,37653-37654,37657-37659,37661,37668,37673-37674,37680,37684,37697,37700-37701,37703-37704,37709-37710,37713-37714,37719,37724,37726,37728,37732,37735,37737,37744,37746,37748-37749,37754,37757,37759-37760,37762,37764-37765,37767-37768,37770-37774,37780,37786-37787,37789,37791-37794,37796-37798,37805-37806,37816-37817,37821-37823,37833-37836,37838,37841,37845,37848-37849,37851-37852,37854-37858,37860,37862-37863,37868,37872,37874-37875,37877,37882-37883,37885-37887,37891,37894-37895,37898-37900,37905,37907,37916,37918-37921,37924-37925,37927,37933,37940-37941,37945-37947,37955-37956,37958-37960,37964-37966,37970-37971,37974-37975,37981-37982,37985-37989,37991-37992,37995-37997,37999-38002,38005,38008-38009,38012-38013,38017,38025-38026,38029,38034-38036,38039-38040,38044-38045,38056,38059-38060,38062,38064-38065,38075-38077,38085,38087,38090,38095-38096,38100-38102,38104,38106,38114-38115,38119,38126-38127,38130,38132,38135-38136,38138,38140,38142,38144,38147,38149-38152,38155-38156,38158-38159,38164,38166,38168-38170,38174,38176-38178,38181-38182,38184-38185,38187-38188,38191,38195,38198,38200,38205-38206,38208-38210,38213,38215-38216,38219,38227-38230,38232,38237-38238,38246,38248,38250,38252,38269,38279-38281,38285-38286,38289-38290,38293,38295,38298,38300-38302,38307-38308,38311,38313,38316,38320,38327,38330,38334-38335,38337,38349,38355-38356,38360,38364,38370,38372,38378-38380,38384-38385,38390,38393-38395,38397,38406,38409-38411,38414,38420-38421,38428-38430,38432-38433,38436,38438-38439,38443-38444,38448-38449,38452-38454,38458,38460-38461,38465-38466,38472,38478,38480,38484,38486,38488-38489,38493-38494,38496,38503,38505,38510-38511,38517,38530,38535,38537,38542-38543,38549,38552-38553,38555-38556,38558-38560,38562,38566,38568,38570-38572,38575,38578,38581-38583,38585-38586,38589-38590,38592,38595,38597,38600,38602,38604-38606,38610,38614,38616,38618,38620-38621,38623,38625,38627,38629-38630,38633,38638-38640,38642,38647-38648,38652,38655-38656,38660,38662,38665,38671-38673,38685-38687,38689,38691,38698-38699,38701,38714,38717,38721-38722,38724,38726,38732-38734,38737-38738,38753-38754,38777-38778,38781,38785,38787-38788,38790,38801,38805-38806,38809-38812,38814,38816-38817,38819,38822,38826,38828-38830,38832,38834,38842-38844,38849,38851,38855,38858,38860,38871-38872,38879,38881,38885-38887,38893,38895,38897,38905-38907,38909-38911,38952,38954-38955,38957-38959,38962-38963,38968,38970,38972-38974,38977,38979-38981,38983,38985-38988,38990,38993-38997,38999-39000,39002-39004,39007,39017-39018,39025-39027,39048-39050,39052-39053,39055,39064-39065,39067,39076,39079,39085-39086,39093,39096,39099,39101-39103,39109-39111,39117-39120,39122-39123,39125,39129,39132,39135-39137,39139,39141-39144,39146,39148-39150,39154,39162-39163,39166,39169-39172,39174-39176,39180,39182-39184,39186-39187,39189-39192,39194-39195,39197-39198,39200-39202,39204,39206-39207,39212-39213,39215-39216,39218-39219,39221-39225,39227-39229,39231,39236-39238,39241-39244,39246-39247,39249,39253,39257,39266,39268-39270,39272,39274-39275,39277-39279,39281-39282,39284-39285,39288-39289,39291,39296,39299-39301,39303,39305-39306,39308,39310-39311,39321-39326,39329,39331,39333-39336,39338,39340-39342,39344,39346-39347,39353,39355,39367-39368,39370,39380-39381,39386-39388,39390,39392,39397-39398,39401,39403,39411,39418,39421,39428-39430,39438-39442,39448-39449,39453,39460,39464,39467-39469,39471-39472,39474,39484-39485,39488,39490-39491,39493,39496,39498-39500,39503,39505-39506,39509-39513,39516-39518,39521-39525,39528-39529,39531,39540,39542-39544,39546-39547,39550-39552,39554-39555,39557,39562,39564,39566,39568,39571,39580,39582-39583,39586-39590,39596,39598,39601-39602,39604-39605,39607-39608,39610,39612-39614,39619-39620,39622-39626,39628,39631-39632,39638,39641-39642,39644-39646,39648,39650,39652-39654,39660,39664,39666-39667,39669,39673,39675,39678-39680,39689-39690,39692-39693,39695,39705-39706,39708-39709,39711,39714,39716,39718,39721,39728,39730-39731,39736,39738-39739,39751,39755-39758,39762-39764,39766-39769,39771-39774,39776-39778,39786,39792-39793,39795,39801,39805-39806,39808,39810,39812-39814,39817-39818,39821-39822,39825-39826,39828,39830,39832,39834-39835,39837-39839,39841-39843,39846-39847,39851,39857,39861,39863-39864,39866-39867,39870-39871,39875,39878,39881,39888-39890,39892-39893,39896,39899-39901,39903,39905,39908-39909,39913-39914,39921,39923-39924,39926,39931,39933,39935,39940-39942,39944,39946-39947,39949-39950,39952,39955-39957,39959,39962-39963,39973-39974,39982,39985-39986,39988,39990-39992,39995-39996,39998,40008,40012,40016,40018-40020,40023-40024,40027-40028,40030,40036-40037,40039-40040,40042-40043,40049,40052,40054-40055,40058-40059,40063,40065,40067-40069,40071-40073,40075-40076,40078,40080,40086,40090,40096,40103-40105,40108,40111,40115,40119-40120,40122,40125,40127-40129,40131,40134,40137-40140,40143-40146,40148-40149,40152,40155,40157-40158,40164,40170,40172,40175-40176,40179,40183,40188,40193,40195,40197-40199,40201,40208,40213-40214,40219,40225,40228-40230,40235,40237,40239-40242,40245,40247,40249-40251,40255-40258,40264,40267-40269,40271,40274,40278,40280,40282-40283,40289,40292,40297-40299,40301-40302,40305,40310-40311,40313,40317-40318,40320,40322,40324-40325,40332,40334-40336,40338-40339,40341-40343,40345-40348,40350-40352,40358,40362,40368,40370-40373,40375,40377,40379,40381-40382,40386,40390-40392,40394-40395,40400,40403,40406,40411-40412,40414-40416,40418-40422,40424,40427,40429,40432-40433,40436,40438-40441,40445,40447,40455,40461,40464,40466,40469-40470,40472-40473,40475-40476,40479-40480,40483,40485-40487,40493,40496,40504-40506,40511-40512,40514-40517,40520,40522,40524,40526-40529,40534-40535,40538-40539,40544,40548-40550,40553,40555,40558,40564-40565,40567,40569,40573,40575-40576,40578,40580-40582,40585-40586,40588-40590,40592-40593,40596,40599-40600,40602-40603,40605-40606,40613-40615,40617,40619-40622,40631-40634,40637,40642-40643,40646,40648-40649,40653,40655,40658,40662-40664,40666-40667,40672,40674-40675,40679,40682,40690,40697-40702,40704-40705,40707-40709,40711-40713,40715-40716,40718-40719,40721,40729-40733,40735,40740,40742-40744,40746,40749-40752,40754-40758,40761,40764,40767,40770,40773,40779,40786-40787,40791,40798,40803-40806,40808-40809,40812,40814-40815,40823,40826-40827,40829,40831,40834-40836,40838,40841,40847-40849,40851,40854,40856,40862-40863,40868-40869,40875-40877,40879-40881,40883,40891,40893,40899,40909,40911,40914,40916,40919,40921-40923,40925,40928-40930,40933-40935,40937,40939-40941,40948-40950,40958,40962-40966,40968,40972,40976,40980-40982,40984-40985,40988-40989,40997-41001,41003-41004,41008-41010,41013,41016-41017,41019-41022,41025-41027,41029,41031,41033,41035-41036,41039,41042-41043,41046-41048,41053,41055-41057,41059-41060,41062-41063,41068,41070,41072,41074-41078,41081,41084,41089,41093,41097-41098,41100-41101,41104,41106-41107,41110,41113,41115,41117,41121,41125,41132,41135-41136,41138,41143-41145,41147,41150-41151,41153-41155,41157,41159-41161,41168,41170,41172,41175-41176,41178,41182-41183,41185,41188,41190-41192,41194-41196,41198,41200,41202-41204,41210,41214-41215,41217-41218,41221-41222,41225,41228,41230,41237,41239,41244-41245,41247-41248,41251-41252,41254-41258,41260-41262,41265,41267,41272,41275-41277,41279,41283,41287,41289-41290,41292-41293,41295,41298,41303,41306,41308,41311,41315-41316,41319,41326,41328-41330,41334-41335,41337-41338,41340-41342,41345,41347,41351-41353,41355-41356,41358,41360,41362-41364,41366,41369-41370,41373,41376,41378-41379,41381,41383,41388,41390-41391,41394,41400,41405,41407,41411-41412,41415-41418,41420,41425,41428-41429,41432,41434-41438,41441,41444,41446-41447,41456,41459,41461,41463-41464,41467-41468,41472,41474,41477-41479,41485,41487-41488,41490,41492,41495-41498,41500-41502,41504,41509-41511,41515,41517,41519,41521,41523-41526,41528-41530,41532-41533,41538,41541,41543,41545,41547-41548,41550,41552-41553,41559,41562,41565,41567,41570-41572,41575-41577,41581-41582,41587,41592,41594,41596-41598,41600,41602-41604,41607,41613-41614,41620-41622,41625,41627,41629-41634,41637,41642,41645,41654,41656,41658,41660,41664-41666,41671-41673,41677-41678,41682,41684,41686-41688,41690-41691,41695-41696,41698,41703,41708,41710,41712,41719-41720,41724,41733,41735,41737-41739,41743,41745,41750-41751,41753,41755,41761-41765,41769,41774-41776,41781-41782,41784,41786,41788-41790,41793,41795,41799,41803,41806,41808,41811,41814-41815,41817-41819,41821,41824,41827-41828,41830-41831,41835,41837,41839-41840,41843,41846,41852-41853,41858-41859,41864,41867,41873,41875,41877-41882,41890,41901,41903,41907-41910,41913-41914,41917,41919,41925,41928-41929,41935-41936,41939,41941-41942,41944,41946-41947,41949,41954,41960,41963,41965-41968,41972-41973,41977-41979,41982,41984,41987-41988,41990,41994,41996-41998,42003,42005-42010,42014,42016-42017,42019-42022,42026-42027,42032,42034-42035,42041,42043-42044,42049,42051,42053-42054,42057-42058,42060-42061,42063,42068,42070-42072,42075-42076,42078-42079,42083,42085,42087,42089,42091-42093,42095,42097,42099-42101,42103-42104,42106,42109,42113-42115,42117,42120-42121,42124,42127-42128,42132,42134-42137,42140,42142,42145,42147,42150-42151,42153-42154,42156-42157,42160,42163,42165,42168-42169,42172,42174,42179-42180,42186,42198-42199,42201,42203,42205,42207,42213-42214,42220,42226-42227,42232,42237,42239,42245-42246,42248,42250,42252-42254,42256,42258-42262,42264-42266,42271,42274-42275,42279,42284,42287,42290-42292,42294-42295,42297,42299-42300,42303-42304,42306,42308-42309,42311-42312,42314-42315,42323-42324,42326,42329,42331-42332,42334,42338-42339,42341-42343,42346-42347,42352-42354,42358-42360,42362,42364-42366,42368-42370,42374-42375,42378,42380,42382-42383,42385-42386,42389,42393-42395,42403-42405,42409,42413-42415,42417-42419,42423,42431-42433,42437-42438,42440,42442,42444,42456-42458,42460,42463-42464,42467,42469-42470,42480-42481,42483,42486,42493,42495,42501-42502,42509,42512,42515,42522,42529,42531,42538-42539,42541-42542,42545,42548,42550-42551,42553-42557,42560-42561,42563,42569,42571,42577,42579-42580,42582-42584,42594-42597,42604,42607,42610,42612-42613,42617,42624,42631,42633,42635,42638,42640,42642,42644,42646,42649-42650,42658,42660-42661,42663-42666,42668,42671-42672,42674,42676-42678,42682-42683,42686-42688,42692,42700-42701,42706,42708-42709,42714-42716,42718,42722-42723,42736,42745-42747,42752,42757-42758,42769-42770,42775-42777,42779,42787-42788,42790-42792,42794,42797,42803-42806,42808,42810-42812,42814-42815,42820-42821,42823-42824,42827-42828,42830-42833,42836,42839,42844,42853,42855,42857-42858,42860-42862,42864,42881,42885,42887,42891,42893,42897,42899,42901-42903,42905,42907-42908,42912-42913,42916,42927,42929,42931,42937-42939,43010-43011,43017,43021,43023-43024,43027,43033-43035,43040-43041,43043,43048,43052,43055,43057-43058,43060,43064,43066,43072,43074-43075,43077-43078,43080,43082,43085,43087,43089-43090,43092-43093,43098-43101,43103-43104,43107,43113-43115,43120,43126-43127,43135-43137,43143,43145,43148,43150,43156,43161,43163,43168,43171,43180-43181,43189,43191,43193-43195,43198,43201,43204,43206,43208,43210-43212,43215,43217-43218,43220,43222-43223,43227-43229,43231-43232,43234-43236,43239,43241-43242,43245-43248,43250-43254,43256,43258,43260,43266-43267,43269-43271,43273-43275,43277,43282,43284-43285,43287,43290,43293-43295,43299,43302,43309,43311-43313,43316-43317,43320-43322,43325,43327-43330,43336,43340,43347-43348,43351-43352,43354-43356,43358-43361,43363-43364,43366,43368,43370-43371,43377-43380,43383,43388-43389,43391-43392,43394-43395,43401,43403,43405-43407,43409-43411,43413-43414,43416-43418,43422-43423,43426,43429,43431,43435,43440-43442,43446-43449,43459,43463,43467-43469,43472-43473,43475,43477-43480,43483-43484,43487-43488,43491,43495-43496,43498-43499,43501,43503,43505-43506,43512-43513,43515,43518,43522,43525,43529,43536-43537,43540,43544,43546,43549-43551,43553,43555-43558,43561,43563,43565,43567-43568,43570-43571,43577,43582-43583,43585,43588-43589,43591,43593,43595-43596,43599-43600,43604-43605,43608-43609,43611-43612,43614,43616-43618,43620,43623-43624,43629-43631,43636-43637,43639-43641,43644-43646,43648,43654,43657,43659,43663,43667,43670-43673,43675,43684,43688,43691,43697,43700,43702,43708-43709,43711,43713,43715-43718,43721-43722,43724-43726,43730-43732,43735-43736,43739,43741,43746,43749-43751,43753,43759-43760,43770,43772-43773,43775,43777-43778,43780,43782-43784,43786,43788,43790,43794,43796-43798,43801,43805,43808,43813,43815,43821,43826,43829,43831,43833-43834,43837-43839,43841-43843,43846-43848,43850-43852,43854-43857,43860-43861,43868,43870,43873-43874,43877,43879-43882,43884-43885,43887,43889-43890,43892,43897,43900,43903,43905,43909,43911-43914,43916-43917,43919-43920,43922-43923,43930,43935,43940,43943-43944,43946,43954-43955,43957,43960,43963,43966,43969-43970,43977-43978,43981,43983,43989,43991,43993-43998,44000-44001,44003-44004,44006-44007,44012-44013,44016,44019,44021,44026-44027,44037-44040,44043-44044,44046-44049,44051-44052,44056-44058,44060,44062,44064-44066,44069,44071,44075-44077,44079,44082-44085,44088,44090,44092-44093,44095-44098,44102,44105,44113,44116-44117,44122-44124,44126,44128,44131-44133,44136,44138-44140,44142,44147,44152,44154-44155,44157,44159,44164,44169-44171,44174,44176,44179-44180,44184,44186,44188-44189,44192,44194-44195,44199,44201-44202,44204-44205,44207-44208,44210,44212,44214,44218,44220-44221,44224-44225,44233,44235,44243-44244,44246,44248-44249,44251-44252,44258,44264,44267,44272,44274,44290-44291,44293,44296,44298-44299,44304,44323,44328,44330,44501-44503,44507-44508,44527,44530-44532,44535,44542-44543,44548,44550,44555-44556,44558,44562,44565,44567,44571-44573,44575-44577,44580,44585-44587,44591-44592,44595,44603,44606,44609,44611,44613-44614,44616-44618,44672,44674,44678-44679,44681,44684,44687,44705-44706,44708-44709,44717,44720,44862,44871,44879,44882-44883,44885,44887,44900,44902,44905,44909,44913,44915,44919,44921,44923,44925,44927,44950,44955-44956,44958,44976-44977,44983,44993,44999,45001-45003,45008-45010,45014,45017,45021-45022,45029,45031-45032,45037,45040,45042-45043,45045,45054-45055,45065-45066,45069-45071,45074-45075,45077-45079,45081-45082,45085-45086,45088-45089,45091-45092,45094,45096-45097,45100,45105-45106,45108,45111-45113,45116,45119,45122,45124-45125,45127,45129,45132,45135-45137,45144,45146-45147,45149,45154,45157,45159,45166,45168,45170-45171,45175-45176,45181-45185,45188-45190,45192,45194,45198,45205,45207,45209-45210,45213-45214,45217-45218,45220-45222,45226,45228,45231,45239-45240,45242,45245-45246,45249-45250,45252,45254-45258,45261,45263-45264,45270,45272-45273,45283,45286-45287,45289,45294,45296-45297,45299,45301-45302,45304,45306-45307,45309-45310,45312-45314,45318-45319,45321-45322,45332-45333,45337-45338,45343-45344,45348,45353,45359-45360,45362,45369,45372,45377-45379,45381-45382,45384,45394,45403,45405-45406,45419,45423,45427,45429-45432,45434-45436,45439,45443-45445,45447,45450-45451,45457-45458,45460-45462,45466,45472-45474,45477,45483,45485,45489-45491,45493-45496,45499,45501-45502,45504,45506,45509-45510,45513-45516,45520,45523,45525,45528,45530,45535,45537-45538,45541-45543,45548-45549,45552,45554,45556,45558,45565-45566,45570-45571,45573,45575,45578-45579,45585,45589,45593,45596,45598,45602-45605,45617-45618,45620,45624,45627,45632,45634,45647,45649-45651,45653,45656-45658,45662,45665,45669,45673,45676,45678-45680,45682,45684-45685,45689-45690,45696-45697,45699,45701-45702,45704,45710-45711,45713,45715,45723-45724,45726,45730,45738,45740,45742,45744,45750,45752,45756-45758,45760,45765,45767,45771-45774,45776,45783,45786,45796,45802,45804,45807,45810,45812-45813,45815,45820-45821,45823,45826,45829,45836,45839-45840,45842-45843,45851-45854,45856,45858,45863,45865,45870,45878-45879,45885,45888,45893,45895-45896,45904,45914-45916,45923-45926,45931,45933-45935,45937,45941-45942,45944,45946-45947,45952,45956,45962,45966-45968,45976,45978-45979,45981-45983,45985-45988,45990-45991,45996-45997,45999,46007-46009,46016-46018,46024-46026,46028-46029,46031-46032,46036,46038,46040-46041,46044,46049,46060,46062-46066,46068,46072,46074,46076-46077,46080,46082-46083,46089,46092,46094-46095,46097-46098,46100-46101,46103-46105,46107,46112-46113,46115,46119-46120,46123,46126,46131,46137,46139,46142-46143,46145,46155,46158,46170,46172-46173,46178,46182,46184,46190-46191,46193,46195,46197,46199,46203,46208-46209,46213,46217,46225,46230,46235,46238-46239,46246,46248,46250,46252-46253,46258,46264-46265,46270,46277,46287,46289,46291,46295,46297,46300-46301,46304-46306,46312,46320,46322,46324,46333,46335,46337,46351,46353,46355,46357,46373,46376,46385-46386,46393-46395,46398-46400,46406,46409,46411-46412,46418,46425-46426,46430,46438,46442,46445-46446,46450-46453,46460,46463,46466-46468,46470-46471,46473,46479-46481,46484,46488,46490,46494,46499,46502,46506-46507,46509-46513,46523,46525-46527,46529-46530,46535-46536,46541,46545-46546,46550,46554,46566,46568,46571-46573,46578,46583,46590,46593-46594,46606,46610,46612-46614,46619,46621,46625,46627-46628,46630,46635,46638-46640,46654-46655,46658,46661,46666-46668,46672,46677-46680,46683,46687-46688,46690,46695,46697,46699,46702-46704,46706-46708,46711,46713-46714,46717-46719,46721,46723,46726-46727,46730,46733,46749,46756,46763,46765,46767,46769,46771,46773,46775,46778,46784,46789-46791,46794,46809,46818,46820-46821,46829,46833,46840-46841,46844,46846,46849,46852,46854,46858,46866,46869,46874-46875,46877,46883,46889-46891,46893,46895,46899-46902,46904,46907,46910-46911,46913,46919,46921,46930,46934,46937,46943,46945,46958-46959,46964,46967-46968,46970,46975,46977,46982-46983,46988,46991,46994,47002,47004,47008,47010-47011,47013,47018-47019,47021-47023,47026-47027,47031,47034-47035,47037,47040,47046,47049,47052,47055,47058-47062,47068-47069,47071,47074,47079,47083,47086-47087,47091,47093-47094,47096-47097,47101,47105,47107,47109,47112,47114,47116,47118-47119,47122,47127,47129,47134,47143-47145,47147,47149-47151,47153,47156-47157,47159,47163,47165-47167,47174-47178,47190-47191,47195,47197-47198,47201-47203,47207-47208,47212-47213,47219-47220,47223,47231,47233-47235,47237-47238,47244-47246,47250,47253,47257-47259,47261,47263,47265-47266,47268,47270,47273-47274,47278,47280,47284,47290-47291,47293-47296,47300-47302,47307,47309,47311,47313,47315-47318,47322,47336,47339-47340,47342,47351-47352,47359-47361,47367-47368,47374-47375,47377,47379-47381,47383,47385-47387,47389,47391-47392,47396,47399,47402,47404,47407,47412-47413,47415-47417,47419,47423-47424,47426,47430,47440,47444,47449,47451,47454,47457-47458,47460-47461,47464-47465,47468-47469,47472,47475-47476,47478-47479,47483,47487,47495,47501-47504,47506,47511,47513,47515,47517,47519,47527,47532,47534,47540-47541,47543-47544,47546,47549-47550,47553,47555-47556,47559,47561,47565-47566,47568,47570-47571,47575,47577,47579,47582,47584,47586-47588,47590,47592,47595-47596,47598,47600,47603,47605,47609,47617,47620-47622,47625-47626,47630,47632-47633,47638-47639,47644,47648,47650-47651,47653-47654,47657-47660,47663,47666,47668,47670,47672,47676,47678,47680-47681,47687,47693,47696-47698,47702-47705,47707,47709-47710,47713,47715-47717,47719-47720,47722,47726-47728,47734,47739,47742-47745,47747,47753,47757-47761,47766,47768-47769,47771,47773-47775,47780,47783,47792,47794,47796-47798,47801,47803-47804,47806,47810-47811,47817-47820,47825-47826,47829-47831,47839-47840,47842-47844,47846-47847,47852,47855,47858-47860,47864-47866,47868,47870-47872,47874-47875,47879-47881,47883-47886,47889,47894,47897-47899,47904-47905,47909-47911,47915-47916,47919-47920,47922,47924-47926,47930,47932,47935,47940,47949,47953,47958,47960-47961,47964-47965,47969,47973,47978-47982,47986,48000-48001,48003-48004,48006-48007,48009-48013,48018,48020,48022,48025-48026,48031,48035-48036,48039-48040,48043-48044,48049,48064-48065,48128,48133-48134,48138,48140-48141,48143,48145-48146,48148,48156-48157,48163-48164,48166,48169-48170,48178-48179,48182,48188-48189,48193,48195,48199-48200,48202,48210,48214-48215,48219-48220,48223,48226-48227,48229,48231,48237,48250-48252,48254,48263,48266-48267,48269,48272-48273,48278,48281,48283-48286,48291-48292,48295,48298,48301-48302,48304-48305,48307,48319,48325,48328-48329,48331,48334,48337,48339-48340,48343,48350,48355,48358,48361-48362,48368,48370,48388,48391-48393,48400,48403-48404,48406,48411-48413,48415,48417,48419,48429,48435-48436,48454-48455,48459,48462,48464-48465,48469,48473,48485,48488,48501,48512-48513,48517-48518,48640-48641,48648,48656-48658,48672,48877,48883-48885,48890,48894,48959,49005-49010,49012,49016,49018-49019,49030,49034,49038-49039,49043,49045-49047,49049-49051,49054,49057,49060-49061,49065,49070,49073,49080,49082,49088,49090-49091,49101-49103,49108-49109,49111-49114,49120-49122,49126,49129,49132,49140,49142,49144,49146-49147,49151', NULL); -- seed shared_buffers VACUUM ANALYZE moc1; SELECT length(coverage::text) FROM moc1; length -------- 82727 (1 row) -- verify that equality doesn't read the whole toasted value EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage = '0/'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=0 loops=1) Filter: (coverage = '0/'::smoc) Rows Removed by Filter: 1 Buffers: shared hit=3 (4 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage && '0/'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=0 loops=1) Filter: (coverage && '0/'::smoc) Rows Removed by Filter: 1 Buffers: shared hit=3 (4 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage && '0/1'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=1 loops=1) Filter: (coverage && '0/1'::smoc) Buffers: shared hit=25 (3 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage && '0/0-11'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=1 loops=1) Filter: (coverage && '0/0-11'::smoc) Buffers: shared hit=3 (3 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage @> '0/'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=1 loops=1) Filter: (coverage @> '0/'::smoc) Buffers: shared hit=3 (3 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage <@ '0/'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=0 loops=1) Filter: (coverage <@ '0/'::smoc) Rows Removed by Filter: 1 Buffers: shared hit=3 (4 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage @> '0/1'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=0 loops=1) Filter: (coverage @> '0/1'::smoc) Rows Removed by Filter: 1 Buffers: shared hit=25 (4 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage <@ '0/1'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=0 loops=1) Filter: (coverage <@ '0/1'::smoc) Rows Removed by Filter: 1 Buffers: shared hit=3 (4 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage @> '0/0-11'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=0 loops=1) Filter: (coverage @> '0/0-11'::smoc) Rows Removed by Filter: 1 Buffers: shared hit=3 (4 rows) EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage <@ '0/0-11'; QUERY PLAN ----------------------------------------------------------------------------- Seq Scan on moc1 (cost=0.00..1.01 rows=1 width=18) (actual rows=1 loops=1) Filter: (coverage <@ '0/0-11'::smoc) Buffers: shared hit=3 (3 rows) SELECT smoc_degrade(4, coverage) FROM moc1; smoc_degrade ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0/3 8-9 1/2-3 5 7 9 11 20 29 31 40 42 44-45 2/5-7 25-27 32-33 35 41-43 64-66 68-69 74-75 77-79 84-86 89-92 96-97 101 103-104 106 109-111 115 121-123 164-166 172 184-186 188 3/0-1 10-11 13-15 17-19 64 66 69 71 77-79 97-99 136-137 139 161-163 268-270 280 295 306-307 348-350 353-355 372 376 383 393-396 398 409 411 420 422 433 435 448 455 459 481-483 668-670 696 701 703 748-750 756-757 766-767 4/8-10 12 16-18 30-31 38-39 49-51 67 260 262 268 281 283 288 290 301 303 305-307 387 552-553 555 640 642-643 1084-1085 1124-1126 1136-1137 1150-1153 1166-1167 1177-1179 1218-1219 1221-1223 1404-1406 1408-1409 1411 1492 1496 1508 1512 1525-1527 1529-1531 1568 1570-1571 1588 1590 1596 1598 1600 1602 1613 1615 1712 1714 1725 1727 1729 1731 1737-1739 1796-1798 1800-1802 1815 1819 1824 1831 1835 1921-1923 2768-2770 2781-2783 2788 2792 2794-2795 2803 2809 2811 3004 3032 3040-3042 3054-3055 3059 3062-3063 (1 row) pgsphere-1.5.1/expected/moc100.out000066400000000000000000000230131461140101500166540ustar00rootroot00000000000000CREATE TABLE moc100 ( ivoid text, coverage smoc, ref_system_name text ); COPY moc100 FROM STDIN; ANALYZE moc100; CREATE INDEX ON moc100 USING GIN (coverage); SELECT ivoid FROM moc100 WHERE coverage && '4/0' ORDER BY ivoid; ivoid ------------------------------------------ ivo://byu.arvo/dfbsspec/q/getssa ivo://cadc.nrc.ca/archive/cfht ivo://cadc.nrc.ca/archive/hst ivo://cds.vizier/b/assocdata ivo://cds.vizier/b/swift ivo://cds.vizier/i/241 ivo://cds.vizier/iv/12 ivo://cds.vizier/ix/13 ivo://cds.vizier/j/a+a/316/147 ivo://cds.vizier/j/a+as/105/311 ivo://cds.vizier/j/a+as/122/235 ivo://chivo/gaia/q/dr1 ivo://chivo/openngc/q/data ivo://cxc.harvard.edu/csc ivo://irsa.ipac/2mass/catalog/psc ivo://irsa.ipac/2mass/catalog/xsc ivo://irsa.ipac/2mass/images/asky-ql ivo://irsa.ipac/cosmos/images ivo://irsa.ipac/iras/images/issa ivo://irsa.ipac/mast/scrapbook ivo://irsa.ipac/spitzer/images/swire ivo://mssl.ucl.ac.uk/xmmsuss_dsa/xmmsuss ivo://ned.ipac/sia ivo://ned.ipac/tap ivo://svo.cab/cat/gbs ivo://svo.cab/cat/uves ivo://svo.cab/cat/xshooter ivo://vopdc.iap/fss ivo://vopdc.obspm/imcce/m4ast ivo://vopdc.obspm/imcce/miriade ivo://vopdc.obspm/imcce/skybot ivo://vopdc.obspm/lesia/bestars/besc ivo://vopdc.obspm/lesia/bestars/bess ivo://vopdc.obspm/luth/exoplanet ivo://vopdc.obspm/luth/hess (35 rows) -- PG 10 does not have JIT, ignore errors on SET DO $$ begin set jit = off; exception when undefined_object then null; when others then raise; end; $$; SELECT explain ($$SELECT * FROM moc100 WHERE coverage && '0/'$$); explain ------------------------------------------------------------------------------------------ Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=0 loops=1) Recheck Cond: (coverage && '0/'::smoc) -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=0 loops=1) Index Cond: (coverage && '0/'::smoc) (4 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage && '4/0'$$); explain ----------------------------------------------------------------- Seq Scan on moc100 (rows=1 width=341) (actual rows=35 loops=1) Filter: (coverage && '4/0'::smoc) Rows Removed by Filter: 66 (3 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/0-11'$$); explain ----------------------------------------------------------------- Seq Scan on moc100 (rows=1 width=341) (actual rows=23 loops=1) Filter: (coverage = '0/0-11'::smoc) Rows Removed by Filter: 78 (3 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '6/43225,43227'$$); explain ---------------------------------------------------------------- Seq Scan on moc100 (rows=1 width=341) (actual rows=1 loops=1) Filter: (coverage = '6/43225 43227'::smoc) Rows Removed by Filter: 100 (3 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/'$$); explain ---------------------------------------------------------------- Seq Scan on moc100 (rows=1 width=341) (actual rows=1 loops=1) Filter: (coverage = '0/'::smoc) Rows Removed by Filter: 100 (3 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/0-11'$$); explain ------------------------------------------------------------------- Seq Scan on moc100 (rows=100 width=341) (actual rows=78 loops=1) Filter: (coverage <> '0/0-11'::smoc) Rows Removed by Filter: 23 (3 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'$$); explain -------------------------------------------------------------------- Seq Scan on moc100 (rows=100 width=341) (actual rows=100 loops=1) Filter: (coverage <> '6/43225 43227'::smoc) Rows Removed by Filter: 1 (3 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/'$$); explain -------------------------------------------------------------------- Seq Scan on moc100 (rows=100 width=341) (actual rows=100 loops=1) Filter: (coverage <> '0/'::smoc) Rows Removed by Filter: 1 (3 rows) SET enable_seqscan = off; SELECT explain ($$SELECT * FROM moc100 WHERE coverage && '4/0'$$); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=35 loops=1) Recheck Cond: (coverage && '4/0'::smoc) Heap Blocks: exact=5 -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=35 loops=1) Index Cond: (coverage && '4/0'::smoc) (5 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <@ '4/0'$$); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=1 loops=1) Recheck Cond: (coverage <@ '4/0'::smoc) Rows Removed by Index Recheck: 35 Heap Blocks: exact=5 -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=36 loops=1) Index Cond: (coverage <@ '4/0'::smoc) (6 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage @> '4/0'$$); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=28 loops=1) Recheck Cond: (coverage @> '4/0'::smoc) Rows Removed by Index Recheck: 1 Heap Blocks: exact=4 -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=29 loops=1) Index Cond: (coverage @> '4/0'::smoc) (6 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/0-11'$$); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=23 loops=1) Recheck Cond: (coverage = '0/0-11'::smoc) Rows Removed by Index Recheck: 1 Heap Blocks: exact=2 -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=24 loops=1) Index Cond: (coverage = '0/0-11'::smoc) (6 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '6/43225,43227'$$); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=1 loops=1) Recheck Cond: (coverage = '6/43225 43227'::smoc) Rows Removed by Index Recheck: 28 Heap Blocks: exact=3 -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=29 loops=1) Index Cond: (coverage = '6/43225 43227'::smoc) (6 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/'$$); explain ------------------------------------------------------------------------------------------ Bitmap Heap Scan on moc100 (rows=1 width=341) (actual rows=1 loops=1) Recheck Cond: (coverage = '0/'::smoc) Heap Blocks: exact=1 -> Bitmap Index Scan on moc100_coverage_idx (rows=1 width=0) (actual rows=1 loops=1) Index Cond: (coverage = '0/'::smoc) (5 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/0-11'$$); explain ---------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=100 width=341) (actual rows=78 loops=1) Recheck Cond: (coverage <> '0/0-11'::smoc) Rows Removed by Index Recheck: 23 Heap Blocks: exact=5 -> Bitmap Index Scan on moc100_coverage_idx (rows=100 width=0) (actual rows=101 loops=1) Index Cond: (coverage <> '0/0-11'::smoc) (6 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'$$); explain ---------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=100 width=341) (actual rows=100 loops=1) Recheck Cond: (coverage <> '6/43225 43227'::smoc) Rows Removed by Index Recheck: 1 Heap Blocks: exact=5 -> Bitmap Index Scan on moc100_coverage_idx (rows=100 width=0) (actual rows=101 loops=1) Index Cond: (coverage <> '6/43225 43227'::smoc) (6 rows) SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/'$$); explain ---------------------------------------------------------------------------------------------- Bitmap Heap Scan on moc100 (rows=100 width=341) (actual rows=100 loops=1) Recheck Cond: (coverage <> '0/'::smoc) Rows Removed by Index Recheck: 1 Heap Blocks: exact=5 -> Bitmap Index Scan on moc100_coverage_idx (rows=100 width=0) (actual rows=101 loops=1) Index Cond: (coverage <> '0/'::smoc) (6 rows) pgsphere-1.5.1/expected/moc_options.out000066400000000000000000000033521461140101500202120ustar00rootroot00000000000000create table moc_opt (m smoc); insert into moc_opt select format('9/%s', i)::smoc from generate_series(1, 1000) g(i); analyze moc_opt; create index moc_opt5 on moc_opt using gin (m); explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; QUERY PLAN --------------------------------------------------------------- Bitmap Heap Scan on moc_opt (actual rows=1 loops=1) Recheck Cond: (m && '9/1'::smoc) Rows Removed by Index Recheck: 254 Heap Blocks: exact=4 -> Bitmap Index Scan on moc_opt5 (actual rows=255 loops=1) Index Cond: (m && '9/1'::smoc) (6 rows) drop index moc_opt5; create index moc_opt8 on moc_opt using gin (m smoc_gin_ops_fine); explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; QUERY PLAN ------------------------------------------------------------- Bitmap Heap Scan on moc_opt (actual rows=1 loops=1) Recheck Cond: (m && '9/1'::smoc) Rows Removed by Index Recheck: 2 Heap Blocks: exact=1 -> Bitmap Index Scan on moc_opt8 (actual rows=3 loops=1) Index Cond: (m && '9/1'::smoc) (6 rows) drop index moc_opt8; create index moc_opt9 on moc_opt using gin (m smoc_gin_ops (order = 9)); explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; QUERY PLAN ------------------------------------------------------------- Bitmap Heap Scan on moc_opt (actual rows=1 loops=1) Recheck Cond: (m && '9/1'::smoc) Heap Blocks: exact=1 -> Bitmap Index Scan on moc_opt9 (actual rows=1 loops=1) Index Cond: (m && '9/1'::smoc) (5 rows) pgsphere-1.5.1/expected/mocautocast.out000066400000000000000000000113231461140101500202000ustar00rootroot00000000000000-- These are MOCs generated by -- SELECT smoc(mocorder, scircle '<(27d, -43d), 0.1d>'); -- intended to check automatic casts of other geometries. CREATE TABLE varorders ( mocorder smallint, geo smoc); INSERT INTO varorders (mocorder, geo) VALUES (1, smoc('1/32 34 1/')), (-3, smoc('1/32 34 3/')), (3, smoc('3/547-548 550 553 3/')), (7, smoc('7/140857-140860 140862 140944-140945 7/')), (-7, smoc('1/32 34 7/')); -- OVERLAPS smoc/scircle SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsupc FROM varorders WHERE geo @> scircle '<(30d, -43d), 1d>'; gsupc ------- -7/-3 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsupc FROM varorders WHERE geo !@> scircle '<(30d, -43d), 1d>'; gnsupc ---------- 1/ 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) csubg FROM varorders WHERE scircle '<(30d, -43d), 1d>' <@ geo; csubg ------- -7/-3 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnsubg FROM varorders WHERE scircle '<(30d, -43d), 1d>' !<@ geo; cnsubg ---------- 1/ 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsubc FROM varorders WHERE geo <@ scircle '<(30d, -43d), 1d>'; gsubc ------- 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsubc FROM varorders WHERE geo !<@ scircle '<(30d, -43d), 1d>'; gnsubc ------------- -7/-3/ 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) csupg FROM varorders WHERE scircle '<(30d, -43d), 1d>' @> geo; csupg ------- 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnsupg FROM varorders WHERE scircle '<(30d, -43d), 1d>' !@> geo; cnsupg ------------- -7/-3/ 3/ 7 (1 row) -- OVERLAPS smoc/spoly SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsupp FROM varorders WHERE geo @> spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); gsupp ------- -7/-3 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsupp FROM varorders WHERE geo !@> spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); gnsupp ---------- 1/ 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) psubg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') <@ geo; psubg ------- -7/-3 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) pnsubg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') !<@ geo; pnsubg ---------- 1/ 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsubp FROM varorders WHERE geo <@ spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); gsubp ------- 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsubp FROM varorders WHERE geo !<@ spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); gnsubp ------------- -7/-3/ 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) psupg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') @> geo; psupg ------- 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) pnsupg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') !@> geo; pnsupg ------------- -7/-3/ 3/ 7 (1 row) -- INTERSECTS smoc/scircle SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgim FROM varorders WHERE scircle '<(45d, -40d), 1d>' && geo; cgim ---------- -7/-3/ 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgnim FROM varorders WHERE scircle '<(45d, -40d), 1d>' !&& geo; cgnim ------- 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cmig FROM varorders WHERE geo && scircle '<(45d, -40d), 1d>'; cmig ---------- -7/-3/ 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnim FROM varorders WHERE geo !&& scircle '<(45d, -40d), 1d>'; cnim ------- 3/ 7 (1 row) -- INTERSECTS smoc/spoly SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgim FROM varorders WHERE spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}' && geo; cgim ---------- -7/-3/ 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgnim FROM varorders WHERE spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}' !&& geo; cgnim ------- 3/ 7 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cmig FROM varorders WHERE geo && spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}'; cmig ---------- -7/-3/ 1 (1 row) SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnim FROM varorders WHERE geo !&& spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}'; cnim ------- 3/ 7 (1 row) DROP TABLE varorders; pgsphere-1.5.1/expected/output_precision.out000066400000000000000000000124631461140101500212770ustar00rootroot00000000000000-- -- Test default and custom output precisions for double values. -- SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) -- -- Check default precision -- SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) -- -- Check option extra_float_digits -- SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ----------------------------- (0.272707696 , 0.018180513) (1 row) SET extra_float_digits TO -2; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------------- (0.2727076956241 , 0.01818051304161) (1 row) SET extra_float_digits TO 0; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SET extra_float_digits TO 1; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SET extra_float_digits TO 2; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ---------------------------------------------- (0.27270769562411401 , 0.018180513041607602) (1 row) SET extra_float_digits TO 3; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ----------------------------------------------- (0.27270769562411401 , 0.0181805130416076016) (1 row) SET extra_float_digits TO 6; ERROR: 6 is outside the valid range for parameter "extra_float_digits" (-15 .. 3) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ----------------------------------------------- (0.27270769562411401 , 0.0181805130416076016) (1 row) -- -- Check compatibility behaviour -- SELECT set_sphere_output_precision(10); set_sphere_output_precision ----------------------------- SET 10 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) SELECT set_sphere_output_precision(12); set_sphere_output_precision ----------------------------- SET 12 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------ (0.272707695624 , 0.0181805130416) (1 row) SELECT set_sphere_output_precision(15); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(17); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(20); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(0); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(-3); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) -- -- Check extra_float_digits after set_sphere_output_precision. -- The change of extra_float_digits should not affect the precision of pgsphere -- output because set_sphere_output_precision enables compatibility mode. -- SELECT set_sphere_output_precision(10); set_sphere_output_precision ----------------------------- SET 10 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) SET extra_float_digits TO -10; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) -- -- Check reset_sphere_output_precision. -- It should disable compatibility mode - extra_float_digits should work. -- SELECT reset_sphere_output_precision(); reset_sphere_output_precision ------------------------------- RESET (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ---------------------- (0.27271 , 0.018181) (1 row) SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ----------------------------- (0.272707696 , 0.018180513) (1 row) pgsphere-1.5.1/expected/output_precision_1.out000066400000000000000000000124111461140101500215100ustar00rootroot00000000000000-- -- Test default and custom output precisions for double values. -- SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) -- -- Check default precision -- SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) -- -- Check option extra_float_digits -- SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ----------------------------- (0.272707696 , 0.018180513) (1 row) SET extra_float_digits TO -2; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------------- (0.2727076956241 , 0.01818051304161) (1 row) SET extra_float_digits TO 0; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SET extra_float_digits TO 1; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SET extra_float_digits TO 2; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SET extra_float_digits TO 3; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SET extra_float_digits TO 6; ERROR: 6 is outside the valid range for parameter "extra_float_digits" (-15 .. 3) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) -- -- Check compatibility behaviour -- SELECT set_sphere_output_precision(10); set_sphere_output_precision ----------------------------- SET 10 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) SELECT set_sphere_output_precision(12); set_sphere_output_precision ----------------------------- SET 12 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------ (0.272707695624 , 0.0181805130416) (1 row) SELECT set_sphere_output_precision(15); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(17); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(20); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(0); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT set_sphere_output_precision(-3); set_sphere_output_precision ----------------------------- SET 15 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) -- -- Check extra_float_digits after set_sphere_output_precision. -- The change of extra_float_digits should not affect the precision of pgsphere -- output because set_sphere_output_precision enables compatibility mode. -- SELECT set_sphere_output_precision(10); set_sphere_output_precision ----------------------------- SET 10 (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) SET extra_float_digits TO -10; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint -------------------------------- (0.2727076956 , 0.01818051304) (1 row) -- -- Check reset_sphere_output_precision. -- It should disable compatibility mode - extra_float_digits should work. -- SELECT reset_sphere_output_precision(); reset_sphere_output_precision ------------------------------- RESET (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ---------------------- (0.27271 , 0.018181) (1 row) SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ----------------------------- (0.272707696 , 0.018180513) (1 row) pgsphere-1.5.1/expected/overlaps.out000066400000000000000000001317221461140101500175170ustar00rootroot00000000000000/* This set of tests is designed to verify the compliance of the overlap operation with the DE-9IM model */ -- sline vs sline -- the lines have no common points select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(20d,0d)', spoint'(30d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | f (1 row) -- the point of intersection of the lines is the boundary for both select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(10d,0d)', spoint'(20d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- one line intersects the other at the boundary point of the latter select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,90d)', spoint'(0d,-10d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- the interiors of the lines intersect at one point select 'sline && sline', 'f' as expected, sline( spoint'(-10d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,90d)', spoint'(0d,-10d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- the lines match select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,0d)', spoint'(10d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- one line lies completely in the other and they have an intersection at the boundary point select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,0d)', spoint'(5d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- one line lies completely in the other and they have no intersection at the boundary point select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(2d,0d)', spoint'(5d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- one line partially lies in the other select 'sline && sline', 't' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(5d,0d)', spoint'(20d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | t | t (1 row) -- the line degenerated into the point lies on the boundary of another select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,0d)', spoint'(0d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- the line degenerated into the point lies in the interior of another select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(5d,0d)', spoint'(5d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- both lines are degenerated into the point and coincide select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(0d,0d)') && sline( spoint'(0d,0d)', spoint'(0d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | t (1 row) -- both lines are degenerated into the point and do not coincide, but lie close to each other select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(0d,0d)') && sline( spoint'(1d,0d)', spoint'(1d,0d)') as actual; ?column? | expected | actual ----------------+----------+-------- sline && sline | f | f (1 row) -- scircle vs scircle -- the circles have no common points select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(30d , 0d) , 5d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | f (1 row) -- the point of intersection of the circles is the boundary for both select 'scircle && scircle', 'f' as expected, scircle'<(-10d , 0d) , 10d>' && scircle'<(10d , 0d) , 10d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- the circles match select 'scircle && scircle', 'f' as expected, scircle'<(-10d , 0d) , 10d>' && scircle'<(-10d , 0d) , 10d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- one circle lies completely in the other and they have an intersection at the boundary point select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(-10d , 0d) , 10d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- one circle lies completely in the other and they have no intersection at the boundary point select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(0d , 0d) , 5d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- one circle partially lies in the other select 'scircle && scircle', 't' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(10d , 0d) , 20d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | t | t (1 row) -- the circle degenerated into the point lies on the boundary of another select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(20d , 0d) , 0d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- the circle degenerated into the point lies in the interior of another select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(0d , 0d) , 0d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- both circles are degenerated into the point and coincide select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 0d>' && scircle'<(0d , 0d) , 0d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | t (1 row) -- both circles are degenerated into the point and do not coincide, but lie close to each other select 'scircle && scircle', 'f' as expected, scircle'<(1d , 0d) , 0d>' && scircle'<(0d , 0d) , 0d>' as actual; ?column? | expected | actual --------------------+----------+-------- scircle && scircle | f | f (1 row) -- sellipse vs sellipse -- the ellipses have no common points select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' && sellipse'<{ 45d , 20d }, (50 , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- the point of intersection of the ellipses is the boundary for both select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' && sellipse'<{ 45d , 20d }, (45d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | f (1 row) -- the ellipses match select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' && sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- one ellipse lies completely in the other and they have an intersection at the boundary point select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 20d , 5d }, (-20d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- one ellipse lies completely in the other and they have no intersection at the boundary point select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 10d , 5d }, (-20d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- one ellipse partially lies in the other select 'sellipse && sellipse', 't' as expected, sellipse'<{ 45d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 20d , 5d }, (30d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | t | t (1 row) -- the ellipse degenerated into the line lies completely in the interior of another (non-degenerate) ellipse select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 10d , 0d }, (10d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- the ellipse degenerated into the line partially lies in the interior of another (non-degenerate) ellipse select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 20d , 0d }, (30d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- the ellipse degenerated into the point lies on the boundary of another select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (30d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- the ellipse degenerated into the point lies in the interior of another select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (40d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- both ellipses are degenerated into the point and coincide select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | t (1 row) -- both ellipses are degenerated into the point and do not coincide, but lie close to each other select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (1d , 0d) , 0d>' as actual; ?column? | expected | actual ----------------------+----------+-------- sellipse && sellipse | f | f (1 row) -- sellipse vs scircle -- the ellipse and circle have no common points select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(30d , 0d) , 5d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | f (1 row) -- the point of intersection of the ellipse and circle is the boundary for both select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(30d , 0d) , 10d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | f (1 row) -- the ellipse and circle match select 'sellipse && scircle', 'f' as expected, sellipse'<{ 10d , 10d }, (30d , 0d) , 0d>' && scircle'<(30d , 0d) , 10d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipse lies completely in the circle and they have an intersection at the boundary point select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(20d , 0d) , 40d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipse lies completely in the circle and they have no intersection at the boundary point select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (20d , 0d) , 0d>' && scircle'<(20d , 0d) , 40d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the circle lies completely in the ellipse select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(0d , 0d) , 5d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the circle partially lies in the ellipse select 'sellipse && scircle', 't' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(20d , 0d) , 15d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | t | t (1 row) -- the ellipse degenerated into the line lies completely in the interior of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 0d }, (0d , 0d) , 0d>' && scircle'<(0d , 0d) , 20d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipse degenerated into the line partially lies in the interior of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 0d }, (10d , 0d) , 0d>' && scircle'<(0d , 0d) , 20d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipse degenerated into the point lies on the boundary of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (10d , 0d) , 0d>' && scircle'<(0d , 0d) , 10d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipse degenerated into the point lies in the interior of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (5d , 0d) , 0d>' && scircle'<(0d , 0d) , 10d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipse and circle are degenerated into the point and coincide select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && scircle'<(0d , 0d) , 0d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | t (1 row) -- the ellipses are degenerated into the point and do not coincide, but lie close to each other select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && scircle'<(1d , 0d) , 0d>' as actual; ?column? | expected | actual ---------------------+----------+-------- sellipse && scircle | f | f (1 row) -- spath vs spath -- the opened paths have no common points select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d) }' && spath'{ (60d, 15d),(70d, 20d),(75d, 20d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | f (1 row) -- the points of intersection of the opened paths is the boundary for both select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (-10d, 0d),(0d, 10d),(45d, 15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- one opened path intersects the other at the boundary point of the latter select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (-20d, -10d),(-10d, 0d),(0d, 10d),(45d, 15d),(60d, 15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- the interiors of the opened paths intersect at one point select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (0d, 10d),(0d, -10d),(10d, -10d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- the interiors of the opened paths intersect at two points select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (0d, 10d),(0d, -10d),(5d, 0d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- the opened paths match select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- the closed paths match select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' && spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- one opened path lies completely in the other and they have an intersection at the boundary point select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 15d),(70d, 20d) }' && spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- one opened path lies completely in the other and they have no intersection at the boundary point select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 15d),(70d, 20d) }' && spath'{ (10d, 0d),(45d, 15d),(60d, 15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | f | t (1 row) -- one opened path partially lies in the other select 'spath && spath', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (45d, 15d),(60d, 15d),(70d, 20d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | t | t (1 row) -- one closed path partially lies in the other select 'spath && spath', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' && spath'{ (45d, 15d),(60d, 15d),(70d, 20d),(45d, 15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | t | t (1 row) -- the opened path partially lies in the closed path select 'spath && spath', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' && spath'{ (45d, 15d),(60d, 15d),(70d, 20d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spath && spath | t | t (1 row) -- spath vs sline -- the opened path and line have no common points select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(20d, 0d)', spoint'(30d, 0d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | f (1 row) -- the points of intersection of the opened path and line is the boundary for both select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(-10d, 0d)', spoint'(45d, 15d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- the interiors of the opened path and line intersect at one point select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(0d, 10d)', spoint'(0d, -10d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- the path and line match select 'spath && sline', 'f' as expected, spath'{ (0d, 10d),(0d, -10d) }' && sline( spoint'(0d, 10d)', spoint'(0d, -10d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- the line lies completely in the opened path and they have an intersection at the boundary point select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 20d) }' && sline( spoint'(-10d, 0d)', spoint'(10d, 0d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- the line lies completely in the opened path and they have no intersection at the boundary point select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 20d) }' && sline( spoint'(10d, 0d)', spoint'(45d, 15d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- the line partially lies in the open path select 'spath && sline', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(5d, 0d)', spoint'(20d, 0d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | t | t (1 row) -- the line degenerated into the point lies in the boundary of open path select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(-10d, 0d)', spoint'(-10d, 0d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- the line degenerated into the point lies in the interior of open path select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(0d, 0d)', spoint'(0d, 0d)') as actual; ?column? | expected | actual ----------------+----------+-------- spath && sline | f | t (1 row) -- spoly vs spoly -- the polygons have no common points select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (10d, 0d),(20d, 0d),(10d, 10d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | f | f (1 row) -- the point of intersection of the polygons is the boundary for both select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (10d, 0d),(20d, 0d),(0d, 10d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | f | t (1 row) -- the interiors of the polygons intersect at one line select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (0d, 0d),(20d, 0d),(0d, 10d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | f | t (1 row) -- the polygons matches select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | f | t (1 row) -- one polygon lies completely in the other and they have an intersection at the boundary line select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | f | t (1 row) -- one polygon lies completely in the other and they have no intersection at the boundary line or point select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && spoly'{ (5d, 5d),(15d, 5d),(15d, 15d),(5d,15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | f | t (1 row) -- one polygon partially lies in the other select 'spoly && spoly', 't' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (5d, 5d),(30d, 5d),(30d, 15d),(5d,15d) }' as actual; ?column? | expected | actual ----------------+----------+-------- spoly && spoly | t | f (1 row) -- spoly vs scircle -- the polygon and circle have no common points select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 90d) , 10d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | f (1 row) -- the point of intersection of the polygon and circle is the boundary for both select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 90d) , 80d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | t (1 row) -- the circle lies completely in the polygon and they have an intersection at the boundary point select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(5d , 1d) , 1d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | t (1 row) -- the circle lies completely in the polygon and they have no intersection at the boundary point select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(5d , 2d) , 1d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | t (1 row) -- the polygon lies completely in the circle select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 15d) , 20d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | t (1 row) -- the polygon partially lies in the circle select 'spoly && scircle', 't' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 5d) , 5d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | t | t (1 row) -- the circle degenerated into the point lies in the boundary of polygon select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 0d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | t (1 row) -- the circle degenerated into the point lies in the interior of polygon select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(2d , 2d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- spoly && scircle | f | t (1 row) -- spoly vs sellipse -- the polygon and ellipse have no common points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | f (1 row) -- the point of intersection of the polygon and ellipse is the boundary for both select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 80d , 20d }, (0d , 90d) , 90d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse lies completely in the polygon and they have an intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && sellipse'<{ 10d , 5d }, (10d , 10d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse lies completely in the polygon and they have no intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && sellipse'<{ 7d , 5d }, (10d , 10d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the polygon lies completely in the ellipse and they have an intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 5d),(10d, 10d),(20d, 5d),(10d, 0d) }' && sellipse'<{ 10d , 5d }, (10d , 5d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the polygon lies completely in the ellipse and they have no intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (1d, 5d),(10d, 9d),(19d, 5d),(10d, 1d) }' && sellipse'<{ 10d , 5d }, (10d , 10d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse partially lies in the polygon select 'spoly && sellipse', 't' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 10d , 2d }, (0d , 5d) , 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | t | t (1 row) -- the ellipse degenerated into the point lies in the boundary of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 0d , 0d }, (0d , 0d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse degenerated into the point lies in the interior of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 0d , 0d }, (5d , 2d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse degenerated into the line lies in the boundary of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 5d , 0d }, (5d , 0d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse degenerated into the line lies in the interior of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 2d , 0d }, (1d , 4d), 90d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- the ellipse degenerated into the line partially lies in the interior of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 10d , 0d }, (1d , 4d), 0d>' as actual; ?column? | expected | actual -------------------+----------+-------- spoly && sellipse | f | t (1 row) -- sbox vs sbox -- the boxes have no common points select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((30d , 30d), (50d , 50d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | f (1 row) -- the point of intersection of the boxes is the boundary for both select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((20d , 20d), (50d , 50d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- the boundaries of the boxes intersect at one line select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((20d , 0d), (50d , 20d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- the boxes matches select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (10d , 10d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- one box lies completely in the other and they have no intersection at the boundary line or point select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (10d , 10d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- one box partially lies in the other select 'sbox && sbox', 't' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((10d , 10d), (30d , 30d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | t | t (1 row) -- one box degenerated into the line lies in the boundary of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((0d , 0d), (20d , 0d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- one box degenerated into the line lies in the interior of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (10d , 5d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- one box degenerated into the point lies in the boundary of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((0d , 0d), (0d , 0d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- one box degenerated into the point lies in the interior of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (5d , 5d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- the boxes are degenerated into the point and coincide select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && sbox'((0d , 0d), (0d , 0d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | t (1 row) -- the boxes are degenerated into the point and not coincide select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && sbox'((10d , 10d), (10d , 10d))' as actual; ?column? | expected | actual --------------+----------+-------- sbox && sbox | f | f (1 row) -- sbox vs scircle -- the box and circle have no common points select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(0d , 90d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | f (1 row) -- the point of intersection of the box and circle is the boundary for both select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(30d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the circle lies completely in the box and they have an intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(10d , 10d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the circle lies completely in the box and they have no intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(10d , 10d) , 5d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box lies completely in the circle and they have an intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((-4d , -3d), (3d , 4d))' && scircle'<(0d , 0d) , 5d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box lies completely in the circle and they have no intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((-4d , -3d), (3d , 4d))' && scircle'<(0d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box degenerated into the line intersects circle select 'sbox && scircle', 'f' as expected, sbox'((-20d , 0d), (20d , 0d))' && scircle'<(0d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | f (1 row) -- the circle partially lies in the box select 'sbox && scircle', 't' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(15d , 15d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | t | t (1 row) -- the circle degenerated into the point lies in the boundary of box select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(0d , 10d) , 0d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the circle degenerated into the point lies in the interior of box select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(10d , 10d) , 0d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box degenerated into the point lies in the boundary of circle select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(10d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box degenerated into the point lies in the interior of circle select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(0d , 0d) , 10d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box and circle are degenerated into the point and coincide select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(0d , 0d) , 0d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | t (1 row) -- the box and circle are degenerated into the point and not coincide select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(5d , 5d) , 0d>' as actual; ?column? | expected | actual -----------------+----------+-------- sbox && scircle | f | f (1 row) -- sbox vs spoly -- the box and polygon have no common points select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (30d, 0d),(40d, 0d),(30d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | f (1 row) -- the point of intersection of the box and polygon is the boundary for both select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (30d, 0d),(40d, 0d),(30d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | f (1 row) -- the boundaries of the boxes intersect at one line select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (20d, 0d),(30d, 0d),(20d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the box and circle matches select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the polygon lies completely in the box and they have an intersection at the boundary line select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the polygon lies completely in the box and they have no intersection at the boundary select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (1d, 1d),(11d, 1d),(1d, 19d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the box lies completely in the polygon and they have an intersection at the boundary line select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (10d , 10d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the box lies completely in the polygon and they have no intersection at the boundary select 'sbox && spoly', 'f' as expected, sbox'((1d , 1d), (2d , 2d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the polygon partially lies in the box select 'sbox && spoly', 't' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (15d, 0d),(35d, 0d),(15d, 35d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | t | t (1 row) -- the box degenerated into the line lies in the boundary of polygon select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 0d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the box degenerated into the line lies in the interior of polygon select 'sbox && spoly', 'f' as expected, sbox'((0d , 5d), (10d , 5d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the box degenerated into the point lies in the boundary of polygon select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- the box degenerated into the point lies in the interior of polygon select 'sbox && spoly', 'f' as expected, sbox'((5d , 5d), (5d , 5d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; ?column? | expected | actual ---------------+----------+-------- sbox && spoly | f | t (1 row) -- sbox vs sellipse -- the box and ellipse have no common points select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sellipse'<{ 20d , 10d }, (0d, 90d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | f (1 row) -- the point of intersection of the box and ellipse is the boundary for both select 'sbox && sellipse', 'f' as expected, sbox'((-10d , -10d), (10d , 10d))' && sellipse'<{ 80d , 10d }, (0d, 90d) , 90d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | f (1 row) -- the ellipse lies completely in the box and they have an intersection at the boundary points select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sellipse'<{ 10d , 5d }, (10d, 10d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | t (1 row) -- the ellipse lies completely in the box and they have no intersection at the boundary points select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sellipse'<{ 9d , 5d }, (10d, 10d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | t (1 row) -- the box lies completely in the ellipse and they have no intersection at the boundary points select 'sbox && sellipse', 'f' as expected, sbox'((-10d , -10d), (10d , 10d))' && sellipse'<{ 30d , 20d }, (0d, 0d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | t (1 row) -- the ellipse partially lies in the box select 'sbox && sellipse', 't' as expected, sbox'((-10d , -10d), (10d , 10d))' && sellipse'<{ 10d , 5d }, (10d, 10d) , 90d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | t | t (1 row) -- the box degenerated into the point lies in the boundary of ellipse select 'sbox && sellipse', 'f' as expected, sbox'((30d , 0d), (30d , 0d))' && sellipse'<{ 30d , 20d }, (0d, 0d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | t (1 row) -- the box degenerated into the point lies in the interior of ellipse select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (10d , 0d))' && sellipse'<{ 30d , 20d }, (0d, 0d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | t (1 row) -- the box and ellipse are degenerated into the point and coincide select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && sellipse'<{ 0d , 0d }, (0d, 0d) , 0d>' as actual; ?column? | expected | actual ------------------+----------+-------- sbox && sellipse | f | t (1 row) pgsphere-1.5.1/expected/path.out000066400000000000000000000206571461140101500166240ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- -- ellipse and path -- -- negators , commutator @,&& SELECT spath '{(280d, -9d),(280d, -8d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -9d),(280d,-12d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d,-11d),(280d,-12d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d, -9d),(280d, -8d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -9d),(280d,-12d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d,-11d),(280d,-12d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d, -9d),(280d, -8d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d, -9d),(280d,-12d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d,-11d),(280d,-12d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -9d),(280d, -8d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d, -9d),(280d,-12d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d,-11d),(280d,-12d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spath '{(280d, -9d),(280d, -8d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spath '{(280d, -9d),(280d,-12d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spath '{(280d,-11d),(280d,-12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spath '{(280d, -9d),(280d, -8d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spath '{(280d, -9d),(280d,-12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spath '{(280d,-11d),(280d,-12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spath '{(280d, -9d),(280d, -8d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spath '{(280d, -9d),(280d,-12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spath '{(280d,-11d),(280d,-12d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spath '{(280d, -9d),(280d, -8d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spath '{(280d, -9d),(280d,-12d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spath '{(280d,-11d),(280d,-12d)}'; ?column? ---------- f (1 row) -- path is a line , ellipse is point SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{0d,0d},(280d, -8d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{0d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- path is a line , ellipse is circle SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- path is a line , ellipse is path SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,0d},(280d, -8d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,0d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- path is a line , ellipse is a real ellipse SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{10d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{10d,5d},(280d, -8d),90d>'; ?column? ---------- t (1 row) -- create path as aggregate SELECT spath(data.p) FROM ( SELECT spoint '(0,1)' as p UNION ALL SELECT spoint '(1,1)' UNION ALL SELECT '(1,0)' ) AS data ; spath --------------------------- {(0 , 1),(1 , 1),(1 , 0)} (1 row) -- -- checking path other operators -- \set poly 'spoly \'{(0.1,0),(0.2,0),(0.2,0.1),(0.3,0.1),(0.3,-0.1),(0.4,-0.1),(0.5,0.1),(0.4,0.2),(0.1,0.2)}\'' \set path1 'spath \'{(0.1,0),(0.2,0),(0.2,0.1),(0.3,0.1),(0.3,-0.1),(0.4,-0.1),(0.5,0.1),(0.4,0.2),(0.1,0.2)}\'' \set path2 'spath \'{(0,0),(1,0),(2,0),(3,0)}\'' \set path3 'spath \'{(0,0),(0,1),(0,1.5)}\'' SELECT @-@ spath '{(0,0),(1,0),(2,0),(3,0)}'; ?column? ---------- 3 (1 row) SELECT :path1 = :path2; ?column? ---------- f (1 row) SELECT :path1 = :path1; ?column? ---------- t (1 row) SELECT :path1 <> :path2; ?column? ---------- t (1 row) SELECT :path1 <> :path1; ?column? ---------- f (1 row) SELECT :poly && :path1; ?column? ---------- t (1 row) SELECT :path1 && :poly ; ?column? ---------- t (1 row) SELECT :path1 @ :poly ; ?column? ---------- t (1 row) SELECT :path2 @ :poly ; ?column? ---------- f (1 row) SELECT :path1 && :path1; ?column? ---------- t (1 row) SELECT :path1 && :path1; ?column? ---------- t (1 row) SELECT :poly && :path2; ?column? ---------- t (1 row) SELECT :path2 && :poly ; ?column? ---------- t (1 row) SELECT :path2 && :path1; ?column? ---------- t (1 row) SELECT :poly && :path3; ?column? ---------- f (1 row) SELECT :path3 && :poly ; ?column? ---------- f (1 row) SELECT :path3 && :path1; ?column? ---------- f (1 row) SELECT :path3 && :path2; ?column? ---------- t (1 row) SELECT :path1 @ scircle '<(0,1),1>'; ?column? ---------- f (1 row) SELECT :path3 @ scircle '<(0,1),1>'; ?column? ---------- t (1 row) SELECT :path3 @ scircle '<(0,1),0.7>'; ?column? ---------- f (1 row) SELECT :path1 && scircle '<(0,1),1>'; ?column? ---------- t (1 row) SELECT :path3 && scircle '<(0,1),1>'; ?column? ---------- t (1 row) SELECT :path3 && scircle '<(0,1),0.7>'; ?column? ---------- t (1 row) SELECT :path3 && scircle '<(0,-1),0.7>'; ?column? ---------- f (1 row) SELECT :path3 @ scircle '<(0,-1),0.7>'; ?column? ---------- f (1 row) SELECT :path3 && sline ( spoint '(0,-1)', spoint '(0,1)' ); ?column? ---------- t (1 row) SELECT :path3 && sline ( spoint '(-1,0)', spoint '(1,0)' ); ?column? ---------- t (1 row) SELECT :path3 && sline ( spoint '(-1,0)', spoint '(-0.3,0)' ); ?column? ---------- f (1 row) SELECT spath '{(0.11,0.15),(0.12,0.15),(0.13,0.15)}' @ :poly; ?column? ---------- t (1 row) -- create path SELECT spath(data.p) FROM ( SELECT spoint '(0,1)' as p UNION ALL SELECT spoint '(1,1)' UNION ALL SELECT '(1,0)' ) AS data ; spath --------------------------- {(0 , 1),(1 , 1),(1 , 0)} (1 row) SELECT set_sphere_output( 'DEG' ); set_sphere_output ------------------- SET DEG (1 row) -- test stored data SELECT spoint(p,2) FROM spheretmp6 WHERE id=2; spoint ------------ (1d , -5d) (1 row) SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) -- get n-th point and array representation path points tests SELECT spoint( spath '{(0, 0),(1, 1)}', 1 ); spoint --------- (0 , 0) (1 row) SELECT spoint( spath '{(0, 0),(1, 1)}', 2 ); spoint --------- (1 , 1) (1 row) SELECT spath_as_array( spath '{(0, 0),(1, 1)}'); spath_as_array ----------------------- {"(0 , 0)","(1 , 1)"} (1 row) pgsphere-1.5.1/expected/points.out000066400000000000000000000323011461140101500171710ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- operators SELECT spoint '(0, 90d)' = spoint '(0, 90d)'; ?column? ---------- t (1 row) SELECT spoint '(0, 90d)' = spoint '(0,-90d)'; ?column? ---------- f (1 row) SELECT spoint '(0,-90d)' = spoint '(0,-90d)'; ?column? ---------- t (1 row) SELECT spoint '(0, 90d)' != spoint '(0, 90d)'; ?column? ---------- f (1 row) SELECT spoint '(0, 90d)' != spoint '(0,-90d)'; ?column? ---------- t (1 row) SELECT spoint '(0,-90d)' != spoint '(0,-90d)'; ?column? ---------- f (1 row) SELECT spoint '(0d, 0)' = spoint '(360d,0)'; ?column? ---------- t (1 row) -- I/O test -- -- Output --- SELECT set_sphere_output( 'DEG' ); set_sphere_output ------------------- SET DEG (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------ (15.625d , 1.0416667d) (1 row) SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; spoint ------------------------- (0.625d , 0.041666667d) (1 row) SELECT '( 1h 3m 30s , -1d 3m 3.6s)'::spoint; spoint --------------------- (15.875d , -1.051d) (1 row) SELECT '( 0h 3m 30s , -0d 3m 3.6s)'::spoint; spoint -------------------- (0.875d , -0.051d) (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; spoint ---------------- (0.625d , 90d) (1 row) SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; spoint ----------------- (0.625d , -90d) (1 row) SELECT set_sphere_output( 'DMS' ); set_sphere_output ------------------- SET DMS (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------- ( 15d 37m 30s , + 1d 2m 30s) (1 row) SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; spoint ------------------------------- ( 0d 37m 30s , + 0d 2m 30s) (1 row) SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; spoint ------------------------------- ( 15d 37m 30s , - 1d 2m 30s) (1 row) SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; spoint ------------------------------- ( 0d 37m 30s , - 0d 2m 30s) (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; spoint ------------------------------ ( 0d 37m 30s , +90d 0m 0s) (1 row) SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; spoint ------------------------------ ( 0d 37m 30s , -90d 0m 0s) (1 row) SELECT set_sphere_output( 'HMS' ); set_sphere_output ------------------- SET HMS (1 row) SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; spoint ------------------------------- ( 1h 2m 30s , + 1d 2m 30s) (1 row) SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; spoint ------------------------------- ( 0h 2m 30s , + 0d 2m 30s) (1 row) SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; spoint ------------------------------- ( 1h 2m 30s , - 1d 2m 30s) (1 row) SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; spoint ------------------------------- ( 0h 2m 30s , - 0d 2m 30s) (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; spoint ------------------------------ ( 0h 2m 30s , +90d 0m 0s) (1 row) SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; spoint ------------------------------ ( 0h 2m 30s , -90d 0m 0s) (1 row) SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) SELECT '( 0h 0m 0s , 0d 0m 0s)'::spoint; spoint --------- (0 , 0) (1 row) -- "incorrect dec. values" SELECT set_sphere_output( 'DEG' ); set_sphere_output ------------------- SET DEG (1 row) SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint; spoint ------------------ (180.625d , 85d) (1 row) SELECT '( 24h 2m 30s , 5d 0m 0s)'::spoint; spoint --------------- (0.625d , 5d) (1 row) SELECT '( -0h 2m 30s , -5d 0m 0s)'::spoint; spoint ------------------ (359.375d , -5d) (1 row) SELECT '( 0h 2m 30s , -95d 0m 0s)'::spoint; spoint ------------------- (180.625d , -85d) (1 row) -- Input -- SELECT '( 0.625d , -0.04166666667d)'::spoint; spoint -------------------------- (0.625d , -0.041666667d) (1 row) SELECT '(0.0109083078249646 , -0.000727220521664407)'::spoint; spoint -------------------------- (0.625d , -0.041666667d) (1 row) -- functions for point -------------- -- spoint(float8, float8) SELECT spoint(0.0109083078249646 , -0.000727220521664407); spoint -------------------------- (0.625d , -0.041666667d) (1 row) SELECT spoint_deg(57.2958, 57.2958); spoint_deg ----------------------- (57.2958d , 57.2958d) (1 row) SELECT spoint_deg(0, 0); spoint_deg ------------ (0d , 0d) (1 row) SELECT spoint_deg(114.5916, 0); spoint_deg ------------------ (114.5916d , 0d) (1 row) SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) SELECT spoint(7.28318530717958623 , 0.00); spoint --------- (1 , 0) (1 row) SELECT spoint(0.0 , 2.141592653589793116); spoint ----------------- (3.1415927 , 1) (1 row) -- dist(spoint,spoint) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 0m 30s , 0d 0m 0s)'::spoint); dist ------------------- 0.008726646259972 (1 row) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , 10d 0m 0s)'::spoint); dist ----------------- 0.1745329251994 (1 row) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); dist ----------------- 0.1745329251994 (1 row) SELECT dist('( 0h 2m 30s , 95d 0m 0s)'::spoint,'( 12h 2m 30s , 85d 0m 0s)'::spoint); dist ------ 0 (1 row) SELECT dist('( 24h 2m 30s , 10d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); dist ----------------- 0.3490658503989 (1 row) SELECT dist('( 0h 2m 30s , 90d 0m 0s)'::spoint,'( 12h 2m 30s , 90d 0m 0s)'::spoint); dist ------ 0 (1 row) SELECT dist('( 0h 2m 30s , -90d 0m 0s)'::spoint,'( 12h 2m 30s , -90d 0m 0s)'::spoint); dist ------ 0 (1 row) -- long(spoint) SELECT long('( 0h 2m 30s , 0d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('( 0h 2m 30s ,95d 0m 0s)'::spoint); long ---------------- 3.152500961415 (1 row) SELECT long('( 0h 2m 30s ,85d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('( 0h 2m 30s ,-95d 0m 0s)'::spoint); long ---------------- 3.152500961415 (1 row) SELECT long('( 0h 2m 30s ,-85d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('( 0h 2m 30s ,90d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('( 0h 2m 30s ,-90d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('(24h 2m 30s , 0d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('(24h 2m 30s ,95d 0m 0s)'::spoint); long ---------------- 3.152500961415 (1 row) SELECT long('(24h 2m 30s ,85d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('(24h 2m 30s ,-95d 0m 0s)'::spoint); long ---------------- 3.152500961415 (1 row) SELECT long('(24h 2m 30s ,-85d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('(24h 2m 30s ,90d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) SELECT long('(24h 2m 30s ,-90d 0m 0s)'::spoint); long ------------------ 0.01090830782496 (1 row) -- lat(spoint) SELECT lat('( 0h 2m 30s , 0d 0m 0s)'::spoint); lat ----- 0 (1 row) SELECT lat('( 0h 2m 30s ,95d 0m 0s)'::spoint); lat ---------------- 1.483529864195 (1 row) SELECT lat('( 0h 2m 30s ,85d 0m 0s)'::spoint); lat ---------------- 1.483529864195 (1 row) SELECT lat('( 0h 2m 30s ,-95d 0m 0s)'::spoint); lat ----------------- -1.483529864195 (1 row) SELECT lat('( 0h 2m 30s ,-85d 0m 0s)'::spoint); lat ----------------- -1.483529864195 (1 row) SELECT lat('( 0h 2m 30s ,90d 0m 0s)'::spoint); lat ---------------- 1.570796326795 (1 row) SELECT lat('( 0h 2m 30s ,-90d 0m 0s)'::spoint); lat ----------------- -1.570796326795 (1 row) SELECT lat('(24h 2m 30s , 0d 0m 0s)'::spoint); lat ----- 0 (1 row) SELECT lat('(24h 2m 30s ,95d 0m 0s)'::spoint); lat ---------------- 1.483529864195 (1 row) SELECT lat('(24h 2m 30s ,85d 0m 0s)'::spoint); lat ---------------- 1.483529864195 (1 row) SELECT lat('(24h 2m 30s ,-95d 0m 0s)'::spoint); lat ----------------- -1.483529864195 (1 row) SELECT lat('(24h 2m 30s ,-85d 0m 0s)'::spoint); lat ----------------- -1.483529864195 (1 row) SELECT lat('(24h 2m 30s ,90d 0m 0s)'::spoint); lat ---------------- 1.570796326795 (1 row) SELECT lat('(24h 2m 30s ,-90d 0m 0s)'::spoint); lat ----------------- -1.570796326795 (1 row) -- operators for points ------------- -- = operator ----------------------- SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 24h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 24h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint='( 12h 2m 30s , 85d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint='( 0h 2m 30s , 10d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint='( 12h 2m 30s , 45d 0m 0s)'::spoint; ?column? ---------- f (1 row) -- <> operator ----------------------- SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 24h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 24h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<>'( 12h 2m 30s , 85d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<>'( 0h 2m 30s , 10d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<>'( 12h 2m 30s , 45d 0m 0s)'::spoint; ?column? ---------- t (1 row) -- <-> operator --------------------- SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 0m 30s , 0d 0m 0s)'::spoint; ?column? ------------------- 0.008726646259972 (1 row) SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , 10d 0m 0s)'::spoint; ?column? ----------------- 0.1745329251994 (1 row) SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; ?column? ----------------- 0.1745329251994 (1 row) SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<->'( 12h 2m 30s , 85d 0m 0s)'::spoint; ?column? ---------- 0 (1 row) SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; ?column? ----------------- 0.3490658503989 (1 row) SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<->'( 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- 0 (1 row) SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<->'( 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- 0 (1 row) -- spoint_dwithin function ---------- SELECT a, b, radius, a <-> b AS "<->", spoint_dwithin(a, b, radius) FROM (VALUES ('(0, 0)'::spoint, '(0, 0)'::spoint, 0), ('(0, 0)', '(0, 1)', 1), ('(0, 0)', '(0.1, 0.1)', 0.14), ('(0, 0)', '(0.1, 0.1)', 0.15) ) sub (a, b, radius); a | b | radius | <-> | spoint_dwithin ---------+-------------+--------+-----------------+---------------- (0 , 0) | (0 , 0) | 0 | 0 | t (0 , 0) | (0 , 1) | 1 | 1 | t (0 , 0) | (0.1 , 0.1) | 0.14 | 0.1413032986961 | f (0 , 0) | (0.1 , 0.1) | 0.15 | 0.1413032986961 | t (4 rows) pgsphere-1.5.1/expected/poly.out000066400000000000000000001241321461140101500166440ustar00rootroot00000000000000\set ECHO none set_sphere_output_precision ----------------------------- SET 8 (1 row) -- checking polygon operators \set poly 'spoly \'{(0.1,0),(0.2,0),(0.2,0.1),(0.3,0.1),(0.3,-0.1),(0.4,-0.1),(0.5,0.1),(0.4,0.2),(0.1,0.2)}\'' SELECT spoint '(0.15,0.10)' @ :poly; -- point inside polygon ?column? ---------- t (1 row) SELECT spoint '(0.20,0.00)' @ :poly; -- point contained polygon ?column? ---------- t (1 row) SELECT spoint '(0.10,0.10)' @ :poly; -- point contained polygon ?column? ---------- t (1 row) SELECT spoint '(0.25,0.50)' @ :poly; -- point outside polygon ?column? ---------- f (1 row) SELECT spoint '(0.25,0.00)' @ :poly; -- point outside polygon ?column? ---------- f (1 row) SELECT scircle '<(0.15,0.10),0.03>' @ :poly; -- circle inside polygon ?column? ---------- t (1 row) SELECT scircle '<(0.20,0.00),0.00>' @ :poly; -- circle contained polygon ?column? ---------- t (1 row) SELECT scircle '<(0.20,0.30),0.05>' @ :poly; -- circle outside polygon ?column? ---------- f (1 row) SELECT scircle '<(0.25,0.00),0.05>' @ :poly; -- circle overlaps polygon ?column? ---------- f (1 row) SELECT scircle '<(0.25,0.00),0.10>' @ :poly; -- circle overlaps polygon ?column? ---------- f (1 row) SELECT scircle '<(0.15,0.10),0.03>' && :poly; -- circle inside polygon ?column? ---------- t (1 row) SELECT scircle '<(0.20,0.00),0.00>' && :poly; -- circle contained polygon ?column? ---------- t (1 row) SELECT scircle '<(0.20,0.30),0.05>' && :poly; -- circle outside polygon ?column? ---------- f (1 row) SELECT scircle '<(0.25,0.00),0.05>' && :poly; -- circle overlaps polygon ?column? ---------- t (1 row) SELECT scircle '<(0.25,0.00),0.10>' && :poly; -- circle overlaps polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.00, 0.00)', spoint '(0.10,0.20)' ) @ :poly; -- line touches polygon ?column? ---------- f (1 row) SELECT sline ( spoint '(0.00, 0.10)', spoint '(0.10,0.10)' ) @ :poly; -- line touches polygon ?column? ---------- f (1 row) SELECT sline ( spoint '(0.50, 0.00)', spoint '(0.50,0.20)' ) @ :poly; -- line touches polygon ?column? ---------- f (1 row) SELECT sline ( spoint '(0.10, 0.20)', spoint '(0.20,0.00)' ) @ :poly; -- line touches and inside polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.45,-0.20)', spoint '(0.45,0.20)' ) @ :poly; -- line overlaps polygon ?column? ---------- f (1 row) SELECT sline ( spoint '(0.45, 0.10)', spoint '(0.45,0.20)' ) @ :poly; -- line overlaps polygon ?column? ---------- f (1 row) SELECT sline ( spoint '(0.24, 0.17)', spoint '(0.25,0.14)' ) @ :poly; -- line inside polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.00, 0.00)', spoint '(0.10,0.20)' ) && :poly; -- line touches polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.00, 0.10)', spoint '(0.10,0.10)' ) && :poly; -- line touches polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.50, 0.00)', spoint '(0.50,0.20)' ) && :poly; -- line touches polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.10, 0.20)', spoint '(0.20,0.00)' ) && :poly; -- line touches and inside polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.45,-0.20)', spoint '(0.45,0.20)' ) && :poly; -- line overlaps polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.45, 0.10)', spoint '(0.45,0.20)' ) && :poly; -- line overlaps polygon ?column? ---------- t (1 row) SELECT sline ( spoint '(0.24, 0.17)', spoint '(0.25,0.14)' ) && :poly; -- line inside polygon ?column? ---------- t (1 row) \unset poly \set poly1 'spoly \'{(0,0),(1,0),(0,1)}\'' \set poly2 'spoly \'{(1,0),(0,0),(0,1)}\'' \set poly3 'spoly \'{(0,1),(0,0),(1,0)}\'' \set poly4 'spoly \'{(0.1,0.9),(0.1,0.1),(0.9,0.1)}\'' \set poly5 'spoly \'{(0.2,0.0),(1.2,0.0),(0.2,1)}\'' SELECT :poly1 = :poly2; ?column? ---------- t (1 row) SELECT :poly2 = :poly3; ?column? ---------- t (1 row) SELECT :poly3 = :poly1; ?column? ---------- t (1 row) SELECT :poly1 && :poly2; ?column? ---------- t (1 row) SELECT :poly2 && :poly3; ?column? ---------- t (1 row) SELECT :poly3 && :poly1; ?column? ---------- t (1 row) SELECT :poly1 @ :poly2; ?column? ---------- t (1 row) SELECT :poly2 @ :poly3; ?column? ---------- t (1 row) SELECT :poly3 @ :poly1; ?column? ---------- t (1 row) SELECT :poly1 @ :poly4; ?column? ---------- f (1 row) SELECT :poly4 @ :poly1; ?column? ---------- t (1 row) SELECT :poly1 && :poly4; ?column? ---------- t (1 row) SELECT :poly4 && :poly1; ?column? ---------- t (1 row) SELECT :poly1 @ :poly5; ?column? ---------- f (1 row) SELECT :poly5 @ :poly1; ?column? ---------- f (1 row) SELECT :poly1 && :poly5; ?column? ---------- t (1 row) SELECT :poly5 && :poly1; ?column? ---------- t (1 row) \unset poly1 \unset poly2 \unset poly3 \unset poly4 \unset poly5 -- From testsuite/poly_test.sql SELECT set_sphere_output('DEG'); set_sphere_output ------------------- SET DEG (1 row) SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; spoly ------------------------------------ {(10d , 0d),(10d , 1d),(15d , 0d)} (1 row) SELECT spoly '{(359d,0d),(359d,1d),(4d,0d)}'; spoly ------------------------------------- {(359d , 0d),(359d , 1d),(4d , 0d)} (1 row) SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; spoly ------------------------------------ {(10d , 0d),(10d , 1d),(15d , 0d)} (1 row) SELECT spoly(ARRAY[0.017453292519943295, 0.03490658503988659, 0.05235987755982988, 0.06981317007977318, 0.08726646259971647, 0.10471975511965977]); spoly --------------------------------- {(1d , 2d),(3d , 4d),(5d , 6d)} (1 row) SELECT spoly(ARRAY[0.17453292519943295, 0.0, 0.17453292519943295, 0.017453292519943295, 0.2617993877991494, 0.0]); spoly ------------------------------------ {(10d , 0d),(10d , 1d),(15d , 0d)} (1 row) SELECT spoly_deg(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]); spoly_deg --------------------------------- {(1d , 2d),(3d , 4d),(5d , 6d)} (1 row) SELECT spoly_deg(ARRAY[10.0, 0.0, 10.0, 1.0, 15.0, 0.0]); spoly_deg ------------------------------------ {(10d , 0d),(10d , 1d),(15d , 0d)} (1 row) --- Constructors SELECT spoly(NULL::spoint[]); spoly ------- (1 row) SELECT spoly(ARRAY[]::spoint[]); ERROR: spherepoly_from_point_array: invalid number of arguments (must be >= 3) SELECT spoly(ARRAY[spoint_deg(0, 0)]); ERROR: spherepoly_from_point_array: invalid number of arguments (must be >= 3) SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0)]); ERROR: spherepoly_from_point_array: invalid number of arguments (must be >= 3) SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10, 10)]); spoly ------------------------------------ {(0d , 0d),(10d , 0d),(10d , 10d)} (1 row) SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10, 10), spoint_deg(0, 10)]); spoly ----------------------------------------------- {(0d , 0d),(10d , 0d),(10d , 10d),(0d , 10d)} (1 row) --- incorrect input ----- SELECT spoly '{(10d,0d),(10d,1d)}'; ERROR: spherepoly_in: more than two points needed LINE 1: SELECT spoly '{(10d,0d),(10d,1d)}'; ^ SELECT spoly(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0]); ERROR: spherepoly_rad: invalid number of arguments (must be even and >= 6) SELECT spoly(ARRAY[1.0, 2.0, 3.0, NULL, 5.0, 6.0]); ERROR: spherepoly_rad: input array is invalid because it has null values SELECT spoly(ARRAY[]::float8[]); ERROR: spherepoly_rad: invalid number of arguments (must be even and >= 6) SELECT spoly(NULL::float8[]); spoly ------- (1 row) SELECT spoly_deg(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0]); ERROR: spherepoly_deg: invalid number of arguments (must be even and >= 6) SELECT spoly_deg(ARRAY[1.0, 2.0, 3.0, NULL, 5.0, 6.0]); ERROR: spherepoly_deg: input array is invalid because it has null values SELECT spoly_deg(ARRAY[]::float8[]); ERROR: spherepoly_deg: invalid number of arguments (must be even and >= 6) SELECT spoly_deg(NULL::float8[]); spoly_deg ----------- (1 row) --- self-crossing input ----- SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}'; ERROR: spherepoly_from_array: a line segment overlaps or polygon too large LINE 1: SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}'; ^ --- degenerate polygons ----- SELECT spoly '{(0d,1d),(0d,2d),(0d,3d)}'; spoly --------------------------------- {(0d , 1d),(0d , 2d),(0d , 3d)} (1 row) SELECT spoly '{(1d,0d),(2d,0d),(3d,0d)}'; spoly --------------------------------- {(1d , 0d),(2d , 0d),(3d , 0d)} (1 row) --- functions SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d)}'); npoints --------- 3 (1 row) SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d),(5d,-5d)}'); npoints --------- 4 (1 row) --SELECT npoints( spoly '{(0d,0d),(0d,90d),(15d,90d),(15d,0d)}'); SELECT area(spoly '{(0d,0d),(0d,90d),(1,0d)}'); area ------ 1 (1 row) SELECT area(spoly '{(0d,0d),(0d,90d),(90d,0d)}')/(4.0*pi()); ?column? ---------- 0.125 (1 row) --- operations --- = operator --- should be true SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(2d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(2d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(3d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; ?column? ---------- f (1 row) --- <> operator --- should be false SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(2d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(2d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; ?column? ---------- f (1 row) --- should be true SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(3d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; ?column? ---------- t (1 row) --- spoint @ spoly --- should be true SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(3d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; ?column? ---------- t (1 row) --- spoint @ spoly --- should be true SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '(0d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '(0d,0d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '(0d,89.9d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '(0d,90d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '(0d,-89.9d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) SELECT '(0d,-90d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) --- should be false SELECT '(0.1d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '(45d,-89d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- f (1 row) SELECT '(0d,1d)'::spoint @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) --- spoly ~ spoint --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0.5d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,89.9d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,90d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-89.9d)'::spoint; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-90d)'::spoint; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.1d,0.5d)'::spoint; ?column? ---------- f (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(45d,-89d)'::spoint; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '(0d,1d)'::spoint; ?column? ---------- f (1 row) --- scircle @ spoly --- should be true SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '<(0d,89.9d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,90d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,-89.9d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,-90d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) --- should be false SELECT '<(0.1d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(45d,-89d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- f (1 row) SELECT '<(0d,1d),0.1d>'::scircle @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(0d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(0d,0d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) --- spoly ~ scircle --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.5d,0.5d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,89.9d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,90d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-89.9d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-90d),0.1d>'::scircle; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(45d,-89d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '<(0d,1d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0.5d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.1d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.6d,0.5d),0.1d>'::scircle; ?column? ---------- f (1 row) --- spoly @ scircle --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),2.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ '<(0d,90d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' @ '<(180d,-90d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),0.99d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(60d,0d),0.99d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}' @ '<(0d,90d),1.0d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}' @ '<(180d,-90d),1.0d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(2d,0d)}' @ '<(0d,0d),1.0d>'::scircle; ?column? ---------- f (1 row) --- scircle ~ spoly --- should be true SELECT '<(0d,0d),2.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; ?column? ---------- t (1 row) SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; ?column? ---------- t (1 row) --- should be false SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(0d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; ?column? ---------- f (1 row) SELECT '<(60d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; ?column? ---------- f (1 row) SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}'; ?column? ---------- f (1 row) SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}'; ?column? ---------- f (1 row) SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(2d,0d)}'; ?column? ---------- f (1 row) --- scircle && spoly --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,89.9d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-89.9d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-90d),0.1d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0d,0d),2.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' && '<(0d,0d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(180d,-90d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && '<(0d,0d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(0d,2d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(2d,0d),1.0d>'::scircle; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(1.5d,0.5d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,88.0d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.3d,0.5d),0.1d>'::scircle; ?column? ---------- f (1 row) SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-87d),0.1d>'::scircle; ?column? ---------- f (1 row) --- spoly && scircle --- should be true SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '<(0d,89.9d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,90d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,-89.9d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,-90d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,0d),2.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; ?column? ---------- t (1 row) SELECT '<(0d,90d),1.0d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT '<(180d,-90d),1.0d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- t (1 row) SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT '<(0d,2d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT '<(2d,0d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) --- should be false SELECT '<(1.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(0d,88.0d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- f (1 row) SELECT '<(0.3d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT '<(0d,-87d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; ?column? ---------- f (1 row) --- spoly @ spoly --- should be true SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) --- should be false --SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- f (1 row) --- spoly ~ spoly --- should be true SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; ?column? ---------- f (1 row) --- spoly && spoly --- should be true SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; ?column? ---------- t (1 row) SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; ?column? ---------- t (1 row) SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- t (1 row) --- should be false SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; ?column? ---------- f (1 row) SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; ?column? ---------- f (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(3d,-1d),(3d,1d),(5d,1d),(5d,-1d)}'; ?column? ---------- f (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-1d,3d),(-1d,5d),(1d,5d),(1d,3d)}'; ?column? ---------- f (1 row) SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(179d,-1d),(179d,1d),(181d,1d),(181d,-1d)}'; ?column? ---------- f (1 row) -- -- ellipse and polygon -- -- negators , commutator @,&& SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; ?column? ---------- f (1 row) SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; ?column? ---------- f (1 row) -- ellipse is point SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' @ sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{0d,0d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{0d,0d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{0d,0d},(280d,-20d),90d>' @ spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{0d,0d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{0d,0d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}'; ?column? ---------- t (1 row) -- ellipse is circle SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}' @ sellipse '<{2d,2d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{5d,5d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{2d,2d},(280d,-20d),90d>' @ spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{5d,5d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-18d),(279d, -12d)}'; ?column? ---------- t (1 row) -- ellipse is line SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}' @ sellipse '<{2d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{5d,0d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,0d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{2d,0d},(280d,-20d),90d>' @ spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,0d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{5d,0d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-18d),(279d, -12d)}'; ?column? ---------- t (1 row) -- ellipse is a real ellipse SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{5d,2d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}' @ sellipse '<{2d,1d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{5d,2d},(280d,-20d),90d>'; ?column? ---------- f (1 row) SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{5d,2d},(280d,-20d),90d>'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,2d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{2d,1d},(280d,-20d),90d>' @ spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}'; ?column? ---------- t (1 row) SELECT sellipse '<{5d,2d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; ?column? ---------- f (1 row) SELECT sellipse '<{5d,2d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-18d),(279d, -12d)}'; ?column? ---------- t (1 row) -- create polygon as aggregate SELECT spoly(data.p) FROM ( SELECT spoint '(0,1)' as p UNION ALL SELECT spoint '(1,1)' UNION ALL SELECT '(1,0)' ) AS data ; spoly ------------------------------------------------------------- {(0d , 57.29578d),(57.29578d , 57.29578d),(57.29578d , 0d)} (1 row) -- test stored data SELECT count(id) FROM spheretmp5 WHERE id=2 AND area(p) BETWEEN 5.735555 AND 5.735556 ; count ------- 1 (1 row) -- check to create this small polygon without errors SELECT area( spoly '{ (3.09472232280407 , 1.47261266025223), (3.0947320190777 , 1.47261266025223), (3.0947320190777 , 1.47262235652586), (3.09472232280407 , 1.47262235652586) }') >= 0 ; ?column? ---------- t (1 row) SELECT npoints( spoly '{ (1.51214841579108 , -2.90888208684947e-05), (1.5121581120647 , -2.90888208684947e-05), (1.5121581120647 , -1.93925472462553e-05), (1.51214841579108 , -1.93925472462553e-05) }'); npoints --------- 4 (1 row) SELECT set_sphere_output( 'RAD' ); set_sphere_output ------------------- SET RAD (1 row) SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 1 ); spoint --------- (0 , 0) (1 row) SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 2 ); spoint --------- (1 , 0) (1 row) SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 3 ); spoint --------- (1 , 1) (1 row) SELECT spoly_as_array( spoly '{(0,0),(1,0),(1,1)}' ); spoly_as_array --------------------------------- {"(0 , 0)","(1 , 0)","(1 , 1)"} (1 row) -- spoly is convex SELECT spoly_is_convex(spoly'{(53d 45m 35.0s, 37d 6m 30.0s), (52d 21m 36.0s, 41d 36m 7.0s), (54d 14m 18.0s, 45d 1m 35.0s), (51d 23m 3.0s, 45d 22m 49.0s), (51d 2m 12.0s, 41d 52m 1.0s), (50d 41m 47.0s, 38d 22m 0s) }'); spoly_is_convex ----------------- f (1 row) SELECT spoly_is_convex(spoly'{(12d,32d),(34d,12d),(59d,21d),(69d,21d)}'); spoly_is_convex ----------------- f (1 row) SELECT spoly_is_convex(spoly'{(12d,32d),(34d,12d),(59d,21d),(34d,40d)}'); spoly_is_convex ----------------- t (1 row) SELECT spoly_is_convex(NULL); spoly_is_convex ----------------- f (1 row) -- Complex but valid polygon SELECT '{ (3.30474723646012 , 1.08600456205300), (3.30341855309927 , 1.08577960186707), (3.30341054542378 , 1.08578643990271), (3.30297351563319 , 1.08633534556428), (3.30357156120003 , 1.08643683957210), (3.30358891855857 , 1.08643995044436), (3.30360894676365 , 1.08644306147078), (3.30361829343581 , 1.08644430596871), (3.30362630482521 , 1.08644555030213), (3.30364633346451 , 1.08644866102000), (3.30365300940335 , 1.08645052692055), (3.30366102096957 , 1.08645177113937), (3.30367036769496 , 1.08645363721023), (3.30367837934959 , 1.08645488137174), (3.30368906174976 , 1.08645612569695), (3.30370107936906 , 1.08645799183673), (3.30370642025712 , 1.08645985750225), (3.30373179124734 , 1.08646358962156), (3.30374514456618 , 1.08646545561358), (3.30410706158729 , 1.08652886672786), (3.30427803417922 , 1.08655868846497), (3.30429673329093 , 1.08655930694968), (3.30432478121775 , 1.08655930174652), (3.30433278932944 , 1.08655308246640), (3.30446348355532 , 1.08638330933224) }'::spoly; spoly --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {(3.3047472 , 1.0860046),(3.3034186 , 1.0857796),(3.3034105 , 1.0857864),(3.3029735 , 1.0863353),(3.3035716 , 1.0864368),(3.3035889 , 1.08644),(3.3036089 , 1.0864431),(3.3036183 , 1.0864443),(3.3036263 , 1.0864456),(3.3036463 , 1.0864487),(3.303653 , 1.0864505),(3.303661 , 1.0864518),(3.3036704 , 1.0864536),(3.3036784 , 1.0864549),(3.3036891 , 1.0864561),(3.3037011 , 1.086458),(3.3037064 , 1.0864599),(3.3037318 , 1.0864636),(3.3037451 , 1.0864655),(3.3041071 , 1.0865289),(3.304278 , 1.0865587),(3.3042967 , 1.0865593),(3.3043248 , 1.0865593),(3.3043328 , 1.0865531),(3.3044635 , 1.0863833)} (1 row) pgsphere-1.5.1/expected/sbox_brin.out000066400000000000000000000055551461140101500176550ustar00rootroot00000000000000SELECT set_sphere_output_precision(8); set_sphere_output_precision ----------------------------- SET 8 (1 row) CREATE TABLE test_boxes ( b sbox ); COPY test_boxes (b) FROM stdin; CREATE OR REPLACE FUNCTION qnodes(q text) RETURNS text LANGUAGE 'plpgsql' AS $$ DECLARE exp TEXT; mat TEXT[]; ret TEXT[]; BEGIN FOR exp IN EXECUTE 'EXPLAIN ' || q LOOP --RAISE NOTICE 'EXP: %', exp; mat := regexp_matches(exp, ' *(?:-> *)?(.*Scan on (test_boxes|test_boxes_brin_idx))'); --RAISE NOTICE 'MAT: %', mat; IF mat IS NOT NULL THEN ret := array_append(ret, mat[1]); END IF; --RAISE NOTICE 'RET: %', ret; END LOOP; RETURN array_to_string(ret,','); END; $$; CREATE INDEX test_boxes_brin_idx ON test_boxes USING brin (b); SET enable_indexscan = OFF; SET enable_bitmapscan = OFF; SET enable_seqscan = ON; SELECT 'scan_seq', qnodes('SELECT * FROM test_boxes WHERE b <@ sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------ scan_seq | Seq Scan on test_boxes (1 row) SELECT * FROM test_boxes WHERE b <@ sbox '( (10d,10d), (20d,20d) )'; b --- (0 rows) SELECT 'scan_seq', qnodes('SELECT * FROM test_boxes WHERE b && sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------ scan_seq | Seq Scan on test_boxes (1 row) SELECT * FROM test_boxes WHERE b && sbox '( (10d,10d), (20d,20d) )'; b -------------------------------------------------------- ((0.34906585 , 0.17453293), (0.35006585 , 0.17463293)) (1 row) SET enable_indexscan = OFF; SET enable_bitmapscan = ON; SET enable_seqscan = OFF; SELECT 'scan_idx', qnodes('SELECT * FROM test_boxes WHERE b <@ sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------------------------------------------------------- scan_idx | Bitmap Heap Scan on test_boxes,Bitmap Index Scan on test_boxes_brin_idx (1 row) SELECT * FROM test_boxes WHERE b <@ sbox '( (10d,10d), (20d,20d) )'; b --- (0 rows) SELECT 'scan_idx', qnodes('SELECT * FROM test_boxes WHERE b && sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------------------------------------------------------- scan_idx | Bitmap Heap Scan on test_boxes,Bitmap Index Scan on test_boxes_brin_idx (1 row) SELECT * FROM test_boxes WHERE b && sbox '( (10d,10d), (20d,20d) )'; b -------------------------------------------------------- ((0.34906585 , 0.17453293), (0.35006585 , 0.17463293)) (1 row) ---- cleanup DROP INDEX test_boxes_brin_idx; DROP TABLE test_boxes; DROP FUNCTION qnodes(text); SET enable_indexscan = ON; SET enable_bitmapscan = ON; SET enable_seqscan = ON; pgsphere-1.5.1/expected/selectivity.out000066400000000000000000000144631461140101500202320ustar00rootroot00000000000000-- test selectivity estimator functions create table spoint10k (star spoint); insert into spoint10k select spoint(i, i*i) from generate_series(1, 10000) g(i); create index on spoint10k using gist (star); analyze spoint10k; -- "explain analyze" wrapper that removes 'cost=...' since it varies across architectures -- (we can't use "costs off" since that also removes the estimated row count) create or replace function explain(query text, do_analyze text default 'true') returns setof text language plpgsql as $$ declare line text; begin for line in execute format('explain (analyze %s, timing off, summary off) %s', do_analyze, query) loop return next regexp_replace(line, 'cost=\S+ ', ''); end loop; return; end; $$; -- <@ operator selectivity select explain('select * from spoint10k where star <@ scircle(spoint(1,1), 1)'); explain ----------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=2298 width=16) (actual rows=3009 loops=1) Recheck Cond: (star <@ '<(1 , 1) , 1>'::scircle) Rows Removed by Index Recheck: 1560 Heap Blocks: exact=55 -> Bitmap Index Scan on spoint10k_star_idx (rows=2298 width=0) (actual rows=4569 loops=1) Index Cond: (star <@ '<(1 , 1) , 1>'::scircle) (6 rows) select explain('select * from spoint10k where star <@ scircle(spoint(1,1), .1)'); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=25 width=16) (actual rows=29 loops=1) Recheck Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) Rows Removed by Index Recheck: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) (6 rows) select explain('select * from spoint10k where star <@ scircle(spoint(1,1), .01)'); explain --------------------------------------------------------------------------------------------- Index Scan using spoint10k_star_idx on spoint10k (rows=1 width=16) (actual rows=1 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.01>'::scircle) (2 rows) select explain('select * from spoint10k where scircle(spoint(1,1), 1) @> star'); explain ----------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=2298 width=16) (actual rows=3009 loops=1) Recheck Cond: ('<(1 , 1) , 1>'::scircle @> star) Rows Removed by Index Recheck: 1560 Heap Blocks: exact=55 -> Bitmap Index Scan on spoint10k_star_idx (rows=2298 width=0) (actual rows=4569 loops=1) Index Cond: (star <@ '<(1 , 1) , 1>'::scircle) (6 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .1) @> star'); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=25 width=16) (actual rows=29 loops=1) Recheck Cond: ('<(1 , 1) , 0.1>'::scircle @> star) Rows Removed by Index Recheck: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) (6 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .01) @> star'); explain --------------------------------------------------------------------------------------------- Index Scan using spoint10k_star_idx on spoint10k (rows=1 width=16) (actual rows=1 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.01>'::scircle) (2 rows) select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), 1)'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=7702 width=16) (actual rows=6991 loops=1) Filter: (star !<@ '<(1 , 1) , 1>'::scircle) Rows Removed by Filter: 3009 (3 rows) select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), .1)'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=9975 width=16) (actual rows=9971 loops=1) Filter: (star !<@ '<(1 , 1) , 0.1>'::scircle) Rows Removed by Filter: 29 (3 rows) select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), .01)'); explain ------------------------------------------------------------------------- Seq Scan on spoint10k (rows=10000 width=16) (actual rows=9999 loops=1) Filter: (star !<@ '<(1 , 1) , 0.01>'::scircle) Rows Removed by Filter: 1 (3 rows) select explain('select * from spoint10k where scircle(spoint(1,1), 1) !@> star'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=7702 width=16) (actual rows=6991 loops=1) Filter: ('<(1 , 1) , 1>'::scircle !@> star) Rows Removed by Filter: 3009 (3 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .1) !@> star'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=9975 width=16) (actual rows=9971 loops=1) Filter: ('<(1 , 1) , 0.1>'::scircle !@> star) Rows Removed by Filter: 29 (3 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .01) !@> star'); explain ------------------------------------------------------------------------- Seq Scan on spoint10k (rows=10000 width=16) (actual rows=9999 loops=1) Filter: ('<(1 , 1) , 0.01>'::scircle !@> star) Rows Removed by Filter: 1 (3 rows) pgsphere-1.5.1/expected/selectivity_1.out000066400000000000000000000144631461140101500204520ustar00rootroot00000000000000-- test selectivity estimator functions create table spoint10k (star spoint); insert into spoint10k select spoint(i, i*i) from generate_series(1, 10000) g(i); create index on spoint10k using gist (star); analyze spoint10k; -- "explain analyze" wrapper that removes 'cost=...' since it varies across architectures -- (we can't use "costs off" since that also removes the estimated row count) create or replace function explain(query text, do_analyze text default 'true') returns setof text language plpgsql as $$ declare line text; begin for line in execute format('explain (analyze %s, timing off, summary off) %s', do_analyze, query) loop return next regexp_replace(line, 'cost=\S+ ', ''); end loop; return; end; $$; -- <@ operator selectivity select explain('select * from spoint10k where star <@ scircle(spoint(1,1), 1)'); explain ----------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=2298 width=16) (actual rows=3009 loops=1) Recheck Cond: (star <@ '<(1 , 1) , 1>'::scircle) Rows Removed by Index Recheck: 1560 Heap Blocks: exact=55 -> Bitmap Index Scan on spoint10k_star_idx (rows=2298 width=0) (actual rows=4569 loops=1) Index Cond: (star <@ '<(1 , 1) , 1>'::scircle) (6 rows) select explain('select * from spoint10k where star <@ scircle(spoint(1,1), .1)'); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=25 width=16) (actual rows=29 loops=1) Recheck Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) Rows Removed by Index Recheck: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.1>'::scircle) (6 rows) select explain('select * from spoint10k where star <@ scircle(spoint(1,1), .01)'); explain --------------------------------------------------------------------------------------------- Index Scan using spoint10k_star_idx on spoint10k (rows=1 width=16) (actual rows=1 loops=1) Index Cond: (star <@ '<(1 , 1) , 0.01>'::scircle) (2 rows) select explain('select * from spoint10k where scircle(spoint(1,1), 1) @> star'); explain ----------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=2298 width=16) (actual rows=3009 loops=1) Recheck Cond: ('<(1 , 1) , 1>'::scircle @> star) Rows Removed by Index Recheck: 1560 Heap Blocks: exact=55 -> Bitmap Index Scan on spoint10k_star_idx (rows=2298 width=0) (actual rows=4569 loops=1) Index Cond: ('<(1 , 1) , 1>'::scircle @> star) (6 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .1) @> star'); explain ------------------------------------------------------------------------------------------- Bitmap Heap Scan on spoint10k (rows=25 width=16) (actual rows=29 loops=1) Recheck Cond: ('<(1 , 1) , 0.1>'::scircle @> star) Rows Removed by Index Recheck: 19 Heap Blocks: exact=32 -> Bitmap Index Scan on spoint10k_star_idx (rows=25 width=0) (actual rows=48 loops=1) Index Cond: ('<(1 , 1) , 0.1>'::scircle @> star) (6 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .01) @> star'); explain --------------------------------------------------------------------------------------------- Index Scan using spoint10k_star_idx on spoint10k (rows=1 width=16) (actual rows=1 loops=1) Index Cond: ('<(1 , 1) , 0.01>'::scircle @> star) (2 rows) select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), 1)'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=7702 width=16) (actual rows=6991 loops=1) Filter: (star !<@ '<(1 , 1) , 1>'::scircle) Rows Removed by Filter: 3009 (3 rows) select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), .1)'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=9975 width=16) (actual rows=9971 loops=1) Filter: (star !<@ '<(1 , 1) , 0.1>'::scircle) Rows Removed by Filter: 29 (3 rows) select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), .01)'); explain ------------------------------------------------------------------------- Seq Scan on spoint10k (rows=10000 width=16) (actual rows=9999 loops=1) Filter: (star !<@ '<(1 , 1) , 0.01>'::scircle) Rows Removed by Filter: 1 (3 rows) select explain('select * from spoint10k where scircle(spoint(1,1), 1) !@> star'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=7702 width=16) (actual rows=6991 loops=1) Filter: ('<(1 , 1) , 1>'::scircle !@> star) Rows Removed by Filter: 3009 (3 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .1) !@> star'); explain ------------------------------------------------------------------------ Seq Scan on spoint10k (rows=9975 width=16) (actual rows=9971 loops=1) Filter: ('<(1 , 1) , 0.1>'::scircle !@> star) Rows Removed by Filter: 29 (3 rows) select explain('select * from spoint10k where scircle(spoint(1,1), .01) !@> star'); explain ------------------------------------------------------------------------- Seq Scan on spoint10k (rows=10000 width=16) (actual rows=9999 loops=1) Filter: ('<(1 , 1) , 0.01>'::scircle !@> star) Rows Removed by Filter: 1 (3 rows) pgsphere-1.5.1/expected/spoint_brin.out000066400000000000000000000055651461140101500202170ustar00rootroot00000000000000CREATE TABLE test_points ( p spoint ); COPY test_points (p) FROM stdin; CREATE OR REPLACE FUNCTION qnodes(q text) RETURNS text LANGUAGE 'plpgsql' AS $$ DECLARE exp TEXT; mat TEXT[]; ret TEXT[]; BEGIN FOR exp IN EXECUTE 'EXPLAIN ' || q LOOP --RAISE NOTICE 'EXP: %', exp; mat := regexp_matches(exp, ' *(?:-> *)?(.*Scan on (test_points|brin_spoint))'); --RAISE NOTICE 'MAT: %', mat; IF mat IS NOT NULL THEN ret := array_append(ret, mat[1]); END IF; --RAISE NOTICE 'RET: %', ret; END LOOP; RETURN array_to_string(ret,','); END; $$; CREATE INDEX brin_spoint ON test_points USING brin (p) WITH (pages_per_range = 16); set enable_indexscan = off; set enable_bitmapscan = off; set enable_seqscan = on; SELECT 'scan_seq', qnodes('SELECT * FROM test_points WHERE p <@ sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------- scan_seq | Seq Scan on test_points (1 row) SELECT * FROM test_points WHERE p <@ sbox '( (10d,10d), (20d,20d) )'; p ----------------------------------------- (0.349065850398866 , 0.174532925199433) (1 row) SELECT 'scan_seq', qnodes('SELECT * FROM test_points WHERE p && sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------- scan_seq | Seq Scan on test_points (1 row) SELECT * FROM test_points WHERE p && sbox '( (10d,10d), (20d,20d) )'; p ----------------------------------------- (0.349065850398866 , 0.174532925199433) (1 row) set enable_indexscan = off; set enable_bitmapscan = on; set enable_seqscan = off; SELECT 'scan_idx', qnodes('SELECT * FROM test_points WHERE p <@ sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------------------------------------------------ scan_idx | Bitmap Heap Scan on test_points,Bitmap Index Scan on brin_spoint (1 row) SELECT * FROM test_points WHERE p <@ sbox '( (10d,10d), (20d,20d) )'; p ----------------------------------------- (0.349065850398866 , 0.174532925199433) (1 row) SELECT 'scan_idx', qnodes('SELECT * FROM test_points WHERE p && sbox ''( (10d,10d), (20d,20d) )'''); ?column? | qnodes ----------+------------------------------------------------------------------ scan_idx | Bitmap Heap Scan on test_points,Bitmap Index Scan on brin_spoint (1 row) SELECT * FROM test_points WHERE p && sbox '( (10d,10d), (20d,20d) )'; p ----------------------------------------- (0.349065850398866 , 0.174532925199433) (1 row) -- cleanup DROP INDEX brin_spoint; DROP TABLE test_points; DROP FUNCTION qnodes(text); set enable_indexscan = on; set enable_bitmapscan = on; set enable_seqscan = on; pgsphere-1.5.1/expected/tables.out000066400000000000000000001241551461140101500171400ustar00rootroot00000000000000-- Create tables SET client_min_messages = 'warning'; CREATE TABLE spheretmp1 (p spoint); \copy spheretmp1 from 'data/test_spherepoint.data' \copy spheretmp1 from 'data/test_spherepoint.data' \copy spheretmp1 from 'data/test_spherepoint.data' \copy spheretmp1 from 'data/test_spherepoint.data' CREATE TABLE spheretmp2 (c scircle); \copy spheretmp2 from 'data/test_spherecircle.data' \copy spheretmp2 from 'data/test_spherecircle.data' \copy spheretmp2 from 'data/test_spherecircle.data' \copy spheretmp2 from 'data/test_spherecircle.data' CREATE TABLE spheretmp3 (b sbox); \copy spheretmp3 from 'data/test_spherebox.data' CREATE TABLE spheretmp4 AS SELECT sline ( p , p - strans '-15d,-15d,-15d,ZXZ' ) AS l FROM spheretmp1; CREATE TABLE spheretmp5 (id int PRIMARY KEY , p spoly ); \copy spheretmp5 from 'data/test_spherepolygon.data' CREATE TABLE spheretmp6 (id int PRIMARY KEY , p spath ); \copy spheretmp6 from 'data/test_spherepath.data' -- Aggregate data from tables SELECT set_sphere_output_precision(12); set_sphere_output_precision ----------------------------- SET 12 (1 row) CREATE TABLE spheretmp7 (p spoint); \copy spheretmp7 from 'data/test_spherepolygon_aggregate.data' SELECT spoly(p) FROM spheretmp7; spoly ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ {(0 , -0.9),(0.0174532925199 , -0.9),(0.0349065850399 , -0.9),(0.0523598775598 , -0.9),(0.0698131700798 , -0.9),(0.0872664625997 , -0.9),(0.10471975512 , -0.9),(0.12217304764 , -0.9),(0.13962634016 , -0.9),(0.157079632679 , -0.9),(0.174532925199 , -0.9),(0.191986217719 , -0.9),(0.209439510239 , -0.9),(0.226892802759 , -0.9),(0.244346095279 , -0.9),(0.261799387799 , -0.9),(0.279252680319 , -0.9),(0.296705972839 , -0.9),(0.314159265359 , -0.9),(0.331612557879 , -0.9),(0.349065850399 , -0.9),(0.366519142919 , -0.9),(0.383972435439 , -0.9),(0.401425727959 , -0.9),(0.418879020479 , -0.9),(0.436332312999 , -0.9),(0.453785605519 , -0.9),(0.471238898038 , -0.9),(0.488692190558 , -0.9),(0.506145483078 , -0.9),(0.523598775598 , -0.9),(0.541052068118 , -0.9),(0.558505360638 , -0.9),(0.575958653158 , -0.9),(0.593411945678 , -0.9),(0.610865238198 , -0.9),(0.628318530718 , -0.9),(0.645771823238 , -0.9),(0.663225115758 , -0.9),(0.680678408278 , -0.9),(0.698131700798 , -0.9),(0.715584993318 , -0.9),(0.733038285838 , -0.9),(0.750491578358 , -0.9),(0.767944870878 , -0.9),(0.785398163397 , -0.9),(0.802851455917 , -0.9),(0.820304748437 , -0.9),(0.837758040957 , -0.9),(0.855211333477 , -0.9),(0.872664625997 , -0.9),(0.890117918517 , -0.9),(0.907571211037 , -0.9),(0.925024503557 , -0.9),(0.942477796077 , -0.9),(0.959931088597 , -0.9),(0.977384381117 , -0.9),(0.994837673637 , -0.9),(1.01229096616 , -0.9),(1.02974425868 , -0.9),(1.0471975512 , -0.9),(1.06465084372 , -0.9),(1.08210413624 , -0.9),(1.09955742876 , -0.9),(1.11701072128 , -0.9),(1.1344640138 , -0.9),(1.15191730632 , -0.9),(1.16937059884 , -0.9),(1.18682389136 , -0.9),(1.20427718388 , -0.9),(1.2217304764 , -0.9),(1.23918376892 , -0.9),(1.25663706144 , -0.9),(1.27409035396 , -0.9),(1.29154364648 , -0.9),(1.308996939 , -0.9),(1.32645023152 , -0.9),(1.34390352404 , -0.9),(1.36135681656 , -0.9),(1.37881010908 , -0.9),(1.3962634016 , -0.9),(1.41371669412 , -0.9),(1.43116998664 , -0.9),(1.44862327916 , -0.9),(1.46607657168 , -0.9),(1.4835298642 , -0.9),(1.50098315672 , -0.9),(1.51843644924 , -0.9),(1.53588974176 , -0.9),(1.55334303427 , -0.9),(1.57079632679 , -0.9),(1.58824961931 , -0.9),(1.60570291183 , -0.9),(1.62315620435 , -0.9),(1.64060949687 , -0.9),(1.65806278939 , -0.9),(1.67551608191 , -0.9),(1.69296937443 , -0.9),(1.71042266695 , -0.9),(1.72787595947 , -0.9),(1.74532925199 , -0.9),(1.76278254451 , -0.9),(1.78023583703 , -0.9),(1.79768912955 , -0.9),(1.81514242207 , -0.9),(1.83259571459 , -0.9),(1.85004900711 , -0.9),(1.86750229963 , -0.9),(1.88495559215 , -0.9),(1.90240888467 , -0.9),(1.91986217719 , -0.9),(1.93731546971 , -0.9),(1.95476876223 , -0.9),(1.97222205475 , -0.9),(1.98967534727 , -0.9),(2.00712863979 , -0.9),(2.02458193231 , -0.9),(2.04203522483 , -0.9),(2.05948851735 , -0.9),(2.07694180987 , -0.9),(2.09439510239 , -0.9),(2.11184839491 , -0.9),(2.12930168743 , -0.9),(2.14675497995 , -0.9),(2.16420827247 , -0.9),(2.18166156499 , -0.9),(2.19911485751 , -0.9),(2.21656815003 , -0.9),(2.23402144255 , -0.9),(2.25147473507 , -0.9),(2.26892802759 , -0.9),(2.28638132011 , -0.9),(2.30383461263 , -0.9),(2.32128790515 , -0.9),(2.33874119767 , -0.9),(2.35619449019 , -0.9),(2.37364778271 , -0.9),(2.39110107523 , -0.9),(2.40855436775 , -0.9),(2.42600766027 , -0.9),(2.44346095279 , -0.9),(2.46091424531 , -0.9),(2.47836753783 , -0.9),(2.49582083035 , -0.9),(2.51327412287 , -0.9),(2.53072741539 , -0.9),(2.54818070791 , -0.9),(2.56563400043 , -0.9),(2.58308729295 , -0.9),(2.60054058547 , -0.9),(2.61799387799 , -0.9),(2.63544717051 , -0.9),(2.65290046303 , -0.9),(2.67035375555 , -0.9),(2.68780704807 , -0.9),(2.70526034059 , -0.9),(2.72271363311 , -0.9),(2.74016692563 , -0.9),(2.75762021815 , -0.9),(2.77507351067 , -0.9),(2.79252680319 , -0.9),(2.80998009571 , -0.9),(2.82743338823 , -0.9),(2.84488668075 , -0.9),(2.86233997327 , -0.9),(2.87979326579 , -0.9),(2.89724655831 , -0.9),(2.91469985083 , -0.9),(2.93215314335 , -0.9),(2.94960643587 , -0.9),(2.96705972839 , -0.9),(2.98451302091 , -0.9),(3.00196631343 , -0.9),(3.01941960595 , -0.9),(3.03687289847 , -0.9),(3.05432619099 , -0.9),(3.07177948351 , -0.9),(3.08923277603 , -0.9),(3.10668606855 , -0.9),(3.12413936107 , -0.9),(3.14159265359 , -0.9),(3.15904594611 , -0.9),(3.17649923863 , -0.9),(3.19395253115 , -0.9),(3.21140582367 , -0.9),(3.22885911619 , -0.9),(3.24631240871 , -0.9),(3.26376570123 , -0.9),(3.28121899375 , -0.9),(3.29867228627 , -0.9),(3.31612557879 , -0.9),(3.33357887131 , -0.9),(3.35103216383 , -0.9),(3.36848545635 , -0.9),(3.38593874887 , -0.9),(3.40339204139 , -0.9),(3.42084533391 , -0.9),(3.43829862643 , -0.9),(3.45575191895 , -0.9),(3.47320521147 , -0.9),(3.49065850399 , -0.9),(3.50811179651 , -0.9),(3.52556508903 , -0.9),(3.54301838155 , -0.9),(3.56047167407 , -0.9),(3.57792496659 , -0.9),(3.59537825911 , -0.9),(3.61283155163 , -0.9),(3.63028484415 , -0.9),(3.64773813667 , -0.9),(3.66519142919 , -0.9),(3.68264472171 , -0.9),(3.70009801423 , -0.9),(3.71755130675 , -0.9),(3.73500459927 , -0.9),(3.75245789179 , -0.9),(3.76991118431 , -0.9),(3.78736447683 , -0.9),(3.80481776935 , -0.9),(3.82227106187 , -0.9),(3.83972435439 , -0.9),(3.85717764691 , -0.9),(3.87463093943 , -0.9),(3.89208423195 , -0.9),(3.90953752447 , -0.9),(3.92699081699 , -0.9),(3.94444410951 , -0.9),(3.96189740203 , -0.9),(3.97935069455 , -0.9),(3.99680398707 , -0.9),(4.01425727959 , -0.9),(4.03171057211 , -0.9),(4.04916386463 , -0.9),(4.06661715715 , -0.9),(4.08407044967 , -0.9),(4.10152374219 , -0.9),(4.11897703471 , -0.9),(4.13643032723 , -0.9),(4.15388361975 , -0.9),(4.17133691227 , -0.9),(4.18879020479 , -0.9),(4.20624349731 , -0.9),(4.22369678983 , -0.9),(4.24115008235 , -0.9),(4.25860337487 , -0.9),(4.27605666739 , -0.9),(4.29350995991 , -0.9),(4.31096325243 , -0.9),(4.32841654495 , -0.9),(4.34586983747 , -0.9),(4.36332312999 , -0.9),(4.38077642251 , -0.9),(4.39822971503 , -0.9),(4.41568300755 , -0.9),(4.43313630007 , -0.9),(4.45058959259 , -0.9),(4.46804288511 , -0.9),(4.48549617763 , -0.9),(4.50294947015 , -0.9),(4.52040276267 , -0.9),(4.53785605519 , -0.9),(4.55530934771 , -0.9),(4.57276264023 , -0.9),(4.59021593275 , -0.9),(4.60766922527 , -0.9),(4.62512251778 , -0.9),(4.6425758103 , -0.9),(4.66002910282 , -0.9),(4.67748239534 , -0.9),(4.69493568786 , -0.9),(4.71238898038 , -0.9),(4.7298422729 , -0.9),(4.74729556542 , -0.9),(4.76474885794 , -0.9),(4.78220215046 , -0.9),(4.79965544298 , -0.9),(4.8171087355 , -0.9),(4.83456202802 , -0.9),(4.85201532054 , -0.9),(4.86946861306 , -0.9),(4.88692190558 , -0.9),(4.9043751981 , -0.9),(4.92182849062 , -0.9),(4.93928178314 , -0.9),(4.95673507566 , -0.9),(4.97418836818 , -0.9),(4.9916416607 , -0.9),(5.00909495322 , -0.9),(5.02654824574 , -0.9),(5.04400153826 , -0.9),(5.06145483078 , -0.9),(5.0789081233 , -0.9),(5.09636141582 , -0.9),(5.11381470834 , -0.9),(5.13126800086 , -0.9),(5.14872129338 , -0.9),(5.1661745859 , -0.9),(5.18362787842 , -0.9),(5.20108117094 , -0.9),(5.21853446346 , -0.9),(5.23598775598 , -0.9),(5.2534410485 , -0.9),(5.27089434102 , -0.9),(5.28834763354 , -0.9),(5.30580092606 , -0.9),(5.32325421858 , -0.9),(5.3407075111 , -0.9),(5.35816080362 , -0.9),(5.37561409614 , -0.9),(5.39306738866 , -0.9),(5.41052068118 , -0.9),(5.4279739737 , -0.9),(5.44542726622 , -0.9),(5.46288055874 , -0.9),(5.48033385126 , -0.9),(5.49778714378 , -0.9),(5.5152404363 , -0.9),(5.53269372882 , -0.9),(5.55014702134 , -0.9),(5.56760031386 , -0.9),(5.58505360638 , -0.9),(5.6025068989 , -0.9),(5.61996019142 , -0.9),(5.63741348394 , -0.9),(5.65486677646 , -0.9),(5.67232006898 , -0.9),(5.6897733615 , -0.9),(5.70722665402 , -0.9),(5.72467994654 , -0.9),(5.74213323906 , -0.9),(5.75958653158 , -0.9),(5.7770398241 , -0.9),(5.79449311662 , -0.9),(5.81194640914 , -0.9),(5.82939970166 , -0.9),(5.84685299418 , -0.9),(5.8643062867 , -0.9),(5.88175957922 , -0.9),(5.89921287174 , -0.9),(5.91666616426 , -0.9),(5.93411945678 , -0.9),(5.9515727493 , -0.9),(5.96902604182 , -0.9),(5.98647933434 , -0.9),(6.00393262686 , -0.9),(6.02138591938 , -0.9),(6.0388392119 , -0.9),(6.05629250442 , -0.9),(6.07374579694 , -0.9),(6.09119908946 , -0.9),(6.10865238198 , -0.9),(6.1261056745 , -0.9),(6.14355896702 , -0.9),(6.16101225954 , -0.9),(6.17846555206 , -0.9),(6.19591884458 , -0.9),(6.2133721371 , -0.9),(6.23082542962 , -0.9),(6.24827872214 , -0.9),(6.26573201466 , -0.9)} (1 row) CREATE TABLE spheretmp8 (p spoint); \copy spheretmp8 from 'data/test_spherepoint.data' SELECT spath(p) FROM spheretmp8 WHERE p IS NOT NULL; spath --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {(1.32 , 0.61),(5.88318530718 , -0.17),(2.3 , 0.6),(5.36318530718 , -0.19),(5.35318530718 , 0.52),(1.89 , 0.1),(1.33 , 0.52),(2.19 , 0.94),(0.13 , 0.34),(0.19 , -0.79),(0.52 , 0.45),(4.66318530718 , 0.14),(4.82318530718 , -0.75),(5.47318530718 , -0.08),(3 , -0.08),(2.21 , -0.91),(0.89 , 1.48),(5.67318530718 , -0.82),(1.06 , -1.13),(1.99 , -1.11),(6.10318530718 , -0.41),(3.09 , 1.25),(0.01 , 0.28),(3.20318530718 , 0.72),(3.61318530718 , 0.97),(2.32 , 0.88),(4.84318530718 , 0.07),(6.02318530718 , -0.09),(3.49318530718 , 1.36),(6.01318530718 , -0.51),(2.15 , 0.84),(4.70318530718 , 0.3),(2.23 , 0.63),(5.85318530718 , 0.52),(3.16318530718 , 0.85),(2.65 , -0.2),(2.33 , -0.05),(4.20318530718 , 0.14),(5.36318530718 , -1.16),(2.87 , -1.38),(2.43 , 1.09),(5.84318530718 , -0.5),(0.41 , -0.34),(4.81318530718 , -0.44),(2.61 , 0.34),(3.02 , 0.84),(1.14 , 0.01),(3.16318530718 , -0.21),(0.99 , -1.22),(2.39 , -0.42),(3.95318530718 , -0.2),(0.22 , -0.09),(5.50318530718 , -0.41),(3.77318530718 , -0.53),(0.66 , 1.29),(3.60318530718 , -0.78),(1.48 , -0.93),(1.57 , -1.06),(2.33 , -0.66),(1.08 , 0.27),(6.07318530718 , -0.3),(3.59318530718 , -0.49),(4.46318530718 , 0.48),(0.03 , 0.29),(2.5 , 0.63),(5.55318530718 , -0.14),(4.19318530718 , -0.49),(5.39318530718 , 0.66),(1.29 , 0.57),(2.51 , -0.96),(2.66 , 0.16),(0.97 , -0.84),(5.28318530718 , 1.02),(2.71 , 0.08),(2.64 , -0.89),(3.93318530718 , 0.92),(1.1 , 0.35),(1.07 , 1.09),(1.13 , 0.53),(5.95318530718 , -0.29),(1.5 , 1.1),(3.22318530718 , 0.07),(0.25 , -0.17),(0.07 , -0.46),(0.06 , 0.4),(3.68318530718 , 0.75),(4.90318530718 , -0.66),(2.01 , -0.23),(0.42 , -0.01),(1.05 , -1.24),(4.17318530718 , -0.82),(6.12318530718 , -0.05),(0.3 , -0.39),(1.35 , 0.05),(5.35318530718 , 0.5),(4.00318530718 , 0.11),(2.82 , 0.68),(2.74 , -0.9),(1.36 , -0.31),(5.47318530718 , -0.2),(2.07 , -0.04),(3.69318530718 , 0.57),(4.46318530718 , 0.44),(5.82318530718 , 0.06),(1.09 , -0.57),(2.49 , -0.07),(3.89318530718 , -0.14),(4.36318530718 , -0.47),(5.02318530718 , 0.35),(3.45318530718 , 0.16),(1.42 , 0.42),(3.15318530718 , -0.99),(5.97318530718 , 0.14),(4.65318530718 , -0.14),(5.27318530718 , -0.63),(3.53318530718 , -0.2),(1.21 , 0.69),(0.05 , -0.97),(3.98318530718 , 0.12),(2.05 , -0.82),(1.3 , -0.33),(2.89 , 0.03),(2.47 , 0.5),(3.69318530718 , 0.28),(5.12318530718 , -0.21),(6.00318530718 , 0.15),(2.26 , -0.9),(1.4 , 0.67),(3.35318530718 , 0.5),(4.66318530718 , 0.09),(1.32 , 0.32),(3.88318530718 , 0.43),(4.40318530718 , 0.8),(5.44318530718 , 0.8),(4.13318530718 , -0.04),(1.29 , -0.9),(2.26 , 0.27),(1.56 , 0.48),(3.06 , 0.12),(2.54 , 0.59),(0.98 , -0.6),(1.41 , 0.05),(1.25 , 0.42),(3.17318530718 , -0.19),(2.22 , -0.73),(0.42 , 0.09),(5.30318530718 , -0.11),(6.26318530718 , 0.99),(5.22318530718 , 0.32),(4.14318530718 , -1.13),(3.17318530718 , 0.35),(1.45 , -0.39),(3.36318530718 , -0.9),(0.93 , 0.27),(2.42 , 1.29),(2.65 , -0.07),(4.09318530718 , 0.05),(4.95318530718 , -0.23),(2.24 , -0.57),(4.47318530718 , 0.88),(0.01 , 0.51),(0.97 , -0.71),(2.71 , -0.26),(1.67 , -0.35),(4.76318530718 , 0.45),(4.50318530718 , -0.01),(0.38 , 1.03),(1.9 , -0.69),(1.92 , 0.65),(4.45318530718 , -1.4),(4.01318530718 , 0.45),(0.84 , 0.18),(5.41318530718 , 0.6),(2.2 , 0.89),(5.89318530718 , -0.33),(0.84 , -0.71),(0.62 , -0.15),(1.63 , -0.11),(1.43 , 0.46),(5.83318530718 , 0.91),(2.02 , 0.24),(5.03318530718 , -0.73),(2.45 , 0.74),(2.82 , 0.52),(2.5 , -0.83),(4.26318530718 , 0.32),(1.89 , -0.02),(1.48 , 0.98),(1.45 , -0.54),(3.28318530718 , -1.04),(3.08 , -0.25),(2.41 , 0.02),(3.72318530718 , -0.51),(2.14 , -0.58),(2.87 , -1.24),(3.16318530718 , -1.38),(1.24 , 0.95),(5.61318530718 , 1.05),(1.97 , -0.2),(6.27318530718 , -0.49),(5.77318530718 , -0.43),(3.02 , 0.69),(1.09 , -0.09),(6.18318530718 , -0.57),(3.20318530718 , -0.15),(0.08 , 0.32),(4.74318530718 , -0.46),(4.46318530718 , 0.73),(5.02318530718 , 0.4),(0.22 , -1.42),(1.23 , -1.14),(4.20318530718 , -1.03),(1.42 , -0.64),(1.72 , 0.11),(1.7 , 0.9),(2.79 , 0.31),(2.9 , 0.28),(3.74318530718 , 0.69),(4.11318530718 , 0.28),(1.75 , 0),(5.12318530718 , -0.47),(1.02 , 0.12),(5.40318530718 , -0.37),(2.45 , -0.78),(4.79318530718 , -1.16),(5.97318530718 , 1.25),(1.7 , -0.94),(4.32318530718 , 0.05),(4.58318530718 , -0.99),(4.60318530718 , 0.79),(3.96318530718 , -0.35),(4.27318530718 , -1.32),(2.55 , -0.69),(2.87 , 0.26),(6.27318530718 , 0.64),(6.11318530718 , 0.84),(2.1 , 1.08),(1.91 , 0.9),(5.48318530718 , -0.45),(2.51 , 0.44),(5.36318530718 , -0.8),(1.18 , 0.83),(3.49318530718 , 0.9),(1.85 , -0.46),(3.81318530718 , 0.02),(2.67 , -0.65),(2.77 , -0.22),(4.33318530718 , 0.27),(4.52318530718 , 0.31),(5.91318530718 , 0.64),(1.07 , -0.97),(2.63 , -0.28),(2.44 , -0.32),(0.36 , -0.86),(4.97318530718 , 0.89),(6.16318530718 , -0.65),(5.19318530718 , 0.56),(3.35318530718 , -0.05),(1.9 , 0.02),(2.54 , -1.17),(2.75 , 1.18),(5.23318530718 , -0.29),(0.42 , -0.06),(5.50318530718 , -1.15),(4.99318530718 , 0.1),(0.67 , 0.97),(3 , 0.76),(6.16318530718 , -1.12),(4.41318530718 , -0.02),(4.60318530718 , -0.74),(1.84 , -0.42),(0.57 , 0.1),(0.55 , 0.27),(3.34318530718 , 1.05),(1.49 , 0.52),(0.38 , 0.04),(1.94 , 1.33),(4.89318530718 , 0.41),(2.06 , 0.6),(1.06 , -0.54),(2.92 , -0.37),(0.53 , -1.21),(0.69 , 1.35),(3.61318530718 , -0.48),(1.31 , 1.19),(0.21 , -0.72),(0.26 , -1),(3.03 , 0.54),(3.42318530718 , 0.01),(1.97 , 1.48),(4.54318530718 , 0.93),(3.09 , 0.6),(4.45318530718 , -0.28),(3.22318530718 , -0.56),(1.46 , -0.48),(0.69 , -1.09),(0.13 , -0.66),(3.87318530718 , 0.05),(1.23 , -0.62),(0.67 , 0.89),(3.19395253115 , -0.0415970138392),(3.14193202317 , -0.0418830539111),(3.19031642854 , 0.0418874172342)} (1 row) pgsphere-1.5.1/expected/version.out000066400000000000000000000001661461140101500173460ustar00rootroot00000000000000-- Check current pgsphere version SELECT pg_sphere_version(); pg_sphere_version ------------------- 1.5.1 (1 row) pgsphere-1.5.1/gnomo.sql.in000066400000000000000000000010631461140101500155710ustar00rootroot00000000000000-- gnomonic projection and its inverse CREATE OR REPLACE FUNCTION gnomonic_proj(spoint, spoint) RETURNS point AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION gnomonic_proj(spoint, spoint) IS 'gnomonic projection, the second argument is the tangential point'; CREATE OR REPLACE FUNCTION gnomonic_inv(point, spoint) RETURNS spoint AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION gnomonic_inv(point, spoint) IS 'inverse of gnomonic projection, the second argument is the tangential point'; pgsphere-1.5.1/healpix.sql.in000066400000000000000000000103421461140101500161040ustar00rootroot00000000000000-- conversions to / from Healpix indexing CREATE OR REPLACE FUNCTION nest2ring(integer, bigint) RETURNS bigint AS 'MODULE_PATHNAME', 'pg_nest2ring' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION nest2ring(integer, bigint) IS 'converts nested Healpix index to a ring Healpix index for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION ring2nest(integer, bigint) RETURNS bigint AS 'MODULE_PATHNAME', 'pg_ring2nest' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION ring2nest(integer, bigint) IS 'converts ringe Healpix index to a nested Healpix index for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION healpix_convert_nest(integer, integer, bigint) RETURNS bigint AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION healpix_convert_nest(integer, integer, bigint) IS 'converts nested Healpix index (last argument) from level of second argument to level of first argument'; CREATE OR REPLACE FUNCTION healpix_convert_ring(integer, integer, bigint) RETURNS bigint AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION healpix_convert_ring(integer, integer, bigint) IS 'converts ring Healpix index (last argument) from level of second argument to level of first argument'; CREATE OR REPLACE FUNCTION nside2order(bigint) RETURNS integer AS 'MODULE_PATHNAME', 'pg_nside2order' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION nside2order(bigint) IS 'returns integer part of base-two logarithm of argument for powers of two up to 29'; CREATE OR REPLACE FUNCTION order2nside(integer) RETURNS bigint AS 'MODULE_PATHNAME', 'pg_order2nside' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION order2nside(integer) IS 'returns power of two for non-negative values up to 29'; CREATE OR REPLACE FUNCTION nside2npix(bigint) RETURNS bigint AS 'MODULE_PATHNAME', 'pg_nside2npix' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION nside2npix(bigint) IS 'returns 12 * nside ^ 2, the number of Healpix elements for the nside parameter'; CREATE OR REPLACE FUNCTION npix2nside(bigint) RETURNS bigint AS 'MODULE_PATHNAME', 'pg_npix2nside' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION npix2nside(bigint) IS 'returns the nside parameter correspondig to the number of Healpix elements'; CREATE OR REPLACE FUNCTION healpix_nest(integer, spoint) RETURNS bigint AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION healpix_nest(integer, spoint) IS 'nested Healpix index of a spherical point for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION healpix_ring(integer, spoint) RETURNS bigint AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION healpix_ring(integer, spoint) IS 'Healpix ring index of a spherical point for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION centre_of_healpix_nest(integer, bigint) RETURNS spoint AS 'MODULE_PATHNAME', 'inv_healpix_nest' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION centre_of_healpix_nest(integer, bigint) IS 'spherical point designating the centre of a nested Healpix element for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION centre_of_healpix_ring(integer, bigint) RETURNS spoint AS 'MODULE_PATHNAME', 'inv_healpix_ring' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION centre_of_healpix_ring(integer, bigint) IS 'spherical point designating the centre of a ring Healpix element for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION center_of_healpix_nest(integer, bigint) RETURNS spoint AS 'MODULE_PATHNAME', 'inv_healpix_nest' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION center_of_healpix_nest(integer, bigint) IS 'spherical point designating the center of a nested Healpix element for the specified integer level (first argument)'; CREATE OR REPLACE FUNCTION center_of_healpix_ring(integer, bigint) RETURNS spoint AS 'MODULE_PATHNAME', 'inv_healpix_ring' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION center_of_healpix_ring(integer, bigint) IS 'spherical point designating the center of a ring Healpix element for the specified integer level (first argument)'; pgsphere-1.5.1/healpix_bare/000077500000000000000000000000001461140101500157475ustar00rootroot00000000000000pgsphere-1.5.1/healpix_bare/LICENSE000066400000000000000000000032121461140101500167520ustar00rootroot00000000000000Copyright (C) 1997-2019 Krzysztof M. Gorski, Eric Hivon, Martin Reinecke, Benjamin D. Wandelt, Anthony J. Banday, Matthias Bartelmann, Reza Ansari & Kenneth M. Ganga Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. pgsphere-1.5.1/healpix_bare/NEWS000066400000000000000000000000541461140101500164450ustar00rootroot00000000000000Version 1.0 (March 2019): initial release pgsphere-1.5.1/healpix_bare/README000066400000000000000000000027651461140101500166410ustar00rootroot00000000000000This package implements a small subset of routines for working with the HEALPix tesselation of the sphere. For information about HEALPix, see the publication by K.M. Gorski et al., 2005, Ap.J., 622, p.759 (http://adsabs.harvard.edu/abs/2005ApJ...622..759G) More comprehensive software packages supporting HEALPix, as well as extensive documentation and references, are available at https://healpix.sourceforge.io/. Compilation =========== gcc -O2 healpix_bare.c -std=c99 test.c -lm clang -O2 healpix_bare.c -std=c99 test.c -lm icc -O2 healpix_bare.c -std=c99 test.c -lm Notes ===== This package is designed to cover a small set of frequently used HEALPix-related routines, which are implemented with a focus on robustness, accuracy and clarity. They have good performance, but are not heavily tuned to keep the code simple - the full-featured, GPL-licensed Healpix Fortran and C++ libraries (available via the link above) will be more efficient in most situations. The motivation for this package is to give developers of BSD-licensed Healpix-related codes a reliable starting point, so that they don't have to re-implement the central algorithms (like conversions between pixel index and angular coordinates), which are nontrivial to do correctly for all corner cases. Acknowledgements ================ If you are using this code in your own packages, please consider citing the original paper in your publications: K.M. Gorski et al., 2005, Ap.J., 622, p.759 (http://adsabs.harvard.edu/abs/2005ApJ...622..759G) pgsphere-1.5.1/healpix_bare/healpix_bare.c000066400000000000000000000230641461140101500205430ustar00rootroot00000000000000/* ----------------------------------------------------------------------------- * * Copyright (C) 1997-2019 Krzysztof M. Gorski, Eric Hivon, Martin Reinecke, * Benjamin D. Wandelt, Anthony J. Banday, * Matthias Bartelmann, * Reza Ansari & Kenneth M. Ganga * * Implementation of the Healpix bare bones C library * * Licensed under a 3-clause BSD style license - see LICENSE * * For more information on HEALPix and additional software packages, see * https://healpix.sourceforge.io/ * * If you are using this code in your own packages, please consider citing * the original paper in your publications: * K.M. Gorski et al., 2005, Ap.J., 622, p.759 * (http://adsabs.harvard.edu/abs/2005ApJ...622..759G) * *----------------------------------------------------------------------------*/ #include #include "healpix_bare.h" #define pi 3.141592653589793238462643383279502884197 static const int jrll[] = { 2,2,2,2,3,3,3,3,4,4,4,4 }; static const int jpll[] = { 1,3,5,7,0,2,4,6,1,3,5,7 }; /* conversions between continuous coordinate systems */ typedef struct { double z, s, phi; } tloc; /*! A structure describing the continuous Healpix coordinate system. \a f takes values in [0;11], \a x and \a y lie in [0.0; 1.0]. */ typedef struct { double x, y; int32_t f; } t_hpc; static t_hpc loc2hpc (tloc loc) { double za = fabs(loc.z); double x = loc.phi*(1./(2.*pi)); if (x<0.) x += (int64_t)x + 1.; else if (x>=1.) x -= (int64_t)x; double tt = 4.*x; if (za<=2./3.) /* Equatorial region */ { double temp1 = 0.5+tt; // [0.5; 4.5) double temp2 = loc.z*0.75; // [-0.5; +0.5] double jp = temp1-temp2; /* index of ascending edge line */ // [0; 5) double jm = temp1+temp2; /* index of descending edge line */ // [0; 5) int ifp = (int)jp; /* in {0,4} */ int ifm = (int)jm; return (t_hpc){jm-ifm, 1+ifp - jp, (ifp==ifm) ? (ifp|4) : ((ifp=4) ntt=3; double tp = tt-ntt; // [0;1) double tmp = loc.s/sqrt((1.+za)*(1./3.)); // FIXME optimize! double jp = tp*tmp; /* increasing edge line index */ double jm = (1.0-tp)*tmp; /* decreasing edge line index */ if (jp>1.) jp = 1.; /* for points too close to the boundary */ if (jm>1.) jm = 1.; return (loc.z >= 0) ? (t_hpc){1.-jm, 1.-jp, ntt} : (t_hpc){jp, jm, ntt+8}; } static tloc hpc2loc (t_hpc hpc) { double jr = jrll[hpc.f] - hpc.x - hpc.y; if (jr<1.) { double tmp = jr*jr*(1./3.); double z = 1. - tmp; double s = sqrt(tmp*(2.-tmp)); double phi = (pi*0.25)*(jpll[hpc.f] + (hpc.x-hpc.y)/jr); return (tloc){z,s,phi}; } else if (jr>3.) { jr = 4.-jr; double tmp = jr*jr*(1./3.); double z = tmp - 1.; double s = sqrt(tmp*(2.-tmp)); double phi = (pi*0.25)*(jpll[hpc.f] + (hpc.x-hpc.y)/jr); return (tloc){z,s,phi}; } else { double z = (2.-jr)*(2./3.); double s = sqrt((1.+z)*(1.-z)); double phi = (pi*0.25)*(jpll[hpc.f] + hpc.x - hpc.y); return (tloc){z,s,phi}; } } static tloc ang2loc(t_ang ang) { double cth=cos(ang.theta), sth=sin(ang.theta); if (sth<0) { sth=-sth; ang.phi+=pi; } return (tloc){cth, sth, ang.phi}; } static t_ang loc2ang(tloc loc) { return (t_ang){atan2(loc.s,loc.z), loc.phi}; } static tloc vec2loc(t_vec vec) { double vlen=sqrt(vec.x*vec.x+vec.y*vec.y+vec.z*vec.z); double cth = vec.z/vlen; double sth = sqrt(vec.x*vec.x+vec.y*vec.y)/vlen; return (tloc){cth,sth,atan2(vec.y,vec.x)}; } static t_vec loc2vec(tloc loc) { return (t_vec){loc.s*cos(loc.phi), loc.s*sin(loc.phi), loc.z}; } t_vec ang2vec(t_ang ang) { return loc2vec(ang2loc(ang)); } t_ang vec2ang(t_vec vec) { return (t_ang) {atan2(sqrt(vec.x*vec.x+vec.y*vec.y),vec.z), atan2(vec.y,vec.x)}; } /* conversions between discrete coordinate systems */ static int64_t isqrt(int64_t v) { int64_t res = sqrt(v+0.5); if (v<((int64_t)(1)<<50)) return res; if (res*res>v) --res; else if ((res+1)*(res+1)<=v) ++res; return res; } static int64_t spread_bits (int64_t v) { int64_t res = v & 0xffffffff; res = (res^(res<<16)) & 0x0000ffff0000ffff; res = (res^(res<< 8)) & 0x00ff00ff00ff00ff; res = (res^(res<< 4)) & 0x0f0f0f0f0f0f0f0f; res = (res^(res<< 2)) & 0x3333333333333333; res = (res^(res<< 1)) & 0x5555555555555555; return res; } static int64_t compress_bits (int64_t v) { int64_t res = v & 0x5555555555555555; res = (res^(res>> 1)) & 0x3333333333333333; res = (res^(res>> 2)) & 0x0f0f0f0f0f0f0f0f; res = (res^(res>> 4)) & 0x00ff00ff00ff00ff; res = (res^(res>> 8)) & 0x0000ffff0000ffff; res = (res^(res>>16)) & 0x00000000ffffffff; return res; } /*! A structure describing the discrete Healpix coordinate system. \a f takes values in [0;11], \a x and \a y lie in [0; nside[. */ typedef struct { int64_t x, y; int32_t f; } t_hpd; static int64_t hpd2nest (int64_t nside, t_hpd hpd) { return (hpd.f*nside*nside) + spread_bits(hpd.x) + (spread_bits(hpd.y)<<1); } static t_hpd nest2hpd (int64_t nside, int64_t pix) { int64_t npface_=nside*nside, p2=pix&(npface_-1); return (t_hpd){compress_bits(p2), compress_bits(p2>>1), pix/npface_}; } static int64_t hpd2ring (int64_t nside_, t_hpd hpd) { int64_t nl4 = 4*nside_; int64_t jr = (jrll[hpd.f]*nside_) - hpd.x - hpd.y - 1; if (jrnl4) ? jp-nl4 : ((jp<1) ? jp+nl4 : jp); return 2*jr*(jr-1) + jp - 1; } else if (jr > 3*nside_) { jr = nl4-jr; int64_t jp = (jpll[hpd.f]*jr + hpd.x - hpd.y + 1) / 2; jp = (jp>nl4) ? jp-nl4 : ((jp<1) ? jp+nl4 : jp); return 12*nside_*nside_ - 2*(jr+1)*jr + jp - 1; } else { int64_t jp = (jpll[hpd.f]*nside_ + hpd.x - hpd.y + 1 + ((jr-nside_)&1)) / 2; jp = (jp>nl4) ? jp-nl4 : ((jp<1) ? jp+nl4 : jp); return 2*nside_*(nside_-1) + (jr-nside_)*nl4 + jp - 1; } } static t_hpd ring2hpd (int64_t nside_, int64_t pix) { int64_t ncap_=2*nside_*(nside_-1); int64_t npix_=12*nside_*nside_; if (pix>1; /* counted from North pole */ int64_t iphi = (pix+1) - 2*iring*(iring-1); int64_t face = (iphi-1)/iring; int64_t irt = iring - (jrll[face]*nside_) + 1; int64_t ipt = 2*iphi- jpll[face]*iring -1; if (ipt>=2*nside_) ipt-=8*nside_; return (t_hpd) {(ipt-irt)>>1, (-(ipt+irt))>>1, face}; } else if (pix<(npix_-ncap_)) /* Equatorial region */ { int64_t ip = pix - ncap_; int64_t iring = (ip/(4*nside_)) + nside_; /* counted from North pole */ int64_t iphi = (ip%(4*nside_)) + 1; int64_t kshift = (iring+nside_)&1; int64_t ire = iring-nside_+1; int64_t irm = 2*nside_+2-ire; int64_t ifm = (iphi - ire/2 + nside_ -1) / nside_; int64_t ifp = (iphi - irm/2 + nside_ -1) / nside_; int64_t face = (ifp==ifm) ? (ifp|4) : ((ifp=2*nside_) ipt-=8*nside_; return (t_hpd) {(ipt-irt)>>1, (-(ipt+irt))>>1, face}; } else /* South Polar cap */ { int64_t ip = npix_ - pix; int64_t iring = (1+isqrt(2*ip-1))>>1; /* counted from South pole */ int64_t iphi = 4*iring + 1 - (ip - 2*iring*(iring-1)); int64_t face=8+(iphi-1)/iring; int64_t irt = 4*nside_ - iring - (jrll[face]*nside_) + 1; int64_t ipt = 2*iphi- jpll[face]*iring -1; if (ipt>=2*nside_) ipt-=8*nside_; return (t_hpd) {(ipt-irt)>>1, (-(ipt+irt))>>1, face}; } } int64_t nest2ring(int64_t nside, int64_t ipnest) { if ((nside&(nside-1))!=0) return -1; return hpd2ring (nside, nest2hpd (nside, ipnest)); } int64_t ring2nest(int64_t nside, int64_t ipring) { if ((nside&(nside-1))!=0) return -1; return hpd2nest (nside, ring2hpd (nside, ipring)); } /* mixed conversions */ static t_hpd loc2hpd (int64_t nside_, tloc loc) { t_hpc tmp = loc2hpc(loc); return (t_hpd){(tmp.x*nside_), (tmp.y*nside_), tmp.f}; } static tloc hpd2loc (int64_t nside_, t_hpd hpd) { double xns = 1./nside_; t_hpc tmp = (t_hpc){(hpd.x+0.5)*xns,(hpd.y+0.5)*xns,hpd.f}; return hpc2loc(tmp); } int64_t npix2nside(int64_t npix) { int64_t res = isqrt(npix/12); return (res*res*12==npix) ? res : -1; } int64_t nside2npix(int64_t nside) { return 12*nside*nside; } double vec_angle(t_vec v1, t_vec v2) { t_vec cross = { v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x }; double len_cross = sqrt(cross.x*cross.x + cross.y*cross.y + cross.z*cross.z); double dot = v1.x*v2.x + v1.y*v2.y + v1.z*v2.z; return atan2 (len_cross, dot); } int64_t ang2ring(int64_t nside, t_ang ang) { return hpd2ring(nside, loc2hpd(nside, ang2loc(ang))); } int64_t ang2nest(int64_t nside, t_ang ang) { return hpd2nest(nside, loc2hpd(nside, ang2loc(ang))); } int64_t vec2ring(int64_t nside, t_vec vec) { return hpd2ring(nside, loc2hpd(nside, vec2loc(vec))); } int64_t vec2nest(int64_t nside, t_vec vec) { return hpd2nest(nside, loc2hpd(nside, vec2loc(vec))); } t_ang ring2ang(int64_t nside, int64_t ipix) { return loc2ang(hpd2loc(nside, ring2hpd(nside, ipix))); } t_ang nest2ang(int64_t nside, int64_t ipix) { return loc2ang(hpd2loc(nside, nest2hpd(nside, ipix))); } t_vec ring2vec(int64_t nside, int64_t ipix) { return loc2vec(hpd2loc(nside, ring2hpd(nside, ipix))); } t_vec nest2vec(int64_t nside, int64_t ipix) { return loc2vec(hpd2loc(nside, nest2hpd(nside, ipix))); } pgsphere-1.5.1/healpix_bare/healpix_bare.h000066400000000000000000000104561461140101500205510ustar00rootroot00000000000000/* ----------------------------------------------------------------------------- * * Copyright (C) 1997-2019 Krzysztof M. Gorski, Eric Hivon, Martin Reinecke, * Benjamin D. Wandelt, Anthony J. Banday, * Matthias Bartelmann, * Reza Ansari & Kenneth M. Ganga * * Public interface of the Healpix bare bones C library * * Licensed under a 3-clause BSD style license - see LICENSE * * For more information on HEALPix and additional software packages, see * https://healpix.sourceforge.io/ * * If you are using this code in your own packages, please consider citing * the original paper in your publications: * K.M. Gorski et al., 2005, Ap.J., 622, p.759 * (http://adsabs.harvard.edu/abs/2005ApJ...622..759G) * *----------------------------------------------------------------------------*/ #ifndef HEALPIX_BARE_H #define HEALPIX_BARE_H #include #ifdef __cplusplus extern "C" { #endif /* This code is written in C99; you may have to adjust your compiler flags. */ /* Continuous coordinate systems */ /* Admissible values for theta (definition see below) 0 <= theta <= pi Admissible values for phi (definition see below) In principle unconstrained, but best accuracy is obtained for -2*pi <= phi <= 2*pi */ /*! A structure describing a location on the sphere. \a Theta is the co-latitude in radians (0 at the North Pole, increasing to pi at the South Pole. \a Phi is the azimuth in radians. */ typedef struct { double theta, phi; } t_ang; /*! A structure describing a 3-vector with coordinates \a x, \a y and \a z.*/ typedef struct { double x, y, z; } t_vec; /*! Returns a normalized 3-vector pointing in the same direction as \a ang. */ t_vec ang2vec(t_ang ang); /*! Returns a t_ang describing the same direction as the 3-vector \a vec. \a vec need not be normalized. */ t_ang vec2ang(t_vec vec); /* Discrete coordinate systems */ /* Admissible values for nside parameters: any integer power of 2 with 1 <= nside <= 1<<29 Admissible values for pixel indices: 0 <= idx < 12*nside*nside */ /*! Returns the RING pixel index of pixel \a ipnest at resolution \a nside. On error, returns -1. */ int64_t nest2ring(int64_t nside, int64_t ipnest); /*! Returns the NEST pixel index of pixel \a ipring at resolution \a nside. On error, returns -1. */ int64_t ring2nest(int64_t nside, int64_t ipring); /* Conversions between continuous and discrete coordinate systems */ /*! Returns the pixel number in NEST scheme at resolution \a nside, which contains the position \a ang. */ int64_t ang2nest(int64_t nside, t_ang ang); /*! Returns the pixel number in RING scheme at resolution \a nside, which contains the position \a ang. */ int64_t ang2ring(int64_t nside, t_ang ang); /*! Returns a t_ang corresponding to the angular position of the center of pixel \a ipix in NEST scheme at resolution \a nside. */ t_ang nest2ang(int64_t nside, int64_t ipix); /*! Returns a t_ang corresponding to the angular position of the center of pixel \a ipix in RING scheme at resolution \a nside. */ t_ang ring2ang(int64_t nside, int64_t ipix); /*! Returns the pixel number in NEST scheme at resolution \a nside, which contains the direction described the 3-vector \a vec. */ int64_t vec2nest(int64_t nside, t_vec vec); /*! Returns the pixel number in RING scheme at resolution \a nside, which contains the direction described the 3-vector \a vec. */ int64_t vec2ring(int64_t nside, t_vec vec); /*! Returns a normalized 3-vector pointing in the direction of the center of pixel \a ipix in NEST scheme at resolution \a nside. */ t_vec nest2vec(int64_t nside, int64_t ipix); /*! Returns a normalized 3-vector pointing in the direction of the center of pixel \a ipix in RING scheme at resolution \a nside. */ t_vec ring2vec(int64_t nside, int64_t ipix); /* Miscellaneous utility routines */ /*! Returns \a 12*nside*nside. */ int64_t nside2npix(int64_t nside); /*! Returns \a sqrt(npix/12) if this is an integer number, otherwise \a -1. */ int64_t npix2nside(int64_t npix); /*! Returns the angle (in radians) between the vectors \a v1 and \a v2. The result is accurate even for angles close to 0 and pi. */ double vec_angle(t_vec v1, t_vec v2); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* HEALPIX_REFERENCE_H */ pgsphere-1.5.1/healpix_bare/test.c000066400000000000000000000103561461140101500170770ustar00rootroot00000000000000/* ----------------------------------------------------------------------------- * * Copyright (C) 1997-2019 Krzysztof M. Gorski, Eric Hivon, Martin Reinecke, * Benjamin D. Wandelt, Anthony J. Banday, * Matthias Bartelmann, * Reza Ansari & Kenneth M. Ganga * * Test for the Healpix bare bones C library * * Licensed under a 3-clause BSD style license - see LICENSE * * For more information on HEALPix and additional software packages, see * https://healpix.sourceforge.io/ * * If you are using this code in your own packages, please consider citing * the original paper in your publications: * K.M. Gorski et al., 2005, Ap.J., 622, p.759 * (http://adsabs.harvard.edu/abs/2005ApJ...622..759G) * *----------------------------------------------------------------------------*/ #include #include #include #include #include #include "healpix_bare.h" static void error_check(int64_t nside, int64_t ipix, int64_t ip1) { if (ip1 != ipix) { printf("Error0: %" PRId64 " %" PRId64 " %" PRId64 "\n", nside, ipix, ip1); abort(); } } static void test2_helper1 (int64_t nside, int64_t dpix, int64_t epix) { /* Find the number of pixels in the full map */ for (int64_t ipix = 0; ipix < epix; ipix +=dpix) error_check(nside, ipix, ring2nest(nside, nest2ring(nside, ipix))); for (int64_t ipix = 0; ipix < epix; ipix +=dpix) error_check(nside, ipix, ang2nest(nside, nest2ang(nside, ipix))); for (int64_t ipix = 0; ipix < epix; ipix +=dpix) error_check(nside, ipix, vec2nest(nside, nest2vec(nside, ipix))); } static void test2_helper2 (int64_t nside, int64_t dpix) { /* Find the number of pixels in the full map */ int64_t npix = nside2npix(nside); for (int64_t ipix = 0; ipix < npix; ipix +=dpix) error_check(nside, ipix, ang2ring(nside, ring2ang(nside, ipix))); for (int64_t ipix = 0; ipix < npix; ipix +=dpix) error_check(nside, ipix, vec2ring(nside, ring2vec(nside, ipix))); } static void test2(void) { printf("Starting basic C Healpix pixel routines test\n"); for (int i=0; i<=29; ++i) { int64_t nside = 1LL<12*nside*nside) epix = 12*nside*nside; printf("Nside: %" PRId64 "\n",nside); test2_helper1(nside,nside*nside/123456+1, npix); test2_helper1(nside, 1, epix); test2_helper2(nside,nside*nside/123456+1); } printf("test completed\n\n"); } static void test3(void) { printf("Starting nontrivial C Healpix pixel routines test\n"); int64_t nside = 1024; int64_t dpix = 23; /* Find the number of pixels in the full map */ int64_t npix = nside2npix(nside); printf("Number of pixels in full map: %ld\n", npix); printf("dpix: %ld\n", dpix); printf("Nest -> ang -> vec -> ang -> Ring -> Nest\n"); for (int64_t ipix = 0; ipix < npix; ipix +=dpix) error_check(nside, ipix, ring2nest(nside, ang2ring(nside, vec2ang(ang2vec(nest2ang(nside, ipix)))))); printf("Ring -> ang -> Nest -> Ring\n"); for (int64_t ipix = 0; ipix < npix; ipix +=dpix) error_check(nside, ipix, nest2ring(nside,ang2nest(nside, ring2ang(nside, ipix)))); printf("Nest -> vec -> Ring -> Nest\n"); for (int64_t ipix = 0; ipix < npix; ipix +=dpix) error_check(nside, ipix, ring2nest(nside,vec2ring(nside,nest2vec(nside, ipix)))); printf("Ring -> vec -> Nest -> Ring\n"); for (int64_t ipix = 0; ipix < npix; ipix +=dpix) error_check(nside, ipix, nest2ring(nside,vec2nest(nside,ring2vec(nside, ipix)))); printf("%" PRId64 "\n", nside); printf("test completed\n\n"); } static void test_ang(void) { printf("Starting vector angle test\n"); for (double i=0; i<10; i+=0.01) { t_vec v1 = { i,10-i,sin(i) }, v2 = { 3-1.5*i, sqrt(i), i*0.3 }; double dot = v1.x*v2.x + v1.y*v2.y + v1.z*v2.z, l1 = sqrt(v1.x*v1.x+v1.y*v1.y+v1.z*v1.z), l2 = sqrt(v2.x*v2.x+v2.y*v2.y+v2.z*v2.z); double ang = acos(dot/(l1*l2)); if (fabs(ang - vec_angle(v1,v2))>1e-13) printf("error in vector angle test: %e %e\n", ang, ang-vec_angle(v1, v2)); } printf("test completed\n\n"); } int main(void) { test2(); test3(); test_ang(); return 0; } pgsphere-1.5.1/pg_sphere.control000066400000000000000000000002721461140101500167030ustar00rootroot00000000000000# pg_sphere extension comment = 'spherical objects with useful functions, operators and index support' default_version = '1.5.1' module_pathname = '$libdir/pg_sphere' relocatable = true pgsphere-1.5.1/pg_sphere_head.sql.in000066400000000000000000000001531461140101500174060ustar00rootroot00000000000000-- complain if this script is run via psql \echo Use "CREATE EXTENSION pg_sphere" to load this file. \quit pgsphere-1.5.1/pgindent-excludes.list000066400000000000000000000000521461140101500176400ustar00rootroot00000000000000pgs_process_moc.h pgs_healpix.h pgs_moc.h pgsphere-1.5.1/pgindent-typedefs.list000066400000000000000000000051301461140101500176510ustar00rootroot00000000000000align_val_t allocator_type __alloc_rebind ArrayType AttrDefault AttrNumber _Base_ptr BlockNumber Box3D BpChar bpoint BrinDesc BrinOpcInfo brin_serialize_callback_type BrinValues __builtin_va_list _Char_alloc_type char_type CommonEntry __compar_fn_t ConsiderSplitContext _Const_Base_ptr __const_iterator const_iterator _Const_Link_type const_pointer ConstrCheck const_reference const_reverse_iterator const_void_pointer coord_t CPoint Datum difference_type _DistanceType div_t DomainConstraintCache double_t __dso_handle __enable_if_t false> false_type __FILE FILE first_type flex_int16_t flex_uint8_t float4 float8 float_t FmgrInfo fmNodePtr FormData_pg_attribute __fpos_t fpos_t FunctionCallInfo GISTENTRY GistEntryVector GISTPageOpaque GISTPageOpaqueData GIST_SPLITVEC GiSTSPointKey __gnuc_va_list Healpix_Base2 hpint64 insert_return_type int16 __int16_t int16_t int32 __int32_t int32_t int64 __int64_t int64_t int8 __int8_t int8_t int_fast16_t int_fast32_t int_fast64_t int_fast8_t __int_least16_t int_least16_t __int_least32_t int_least32_t __int_least64_t int_least64_t __int_least8_t int_least8_t __intmax_t intmax_t intptr_t int_type _IO_lock_t iostate ItemIdData iterator iterator_category iterator_type key_compare key_type layout_vec ldiv_t _Link_type lldiv_t LocationIndex __make_not_void map_const_iter map_iterator mapped_type map_rev_iter max_align_t __mbstate_t mbstate_t MemoryContext moc_interval moc_map moc_map_entry moc_out_data moc_tree_entry NameData _Node_allocator NodeTag node_type NullableDatum nullptr_t __off64_t OffsetNumber __off_t Oid ostream __ostream_type other output_map Page PageGistNSN PageHeader PageHeaderData PageXLogRecPtr Pg_finfo_record PGFunction Pg_magic_struct pgs_error_handler phasevec Point Point3D __pointer pointer Pointer ptrdiff_t __ptr_rebind rebind rebind_alloc reference Relation _Rep_type reverse_iterator rintv_iter rnode_iter rtype SBOX SCIRCLE second_type _Self SELLIPSE SEuler Size size_t size_type SLine Smoc SPATH SplitInterval SPoint SPOLY StrategyNumber streamsize string __sv_type t_ang tdiff text _Tp_alloc_type TransactionId true_type tsize TupleConstr TupleDesc __type type TypeCacheEntry uchar uint16 __uint16_t uint16_t uint32 __uint32_t uint32_t uint64 __uint64_t uint64_t uint8 __uint8_t uint8_t uint_fast16_t uint_fast32_t uint_fast64_t uint_fast8_t __uint_least16_t uint_least16_t __uint_least32_t uint_least32_t __uint_least64_t uint_least64_t __uint_least8_t uint_least8_t __uintmax_t uintmax_t uintptr_t va_list value_type varattrib_4b vec3 Vector3D wctrans_t wctype_t wint_t YY_BUFFER_STATE YY_CHAR yy_size_t yy_state_type YYSTYPE yytype_int16 yytype_int8 yytype_uint8 pgsphere-1.5.1/pgs_box.sql.in000066400000000000000000000725021461140101500161210ustar00rootroot00000000000000-- ************************** -- -- spherical box functions -- -- ************************** CREATE FUNCTION sbox(spoint, spoint) RETURNS sbox AS 'MODULE_PATHNAME', 'spherebox_in_from_points' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox(spoint, spoint) IS 'returns a spherical box from south-west corner(arg1) and north-east corner(arg2)'; CREATE FUNCTION sw(sbox) RETURNS spoint AS 'MODULE_PATHNAME', 'spherebox_sw' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sw(sbox) IS 'south-west corner of spherical box'; CREATE FUNCTION se(sbox) RETURNS spoint AS 'MODULE_PATHNAME', 'spherebox_se' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION se(sbox) IS 'south-east corner of spherical box'; CREATE FUNCTION nw(sbox) RETURNS spoint AS 'MODULE_PATHNAME', 'spherebox_nw' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION nw(sbox) IS 'north-west corner of spherical box'; CREATE FUNCTION ne(sbox) RETURNS spoint AS 'MODULE_PATHNAME', 'spherebox_ne' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION ne(sbox) IS 'north-east corner of spherical box'; CREATE FUNCTION area(sbox) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherebox_area' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION area(sbox) IS 'area of a spherical box'; -- -- circumference -- CREATE FUNCTION circum(sbox) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherebox_circ' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION circum(sbox) IS 'circumference of spherical box'; CREATE OPERATOR @-@ ( RIGHTARG = sbox, PROCEDURE = circum ); COMMENT ON OPERATOR @-@ (NONE, sbox) IS 'circumference of spherical box'; -- -- equal -- CREATE FUNCTION sbox_equal(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_equal(sbox, sbox) IS 'returns true, if spherical boxes are equal'; CREATE OPERATOR = ( LEFTARG = sbox, RIGHTARG = sbox, COMMUTATOR = =, NEGATOR = <>, PROCEDURE = sbox_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (sbox, sbox) IS 'true, if spherical boxes are equal'; -- -- not equal -- CREATE FUNCTION sbox_equal_neg (sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_equal_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_equal_neg (sbox, sbox) IS 'returns true, if spherical boxes are not equal'; CREATE OPERATOR <> ( LEFTARG = sbox, RIGHTARG = sbox, COMMUTATOR = <>, NEGATOR = =, PROCEDURE = sbox_equal_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (sbox, sbox) IS 'true, if spherical boxes are not equal'; -- -- box contains box -- CREATE FUNCTION sbox_contains_box(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_box' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_box(sbox, sbox) IS 'true if spherical box contains spherical box'; -- -- box is contained by box -- CREATE FUNCTION sbox_contains_box_com(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_box_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_box_com(sbox, sbox) IS 'true if spherical box contains spherical box'; -- -- box does not contain box -- CREATE FUNCTION sbox_contains_box_neg(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_box_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_box_neg(sbox, sbox) IS 'true if spherical box does not contain spherical box'; -- -- box is not contained by box -- CREATE FUNCTION sbox_contains_box_com_neg(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_box_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_box_com_neg(sbox, sbox) IS 'true if spherical box does not contain spherical box'; -- -- box overlaps box -- CREATE FUNCTION sbox_overlap_box(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_box' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_box(sbox, sbox) IS 'true if spherical box overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_overlap_box, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, sbox) IS 'true if spherical box overlap spherical box'; -- -- box does not overlap box -- CREATE FUNCTION sbox_overlap_box_neg(sbox, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_box_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_box_neg(sbox, sbox) IS 'true if spherical box does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_overlap_box_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sbox, sbox) IS 'true if spherical box does not overlap spherical box'; -- -- point is contained by box -- CREATE FUNCTION sbox_cont_point_com(spoint, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_point_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_cont_point_com(spoint, sbox) IS 'true if spherical point is contained by spherical box'; -- -- point is not contained by box -- CREATE FUNCTION sbox_cont_point_com_neg(spoint, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_point_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_cont_point_com_neg (spoint, sbox) IS 'true if spherical point is not contained by spherical box'; -- -- box contains point -- CREATE FUNCTION sbox_cont_point(sbox, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_cont_point (sbox, spoint) IS 'true if spherical box contains spherical point'; -- -- box does not contain point -- CREATE FUNCTION sbox_cont_point_neg(sbox, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_point_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_cont_point_neg (sbox, spoint) IS 'true if spherical box does not contain spherical point'; -- -- box contains circle -- CREATE FUNCTION sbox_contains_circle(sbox, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_circle(sbox, scircle) IS 'true if spherical box contains spherical circle'; -- -- circle is contained by box -- CREATE FUNCTION sbox_contains_circle_com(scircle, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_circle_com(scircle, sbox) IS 'true if spherical box contains spherical circle'; -- -- box does not contain circle -- CREATE FUNCTION sbox_contains_circle_neg(sbox, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_circle_neg(sbox, scircle) IS 'true if spherical box does not contain spherical circle'; -- -- circle is not contained by box -- CREATE FUNCTION sbox_contains_circle_com_neg(scircle, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_circle_com_neg(scircle, sbox) IS 'true if spherical box does not contain spherical circle'; -- -- circle contains box -- CREATE FUNCTION scircle_contains_box(scircle, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_box' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_box(scircle, sbox) IS 'true if spherical circle contains spherical box'; -- -- box is contained by circle -- CREATE FUNCTION scircle_contains_box_com(sbox, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_box_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_box_com(sbox, scircle) IS 'true if spherical circle contains spherical box'; -- -- circle does not contain box -- CREATE FUNCTION scircle_contains_box_neg(scircle, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_box_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_box_neg(scircle, sbox) IS 'true if spherical circle does not contain spherical box'; -- -- box is not contained by circle -- CREATE FUNCTION scircle_contains_box_com_neg(sbox, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_box_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_box_com_neg(sbox, scircle) IS 'true if spherical circle does not contain spherical box'; -- -- circle overlaps box -- CREATE FUNCTION sbox_overlap_circle(sbox, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_circle(sbox, scircle) IS 'true if spherical circle overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = sbox_overlap_circle, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, scircle) IS 'true if spherical circle overlap spherical box'; -- -- box overlaps circle -- CREATE FUNCTION sbox_overlap_circle_com(scircle, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_circle_com(scircle, sbox) IS 'true if spherical circle overlap spherical box'; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = sbox_overlap_circle_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (scircle, sbox) IS 'true if spherical circle overlap spherical box'; -- -- circle does not overlap box -- CREATE FUNCTION sbox_overlap_circle_neg(sbox, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_circle_neg(sbox, scircle) IS 'true if spherical circle does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = sbox_overlap_circle_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sbox, scircle) IS 'true if spherical circle does not overlap spherical box'; -- -- box does not overlap circle -- CREATE FUNCTION sbox_overlap_circle_com_neg(scircle, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_circle_com_neg(scircle, sbox) IS 'true if spherical circle does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = sbox_overlap_circle_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (scircle, sbox) IS 'true if spherical circle does not overlap spherical box'; -- -- box contains line -- CREATE FUNCTION sbox_contains_line(sbox, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_line(sbox, sline) IS 'true if spherical box contains spherical line'; -- -- line is contained by box -- CREATE FUNCTION sbox_contains_line_com(sline, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_line_com(sline, sbox) IS 'true if spherical box contains spherical line'; -- -- box does not contain line -- CREATE FUNCTION sbox_contains_line_neg(sbox, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_line_neg(sbox, sline) IS 'true if spherical box does not contain spherical line'; -- -- line is not contained by box -- CREATE FUNCTION sbox_contains_line_com_neg(sline, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_line_com_neg(sline, sbox) IS 'true if spherical box does not contain spherical line'; -- -- line overlaps box -- CREATE FUNCTION sbox_overlap_line(sbox, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_line(sbox, sline) IS 'true if spherical line overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = sline, PROCEDURE = sbox_overlap_line, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, sline) IS 'true if spherical line overlap spherical box'; -- -- box overlaps line -- CREATE FUNCTION sbox_overlap_line_com(sline, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_line_com(sline, sbox) IS 'true if spherical line overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sline, RIGHTARG = sbox, PROCEDURE = sbox_overlap_line_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sline, sbox) IS 'true if spherical line overlap spherical box'; -- -- line does not overlap box -- CREATE FUNCTION sbox_overlap_line_neg(sbox, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_line_neg(sbox, sline) IS 'true if spherical line does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sbox, RIGHTARG = sline, PROCEDURE = sbox_overlap_line_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sbox, sline) IS 'true if spherical line does not overlap spherical box'; -- -- box does not overlap line -- CREATE FUNCTION sbox_overlap_line_com_neg(sline, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_line_com_neg(sline, sbox) IS 'true if spherical line does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sline, RIGHTARG = sbox, PROCEDURE = sbox_overlap_line_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sline, sbox) IS 'true if spherical line does not overlap spherical box'; -- -- box contains ellipse -- CREATE FUNCTION sbox_contains_ellipse(sbox, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_ellipse(sbox, sellipse) IS 'true if spherical box contains spherical ellipse'; -- -- ellipse is contained by box -- CREATE FUNCTION sbox_contains_ellipse_com(sellipse, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_ellipse_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_ellipse_com(sellipse, sbox) IS 'true if spherical box contains spherical ellipse'; -- -- box does not contain ellipse -- CREATE FUNCTION sbox_contains_ellipse_neg(sbox, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_ellipse_neg(sbox, sellipse) IS 'true if spherical box does not contain spherical ellipse'; -- -- ellipse is not contained by box -- CREATE FUNCTION sbox_contains_ellipse_com_neg(sellipse, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_ellipse_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_ellipse_com_neg(sellipse, sbox) IS 'true if spherical box does not contain spherical ellipse'; -- -- ellipse contains box -- CREATE FUNCTION sellipse_contains_box(sellipse, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_box' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_box(sellipse, sbox) IS 'true if spherical ellipse contains spherical box'; -- -- box is contained by ellipse -- CREATE FUNCTION sellipse_contains_box_com(sbox, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_box_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_box_com(sbox, sellipse) IS 'true if spherical ellipse contains spherical box'; -- -- ellipse does not contain box -- CREATE FUNCTION sellipse_contains_box_neg(sellipse, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_box_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_box_neg(sellipse, sbox) IS 'true if spherical ellipse does not contain spherical box'; -- -- box is not contained by ellipse -- CREATE FUNCTION sellipse_contains_box_com_neg(sbox, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_box_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_box_com_neg(sbox, sellipse) IS 'true if spherical ellipse does not contain spherical box'; -- -- ellipse overlaps box -- CREATE FUNCTION sbox_overlap_ellipse(sbox, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_ellipse(sbox, sellipse) IS 'true if spherical ellipse overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sbox_overlap_ellipse, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, sellipse) IS 'true if spherical ellipse overlap spherical box'; -- -- box overlaps ellipse -- CREATE FUNCTION sbox_overlap_ellipse_com(sellipse, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_ellipse_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_ellipse_com(sellipse, sbox) IS 'true if spherical ellipse overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sbox_overlap_ellipse_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sellipse, sbox) IS 'true if spherical ellipse overlap spherical box'; -- -- ellipse does not overlap box -- CREATE FUNCTION sbox_overlap_ellipse_neg(sbox, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_ellipse_neg(sbox, sellipse) IS 'true if spherical ellipse does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sbox_overlap_ellipse_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sbox, sellipse) IS 'true if spherical ellipse does not overlap spherical box'; -- -- box does not overlap ellipse -- CREATE FUNCTION sbox_overlap_ellipse_com_neg(sellipse, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_ellipse_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_ellipse_com_neg(sellipse, sbox) IS 'true if spherical ellipse does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sbox_overlap_ellipse_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sellipse, sbox) IS 'true if spherical ellipse does not overlap spherical box'; -- -- box contains polygon -- CREATE FUNCTION sbox_contains_poly(sbox, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_poly(sbox, spoly) IS 'true if spherical box contains spherical polygon'; -- -- polygon is contained by box -- CREATE FUNCTION sbox_contains_poly_com(spoly, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_poly_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_poly_com(spoly, sbox) IS 'true if spherical box contains spherical polygon'; -- -- box does not contain polygon -- CREATE FUNCTION sbox_contains_poly_neg(sbox, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_poly_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_poly_neg(sbox, spoly) IS 'true if spherical box does not contain spherical polygon'; -- -- polygon is not contained by box -- CREATE FUNCTION sbox_contains_poly_com_neg(spoly, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_poly_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_poly_com_neg(spoly, sbox) IS 'true if spherical box does not contain spherical polygon'; -- -- polygon contains box -- CREATE FUNCTION spoly_contains_box(spoly, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_box' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_box(spoly, sbox) IS 'true if spherical polygon contains spherical box'; -- -- box is contained by polygon -- CREATE FUNCTION spoly_contains_box_com(sbox, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_box_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_box_com(sbox, spoly) IS 'true if spherical polygon contains spherical box'; -- -- polygon does not contain box -- CREATE FUNCTION spoly_contains_box_neg(spoly, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_box_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_box_neg(spoly, sbox) IS 'true if spherical polygon does not contain spherical box'; -- -- box is not contained by polygon -- CREATE FUNCTION spoly_contains_box_com_neg(sbox, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_box_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_box_com_neg(sbox, spoly) IS 'true if spherical polygon does not contain spherical box'; -- -- polygon overlaps box -- CREATE FUNCTION sbox_overlap_poly(sbox, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_poly(sbox, spoly) IS 'true if spherical polygon overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = sbox_overlap_poly, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, spoly) IS 'true if spherical polygon overlap spherical box'; -- -- box overlaps polygon -- CREATE FUNCTION sbox_overlap_poly_com(spoly, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_poly_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_poly_com(spoly, sbox) IS 'true if spherical polygon overlap spherical box'; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = sbox_overlap_poly_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoly, sbox) IS 'true if spherical polygon overlap spherical box'; -- -- polygon does not overlap box -- CREATE FUNCTION sbox_overlap_poly_neg(sbox, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_poly_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_poly_neg(sbox, spoly) IS 'true if spherical polygon does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = sbox_overlap_poly_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sbox, spoly) IS 'true if spherical polygon does not overlap spherical box'; -- -- box does not overlap polygon -- CREATE FUNCTION sbox_overlap_poly_com_neg(spoly, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_poly_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_poly_com_neg(spoly, sbox) IS 'true if spherical polygon does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = sbox_overlap_poly_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spoly, sbox) IS 'true if spherical polygon does not overlap spherical box'; -- -- box contains path -- CREATE FUNCTION sbox_contains_path(sbox, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_path(sbox, spath) IS 'true if spherical box contains spherical path'; -- -- path is contained by box -- CREATE FUNCTION sbox_contains_path_com(spath, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_path_com(spath, sbox) IS 'true if spherical box contains spherical path'; -- -- box does not contain path -- CREATE FUNCTION sbox_contains_path_neg(sbox, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_path_neg(sbox, spath) IS 'true if spherical box does not contain spherical path'; -- -- path is not contained by box -- CREATE FUNCTION sbox_contains_path_com_neg(spath, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_cont_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_contains_path_com_neg(spath, sbox) IS 'true if spherical box does not contain spherical path'; -- -- path overlaps box -- CREATE FUNCTION sbox_overlap_path(sbox, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_path(sbox, spath) IS 'true if spherical path overlap spherical box'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = spath, PROCEDURE = sbox_overlap_path, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, spath) IS 'true if spherical path overlap spherical box'; -- -- box overlaps path -- CREATE FUNCTION sbox_overlap_path_com(spath, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_path_com(spath, sbox) IS 'true if spherical path overlap spherical box'; CREATE OPERATOR && ( LEFTARG = spath, RIGHTARG = sbox, PROCEDURE = sbox_overlap_path_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spath, sbox) IS 'true if spherical path overlap spherical box'; -- -- path does not overlap box -- CREATE FUNCTION sbox_overlap_path_neg(sbox, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_path_neg(sbox, spath) IS 'true if spherical path does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = sbox, RIGHTARG = spath, PROCEDURE = sbox_overlap_path_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sbox, spath) IS 'true if spherical path does not overlap spherical box'; -- -- box does not overlap path -- CREATE FUNCTION sbox_overlap_path_com_neg(spath, sbox) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherebox_overlap_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sbox_overlap_path_com_neg(spath, sbox) IS 'true if spherical path does not overlap spherical box'; CREATE OPERATOR !&& ( LEFTARG = spath, RIGHTARG = sbox, PROCEDURE = sbox_overlap_path_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spath, sbox) IS 'true if spherical path does not overlap spherical box'; pgsphere-1.5.1/pgs_brin.sql.in000066400000000000000000000274121461140101500162630ustar00rootroot00000000000000 -------------------------------------------------------------------- -- BRIN support -- -------------------------------------------------------------------- -------------------------------- -- the Operators -- -------------------------------- CREATE FUNCTION spoint_overlaps_spherekey(spoint, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'spoint_overlaps_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spoint_contains_spherekey(spoint, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'spoint_contains_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spoint_iscontained_spherekey(spoint, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'spoint_iscontained_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION sbox_overlaps_spherekey(sbox, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'sbox_overlaps_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION sbox_contains_spherekey(sbox, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'sbox_contains_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION sbox_iscontained_spherekey(sbox, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'sbox_iscontained_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spherekey_overlaps_spherekey(spherekey, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'spherekey_overlaps_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spherekey_contains_spherekey(spherekey, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'spherekey_contains_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spherekey_iscontained_spherekey(spherekey, spherekey) RETURNS boolean AS 'MODULE_PATHNAME', 'spoint_iscontained_spherekey' LANGUAGE 'c' IMMUTABLE STRICT; CREATE OPERATOR && ( LEFTARG = spoint, RIGHTARG = spherekey, PROCEDURE = spoint_overlaps_spherekey, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoint, spherekey) IS 'true, if the spherical point overlaps a spherekey'; CREATE OPERATOR @> ( LEFTARG = spoint, RIGHTARG = spherekey, PROCEDURE = spoint_contains_spherekey, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoint, spherekey) IS 'true, if the spherical point contains a spherekey - just needed to define the OpFamily'; CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = spherekey, PROCEDURE = spoint_iscontained_spherekey, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, spherekey) IS 'true, if the spherical point is contained in a spherekey'; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = spherekey, PROCEDURE = sbox_overlaps_spherekey, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, spherekey) IS 'true, if the spherical box overlaps a spherekey'; CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = spherekey, PROCEDURE = sbox_contains_spherekey, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, spherekey) IS 'true, if the spherical box contains a spherekey'; CREATE OPERATOR <@ ( LEFTARG = sbox, RIGHTARG = spherekey, PROCEDURE = sbox_iscontained_spherekey, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sbox, spherekey) IS 'true, if the spherical box is contained in a spherekey'; CREATE OPERATOR && ( LEFTARG = spherekey, RIGHTARG = spherekey, PROCEDURE = spherekey_overlaps_spherekey, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spherekey, spherekey) IS 'true, if the spherekey overlaps another spherekey'; CREATE OPERATOR @> ( LEFTARG = spherekey, RIGHTARG = spherekey, PROCEDURE = spherekey_contains_spherekey, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoint, spherekey) IS 'true, if the spherekey contains another spherekey'; CREATE OPERATOR <@ ( LEFTARG = spherekey, RIGHTARG = spherekey, PROCEDURE = spherekey_iscontained_spherekey, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spherekey, spherekey) IS 'true, if the spherical point is contained in another spherekey'; --------------------------------------------- -- create operators with crossed datatypes -- --------------------------------------------- CREATE FUNCTION spherekey_overlaps_spoint(spherekey, spoint) RETURNS boolean AS $$ SELECT $2 && $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION spherekey_contains_spoint(spherekey, spoint) RETURNS boolean AS $$ SELECT $2 <@ $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION spherekey_iscontained_spoint(spherekey, spoint) RETURNS boolean AS $$ SELECT $2 @> $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION spherekey_overlaps_sbox(spherekey, sbox) RETURNS boolean AS $$ SELECT $2 && $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION spherekey_contains_sbox(spherekey, sbox) RETURNS boolean AS $$ SELECT $2 <@ $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION spherekey_iscontained_sbox(spherekey, sbox) RETURNS boolean AS $$ SELECT $2 @> $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE OPERATOR && ( LEFTARG = spherekey, RIGHTARG = spoint, PROCEDURE = spherekey_overlaps_spoint, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spherekey, spoint) IS 'true, if the spherekey overlaps a spoint'; CREATE OPERATOR @> ( LEFTARG = spherekey, RIGHTARG = spoint, PROCEDURE = spherekey_contains_spoint, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spherekey, spoint) IS 'true, if the spherekey contains a spherical point'; CREATE OPERATOR <@ ( LEFTARG = spherekey, RIGHTARG = spoint, PROCEDURE = spherekey_iscontained_spoint, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spherekey, spoint) IS 'true, if the spherekey is contained in a spherical point - just needed to define the OpFamily'; CREATE OPERATOR && ( LEFTARG = spherekey, RIGHTARG = sbox, PROCEDURE = spherekey_overlaps_sbox, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spherekey, sbox) IS 'true, if the spherekey overlaps a spherical point'; CREATE OPERATOR @> ( LEFTARG = spherekey, RIGHTARG = sbox, PROCEDURE = spherekey_contains_sbox, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spherekey, sbox) IS 'true, if the spherekey contains a spherical point'; CREATE OPERATOR <@ ( LEFTARG = spherekey, RIGHTARG = sbox, PROCEDURE = spherekey_iscontained_sbox, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spherekey, sbox) IS 'true, if the spherekey is contained in a spherical point'; ------------------------------------------------- -- create operators that will actually be used -- ------------------------------------------------- CREATE FUNCTION spoint_overlaps_sbox(spoint, sbox) RETURNS boolean AS 'MODULE_PATHNAME', 'spoint_overlaps_sbox' LANGUAGE 'c' IMMUTABLE STRICT; CREATE OPERATOR && ( LEFTARG = spoint, RIGHTARG = sbox, PROCEDURE = spoint_overlaps_sbox, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoint, sbox) IS 'true, if the spherical point overlaps a spherical box'; ------------------------------------------------------------ -- Complementar operators, needed for OpFamily definition -- ------------------------------------------------------------ CREATE FUNCTION sbox_overlaps_spoint(sbox, spoint) RETURNS boolean AS $$ SELECT $2 && $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE OPERATOR && ( LEFTARG = sbox, RIGHTARG = spoint, PROCEDURE = sbox_overlaps_spoint, COMMUTATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sbox, spoint) IS 'true, if the spherical box overlaps a spherical point'; CREATE FUNCTION sbox_iscontained_spoint(sbox, spoint) RETURNS boolean AS 'MODULE_PATHNAME', 'sbox_iscontained_spoint' LANGUAGE 'c' IMMUTABLE STRICT; CREATE OPERATOR <@ ( LEFTARG = sbox, RIGHTARG = spoint, PROCEDURE = sbox_iscontained_spoint, COMMUTATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE FUNCTION spoint_contains_sbox(spoint, sbox) RETURNS boolean AS $$ SELECT $2 <@ $1; $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE OPERATOR @> ( LEFTARG = spoint, RIGHTARG = sbox, PROCEDURE = spoint_contains_sbox, COMMUTATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); -------------------------------- -- the OpFamily -- -------------------------------- CREATE OPERATOR FAMILY brin_inclusion_spheric_ops USING brin; CREATE OR REPLACE FUNCTION spoint_brin_inclusion_add_value(internal, internal, internal, internal) RETURNS boolean AS 'MODULE_PATHNAME','spoint_brin_inclusion_add_value' LANGUAGE 'c'; CREATE OR REPLACE FUNCTION sbox_brin_inclusion_add_value(internal, internal, internal, internal) RETURNS boolean AS 'MODULE_PATHNAME','sbox_brin_inclusion_add_value' LANGUAGE 'c'; CREATE OPERATOR CLASS brin_spoint_inclusion_ops DEFAULT FOR TYPE spoint USING brin FAMILY brin_inclusion_spheric_ops AS FUNCTION 1 brin_inclusion_opcinfo(internal) , FUNCTION 2 spoint_brin_inclusion_add_value(internal, internal, internal, internal) , FUNCTION 3 brin_inclusion_consistent(internal, internal, internal) , FUNCTION 4 brin_inclusion_union(internal, internal, internal) , STORAGE spherekey; CREATE OPERATOR CLASS brin_sbox_inclusion_ops DEFAULT FOR TYPE sbox USING brin FAMILY brin_inclusion_spheric_ops AS FUNCTION 1 brin_inclusion_opcinfo(internal) , FUNCTION 2 sbox_brin_inclusion_add_value(internal, internal, internal, internal) , FUNCTION 3 brin_inclusion_consistent(internal, internal, internal) , FUNCTION 4 brin_inclusion_union(internal, internal, internal) , STORAGE spherekey; ALTER OPERATOR FAMILY brin_inclusion_spheric_ops USING brin ADD OPERATOR 3 &&(spherekey, spoint), OPERATOR 7 @>(spherekey, spoint), OPERATOR 8 <@(spherekey, spoint), OPERATOR 3 &&(spoint, spherekey), OPERATOR 7 @>(spoint, spherekey), OPERATOR 8 <@(spoint, spherekey), OPERATOR 3 &&(spherekey, sbox), OPERATOR 7 @>(spherekey, sbox), OPERATOR 8 <@(spherekey, sbox), OPERATOR 3 &&(sbox, spherekey), OPERATOR 7 @>(sbox, spherekey), OPERATOR 8 <@(sbox, spherekey), OPERATOR 3 &&(spherekey, spherekey), OPERATOR 7 @>(spherekey, spherekey), OPERATOR 8 <@(spherekey, spherekey), OPERATOR 3 &&(spoint, sbox), OPERATOR 3 &&(sbox, spoint), OPERATOR 7 @>(sbox, spoint), OPERATOR 7 @>(spoint, sbox), OPERATOR 8 <@(sbox, spoint), OPERATOR 8 <@(spoint, sbox), OPERATOR 3 &&(sbox, sbox), OPERATOR 7 @>(sbox, sbox), OPERATOR 8 <@(sbox, sbox); pgsphere-1.5.1/pgs_circle.sql.in000066400000000000000000000237521461140101500165750ustar00rootroot00000000000000-- **************************** -- -- spherical circle functions -- -- **************************** CREATE FUNCTION area(scircle) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherecircle_area' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION area(scircle) IS 'area of spherical circle'; CREATE FUNCTION radius(scircle) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherecircle_radius' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION radius(scircle) IS 'radius of spherical circle'; CREATE FUNCTION scircle(spoint, float8) RETURNS scircle AS 'MODULE_PATHNAME' , 'spherecircle_by_center' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle(spoint, float8) IS 'spherical circle with spherical point as center and float8 as radius in radians'; CREATE FUNCTION scircle_deg(spoint, float8) RETURNS scircle AS 'MODULE_PATHNAME' , 'spherecircle_by_center_deg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_deg(spoint, float8) IS 'spherical circle with spherical point as center and float8 as radius in degrees'; -- -- Casting point as circle -- CREATE FUNCTION scircle(spoint) RETURNS scircle AS 'MODULE_PATHNAME' , 'spherepoint_to_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle(spoint) IS 'spherical circle with radius 0 and spherical point as center'; CREATE CAST (spoint AS scircle) WITH FUNCTION scircle(spoint) AS IMPLICIT; -- ************************** -- -- spherical circle operators -- -- ************************** -- -- equal -- CREATE FUNCTION scircle_equal(scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_equal(scircle, scircle) IS 'returns true, if spherical circles are equal'; CREATE OPERATOR = ( LEFTARG = scircle, RIGHTARG = scircle, COMMUTATOR = = , NEGATOR = <>, PROCEDURE = scircle_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (scircle, scircle) IS 'true, if spherical circles are equal'; -- -- not equal -- CREATE FUNCTION scircle_equal_neg(scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_equal_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_equal_neg(scircle, scircle) IS 'returns true, if spherical circles are not equal'; CREATE OPERATOR <> ( LEFTARG = scircle, RIGHTARG = scircle, COMMUTATOR = <>, NEGATOR = = , PROCEDURE = scircle_equal_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (scircle, scircle) IS 'true, if spherical circles are not equal'; -- -- overlap -- CREATE FUNCTION scircle_overlap(scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_overlap' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_overlap(scircle, scircle) IS 'true if spherical circles overlap'; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_overlap, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (scircle, scircle) IS 'true if spherical circles overlap'; -- -- not overlap -- CREATE FUNCTION scircle_overlap_neg(scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_overlap_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_overlap_neg(scircle, scircle) IS 'true if spherical circles do not overlap'; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_overlap_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (scircle, scircle) IS 'true if spherical circles do not overlap'; -- -- center of circle -- CREATE FUNCTION center(scircle) RETURNS spoint AS 'MODULE_PATHNAME' , 'spherecircle_center' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION center(scircle) IS 'center of spherical circle'; CREATE OPERATOR @@ ( RIGHTARG = scircle, PROCEDURE = center ); COMMENT ON OPERATOR @@ (NONE , scircle) IS 'center of spherical circle'; -- -- circumference -- CREATE FUNCTION circum(scircle) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherecircle_circ' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION circum(scircle) IS 'circumference of spherical circle'; CREATE OPERATOR @-@ ( RIGHTARG = scircle, PROCEDURE = circum ); COMMENT ON OPERATOR @-@ (NONE , scircle) IS 'circumference of spherical circle'; -- -- circle is contained by circle -- CREATE FUNCTION scircle_contained_by_circle(scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_in_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contained_by_circle(scircle, scircle) IS 'true if spherical circle is contained by spherical circle'; -- -- circle is not contained by circle -- CREATE FUNCTION scircle_contained_by_circle_neg (scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_in_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contained_by_circle_neg (scircle, scircle) IS 'true if spherical circle is not contained by spherical circle'; -- -- circle contains circle -- CREATE FUNCTION scircle_contains_circle (scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_in_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_circle (scircle, scircle) IS 'true if spherical circle contains spherical circle'; -- -- circle does not contain circle -- CREATE FUNCTION scircle_contains_circle_neg (scircle, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherecircle_in_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_circle_neg (scircle, scircle) IS 'true if spherical circle does not contain spherical circle'; -- -- point is contained by circle -- CREATE FUNCTION spoint_contained_by_circle(spoint, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherepoint_in_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle(spoint, scircle) IS 'true if spherical point is contained by spherical circle'; -- -- point is not contained by circle -- CREATE FUNCTION spoint_contained_by_circle_neg(spoint, scircle) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_neg (spoint, scircle) IS 'true if spherical point is not contained by spherical circle '; -- -- circle contains point -- CREATE FUNCTION spoint_contained_by_circle_com(scircle, spoint) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_com (scircle, spoint) IS 'true if spherical circle contains spherical point '; -- -- circle does not contain point -- CREATE FUNCTION spoint_contained_by_circle_com_neg(scircle, spoint) RETURNS BOOL AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_com_neg (scircle, spoint) IS 'true if spherical circle does not contain spherical point '; -- -- distance between circles -- CREATE FUNCTION dist(scircle, scircle) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherecircle_distance' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION dist(scircle, scircle) IS 'distance between two spherical circles'; CREATE OPERATOR <-> ( LEFTARG = scircle, RIGHTARG = scircle, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (scircle, scircle) IS 'distance between two spherical circles'; -- -- distance between circle and point -- CREATE FUNCTION dist(scircle, spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherecircle_point_distance' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION dist(scircle, spoint) IS 'distance between spherical circle and spherical point'; CREATE OPERATOR <-> ( LEFTARG = scircle, RIGHTARG = spoint, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (scircle, spoint) IS 'distance between spherical circle and spherical point'; -- -- distance between point and circle -- CREATE FUNCTION dist(spoint, scircle) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherecircle_point_distance_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION dist(spoint, scircle) IS 'distance between spherical circle and spherical point'; CREATE OPERATOR <-> ( LEFTARG = spoint, RIGHTARG = scircle, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (spoint, scircle) IS 'distance between spherical circle and spherical point'; -- -- Transformation of circle -- CREATE FUNCTION strans_circle(scircle, strans) RETURNS scircle AS 'MODULE_PATHNAME' , 'spheretrans_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_circle (scircle, strans) IS 'returns a transformated spherical circle'; CREATE OPERATOR + ( LEFTARG = scircle, RIGHTARG = strans, PROCEDURE = strans_circle ); COMMENT ON OPERATOR + (scircle, strans) IS 'transforms a spherical circle '; CREATE FUNCTION strans_circle_inverse(scircle, strans) RETURNS scircle AS 'MODULE_PATHNAME' , 'spheretrans_circle_inverse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_circle_inverse (scircle, strans) IS 'returns a inverse transformated spherical circle'; CREATE OPERATOR - ( LEFTARG = scircle, RIGHTARG = strans, PROCEDURE = strans_circle_inverse ); COMMENT ON OPERATOR - (scircle, strans) IS 'transforms inverse a spherical circle '; pgsphere-1.5.1/pgs_circle_sel.sql.in000066400000000000000000000101131461140101500174230ustar00rootroot00000000000000CREATE FUNCTION spoint_contained_by_circle_sel(internal, oid, internal, integer) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_sel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_sel(internal, oid, internal, integer) IS 'selectivity estimator function for spoint_contained_by_circle'; CREATE FUNCTION spoint_contained_by_circle_joinsel(internal, oid, internal, smallint, internal) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_joinsel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_joinsel(internal, oid, internal, smallint, internal) IS 'join selectivity estimator function for spoint_contained_by_circle'; CREATE FUNCTION spoint_contained_by_circle_neg_sel(internal, oid, internal, integer) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_neg_sel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_neg_sel(internal, oid, internal, integer) IS 'selectivity estimator function for spoint_contained_by_circle_neg'; CREATE FUNCTION spoint_contained_by_circle_neg_joinsel(internal, oid, internal, smallint, internal) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_neg_joinsel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_neg_joinsel(internal, oid, internal, smallint, internal) IS 'join selectivity estimator function for spoint_contained_by_circle_neg'; CREATE FUNCTION spoint_contained_by_circle_com_sel(internal, oid, internal, integer) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_sel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_com_sel(internal, oid, internal, integer) IS 'selectivity estimator function for spoint_contained_by_circle_com'; CREATE FUNCTION spoint_contained_by_circle_com_joinsel(internal, oid, internal, smallint, internal) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_joinsel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_com_joinsel(internal, oid, internal, smallint, internal) IS 'join selectivity estimator function for spoint_contained_by_circle_com'; CREATE FUNCTION spoint_contained_by_circle_com_neg_sel(internal, oid, internal, integer) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_neg_sel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_com_neg_sel(internal, oid, internal, integer) IS 'selectivity estimator function for spoint_contained_by_circle_com_neg'; CREATE FUNCTION spoint_contained_by_circle_com_neg_joinsel(internal, oid, internal, smallint, internal) RETURNS double precision AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_neg_joinsel' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_contained_by_circle_com_neg_joinsel(internal, oid, internal, smallint, internal) IS 'join selectivity estimator function for spoint_contained_by_circle_com_neg'; ALTER OPERATOR @> (scircle, spoint) SET ( RESTRICT = spoint_contained_by_circle_com_sel, JOIN = spoint_contained_by_circle_com_joinsel ); ALTER OPERATOR <@ (spoint, scircle) SET ( RESTRICT = spoint_contained_by_circle_sel, JOIN = spoint_contained_by_circle_joinsel ); ALTER OPERATOR !@> (scircle, spoint) SET ( RESTRICT = spoint_contained_by_circle_com_neg_sel, JOIN = spoint_contained_by_circle_com_neg_joinsel ); ALTER OPERATOR !<@ (spoint, scircle) SET ( RESTRICT = spoint_contained_by_circle_neg_sel, JOIN = spoint_contained_by_circle_neg_joinsel ); CREATE FUNCTION spoint_dwithin(spoint, spoint, float8) RETURNS boolean AS 'MODULE_PATHNAME', 'spherepoint_dwithin' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_dwithin(spoint, spoint, float8) IS 'predicate matching spherical points less than a given distance apart'; pgsphere-1.5.1/pgs_contains_ops.sql.in000066400000000000000000001154571461140101500200370ustar00rootroot00000000000000--- scircle vs scircle CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contains_circle, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, scircle) IS 'true if spherical circle (LHS) contains spherical circle (RHS)'; CREATE OPERATOR <@ ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contained_by_circle, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (scircle, scircle) IS 'true if spherical circle (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contains_circle_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, scircle) IS 'true if spherical circle (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contained_by_circle_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (scircle, scircle) IS 'true if spherical circle (LHS) is not contained by spherical circle (RHS)'; --- spoint vs scircle CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = spoint, PROCEDURE = spoint_contained_by_circle_com, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, spoint) IS 'true if spherical circle (LHS) contains spherical point (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = scircle, PROCEDURE = spoint_contained_by_circle, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, scircle) IS 'true if spherical point (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = spoint, PROCEDURE = spoint_contained_by_circle_com_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, spoint) IS 'true if spherical circle (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = scircle, PROCEDURE = spoint_contained_by_circle_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoint, scircle) IS 'true if spherical point (LHS) is not contained by spherical circle (RHS)'; --- spoly vs spoly CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, spoly) IS 'true if spherical polygon (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoly, spoly) IS 'true if spherical polygon (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, spoly) IS 'true if spherical polygon (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoly, spoly) IS 'true if spherical polygon (LHS) is not contained by spherical polygon (RHS)'; -- spoly vs spoint CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = spoint, PROCEDURE = spoly_contains_point, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, spoint) IS 'true if spherical polygon (LHS) contains spherical point (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = spoly, PROCEDURE = spoly_contains_point_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, spoly) IS 'true if spherical point (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = spoint, PROCEDURE = spoly_contains_point_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, spoint) IS 'true if spherical polygon (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = spoly, PROCEDURE = spoly_contains_point_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoint, spoly) IS 'true if spherical point (LHS) is not contained by spherical polygon (RHS)'; --- scircle vs spoly CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = scircle_contains_polygon, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, spoly) IS 'true if spherical circle (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = scircle_contains_polygon_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoly, scircle) IS 'true if spherical polygon (LHS) is contained by spherical circle (LHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = scircle_contains_polygon_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, spoly) IS 'true if spherical circle (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = scircle_contains_polygon_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoly, scircle) IS 'true if spherical polygon (LHS) is not contained spherical circle (RHS)'; CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = spoly_contains_circle, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, scircle) IS 'true if spherical polygon (LHS) contains spherical circle (RHS)'; CREATE OPERATOR <@ ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = spoly_contains_circle_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (scircle, spoly) IS 'true if spherical circle (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = spoly_contains_circle_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, scircle) IS 'true if spherical polygon (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = spoly_contains_circle_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (scircle, spoly) IS 'true if spherical circle (LHS) is not contained by spherical polygon (RHS)'; --- sbox vs sbox CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, sbox) IS 'true if spherical box (LHS) contains spherical box (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sbox, sbox) IS 'true if spherical box (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, sbox) IS 'true if spherical box (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sbox, sbox) IS 'true if spherical box (LHS) is not contained by spherical box (RHS)'; --- sbox vs spoint CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = spoint, PROCEDURE = sbox_cont_point, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, spoint) IS 'true if spherical box (LHS) contains spherical point (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = sbox, PROCEDURE = sbox_cont_point_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, sbox) IS 'true if spherical point (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = spoint, PROCEDURE = sbox_cont_point_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, spoint) IS 'true if spherical box (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = sbox, PROCEDURE = sbox_cont_point_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoint, sbox) IS 'true if spherical point (LHS) is not contained by spherical box (RHS)'; --- scircle vs sbox CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = scircle_contains_box, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, sbox) IS 'true if spherical circle (LHS) contains spherical box (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = scircle_contains_box_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sbox, scircle) IS 'true if spherical box (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = scircle_contains_box_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, sbox) IS 'true if spherical circle (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = scircle_contains_box_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sbox, scircle) IS 'true if spherical box (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = sbox_contains_circle, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, scircle) IS 'true if spherical box (LHS) contains spherical circle (RHS)'; CREATE OPERATOR <@ ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = sbox_contains_circle_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (scircle, sbox) IS 'true if spherical circle (LHS) contains spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = sbox_contains_circle_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, scircle) IS 'true if spherical box (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = sbox_contains_circle_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (scircle, sbox) IS 'true if spherical circle (LHS) is not contained by spherical box (RHS)'; --- sbox vs spoly CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = spoly_contains_box, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, sbox) IS 'true if spherical polygon (LHS) contains spherical box (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = spoly_contains_box_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sbox, spoly) IS 'true if spherical box (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = spoly_contains_box_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, sbox) IS 'true if spherical polygon (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = spoly_contains_box_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sbox, spoly) IS 'true if spherical box (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = sbox_contains_poly, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, spoly) IS 'true if spherical box (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = sbox_contains_poly_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoly, sbox) IS 'true if spherical polygon (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = sbox_contains_poly_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, spoly) IS 'true if spherical box (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = sbox_contains_poly_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoly, sbox) IS 'true if spherical polygon (LHS) is not contained by spherical box (RHS)'; -- new stuff -- CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = sline, PROCEDURE = sline_contains_point_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, sline) IS 'true if spherical point (LHS) is contained by spherical line (RHS)'; CREATE OPERATOR @> ( LEFTARG = sline, RIGHTARG = spoint, PROCEDURE = sline_contains_point, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sline, spoint) IS 'true if spherical line (LHS) contains the spherical point (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sline, RIGHTARG = spoint, PROCEDURE = sline_contains_point_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sline, spoint) IS 'true if spherical line (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = sline, PROCEDURE = sline_contains_point_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoint, sline) IS 'true if spherical point (LHS) is not contained by spherical line (RHS)'; CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = sline, PROCEDURE = scircle_contains_line, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, sline) IS 'true if spherical circle (LHS) contains spherical line (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sline, RIGHTARG = scircle, PROCEDURE = scircle_contains_line_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sline, scircle) IS 'true if spherical line (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = sline, PROCEDURE = scircle_contains_line_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, sline) IS 'true if spherical circle (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sline, RIGHTARG = scircle, PROCEDURE = scircle_contains_line_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sline, scircle) IS 'true if spherical line (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = sline, PROCEDURE = spoly_contains_line, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, sline) IS 'true if spherical polygon (LHS) contains spherical line (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sline, RIGHTARG = spoly, PROCEDURE = spoly_contains_line_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sline, spoly) IS 'true if spherical line (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = sline, PROCEDURE = spoly_contains_line, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, sline) IS 'true if spherical polygon (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sline, RIGHTARG = spoly, PROCEDURE = spoly_contains_line_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sline, spoly) IS 'true if spherical line (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, sellipse) IS 'true if spherical ellipse (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sellipse, sellipse) IS 'true if spherical ellipse (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, sellipse) IS 'true if spherical ellipse (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sellipse, sellipse) IS 'true if spherical ellipse (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = spoint, PROCEDURE = sellipse_contains_point, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, spoint) IS 'true if spherical ellipse (LHS) contains spherical point (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_point_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, sellipse) IS 'true if spherical point (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = spoint, PROCEDURE = sellipse_contains_point_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, spoint) IS 'true if spherical ellipse (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_point_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoint, sellipse) IS 'true if spherical point (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sbox_contains_ellipse, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, sellipse) IS 'true if spherical box (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sbox_contains_ellipse_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sellipse, sbox) IS 'true if spherical ellipse (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sbox_contains_ellipse_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, sellipse) IS 'true if spherical box (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sbox_contains_ellipse_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sellipse, sbox) IS 'true if spherical ellipse (LHS) is not contained by spherical box (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sellipse_contains_box, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, sbox) IS 'true if spherical ellipse (LHS) contains spherical box (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_box_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sbox, sellipse) IS 'true if spherical box (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sellipse_contains_box_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, sbox) IS 'true if spherical ellipse (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_box_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sbox, sellipse) IS 'true if spherical box (LHS) is not containe by spherical ellipse (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = sellipse_contains_circle, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, scircle) IS 'true if spherical ellipse (LHS) contains spherical circle (RHS)'; CREATE OPERATOR <@ ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_circle_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (scircle, sellipse) IS 'true if spherical circle (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = sellipse_contains_circle_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, scircle) IS 'true if spherical ellipse (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_circle_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (scircle, sellipse) IS 'true if spherical circle (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = scircle_contains_ellipse, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, sellipse) IS 'true if spherical circle (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = scircle_contains_ellipse_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sellipse, scircle) IS 'true if spherical ellipse (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = scircle_contains_ellipse_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, sellipse) IS 'true if spherical circle (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = scircle_contains_ellipse_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sellipse, scircle) IS 'true if spherical ellipse (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = sline, PROCEDURE = sellipse_contains_line, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, sline) IS 'true if spherical ellipse (LHS) contains spherical line (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sline, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_line_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sline, sellipse) IS 'true if spherical line is contained by spherical ellipse'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = sline, PROCEDURE = sellipse_contains_line_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, sline) IS 'true if spherical ellipse (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sline, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_line_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sline, sellipse) IS 'true if spherical line (LHS) is not contained by spherical line (RHS)'; CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_contains_ellipse, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, sellipse) IS 'true if spherical polygon (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = spoly_contains_ellipse_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sellipse, spoly) IS 'true if spherical ellipse (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_contains_ellipse_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, sellipse) IS 'true if spherical polygon (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = spoly_contains_ellipse_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sellipse, spoly) IS 'true if spherical ellipse (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = sellipse_contains_polygon, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, spoly) IS 'true if spherical ellipse (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_polygon_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoly, sellipse) IS 'true if spherical polygon (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = sellipse_contains_polygon_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, spoly) IS 'true if spherical ellipse (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_polygon_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoly, sellipse) IS 'true if spherical polygon (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR @> ( LEFTARG = spath, RIGHTARG = spoint, PROCEDURE = spath_contains_point, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spath, spoint) IS 'true if spherical path (LHS) contains spherical point (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = spath, PROCEDURE = spath_contains_point_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spoint, spath) IS 'true if spherical point (LHS) is contained by spherical path (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spath, RIGHTARG = spoint, PROCEDURE = spath_contains_point_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spath, spoint) IS 'true if spherical path (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = spath, PROCEDURE = spath_contains_point_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spoint, spath) IS 'true if spherical point (LHS) is not contained by spherical path (RHS)'; CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = spath, PROCEDURE = sbox_contains_path, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, spath) IS 'true if spherical box (LHS) contains spherical path (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spath, RIGHTARG = sbox, PROCEDURE = sbox_contains_path_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spath, sbox) IS 'true if spherical path is contained by spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = spath, PROCEDURE = sbox_contains_path_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, spath) IS 'true if spherical box (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spath, RIGHTARG = sbox, PROCEDURE = sbox_contains_path_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spath, sbox) IS 'true if spherical path (LHS) is not contained by spherical box (RHS)'; CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = spath, PROCEDURE = scircle_contains_path, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (scircle, spath) IS 'true if spherical circle (LHS) contains spherical path (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spath, RIGHTARG = scircle, PROCEDURE = scircle_contains_path_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spath, scircle) IS 'true if spherical path (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = spath, PROCEDURE = scircle_contains_path_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (scircle, spath) IS 'true if spherical circle (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spath, RIGHTARG = scircle, PROCEDURE = scircle_contains_path_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spath, scircle) IS 'true if spherical path (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR @> ( LEFTARG = sellipse, RIGHTARG = spath, PROCEDURE = sellipse_contains_path, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sellipse, spath) IS 'true if spherical ellipse (LHS) contains spherical path (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spath, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_path_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spath, sellipse) IS 'true if spherical path (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sellipse, RIGHTARG = spath, PROCEDURE = sellipse_contains_path_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sellipse, spath) IS 'true if spherical ellipse (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spath, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_path_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spath, sellipse) IS 'true if spherical path is not contained by spherical ellipse (RHS)'; CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = spath, PROCEDURE = spoly_contains_path, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (spoly, spath) IS 'true if spherical polygon (LHS) contains spherical path (RHS)'; CREATE OPERATOR <@ ( LEFTARG = spath, RIGHTARG = spoly, PROCEDURE = spoly_contains_path_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (spath, spoly) IS 'true if spherical path (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = spath, PROCEDURE = spoly_contains_path_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, spath) IS 'true if spherical polygon (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = spath, RIGHTARG = spoly, PROCEDURE = spoly_contains_path_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (spath, spoly) IS 'true if spherical path (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR @> ( LEFTARG = sbox, RIGHTARG = sline, PROCEDURE = sbox_contains_line, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (sbox, sline) IS 'true if spherical box (LHS) contains spherical line (RHS)'; CREATE OPERATOR <@ ( LEFTARG = sline, RIGHTARG = sbox, PROCEDURE = sbox_contains_line_com, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (sline, sbox) IS 'true if spherical line (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !@> ( LEFTARG = sbox, RIGHTARG = sline, PROCEDURE = sbox_contains_line_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (sbox, sline) IS 'true if spherical box (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !<@ ( LEFTARG = sline, RIGHTARG = sbox, PROCEDURE = sbox_contains_line_com_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (sline, sbox) IS 'true if spherical line (LHS) is not contained by spherical box (RHS)'; pgsphere-1.5.1/pgs_contains_ops_compat.sql.in000066400000000000000000001147401461140101500213740ustar00rootroot00000000000000-- declare old-style contains operators -- (akin to built-in geometry operators before PostgreSQL 8.2), -- adapted from pgs_contains_ops.sql.in --- scircle vs scircle CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contains_circle, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, scircle) IS 'true if spherical circle (LHS) contains spherical circle (RHS)'; CREATE OPERATOR @ ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contained_by_circle, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (scircle, scircle) IS 'true if spherical circle (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contains_circle_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, scircle) IS 'true if spherical circle (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !@ ( LEFTARG = scircle, RIGHTARG = scircle, PROCEDURE = scircle_contained_by_circle_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (scircle, scircle) IS 'true if spherical circle (LHS) is not contained by spherical circle (RHS)'; --- spoint vs scircle CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = spoint, PROCEDURE = spoint_contained_by_circle_com, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, spoint) IS 'true if spherical circle (LHS) contains spherical point (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoint, RIGHTARG = scircle, PROCEDURE = spoint_contained_by_circle, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoint, scircle) IS 'true if spherical point (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = spoint, PROCEDURE = spoint_contained_by_circle_com_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, spoint) IS 'true if spherical circle (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = scircle, PROCEDURE = spoint_contained_by_circle_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, scircle) IS 'true if spherical point (LHS) is not contained by spherical circle (RHS)'; --- spoly vs spoly CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, spoly) IS 'true if spherical polygon (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoly, spoly) IS 'true if spherical polygon (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, spoly) IS 'true if spherical polygon (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_contains_polygon_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoly, spoly) IS 'true if spherical polygon (LHS) is not contained by spherical polygon (RHS)'; -- spoly vs spoint CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = spoint, PROCEDURE = spoly_contains_point, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, spoint) IS 'true if spherical polygon (LHS) contains spherical point (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoint, RIGHTARG = spoly, PROCEDURE = spoly_contains_point_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoint, spoly) IS 'true if spherical point (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = spoint, PROCEDURE = spoly_contains_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, spoint) IS 'true if spherical polygon (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = spoly, PROCEDURE = spoly_contains_point_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, spoly) IS 'true if spherical point (LHS) is not contained by spherical polygon (RHS)'; --- scircle vs spoly CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = scircle_contains_polygon, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, spoly) IS 'true if spherical circle (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = scircle_contains_polygon_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoly, scircle) IS 'true if spherical polygon (LHS) is contained by spherical circle (LHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = scircle_contains_polygon_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, spoly) IS 'true if spherical circle (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = scircle_contains_polygon_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoly, scircle) IS 'true if spherical polygon (LHS) is not contained spherical circle (RHS)'; CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = spoly_contains_circle, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, scircle) IS 'true if spherical polygon (LHS) contains spherical circle (RHS)'; CREATE OPERATOR @ ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = spoly_contains_circle_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (scircle, spoly) IS 'true if spherical circle (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = spoly_contains_circle_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, scircle) IS 'true if spherical polygon (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !@ ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = spoly_contains_circle_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (scircle, spoly) IS 'true if spherical circle (LHS) is not contained by spherical polygon (RHS)'; --- sbox vs sbox CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, sbox) IS 'true if spherical box (LHS) contains spherical box (RHS)'; CREATE OPERATOR @ ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sbox, sbox) IS 'true if spherical box (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, sbox) IS 'true if spherical box (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sbox, RIGHTARG = sbox, PROCEDURE = sbox_contains_box_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sbox, sbox) IS 'true if spherical box (LHS) is not contained by spherical box (RHS)'; --- sbox vs spoint CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = spoint, PROCEDURE = sbox_cont_point, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, spoint) IS 'true if spherical box (LHS) contains spherical point (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoint, RIGHTARG = sbox, PROCEDURE = sbox_cont_point_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoint, sbox) IS 'true if spherical point (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = spoint, PROCEDURE = sbox_cont_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, spoint) IS 'true if spherical box (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = sbox, PROCEDURE = sbox_cont_point_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, sbox) IS 'true if spherical point (LHS) is not contained by spherical box (RHS)'; --- scircle vs sbox CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = scircle_contains_box, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, sbox) IS 'true if spherical circle (LHS) contains spherical box (RHS)'; CREATE OPERATOR @ ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = scircle_contains_box_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sbox, scircle) IS 'true if spherical box (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = scircle_contains_box_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, sbox) IS 'true if spherical circle (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = scircle_contains_box_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sbox, scircle) IS 'true if spherical box (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = sbox_contains_circle, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, scircle) IS 'true if spherical box (LHS) contains spherical circle (RHS)'; CREATE OPERATOR @ ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = sbox_contains_circle_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (scircle, sbox) IS 'true if spherical circle (LHS) contains spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = scircle, PROCEDURE = sbox_contains_circle_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, scircle) IS 'true if spherical box (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !@ ( LEFTARG = scircle, RIGHTARG = sbox, PROCEDURE = sbox_contains_circle_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (scircle, sbox) IS 'true if spherical circle (LHS) is not contained by spherical box (RHS)'; --- sbox vs spoly CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = spoly_contains_box, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, sbox) IS 'true if spherical polygon (LHS) contains spherical box (RHS)'; CREATE OPERATOR @ ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = spoly_contains_box_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sbox, spoly) IS 'true if spherical box (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = spoly_contains_box_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, sbox) IS 'true if spherical polygon (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = spoly_contains_box_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sbox, spoly) IS 'true if spherical box (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = sbox_contains_poly, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, spoly) IS 'true if spherical box (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = sbox_contains_poly_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoly, sbox) IS 'true if spherical polygon (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = spoly, PROCEDURE = sbox_contains_poly_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, spoly) IS 'true if spherical box (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoly, RIGHTARG = sbox, PROCEDURE = sbox_contains_poly_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoly, sbox) IS 'true if spherical polygon (LHS) is not contained by spherical box (RHS)'; -- new stuff -- CREATE OPERATOR @ ( LEFTARG = spoint, RIGHTARG = sline, PROCEDURE = sline_contains_point_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoint, sline) IS 'true if spherical point (LHS) is contained by spherical line (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sline, RIGHTARG = spoint, PROCEDURE = sline_contains_point, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sline, spoint) IS 'true if spherical line (LHS) contains the spherical point (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sline, RIGHTARG = spoint, PROCEDURE = sline_contains_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sline, spoint) IS 'true if spherical line (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = sline, PROCEDURE = sline_contains_point_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, sline) IS 'true if spherical point (LHS) is not contained by spherical line (RHS)'; CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = sline, PROCEDURE = scircle_contains_line, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, sline) IS 'true if spherical circle (LHS) contains spherical line (RHS)'; CREATE OPERATOR @ ( LEFTARG = sline, RIGHTARG = scircle, PROCEDURE = scircle_contains_line_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sline, scircle) IS 'true if spherical line (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = sline, PROCEDURE = scircle_contains_line_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, sline) IS 'true if spherical circle (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sline, RIGHTARG = scircle, PROCEDURE = scircle_contains_line_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sline, scircle) IS 'true if spherical line (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = sline, PROCEDURE = spoly_contains_line, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, sline) IS 'true if spherical polygon (LHS) contains spherical line (RHS)'; CREATE OPERATOR @ ( LEFTARG = sline, RIGHTARG = spoly, PROCEDURE = spoly_contains_line_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sline, spoly) IS 'true if spherical line (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = sline, PROCEDURE = spoly_contains_line, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, sline) IS 'true if spherical polygon (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sline, RIGHTARG = spoly, PROCEDURE = spoly_contains_line_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sline, spoly) IS 'true if spherical line (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, sellipse) IS 'true if spherical ellipse (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR @ ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sellipse, sellipse) IS 'true if spherical ellipse (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, sellipse) IS 'true if spherical ellipse (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_ellipse_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sellipse, sellipse) IS 'true if spherical ellipse (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = spoint, PROCEDURE = sellipse_contains_point, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, spoint) IS 'true if spherical ellipse (LHS) contains spherical point (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoint, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_point_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoint, sellipse) IS 'true if spherical point (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = spoint, PROCEDURE = sellipse_contains_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, spoint) IS 'true if spherical ellipse (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_point_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, sellipse) IS 'true if spherical point (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sbox_contains_ellipse, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, sellipse) IS 'true if spherical box (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR @ ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sbox_contains_ellipse_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sellipse, sbox) IS 'true if spherical ellipse (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sbox_contains_ellipse_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, sellipse) IS 'true if spherical box (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sbox_contains_ellipse_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sellipse, sbox) IS 'true if spherical ellipse (LHS) is not contained by spherical box (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sellipse_contains_box, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, sbox) IS 'true if spherical ellipse (LHS) contains spherical box (RHS)'; CREATE OPERATOR @ ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_box_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sbox, sellipse) IS 'true if spherical box (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = sbox, PROCEDURE = sellipse_contains_box_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, sbox) IS 'true if spherical ellipse (LHS) does not contain spherical box (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sbox, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_box_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sbox, sellipse) IS 'true if spherical box (LHS) is not containe by spherical ellipse (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = sellipse_contains_circle, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, scircle) IS 'true if spherical ellipse (LHS) contains spherical circle (RHS)'; CREATE OPERATOR @ ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_circle_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (scircle, sellipse) IS 'true if spherical circle (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = sellipse_contains_circle_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, scircle) IS 'true if spherical ellipse (LHS) does not contain spherical circle (RHS)'; CREATE OPERATOR !@ ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_circle_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (scircle, sellipse) IS 'true if spherical circle (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = scircle_contains_ellipse, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, sellipse) IS 'true if spherical circle (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR @ ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = scircle_contains_ellipse_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sellipse, scircle) IS 'true if spherical ellipse (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = scircle_contains_ellipse_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, sellipse) IS 'true if spherical circle (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = scircle_contains_ellipse_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sellipse, scircle) IS 'true if spherical ellipse (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = sline, PROCEDURE = sellipse_contains_line, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, sline) IS 'true if spherical ellipse (LHS) contains spherical line (RHS)'; CREATE OPERATOR @ ( LEFTARG = sline, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_line_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sline, sellipse) IS 'true if spherical line is contained by spherical ellipse'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = sline, PROCEDURE = sellipse_contains_line_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, sline) IS 'true if spherical ellipse (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sline, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_line_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sline, sellipse) IS 'true if spherical line (LHS) is not contained by spherical line (RHS)'; CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_contains_ellipse, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, sellipse) IS 'true if spherical polygon (LHS) contains spherical ellipse (RHS)'; CREATE OPERATOR @ ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = spoly_contains_ellipse_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sellipse, spoly) IS 'true if spherical ellipse (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_contains_ellipse_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, sellipse) IS 'true if spherical polygon (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = spoly_contains_ellipse_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sellipse, spoly) IS 'true if spherical ellipse (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = sellipse_contains_polygon, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, spoly) IS 'true if spherical ellipse (LHS) contains spherical polygon (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_polygon_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoly, sellipse) IS 'true if spherical polygon (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = sellipse_contains_polygon_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, spoly) IS 'true if spherical ellipse (LHS) does not contain spherical polygon (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_polygon_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoly, sellipse) IS 'true if spherical polygon (LHS) is not contained by spherical ellipse (RHS)'; CREATE OPERATOR ~ ( LEFTARG = spath, RIGHTARG = spoint, PROCEDURE = spath_contains_point, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spath, spoint) IS 'true if spherical path (LHS) contains spherical point (RHS)'; CREATE OPERATOR @ ( LEFTARG = spoint, RIGHTARG = spath, PROCEDURE = spath_contains_point_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spoint, spath) IS 'true if spherical point (LHS) is contained by spherical path (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spath, RIGHTARG = spoint, PROCEDURE = spath_contains_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spath, spoint) IS 'true if spherical path (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = spath, PROCEDURE = spath_contains_point_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, spath) IS 'true if spherical point (LHS) is not contained by spherical path (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = spath, PROCEDURE = sbox_contains_path, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, spath) IS 'true if spherical box (LHS) contains spherical path (RHS)'; CREATE OPERATOR @ ( LEFTARG = spath, RIGHTARG = sbox, PROCEDURE = sbox_contains_path_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spath, sbox) IS 'true if spherical path is contained by spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = spath, PROCEDURE = sbox_contains_path_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, spath) IS 'true if spherical box (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spath, RIGHTARG = sbox, PROCEDURE = sbox_contains_path_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spath, sbox) IS 'true if spherical path (LHS) is not contained by spherical box (RHS)'; CREATE OPERATOR ~ ( LEFTARG = scircle, RIGHTARG = spath, PROCEDURE = scircle_contains_path, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (scircle, spath) IS 'true if spherical circle (LHS) contains spherical path (RHS)'; CREATE OPERATOR @ ( LEFTARG = spath, RIGHTARG = scircle, PROCEDURE = scircle_contains_path_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spath, scircle) IS 'true if spherical path (LHS) is contained by spherical circle (RHS)'; CREATE OPERATOR !~ ( LEFTARG = scircle, RIGHTARG = spath, PROCEDURE = scircle_contains_path_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (scircle, spath) IS 'true if spherical circle (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spath, RIGHTARG = scircle, PROCEDURE = scircle_contains_path_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spath, scircle) IS 'true if spherical path (LHS) is not contained by spherical circle (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sellipse, RIGHTARG = spath, PROCEDURE = sellipse_contains_path, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sellipse, spath) IS 'true if spherical ellipse (LHS) contains spherical path (RHS)'; CREATE OPERATOR @ ( LEFTARG = spath, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_path_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spath, sellipse) IS 'true if spherical path (LHS) is contained by spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sellipse, RIGHTARG = spath, PROCEDURE = sellipse_contains_path_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sellipse, spath) IS 'true if spherical ellipse (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spath, RIGHTARG = sellipse, PROCEDURE = sellipse_contains_path_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spath, sellipse) IS 'true if spherical path is not contained by spherical ellipse (RHS)'; CREATE OPERATOR ~ ( LEFTARG = spoly, RIGHTARG = spath, PROCEDURE = spoly_contains_path, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (spoly, spath) IS 'true if spherical polygon (LHS) contains spherical path (RHS)'; CREATE OPERATOR @ ( LEFTARG = spath, RIGHTARG = spoly, PROCEDURE = spoly_contains_path_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (spath, spoly) IS 'true if spherical path (LHS) is contained by spherical polygon (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = spath, PROCEDURE = spoly_contains_path_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, spath) IS 'true if spherical polygon (LHS) does not contain spherical path (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spath, RIGHTARG = spoly, PROCEDURE = spoly_contains_path_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spath, spoly) IS 'true if spherical path (LHS) is not contained by spherical polygon (RHS)'; CREATE OPERATOR ~ ( LEFTARG = sbox, RIGHTARG = sline, PROCEDURE = sbox_contains_line, COMMUTATOR = '@', NEGATOR = '!~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR ~ (sbox, sline) IS 'true if spherical box (LHS) contains spherical line (RHS)'; CREATE OPERATOR @ ( LEFTARG = sline, RIGHTARG = sbox, PROCEDURE = sbox_contains_line_com, COMMUTATOR = '~', NEGATOR = '!@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @ (sline, sbox) IS 'true if spherical line (LHS) is contained by spherical box (RHS)'; CREATE OPERATOR !~ ( LEFTARG = sbox, RIGHTARG = sline, PROCEDURE = sbox_contains_line_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sbox, sline) IS 'true if spherical box (LHS) does not contain spherical line (RHS)'; CREATE OPERATOR !@ ( LEFTARG = sline, RIGHTARG = sbox, PROCEDURE = sbox_contains_line_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (sline, sbox) IS 'true if spherical line (LHS) is not contained by spherical box (RHS)'; pgsphere-1.5.1/pgs_ellipse.sql.in000066400000000000000000000456111461140101500167670ustar00rootroot00000000000000-- **************************** -- -- spherical ellipse functions -- -- **************************** CREATE FUNCTION sellipse(spoint, float8, float8, float8) RETURNS sellipse AS 'MODULE_PATHNAME', 'sphereellipse_infunc' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse(spoint, float8, float8, float8) IS 'returns spherical ellipse from center, radius1, radius2 and inclination'; CREATE FUNCTION inc(sellipse) RETURNS float8 AS 'MODULE_PATHNAME', 'sphereellipse_incl' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION inc(sellipse) IS 'inclination of spherical ellipse'; CREATE FUNCTION lrad(sellipse) RETURNS float8 AS 'MODULE_PATHNAME', 'sphereellipse_rad1' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION lrad(sellipse) IS 'large radius of spherical ellipse'; CREATE FUNCTION srad(sellipse) RETURNS float8 AS 'MODULE_PATHNAME', 'sphereellipse_rad2' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION srad(sellipse) IS 'small radius of spherical ellipse'; -- -- Casting point as ellipse -- CREATE FUNCTION sellipse(spoint) RETURNS sellipse AS 'MODULE_PATHNAME', 'spherepoint_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse(spoint) IS 'returns spherical point as spherical ellipse'; CREATE CAST (spoint AS sellipse) WITH FUNCTION sellipse(spoint) AS IMPLICIT; -- -- Casting ellipse as circle -- CREATE FUNCTION scircle(sellipse) RETURNS scircle AS 'MODULE_PATHNAME', 'sphereellipse_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle(sellipse) IS 'spherical bounding circle of spherical ellipse'; CREATE CAST (sellipse AS scircle) WITH FUNCTION scircle(sellipse) AS IMPLICIT; -- -- Casting circle as ellipse -- CREATE FUNCTION sellipse(scircle) RETURNS sellipse AS 'MODULE_PATHNAME', 'spherecircle_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse(scircle) IS 'returns spherical circle as spherical ellipse'; CREATE CAST (scircle AS sellipse) WITH FUNCTION sellipse(scircle) AS IMPLICIT; -- -- Casting ellipse as Euler transformation -- CREATE FUNCTION strans(sellipse) RETURNS strans AS 'MODULE_PATHNAME', 'sphereellipse_trans' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans(sellipse) IS 'returns Euler transformation of spherical ellipse'; CREATE CAST (sellipse AS strans) WITH FUNCTION strans(sellipse) AS IMPLICIT; -- **************************** -- -- spherical ellipse operators -- -- **************************** CREATE FUNCTION center(sellipse) RETURNS spoint AS 'MODULE_PATHNAME', 'sphereellipse_center' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION center(sellipse) IS 'center of spherical ellipse'; CREATE OPERATOR @@ ( RIGHTARG = sellipse, PROCEDURE = center ); COMMENT ON OPERATOR @@ (NONE, sellipse) IS 'center of spherical ellipse'; -- -- equal -- CREATE FUNCTION sellipse_equal(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_equal(sellipse, sellipse) IS 'returns true, if spherical ellipses are equal'; CREATE OPERATOR = ( LEFTARG = sellipse, RIGHTARG = sellipse, COMMUTATOR = = , NEGATOR = <>, PROCEDURE = sellipse_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (sellipse, sellipse) IS 'true, if spherical ellipses are equal'; -- -- not equal -- CREATE FUNCTION sellipse_equal_neg(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_equal_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_equal_neg(sellipse, sellipse) IS 'returns true, if spherical ellipses are not equal'; CREATE OPERATOR <> ( LEFTARG = sellipse, RIGHTARG = sellipse, COMMUTATOR = <>, NEGATOR = = , PROCEDURE = sellipse_equal_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (sellipse, sellipse) IS 'true, if spherical ellipses are not equal'; -- -- ellipse contains ellipse -- CREATE FUNCTION sellipse_contains_ellipse(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_ellipse(sellipse, sellipse) IS 'true if spherical ellipse contains spherical ellipse'; -- -- ellipse is contained by ellipse -- CREATE FUNCTION sellipse_contains_ellipse_com(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_ellipse_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_ellipse_com(sellipse, sellipse) IS 'true if spherical ellipse is contained by spherical ellipse'; -- -- ellipse does not contain ellipse -- CREATE FUNCTION sellipse_contains_ellipse_neg(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_ellipse_neg(sellipse, sellipse) IS 'true if spherical ellipse does not contain spherical ellipse'; -- -- ellipse is not contained by ellipse -- CREATE FUNCTION sellipse_contains_ellipse_com_neg(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_ellipse_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_ellipse_com_neg(sellipse, sellipse) IS 'true if spherical ellipse is not contained by spherical ellipse'; -- -- ellipses overlap -- CREATE FUNCTION sellipse_overlap_ellipse(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_ellipse(sellipse, sellipse) IS 'true if spherical ellipse overlaps spherical ellipse'; CREATE OPERATOR && ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_ellipse, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sellipse, sellipse) IS 'true if spherical ellipses overlap'; -- -- ellipses do not overlap -- CREATE FUNCTION sellipse_overlap_ellipse_neg(sellipse, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_ellipse_neg(sellipse, sellipse) IS 'true if spherical ellipse does not overlap spherical ellipse'; CREATE OPERATOR !&& ( LEFTARG = sellipse, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_ellipse_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sellipse, sellipse) IS 'true if spherical ellipse does not overlap spherical ellipse'; -- -- ellipse contains point -- CREATE FUNCTION sellipse_contains_point(sellipse, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_point(sellipse, spoint) IS 'true if spherical ellipse contains spherical point'; -- -- point is contained by ellipse -- CREATE FUNCTION sellipse_contains_point_com(spoint, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_point_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_point_com(spoint, sellipse) IS 'true if spherical ellipse contains spherical point'; -- -- ellipse does not contain point -- CREATE FUNCTION sellipse_contains_point_neg(sellipse, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_point_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_point_neg(sellipse, spoint) IS 'true if spherical ellipse contains spherical point'; -- -- point is not contained by ellipse -- CREATE FUNCTION sellipse_contains_point_com_neg(spoint, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_point_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_point_com_neg(spoint, sellipse) IS 'true if spherical ellipse contains spherical point'; -- -- Transformation of ellipse -- CREATE FUNCTION strans_ellipse(sellipse, strans) RETURNS sellipse AS 'MODULE_PATHNAME', 'spheretrans_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_ellipse (sellipse, strans) IS 'returns a transformated spherical ellipse'; CREATE OPERATOR + ( LEFTARG = sellipse, RIGHTARG = strans, PROCEDURE = strans_ellipse ); COMMENT ON OPERATOR + (sellipse, strans) IS 'transforms a spherical ellipse'; CREATE FUNCTION strans_ellipse_inverse (sellipse, strans) RETURNS sellipse AS 'MODULE_PATHNAME', 'spheretrans_ellipse_inv' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_ellipse_inverse (sellipse, strans) IS 'returns a inverse transformated spherical ellipse'; CREATE OPERATOR - ( LEFTARG = sellipse, RIGHTARG = strans, PROCEDURE = strans_ellipse_inverse ); COMMENT ON OPERATOR - (sellipse, strans) IS 'transforms inverse a spherical ellipse'; -- -- ellipse contains circle -- CREATE FUNCTION sellipse_contains_circle(sellipse, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_circle(sellipse, scircle) IS 'true if spherical ellipse contains spherical circle'; -- -- circle is contained by ellipse -- CREATE FUNCTION sellipse_contains_circle_com(scircle, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_circle_com(scircle, sellipse) IS 'true if spherical ellipse contains spherical circle'; -- -- ellipse does not contain circle -- CREATE FUNCTION sellipse_contains_circle_neg(sellipse, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_circle_neg(sellipse, scircle) IS 'true if spherical ellipse does not contain spherical circle'; -- -- circle is not contained by ellipse -- CREATE FUNCTION sellipse_contains_circle_com_neg(scircle, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_circle_com_neg(scircle, sellipse) IS 'true if spherical ellipse does not contain spherical circle'; -- -- circle contains ellipse -- CREATE FUNCTION scircle_contains_ellipse(scircle, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_ellipse(scircle, sellipse) IS 'true if spherical circle contains spherical ellipse'; -- -- ellipse is contained by circle -- CREATE FUNCTION scircle_contains_ellipse_com(sellipse, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_ellipse_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_ellipse_com(sellipse, scircle) IS 'true if spherical circle contains spherical ellipse'; -- -- circle does not contain ellipse -- CREATE FUNCTION scircle_contains_ellipse_neg(scircle, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_ellipse_neg(scircle, sellipse) IS 'true if spherical circle does not contain spherical ellipse'; -- -- ellipse is not contained by circle -- CREATE FUNCTION scircle_contains_ellipse_com_neg(sellipse, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_ellipse_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_ellipse_com_neg(sellipse, scircle) IS 'true if spherical circle does not contain spherical ellipse'; -- -- circle overlaps ellipse -- CREATE FUNCTION sellipse_overlap_circle(sellipse, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_circle(sellipse, scircle) IS 'true if spherical circle overlap spherical ellipse'; CREATE OPERATOR && ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = sellipse_overlap_circle, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sellipse, scircle) IS 'true if spherical circle overlap spherical ellipse'; -- -- ellipse overlaps circle -- CREATE FUNCTION sellipse_overlap_circle_com(scircle, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_circle_com(scircle, sellipse) IS 'true if spherical circle overlap spherical ellipse'; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_circle_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (scircle, sellipse) IS 'true if spherical circle overlap spherical ellipse'; -- -- circle does not overlap ellipse -- CREATE FUNCTION sellipse_overlap_circle_neg(sellipse, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_circle_neg(sellipse, scircle) IS 'true if spherical circle does not overlap spherical ellipse'; CREATE OPERATOR !&& ( LEFTARG = sellipse, RIGHTARG = scircle, PROCEDURE = sellipse_overlap_circle_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sellipse, scircle) IS 'true if spherical circle does not overlap spherical ellipse'; -- -- ellipse does not overlap circle -- CREATE FUNCTION sellipse_overlap_circle_com_neg(scircle, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_circle_com_neg(scircle, sellipse) IS 'true if spherical circle does not overlap spherical ellipse'; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_circle_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (scircle, sellipse) IS 'true if spherical circle does not overlap spherical ellipse'; -- -- ellipse overlaps line -- CREATE FUNCTION sellipse_overlap_line (sellipse, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_line (sellipse, sline) IS 'returns true if spherical line overlaps spherical ellipse'; CREATE OPERATOR && ( LEFTARG = sellipse, RIGHTARG = sline, PROCEDURE = sellipse_overlap_line, COMMUTATOR = '&&', NEGATOR = '!&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sellipse, sline) IS 'true if spherical line overlaps spherical ellipse'; -- -- line overlaps ellipse -- CREATE FUNCTION sellipse_overlap_line_com(sline, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_line_com(sline, sellipse) IS 'returns true if spherical line overlaps spherical ellipse'; CREATE OPERATOR && ( LEFTARG = sline, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_line_com, COMMUTATOR = '&&', NEGATOR = '!&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sline, sellipse) IS 'true if spherical line overlaps spherical ellipse'; -- -- ellipse does not overlap line -- CREATE FUNCTION sellipse_overlap_line_neg (sellipse, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_line_neg (sellipse, sline) IS 'returns true if spherical line overlaps spherical ellipse'; CREATE OPERATOR !&& ( LEFTARG = sellipse, RIGHTARG = sline, PROCEDURE = sellipse_overlap_line_neg, COMMUTATOR = '!&&', NEGATOR = '&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sellipse, sline) IS 'true if spherical line does not overlap spherical ellipse'; -- -- line does not overlap ellipse -- CREATE FUNCTION sellipse_overlap_line_com_neg(sline, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_line_com_neg(sline, sellipse) IS 'returns true if spherical line does not overlap spherical ellipse'; CREATE OPERATOR !&& ( LEFTARG = sline, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_line_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sline, sellipse) IS 'true if spherical line does not overlap spherical ellipse'; -- -- ellipse contains line -- CREATE FUNCTION sellipse_contains_line(sellipse, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_line(sellipse, sline) IS 'returns true if spherical ellipse contains spherical line'; -- -- line is contained by ellipse -- CREATE FUNCTION sellipse_contains_line_com(sline, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_line_com(sline, sellipse) IS 'returns true if spherical ellipse contains spherical line'; -- -- ellipse does not contain line -- CREATE FUNCTION sellipse_contains_line_neg(sellipse, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_line_neg(sellipse, sline) IS 'returns true if spherical ellipse does not contain spherical line'; -- -- line is not contained by ellipse -- CREATE FUNCTION sellipse_contains_line_com_neg(sline, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_line_com_neg(sline, sellipse) IS 'returns true if spherical ellipse does not contain spherical line'; pgsphere-1.5.1/pgs_epochprop.sql.in000066400000000000000000000017711461140101500173300ustar00rootroot00000000000000-- *********************************** -- -- functions for propagating positions -- -- *********************************** CREATE FUNCTION epoch_prop( pos spoint, parallax DOUBLE PRECISION, pmlng DOUBLE PRECISION, pmlat DOUBLE PRECISION, rv DOUBLE PRECISION, delta_t DOUBLE PRECISION) RETURNS double precision[6] AS 'MODULE_PATHNAME', 'epoch_prop' LANGUAGE 'c' IMMUTABLE PARALLEL SAFE; CREATE FUNCTION epoch_prop_pos( pos spoint, parallax DOUBLE PRECISION, pmlng DOUBLE PRECISION, pmlat DOUBLE PRECISION, rv DOUBLE PRECISION, delta_t DOUBLE PRECISION) RETURNS spoint AS $body$ SELECT spoint(pv[1], pv[2]) FROM epoch_prop(pos, parallax, pmlng, pmlat, rv, delta_t) as pv $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE FUNCTION epoch_prop_pos( pos spoint, pmlng DOUBLE PRECISION, pmlat DOUBLE PRECISION, delta_t DOUBLE PRECISION) RETURNS spoint AS $body$ SELECT spoint(pv[1], pv[2]) FROM epoch_prop(pos, 0, pmlng, pmlat, 0, delta_t) as pv $body$ LANGUAGE SQL STABLE PARALLEL SAFE; pgsphere-1.5.1/pgs_euler.sql.in000066400000000000000000000130541461140101500164420ustar00rootroot00000000000000 -- spherical transformation functions CREATE FUNCTION strans_zxz(strans) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_zxz' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_zxz(strans) IS 'returns Euler transformation as ZXZ transformation'; CREATE FUNCTION strans(FLOAT8, FLOAT8, FLOAT8) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_from_float8' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans(FLOAT8, FLOAT8, FLOAT8) IS 'returns an transformation object using Euler angles (ZXZ)'; CREATE FUNCTION strans(FLOAT8, FLOAT8, FLOAT8, CSTRING) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_from_float8_and_type' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans(FLOAT8, FLOAT8, FLOAT8, CSTRING) IS 'returns an transformation object using Euler angles and axis'; CREATE FUNCTION phi(strans) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spheretrans_phi' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION phi(strans) IS 'returns the first angle of Euler angles of a transformation object'; CREATE FUNCTION theta(strans) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spheretrans_theta' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION theta(strans) IS 'returns the second angle of Euler angles of a transformation object'; CREATE FUNCTION psi(strans) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spheretrans_psi' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION psi(strans) IS 'returns the third angle of Euler angles of a transformation object'; CREATE FUNCTION axes(strans) RETURNS CHARACTER(3) AS 'MODULE_PATHNAME', 'spheretrans_type' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION axes (strans) IS 'returns the axis of Euler angles of a transformation object'; -- spherical transformation operators CREATE FUNCTION strans_equal(strans, strans) RETURNS BOOL AS 'MODULE_PATHNAME', 'spheretrans_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_equal(strans, strans) IS 'returns true, if Euler transformations are equal'; CREATE OPERATOR = ( LEFTARG = strans, RIGHTARG = strans, COMMUTATOR = = , NEGATOR = <>, PROCEDURE = strans_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (strans, strans) IS 'true, if Euler transformations are equal'; CREATE FUNCTION strans_not_equal(strans, strans) RETURNS BOOL AS 'MODULE_PATHNAME', 'spheretrans_not_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_not_equal(strans, strans) IS 'returns true, if Euler transformations are not equal'; CREATE OPERATOR <> ( LEFTARG = strans, RIGHTARG = strans, COMMUTATOR = <>, NEGATOR = = , PROCEDURE = strans_not_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (strans, strans) IS 'true, if spherical Euler transformations are not equal'; CREATE FUNCTION strans(strans) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans(strans) IS 'returns Euler transformation'; CREATE OPERATOR + ( RIGHTARG = strans, PROCEDURE = strans ); COMMENT ON OPERATOR + (NONE, strans) IS 'returns Euler transformation'; CREATE FUNCTION strans_invert(strans) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_invert' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_invert(strans) IS 'returns inverse Euler transformation'; CREATE OPERATOR - ( RIGHTARG = strans, PROCEDURE = strans_invert ); COMMENT ON OPERATOR - (NONE, strans) IS 'inverts Euler transformation'; CREATE FUNCTION strans_point(spoint, strans) RETURNS spoint AS 'MODULE_PATHNAME', 'spheretrans_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_point (spoint, strans) IS 'returns a transformated spherical point'; CREATE OPERATOR + ( LEFTARG = spoint, RIGHTARG = strans, PROCEDURE = strans_point ); COMMENT ON OPERATOR + (spoint, strans) IS 'transforms a spherical point'; CREATE FUNCTION strans_point_inverse(spoint, strans) RETURNS spoint AS 'MODULE_PATHNAME', 'spheretrans_point_inverse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_point_inverse (spoint, strans) IS 'returns a inverse transformated spherical point'; CREATE OPERATOR - ( LEFTARG = spoint, RIGHTARG = strans, PROCEDURE = strans_point_inverse ); COMMENT ON OPERATOR - (spoint, strans) IS 'transforms inverse a spherical point'; CREATE FUNCTION strans_trans(strans, strans) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_trans' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_trans (strans, strans) IS 'returns a transformated Euler transformation'; CREATE OPERATOR + ( LEFTARG = strans, RIGHTARG = strans, PROCEDURE = strans_trans ); COMMENT ON OPERATOR + (strans, strans) IS 'transforms a Euler transformation'; CREATE FUNCTION strans_trans_inv(strans, strans) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_trans_inv' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_trans_inv (strans, strans) IS 'returns a inverse transformated Euler transformation'; CREATE OPERATOR - ( LEFTARG = strans, RIGHTARG = strans, PROCEDURE = strans_trans_inv ); COMMENT ON OPERATOR - (strans, strans) IS 'transforms inverse a Euler transformation'; pgsphere-1.5.1/pgs_gist.sql.in000066400000000000000000000336721461140101500163040ustar00rootroot00000000000000 -- Spherical key definition' CREATE FUNCTION spherekey_in(CSTRING) RETURNS spherekey AS 'MODULE_PATHNAME' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spherekey_out(spherekey) RETURNS CSTRING AS 'MODULE_PATHNAME' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE spherekey ( internallength = 24, input = spherekey_in, output = spherekey_out ); CREATE FUNCTION pointkey_in(CSTRING) RETURNS pointkey AS 'MODULE_PATHNAME', 'pointkey_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION pointkey_out(pointkey) RETURNS CSTRING AS 'MODULE_PATHNAME', 'pointkey_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION pointkey_volume(pointkey) RETURNS float8 AS 'MODULE_PATHNAME', 'pointkey_volume' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION pointkey_area(pointkey) RETURNS float8 AS 'MODULE_PATHNAME', 'pointkey_area' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION pointkey_perimeter(pointkey) RETURNS float8 AS 'MODULE_PATHNAME', 'pointkey_perimeter' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE TYPE pointkey ( input = pointkey_in, output = pointkey_out, internallength = -1, ALIGNMENT = int4, STORAGE = PLAIN ); -- GIST common CREATE FUNCTION g_spherekey_decompress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spherekey_decompress' LANGUAGE 'c'; CREATE FUNCTION g_spherekey_union(bytea, internal) RETURNS spherekey AS 'MODULE_PATHNAME', 'g_spherekey_union' LANGUAGE 'c'; CREATE FUNCTION g_spherekey_penalty (internal, internal, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spherekey_penalty' LANGUAGE 'c' STRICT; CREATE FUNCTION g_spherekey_picksplit(internal, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spherekey_picksplit' LANGUAGE 'c'; CREATE FUNCTION g_spherekey_same (spherekey, spherekey, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spherekey_same' LANGUAGE 'c'; -- create the operator class for spherical points CREATE FUNCTION g_spoint_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint_compress' LANGUAGE 'c'; CREATE FUNCTION g_spoint_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint_consistent' LANGUAGE 'c'; CREATE FUNCTION g_spoint_distance(internal, spoint, smallint, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint_distance' LANGUAGE 'c'; CREATE OPERATOR CLASS spoint DEFAULT FOR TYPE spoint USING gist AS OPERATOR 1 = (spoint, spoint), OPERATOR 11 @ (spoint, scircle), OPERATOR 12 @ (spoint, sline), OPERATOR 13 @ (spoint, spath), OPERATOR 14 @ (spoint, spoly), OPERATOR 15 @ (spoint, sellipse), OPERATOR 16 @ (spoint, sbox), OPERATOR 17 <-> (spoint, spoint) FOR ORDER BY float_ops, OPERATOR 37 <@ (spoint, scircle), OPERATOR 38 <@ (spoint, sline), OPERATOR 39 <@ (spoint, spath), OPERATOR 40 <@ (spoint, spoly), OPERATOR 41 <@ (spoint, sellipse), OPERATOR 42 <@ (spoint, sbox), FUNCTION 1 g_spoint_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_spoint_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), FUNCTION 8 g_spoint_distance (internal, spoint, smallint, oid, internal), STORAGE spherekey; -- create the operator class for spherical circle CREATE FUNCTION g_scircle_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_scircle_compress' LANGUAGE 'c'; CREATE FUNCTION g_scircle_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_scircle_consistent' LANGUAGE 'c'; CREATE OPERATOR CLASS scircle DEFAULT FOR TYPE scircle USING gist AS OPERATOR 1 = (scircle, scircle), OPERATOR 11 @ (scircle, scircle), OPERATOR 12 @ (scircle, spoly), OPERATOR 13 @ (scircle, sellipse), OPERATOR 14 @ (scircle, sbox), OPERATOR 21 ~ (scircle, spoint), OPERATOR 22 ~ (scircle, scircle), OPERATOR 23 ~ (scircle, sline), OPERATOR 24 ~ (scircle, spath), OPERATOR 25 ~ (scircle, spoly), OPERATOR 26 ~ (scircle, sellipse), OPERATOR 27 ~ (scircle, sbox), OPERATOR 31 && (scircle, scircle), OPERATOR 32 && (scircle, sline), OPERATOR 33 && (scircle, spath), OPERATOR 34 && (scircle, spoly), OPERATOR 35 && (scircle, sellipse), OPERATOR 36 && (scircle, sbox), OPERATOR 37 <@ (scircle, scircle), OPERATOR 38 <@ (scircle, spoly), OPERATOR 39 <@ (scircle, sellipse), OPERATOR 40 <@ (scircle, sbox), OPERATOR 43 @> (scircle, spoint), OPERATOR 44 @> (scircle, scircle), OPERATOR 45 @> (scircle, sline), OPERATOR 46 @> (scircle, spath), OPERATOR 47 @> (scircle, spoly), OPERATOR 48 @> (scircle, sellipse), OPERATOR 49 @> (scircle, sbox), FUNCTION 1 g_scircle_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_scircle_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), STORAGE spherekey; -- create the operator class for spherical line CREATE FUNCTION g_sline_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_sline_compress' LANGUAGE 'c'; CREATE FUNCTION g_sline_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_sline_consistent' LANGUAGE 'c'; CREATE OPERATOR CLASS sline DEFAULT FOR TYPE sline USING gist AS OPERATOR 1 = (sline, sline), OPERATOR 2 # (sline, sline), OPERATOR 11 @ (sline, scircle), OPERATOR 12 @ (sline, spoly), OPERATOR 13 @ (sline, sellipse), OPERATOR 14 @ (sline, sbox), OPERATOR 21 ~ (sline, spoint), OPERATOR 31 && (sline, scircle), OPERATOR 32 && (sline, sline), OPERATOR 33 && (sline, spath), OPERATOR 34 && (sline, spoly), OPERATOR 35 && (sline, sellipse), OPERATOR 36 && (sline, sbox), OPERATOR 37 <@ (sline, scircle), OPERATOR 38 <@ (sline, spoly), OPERATOR 39 <@ (sline, sellipse), OPERATOR 40 <@ (sline, sbox), OPERATOR 43 @> (sline, spoint), FUNCTION 1 g_sline_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_sline_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), STORAGE spherekey; -- create the operator class for spherical ellipse CREATE FUNCTION g_sellipse_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_sellipse_compress' LANGUAGE 'c'; CREATE FUNCTION g_sellipse_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_sellipse_consistent' LANGUAGE 'c'; CREATE OPERATOR CLASS sellipse DEFAULT FOR TYPE sellipse USING gist AS OPERATOR 1 = (sellipse, sellipse), OPERATOR 11 @ (sellipse, scircle), OPERATOR 12 @ (sellipse, spoly), OPERATOR 13 @ (sellipse, sellipse), OPERATOR 14 @ (sellipse, sbox), OPERATOR 21 ~ (sellipse, spoint), OPERATOR 22 ~ (sellipse, scircle), OPERATOR 23 ~ (sellipse, sline), OPERATOR 24 ~ (sellipse, spath), OPERATOR 25 ~ (sellipse, spoly), OPERATOR 26 ~ (sellipse, sellipse), OPERATOR 27 ~ (sellipse, sbox), OPERATOR 31 && (sellipse, scircle), OPERATOR 32 && (sellipse, sline), OPERATOR 33 && (sellipse, spath), OPERATOR 34 && (sellipse, spoly), OPERATOR 35 && (sellipse, sellipse), OPERATOR 36 && (sellipse, sbox), OPERATOR 37 <@ (sellipse, scircle), OPERATOR 38 <@ (sellipse, spoly), OPERATOR 39 <@ (sellipse, sellipse), OPERATOR 40 <@ (sellipse, sbox), OPERATOR 43 @> (sellipse, spoint), OPERATOR 44 @> (sellipse, scircle), OPERATOR 45 @> (sellipse, sline), OPERATOR 46 @> (sellipse, spath), OPERATOR 47 @> (sellipse, spoly), OPERATOR 48 @> (sellipse, sellipse), OPERATOR 49 @> (sellipse, sbox), FUNCTION 1 g_sellipse_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_sellipse_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), STORAGE spherekey; -- create the operator class for spherical polygon CREATE FUNCTION g_spoly_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoly_compress' LANGUAGE 'c'; CREATE FUNCTION g_spoly_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoly_consistent' LANGUAGE 'c'; CREATE OPERATOR CLASS spoly DEFAULT FOR TYPE spoly USING gist AS OPERATOR 1 = (spoly, spoly), OPERATOR 11 @ (spoly, scircle), OPERATOR 12 @ (spoly, spoly), OPERATOR 13 @ (spoly, sellipse), OPERATOR 14 @ (spoly, sbox), OPERATOR 21 ~ (spoly, spoint), OPERATOR 22 ~ (spoly, scircle), OPERATOR 23 ~ (spoly, sline), OPERATOR 24 ~ (spoly, spath), OPERATOR 25 ~ (spoly, spoly), OPERATOR 26 ~ (spoly, sellipse), OPERATOR 27 ~ (spoly, sbox), OPERATOR 31 && (spoly, scircle), OPERATOR 32 && (spoly, sline), OPERATOR 33 && (spoly, spath), OPERATOR 34 && (spoly, spoly), OPERATOR 35 && (spoly, sellipse), OPERATOR 36 && (spoly, sbox), OPERATOR 37 <@ (spoly, scircle), OPERATOR 38 <@ (spoly, spoly), OPERATOR 39 <@ (spoly, sellipse), OPERATOR 40 <@ (spoly, sbox), OPERATOR 43 @> (spoly, spoint), OPERATOR 44 @> (spoly, scircle), OPERATOR 45 @> (spoly, sline), OPERATOR 46 @> (spoly, spath), OPERATOR 47 @> (spoly, spoly), OPERATOR 48 @> (spoly, sellipse), OPERATOR 49 @> (spoly, sbox), FUNCTION 1 g_spoly_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_spoly_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), STORAGE spherekey; -- create the operator class for spherical path CREATE FUNCTION g_spath_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spath_compress' LANGUAGE 'c'; CREATE FUNCTION g_spath_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spath_consistent' LANGUAGE 'c'; CREATE OPERATOR CLASS spath DEFAULT FOR TYPE spath USING gist AS OPERATOR 1 = (spath, spath), OPERATOR 11 @ (spath, scircle), OPERATOR 12 @ (spath, spoly), OPERATOR 13 @ (spath, sellipse), OPERATOR 14 @ (spath, sbox), OPERATOR 21 ~ (spath, spoint), OPERATOR 31 && (spath, scircle), OPERATOR 32 && (spath, sline), OPERATOR 33 && (spath, spath), OPERATOR 34 && (spath, spoly), OPERATOR 35 && (spath, sellipse), OPERATOR 36 && (spath, sbox), OPERATOR 37 <@ (spath, scircle), OPERATOR 38 <@ (spath, spoly), OPERATOR 39 <@ (spath, sellipse), OPERATOR 40 <@ (spath, sbox), OPERATOR 43 @> (spath, spoint), FUNCTION 1 g_spath_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_spath_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), STORAGE spherekey; -- create the operator class for spherical box CREATE FUNCTION g_sbox_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_sbox_compress' LANGUAGE 'c'; CREATE FUNCTION g_sbox_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_sbox_consistent' LANGUAGE 'c'; CREATE OPERATOR CLASS sbox DEFAULT FOR TYPE sbox USING gist AS OPERATOR 1 = (sbox, sbox), OPERATOR 11 @ (sbox, scircle), OPERATOR 12 @ (sbox, spoly), OPERATOR 13 @ (sbox, sellipse), OPERATOR 14 @ (sbox, sbox), OPERATOR 21 ~ (sbox, spoint), OPERATOR 22 ~ (sbox, scircle), OPERATOR 23 ~ (sbox, sline), OPERATOR 24 ~ (sbox, spath), OPERATOR 25 ~ (sbox, spoly), OPERATOR 26 ~ (sbox, sellipse), OPERATOR 27 ~ (sbox, sbox), OPERATOR 31 && (sbox, scircle), OPERATOR 32 && (sbox, sline), OPERATOR 33 && (sbox, spath), OPERATOR 34 && (sbox, spoly), OPERATOR 35 && (sbox, sellipse), OPERATOR 36 && (sbox, sbox), OPERATOR 37 <@ (sbox, scircle), OPERATOR 38 <@ (sbox, spoly), OPERATOR 39 <@ (sbox, sellipse), OPERATOR 40 <@ (sbox, sbox), OPERATOR 43 @> (sbox, spoint), OPERATOR 44 @> (sbox, scircle), OPERATOR 45 @> (sbox, sline), OPERATOR 46 @> (sbox, spath), OPERATOR 47 @> (sbox, spoly), OPERATOR 48 @> (sbox, sellipse), OPERATOR 49 @> (sbox, sbox), FUNCTION 1 g_sbox_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spherekey_union (bytea, internal), FUNCTION 3 g_sbox_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spherekey_penalty (internal, internal, internal), FUNCTION 6 g_spherekey_picksplit (internal, internal), FUNCTION 7 g_spherekey_same (spherekey, spherekey, internal), STORAGE spherekey; pgsphere-1.5.1/pgs_gist_pointkey.sql.in000066400000000000000000000016221461140101500202140ustar00rootroot00000000000000CREATE FUNCTION pointkey_in(CSTRING) RETURNS pointkey AS 'MODULE_PATHNAME', 'pointkey_in' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION pointkey_out(pointkey) RETURNS CSTRING AS 'MODULE_PATHNAME', 'pointkey_out' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION pointkey_volume(pointkey) RETURNS float8 AS 'MODULE_PATHNAME', 'pointkey_volume' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION pointkey_area(pointkey) RETURNS float8 AS 'MODULE_PATHNAME', 'pointkey_area' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION pointkey_perimeter(pointkey) RETURNS float8 AS 'MODULE_PATHNAME', 'pointkey_perimeter' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE TYPE pointkey ( input = pointkey_in, output = pointkey_out, internallength = VARIABLE, ALIGNMENT = double, STORAGE = PLAIN ); pgsphere-1.5.1/pgs_gist_spoint3.sql.in000066400000000000000000000043531461140101500177550ustar00rootroot00000000000000-- create the next generation operator class for spherical points CREATE FUNCTION g_spoint3_union(bytea, internal) RETURNS spherekey AS 'MODULE_PATHNAME', 'g_spoint3_union' LANGUAGE 'c'; CREATE FUNCTION g_spoint3_penalty (internal, internal, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint3_penalty' LANGUAGE 'c' STRICT PARALLEL SAFE; CREATE FUNCTION g_spoint3_picksplit(internal, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint3_picksplit' LANGUAGE 'c'; CREATE FUNCTION g_spoint3_same (bytea, bytea, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint3_same' LANGUAGE 'c'; CREATE FUNCTION g_spoint3_compress(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint3_compress' LANGUAGE 'c'; CREATE FUNCTION g_spoint3_consistent(internal, internal, int4, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint3_consistent' LANGUAGE 'c'; CREATE FUNCTION g_spoint3_distance(internal, internal, int4, oid) RETURNS float8 AS 'MODULE_PATHNAME', 'g_spoint3_distance' LANGUAGE 'c'; CREATE FUNCTION g_spoint3_fetch(internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint3_fetch' LANGUAGE 'c' STRICT PARALLEL SAFE; CREATE OPERATOR CLASS spoint3 FOR TYPE spoint USING gist AS OPERATOR 1 = (spoint, spoint), OPERATOR 11 @ (spoint, scircle), OPERATOR 12 @ (spoint, sline), OPERATOR 13 @ (spoint, spath), OPERATOR 14 @ (spoint, spoly), OPERATOR 15 @ (spoint, sellipse), OPERATOR 16 @ (spoint, sbox), OPERATOR 37 <@ (spoint, scircle), OPERATOR 38 <@ (spoint, sline), OPERATOR 39 <@ (spoint, spath), OPERATOR 40 <@ (spoint, spoly), OPERATOR 41 <@ (spoint, sellipse), OPERATOR 42 <@ (spoint, sbox), OPERATOR 100 <-> (spoint, spoint) FOR ORDER BY float_ops, FUNCTION 1 g_spoint3_consistent (internal, internal, int4, oid, internal), FUNCTION 2 g_spoint3_union (bytea, internal), FUNCTION 3 g_spoint3_compress (internal), FUNCTION 4 g_spherekey_decompress (internal), FUNCTION 5 g_spoint3_penalty (internal, internal, internal), FUNCTION 6 g_spoint3_picksplit (internal, internal), FUNCTION 7 g_spoint3_same (bytea, bytea, internal), FUNCTION 8 g_spoint3_distance (internal, internal, int4, oid), FUNCTION 9 (spoint, spoint) g_spoint3_fetch (internal), STORAGE pointkey; pgsphere-1.5.1/pgs_gist_support.sql.in000066400000000000000000000006021461140101500200630ustar00rootroot00000000000000-- PG12+ has support functions CREATE FUNCTION spoint_dwithin_supportfn (internal) RETURNS internal AS 'MODULE_PATHNAME', 'spherepoint_dwithin_supportfn' LANGUAGE 'c'; COMMENT ON FUNCTION spoint_dwithin_supportfn(internal) IS 'support function for spoint_dwithin'; ALTER FUNCTION spoint_dwithin(spoint, spoint, float8) SUPPORT spoint_dwithin_supportfn; pgsphere-1.5.1/pgs_hash.sql.in000066400000000000000000000010001461140101500162350ustar00rootroot00000000000000CREATE FUNCTION spoint_hash32 (spoint) RETURNS int IMMUTABLE STRICT PARALLEL SAFE LANGUAGE C AS 'MODULE_PATHNAME', 'spherepoint_hash32'; UPDATE pg_operator SET oprcanhash = true WHERE oprname = '=' AND oprleft = 'spoint'::regtype AND oprright = 'spoint'::regtype; /* PG17: ALTER OPERATOR = (spoint, spoint) SET (HASHES); */ CREATE OPERATOR CLASS spoint_hash_ops DEFAULT FOR TYPE spoint USING hash AS OPERATOR 1 = (spoint, spoint), FUNCTION 1 spoint_hash32(spoint); pgsphere-1.5.1/pgs_line.sql.in000066400000000000000000000337321461140101500162620ustar00rootroot00000000000000-- **************************** -- -- spherical line functions -- -- **************************** CREATE FUNCTION sline(spoint, spoint) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_from_points' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline(spoint, spoint) IS 'returns a spherical line using begin (arg1) and end (arg2)'; CREATE FUNCTION sline(strans, float8) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_from_trans' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline(strans, float8) IS 'returns a spherical line using Euler transformation (arg1) and length (arg2)'; CREATE FUNCTION meridian(float8) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_meridian' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION meridian(float8) IS 'returns a spherical line as a meridian along longitude arg'; CREATE FUNCTION sl_beg(sline) RETURNS spoint AS 'MODULE_PATHNAME', 'sphereline_begin' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sl_beg(sline) IS 'returns the begin of a spherical line'; CREATE FUNCTION sl_end(sline) RETURNS spoint AS 'MODULE_PATHNAME', 'sphereline_end' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sl_end(sline) IS 'returns the end of a spherical line'; -- -- Cast line as Euler transformation -- CREATE FUNCTION strans(sline) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_from_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans(sline) IS 'converts line to a transformation (ZXZ)'; CREATE CAST (sline AS strans) WITH FUNCTION strans(sline) AS IMPLICIT; -- -- Cast point as line -- CREATE FUNCTION sline(spoint) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_from_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline(spoint) IS 'casts a spherical point to a spherical line'; CREATE CAST (spoint AS sline) WITH FUNCTION sline(spoint) AS IMPLICIT; -- *************************** -- -- spherical line operators -- -- *************************** -- -- equal -- CREATE FUNCTION sline_equal(sline, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_equal(sline, sline) IS 'returns true, if spherical lines are equal'; CREATE OPERATOR = ( LEFTARG = sline, RIGHTARG = sline, COMMUTATOR = = , NEGATOR = <>, PROCEDURE = sline_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (sline, sline) IS 'true, if spherical lines are equal'; -- -- not equal -- CREATE FUNCTION sline_equal_neg(sline, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_equal_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_equal_neg(sline, sline) IS 'returns true, if spherical lines are not equal'; CREATE OPERATOR <> ( LEFTARG = sline, RIGHTARG = sline, COMMUTATOR = <>, NEGATOR = = , PROCEDURE = sline_equal_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (sline, sline) IS 'true, if spherical lines are not equal'; -- -- length -- CREATE FUNCTION length(sline) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'sphereline_length' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION length(sline) IS 'returns the length of a spherical line (in radians)'; CREATE OPERATOR @-@ ( RIGHTARG = sline, PROCEDURE = length ); COMMENT ON OPERATOR @-@ (NONE, sline) IS 'length of spherical line'; -- -- swap begin and end -- CREATE FUNCTION swap(sline) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_swap_beg_end' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION swap(sline) IS 'returns a spherical line with swapped begin and end'; CREATE OPERATOR - ( RIGHTARG = sline, PROCEDURE = swap ); COMMENT ON OPERATOR - (NONE, sline) IS 'swaps begin and and of a spherical line'; -- -- turns path of line -- CREATE FUNCTION turn(sline) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_turn' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION turn(sline) IS 'returns a turned spherical line but keeps begin and end'; CREATE OPERATOR ! ( RIGHTARG = sline, PROCEDURE = turn ); COMMENT ON OPERATOR ! (NONE, sline) IS 'turns a spherical line, but keep begin and end,'; -- -- line crossing -- CREATE FUNCTION sline_crosses(sline, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_crosses' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_crosses(sline, sline) IS 'returns true if spherical lines cross'; CREATE OPERATOR # ( LEFTARG = sline, RIGHTARG = sline, COMMUTATOR = #, NEGATOR = !#, PROCEDURE = sline_crosses, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR # (sline, sline) IS 'true, if spherical lines cross'; -- -- lines do not cross -- CREATE FUNCTION sline_crosses_neg(sline, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_crosses_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_crosses_neg(sline, sline) IS 'returns true if spherical lines do not cross'; CREATE OPERATOR !# ( LEFTARG = sline, RIGHTARG = sline, COMMUTATOR = !#, NEGATOR = #, PROCEDURE = sline_crosses_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !# (sline, sline) IS 'true, if spherical lines do not cross'; -- -- lines overlap -- CREATE FUNCTION sline_overlap(sline, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_overlap' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_overlap(sline, sline) IS 'returns true if spherical lines overlap or cross'; CREATE OPERATOR && ( LEFTARG = sline, RIGHTARG = sline, PROCEDURE = sline_overlap, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sline, sline) IS 'true if spherical line overlap or cross'; -- -- lines do not overlap -- CREATE FUNCTION sline_overlap_neg(sline, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_overlap_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_overlap_neg(sline, sline) IS 'returns true if spherical lines do not overlap or cross'; CREATE OPERATOR !&& ( LEFTARG = sline, RIGHTARG = sline, PROCEDURE = sline_overlap, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sline, sline) IS 'true if spherical lines do not overlap or cross'; -- -- line contains point -- CREATE FUNCTION sline_contains_point (sline, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_cont_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_contains_point (sline, spoint) IS 'returns true if spherical line contains spherical point'; -- -- point is contained by line -- CREATE FUNCTION sline_contains_point_com (spoint, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_cont_point_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_contains_point_com (spoint, sline) IS 'returns true if spherical line contains spherical point'; -- -- line does not contain point -- CREATE FUNCTION sline_contains_point_neg (sline, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_cont_point_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_contains_point_neg (sline, spoint) IS 'returns true if spherical line does not contain spherical point'; -- -- point is not contained by line -- CREATE FUNCTION sline_contains_point_com_neg (spoint, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_cont_point_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_contains_point_com_neg (spoint, sline) IS 'returns true if spherical line does not contain spherical point'; -- -- Transformation of line -- CREATE FUNCTION strans_line(sline, strans) RETURNS sline AS 'MODULE_PATHNAME', 'spheretrans_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_line (sline, strans) IS 'returns a transformated spherical line'; CREATE OPERATOR + ( LEFTARG = sline, RIGHTARG = strans, PROCEDURE = strans_line ); COMMENT ON OPERATOR + (sline, strans) IS 'transforms a spherical line'; CREATE FUNCTION strans_line_inverse(sline, strans) RETURNS sline AS 'MODULE_PATHNAME', 'spheretrans_line_inverse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_line_inverse (sline, strans) IS 'returns a inverse transformated spherical line'; CREATE OPERATOR - ( LEFTARG = sline, RIGHTARG = strans, PROCEDURE = strans_line_inverse ); COMMENT ON OPERATOR - (sline, strans) IS 'transforms inverse a spherical line'; -- -- line overlaps circle -- CREATE FUNCTION sline_overlap_circle(sline, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_overlap_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_overlap_circle(sline, scircle) IS 'returns true if spherical line overlaps spherical circle'; CREATE OPERATOR && ( LEFTARG = sline, RIGHTARG = scircle, PROCEDURE = sline_overlap_circle, COMMUTATOR = '&&', NEGATOR = '!&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sline, scircle) IS 'true if spherical line overlaps spherical circle'; -- -- circle overlaps line -- CREATE FUNCTION sline_overlap_circle_com(scircle, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_overlap_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_overlap_circle_com(scircle, sline) IS 'returns true if spherical line overlaps spherical circle'; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = sline, PROCEDURE = sline_overlap_circle_com, COMMUTATOR = '&&', NEGATOR = '!&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (scircle, sline) IS 'true if spherical line overlaps spherical circle'; -- -- line does not overlap circle -- CREATE FUNCTION sline_overlap_circle_neg(sline, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_overlap_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_overlap_circle_neg(sline, scircle) IS 'returns true if spherical line does not overlap spherical circle'; CREATE OPERATOR !&& ( LEFTARG = sline, RIGHTARG = scircle, PROCEDURE = sline_overlap_circle_neg, COMMUTATOR = '!&&', NEGATOR = '&&' , RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sline, scircle) IS 'true if spherical line does not overlap spherical circle'; -- -- circle does not overlap line -- CREATE FUNCTION sline_overlap_circle_com_neg(scircle, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereline_overlap_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sline_overlap_circle_com_neg(scircle, sline) IS 'returns true if spherical line overlaps spherical circle'; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = sline, PROCEDURE = sline_overlap_circle_com, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (scircle, sline) IS 'true if spherical line does not overlap spherical circle'; -- -- circle contains line -- CREATE FUNCTION scircle_contains_line(scircle, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_line(scircle, sline) IS 'returns true if spherical circle contains spherical line'; -- -- line is contained by circle -- CREATE FUNCTION scircle_contains_line_com(sline, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_line_com(sline, scircle) IS 'returns true if spherical circle contains spherical line'; -- -- circle does not contain line -- CREATE FUNCTION scircle_contains_line_neg(scircle, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_line_neg(scircle, sline) IS 'returns true if spherical circle does not contain spherical line'; -- -- line is not contained by circle -- CREATE FUNCTION scircle_contains_line_com_neg(sline, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_line_com_neg(sline, scircle) IS 'returns true if spherical circle does not contain spherical line'; -- -- distance between line and point -- CREATE FUNCTION dist(sline, spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'sphereline_point_distance' LANGUAGE 'c' IMMUTABLE STRICT; COMMENT ON FUNCTION dist(sline, spoint) IS 'returns the distance between spherical line and spherical point'; CREATE OPERATOR <-> ( LEFTARG = sline, RIGHTARG = spoint, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (sline, spoint) IS 'returns the distance between spherical line and spherical point'; -- -- distance between point and line -- CREATE FUNCTION dist(spoint, sline) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'sphereline_point_distance_com' LANGUAGE 'c' IMMUTABLE STRICT; COMMENT ON FUNCTION dist(spoint, sline) IS 'returns the distance between spherical line and spherical point'; CREATE OPERATOR <-> ( LEFTARG = spoint, RIGHTARG = sline, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (spoint, sline) IS 'returns the distance between spherical line and spherical point'; pgsphere-1.5.1/pgs_moc_geo_casts.sql.in000066400000000000000000000243451461140101500201400ustar00rootroot00000000000000-- MOC/geometry automatic casts. -- Generated 2021-12-08 by gen_moccast.py. -- You probably do not want to re-generate this; fixes need to be updates -- on the SQL level. -- ################################# -- Cleanup set client_min_messages = 'warning'; DROP OPERATOR IF EXISTS <@ (smoc, scircle), <@ (scircle, smoc), <@ (smoc, spoly), <@ (spoly, smoc), !<@ (smoc, scircle), !<@ (scircle, smoc), !<@ (smoc, spoly), !<@ (spoly, smoc), @> (smoc, scircle), @> (scircle, smoc), @> (smoc, spoly), @> (spoly, smoc), !@> (smoc, scircle), !@> (scircle, smoc), !@> (smoc, spoly), !@> (spoly, smoc); reset client_min_messages; -- ################################# -- smoc/geo OVERLAPS CREATE OR REPLACE FUNCTION scircle_subset_smoc( geo_arg scircle, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) <@ a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR <@ ( LEFTARG = scircle, RIGHTARG = smoc, PROCEDURE = scircle_subset_smoc, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_subset_scircle( a_moc smoc, geo_arg scircle) RETURNS BOOL AS $body$ SELECT a_moc <@ smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR <@ ( LEFTARG = smoc, RIGHTARG = scircle, PROCEDURE = smoc_subset_scircle, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION spoly_subset_smoc( geo_arg spoly, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) <@ a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR <@ ( LEFTARG = spoly, RIGHTARG = smoc, PROCEDURE = spoly_subset_smoc, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_subset_spoly( a_moc smoc, geo_arg spoly) RETURNS BOOL AS $body$ SELECT a_moc <@ smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR <@ ( LEFTARG = smoc, RIGHTARG = spoly, PROCEDURE = smoc_subset_spoly, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION scircle_not_subset_smoc( geo_arg scircle, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) !<@ a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !<@ ( LEFTARG = scircle, RIGHTARG = smoc, PROCEDURE = scircle_not_subset_smoc, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_not_subset_scircle( a_moc smoc, geo_arg scircle) RETURNS BOOL AS $body$ SELECT a_moc !<@ smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !<@ ( LEFTARG = smoc, RIGHTARG = scircle, PROCEDURE = smoc_not_subset_scircle, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION spoly_not_subset_smoc( geo_arg spoly, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) !<@ a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !<@ ( LEFTARG = spoly, RIGHTARG = smoc, PROCEDURE = spoly_not_subset_smoc, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_not_subset_spoly( a_moc smoc, geo_arg spoly) RETURNS BOOL AS $body$ SELECT a_moc !<@ smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !<@ ( LEFTARG = smoc, RIGHTARG = spoly, PROCEDURE = smoc_not_subset_spoly, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION scircle_superset_smoc( geo_arg scircle, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) @> a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR @> ( LEFTARG = scircle, RIGHTARG = smoc, PROCEDURE = scircle_superset_smoc, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_superset_scircle( a_moc smoc, geo_arg scircle) RETURNS BOOL AS $body$ SELECT a_moc @> smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR @> ( LEFTARG = smoc, RIGHTARG = scircle, PROCEDURE = smoc_superset_scircle, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION spoly_superset_smoc( geo_arg spoly, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) @> a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR @> ( LEFTARG = spoly, RIGHTARG = smoc, PROCEDURE = spoly_superset_smoc, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_superset_spoly( a_moc smoc, geo_arg spoly) RETURNS BOOL AS $body$ SELECT a_moc @> smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR @> ( LEFTARG = smoc, RIGHTARG = spoly, PROCEDURE = smoc_superset_spoly, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION scircle_not_superset_smoc( geo_arg scircle, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) !@> a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !@> ( LEFTARG = scircle, RIGHTARG = smoc, PROCEDURE = scircle_not_superset_smoc, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_not_superset_scircle( a_moc smoc, geo_arg scircle) RETURNS BOOL AS $body$ SELECT a_moc !@> smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !@> ( LEFTARG = smoc, RIGHTARG = scircle, PROCEDURE = smoc_not_superset_scircle, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION spoly_not_superset_smoc( geo_arg spoly, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) !@> a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = smoc, PROCEDURE = spoly_not_superset_smoc, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_not_superset_spoly( a_moc smoc, geo_arg spoly) RETURNS BOOL AS $body$ SELECT a_moc !@> smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !@> ( LEFTARG = smoc, RIGHTARG = spoly, PROCEDURE = smoc_not_superset_spoly, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); -- ################################# -- smoc/geo INTERSECTS CREATE OR REPLACE FUNCTION scircle_intersect_smoc( geo_arg scircle, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) && a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = smoc, PROCEDURE = scircle_intersect_smoc, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_intersect_scircle( a_moc smoc, geo_arg scircle) RETURNS BOOL AS $body$ SELECT a_moc && smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR && ( LEFTARG = smoc, RIGHTARG = scircle, PROCEDURE = smoc_intersect_scircle, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION spoly_intersect_smoc( geo_arg spoly, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) && a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = smoc, PROCEDURE = spoly_intersect_smoc, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_intersect_spoly( a_moc smoc, geo_arg spoly) RETURNS BOOL AS $body$ SELECT a_moc && smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR && ( LEFTARG = smoc, RIGHTARG = spoly, PROCEDURE = smoc_intersect_spoly, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION scircle_not_intersect_smoc( geo_arg scircle, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) !&& a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = smoc, PROCEDURE = scircle_not_intersect_smoc, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_not_intersect_scircle( a_moc smoc, geo_arg scircle) RETURNS BOOL AS $body$ SELECT a_moc !&& smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !&& ( LEFTARG = smoc, RIGHTARG = scircle, PROCEDURE = smoc_not_intersect_scircle, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION spoly_not_intersect_smoc( geo_arg spoly, a_moc smoc) RETURNS BOOL AS $body$ SELECT smoc(max_order(a_moc), geo_arg) !&& a_moc $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = smoc, PROCEDURE = spoly_not_intersect_smoc, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OR REPLACE FUNCTION smoc_not_intersect_spoly( a_moc smoc, geo_arg spoly) RETURNS BOOL AS $body$ SELECT a_moc !&& smoc(max_order(a_moc), geo_arg) $body$ LANGUAGE SQL STABLE PARALLEL SAFE; CREATE OPERATOR !&& ( LEFTARG = smoc, RIGHTARG = spoly, PROCEDURE = smoc_not_intersect_spoly, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); pgsphere-1.5.1/pgs_moc_ops.sql.in000066400000000000000000000200361461140101500167630ustar00rootroot00000000000000-- debugging CREATE FUNCTION smoc_info (smoc) RETURNS text AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; CREATE FUNCTION area (smoc) RETURNS double precision AS 'MODULE_PATHNAME', 'smoc_area' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; -- boolean operations CREATE FUNCTION smoc_eq (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_eq (smoc, smoc) IS 'equal'; CREATE OPERATOR = ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_eq, COMMUTATOR = '=', NEGATOR = '<>', RESTRICT = eqsel, JOIN = eqjoinsel ); COMMENT ON OPERATOR = (smoc, smoc) IS 'equal'; CREATE FUNCTION smoc_neq (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_neq (smoc, smoc) IS 'not equal'; CREATE OPERATOR <> ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_neq, COMMUTATOR = '<>', NEGATOR = '=', RESTRICT = neqsel, JOIN = neqjoinsel ); COMMENT ON OPERATOR <> (smoc, smoc) IS 'not equal'; CREATE FUNCTION smoc_overlap (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_overlap (smoc, smoc) IS 'overlaps'; CREATE OPERATOR && ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_overlap, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (smoc, smoc) IS 'overlaps'; CREATE FUNCTION smoc_overlap_neg (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_overlap_neg (smoc, smoc) IS 'overlaps not'; CREATE OPERATOR !&& ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_overlap_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (smoc, smoc) IS 'overlaps not'; CREATE FUNCTION smoc_subset_smoc (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_subset_smoc (smoc, smoc) IS 'is contained by'; CREATE OPERATOR <@ ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_subset_smoc, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <@ (smoc, smoc) IS 'is contained by'; CREATE FUNCTION smoc_subset_smoc_neg (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_subset_smoc_neg (smoc, smoc) IS 'is not contained by'; CREATE OPERATOR !<@ ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_subset_smoc_neg, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !<@ (smoc, smoc) IS 'is not contained by'; CREATE FUNCTION smoc_superset_smoc (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_superset_smoc (smoc, smoc) IS 'contains'; CREATE OPERATOR @> ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_superset_smoc, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR @> (smoc, smoc) IS 'contains'; CREATE FUNCTION smoc_superset_smoc_neg (smoc, smoc) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_superset_smoc_neg (smoc, smoc) IS 'does not contain'; CREATE OPERATOR !@> ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_superset_smoc_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (smoc, smoc) IS 'does not contain'; -- union and intersection CREATE FUNCTION smoc_union (smoc, smoc) RETURNS smoc AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_union (smoc, smoc) IS 'union'; CREATE OPERATOR | ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_union ); COMMENT ON OPERATOR | (smoc, smoc) IS 'union'; CREATE AGGREGATE sum (smoc) ( SFUNC = smoc_union, STYPE = smoc ); COMMENT ON AGGREGATE sum (smoc) IS 'smoc union aggregate'; CREATE FUNCTION smoc_intersection (smoc, smoc) RETURNS smoc AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_intersection (smoc, smoc) IS 'intersection'; CREATE OPERATOR & ( LEFTARG = smoc, RIGHTARG = smoc, PROCEDURE = smoc_intersection ); COMMENT ON OPERATOR & (smoc, smoc) IS 'intersection'; CREATE AGGREGATE intersection (smoc) ( SFUNC = smoc_intersection, STYPE = smoc ); COMMENT ON AGGREGATE intersection (smoc) IS 'smoc intersection aggregate'; -- smoc constructors CREATE FUNCTION smoc_degrade ("order" int, smoc) RETURNS smoc AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_degrade ("order" int, smoc) IS 'reduce order of smoc'; CREATE FUNCTION smoc ("order" int, spoint) RETURNS smoc AS 'MODULE_PATHNAME', 'smoc_spoint' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc ("order" int, spoint) IS 'constructs smoc of given order from spoint'; CREATE FUNCTION smoc_disc ("order" int, lng double precision, lat double precision, radius double precision) RETURNS smoc AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc_disc ("order" int, lng double precision, lat double precision, radius double precision) IS 'constructs smoc of given order from circle parameters'; CREATE FUNCTION smoc ("order" int, scircle) RETURNS smoc AS 'MODULE_PATHNAME', 'smoc_scircle' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc ("order" int, scircle) IS 'constructs smoc of given order from scircle'; CREATE FUNCTION smoc ("order" int, spoly) RETURNS smoc AS 'MODULE_PATHNAME', 'smoc_spoly' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; COMMENT ON FUNCTION smoc ("order" int, spoly) IS 'constructs smoc of given order from spoly'; -- GIN index CREATE FUNCTION smoc_gin_extract_value (smoc, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; CREATE FUNCTION smoc_gin_extract_value_fine (smoc, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; CREATE FUNCTION smoc_gin_extract_query (smoc, internal, int2, internal, internal, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; CREATE FUNCTION smoc_gin_extract_query_fine (smoc, internal, int2, internal, internal, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; CREATE FUNCTION smoc_gin_consistent (internal, int2, smoc, int4, internal, internal, internal, internal) RETURNS boolean AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; CREATE OPERATOR CLASS smoc_gin_ops DEFAULT FOR TYPE smoc USING gin AS OPERATOR 1 &&, OPERATOR 2 <@, OPERATOR 3 @>, OPERATOR 4 =, OPERATOR 5 <>, FUNCTION 1 btint4cmp (int4, int4), FUNCTION 2 smoc_gin_extract_value (smoc, internal, internal), FUNCTION 3 smoc_gin_extract_query (smoc, internal, int2, internal, internal, internal, internal), FUNCTION 4 smoc_gin_consistent (internal, int2, smoc, int4, internal, internal, internal, internal), --FUNCTION 5 smoc_gin_compare_partial (), --FUNCTION 6 smoc_gin_tri_consistent (), --FUNCTION 7 (smoc) smoc_gin_options (internal), -- needs PG13 STORAGE int4; CREATE OPERATOR CLASS smoc_gin_ops_fine FOR TYPE smoc USING gin AS OPERATOR 1 &&, OPERATOR 2 <@, OPERATOR 3 @>, OPERATOR 4 =, OPERATOR 5 <>, FUNCTION 1 btint4cmp (int4, int4), FUNCTION 2 smoc_gin_extract_value_fine (smoc, internal, internal), FUNCTION 3 smoc_gin_extract_query_fine (smoc, internal, int2, internal, internal, internal, internal), FUNCTION 4 smoc_gin_consistent (internal, int2, smoc, int4, internal, internal, internal, internal), --FUNCTION 5 smoc_gin_compare_partial (), --FUNCTION 6 smoc_gin_tri_consistent (), STORAGE int4; pgsphere-1.5.1/pgs_moc_options.sql.in000066400000000000000000000003711461140101500176550ustar00rootroot00000000000000-- GIN opclass options CREATE FUNCTION smoc_gin_options (internal) RETURNS void AS 'MODULE_PATHNAME' LANGUAGE C PARALLEL SAFE IMMUTABLE STRICT; ALTER OPERATOR FAMILY smoc_gin_ops USING gin ADD FUNCTION 7 (smoc) smoc_gin_options (internal); pgsphere-1.5.1/pgs_moc_type.sql.in000066400000000000000000000065321461140101500171500ustar00rootroot00000000000000CREATE TYPE smoc; CREATE FUNCTION smoc_in(cstring) RETURNS smoc AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION smoc_out(smoc) RETURNS cstring AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; CREATE TYPE smoc ( input = smoc_in, output = smoc_out, delimiter = ';', internallength = VARIABLE, alignment = double, storage = EXTERNAL ); CREATE FUNCTION moc_debug() RETURNS text AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION set_smoc_output_type(integer) RETURNS cstring AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION max_order(smoc) RETURNS integer AS 'MODULE_PATHNAME', 'smoc_order' LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION healpix_subset_smoc(bigint, smoc) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION healpix_not_subset_smoc(bigint, smoc) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION smoc_superset_healpix(smoc, bigint) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION smoc_not_superset_healpix(smoc, bigint) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION spoint_subset_smoc(spoint, smoc) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION spoint_not_subset_smoc(spoint, smoc) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION smoc_superset_spoint(smoc, spoint) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE FUNCTION smoc_not_superset_spoint(smoc, spoint) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT PARALLEL SAFE; CREATE OPERATOR <@ ( LEFTARG = bigint, RIGHTARG = smoc, PROCEDURE = healpix_subset_smoc, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR !<@ ( LEFTARG = bigint, RIGHTARG = smoc, PROCEDURE = healpix_not_subset_smoc, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @> ( LEFTARG = smoc, RIGHTARG = bigint, PROCEDURE = smoc_superset_healpix, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR !@> ( LEFTARG = smoc, RIGHTARG = bigint, PROCEDURE = smoc_not_superset_healpix, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR <@ ( LEFTARG = spoint, RIGHTARG = smoc, PROCEDURE = spoint_subset_smoc, COMMUTATOR = '@>', NEGATOR = '!<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR !<@ ( LEFTARG = spoint, RIGHTARG = smoc, PROCEDURE = spoint_not_subset_smoc, COMMUTATOR = '!@>', NEGATOR = '<@', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR @> ( LEFTARG = smoc, RIGHTARG = spoint, PROCEDURE = smoc_superset_spoint, COMMUTATOR = '<@', NEGATOR = '!@>', RESTRICT = contsel, JOIN = contjoinsel ); CREATE OPERATOR !@> ( LEFTARG = smoc, RIGHTARG = spoint, PROCEDURE = smoc_not_superset_spoint, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); pgsphere-1.5.1/pgs_path.sql.in000066400000000000000000000527131461140101500162670ustar00rootroot00000000000000 -- ****************************** -- -- spherical path functions -- -- ****************************** CREATE FUNCTION npoints(spath) RETURNS INT4 AS 'MODULE_PATHNAME', 'spherepath_npts' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION npoints(spath) IS 'returns number of points of spherical path'; CREATE FUNCTION spoint(spath, int4) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepath_get_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint(spath, int4) IS 'returns n-th point of spherical path'; CREATE FUNCTION spoint(spath, float8) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepath_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint(spath, float8) IS 'returns n-th point of spherical path using linear interpolation'; CREATE FUNCTION spath_as_array(spath) RETURNS spoint[] AS 'MODULE_PATHNAME', 'spherepath_get_array' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_as_array(spath) IS 'returns spath as array of points'; -- ****************************** -- -- spherical path operators -- -- ****************************** -- -- equal -- CREATE FUNCTION spath_equal(spath, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_equal(spath, spath) IS 'returns true, if spherical paths are equal'; CREATE OPERATOR = ( LEFTARG = spath, RIGHTARG = spath, COMMUTATOR = = , NEGATOR = <>, PROCEDURE = spath_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (spath, spath) IS 'true, if spherical paths are equal'; -- -- not equal -- CREATE FUNCTION spath_equal_neg(spath, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_equal_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_equal_neg(spath, spath) IS 'returns true, if spherical paths are equal'; CREATE OPERATOR <> ( LEFTARG = spath, RIGHTARG = spath, COMMUTATOR = <>, NEGATOR = = , PROCEDURE = spath_equal_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (spath, spath) IS 'true, if spherical paths are not equal'; -- -- length -- CREATE FUNCTION length(spath) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepath_length' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION length(spath) IS 'returns length of spherical path'; CREATE OPERATOR @-@ ( RIGHTARG = spath, PROCEDURE = length ); COMMENT ON OPERATOR @-@ (NONE, spath) IS 'returns length of spherical path'; -- -- change the direction of path -- CREATE FUNCTION swap(spath) RETURNS spath AS 'MODULE_PATHNAME', 'spherepath_swap' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION swap(spath) IS 'returns a swapped spherical path (changed direction)'; CREATE OPERATOR - ( RIGHTARG = spath, PROCEDURE = swap ); COMMENT ON OPERATOR - (NONE, spath) IS 'changes the direction of a spherical path'; -- -- paths overlap -- CREATE FUNCTION spath_overlap_path(spath, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_overlap_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_overlap_path(spath, spath) IS 'true if spherical path overlaps spherical path'; CREATE OPERATOR && ( LEFTARG = spath, RIGHTARG = spath, PROCEDURE = spath_overlap_path, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spath, spath) IS 'true if spherical paths overlap'; -- -- paths do not overlap -- CREATE FUNCTION spath_overlap_path_neg(spath, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_overlap_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_overlap_path_neg(spath, spath) IS 'true if spherical path does not overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = spath, RIGHTARG = spath, PROCEDURE = spath_overlap_path, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spath, spath) IS 'true if spherical path does not overlap spherical path'; -- -- path contains point -- CREATE FUNCTION spath_contains_point(spath, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_cont_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_contains_point(spath, spoint) IS 'true if spherical path contains spherical point'; -- -- point is contained by path -- CREATE FUNCTION spath_contains_point_com(spoint, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_cont_point_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_contains_point_com(spoint, spath) IS 'true if spherical path contains spherical point'; -- -- path does not contain point -- CREATE FUNCTION spath_contains_point_neg(spath, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_cont_point_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_contains_point_neg(spath, spoint) IS 'true if spherical path does not contain spherical point'; -- -- point is not contained by path -- CREATE FUNCTION spath_contains_point_com_neg(spoint, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_cont_point_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_contains_point_com_neg(spoint, spath) IS 'true if spherical path does not contain spherical point'; -- -- Transformation of path -- CREATE FUNCTION strans_path(spath, strans) RETURNS spath AS 'MODULE_PATHNAME', 'spheretrans_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_path (spath, strans) IS 'returns a transformated spherical path'; CREATE OPERATOR + ( LEFTARG = spath, RIGHTARG = strans, PROCEDURE = strans_path ); COMMENT ON OPERATOR + (spath, strans) IS 'transforms a spherical path'; CREATE FUNCTION strans_path_inverse(spath, strans) RETURNS spath AS 'MODULE_PATHNAME', 'spheretrans_path_inverse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_path_inverse (spath, strans) IS 'returns a inverse transformated spherical path'; CREATE OPERATOR - ( LEFTARG = spath, RIGHTARG = strans, PROCEDURE = strans_path_inverse ); COMMENT ON OPERATOR - (spath, strans) IS 'transforms inverse a spherical path'; -- -- circle contains path -- CREATE FUNCTION scircle_contains_path(scircle, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_path(scircle, spath) IS 'true if spherical circle contains spherical path'; -- -- path is contained by circle -- CREATE FUNCTION scircle_contains_path_com(spath, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_path_com(spath, scircle) IS 'true if spherical circle contains spherical path'; -- -- circle does not contains path -- CREATE FUNCTION scircle_contains_path_neg(scircle, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_path_neg(scircle, spath) IS 'true if spherical circle does not contain spherical path'; -- -- path is not contained by circle -- CREATE FUNCTION scircle_contains_path_com_neg(spath, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_path_com_neg(spath, scircle) IS 'true if spherical circle does not contain spherical path'; -- -- circle overlaps path -- CREATE FUNCTION scircle_overlap_path(scircle, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_overlap_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_overlap_path(scircle, spath) IS 'true if spherical circle overlap spherical path'; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = spath, PROCEDURE = scircle_overlap_path, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (scircle, spath) IS 'true if spherical circle overlap spherical path'; -- -- path overlaps circle -- CREATE FUNCTION scircle_overlap_path_com(spath, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_overlap_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_overlap_path_com(spath, scircle) IS 'true if spherical circle overlap spherical path'; CREATE OPERATOR && ( LEFTARG = spath, RIGHTARG = scircle, PROCEDURE = scircle_overlap_path_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spath, scircle) IS 'true if spherical circle overlap spherical path'; -- -- circle does not overlap path -- CREATE FUNCTION scircle_overlap_path_neg(scircle, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_overlap_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_overlap_path_neg(scircle, spath) IS 'true if spherical circle does not overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = spath, PROCEDURE = scircle_overlap_path_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (scircle, spath) IS 'true if spherical circle does not overlap spherical path'; -- -- path does not overlap circle -- CREATE FUNCTION scircle_overlap_path_com_neg(spath, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_overlap_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_overlap_path_com_neg(spath, scircle) IS 'true if spherical circle overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = spath, RIGHTARG = scircle, PROCEDURE = scircle_overlap_path_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spath, scircle) IS 'true if spherical circle does not overlap spherical path'; -- -- path overlaps line -- CREATE FUNCTION spath_overlap_line(spath, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_overlap_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_overlap_line(spath, sline) IS 'true if spherical path overlaps spherical line'; CREATE OPERATOR && ( LEFTARG = spath, RIGHTARG = sline, PROCEDURE = spath_overlap_line, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spath, sline) IS 'true if spherical line overlap spherical path'; -- -- line overlaps path -- CREATE FUNCTION spath_overlap_line_com(sline, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_overlap_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_overlap_line_com(sline, spath) IS 'true if spherical path overlaps spherical line'; CREATE OPERATOR && ( LEFTARG = sline, RIGHTARG = spath, PROCEDURE = spath_overlap_line_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sline, spath) IS 'true if spherical line overlap spherical path'; -- -- path does not overlap line -- CREATE FUNCTION spath_overlap_line_neg(spath, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_overlap_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_overlap_line_neg(spath, sline) IS 'true if spherical path does not overlap spherical line'; CREATE OPERATOR !&& ( LEFTARG = spath, RIGHTARG = sline, PROCEDURE = spath_overlap_line_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spath, sline) IS 'true if spherical line does not overlap spherical path'; -- -- line does not overlap path -- CREATE FUNCTION spath_overlap_line_com_neg(sline, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepath_overlap_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_overlap_line_com_neg(sline, spath) IS 'true if spherical path does not overlap spherical line'; CREATE OPERATOR !&& ( LEFTARG = sline, RIGHTARG = spath, PROCEDURE = spath_overlap_line_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sline, spath) IS 'true if spherical line does not overlap spherical path'; -- -- ellipse contains path -- CREATE FUNCTION sellipse_contains_path(sellipse, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_path(sellipse, spath) IS 'true if spherical ellipse contains spherical path'; -- -- path is contained by ellipse -- CREATE FUNCTION sellipse_contains_path_com(spath, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_path_com(spath, sellipse) IS 'true if spherical ellipse contains spherical path'; -- -- ellipse does not contains path -- CREATE FUNCTION sellipse_contains_path_neg(sellipse, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_path_neg(sellipse, spath) IS 'true if spherical ellipse does not contain spherical path'; -- -- path is not contained by ellipse -- CREATE FUNCTION sellipse_contains_path_com_neg(spath, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_path_com_neg(spath, sellipse) IS 'true if spherical ellipse does not contain spherical path'; -- -- ellipse overlaps path -- CREATE FUNCTION sellipse_overlap_path(sellipse, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_path(sellipse, spath) IS 'true if spherical ellipse overlap spherical path'; CREATE OPERATOR && ( LEFTARG = sellipse, RIGHTARG = spath, PROCEDURE = sellipse_overlap_path, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sellipse, spath) IS 'true if spherical ellipse overlap spherical path'; -- -- path overlaps ellipse -- CREATE FUNCTION sellipse_overlap_path_com(spath, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_path_com(spath, sellipse) IS 'true if spherical ellipse overlap spherical path'; CREATE OPERATOR && ( LEFTARG = spath, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_path_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spath, sellipse) IS 'true if spherical ellipse overlap spherical path'; -- -- ellipse does not overlap path -- CREATE FUNCTION sellipse_overlap_path_neg(sellipse, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_path_neg(sellipse, spath) IS 'true if spherical ellipse does not overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = sellipse, RIGHTARG = spath, PROCEDURE = sellipse_overlap_path_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sellipse, spath) IS 'true if spherical ellipse does not overlap spherical path'; -- -- path does not overlap ellipse -- CREATE FUNCTION sellipse_overlap_path_com_neg(spath, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_overlap_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_overlap_path_com_neg(spath, sellipse) IS 'true if spherical ellipse overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = spath, RIGHTARG = sellipse, PROCEDURE = sellipse_overlap_path_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spath, sellipse) IS 'true if spherical ellipse does not overlap spherical path'; -- -- polygon contains path -- CREATE FUNCTION spoly_contains_path(spoly, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_path(spoly, spath) IS 'true if spherical polygon contains spherical path'; -- -- path is contained by polygon -- CREATE FUNCTION spoly_contains_path_com(spath, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_path_com(spath, spoly) IS 'true if spherical polygon contains spherical path'; -- -- polygon does not contains path -- CREATE FUNCTION spoly_contains_path_neg(spoly, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_path_neg(spoly, spath) IS 'true if spherical polygon does not contain spherical path'; -- -- path is not contained by polygon -- CREATE FUNCTION spoly_contains_path_com_neg(spath, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_path_com_neg(spath, spoly) IS 'true if spherical polygon does not contain spherical path'; -- -- polygon overlaps path -- CREATE FUNCTION spoly_overlap_path(spoly, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_path' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_path(spoly, spath) IS 'true if spherical polygon overlap spherical path'; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = spath, PROCEDURE = spoly_overlap_path, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoly, spath) IS 'true if spherical polygon overlap spherical path'; -- -- path overlaps polygon -- CREATE FUNCTION spoly_overlap_path_com(spath, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_path_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_path_com(spath, spoly) IS 'true if spherical polygon overlap spherical path'; CREATE OPERATOR && ( LEFTARG = spath, RIGHTARG = spoly, PROCEDURE = spoly_overlap_path_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spath, spoly) IS 'true if spherical polygon overlap spherical path'; -- -- polygon does not overlap path -- CREATE FUNCTION spoly_overlap_path_neg(spoly, spath) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_path_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_path_neg(spoly, spath) IS 'true if spherical polygon does not overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = spath, PROCEDURE = spoly_overlap_path_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spoly, spath) IS 'true if spherical polygon does not overlap spherical path'; -- -- path does not overlap polygon -- CREATE FUNCTION spoly_overlap_path_com_neg(spath, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_path_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_path_com_neg(spath, spoly) IS 'true if spherical polygon overlap spherical path'; CREATE OPERATOR !&& ( LEFTARG = spath, RIGHTARG = spoly, PROCEDURE = spoly_overlap_path_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spath, spoly) IS 'true if spherical polygon does not overlap spherical path'; -- -- Aggregate functions to add points to path -- CREATE FUNCTION spath_add_point_aggr (spath, spoint) RETURNS spath AS 'MODULE_PATHNAME', 'spherepath_add_point' LANGUAGE 'c' IMMUTABLE PARALLEL SAFE; COMMENT ON FUNCTION spath_add_point_aggr (spath, spoint) IS 'adds a spherical point to spherical path. Do not use it standalone!'; CREATE FUNCTION spath_add_points_fin_aggr (spath) RETURNS spath AS 'MODULE_PATHNAME', 'spherepath_add_points_finalize' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_add_points_fin_aggr (spath) IS 'Finalize spherical point adding to spherical path. Do not use it standalone!'; CREATE AGGREGATE spath ( sfunc = spath_add_point_aggr, basetype = spoint, stype = spath, finalfunc = spath_add_points_fin_aggr ); pgsphere-1.5.1/pgs_point.sql.in000066400000000000000000000101641461140101500164560ustar00rootroot00000000000000-- ************************** -- -- spherical point functions -- -- ************************** CREATE FUNCTION pg_sphere_version() RETURNS CSTRING AS 'MODULE_PATHNAME', 'pg_sphere_version' LANGUAGE 'c'; CREATE FUNCTION spoint(FLOAT8, FLOAT8) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepoint_from_long_lat' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION spoint_deg(FLOAT8, FLOAT8) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepoint_from_long_lat_deg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; CREATE FUNCTION set_sphere_output_precision(INT4) RETURNS CSTRING AS 'MODULE_PATHNAME', 'set_sphere_output_precision' LANGUAGE 'c'; CREATE FUNCTION reset_sphere_output_precision() RETURNS CSTRING AS 'MODULE_PATHNAME', 'reset_sphere_output_precision' LANGUAGE 'c'; CREATE FUNCTION set_sphere_output(CSTRING) RETURNS CSTRING AS 'MODULE_PATHNAME', 'set_sphere_output' LANGUAGE 'c'; COMMENT ON FUNCTION spoint(FLOAT8, FLOAT8) IS 'returns a spherical point from longitude (arg1), latitude (arg2)'; COMMENT ON FUNCTION spoint_deg(FLOAT8, FLOAT8) IS 'returns a spherical point from longitude (arg1, in degrees), latitude (arg2, in degrees)'; CREATE FUNCTION long(spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoint_long' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION long(spoint) IS 'longitude of spherical point'; CREATE FUNCTION lat(spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoint_lat' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION lat(spoint) IS 'latitude of spherical point'; CREATE FUNCTION x(spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoint_x' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION x(spoint) IS 'cartesian x value of spherical point'; CREATE FUNCTION y(spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoint_y' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION y(spoint) IS 'cartesian y value of spherical point'; CREATE FUNCTION xyz(spoint) RETURNS FLOAT8[] AS 'MODULE_PATHNAME', 'spherepoint_xyz' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION xyz(spoint) IS 'cartesian values of spherical point'; CREATE FUNCTION z(spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoint_z' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION z(spoint) IS 'cartesian z value of spherical point'; -- *************************** -- -- spherical point operators -- -- *************************** -- -- equal -- CREATE FUNCTION spoint_equal(spoint, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoint_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_equal(spoint, spoint) IS 'returns true, if spherical points are equal'; CREATE OPERATOR = ( LEFTARG = spoint, RIGHTARG = spoint, COMMUTATOR = =, NEGATOR = <>, PROCEDURE = spoint_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (spoint, spoint) IS 'true, if spherical points are equal'; -- -- not equal -- CREATE FUNCTION spoint_equal_neg (spoint, spoint) RETURNS BOOL AS 'SELECT NOT spoint_equal($1,$2);' LANGUAGE 'sql' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_equal_neg (spoint, spoint) IS 'returns true, if spherical points are not equal'; CREATE OPERATOR <> ( LEFTARG = spoint, RIGHTARG = spoint, COMMUTATOR = <>, NEGATOR = =, PROCEDURE = spoint_equal_neg, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (spoint, spoint) IS 'true, if spherical points are not equal'; -- -- distance between points -- CREATE FUNCTION dist(spoint, spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoint_distance' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION dist(spoint, spoint) IS 'distance between spherical points'; CREATE OPERATOR <-> ( LEFTARG = spoint, RIGHTARG = spoint, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (spoint, spoint) IS 'distance between spherical points'; pgsphere-1.5.1/pgs_polygon.sql.in000066400000000000000000000576441461140101500170320ustar00rootroot00000000000000-- ************************** -- -- spherical polygon functions -- -- ************************** CREATE FUNCTION npoints(spoly) RETURNS INT4 AS 'MODULE_PATHNAME', 'spherepoly_npts' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION npoints(spoly) IS 'returns number of points of spherical polygon'; CREATE FUNCTION spoint(spoly, int4) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepoly_get_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint(spoly, int4) IS 'returns n-th point of spherical polygon'; CREATE FUNCTION spoly_as_array(spoly) RETURNS spoint[] AS 'MODULE_PATHNAME', 'spherepoly_get_array' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_as_array(spoly) IS 'returns spoly as array of points'; CREATE FUNCTION area(spoly) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoly_area' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION area(spoly) IS 'returns area of spherical polygon'; -- **************************** -- -- spherical polygon operators -- -- **************************** -- -- equal -- CREATE FUNCTION spoly_equal(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_equal' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_equal(spoly, spoly) IS 'returns true, if spherical polygons are equal'; CREATE OPERATOR = ( LEFTARG = spoly, RIGHTARG = spoly, COMMUTATOR = =, NEGATOR = <>, PROCEDURE = spoly_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR = (spoly, spoly) IS 'true, if spherical polygons are equal'; -- -- not equal -- CREATE FUNCTION spoly_not_equal(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_equal_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_not_equal(spoly, spoly) IS 'returns true, if spherical polygons are not equal'; CREATE OPERATOR <> ( LEFTARG = spoly, RIGHTARG = spoly, COMMUTATOR = <>, NEGATOR = =, PROCEDURE = spoly_not_equal, RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR <> (spoly, spoly) IS 'true, if spherical polygons are not equal'; -- -- circumference -- CREATE FUNCTION circum(spoly) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'spherepoly_circ' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION circum(spoly) IS 'returns circumference of spherical polygon'; CREATE OPERATOR @-@ ( RIGHTARG = spoly, PROCEDURE = circum ); COMMENT ON OPERATOR @-@ (NONE, spoly) IS 'returns circumference of spherical polygon'; -- -- polygon contains polygon -- CREATE FUNCTION spoly_contains_polygon(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_polygon(spoly, spoly) IS 'true if spherical polygon contains spherical polygon'; -- -- polygon is contained by polygon -- CREATE FUNCTION spoly_contains_polygon_com(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_poly_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_polygon_com(spoly, spoly) IS 'true if spherical polygon is contained by spherical polygon'; -- -- polygon does not contain polygon -- CREATE FUNCTION spoly_contains_polygon_neg(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_poly_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_polygon_neg(spoly, spoly) IS 'true if spherical polygon does not contain spherical polygon'; -- -- polygon is not contained by polygon -- CREATE FUNCTION spoly_contains_polygon_com_neg(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_poly_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_polygon_com_neg(spoly, spoly) IS 'true if spherical polygon is not contained by spherical polygon'; -- -- polygons overlap -- CREATE FUNCTION spoly_overlap_polygon(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_polygon(spoly, spoly) IS 'true if spherical polygon overlaps spherical polygon'; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_overlap_polygon, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoly, spoly) IS 'true if spherical polygons overlap'; -- -- polygons do not overlap -- CREATE FUNCTION spoly_overlap_polygon_neg(spoly, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_poly_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_polygon_neg(spoly, spoly) IS 'true if spherical polygon does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = spoly, PROCEDURE = spoly_overlap_polygon, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spoly, spoly) IS 'true if spherical polygon does not overlap spherical polygon'; -- -- polygon contains point -- CREATE FUNCTION spoly_contains_point(spoly, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_point(spoly, spoint) IS 'true if spherical polygon contains spherical point'; -- -- point is contained by polygon -- CREATE FUNCTION spoly_contains_point_com(spoint, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_point_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_point_com(spoint, spoly) IS 'true if spherical polygon contains spherical point'; -- -- polygon does not contain point -- CREATE FUNCTION spoly_contains_point_neg(spoly, spoint) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_point_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_point_neg(spoly, spoint) IS 'true if spherical polygon does not contain spherical point'; -- -- point is not contained by polygon -- CREATE FUNCTION spoly_contains_point_com_neg(spoint, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_point_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_point_com_neg(spoint, spoly) IS 'true if spherical polygon does not contain spherical point'; -- -- Transformation of polygon -- CREATE FUNCTION strans_poly(spoly, strans) RETURNS spoly AS 'MODULE_PATHNAME', 'spheretrans_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_poly (spoly, strans) IS 'returns a transformated spherical polygon'; CREATE OPERATOR + ( LEFTARG = spoly, RIGHTARG = strans, PROCEDURE = strans_poly ); COMMENT ON OPERATOR + (spoly, strans) IS 'transforms a spherical polygon'; CREATE FUNCTION strans_poly_inverse(spoly, strans) RETURNS spoly AS 'MODULE_PATHNAME', 'spheretrans_poly_inverse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION strans_poly_inverse (spoly, strans) IS 'returns a inverse transformated spherical polygon'; CREATE OPERATOR - ( LEFTARG = spoly, RIGHTARG = strans, PROCEDURE = strans_poly_inverse ); COMMENT ON OPERATOR - (spoly, strans) IS 'transforms inverse a spherical polygon'; -- -- polygon contains circle -- CREATE FUNCTION spoly_contains_circle(spoly, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_circle(spoly, scircle) IS 'true if spherical polygon contains spherical circle'; -- -- circle is contained by polygon -- CREATE FUNCTION spoly_contains_circle_com(scircle, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_circle_com(scircle, spoly) IS 'true if spherical polygon contains spherical circle'; -- -- polygon does not contain circle -- CREATE FUNCTION spoly_contains_circle_neg(spoly, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_circle_neg(spoly, scircle) IS 'true if spherical polygon does not contain spherical circle'; -- -- circle is not contained by polygon -- CREATE FUNCTION spoly_contains_circle_com_neg(scircle, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_circle_com_neg(scircle, spoly) IS 'true if spherical polygon does not contain spherical circle'; -- -- circle contains polygon -- CREATE FUNCTION scircle_contains_polygon(scircle, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_polygon(scircle, spoly) IS 'true if spherical circle contains spherical polygon'; -- -- polygon is contained by circle -- CREATE FUNCTION scircle_contains_polygon_com(spoly, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_poly_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_polygon_com(spoly, scircle) IS 'true if spherical circle contains spherical polygon'; -- -- circle does not contain polygon -- CREATE FUNCTION scircle_contains_polygon_neg(scircle, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_poly_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_polygon_neg(scircle, spoly) IS 'true if spherical circle does not contain spherical polygon'; -- -- polygon is not contained by circle -- CREATE FUNCTION scircle_contains_polygon_com_neg(spoly, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherecircle_cont_poly_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_contains_polygon_com_neg(spoly, scircle) IS 'true if spherical circle does not contain spherical polygon'; -- -- circle overlaps polygon -- CREATE FUNCTION spoly_overlap_circle(spoly, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_circle' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_circle(spoly, scircle) IS 'true if spherical circle overlap spherical polygon'; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = spoly_overlap_circle, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoly, scircle) IS 'true if spherical circle overlap spherical polygon'; -- -- polygon overlaps circle -- CREATE FUNCTION spoly_overlap_circle_com(scircle, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_circle_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_circle_com(scircle, spoly) IS 'true if spherical circle overlap spherical polygon'; CREATE OPERATOR && ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = spoly_overlap_circle_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (scircle, spoly) IS 'true if spherical circle overlap spherical polygon'; -- -- circle does not overlap polygon -- CREATE FUNCTION spoly_overlap_circle_neg(spoly, scircle) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_circle_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_circle_neg(spoly, scircle) IS 'true if spherical circle does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = scircle, PROCEDURE = spoly_overlap_circle_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spoly, scircle) IS 'true if spherical circle does not overlap spherical polygon'; -- -- polygon does not overlap circle -- CREATE FUNCTION spoly_overlap_circle_com_neg(scircle, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_circle_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_circle_com_neg(scircle, spoly) IS 'true if spherical circle does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = scircle, RIGHTARG = spoly, PROCEDURE = spoly_overlap_circle_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (scircle, spoly) IS 'true if spherical circle does not overlap spherical polygon'; -- -- polygon contains line -- CREATE FUNCTION spoly_contains_line(spoly, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_line(spoly, sline) IS 'true if spherical polygon contains spherical line'; -- -- line is contained by polygon -- CREATE FUNCTION spoly_contains_line_com(sline, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_line_com(sline, spoly) IS 'true if spherical polygon contains spherical line'; -- -- polygon does not contain line -- CREATE FUNCTION spoly_contains_line_neg(spoly, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_line_neg(spoly, sline) IS 'true if spherical polygon does not contain spherical line'; -- -- line is not contained by polygon -- CREATE FUNCTION spoly_contains_line_com_neg(sline, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_line_com_neg(sline, spoly) IS 'true if spherical polygon does not contain spherical line'; -- -- line overlaps polygon -- CREATE FUNCTION spoly_overlap_line(spoly, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_line' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_line(spoly, sline) IS 'true if spherical line overlap spherical polygon'; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = sline, PROCEDURE = spoly_overlap_line, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoly, sline) IS 'true if spherical line overlap spherical polygon'; -- -- polygon overlaps line -- CREATE FUNCTION spoly_overlap_line_com(sline, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_line_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_line_com(sline, spoly) IS 'true if spherical line overlap spherical polygon'; CREATE OPERATOR && ( LEFTARG = sline, RIGHTARG = spoly, PROCEDURE = spoly_overlap_line_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sline, spoly) IS 'true if spherical line overlap spherical polygon'; -- -- line does not overlap polygon -- CREATE FUNCTION spoly_overlap_line_neg(spoly, sline) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_line_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_line_neg(spoly, sline) IS 'true if spherical line does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = sline, PROCEDURE = spoly_overlap_line_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spoly, sline) IS 'true if spherical line does not overlap spherical polygon'; -- -- polygon does not overlap line -- CREATE FUNCTION spoly_overlap_line_com_neg(sline, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_line_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_line_com_neg(sline, spoly) IS 'true if spherical line does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = sline, RIGHTARG = spoly, PROCEDURE = spoly_overlap_line_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sline, spoly) IS 'true if spherical line does not overlap spherical polygon'; -- -- polygon contains ellipse -- CREATE FUNCTION spoly_contains_ellipse(spoly, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_ellipse(spoly, sellipse) IS 'true if spherical polygon contains spherical ellipse'; -- -- ellipse is contained by polygon -- CREATE FUNCTION spoly_contains_ellipse_com(sellipse, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_ellipse_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_ellipse_com(sellipse, spoly) IS 'true if spherical polygon contains spherical ellipse'; -- -- polygon does not contain ellipse -- CREATE FUNCTION spoly_contains_ellipse_neg(spoly, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_ellipse_neg(spoly, sellipse) IS 'true if spherical polygon does not contain spherical ellipse'; -- -- ellipse is not contained by polygon -- CREATE FUNCTION spoly_contains_ellipse_com_neg(sellipse, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_cont_ellipse_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_contains_ellipse_com_neg(sellipse, spoly) IS 'true if spherical polygon does not contain spherical ellipse'; -- -- ellipse contains polygon -- CREATE FUNCTION sellipse_contains_polygon(sellipse, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_poly' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_polygon(sellipse, spoly) IS 'true if spherical ellipse contains spherical polygon'; -- -- polygon is contained by ellipse -- CREATE FUNCTION sellipse_contains_polygon_com(spoly, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_poly_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_polygon_com(spoly, sellipse) IS 'true if spherical ellipse contains spherical polygon'; -- -- ellipse does not contain polygon -- CREATE FUNCTION sellipse_contains_polygon_neg(sellipse, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_poly_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_polygon_neg(sellipse, spoly) IS 'true if spherical ellipse does not contain spherical polygon'; -- -- polygon is not contained by ellipse -- CREATE FUNCTION sellipse_contains_polygon_com_neg(spoly, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'sphereellipse_cont_poly_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION sellipse_contains_polygon_com_neg(spoly, sellipse) IS 'true if spherical ellipse does not contain spherical polygon'; -- -- ellipse overlaps polygon -- CREATE FUNCTION spoly_overlap_ellipse(spoly, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_ellipse' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_ellipse(spoly, sellipse) IS 'true if spherical ellipse overlap spherical polygon'; CREATE OPERATOR && ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_overlap_ellipse, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (spoly, sellipse) IS 'true if spherical ellipse overlap spherical polygon'; -- -- polygon overlaps ellipse -- CREATE FUNCTION spoly_overlap_ellipse_com(sellipse, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_ellipse_com' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_ellipse_com(sellipse, spoly) IS 'true if spherical ellipse overlap spherical polygon'; CREATE OPERATOR && ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = spoly_overlap_ellipse_com, COMMUTATOR = '&&', NEGATOR = '!&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR && (sellipse, spoly) IS 'true if spherical ellipse overlap spherical polygon'; -- -- ellipse does not overlap polygon -- CREATE FUNCTION spoly_overlap_ellipse_neg(spoly, sellipse) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_ellipse_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_ellipse_neg(spoly, sellipse) IS 'true if spherical ellipse does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_overlap_ellipse_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (spoly, sellipse) IS 'true if spherical ellipse does not overlap spherical polygon'; -- -- polygon does not overlap ellipse -- CREATE FUNCTION spoly_overlap_ellipse_com_neg(sellipse, spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_overlap_ellipse_com_neg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_overlap_ellipse_com_neg(sellipse, spoly) IS 'true if spherical ellipse does not overlap spherical polygon'; CREATE OPERATOR !&& ( LEFTARG = sellipse, RIGHTARG = spoly, PROCEDURE = spoly_overlap_ellipse_com_neg, COMMUTATOR = '!&&', NEGATOR = '&&', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !&& (sellipse, spoly) IS 'true if spherical ellipse does not overlap spherical polygon'; -- -- Functions to create a polygon from arrays -- CREATE FUNCTION spoly(float8[]) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_rad' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly(float8[]) IS 'creates spoly from array of numbers in radians'; CREATE FUNCTION spoly(spoint[]) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_from_point_array' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly(spoint[]) IS 'creates spoly from an array of points'; CREATE FUNCTION spoly_deg(float8[]) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_deg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_deg(float8[]) IS 'creates spoly from array of numbers in degrees'; -- -- Aggregate functions to add points to polygon -- CREATE FUNCTION spoly_add_point_aggr (spoly, spoint) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_add_point' LANGUAGE 'c' IMMUTABLE PARALLEL SAFE; COMMENT ON FUNCTION spoly_add_point_aggr (spoly, spoint) IS 'adds a spherical point to spherical polygon. Do not use it standalone!'; CREATE FUNCTION spoly_add_points_fin_aggr (spoly) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_add_points_finalize' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_add_points_fin_aggr (spoly) IS 'Finalize spherical point adding to spherical polygon. Do not use it standalone!'; CREATE AGGREGATE spoly ( sfunc = spoly_add_point_aggr, basetype = spoint, stype = spoly, finalfunc = spoly_add_points_fin_aggr ); -- -- polygon is convex -- CREATE FUNCTION spoly_is_convex(spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_is_convex' LANGUAGE 'c' IMMUTABLE PARALLEL SAFE; COMMENT ON FUNCTION spoly_is_convex(spoly) IS 'true if spherical polygon is convex'; pgsphere-1.5.1/pgs_types.sql.in000066400000000000000000000063371461140101500165000ustar00rootroot00000000000000 -- Creates a type 'spherical point' CREATE FUNCTION spoint_in(CSTRING) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepoint_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spoint_out(spoint) RETURNS CSTRING AS 'MODULE_PATHNAME', 'spherepoint_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE spoint ( internallength = 16, input = spoint_in, output = spoint_out ); -- Creates a type 'spherical transformation' CREATE FUNCTION strans_in(CSTRING) RETURNS strans AS 'MODULE_PATHNAME', 'spheretrans_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION strans_out(strans) RETURNS CSTRING AS 'MODULE_PATHNAME', 'spheretrans_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE strans ( internallength = 32, input = strans_in, output = strans_out ); -- Creates a type 'spherical circle' CREATE FUNCTION scircle_in(CSTRING) RETURNS scircle AS 'MODULE_PATHNAME', 'spherecircle_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION scircle_out(scircle) RETURNS CSTRING AS 'MODULE_PATHNAME', 'spherecircle_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE scircle ( internallength = 24, input = scircle_in, output = scircle_out ); -- Creates a type 'spherical line' CREATE FUNCTION sline_in(CSTRING) RETURNS sline AS 'MODULE_PATHNAME', 'sphereline_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION sline_out(sline) RETURNS CSTRING AS 'MODULE_PATHNAME', 'sphereline_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE sline ( internallength = 32, input = sline_in, output = sline_out ); -- Creates a type 'spherical ellipse' CREATE FUNCTION sellipse_in(CSTRING) RETURNS sellipse AS 'MODULE_PATHNAME', 'sphereellipse_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION sellipse_out(sellipse) RETURNS CSTRING AS 'MODULE_PATHNAME', 'sphereellipse_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE sellipse ( internallength = 40, input = sellipse_in, output = sellipse_out ); -- Creates a type 'spherical polygon' CREATE FUNCTION spoly_in(CSTRING) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spoly_out(spoly) RETURNS CSTRING AS 'MODULE_PATHNAME', 'spherepoly_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE spoly ( internallength = VARIABLE, input = spoly_in, output = spoly_out, storage = external ); -- Creates a type 'spherical path' CREATE FUNCTION spath_in(CSTRING) RETURNS spath AS 'MODULE_PATHNAME', 'spherepath_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION spath_out(spath) RETURNS CSTRING AS 'MODULE_PATHNAME', 'spherepath_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE spath ( internallength = VARIABLE, input = spath_in, output = spath_out, storage = external ); -- Creates a type 'spherical box' CREATE FUNCTION sbox_in(CSTRING) RETURNS sbox AS 'MODULE_PATHNAME', 'spherebox_in' LANGUAGE 'c' IMMUTABLE STRICT; CREATE FUNCTION sbox_out(sbox) RETURNS CSTRING AS 'MODULE_PATHNAME', 'spherebox_out' LANGUAGE 'c' IMMUTABLE STRICT; CREATE TYPE sbox ( internallength = 32, input = sbox_in, output = sbox_out ); pgsphere-1.5.1/sql/000077500000000000000000000000001461140101500141235ustar00rootroot00000000000000pgsphere-1.5.1/sql/bounding_box_gist.sql000066400000000000000000000064521461140101500203560ustar00rootroot00000000000000SET extra_float_digits = 2; SET enable_seqscan=true; CREATE TABLE bbox_ellipse (e sellipse not null); INSERT INTO bbox_ellipse VALUES ('<{10d, 0.1d}, (0d,0d), 0d>'); SELECT spoint '(5d, 0d)' @ sellipse '<{10d, 0.1d}, (0d,0d), 0d>' AS inside; SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; -- The ellipse has semi-major axis length of 10 degrees along the equator, -- so (lon,lat) = (5,0) should be inside. CREATE INDEX idx_bbox_ellipse ON bbox_ellipse USING gist (e); ANALYZE bbox_ellipse; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' @ e; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_ellipse WHERE spoint '(5d, 0d)' <@ e; SET enable_seqscan=true; CREATE TABLE bbox_poly (p spoly not null); INSERT INTO bbox_poly VALUES ('{(40d,-40d), (0d,80d), (-40d,-40d)}'); SELECT spoint '(0d, 0d)' @ spoly '{(40d,-40d), (0d,80d), (-40d,-40d)}' AS inside; SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; CREATE INDEX idx_bbox_poly ON bbox_poly USING gist (p); ANALYZE bbox_poly; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' @ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_poly WHERE spoint '(0d, 0d)' <@ p; SET enable_seqscan=true; CREATE TABLE bbox_path (p spath not null); INSERT INTO bbox_path VALUES ('{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}'); SELECT sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && spath '{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}' AS crossing; SELECT spoint '(0d, 0d)' @ spath '{(-46d,0d), (-45d,80d), (-45d,0d), (80d,0d)}' AS inside; SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; CREATE INDEX idx_bbox_path ON bbox_path USING gist (p); ANALYZE bbox_path; SET enable_seqscan=false; SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE sline(spoint '(0d, -10d)', spoint '(0d, 10d)') && p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' @ p; EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM bbox_path WHERE spoint '(0d, 0d)' <@ p; pgsphere-1.5.1/sql/box.sql000066400000000000000000000736351461140101500154520ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); \set ECHO all -- -- sbox and spoint -- SELECT spoint '(0d,90d)' @ sbox '((0d,80d),(360d,90d))' ; SELECT sbox '((309d,309d),(313d,313d))' ~ spoint '(310d,310d)' ; SELECT spoint '(310d,310d)' @ sbox '((309d,309d),(313d,313d))' ; SELECT sbox '((309d,309d),(313d,313d))' ~ spoint '(10d,10d)' ; SELECT spoint '(10d,10d)' @ sbox '((309d,309d),(313d,313d))' ; SELECT sbox '((309d,309d),(313d,313d))' !~ spoint '(310d,310d)' ; SELECT spoint '(310d,310d)' !@ sbox '((309d,309d),(313d,313d))' ; SELECT sbox '((309d,309d),(313d,313d))' !~ spoint '(10d,10d)' ; SELECT spoint '(10d,10d)' !@ sbox '((309d,309d),(313d,313d))' ; SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(10d,10d)'; SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(10d,20d)'; SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(20d,10d)'; SELECT sbox '((10d,10d),(20d,20d))' ~ spoint '(20d,20d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(310d,10d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(310d,20d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(320d,10d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(320d,20d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(310d,15d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(315d,20d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(315d,10d)'; SELECT sbox '((310d,10d),(320d,20d))' ~ spoint '(320d,15d)'; SELECT spoint '(320d, 15d)' @ sbox '((310d,10d),(320d,20d))' ; SELECT spoint '(140d,-15d)' @ sbox '((310d,10d),(320d,20d))' ; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(300d,10d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(300d,15d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(300d,20d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(330d,10d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(330d,15d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(330d,20d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(0d,10d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(0d,15d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(0d,20d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(10d,10d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(10d,15d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(10d,20d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(30d,10d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(30d,15d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(30d,20d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(180d,10d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(180d,15d)'; SELECT sbox '((310d,10d),(20d,20d))' ~ spoint '(180d,20d)'; SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(300d,10d)'; SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(320d,-80d)'; SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(320d,-85d)'; SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(320d,-90d)'; SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(180d,-90d)'; SELECT sbox '((310d,-90d),(20d,-80d))' ~ spoint '(180d,-89.99d)'; SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(300d,10d)'; SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(320d,80d)'; SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(320d,85d)'; SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(320d,90d)'; SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(180d,90d)'; SELECT sbox '((310d,80d),(20d,90d))' ~ spoint '(180d,89.99d)'; SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(300d,10d)'; SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(320d,-80d)'; SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(320d,-85d)'; SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(320d,-90d)'; SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(180d,-90d)'; SELECT sbox '((0d,-90d),(360d,-80d))' ~ spoint '(180d,-89.99d)'; SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(300d,10d)'; SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(320d,80d)'; SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(320d,85d)'; SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(320d,90d)'; SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(180d,90d)'; SELECT sbox '((0d,80d),(360d,90d))' ~ spoint '(180d,89.99d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d,-11d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d,-10d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, -5d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 0d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 5d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 20d)'; SELECT sbox '((0d,-10d),(360d,20d))' ~ spoint '(270d, 21d)'; SELECT spoint '(320d, 15d)' !@ sbox '((310d,10d),(320d,20d))' ; SELECT spoint '(140d,-15d)' !@ sbox '((310d,10d),(320d,20d))' ; SELECT sbox '((10d,10d),(20d,20d))' !~ spoint '(10d,10d)'; SELECT sbox '((270d,-10d),(300d,20d))' !~ spoint '(10d,10d)'; -- -- sbox (as point) and spoint -- SELECT sbox '((310d,310d),(310d,310d))' ~ spoint '(310d,310d)' ; SELECT spoint '(310d,310d)' @ sbox '((310d,310d),(310d,310d))' ; SELECT sbox '((310d,310d),(310d,310d))' ~ spoint '(10d,10d)' ; SELECT spoint '(11d,11d)' @ sbox '((310d,310d),(310d,310d))' ; -- -- sbox and circle -- -- Check negators / commutators SELECT scircle '<(0d, 70d),1d>' && sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' && scircle '<(0d, 70d),1d>'; SELECT scircle '<(0d, 70d),1d>' !&& sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' !&& scircle '<(0d, 70d),1d>'; SELECT scircle '<(0d, 50d),1d>' && sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' && scircle '<(0d, 50d),1d>'; SELECT scircle '<(0d, 50d),1d>' !&& sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' !&& scircle '<(0d, 50d),1d>'; SELECT scircle '<(0d, 70d),1d>' @ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' @ scircle '<(0d, 70d),1d>'; SELECT scircle '<(0d, 70d),1d>' !@ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' !@ scircle '<(0d, 70d),1d>'; SELECT scircle '<(0d, 50d),1d>' @ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' @ scircle '<(0d, 50d),1d>'; SELECT scircle '<(0d, 50d),1d>' !@ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' !@ scircle '<(0d, 50d),1d>'; SELECT scircle '<(0d, 70d),1d>' ~ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' ~ scircle '<(0d, 70d),1d>'; SELECT scircle '<(0d, 70d),1d>' !~ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' !~ scircle '<(0d, 70d),1d>'; SELECT scircle '<(0d, 50d),1d>' ~ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' ~ scircle '<(0d, 50d),1d>'; SELECT scircle '<(0d, 50d),1d>' !~ sbox '((-10d, 60d),(10d, 80d))'; SELECT sbox '((-10d, 60d),(10d, 80d))' !~ scircle '<(0d, 50d),1d>'; -- Other Checks SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(360d, 90d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(360d,-90d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(360d, 90d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(360d,-90d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(360d, 89d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(360d,-89d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(360d, 89d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(360d,-89d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(360d, 88d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(360d,-88d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(360d, 88d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(360d,-88d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(270d, 90d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(270d,-90d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(270d, 90d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(270d,-90d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(270d, 89d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(270d,-89d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(270d, 89d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(270d,-89d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(270d, 88d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(270d,-88d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(270d, 88d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(270d,-88d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(90d, 90d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(90d,-90d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(90d, 90d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(90d,-90d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(90d, 89d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(90d,-89d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(90d, 89d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(90d,-89d))'; SELECT scircle '<(0d, 90d),1d>' @ sbox '((0d, 80d),(90d, 88d))'; SELECT scircle '<(0d,-90d),1d>' @ sbox '((0d,-80d),(90d,-88d))'; SELECT scircle '<(0d, 90d),1d>' && sbox '((0d, 80d),(90d, 88d))'; SELECT scircle '<(0d,-90d),1d>' && sbox '((0d,-80d),(90d,-88d))'; SELECT scircle '<(0d, 89d),1d>' @ sbox '((0d, 80d),(90d, 90d))'; SELECT scircle '<(0d,-89d),1d>' @ sbox '((0d,-80d),(90d,-90d))'; SELECT scircle '<(0d, 89d),1d>' && sbox '((0d, 80d),(90d, 90d))'; SELECT scircle '<(0d,-89d),1d>' && sbox '((0d,-80d),(90d,-90d))'; SELECT scircle '<(0d, 89d),1d>' @ sbox '((0d, 80d),(90d, 89d))'; SELECT scircle '<(0d,-89d),1d>' @ sbox '((0d,-80d),(90d,-89d))'; SELECT scircle '<(0d, 89d),1d>' && sbox '((0d, 80d),(90d, 89d))'; SELECT scircle '<(0d,-89d),1d>' && sbox '((0d,-80d),(90d,-89d))'; SELECT scircle '<(0d, 89d),1d>' @ sbox '((0d, 80d),(90d, 88d))'; SELECT scircle '<(0d,-89d),1d>' @ sbox '((0d,-80d),(90d,-88d))'; SELECT scircle '<(0d, 89d),1d>' && sbox '((0d, 80d),(90d, 88d))'; SELECT scircle '<(0d,-89d),1d>' && sbox '((0d,-80d),(90d,-88d))'; SELECT scircle '<(0d, 90d),10d>' @ sbox '((0d, 80d),(360d, 90d))'; SELECT scircle '<(0d, 90d),10d>' ~ sbox '((0d, 80d),(360d, 90d))'; SELECT scircle '<(0d, 90d),10d>' && sbox '((0d, 80d),(360d, 90d))'; -- -- sbox and line -- SELECT sline( spoint '(0d,0d)', spoint '(0d,10d)' ) @ sbox '((0d,0d),(10d,10d))'; SELECT sline( spoint '(0d,0d)', spoint '(0d,0d)' ) @ sbox '((0d,0d),(10d,10d))'; SELECT sline( spoint '(0d,10d)', spoint '(10d,10d)' ) @ sbox '((0d,0d),(10d,10d))'; SELECT sline( spoint '(0d,0d)', spoint '(0d,10d)' ) && sbox '((0d,0d),(10d,10d))'; SELECT sline( spoint '(0d,0d)', spoint '(0d,0d)' ) && sbox '((0d,0d),(10d,10d))'; SELECT sline( spoint '(0d,10d)', spoint '(10d,10d)' ) && sbox '((0d,0d),(10d,10d))'; -- sbox is point, sline is point SELECT sbox '((310d,310d),(310d,310d))' ~ sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) ; SELECT sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) @ sbox '((310d,310d),(310d,310d))' ; SELECT sbox '((310d,310d),(310d,310d))' ~ sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; SELECT sline ( spoint '(11d,11d)' , spoint '(11d,11d)' ) @ sbox '((310d,310d),(310d,310d))' ; SELECT sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) @ sbox '((310d,90d),(310d,90d))' ; SELECT sbox '((310d,90d),(310d,90d))' ~ sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; SELECT sbox '((310d,310d),(310d,310d))' && sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) ; SELECT sline ( spoint '(310d,310d)', spoint '(310d,310d)' ) && sbox '((310d,310d),(310d,310d))' ; SELECT sbox '((310d,310d),(310d,310d))' && sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; SELECT sline ( spoint '(11d,11d)' , spoint '(11d,11d)' ) && sbox '((310d,310d),(310d,310d))' ; SELECT sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) && sbox '((310d,90d),(310d,90d))' ; SELECT sbox '((310d,90d),(310d,90d))' && sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; -- sbox is point only SELECT sbox '((310d,10d),(310d,10d))' ~ sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) ; SELECT sbox '((310d,10d),(310d,10d))' && sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) ; SELECT sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) @ sbox '((310d,10d),(310d,10d))' ; SELECT sline ( spoint '(310d,10d)', spoint '(310d,20d)' ) && sbox '((310d,10d),(310d,10d))' ; SELECT sbox '((310d,10d),(310d,10d))' ~ sline ( spoint '(10d,10d)', spoint '(10d,20d)' ) ; SELECT sbox '((310d,10d),(310d,10d))' && sline ( spoint '(10d,10d)', spoint '(10d,20d)' ) ; SELECT sline ( spoint '(11d,11d)' , spoint '(21d,11d)' ) @ sbox '((310d,10d),(310d,10d))' ; SELECT sline ( spoint '(11d,11d)' , spoint '(21d,11d)' ) && sbox '((310d,10d),(310d,10d))' ; SELECT sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) @ sbox '((310d,90d),(310d,90d))' ; SELECT sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) && sbox '((310d,90d),(310d,90d))' ; SELECT sbox '((310d,90d),(310d,90d))' ~ sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) ; SELECT sbox '((310d,90d),(310d,90d))' && sline ( spoint '(11d,90d)' , spoint '(11d,80d)' ) ; -- sline is point only SELECT sbox '((310d,10d),(320d,20d))' ~ sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) ; SELECT sbox '((310d,10d),(320d,20d))' && sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) ; SELECT sbox '((310d,10d),(320d,20d))' ~ sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) ; SELECT sbox '((310d,10d),(320d,20d))' && sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) ; SELECT sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) @ sbox '((310d,10d),(320d,20d))' ; SELECT sline ( spoint '(310d,10d)', spoint '(310d,10d)' ) && sbox '((310d,10d),(320d,20d))' ; SELECT sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) @ sbox '((310d,10d),(320d,20d))' ; SELECT sline ( spoint '(315d,15d)', spoint '(315d,15d)' ) && sbox '((310d,10d),(320d,20d))' ; SELECT sbox '((310d,10d),(320d,20d))' ~ sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; SELECT sbox '((310d,10d),(320d,20d))' && sline ( spoint '(10d,10d)', spoint '(10d,10d)' ) ; SELECT sline ( spoint '(11d, 11d)' , spoint '(11d,11d)' ) @ sbox '((310d,10d),(320d,20d))' ; SELECT sline ( spoint '(11d, 11d)' , spoint '(11d,11d)' ) && sbox '((310d,10d),(320d,20d))' ; SELECT sline ( spoint '(11d, 90d)' , spoint '(11d,90d)' ) @ sbox '((310d,80d),(320d,90d))' ; SELECT sline ( spoint '(11d, 90d)' , spoint '(11d,90d)' ) && sbox '((310d,80d),(320d,90d))' ; SELECT sline ( spoint '(11d, 85d)' , spoint '(11d,85d)' ) @ sbox '((310d,80d),(320d,90d))' ; SELECT sline ( spoint '(11d, 85d)' , spoint '(11d,85d)' ) && sbox '((310d,80d),(320d,90d))' ; SELECT sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) @ sbox '((310d,80d),(320d,90d))' ; SELECT sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) && sbox '((310d,80d),(320d,90d))' ; SELECT sbox '((310d,80d),(320d,90d))' ~ sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; SELECT sbox '((310d,80d),(320d,90d))' && sline ( spoint '(11d,90d)' , spoint '(11d,90d)' ) ; SELECT sbox '((310d,80d),(320d,90d))' ~ sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) ; SELECT sbox '((310d,80d),(320d,90d))' && sline ( spoint '(315d,85d)' , spoint '(315d,85d)' ) ; -- sline / sbox near pole SELECT sbox '((20d,80d),(200d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,85d)' ) ; SELECT sbox '((20d,80d),(200d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,85d)' ) ; SELECT sbox '((10d,80d),(210d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; SELECT sbox '((10d,80d),(210d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; SELECT sbox '((10d,80d),(211d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; SELECT sbox '((10d,80d),(211d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,81d)' ) ; SELECT sbox '((190d,80d),(199d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(199d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(200d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(200d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(210d,90d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(210d,90d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((200d,80d),(210d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((200d,80d),(210d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((210d,80d),(220d,90d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((210d,80d),(220d,90d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(199d,88d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(199d,88d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(200d,88d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(200d,88d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(210d,88d))' ~ sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((190d,80d),(210d,88d))' && sline ( spoint '(200d,85d)', spoint '(20d,90d)' ) ; SELECT sbox '((200d,80d),(210d,88d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((200d,80d),(210d,88d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((210d,80d),(220d,88d))' ~ sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; SELECT sbox '((210d,80d),(220d,88d))' && sline ( spoint '(200d,81d)', spoint '(20d,90d)' ) ; -- sbox near equator SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,85d)', spoint '( 20d, 85d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,85d)', spoint '( 20d, 85d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(190d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(190d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(205d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(205d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(202d, 0d)', spoint '(207d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(202d, 0d)', spoint '(207d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,-5d)', spoint '(200d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,-5d)', spoint '(200d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d,-5d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d,-5d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(200d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(200d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(200d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(200d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d, 0d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d, 0d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d, 0d)', spoint '(205d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d, 0d)', spoint '(205d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,-5d)', spoint '(200d, 15d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,-5d)', spoint '(200d, 15d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d,-5d)', spoint '(205d, 15d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d,-5d)', spoint '(205d, 15d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(210d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(210d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(211d, 11d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(211d, 11d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(211d, 11d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(211d, 11d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(210d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(210d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(209d, 9d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(209d, 9d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(201d, 1d)', spoint '(211d, 11d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(201d, 1d)', spoint '(211d, 11d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(201d, 0d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(201d, 0d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(201d, 1d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(201d, 1d)', spoint '(205d, 5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,10d)', spoint '(210d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,10d)', spoint '(210d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,10d)', spoint '(205d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,10d)', spoint '(205d, 10d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(199d,-1d)', spoint '(200d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(199d,-1d)', spoint '(200d, 0d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d,10d)', spoint '(200d, 20d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d,10d)', spoint '(200d, 20d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d,10d)', spoint '(205d, 20d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d,10d)', spoint '(205d, 20d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(210d,10d)', spoint '(210d, 20d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(210d,10d)', spoint '(210d, 20d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(200d, 0d)', spoint '(200d, -5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(200d, 0d)', spoint '(200d, -5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(205d, 0d)', spoint '(205d, -5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(205d, 0d)', spoint '(205d, -5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline ( spoint '(210d, 0d)', spoint '(210d, -5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' && sline ( spoint '(210d, 0d)', spoint '(210d, -5d)' ) ; SELECT sbox '((200d,0d),(210d,10d))' ~ sline '( -10d, -10d, 200d, ZXZ ), 20d' ; SELECT sbox '((200d,0d),(210d,10d))' && sline '( -10d, -10d, 200d, ZXZ ), 20d' ; -- general position SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, 0d)', spoint '(190d, 0d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, 0d)', spoint '(190d, 0d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(190d, -40d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(190d, -40d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -50d)', spoint '(190d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -50d)', spoint '(190d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -40d)', spoint '(189d, -40d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -40d)', spoint '(189d, -40d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -50d)', spoint '(189d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -50d)', spoint '(189d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -40d)', spoint '(191d, -40d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -40d)', spoint '(191d, -40d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -50d)', spoint '(191d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -50d)', spoint '(191d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(170d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(170d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(170d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(170d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(170d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(170d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(190d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(170d, -40d)', spoint '(190d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(171d, -41d)', spoint '(189d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(171d, -41d)', spoint '(189d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -39d)', spoint '(180d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -39d)', spoint '(180d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(180d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(180d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(180d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(180d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(180d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(180d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(180d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(180d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -39d)', spoint '(182d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -39d)', spoint '(182d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(182d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(182d, -51d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -40d)', spoint '(182d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -40d)', spoint '(182d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(182d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(182d, -50d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(180d, -41d)', spoint '(182d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' && sline ( spoint '(180d, -41d)', spoint '(182d, -49d)' ) ; SELECT sbox '((170d,-50d),(190d,-40d))' ~ sline ( spoint '(170d, -40d)', spoint '(190d, -40d)' ) ; -- all less/equals/greater permutations of spoint coordinates with respect to a fixed sbox select 'f' as expected, spoint(0.50, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(0.50, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(0.50, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(0.50, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(0.50, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(0.75, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(0.75, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(0.75, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(0.75, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(0.75, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.00, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(1.00, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(1.00, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(1.00, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.00, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.25, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(1.25, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(1.25, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 't' as expected, spoint(1.25, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.25, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.50, 0.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.50, 0.75) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.50, 1.00) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.50, 1.25) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; select 'f' as expected, spoint(1.50, 1.50) <@ sbox(spoint(0.75, 0.75), spoint(1.25, 1.25)) as actual; -- wide spherical boxes pgsphere-1.5.1/sql/circle.sql000066400000000000000000000214221461140101500161060ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); SET extra_float_digits = 0; \set ECHO all -- Input/Output --- SELECT scircle_deg(spoint(10,10), 90); SELECT scircle_deg(spoint(10,10), 91); SELECT scircle_deg(spoint(0,0), 0); SELECT scircle_deg(spoint(10,10), -1); SELECT set_sphere_output( 'RAD' ); SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT set_sphere_output( 'DEG' ); SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT set_sphere_output( 'DMS' ); SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT set_sphere_output( 'HMS' ); SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT set_sphere_output( 'DMS' ); -- Functions -- checking spherical circle operators SELECT scircle '<(0, 90d),1>' = '<(0, 90d),1>' ; SELECT scircle '<(0,-90d),1>' <> '<(0, 90d),1>' ; -- float8 dist(scircle,scircle) SELECT 180.0*dist('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle,'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*dist('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); -- spoint center(scircle) SELECT center('< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle); SELECT center('< (1h 2m 30s , +90d 0m 0s), 1.0d >'::scircle); -- scircle scircle(spoint) SELECT scircle('(0d,0d)'::spoint); SELECT scircle('(0d,90d)'::spoint); SELECT scircle('(0d,-90d)'::spoint); -- Operators -- = operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (25h 0m 0s,+1d), 1d 30m >'::scircle ; SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle='< (13h 0m 0s,+85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle='< (13h 0m 0s,-85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle='< (2h 0m 0s,+90d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle='< (2h 0m 0s,-90d), 1.5d >'::scircle ; -- should be "false" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,-1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 2.5d >'::scircle ; -- <> operator -- should be "false" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (25h 0m 0s,+1d), 1d 30m >'::scircle ; SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle <> '< (13h 0m 0s,+85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle <> '< (13h 0m 0s,-85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle <> '< (2h 0m 0s,+90d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle <> '< (2h 0m 0s,-90d), 1.5d >'::scircle ; -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,-1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 2.5d >'::scircle ; -- && operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,-1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0s,0d), 15d >'::scircle; SELECT '< (2h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0.1s,0d), 15d >'::scircle; SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (23h 0m 0.1s,0d), 15d >'::scircle; -- should be "false" SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle && '< (1h 0m 0s,-1d), 0.5d >'::scircle; SELECT '< (1d 0m 0s,+1d), 1.0d >'::scircle && '< (0d 0m 0s,0d), 0.1d >'::scircle; -- @@ operator SELECT @@ '< (1h 2m 3s , +1d 2m 3s), 1.0d >'::scircle; SELECT @@ '< (1h 2m 3s , +90d 0m 0s), 1.0d >'::scircle; -- <-> operator SELECT 180.0*('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle<->'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); SELECT 180.0*('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); -- scircle @ scircle operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (2d 0m 0s,+1d), 0.5d >'::scircle @ '< (1d 0m 0s,0d), 3.5d >'::scircle; SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; -- should be "false" SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (2h 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (2d 0m 0s,+1d), 1.5d >'::scircle @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; -- scircle ~ scircle operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (1d 0m 0s,0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; -- should be "false" SELECT '< (2h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; -- spoint @ scircle operator -- should be "true" SELECT '(1h 0m 0s,+1d) '::spoint @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; SELECT '(2d 0m 0s,+1d) '::spoint @ '< (1d 0m 0s, 0d), 3.5d >'::scircle; SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; -- should be "false" SELECT '(1h 0m 0s,+1d )'::spoint @ '< (2h 0m 0s,-1d), 1.5d >'::scircle; SELECT '(3d 30m 0s,+1d )'::spoint @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; SELECT '(1h 0m 0s,+88.99d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; SELECT '(1h 0m 0s,-88.99d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; -- spoint ~ scircle operator -- should be "true" SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d) '::spoint; SELECT '< (1d 0m 0s, 0d), 3.5d >'::scircle ~ '(2d 0m 0s,+1d) '::spoint; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; -- should be "false" SELECT '< (2h 0m 0s,-1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d )'::spoint; SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '(3d 30m 0s,+1d )'::spoint; SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+88.99d)'::spoint; SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-88.99d)'::spoint; pgsphere-1.5.1/sql/circle_extended.sql000066400000000000000000000072751461140101500200000ustar00rootroot00000000000000-- indexed operations..... SET enable_indexscan=off; select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; SET enable_indexscan=on; select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; -- "Cross-correlation" about 30 seconds on PIII-750 select count(spoint_data.sp) from spoint_data,scircle_data where spoint_data.sp @ scircle_data.sc; pgsphere-1.5.1/sql/contains.sql000066400000000000000000000126441461140101500164710ustar00rootroot00000000000000/* This set of tests is designed to verify the compliance of the contain operation with the DE-9IM model */ -- sline vs spoint -- the point lies far beyond the line select 'sline ~ spoint', 'f' as expected, sline(spoint'(270d,10d)', spoint'(270d,30d)') ~ spoint'(0d, 50d)' as actual; -- the point lies in the boundary of line select 'sline ~ spoint', 'f' as expected, sline(spoint'(270d,10d)', spoint'(270d,30d)') ~ spoint'(270d, 10d)' as actual; -- the point lies in the interior of line select 'sline ~ spoint', 't' as expected, sline(spoint'(270d,10d)', spoint'(270d,30d)') ~ spoint'(270d, 20d)' as actual; -- the point and line that degenerated into the point coincide select 'sline ~ spoint', 't' as expected, sline(spoint'(270d,10d)', spoint'(270d,10d)') ~ spoint'(270d, 10d)' as actual; -- the point and line that degenerated into the point do not coincide select 'sline ~ spoint', 'f' as expected, sline(spoint'(270d,10d)', spoint'(270d,10d)') ~ spoint'(270d, 20d)' as actual; -- spoint vs scircle -- the point lies far beyond the circle select 'spoint @ scircle', 'f' as expected, spoint'(0d,0d)' @ scircle'<(0d,90d),50d>' as actual; -- the point lies in the boundary of circle select 'spoint @ scircle', 'f' as expected, spoint'(0d,80d)' @ scircle'<(0d,90d),10d>' as actual; -- the point lies in the interior of circle select 'spoint @ scircle', 't' as expected, spoint'(0d,80d)' @ scircle'<(0d,90d),50d>' as actual; -- the point and circle that degenerated into the point coincide select 'spoint @ scircle', 't' as expected, spoint'(0d,90d)' @ scircle'<(0d,90d),0d>' as actual; -- the point and circle that degenerated into the point do not coincide select 'spoint @ scircle', 'f' as expected, spoint'(0d,50d)' @ scircle'<(0d,90d),0d>' as actual; -- sellipse vs spoint -- the point lies far beyond the ellipse select 'sellipse ~ spoint', 'f' as expected, sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' ~ spoint'(0d, 0d)' as actual; -- the point lies in the boundary of ellipse select 'sellipse ~ spoint', 'f' as expected, sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' ~ spoint'(0d, 70d)' as actual; -- the point lies in the interior of ellipse select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' ~ spoint'(90d, 65d)' as actual; -- the point lies in the boundary of ellipse that degenerated into the line select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 10d , 0d }, (0d , 0d) , 0d>' ~ spoint'(10d, 0d)' as actual; -- the point lies in the interior of ellipse that degenerated into the line select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 10d , 0d }, (0d , 0d) , 0d>' ~ spoint'(0d, 0d)' as actual; -- the point and ellipse that degenerated into the point coincide select 'sellipse ~ spoint', 't' as expected, sellipse'<{ 0d , 0d }, (0d , 90d) , 0d>' ~ spoint'(0d, 90d)' as actual; -- the point and ellipse that degenerated into the point do not coincide select 'sellipse ~ spoint', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 90d) , 0d>' ~ spoint'(0d, 91d)' as actual; -- spath vs spoint -- the point lies far beyond the opened path select 'spath ~ spoint', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d) }' ~ spoint'(0d, 90d)' as actual; -- the point lies in the boundary of opened path select 'spath ~ spoint', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d) }' ~ spoint'(-10d, 0d)' as actual; -- the point lies in the boundary of unsimple opened path select 'spath ~ spoint', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d),(-5d, 0d) }' ~ spoint'(-5d, 0d)' as actual; -- the point lies in the interior of opened path select 'spath ~ spoint', 't' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d) }' ~ spoint'(9d, 0d)' as actual; -- the point lies in the interior of closed path select 'spath ~ spoint', 't' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d),(80d,30d),(-10d, 0d) }' ~ spoint'(-10d, 0d)' as actual; -- spoly vs spoint -- the point lies far beyond the polygon select 'spoly ~ spoint', 'f' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(0d, 90d)' as actual; -- the point lies in the boundary of polygon select 'spoly ~ spoint', 'f' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(5d, 0d)' as actual; -- the point lies in the boundary of polygon select 'spoly ~ spoint', 'f' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(20d, 20d)' as actual; -- the point lies in the interior of polygon select 'spoly ~ spoint', 't' as expected, spoly'{ (0d,0d), (10d,0d), (20d,20d) }' ~ spoint'(5d, 5d)' as actual; -- sbox vs spoint -- the point lies far beyond the box select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(0d, 90d)' as actual; -- the point lies in the boundary of box select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(0d, 5d)' as actual; -- the point lies in the boundary of box select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(0d, 0d)' as actual; -- the point lies in the interior of box select 'sbox ~ spoint', 't' as expected, sbox'( (0d,0d), (20d,10d) )' ~ spoint'(5d, 5d)' as actual; -- the point and box that degenerated into the point coincide select 'sbox ~ spoint', 't' as expected, sbox'( (0d,0d), (0d,0d) )' ~ spoint'(0d, 0d)' as actual; -- the point and box that degenerated into the point do not coincide select 'sbox ~ spoint', 'f' as expected, sbox'( (0d,0d), (0d,0d) )' ~ spoint'(0d, 1d)' as actual; pgsphere-1.5.1/sql/contains_ops.sql000066400000000000000000000341401461140101500173450ustar00rootroot00000000000000 -- scircle vs spoint select 'scircle @> spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) @> spoint(1.0,1.0) as actual; select 'scircle @> spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) @> spoint(2.0,2.0) as actual; select 'spoint <@ scircle', 't' as expected, spoint(1.0,1.0) <@ scircle(spoint(1.0,1.0),0.1) as actual; select 'spoint <@ scircle', 'f' as expected, spoint(2.0,2.0) <@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !@> spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !@> spoint(1.0,1.0) as actual; select 'scircle !@> spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) !@> spoint(2.0,2.0) as actual; select 'spoint !<@ scircle', 'f' as expected, spoint(1.0,1.0) !<@ scircle(spoint(1.0,1.0),0.1) as actual; select 'spoint !<@ scircle', 't' as expected, spoint(2.0,2.0) !<@ scircle(spoint(1.0,1.0),0.1) as actual; -- sbox vs spoint select 'sbox @> spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> spoint(1.1,1.1) as actual; select 'sbox @> spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> spoint(2.0,2.0) as actual; select 'spoint <@ sbox', 't' as expected, spoint(1.1,1.1) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'spoint <@ sbox', 'f' as expected, spoint(2.0,2.0) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox !@> spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> spoint(1.1,1.1) as actual; select 'sbox !@> spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> spoint(2.0,2.0) as actual; select 'spoint !<@ sbox', 'f' as expected, spoint(1.1,1.1) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'spoint !<@ sbox', 't' as expected, spoint(2.0,2.0) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; -- spoly vs spoint select 'spoly @> spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> spoint(1.1,1.1) as actual; select 'spoly @> spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> spoint(2.0,2.0) as actual; select 'spoint <@ spoly', 't' as expected, spoint(1.1,1.1) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoint <@ spoly', 'f' as expected, spoint(2.0,2.0) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly !@> spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> spoint(1.1,1.1) as actual; select 'spoly !@> spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> spoint(2.0,2.0) as actual; select 'spoint !<@ spoly', 'f' as expected, spoint(1.1,1.1) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoint !<@ spoly', 't' as expected, spoint(2.0,2.0) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; -- scircle vs scircle select 'scircle @> scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) @> scircle(spoint(1.0,1.0),0.05) as actual; select 'scircle @> scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) @> scircle(spoint(2.0,2.0),0.05) as actual; select 'scircle @> scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) @> scircle(spoint(1.0,1.0),0.2) as actual; select 'scircle <@ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.05) <@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle <@ scircle', 'f' as expected, scircle(spoint(2.0,2.0),0.05) <@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle <@ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.2) <@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !@> scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !@> scircle(spoint(1.0,1.0),0.05) as actual; select 'scircle !@> scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !@> scircle(spoint(2.0,2.0),0.05) as actual; select 'scircle !@> scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !@> scircle(spoint(1.0,1.0),0.2) as actual; select 'scircle !<@ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.05) !<@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !<@ scircle', 't' as expected, scircle(spoint(2.0,2.0),0.05) !<@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !<@ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.2) !<@ scircle(spoint(1.0,1.0),0.1) as actual; -- sbox vs scircle select 'sbox @> scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> scircle(spoint(1.1,1.1),0.01) as actual; select 'sbox @> scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> scircle(spoint(2.0,2.0),0.01) as actual; select 'sbox @> scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @> scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle <@ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle <@ sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.01) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle <@ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) <@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox !@> scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> scircle(spoint(1.1,1.1),0.01) as actual; select 'sbox !@> scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> scircle(spoint(2.0,2.0),0.01) as actual; select 'sbox !@> scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@> scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle !<@ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !<@ sbox', 't' as expected, scircle(spoint(2.0,2.0),0.01) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !<@ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) !<@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; -- select 'scircle @> sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) @> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle @> sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.2) @> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle @> sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) @> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox <@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) <@ scircle(spoint(1.1,1.1),0.2) as actual; select 'sbox <@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) <@ scircle(spoint(2.0,2.0),0.2) as actual; select 'sbox <@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) <@ scircle(spoint(1.1,1.1),0.01) as actual; select 'scircle !@> sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) !@> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !@> sbox', 't' as expected, scircle(spoint(2.0,2.0),0.2) !@> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !@> sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) !@> sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox !<@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !<@ scircle(spoint(1.1,1.1),0.2) as actual; select 'sbox !<@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !<@ scircle(spoint(2.0,2.0),0.2) as actual; select 'sbox !<@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !<@ scircle(spoint(1.1,1.1),0.01) as actual; -- spoly vs scircle select 'spoly @> scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> scircle(spoint(1.1,1.1),0.01) as actual; select 'spoly @> scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> scircle(spoint(2.0,2.0),0.2) as actual; select 'spoly @> scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @> scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle <@ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.01) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle <@ spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.01) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle <@ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.2) <@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly !@> scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> scircle(spoint(1.1,1.1),0.01) as actual; select 'spoly !@> scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> scircle(spoint(2.0,2.0),0.2) as actual; select 'spoly !@> scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@> scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle !<@ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !<@ spoly', 't' as expected, scircle(spoint(2.0,2.0),0.01) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !<@ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.2) !<@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; -- select 'scircle @> spoly', 't' as expected, scircle(spoint(1.1,1.1),0.5) @> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle @> spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.5) @> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle @> spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.05) @> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly <@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly <@ scircle(spoint(1.1,1.1),0.5) as actual; select 'spoly <@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly <@ scircle(spoint(2.0,2.0),0.5) as actual; select 'spoly <@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly <@ scircle(spoint(1.1,1.1),0.05) as actual; select 'scircle !@> spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.5) !@> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !@> spoly', 't' as expected, scircle(spoint(2.0,2.0),0.5) !@> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !@> spoly', 't' as expected, scircle(spoint(1.1,1.1),0.05) !@> '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly !<@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !<@ scircle(spoint(1.1,1.1),0.5) as actual; select 'spoly !<@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !<@ scircle(spoint(2.0,2.0),0.5) as actual; select 'spoly !<@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !<@ scircle(spoint(1.1,1.1),0.05) as actual; -- sbox vs spoly select 'sbox @> spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) @> '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'sbox @> spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) @> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'sbox @> spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) @> '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly as actual; select 'spoly <@ sbox', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly <@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly <@ sbox', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly <@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly <@ sbox', 'f' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly <@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'sbox !@> spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !@> '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'sbox !@> spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !@> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'sbox !@> spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !@> '{(0.9,0.9),(1.1,0.9),(1.1,1.1),(0.9,1.1)}'::spoly as actual; select 'spoly !<@ sbox', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !<@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly !<@ sbox', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !<@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly !<@ sbox', 't' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly !<@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; -- spoly vs spoly select 'spoly @> spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @> '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; select 'spoly @> spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'spoly @> spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @> '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; select 'spoly <@ spoly', 't' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly <@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly <@ spoly', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly <@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly <@ spoly', 'f' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly <@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly !@> spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@> '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; select 'spoly !@> spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@> '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'spoly !@> spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@> '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; select 'spoly !<@ spoly', 'f' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly !<@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly !<@ spoly', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !<@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly !<@ spoly', 't' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly !<@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; pgsphere-1.5.1/sql/contains_ops_compat.sql000066400000000000000000000336101461140101500207110ustar00rootroot00000000000000 -- scircle vs spoint select 'scircle ~ spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) ~ spoint(1.0,1.0) as actual; select 'scircle ~ spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) ~ spoint(2.0,2.0) as actual; select 'spoint @ scircle', 't' as expected, spoint(1.0,1.0) @ scircle(spoint(1.0,1.0),0.1) as actual; select 'spoint @ scircle', 'f' as expected, spoint(2.0,2.0) @ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !~ spoint', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !~ spoint(1.0,1.0) as actual; select 'scircle !~ spoint', 't' as expected, scircle(spoint(1.0,1.0),0.1) !~ spoint(2.0,2.0) as actual; select 'spoint !@ scircle', 'f' as expected, spoint(1.0,1.0) !@ scircle(spoint(1.0,1.0),0.1) as actual; select 'spoint !@ scircle', 't' as expected, spoint(2.0,2.0) !@ scircle(spoint(1.0,1.0),0.1) as actual; -- sbox vs spoint select 'sbox ~ spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ spoint(1.1,1.1) as actual; select 'sbox ~ spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ spoint(2.0,2.0) as actual; select 'spoint @ sbox', 't' as expected, spoint(1.1,1.1) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'spoint @ sbox', 'f' as expected, spoint(2.0,2.0) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox !~ spoint', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ spoint(1.1,1.1) as actual; select 'sbox !~ spoint', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ spoint(2.0,2.0) as actual; select 'spoint !@ sbox', 'f' as expected, spoint(1.1,1.1) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'spoint !@ sbox', 't' as expected, spoint(2.0,2.0) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; -- spoly vs spoint select 'spoly ~ spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ spoint(1.1,1.1) as actual; select 'spoly ~ spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ spoint(2.0,2.0) as actual; select 'spoint @ spoly', 't' as expected, spoint(1.1,1.1) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoint @ spoly', 'f' as expected, spoint(2.0,2.0) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly !~ spoint', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ spoint(1.1,1.1) as actual; select 'spoly !~ spoint', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ spoint(2.0,2.0) as actual; select 'spoint !@ spoly', 'f' as expected, spoint(1.1,1.1) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoint !@ spoly', 't' as expected, spoint(2.0,2.0) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; -- scircle vs scircle select 'scircle ~ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) ~ scircle(spoint(1.0,1.0),0.05) as actual; select 'scircle ~ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) ~ scircle(spoint(2.0,2.0),0.05) as actual; select 'scircle ~ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) ~ scircle(spoint(1.0,1.0),0.2) as actual; select 'scircle @ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.05) @ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle @ scircle', 'f' as expected, scircle(spoint(2.0,2.0),0.05) @ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle @ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.2) @ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !~ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.1) !~ scircle(spoint(1.0,1.0),0.05) as actual; select 'scircle !~ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !~ scircle(spoint(2.0,2.0),0.05) as actual; select 'scircle !~ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.1) !~ scircle(spoint(1.0,1.0),0.2) as actual; select 'scircle !@ scircle', 'f' as expected, scircle(spoint(1.0,1.0),0.05) !@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !@ scircle', 't' as expected, scircle(spoint(2.0,2.0),0.05) !@ scircle(spoint(1.0,1.0),0.1) as actual; select 'scircle !@ scircle', 't' as expected, scircle(spoint(1.0,1.0),0.2) !@ scircle(spoint(1.0,1.0),0.1) as actual; -- sbox vs scircle select 'sbox ~ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ scircle(spoint(1.1,1.1),0.01) as actual; select 'sbox ~ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ scircle(spoint(2.0,2.0),0.01) as actual; select 'sbox ~ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) ~ scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle @ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle @ sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.01) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle @ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) @ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox !~ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ scircle(spoint(1.1,1.1),0.01) as actual; select 'sbox !~ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ scircle(spoint(2.0,2.0),0.01) as actual; select 'sbox !~ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !~ scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle !@ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !@ sbox', 't' as expected, scircle(spoint(2.0,2.0),0.01) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !@ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) !@ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; -- select 'scircle ~ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.2) ~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle ~ sbox', 'f' as expected, scircle(spoint(2.0,2.0),0.2) ~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle ~ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.01) ~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox @ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @ scircle(spoint(1.1,1.1),0.2) as actual; select 'sbox @ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @ scircle(spoint(2.0,2.0),0.2) as actual; select 'sbox @ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) @ scircle(spoint(1.1,1.1),0.01) as actual; select 'scircle !~ sbox', 'f' as expected, scircle(spoint(1.1,1.1),0.2) !~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !~ sbox', 't' as expected, scircle(spoint(2.0,2.0),0.2) !~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'scircle !~ sbox', 't' as expected, scircle(spoint(1.1,1.1),0.01) !~ sbox(spoint(1.0,1.0),spoint(1.2,1.2)) as actual; select 'sbox !@ scircle', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@ scircle(spoint(1.1,1.1),0.2) as actual; select 'sbox !@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@ scircle(spoint(2.0,2.0),0.2) as actual; select 'sbox !@ scircle', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.2,1.2)) !@ scircle(spoint(1.1,1.1),0.01) as actual; -- spoly vs scircle select 'spoly ~ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ scircle(spoint(1.1,1.1),0.01) as actual; select 'spoly ~ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ scircle(spoint(2.0,2.0),0.2) as actual; select 'spoly ~ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly ~ scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle @ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.01) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle @ spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.01) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle @ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.2) @ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly !~ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ scircle(spoint(1.1,1.1),0.01) as actual; select 'spoly !~ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ scircle(spoint(2.0,2.0),0.2) as actual; select 'spoly !~ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !~ scircle(spoint(1.1,1.1),0.2) as actual; select 'scircle !@ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.01) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !@ spoly', 't' as expected, scircle(spoint(2.0,2.0),0.01) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !@ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.2) !@ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; -- select 'scircle ~ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.5) ~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle ~ spoly', 'f' as expected, scircle(spoint(2.0,2.0),0.5) ~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle ~ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.05) ~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly @ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @ scircle(spoint(1.1,1.1),0.5) as actual; select 'spoly @ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @ scircle(spoint(2.0,2.0),0.5) as actual; select 'spoly @ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly @ scircle(spoint(1.1,1.1),0.05) as actual; select 'scircle !~ spoly', 'f' as expected, scircle(spoint(1.1,1.1),0.5) !~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !~ spoly', 't' as expected, scircle(spoint(2.0,2.0),0.5) !~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'scircle !~ spoly', 't' as expected, scircle(spoint(1.1,1.1),0.05) !~ '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly as actual; select 'spoly !@ scircle', 'f' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@ scircle(spoint(1.1,1.1),0.5) as actual; select 'spoly !@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@ scircle(spoint(2.0,2.0),0.5) as actual; select 'spoly !@ scircle', 't' as expected, '{(1.0,1.0),(1.2,1.0),(1.2,1.2),(1.0,1.2)}'::spoly !@ scircle(spoint(1.1,1.1),0.05) as actual; -- sbox vs spoly select 'sbox ~ spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) ~ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'sbox ~ spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) ~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'sbox ~ spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) ~ '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly as actual; select 'spoly @ sbox', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly @ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly @ sbox', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly @ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly @ sbox', 'f' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly @ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'sbox !~ spoly', 'f' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !~ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'sbox !~ spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'sbox !~ spoly', 't' as expected, sbox(spoint(1.0,1.0),spoint(1.5,1.5)) !~ '{(0.9,0.9),(1.1,0.9),(1.1,1.1),(0.9,1.1)}'::spoly as actual; select 'spoly !@ sbox', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly !@ sbox', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; select 'spoly !@ sbox', 't' as expected, '{(0.9 , 0.9),(1.1 , 0.9),(1.1 , 1.1),(0.9 , 1.1)}'::spoly !@ sbox(spoint(1.0,1.0),spoint(1.5,1.5)) as actual; -- spoly vs spoly select 'spoly ~ spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly ~ '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; select 'spoly ~ spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly ~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'spoly ~ spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly ~ '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; select 'spoly @ spoly', 't' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly @ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly @ spoly', 'f' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly @ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly @ spoly', 'f' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly @ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly !~ spoly', 'f' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !~ '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly as actual; select 'spoly !~ spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !~ '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly as actual; select 'spoly !~ spoly', 't' as expected, '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly !~ '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly as actual; select 'spoly !@ spoly', 'f' as expected, '{(1.11,1.11),(1.19,1.11),(1.19,1.19),(1.11,1.19)}'::spoly !@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly !@ spoly', 't' as expected, '{(2.1,2.1),(2.2,1.1),(2.2,1.2),(2.1,1.2)}'::spoly !@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; select 'spoly !@ spoly', 't' as expected, '{(0.9,0.9),(1.2,0.9),(1.2,1.2),(0.9,1.2)}'::spoly !@ '{(1.1,1.1),(1.2,1.1),(1.2,1.2),(1.1,1.2)}'::spoly as actual; pgsphere-1.5.1/sql/ellipse.sql000066400000000000000000000452241461140101500163100ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); \set ECHO all -- ellipse tests --equal operator SELECT sellipse '<{0d,0d},(170d,-12d),0d>' = sellipse '<{0d,0d},(170d,-12d),0d>'; SELECT sellipse '<{0d,0d},(170d,-12d),0d>' = sellipse '<{0d,0d},(170d,-12d),-2d>'; SELECT sellipse '<{5d,5d},(170d,-12d),0d>' = sellipse '<{5d,5d},(170d,-12d),-2d>'; SELECT sellipse '<{5d,2d},(170d,-12d),0d>' = sellipse '<{5d,2d},(170d,-12d),-2d>'; -- not equal SELECT sellipse '<{5d,2d},(170d,-12d),0d>' != sellipse '<{5d,2d},(170d,-12d),-2d>'; SELECT sellipse '<{5d,2d},(170d,-12d),0d>' != sellipse '<{5d,2d},(170d,-12d), 0d>'; SELECT sellipse '<{10d, 5d},(300d,0d), 0d>' = sellipse '<{10d,5d},(300d,0d), 180d>' ; SELECT sellipse '<{10d, 5d},(300d,0d), 90d>' = sellipse '<{10d,5d},(300d,0d), 270d>' ; -- ellipse and point SELECT spoint '(280d,-20d)' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoint '(280d,-10d)' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoint '(280d,-9.9d)' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoint '(280d,-10d)' ; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoint '(280d, -9d)' ; SELECT spoint '(280d,-10d)' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoint '(280d,-9.9d)' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoint '(280d,-10d)' ; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoint '(280d, -9d)' ; SELECT spoint '(0d, 90d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(0d, -90d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(0d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(90d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(180d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(270d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(9d, 0d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(0d, 9d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; SELECT spoint '(0d, 4d)' @ sellipse '<{10d,5d},(0d,0d),0d>' ; -- --ellipse and circle (@,&&) -- -- negators and commutators SELECT scircle '<(280d,-10d),0d>' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d, -9d),0d>' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-10d),0d>' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d, -9d),0d>' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ scircle '<(280d,-10d),0d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ scircle '<(280d, -9d),0d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ scircle '<(280d,-10d),0d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ scircle '<(280d, -9d),0d>'; SELECT scircle '<(280d,-10d),2d>' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d, 0d),2d>' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-10d),2d>' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d, 0d),2d>' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && scircle '<(280d,-10d),2d>' ; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && scircle '<(280d, 0d),2d>' ; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& scircle '<(280d,-10d),2d>' ; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& scircle '<(280d, 0d),2d>' ; SELECT scircle '<(280d,-10d),0d>' && sellipse '<{10d,5d},(280d,-20d),90d>'; -- ellipse is circle SELECT scircle '<(280d,-10d),2d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),2d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-16d),2d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),15d>' @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-10d),2d>' ; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-18d),2d>' ; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-16d),2d>' ; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ scircle '<(280d,-18d),15d>' ; SELECT scircle '<(280d,-10d),2d>' && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),2d>' && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT scircle '<(280d,-16d),2d>' && sellipse '<{5d,5d},(280d,-20d),90d>'; -- ellipse is line SELECT scircle '<(280d,-10d),0d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),0d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-16d),0d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),15d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-10d),0d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),0d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-10d),2d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),2d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-16d),2d>' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-10d),2d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT scircle '<(280d,-18d),2d>' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT sellipse '<{5d,0d},(280d,-20d),90d>' @ scircle '<(280d,-18d),15d>' ; -- --ellipse and line (@,&&) -- -- negators and commutators SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ) !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ) !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ) !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& sline ( spoint '(280d, -9d)', spoint '(280d, -8d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& sline ( spoint '(280d, -9d)', spoint '(280d,-12d)' ); SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& sline ( spoint '(280d,-11d)', spoint '(280d,-12d)' ); -- line is point , ellipse is point SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{0d,0d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{0d,0d},(280d, -8d),90d>'; -- line is point , ellipse is circle SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{5d,5d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{5d,5d},(280d, -8d),90d>'; -- line is point , ellipse is a real ellipse SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) @ sellipse '<{10d,5d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -8d)' ) && sellipse '<{10d,5d},(280d, -8d),90d>'; -- line is a real line , ellipse is point SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{0d,0d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{0d,0d},(280d, -8d),90d>'; -- line is a real line , ellipse is circle SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,5d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,5d},(280d, -8d),90d>'; -- line is a real line , ellipse is line SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{5d,0d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{5d,0d},(280d, -8d),90d>'; -- line is a real line , ellipse is a real ellipse SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) @ sellipse '<{10d,5d},(280d, -8d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sline ( spoint '(280d, -8d)', spoint '(280d, -9d)' ) && sellipse '<{10d,5d},(280d, -8d),90d>'; -- -- ellipse and ellipse -- -- check @ SELECT sellipse '<{10d, 5d},(300d,0d), 0d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; SELECT sellipse '<{10d, 5d},(300d,0d), 90d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; SELECT sellipse '<{10d, 5d},(300d,0d),180d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; SELECT sellipse '<{10d, 5d},(300d,0d),270d>' @ sellipse '<{10d,5d},(300d,0d),0d>'; SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; -- negators , commutator @,&& SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' @ sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' && sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' && sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' && sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' !@ sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' !@ sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' !@ sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{ 2d, 1d},( 52d,6d), 0d>' !&& sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 52d,6d), 0d>' !&& sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d, 5d},( 90d,9d), 0d>' !&& sellipse '<{10d,5d},(50d,5d),45d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' ~ sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' ~ sellipse '<{10d, 5d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' ~ sellipse '<{10d, 5d},( 90d,9d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' && sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' && sellipse '<{10d, 5d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' && sellipse '<{10d, 5d},( 90d,9d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' !~ sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' !~ sellipse '<{10d, 5d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' !~ sellipse '<{10d, 5d},( 90d,9d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' !&& sellipse '<{ 2d, 1d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' !&& sellipse '<{10d, 5d},( 52d,6d), 0d>'; SELECT sellipse '<{10d,5d},(50d,5d),45d>' !&& sellipse '<{10d, 5d},( 90d,9d), 0d>'; -- left ellipse is point right ellipse is point SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' @ sellipse '<{0d,0d},(50d,-5d),45d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' @ sellipse '<{0d,0d},(50d,-5d),45d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' && sellipse '<{0d,0d},(50d,-5d),45d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' && sellipse '<{0d,0d},(50d,-5d),45d>'; -- left ellipse is line right ellipse is point SELECT sellipse '<{ 5d, 0d},( 50d, -2d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 0d},( 50d,-12d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 0d},( 50d, -2d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 0d},( 50d,-12d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; -- left ellipse is circle right ellipse is point SELECT sellipse '<{ 5d, 5d},( 50d, -2d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 5d},( 50d,-12d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 5d},( 50d, -2d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 5d},( 50d,-12d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; -- left ellipse is real ellipse right ellipse is point SELECT sellipse '<{ 5d, 3d},( 50d, -2d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 3d},( 50d,-12d), 90d>' @ sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 3d},( 50d, -2d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; SELECT sellipse '<{ 5d, 3d},( 50d,-12d), 90d>' && sellipse '<{0d,0d},(50d,-5d),0d>'; -- left ellipse is point right ellipse is line SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; -- left ellipse is line right ellipse is line SELECT sellipse '<{ 3d, 0d},( 50d,-5d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d,-8d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d,-6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d, 6d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d,-5d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d,-8d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d,-6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 0d},( 50d, 6d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; -- left ellipse is circle right ellipse is line SELECT sellipse '<{ 3d, 3d},( 50d,-5d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d,-8d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d,-6d), 0d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d, 6d), 90d>' @ sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d,-5d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d,-8d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d,-6d), 0d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d, 6d), 90d>' && sellipse '<{5d,0d},(50d,-5d),90d>'; -- left ellipse is point right ellipse is circle SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-5d), 0d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d,-6d), 0d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 0d, 0d},( 50d, 6d), 0d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; -- left ellipse is line right ellipse is circle SELECT sellipse '<{ 5d, 0d},( 50d,-5d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 0d},( 50d,-6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 0d},( 50d, 6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 0d},( 50d,-5d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 0d},( 50d,-6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 0d},( 50d, 6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; -- left ellipse is circle right ellipse is circle SELECT sellipse '<{ 3d, 3d},( 50d,-4d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 5d},( 50d,-5d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 5d},( 50d,-6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 5d},( 50d, 6d), 90d>' @ sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 3d, 3d},( 50d,-4d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 5d},( 50d,-5d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 5d},( 50d,-6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; SELECT sellipse '<{ 5d, 5d},( 50d, 6d), 90d>' && sellipse '<{5d,5d},(50d,-5d),90d>'; pgsphere-1.5.1/sql/epochprop.sql000066400000000000000000000055221461140101500166470ustar00rootroot00000000000000SET extra_float_digits = 2; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 546.9759, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 0, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), NULL, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, -100) AS tp) AS q; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 23, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), NULL, 20) AS tp) AS q; SELECT to_char(DEGREES(tp[1]), '999D9999999999'), to_char(DEGREES(tp[2]), '999D9999999999'), to_char(tp[3], '999D999'), to_char(DEGREES(tp[4])*3.6e6, '999D999'), to_char(DEGREES(tp[5])*3.6e6, '99999D999'), to_char(tp[6], '999D999') FROM ( SELECT epoch_prop(spoint(radians(269.45207695), radians(4.693364966)), 23, NULL, RADIANS(10362/3.6e6), -110, 120) AS tp) AS q; SELECT epoch_prop(NULL, 23, 0.01 , RADIANS(10362/3.6e6), -110, 120); SELECT epoch_prop_pos(spoint(radians(269.45207695), radians(4.693364966)), 23, RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110, 20) AS tp; SELECT epoch_prop_pos(spoint(radians(269.45207695), radians(4.693364966)), RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), 20) AS tp; pgsphere-1.5.1/sql/euler.sql000066400000000000000000000026531461140101500157660ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); SET extra_float_digits TO -3; \set ECHO all -- checking Euler transformation operators SELECT strans '-10d,0d,10d,ZZZ' = '-10d,0d,10d,XXX' ; SELECT strans '-40d,0d,40d,ZZZ' <> '-40d,0d,40d,XXX' ; SELECT strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ); SELECT theta( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) ); SELECT psi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) ); SELECT phi( strans ( 20.0*pi()/180.0, -270.0*pi()/180.0, 70.5*pi()/180.0, 'XZY' ) ); SELECT theta( strans( '20d, 30d, 40d, XZY' ) ); SELECT psi( strans( '20d, 30d, 40d, XZY' ) ); SELECT phi( strans( '20d, 30d, 40d, XZY' ) ); SELECT strans( '2d 20m, 10d, 0' ); SELECT theta( strans( '2d 20m, 10d, 0' ) ); SELECT psi( strans( '2d 20m, 10d, 0' ) ); SELECT phi( strans( '2d 20m, 10d, 0' ) ); SELECT strans ( '10d, 90d, 270d, ZXZ' ); SELECT theta( strans ( '10d, 90d, 270d, ZXZ' ) ); SELECT psi( strans ( '10d, 90d, 270d, ZXZ' ) ); SELECT phi( strans ( '10d, 90d, 270d, ZXZ' ) ); SELECT - strans ( '20d, 50d, 80d, XYZ' ); SELECT theta( - strans ( '20d, 50d, 80d, XYZ' ) ); SELECT psi( - strans ( '20d, 50d, 80d, XYZ' ) ); SELECT phi( - strans ( '20d, 50d, 80d, XYZ' ) ); SELECT strans( '90d, 60d, 30d' ); SELECT theta( strans( '90d, 60d, 30d' ) ); SELECT psi( strans( '90d, 60d, 30d' ) ); SELECT phi( strans( '90d, 60d, 30d' ) ); pgsphere-1.5.1/sql/gist_support.sql000066400000000000000000000033361461140101500174130ustar00rootroot00000000000000-- spoint_dwithin function selectivity set jit = off; -- suppress extra planning output select explain('select * from spoint10k where spoint_dwithin(star, spoint(1,1), 1)'); select explain('select * from spoint10k where spoint_dwithin(star, spoint(1,1), .1)'); select explain('select * from spoint10k where spoint_dwithin(star, spoint(1,1), .01)'); select explain('select * from spoint10k where spoint_dwithin(spoint(1,1), star, 1)'); select explain('select * from spoint10k where spoint_dwithin(spoint(1,1), star, .1)'); select explain('select * from spoint10k where spoint_dwithin(spoint(1,1), star, .01)'); select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, 1)', do_analyze := 'false'); select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .1)'); select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01)'); -- spoint_dwithin is symmetric in the first two arguments select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01) where spoint_dwithin(a.star, spoint(1,1), .1)'); select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(b.star, a.star, .01) where spoint_dwithin(a.star, spoint(1,1), .1)'); -- both sides indexable, check if the planner figures out the better choice select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01) where spoint_dwithin(a.star, spoint(1,1), .1) and spoint_dwithin(b.star, spoint(1,1), .05)'); select explain('select * from spoint10k a join spoint10k b on spoint_dwithin(a.star, b.star, .01) where spoint_dwithin(a.star, spoint(1,1), .05) and spoint_dwithin(b.star, spoint(1,1), .1)'); pgsphere-1.5.1/sql/gnomo.sql000066400000000000000000000243761461140101500157770ustar00rootroot00000000000000SET extra_float_digits TO -3; SELECT set_sphere_output_precision(12); select gnomonic_proj(spoint '(0.95, -0.455)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(0.95, -0.45)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(0.95, -0.445)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(1, -0.455)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(1, -0.45)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(1, -0.445)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(1.05, -0.455)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(1.05, -0.45)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(1.05, -0.445)', spoint '(1, -0.45)'); select gnomonic_proj(spoint '(0.95, 0.045)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(0.95, 0.05)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(0.95, 0.055)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(1, 0.045)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(1, 0.05)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(1, 0.055)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(1.05, 0.045)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(1.05, 0.05)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(1.05, 0.055)', spoint '(1, 0.05)'); select gnomonic_proj(spoint '(0.95, 0.545)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(0.95, 0.55)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(0.95, 0.555)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(1, 0.545)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(1, 0.55)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(1, 0.555)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(1.05, 0.545)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(1.05, 0.55)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(1.05, 0.555)', spoint '(1, 0.55)'); select gnomonic_proj(spoint '(2.95, -0.455)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(2.95, -0.45)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(2.95, -0.445)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(3, -0.455)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(3, -0.45)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(3, -0.445)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(3.05, -0.455)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(3.05, -0.45)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(3.05, -0.445)', spoint '(3, -0.45)'); select gnomonic_proj(spoint '(2.95, 0.045)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(2.95, 0.05)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(2.95, 0.055)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(3, 0.045)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(3, 0.05)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(3, 0.055)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(3.05, 0.045)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(3.05, 0.05)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(3.05, 0.055)', spoint '(3, 0.05)'); select gnomonic_proj(spoint '(2.95, 0.545)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(2.95, 0.55)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(2.95, 0.555)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(3, 0.545)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(3, 0.55)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(3, 0.555)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(3.05, 0.545)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(3.05, 0.55)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(3.05, 0.555)', spoint '(3, 0.55)'); select gnomonic_proj(spoint '(4.95, -0.455)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(4.95, -0.45)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(4.95, -0.445)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(5, -0.455)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(5, -0.45)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(5, -0.445)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(5.05, -0.455)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(5.05, -0.45)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(5.05, -0.445)', spoint '(5, -0.45)'); select gnomonic_proj(spoint '(4.95, 0.045)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(4.95, 0.05)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(4.95, 0.055)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(5, 0.045)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(5, 0.05)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(5, 0.055)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(5.05, 0.045)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(5.05, 0.05)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(5.05, 0.055)', spoint '(5, 0.05)'); select gnomonic_proj(spoint '(4.95, 0.545)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(4.95, 0.55)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(4.95, 0.555)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(5, 0.545)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(5, 0.55)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(5, 0.555)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(5.05, 0.545)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(5.05, 0.55)', spoint '(5, 0.55)'); select gnomonic_proj(spoint '(5.05, 0.555)', spoint '(5, 0.55)'); select gnomonic_inv(point '(0.95, -0.455)', spoint '(1, -0.45)'); select gnomonic_inv(point '(0.95, -0.45)', spoint '(1, -0.45)'); select gnomonic_inv(point '(0.95, -0.445)', spoint '(1, -0.45)'); select gnomonic_inv(point '(1, -0.455)', spoint '(1, -0.45)'); select gnomonic_inv(point '(1, -0.45)', spoint '(1, -0.45)'); select gnomonic_inv(point '(1, -0.445)', spoint '(1, -0.45)'); select gnomonic_inv(point '(1.05, -0.455)', spoint '(1, -0.45)'); select gnomonic_inv(point '(1.05, -0.45)', spoint '(1, -0.45)'); select gnomonic_inv(point '(1.05, -0.445)', spoint '(1, -0.45)'); select gnomonic_inv(point '(0.95, 0.045)', spoint '(1, 0.05)'); select gnomonic_inv(point '(0.95, 0.05)', spoint '(1, 0.05)'); select gnomonic_inv(point '(0.95, 0.055)', spoint '(1, 0.05)'); select gnomonic_inv(point '(1, 0.045)', spoint '(1, 0.05)'); select gnomonic_inv(point '(1, 0.05)', spoint '(1, 0.05)'); select gnomonic_inv(point '(1, 0.055)', spoint '(1, 0.05)'); select gnomonic_inv(point '(1.05, 0.045)', spoint '(1, 0.05)'); select gnomonic_inv(point '(1.05, 0.05)', spoint '(1, 0.05)'); select gnomonic_inv(point '(1.05, 0.055)', spoint '(1, 0.05)'); select gnomonic_inv(point '(0.95, 0.545)', spoint '(1, 0.55)'); select gnomonic_inv(point '(0.95, 0.55)', spoint '(1, 0.55)'); select gnomonic_inv(point '(0.95, 0.555)', spoint '(1, 0.55)'); select gnomonic_inv(point '(1, 0.545)', spoint '(1, 0.55)'); select gnomonic_inv(point '(1, 0.55)', spoint '(1, 0.55)'); select gnomonic_inv(point '(1, 0.555)', spoint '(1, 0.55)'); select gnomonic_inv(point '(1.05, 0.545)', spoint '(1, 0.55)'); select gnomonic_inv(point '(1.05, 0.55)', spoint '(1, 0.55)'); select gnomonic_inv(point '(1.05, 0.555)', spoint '(1, 0.55)'); select gnomonic_inv(point '(2.95, -0.455)', spoint '(3, -0.45)'); select gnomonic_inv(point '(2.95, -0.45)', spoint '(3, -0.45)'); select gnomonic_inv(point '(2.95, -0.445)', spoint '(3, -0.45)'); select gnomonic_inv(point '(3, -0.455)', spoint '(3, -0.45)'); select gnomonic_inv(point '(3, -0.45)', spoint '(3, -0.45)'); select gnomonic_inv(point '(3, -0.445)', spoint '(3, -0.45)'); select gnomonic_inv(point '(3.05, -0.455)', spoint '(3, -0.45)'); select gnomonic_inv(point '(3.05, -0.45)', spoint '(3, -0.45)'); select gnomonic_inv(point '(3.05, -0.445)', spoint '(3, -0.45)'); select gnomonic_inv(point '(2.95, 0.045)', spoint '(3, 0.05)'); select gnomonic_inv(point '(2.95, 0.05)', spoint '(3, 0.05)'); select gnomonic_inv(point '(2.95, 0.055)', spoint '(3, 0.05)'); select gnomonic_inv(point '(3, 0.045)', spoint '(3, 0.05)'); select gnomonic_inv(point '(3, 0.05)', spoint '(3, 0.05)'); select gnomonic_inv(point '(3, 0.055)', spoint '(3, 0.05)'); select gnomonic_inv(point '(3.05, 0.045)', spoint '(3, 0.05)'); select gnomonic_inv(point '(3.05, 0.05)', spoint '(3, 0.05)'); select gnomonic_inv(point '(3.05, 0.055)', spoint '(3, 0.05)'); select gnomonic_inv(point '(2.95, 0.545)', spoint '(3, 0.55)'); select gnomonic_inv(point '(2.95, 0.55)', spoint '(3, 0.55)'); select gnomonic_inv(point '(2.95, 0.555)', spoint '(3, 0.55)'); select gnomonic_inv(point '(3, 0.545)', spoint '(3, 0.55)'); select gnomonic_inv(point '(3, 0.55)', spoint '(3, 0.55)'); select gnomonic_inv(point '(3, 0.555)', spoint '(3, 0.55)'); select gnomonic_inv(point '(3.05, 0.545)', spoint '(3, 0.55)'); select gnomonic_inv(point '(3.05, 0.55)', spoint '(3, 0.55)'); select gnomonic_inv(point '(3.05, 0.555)', spoint '(3, 0.55)'); select gnomonic_inv(point '(4.95, -0.455)', spoint '(5, -0.45)'); select gnomonic_inv(point '(4.95, -0.45)', spoint '(5, -0.45)'); select gnomonic_inv(point '(4.95, -0.445)', spoint '(5, -0.45)'); select gnomonic_inv(point '(5, -0.455)', spoint '(5, -0.45)'); select gnomonic_inv(point '(5, -0.45)', spoint '(5, -0.45)'); select gnomonic_inv(point '(5, -0.445)', spoint '(5, -0.45)'); select gnomonic_inv(point '(5.05, -0.455)', spoint '(5, -0.45)'); select gnomonic_inv(point '(5.05, -0.45)', spoint '(5, -0.45)'); select gnomonic_inv(point '(5.05, -0.445)', spoint '(5, -0.45)'); select gnomonic_inv(point '(4.95, 0.045)', spoint '(5, 0.05)'); select gnomonic_inv(point '(4.95, 0.05)', spoint '(5, 0.05)'); select gnomonic_inv(point '(4.95, 0.055)', spoint '(5, 0.05)'); select gnomonic_inv(point '(5, 0.045)', spoint '(5, 0.05)'); select gnomonic_inv(point '(5, 0.05)', spoint '(5, 0.05)'); select gnomonic_inv(point '(5, 0.055)', spoint '(5, 0.05)'); select gnomonic_inv(point '(5.05, 0.045)', spoint '(5, 0.05)'); select gnomonic_inv(point '(5.05, 0.05)', spoint '(5, 0.05)'); select gnomonic_inv(point '(5.05, 0.055)', spoint '(5, 0.05)'); select gnomonic_inv(point '(4.95, 0.545)', spoint '(5, 0.55)'); select gnomonic_inv(point '(4.95, 0.55)', spoint '(5, 0.55)'); select gnomonic_inv(point '(4.95, 0.555)', spoint '(5, 0.55)'); select gnomonic_inv(point '(5, 0.545)', spoint '(5, 0.55)'); select gnomonic_inv(point '(5, 0.55)', spoint '(5, 0.55)'); select gnomonic_inv(point '(5, 0.555)', spoint '(5, 0.55)'); select gnomonic_inv(point '(5.05, 0.545)', spoint '(5, 0.55)'); select gnomonic_inv(point '(5.05, 0.55)', spoint '(5, 0.55)'); select gnomonic_inv(point '(5.05, 0.555)', spoint '(5, 0.55)'); pgsphere-1.5.1/sql/healpix.sql000066400000000000000000003667451461140101500163230ustar00rootroot00000000000000SELECT set_sphere_output_precision(9); select nside2order(1); select nside2order(2); select nside2order(4); select nside2order(8); select nside2order(16); select nside2order(32); select nside2order(64); select nside2order(128); select nside2order(256); select nside2order(512); select nside2order(1024); select nside2order(2048); select nside2order(4096); select nside2order(8192); select nside2order(16384); select nside2order(32768); select nside2order(65536); select nside2order(131072); select nside2order(262144); select nside2order(524288); select nside2order(1048576); select nside2order(2097152); select nside2order(4194304); select nside2order(8388608); select nside2order(16777216); select nside2order(33554432); select nside2order(67108864); select nside2order(134217728); select nside2order(268435456); select nside2order(536870912); select order2nside(0); select order2nside(1); select order2nside(2); select order2nside(3); select order2nside(4); select order2nside(5); select order2nside(6); select order2nside(7); select order2nside(8); select order2nside(9); select order2nside(10); select order2nside(11); select order2nside(12); select order2nside(13); select order2nside(14); select order2nside(15); select order2nside(16); select order2nside(17); select order2nside(18); select order2nside(19); select order2nside(20); select order2nside(21); select order2nside(22); select order2nside(23); select order2nside(24); select order2nside(25); select order2nside(26); select order2nside(27); select order2nside(28); select order2nside(29); select nside2npix(1); select nside2npix(2); select nside2npix(4); select nside2npix(8); select nside2npix(16); select nside2npix(32); select nside2npix(64); select nside2npix(128); select nside2npix(256); select nside2npix(512); select nside2npix(1024); select nside2npix(2048); select nside2npix(4096); select nside2npix(8192); select nside2npix(16384); select nside2npix(32768); select nside2npix(65536); select nside2npix(131072); select nside2npix(262144); select nside2npix(524288); select nside2npix(1048576); select nside2npix(2097152); select nside2npix(4194304); select nside2npix(8388608); select nside2npix(16777216); select nside2npix(33554432); select nside2npix(67108864); select nside2npix(134217728); select nside2npix(268435456); select nside2npix(536870912); select npix2nside(12); select npix2nside(48); select npix2nside(192); select npix2nside(768); select npix2nside(3072); select npix2nside(12288); select npix2nside(49152); select npix2nside(196608); select npix2nside(786432); select npix2nside(3145728); select npix2nside(12582912); select npix2nside(50331648); select npix2nside(201326592); select npix2nside(805306368); select npix2nside(3221225472); select npix2nside(12884901888); select npix2nside(51539607552); select npix2nside(206158430208); select npix2nside(824633720832); select npix2nside(3298534883328); select npix2nside(13194139533312); select npix2nside(52776558133248); select npix2nside(211106232532992); select npix2nside(844424930131968); select npix2nside(3377699720527872); select npix2nside(13510798882111488); select npix2nside(54043195528445952); select npix2nside(216172782113783808); select npix2nside(864691128455135232); select npix2nside(3458764513820540928); select healpix_nest(0, '(0d, -90d)'); select healpix_ring(0, '(0d, -45d)'); select healpix_ring(0, '(0d, 0.0001)'); select healpix_ring(0, '(0d, 45d)'); select healpix_ring(0, '(0d, 90d)'); select healpix_ring(0, '(90d, -90d)'); select healpix_ring(0, '(90d, -45d)'); select healpix_ring(0, '(90d, 0.0001)'); select healpix_ring(0, '(90d, 45d)'); select healpix_nest(0, '(90d, 90d)'); select healpix_nest(0, '(180d, -90d)'); select healpix_ring(0, '(180d, -45d)'); select healpix_ring(0, '(180d, 0.0001)'); select healpix_nest(0, '(180d, 45d)'); select healpix_nest(0, '(180d, 90d)'); select healpix_nest(0, '(270d, -90d)'); select healpix_nest(0, '(270d, -45d)'); select healpix_ring(0, '(270d, 0.0001)'); select healpix_nest(0, '(270d, 45d)'); select healpix_nest(0, '(270d, 90d)'); select healpix_nest(0, '(360d, -90d)'); select healpix_ring(0, '(360d, -45d)'); select healpix_nest(0, '(360d, 0.0001)'); select healpix_nest(0, '(360d, 45d)'); select healpix_ring(0, '(360d, 90d)'); select healpix_nest(5, '(0d, -90d)'); select healpix_ring(5, '(0d, -67.5d)'); select healpix_nest(5, '(0d, -45d)'); select healpix_nest(5, '(0d, -22.5d)'); select healpix_nest(5, '(0d, 0.0001)'); select healpix_nest(5, '(0d, 22.5d)'); select healpix_ring(5, '(0d, 45d)'); select healpix_ring(5, '(0d, 67.5d)'); select healpix_ring(5, '(0d, 90d)'); select healpix_nest(5, '(45d, -90d)'); select healpix_nest(5, '(45d, -67.5d)'); select healpix_nest(5, '(45d, -45d)'); select healpix_ring(5, '(45d, -22.5d)'); select healpix_ring(5, '(45d, 0.0001)'); select healpix_nest(5, '(45d, 22.5d)'); select healpix_nest(5, '(45d, 45d)'); select healpix_ring(5, '(45d, 67.5d)'); select healpix_nest(5, '(45d, 90d)'); select healpix_ring(5, '(90d, -90d)'); select healpix_nest(5, '(90d, -67.5d)'); select healpix_nest(5, '(90d, -45d)'); select healpix_ring(5, '(90d, -22.5d)'); select healpix_ring(5, '(90d, 0.0001)'); select healpix_ring(5, '(90d, 22.5d)'); select healpix_ring(5, '(90d, 45d)'); select healpix_nest(5, '(90d, 67.5d)'); select healpix_nest(5, '(90d, 90d)'); select healpix_ring(5, '(135d, -90d)'); select healpix_ring(5, '(135d, -67.5d)'); select healpix_nest(5, '(135d, -45d)'); select healpix_nest(5, '(135d, -22.5d)'); select healpix_nest(5, '(135d, 0.0001)'); select healpix_ring(5, '(135d, 22.5d)'); select healpix_nest(5, '(135d, 45d)'); select healpix_ring(5, '(135d, 67.5d)'); select healpix_ring(5, '(135d, 90d)'); select healpix_ring(5, '(180d, -90d)'); select healpix_nest(5, '(180d, -67.5d)'); select healpix_nest(5, '(180d, -45d)'); select healpix_ring(5, '(180d, -22.5d)'); select healpix_ring(5, '(180d, 0.0001)'); select healpix_nest(5, '(180d, 22.5d)'); select healpix_ring(5, '(180d, 45d)'); select healpix_ring(5, '(180d, 67.5d)'); select healpix_ring(5, '(180d, 90d)'); select healpix_nest(5, '(225d, -90d)'); select healpix_ring(5, '(225d, -67.5d)'); select healpix_ring(5, '(225d, -45d)'); select healpix_nest(5, '(225d, -22.5d)'); select healpix_nest(5, '(225d, 0.0001)'); select healpix_nest(5, '(225d, 22.5d)'); select healpix_nest(5, '(225d, 45d)'); select healpix_ring(5, '(225d, 67.5d)'); select healpix_ring(5, '(225d, 90d)'); select healpix_ring(5, '(270d, -90d)'); select healpix_ring(5, '(270d, -67.5d)'); select healpix_ring(5, '(270d, -45d)'); select healpix_nest(5, '(270d, -22.5d)'); select healpix_nest(5, '(270d, 0.0001)'); select healpix_nest(5, '(270d, 22.5d)'); select healpix_ring(5, '(270d, 45d)'); select healpix_ring(5, '(270d, 67.5d)'); select healpix_ring(5, '(270d, 90d)'); select healpix_ring(5, '(315d, -90d)'); select healpix_nest(5, '(315d, -67.5d)'); select healpix_ring(5, '(315d, -45d)'); select healpix_nest(5, '(315d, -22.5d)'); select healpix_nest(5, '(315d, 0.0001)'); select healpix_nest(5, '(315d, 22.5d)'); select healpix_nest(5, '(315d, 45d)'); select healpix_ring(5, '(315d, 67.5d)'); select healpix_ring(5, '(315d, 90d)'); select healpix_nest(5, '(360d, -90d)'); select healpix_nest(5, '(360d, -67.5d)'); select healpix_nest(5, '(360d, -45d)'); select healpix_ring(5, '(360d, -22.5d)'); select healpix_nest(5, '(360d, 0.0001)'); select healpix_ring(5, '(360d, 22.5d)'); select healpix_nest(5, '(360d, 45d)'); select healpix_nest(5, '(360d, 67.5d)'); select healpix_nest(5, '(360d, 90d)'); select healpix_ring(10, '(0d, -90d)'); select healpix_ring(10, '(0d, -78.75d)'); select healpix_ring(10, '(0d, -67.5d)'); select healpix_nest(10, '(0d, -56.25d)'); select healpix_nest(10, '(0d, -45d)'); select healpix_nest(10, '(0d, -33.75d)'); select healpix_ring(10, '(0d, -22.5d)'); select healpix_nest(10, '(0d, -11.25d)'); select healpix_ring(10, '(0d, 0.0001)'); select healpix_nest(10, '(0d, 11.25d)'); select healpix_ring(10, '(0d, 22.5d)'); select healpix_ring(10, '(0d, 33.75d)'); select healpix_ring(10, '(0d, 45d)'); select healpix_ring(10, '(0d, 56.25d)'); select healpix_nest(10, '(0d, 67.5d)'); select healpix_nest(10, '(0d, 78.75d)'); select healpix_nest(10, '(0d, 90d)'); select healpix_nest(10, '(22.5d, -90d)'); select healpix_nest(10, '(22.5d, -78.75d)'); select healpix_nest(10, '(22.5d, -67.5d)'); select healpix_ring(10, '(22.5d, -56.25d)'); select healpix_nest(10, '(22.5d, -45d)'); select healpix_nest(10, '(22.5d, -33.75d)'); select healpix_nest(10, '(22.5d, -22.5d)'); select healpix_ring(10, '(22.5d, -11.25d)'); select healpix_nest(10, '(22.5d, 0.0001)'); select healpix_ring(10, '(22.5d, 11.25d)'); select healpix_ring(10, '(22.5d, 22.5d)'); select healpix_ring(10, '(22.5d, 33.75d)'); select healpix_nest(10, '(22.5d, 45d)'); select healpix_ring(10, '(22.5d, 56.25d)'); select healpix_ring(10, '(22.5d, 67.5d)'); select healpix_nest(10, '(22.5d, 78.75d)'); select healpix_nest(10, '(22.5d, 90d)'); select healpix_nest(10, '(45d, -90d)'); select healpix_ring(10, '(45d, -78.75d)'); select healpix_nest(10, '(45d, -67.5d)'); select healpix_ring(10, '(45d, -56.25d)'); select healpix_nest(10, '(45d, -45d)'); select healpix_ring(10, '(45d, -33.75d)'); select healpix_nest(10, '(45d, -22.5d)'); select healpix_nest(10, '(45d, -11.25d)'); select healpix_nest(10, '(45d, 0.0001)'); select healpix_nest(10, '(45d, 11.25d)'); select healpix_nest(10, '(45d, 22.5d)'); select healpix_nest(10, '(45d, 33.75d)'); select healpix_nest(10, '(45d, 45d)'); select healpix_nest(10, '(45d, 56.25d)'); select healpix_ring(10, '(45d, 67.5d)'); select healpix_ring(10, '(45d, 78.75d)'); select healpix_ring(10, '(45d, 90d)'); select healpix_nest(10, '(67.5d, -90d)'); select healpix_nest(10, '(67.5d, -78.75d)'); select healpix_nest(10, '(67.5d, -67.5d)'); select healpix_nest(10, '(67.5d, -56.25d)'); select healpix_nest(10, '(67.5d, -45d)'); select healpix_nest(10, '(67.5d, -33.75d)'); select healpix_nest(10, '(67.5d, -22.5d)'); select healpix_nest(10, '(67.5d, -11.25d)'); select healpix_ring(10, '(67.5d, 0.0001)'); select healpix_ring(10, '(67.5d, 11.25d)'); select healpix_ring(10, '(67.5d, 22.5d)'); select healpix_nest(10, '(67.5d, 33.75d)'); select healpix_nest(10, '(67.5d, 45d)'); select healpix_ring(10, '(67.5d, 56.25d)'); select healpix_nest(10, '(67.5d, 67.5d)'); select healpix_nest(10, '(67.5d, 78.75d)'); select healpix_nest(10, '(67.5d, 90d)'); select healpix_nest(10, '(90d, -90d)'); select healpix_nest(10, '(90d, -78.75d)'); select healpix_ring(10, '(90d, -67.5d)'); select healpix_ring(10, '(90d, -56.25d)'); select healpix_nest(10, '(90d, -45d)'); select healpix_ring(10, '(90d, -33.75d)'); select healpix_ring(10, '(90d, -22.5d)'); select healpix_nest(10, '(90d, -11.25d)'); select healpix_nest(10, '(90d, 0.0001)'); select healpix_ring(10, '(90d, 11.25d)'); select healpix_nest(10, '(90d, 22.5d)'); select healpix_ring(10, '(90d, 33.75d)'); select healpix_nest(10, '(90d, 45d)'); select healpix_nest(10, '(90d, 56.25d)'); select healpix_nest(10, '(90d, 67.5d)'); select healpix_ring(10, '(90d, 78.75d)'); select healpix_nest(10, '(90d, 90d)'); select healpix_nest(10, '(112.5d, -90d)'); select healpix_nest(10, '(112.5d, -78.75d)'); select healpix_ring(10, '(112.5d, -67.5d)'); select healpix_ring(10, '(112.5d, -56.25d)'); select healpix_ring(10, '(112.5d, -45d)'); select healpix_ring(10, '(112.5d, -33.75d)'); select healpix_ring(10, '(112.5d, -22.5d)'); select healpix_nest(10, '(112.5d, -11.25d)'); select healpix_nest(10, '(112.5d, 0.0001)'); select healpix_nest(10, '(112.5d, 11.25d)'); select healpix_ring(10, '(112.5d, 22.5d)'); select healpix_nest(10, '(112.5d, 33.75d)'); select healpix_nest(10, '(112.5d, 45d)'); select healpix_ring(10, '(112.5d, 56.25d)'); select healpix_ring(10, '(112.5d, 67.5d)'); select healpix_nest(10, '(112.5d, 78.75d)'); select healpix_ring(10, '(112.5d, 90d)'); select healpix_nest(10, '(135d, -90d)'); select healpix_ring(10, '(135d, -78.75d)'); select healpix_ring(10, '(135d, -67.5d)'); select healpix_nest(10, '(135d, -56.25d)'); select healpix_ring(10, '(135d, -45d)'); select healpix_ring(10, '(135d, -33.75d)'); select healpix_nest(10, '(135d, -22.5d)'); select healpix_nest(10, '(135d, -11.25d)'); select healpix_nest(10, '(135d, 0.0001)'); select healpix_nest(10, '(135d, 11.25d)'); select healpix_nest(10, '(135d, 22.5d)'); select healpix_ring(10, '(135d, 33.75d)'); select healpix_ring(10, '(135d, 45d)'); select healpix_ring(10, '(135d, 56.25d)'); select healpix_nest(10, '(135d, 67.5d)'); select healpix_ring(10, '(135d, 78.75d)'); select healpix_ring(10, '(135d, 90d)'); select healpix_ring(10, '(157.5d, -90d)'); select healpix_nest(10, '(157.5d, -78.75d)'); select healpix_ring(10, '(157.5d, -67.5d)'); select healpix_ring(10, '(157.5d, -56.25d)'); select healpix_nest(10, '(157.5d, -45d)'); select healpix_nest(10, '(157.5d, -33.75d)'); select healpix_ring(10, '(157.5d, -22.5d)'); select healpix_nest(10, '(157.5d, -11.25d)'); select healpix_nest(10, '(157.5d, 0.0001)'); select healpix_ring(10, '(157.5d, 11.25d)'); select healpix_ring(10, '(157.5d, 22.5d)'); select healpix_nest(10, '(157.5d, 33.75d)'); select healpix_nest(10, '(157.5d, 45d)'); select healpix_ring(10, '(157.5d, 56.25d)'); select healpix_ring(10, '(157.5d, 67.5d)'); select healpix_nest(10, '(157.5d, 78.75d)'); select healpix_ring(10, '(157.5d, 90d)'); select healpix_nest(10, '(180d, -90d)'); select healpix_ring(10, '(180d, -78.75d)'); select healpix_nest(10, '(180d, -67.5d)'); select healpix_ring(10, '(180d, -56.25d)'); select healpix_ring(10, '(180d, -45d)'); select healpix_ring(10, '(180d, -33.75d)'); select healpix_nest(10, '(180d, -22.5d)'); select healpix_ring(10, '(180d, -11.25d)'); select healpix_nest(10, '(180d, 0.0001)'); select healpix_nest(10, '(180d, 11.25d)'); select healpix_ring(10, '(180d, 22.5d)'); select healpix_nest(10, '(180d, 33.75d)'); select healpix_nest(10, '(180d, 45d)'); select healpix_nest(10, '(180d, 56.25d)'); select healpix_ring(10, '(180d, 67.5d)'); select healpix_ring(10, '(180d, 78.75d)'); select healpix_nest(10, '(180d, 90d)'); select healpix_nest(10, '(202.5d, -90d)'); select healpix_ring(10, '(202.5d, -78.75d)'); select healpix_nest(10, '(202.5d, -67.5d)'); select healpix_nest(10, '(202.5d, -56.25d)'); select healpix_nest(10, '(202.5d, -45d)'); select healpix_nest(10, '(202.5d, -33.75d)'); select healpix_nest(10, '(202.5d, -22.5d)'); select healpix_nest(10, '(202.5d, -11.25d)'); select healpix_nest(10, '(202.5d, 0.0001)'); select healpix_ring(10, '(202.5d, 11.25d)'); select healpix_ring(10, '(202.5d, 22.5d)'); select healpix_ring(10, '(202.5d, 33.75d)'); select healpix_nest(10, '(202.5d, 45d)'); select healpix_nest(10, '(202.5d, 56.25d)'); select healpix_nest(10, '(202.5d, 67.5d)'); select healpix_nest(10, '(202.5d, 78.75d)'); select healpix_nest(10, '(202.5d, 90d)'); select healpix_ring(10, '(225d, -90d)'); select healpix_nest(10, '(225d, -78.75d)'); select healpix_nest(10, '(225d, -67.5d)'); select healpix_nest(10, '(225d, -56.25d)'); select healpix_ring(10, '(225d, -45d)'); select healpix_nest(10, '(225d, -33.75d)'); select healpix_ring(10, '(225d, -22.5d)'); select healpix_ring(10, '(225d, -11.25d)'); select healpix_ring(10, '(225d, 0.0001)'); select healpix_ring(10, '(225d, 11.25d)'); select healpix_nest(10, '(225d, 22.5d)'); select healpix_nest(10, '(225d, 33.75d)'); select healpix_nest(10, '(225d, 45d)'); select healpix_nest(10, '(225d, 56.25d)'); select healpix_nest(10, '(225d, 67.5d)'); select healpix_nest(10, '(225d, 78.75d)'); select healpix_ring(10, '(225d, 90d)'); select healpix_nest(10, '(247.5d, -90d)'); select healpix_ring(10, '(247.5d, -78.75d)'); select healpix_ring(10, '(247.5d, -67.5d)'); select healpix_ring(10, '(247.5d, -56.25d)'); select healpix_ring(10, '(247.5d, -45d)'); select healpix_ring(10, '(247.5d, -33.75d)'); select healpix_nest(10, '(247.5d, -22.5d)'); select healpix_ring(10, '(247.5d, -11.25d)'); select healpix_nest(10, '(247.5d, 0.0001)'); select healpix_nest(10, '(247.5d, 11.25d)'); select healpix_nest(10, '(247.5d, 22.5d)'); select healpix_nest(10, '(247.5d, 33.75d)'); select healpix_nest(10, '(247.5d, 45d)'); select healpix_nest(10, '(247.5d, 56.25d)'); select healpix_nest(10, '(247.5d, 67.5d)'); select healpix_ring(10, '(247.5d, 78.75d)'); select healpix_nest(10, '(247.5d, 90d)'); select healpix_nest(10, '(270d, -90d)'); select healpix_ring(10, '(270d, -78.75d)'); select healpix_ring(10, '(270d, -67.5d)'); select healpix_ring(10, '(270d, -56.25d)'); select healpix_nest(10, '(270d, -45d)'); select healpix_ring(10, '(270d, -33.75d)'); select healpix_nest(10, '(270d, -22.5d)'); select healpix_nest(10, '(270d, -11.25d)'); select healpix_nest(10, '(270d, 0.0001)'); select healpix_nest(10, '(270d, 11.25d)'); select healpix_nest(10, '(270d, 22.5d)'); select healpix_ring(10, '(270d, 33.75d)'); select healpix_ring(10, '(270d, 45d)'); select healpix_ring(10, '(270d, 56.25d)'); select healpix_ring(10, '(270d, 67.5d)'); select healpix_ring(10, '(270d, 78.75d)'); select healpix_nest(10, '(270d, 90d)'); select healpix_nest(10, '(292.5d, -90d)'); select healpix_ring(10, '(292.5d, -78.75d)'); select healpix_nest(10, '(292.5d, -67.5d)'); select healpix_nest(10, '(292.5d, -56.25d)'); select healpix_ring(10, '(292.5d, -45d)'); select healpix_ring(10, '(292.5d, -33.75d)'); select healpix_ring(10, '(292.5d, -22.5d)'); select healpix_ring(10, '(292.5d, -11.25d)'); select healpix_nest(10, '(292.5d, 0.0001)'); select healpix_ring(10, '(292.5d, 11.25d)'); select healpix_ring(10, '(292.5d, 22.5d)'); select healpix_nest(10, '(292.5d, 33.75d)'); select healpix_nest(10, '(292.5d, 45d)'); select healpix_nest(10, '(292.5d, 56.25d)'); select healpix_ring(10, '(292.5d, 67.5d)'); select healpix_nest(10, '(292.5d, 78.75d)'); select healpix_ring(10, '(292.5d, 90d)'); select healpix_nest(10, '(315d, -90d)'); select healpix_nest(10, '(315d, -78.75d)'); select healpix_ring(10, '(315d, -67.5d)'); select healpix_ring(10, '(315d, -56.25d)'); select healpix_nest(10, '(315d, -45d)'); select healpix_ring(10, '(315d, -33.75d)'); select healpix_nest(10, '(315d, -22.5d)'); select healpix_ring(10, '(315d, -11.25d)'); select healpix_nest(10, '(315d, 0.0001)'); select healpix_nest(10, '(315d, 11.25d)'); select healpix_ring(10, '(315d, 22.5d)'); select healpix_ring(10, '(315d, 33.75d)'); select healpix_nest(10, '(315d, 45d)'); select healpix_nest(10, '(315d, 56.25d)'); select healpix_ring(10, '(315d, 67.5d)'); select healpix_ring(10, '(315d, 78.75d)'); select healpix_ring(10, '(315d, 90d)'); select healpix_nest(10, '(337.5d, -90d)'); select healpix_ring(10, '(337.5d, -78.75d)'); select healpix_nest(10, '(337.5d, -67.5d)'); select healpix_ring(10, '(337.5d, -56.25d)'); select healpix_nest(10, '(337.5d, -45d)'); select healpix_ring(10, '(337.5d, -33.75d)'); select healpix_nest(10, '(337.5d, -22.5d)'); select healpix_ring(10, '(337.5d, -11.25d)'); select healpix_nest(10, '(337.5d, 0.0001)'); select healpix_ring(10, '(337.5d, 11.25d)'); select healpix_ring(10, '(337.5d, 22.5d)'); select healpix_nest(10, '(337.5d, 33.75d)'); select healpix_nest(10, '(337.5d, 45d)'); select healpix_ring(10, '(337.5d, 56.25d)'); select healpix_ring(10, '(337.5d, 67.5d)'); select healpix_ring(10, '(337.5d, 78.75d)'); select healpix_ring(10, '(337.5d, 90d)'); select healpix_nest(10, '(360d, -90d)'); select healpix_nest(10, '(360d, -78.75d)'); select healpix_ring(10, '(360d, -67.5d)'); select healpix_ring(10, '(360d, -56.25d)'); select healpix_ring(10, '(360d, -45d)'); select healpix_ring(10, '(360d, -33.75d)'); select healpix_nest(10, '(360d, -22.5d)'); select healpix_ring(10, '(360d, -11.25d)'); select healpix_nest(10, '(360d, 0.0001)'); select healpix_nest(10, '(360d, 11.25d)'); select healpix_nest(10, '(360d, 22.5d)'); select healpix_ring(10, '(360d, 33.75d)'); select healpix_nest(10, '(360d, 45d)'); select healpix_nest(10, '(360d, 56.25d)'); select healpix_ring(10, '(360d, 67.5d)'); select healpix_ring(10, '(360d, 78.75d)'); select healpix_nest(10, '(360d, 90d)'); select healpix_ring(15, '(0d, -90d)'); select healpix_ring(15, '(0d, -84.375d)'); select healpix_nest(15, '(0d, -78.75d)'); select healpix_nest(15, '(0d, -73.125d)'); select healpix_nest(15, '(0d, -67.5d)'); select healpix_nest(15, '(0d, -61.875d)'); select healpix_nest(15, '(0d, -56.25d)'); select healpix_ring(15, '(0d, -50.625d)'); select healpix_ring(15, '(0d, -45d)'); select healpix_ring(15, '(0d, -39.375d)'); select healpix_nest(15, '(0d, -33.75d)'); select healpix_nest(15, '(0d, -28.125d)'); select healpix_ring(15, '(0d, -22.5d)'); select healpix_ring(15, '(0d, -16.875d)'); select healpix_nest(15, '(0d, -11.25d)'); select healpix_nest(15, '(0d, -5.625d)'); select healpix_ring(15, '(0d, 0.0001)'); select healpix_ring(15, '(0d, 5.625d)'); select healpix_ring(15, '(0d, 11.25d)'); select healpix_ring(15, '(0d, 16.875d)'); select healpix_ring(15, '(0d, 22.5d)'); select healpix_nest(15, '(0d, 28.125d)'); select healpix_nest(15, '(0d, 33.75d)'); select healpix_nest(15, '(0d, 39.375d)'); select healpix_nest(15, '(0d, 45d)'); select healpix_nest(15, '(0d, 50.625d)'); select healpix_nest(15, '(0d, 56.25d)'); select healpix_nest(15, '(0d, 61.875d)'); select healpix_nest(15, '(0d, 67.5d)'); select healpix_ring(15, '(0d, 73.125d)'); select healpix_ring(15, '(0d, 78.75d)'); select healpix_nest(15, '(0d, 84.375d)'); select healpix_nest(15, '(0d, 90d)'); select healpix_ring(15, '(11.25d, -90d)'); select healpix_ring(15, '(11.25d, -84.375d)'); select healpix_ring(15, '(11.25d, -78.75d)'); select healpix_nest(15, '(11.25d, -73.125d)'); select healpix_ring(15, '(11.25d, -67.5d)'); select healpix_ring(15, '(11.25d, -61.875d)'); select healpix_nest(15, '(11.25d, -56.25d)'); select healpix_ring(15, '(11.25d, -50.625d)'); select healpix_nest(15, '(11.25d, -45d)'); select healpix_nest(15, '(11.25d, -39.375d)'); select healpix_ring(15, '(11.25d, -33.75d)'); select healpix_ring(15, '(11.25d, -28.125d)'); select healpix_nest(15, '(11.25d, -22.5d)'); select healpix_ring(15, '(11.25d, -16.875d)'); select healpix_ring(15, '(11.25d, -11.25d)'); select healpix_ring(15, '(11.25d, -5.625d)'); select healpix_ring(15, '(11.25d, 0.0001)'); select healpix_nest(15, '(11.25d, 5.625d)'); select healpix_ring(15, '(11.25d, 11.25d)'); select healpix_ring(15, '(11.25d, 16.875d)'); select healpix_ring(15, '(11.25d, 22.5d)'); select healpix_nest(15, '(11.25d, 28.125d)'); select healpix_nest(15, '(11.25d, 33.75d)'); select healpix_nest(15, '(11.25d, 39.375d)'); select healpix_ring(15, '(11.25d, 45d)'); select healpix_ring(15, '(11.25d, 50.625d)'); select healpix_ring(15, '(11.25d, 56.25d)'); select healpix_ring(15, '(11.25d, 61.875d)'); select healpix_ring(15, '(11.25d, 67.5d)'); select healpix_ring(15, '(11.25d, 73.125d)'); select healpix_nest(15, '(11.25d, 78.75d)'); select healpix_nest(15, '(11.25d, 84.375d)'); select healpix_ring(15, '(11.25d, 90d)'); select healpix_nest(15, '(22.5d, -90d)'); select healpix_nest(15, '(22.5d, -84.375d)'); select healpix_ring(15, '(22.5d, -78.75d)'); select healpix_nest(15, '(22.5d, -73.125d)'); select healpix_nest(15, '(22.5d, -67.5d)'); select healpix_ring(15, '(22.5d, -61.875d)'); select healpix_nest(15, '(22.5d, -56.25d)'); select healpix_ring(15, '(22.5d, -50.625d)'); select healpix_nest(15, '(22.5d, -45d)'); select healpix_nest(15, '(22.5d, -39.375d)'); select healpix_nest(15, '(22.5d, -33.75d)'); select healpix_nest(15, '(22.5d, -28.125d)'); select healpix_ring(15, '(22.5d, -22.5d)'); select healpix_ring(15, '(22.5d, -16.875d)'); select healpix_ring(15, '(22.5d, -11.25d)'); select healpix_ring(15, '(22.5d, -5.625d)'); select healpix_ring(15, '(22.5d, 0.0001)'); select healpix_ring(15, '(22.5d, 5.625d)'); select healpix_ring(15, '(22.5d, 11.25d)'); select healpix_ring(15, '(22.5d, 16.875d)'); select healpix_ring(15, '(22.5d, 22.5d)'); select healpix_nest(15, '(22.5d, 28.125d)'); select healpix_ring(15, '(22.5d, 33.75d)'); select healpix_ring(15, '(22.5d, 39.375d)'); select healpix_nest(15, '(22.5d, 45d)'); select healpix_nest(15, '(22.5d, 50.625d)'); select healpix_ring(15, '(22.5d, 56.25d)'); select healpix_ring(15, '(22.5d, 61.875d)'); select healpix_ring(15, '(22.5d, 67.5d)'); select healpix_nest(15, '(22.5d, 73.125d)'); select healpix_ring(15, '(22.5d, 78.75d)'); select healpix_ring(15, '(22.5d, 84.375d)'); select healpix_ring(15, '(22.5d, 90d)'); select healpix_nest(15, '(33.75d, -90d)'); select healpix_nest(15, '(33.75d, -84.375d)'); select healpix_ring(15, '(33.75d, -78.75d)'); select healpix_ring(15, '(33.75d, -73.125d)'); select healpix_nest(15, '(33.75d, -67.5d)'); select healpix_ring(15, '(33.75d, -61.875d)'); select healpix_nest(15, '(33.75d, -56.25d)'); select healpix_nest(15, '(33.75d, -50.625d)'); select healpix_nest(15, '(33.75d, -45d)'); select healpix_nest(15, '(33.75d, -39.375d)'); select healpix_nest(15, '(33.75d, -33.75d)'); select healpix_ring(15, '(33.75d, -28.125d)'); select healpix_ring(15, '(33.75d, -22.5d)'); select healpix_nest(15, '(33.75d, -16.875d)'); select healpix_nest(15, '(33.75d, -11.25d)'); select healpix_ring(15, '(33.75d, -5.625d)'); select healpix_nest(15, '(33.75d, 0.0001)'); select healpix_nest(15, '(33.75d, 5.625d)'); select healpix_ring(15, '(33.75d, 11.25d)'); select healpix_nest(15, '(33.75d, 16.875d)'); select healpix_ring(15, '(33.75d, 22.5d)'); select healpix_ring(15, '(33.75d, 28.125d)'); select healpix_ring(15, '(33.75d, 33.75d)'); select healpix_nest(15, '(33.75d, 39.375d)'); select healpix_ring(15, '(33.75d, 45d)'); select healpix_ring(15, '(33.75d, 50.625d)'); select healpix_nest(15, '(33.75d, 56.25d)'); select healpix_ring(15, '(33.75d, 61.875d)'); select healpix_ring(15, '(33.75d, 67.5d)'); select healpix_ring(15, '(33.75d, 73.125d)'); select healpix_nest(15, '(33.75d, 78.75d)'); select healpix_ring(15, '(33.75d, 84.375d)'); select healpix_nest(15, '(33.75d, 90d)'); select healpix_ring(15, '(45d, -90d)'); select healpix_nest(15, '(45d, -84.375d)'); select healpix_nest(15, '(45d, -78.75d)'); select healpix_nest(15, '(45d, -73.125d)'); select healpix_ring(15, '(45d, -67.5d)'); select healpix_nest(15, '(45d, -61.875d)'); select healpix_ring(15, '(45d, -56.25d)'); select healpix_nest(15, '(45d, -50.625d)'); select healpix_nest(15, '(45d, -45d)'); select healpix_nest(15, '(45d, -39.375d)'); select healpix_ring(15, '(45d, -33.75d)'); select healpix_ring(15, '(45d, -28.125d)'); select healpix_ring(15, '(45d, -22.5d)'); select healpix_nest(15, '(45d, -16.875d)'); select healpix_ring(15, '(45d, -11.25d)'); select healpix_nest(15, '(45d, -5.625d)'); select healpix_ring(15, '(45d, 0.0001)'); select healpix_nest(15, '(45d, 5.625d)'); select healpix_ring(15, '(45d, 11.25d)'); select healpix_nest(15, '(45d, 16.875d)'); select healpix_ring(15, '(45d, 22.5d)'); select healpix_nest(15, '(45d, 28.125d)'); select healpix_ring(15, '(45d, 33.75d)'); select healpix_nest(15, '(45d, 39.375d)'); select healpix_ring(15, '(45d, 45d)'); select healpix_ring(15, '(45d, 50.625d)'); select healpix_nest(15, '(45d, 56.25d)'); select healpix_ring(15, '(45d, 61.875d)'); select healpix_ring(15, '(45d, 67.5d)'); select healpix_nest(15, '(45d, 73.125d)'); select healpix_ring(15, '(45d, 78.75d)'); select healpix_nest(15, '(45d, 84.375d)'); select healpix_nest(15, '(45d, 90d)'); select healpix_nest(15, '(56.25d, -90d)'); select healpix_ring(15, '(56.25d, -84.375d)'); select healpix_nest(15, '(56.25d, -78.75d)'); select healpix_ring(15, '(56.25d, -73.125d)'); select healpix_nest(15, '(56.25d, -67.5d)'); select healpix_nest(15, '(56.25d, -61.875d)'); select healpix_nest(15, '(56.25d, -56.25d)'); select healpix_ring(15, '(56.25d, -50.625d)'); select healpix_ring(15, '(56.25d, -45d)'); select healpix_ring(15, '(56.25d, -39.375d)'); select healpix_nest(15, '(56.25d, -33.75d)'); select healpix_ring(15, '(56.25d, -28.125d)'); select healpix_nest(15, '(56.25d, -22.5d)'); select healpix_nest(15, '(56.25d, -16.875d)'); select healpix_nest(15, '(56.25d, -11.25d)'); select healpix_ring(15, '(56.25d, -5.625d)'); select healpix_nest(15, '(56.25d, 0.0001)'); select healpix_ring(15, '(56.25d, 5.625d)'); select healpix_ring(15, '(56.25d, 11.25d)'); select healpix_ring(15, '(56.25d, 16.875d)'); select healpix_nest(15, '(56.25d, 22.5d)'); select healpix_ring(15, '(56.25d, 28.125d)'); select healpix_nest(15, '(56.25d, 33.75d)'); select healpix_nest(15, '(56.25d, 39.375d)'); select healpix_nest(15, '(56.25d, 45d)'); select healpix_nest(15, '(56.25d, 50.625d)'); select healpix_nest(15, '(56.25d, 56.25d)'); select healpix_nest(15, '(56.25d, 61.875d)'); select healpix_ring(15, '(56.25d, 67.5d)'); select healpix_nest(15, '(56.25d, 73.125d)'); select healpix_ring(15, '(56.25d, 78.75d)'); select healpix_nest(15, '(56.25d, 84.375d)'); select healpix_nest(15, '(56.25d, 90d)'); select healpix_ring(15, '(67.5d, -90d)'); select healpix_ring(15, '(67.5d, -84.375d)'); select healpix_ring(15, '(67.5d, -78.75d)'); select healpix_ring(15, '(67.5d, -73.125d)'); select healpix_ring(15, '(67.5d, -67.5d)'); select healpix_ring(15, '(67.5d, -61.875d)'); select healpix_ring(15, '(67.5d, -56.25d)'); select healpix_nest(15, '(67.5d, -50.625d)'); select healpix_ring(15, '(67.5d, -45d)'); select healpix_nest(15, '(67.5d, -39.375d)'); select healpix_ring(15, '(67.5d, -33.75d)'); select healpix_nest(15, '(67.5d, -28.125d)'); select healpix_ring(15, '(67.5d, -22.5d)'); select healpix_ring(15, '(67.5d, -16.875d)'); select healpix_ring(15, '(67.5d, -11.25d)'); select healpix_ring(15, '(67.5d, -5.625d)'); select healpix_ring(15, '(67.5d, 0.0001)'); select healpix_nest(15, '(67.5d, 5.625d)'); select healpix_nest(15, '(67.5d, 11.25d)'); select healpix_nest(15, '(67.5d, 16.875d)'); select healpix_nest(15, '(67.5d, 22.5d)'); select healpix_ring(15, '(67.5d, 28.125d)'); select healpix_ring(15, '(67.5d, 33.75d)'); select healpix_nest(15, '(67.5d, 39.375d)'); select healpix_ring(15, '(67.5d, 45d)'); select healpix_nest(15, '(67.5d, 50.625d)'); select healpix_nest(15, '(67.5d, 56.25d)'); select healpix_nest(15, '(67.5d, 61.875d)'); select healpix_nest(15, '(67.5d, 67.5d)'); select healpix_nest(15, '(67.5d, 73.125d)'); select healpix_nest(15, '(67.5d, 78.75d)'); select healpix_ring(15, '(67.5d, 84.375d)'); select healpix_nest(15, '(67.5d, 90d)'); select healpix_nest(15, '(78.75d, -90d)'); select healpix_nest(15, '(78.75d, -84.375d)'); select healpix_nest(15, '(78.75d, -78.75d)'); select healpix_ring(15, '(78.75d, -73.125d)'); select healpix_ring(15, '(78.75d, -67.5d)'); select healpix_ring(15, '(78.75d, -61.875d)'); select healpix_ring(15, '(78.75d, -56.25d)'); select healpix_ring(15, '(78.75d, -50.625d)'); select healpix_ring(15, '(78.75d, -45d)'); select healpix_nest(15, '(78.75d, -39.375d)'); select healpix_nest(15, '(78.75d, -33.75d)'); select healpix_ring(15, '(78.75d, -28.125d)'); select healpix_nest(15, '(78.75d, -22.5d)'); select healpix_nest(15, '(78.75d, -16.875d)'); select healpix_ring(15, '(78.75d, -11.25d)'); select healpix_ring(15, '(78.75d, -5.625d)'); select healpix_nest(15, '(78.75d, 0.0001)'); select healpix_nest(15, '(78.75d, 5.625d)'); select healpix_nest(15, '(78.75d, 11.25d)'); select healpix_nest(15, '(78.75d, 16.875d)'); select healpix_ring(15, '(78.75d, 22.5d)'); select healpix_ring(15, '(78.75d, 28.125d)'); select healpix_ring(15, '(78.75d, 33.75d)'); select healpix_ring(15, '(78.75d, 39.375d)'); select healpix_nest(15, '(78.75d, 45d)'); select healpix_nest(15, '(78.75d, 50.625d)'); select healpix_ring(15, '(78.75d, 56.25d)'); select healpix_nest(15, '(78.75d, 61.875d)'); select healpix_ring(15, '(78.75d, 67.5d)'); select healpix_ring(15, '(78.75d, 73.125d)'); select healpix_ring(15, '(78.75d, 78.75d)'); select healpix_ring(15, '(78.75d, 84.375d)'); select healpix_ring(15, '(78.75d, 90d)'); select healpix_ring(15, '(90d, -90d)'); select healpix_ring(15, '(90d, -84.375d)'); select healpix_nest(15, '(90d, -78.75d)'); select healpix_nest(15, '(90d, -73.125d)'); select healpix_ring(15, '(90d, -67.5d)'); select healpix_nest(15, '(90d, -61.875d)'); select healpix_nest(15, '(90d, -56.25d)'); select healpix_ring(15, '(90d, -50.625d)'); select healpix_nest(15, '(90d, -45d)'); select healpix_nest(15, '(90d, -39.375d)'); select healpix_ring(15, '(90d, -33.75d)'); select healpix_nest(15, '(90d, -28.125d)'); select healpix_ring(15, '(90d, -22.5d)'); select healpix_nest(15, '(90d, -16.875d)'); select healpix_ring(15, '(90d, -11.25d)'); select healpix_ring(15, '(90d, -5.625d)'); select healpix_nest(15, '(90d, 0.0001)'); select healpix_ring(15, '(90d, 5.625d)'); select healpix_nest(15, '(90d, 11.25d)'); select healpix_nest(15, '(90d, 16.875d)'); select healpix_nest(15, '(90d, 22.5d)'); select healpix_nest(15, '(90d, 28.125d)'); select healpix_nest(15, '(90d, 33.75d)'); select healpix_nest(15, '(90d, 39.375d)'); select healpix_nest(15, '(90d, 45d)'); select healpix_nest(15, '(90d, 50.625d)'); select healpix_nest(15, '(90d, 56.25d)'); select healpix_ring(15, '(90d, 61.875d)'); select healpix_ring(15, '(90d, 67.5d)'); select healpix_nest(15, '(90d, 73.125d)'); select healpix_nest(15, '(90d, 78.75d)'); select healpix_ring(15, '(90d, 84.375d)'); select healpix_nest(15, '(90d, 90d)'); select healpix_ring(15, '(101.25d, -90d)'); select healpix_nest(15, '(101.25d, -84.375d)'); select healpix_ring(15, '(101.25d, -78.75d)'); select healpix_nest(15, '(101.25d, -73.125d)'); select healpix_ring(15, '(101.25d, -67.5d)'); select healpix_nest(15, '(101.25d, -61.875d)'); select healpix_ring(15, '(101.25d, -56.25d)'); select healpix_nest(15, '(101.25d, -50.625d)'); select healpix_nest(15, '(101.25d, -45d)'); select healpix_ring(15, '(101.25d, -39.375d)'); select healpix_ring(15, '(101.25d, -33.75d)'); select healpix_ring(15, '(101.25d, -28.125d)'); select healpix_ring(15, '(101.25d, -22.5d)'); select healpix_nest(15, '(101.25d, -16.875d)'); select healpix_nest(15, '(101.25d, -11.25d)'); select healpix_nest(15, '(101.25d, -5.625d)'); select healpix_nest(15, '(101.25d, 0.0001)'); select healpix_nest(15, '(101.25d, 5.625d)'); select healpix_ring(15, '(101.25d, 11.25d)'); select healpix_nest(15, '(101.25d, 16.875d)'); select healpix_ring(15, '(101.25d, 22.5d)'); select healpix_ring(15, '(101.25d, 28.125d)'); select healpix_nest(15, '(101.25d, 33.75d)'); select healpix_ring(15, '(101.25d, 39.375d)'); select healpix_nest(15, '(101.25d, 45d)'); select healpix_ring(15, '(101.25d, 50.625d)'); select healpix_ring(15, '(101.25d, 56.25d)'); select healpix_nest(15, '(101.25d, 61.875d)'); select healpix_ring(15, '(101.25d, 67.5d)'); select healpix_nest(15, '(101.25d, 73.125d)'); select healpix_nest(15, '(101.25d, 78.75d)'); select healpix_ring(15, '(101.25d, 84.375d)'); select healpix_nest(15, '(101.25d, 90d)'); select healpix_ring(15, '(112.5d, -90d)'); select healpix_ring(15, '(112.5d, -84.375d)'); select healpix_ring(15, '(112.5d, -78.75d)'); select healpix_ring(15, '(112.5d, -73.125d)'); select healpix_ring(15, '(112.5d, -67.5d)'); select healpix_nest(15, '(112.5d, -61.875d)'); select healpix_nest(15, '(112.5d, -56.25d)'); select healpix_nest(15, '(112.5d, -50.625d)'); select healpix_nest(15, '(112.5d, -45d)'); select healpix_ring(15, '(112.5d, -39.375d)'); select healpix_ring(15, '(112.5d, -33.75d)'); select healpix_ring(15, '(112.5d, -28.125d)'); select healpix_nest(15, '(112.5d, -22.5d)'); select healpix_nest(15, '(112.5d, -16.875d)'); select healpix_nest(15, '(112.5d, -11.25d)'); select healpix_nest(15, '(112.5d, -5.625d)'); select healpix_ring(15, '(112.5d, 0.0001)'); select healpix_nest(15, '(112.5d, 5.625d)'); select healpix_nest(15, '(112.5d, 11.25d)'); select healpix_ring(15, '(112.5d, 16.875d)'); select healpix_ring(15, '(112.5d, 22.5d)'); select healpix_nest(15, '(112.5d, 28.125d)'); select healpix_ring(15, '(112.5d, 33.75d)'); select healpix_nest(15, '(112.5d, 39.375d)'); select healpix_ring(15, '(112.5d, 45d)'); select healpix_nest(15, '(112.5d, 50.625d)'); select healpix_ring(15, '(112.5d, 56.25d)'); select healpix_nest(15, '(112.5d, 61.875d)'); select healpix_nest(15, '(112.5d, 67.5d)'); select healpix_nest(15, '(112.5d, 73.125d)'); select healpix_ring(15, '(112.5d, 78.75d)'); select healpix_ring(15, '(112.5d, 84.375d)'); select healpix_ring(15, '(112.5d, 90d)'); select healpix_ring(15, '(123.75d, -90d)'); select healpix_nest(15, '(123.75d, -84.375d)'); select healpix_nest(15, '(123.75d, -78.75d)'); select healpix_nest(15, '(123.75d, -73.125d)'); select healpix_ring(15, '(123.75d, -67.5d)'); select healpix_nest(15, '(123.75d, -61.875d)'); select healpix_ring(15, '(123.75d, -56.25d)'); select healpix_nest(15, '(123.75d, -50.625d)'); select healpix_nest(15, '(123.75d, -45d)'); select healpix_ring(15, '(123.75d, -39.375d)'); select healpix_nest(15, '(123.75d, -33.75d)'); select healpix_nest(15, '(123.75d, -28.125d)'); select healpix_nest(15, '(123.75d, -22.5d)'); select healpix_nest(15, '(123.75d, -16.875d)'); select healpix_ring(15, '(123.75d, -11.25d)'); select healpix_ring(15, '(123.75d, -5.625d)'); select healpix_ring(15, '(123.75d, 0.0001)'); select healpix_nest(15, '(123.75d, 5.625d)'); select healpix_ring(15, '(123.75d, 11.25d)'); select healpix_nest(15, '(123.75d, 16.875d)'); select healpix_ring(15, '(123.75d, 22.5d)'); select healpix_ring(15, '(123.75d, 28.125d)'); select healpix_nest(15, '(123.75d, 33.75d)'); select healpix_ring(15, '(123.75d, 39.375d)'); select healpix_nest(15, '(123.75d, 45d)'); select healpix_nest(15, '(123.75d, 50.625d)'); select healpix_nest(15, '(123.75d, 56.25d)'); select healpix_ring(15, '(123.75d, 61.875d)'); select healpix_ring(15, '(123.75d, 67.5d)'); select healpix_ring(15, '(123.75d, 73.125d)'); select healpix_nest(15, '(123.75d, 78.75d)'); select healpix_nest(15, '(123.75d, 84.375d)'); select healpix_nest(15, '(123.75d, 90d)'); select healpix_ring(15, '(135d, -90d)'); select healpix_nest(15, '(135d, -84.375d)'); select healpix_nest(15, '(135d, -78.75d)'); select healpix_nest(15, '(135d, -73.125d)'); select healpix_nest(15, '(135d, -67.5d)'); select healpix_ring(15, '(135d, -61.875d)'); select healpix_nest(15, '(135d, -56.25d)'); select healpix_ring(15, '(135d, -50.625d)'); select healpix_nest(15, '(135d, -45d)'); select healpix_ring(15, '(135d, -39.375d)'); select healpix_nest(15, '(135d, -33.75d)'); select healpix_ring(15, '(135d, -28.125d)'); select healpix_ring(15, '(135d, -22.5d)'); select healpix_ring(15, '(135d, -16.875d)'); select healpix_nest(15, '(135d, -11.25d)'); select healpix_ring(15, '(135d, -5.625d)'); select healpix_ring(15, '(135d, 0.0001)'); select healpix_ring(15, '(135d, 5.625d)'); select healpix_ring(15, '(135d, 11.25d)'); select healpix_nest(15, '(135d, 16.875d)'); select healpix_nest(15, '(135d, 22.5d)'); select healpix_nest(15, '(135d, 28.125d)'); select healpix_ring(15, '(135d, 33.75d)'); select healpix_nest(15, '(135d, 39.375d)'); select healpix_nest(15, '(135d, 45d)'); select healpix_ring(15, '(135d, 50.625d)'); select healpix_nest(15, '(135d, 56.25d)'); select healpix_ring(15, '(135d, 61.875d)'); select healpix_ring(15, '(135d, 67.5d)'); select healpix_nest(15, '(135d, 73.125d)'); select healpix_ring(15, '(135d, 78.75d)'); select healpix_nest(15, '(135d, 84.375d)'); select healpix_nest(15, '(135d, 90d)'); select healpix_ring(15, '(146.25d, -90d)'); select healpix_ring(15, '(146.25d, -84.375d)'); select healpix_nest(15, '(146.25d, -78.75d)'); select healpix_ring(15, '(146.25d, -73.125d)'); select healpix_nest(15, '(146.25d, -67.5d)'); select healpix_ring(15, '(146.25d, -61.875d)'); select healpix_ring(15, '(146.25d, -56.25d)'); select healpix_ring(15, '(146.25d, -50.625d)'); select healpix_ring(15, '(146.25d, -45d)'); select healpix_ring(15, '(146.25d, -39.375d)'); select healpix_nest(15, '(146.25d, -33.75d)'); select healpix_nest(15, '(146.25d, -28.125d)'); select healpix_ring(15, '(146.25d, -22.5d)'); select healpix_ring(15, '(146.25d, -16.875d)'); select healpix_nest(15, '(146.25d, -11.25d)'); select healpix_ring(15, '(146.25d, -5.625d)'); select healpix_ring(15, '(146.25d, 0.0001)'); select healpix_ring(15, '(146.25d, 5.625d)'); select healpix_ring(15, '(146.25d, 11.25d)'); select healpix_nest(15, '(146.25d, 16.875d)'); select healpix_ring(15, '(146.25d, 22.5d)'); select healpix_ring(15, '(146.25d, 28.125d)'); select healpix_ring(15, '(146.25d, 33.75d)'); select healpix_ring(15, '(146.25d, 39.375d)'); select healpix_ring(15, '(146.25d, 45d)'); select healpix_nest(15, '(146.25d, 50.625d)'); select healpix_nest(15, '(146.25d, 56.25d)'); select healpix_nest(15, '(146.25d, 61.875d)'); select healpix_nest(15, '(146.25d, 67.5d)'); select healpix_ring(15, '(146.25d, 73.125d)'); select healpix_nest(15, '(146.25d, 78.75d)'); select healpix_ring(15, '(146.25d, 84.375d)'); select healpix_nest(15, '(146.25d, 90d)'); select healpix_ring(15, '(157.5d, -90d)'); select healpix_nest(15, '(157.5d, -84.375d)'); select healpix_nest(15, '(157.5d, -78.75d)'); select healpix_ring(15, '(157.5d, -73.125d)'); select healpix_ring(15, '(157.5d, -67.5d)'); select healpix_nest(15, '(157.5d, -61.875d)'); select healpix_nest(15, '(157.5d, -56.25d)'); select healpix_ring(15, '(157.5d, -50.625d)'); select healpix_ring(15, '(157.5d, -45d)'); select healpix_nest(15, '(157.5d, -39.375d)'); select healpix_nest(15, '(157.5d, -33.75d)'); select healpix_nest(15, '(157.5d, -28.125d)'); select healpix_ring(15, '(157.5d, -22.5d)'); select healpix_nest(15, '(157.5d, -16.875d)'); select healpix_nest(15, '(157.5d, -11.25d)'); select healpix_nest(15, '(157.5d, -5.625d)'); select healpix_ring(15, '(157.5d, 0.0001)'); select healpix_nest(15, '(157.5d, 5.625d)'); select healpix_nest(15, '(157.5d, 11.25d)'); select healpix_ring(15, '(157.5d, 16.875d)'); select healpix_nest(15, '(157.5d, 22.5d)'); select healpix_ring(15, '(157.5d, 28.125d)'); select healpix_nest(15, '(157.5d, 33.75d)'); select healpix_ring(15, '(157.5d, 39.375d)'); select healpix_nest(15, '(157.5d, 45d)'); select healpix_nest(15, '(157.5d, 50.625d)'); select healpix_ring(15, '(157.5d, 56.25d)'); select healpix_ring(15, '(157.5d, 61.875d)'); select healpix_ring(15, '(157.5d, 67.5d)'); select healpix_nest(15, '(157.5d, 73.125d)'); select healpix_ring(15, '(157.5d, 78.75d)'); select healpix_nest(15, '(157.5d, 84.375d)'); select healpix_nest(15, '(157.5d, 90d)'); select healpix_nest(15, '(168.75d, -90d)'); select healpix_ring(15, '(168.75d, -84.375d)'); select healpix_nest(15, '(168.75d, -78.75d)'); select healpix_ring(15, '(168.75d, -73.125d)'); select healpix_nest(15, '(168.75d, -67.5d)'); select healpix_ring(15, '(168.75d, -61.875d)'); select healpix_nest(15, '(168.75d, -56.25d)'); select healpix_nest(15, '(168.75d, -50.625d)'); select healpix_nest(15, '(168.75d, -45d)'); select healpix_nest(15, '(168.75d, -39.375d)'); select healpix_ring(15, '(168.75d, -33.75d)'); select healpix_ring(15, '(168.75d, -28.125d)'); select healpix_ring(15, '(168.75d, -22.5d)'); select healpix_ring(15, '(168.75d, -16.875d)'); select healpix_ring(15, '(168.75d, -11.25d)'); select healpix_nest(15, '(168.75d, -5.625d)'); select healpix_nest(15, '(168.75d, 0.0001)'); select healpix_ring(15, '(168.75d, 5.625d)'); select healpix_ring(15, '(168.75d, 11.25d)'); select healpix_ring(15, '(168.75d, 16.875d)'); select healpix_ring(15, '(168.75d, 22.5d)'); select healpix_nest(15, '(168.75d, 28.125d)'); select healpix_ring(15, '(168.75d, 33.75d)'); select healpix_ring(15, '(168.75d, 39.375d)'); select healpix_nest(15, '(168.75d, 45d)'); select healpix_ring(15, '(168.75d, 50.625d)'); select healpix_ring(15, '(168.75d, 56.25d)'); select healpix_ring(15, '(168.75d, 61.875d)'); select healpix_nest(15, '(168.75d, 67.5d)'); select healpix_ring(15, '(168.75d, 73.125d)'); select healpix_nest(15, '(168.75d, 78.75d)'); select healpix_ring(15, '(168.75d, 84.375d)'); select healpix_nest(15, '(168.75d, 90d)'); select healpix_nest(15, '(180d, -90d)'); select healpix_ring(15, '(180d, -84.375d)'); select healpix_nest(15, '(180d, -78.75d)'); select healpix_ring(15, '(180d, -73.125d)'); select healpix_nest(15, '(180d, -67.5d)'); select healpix_ring(15, '(180d, -61.875d)'); select healpix_ring(15, '(180d, -56.25d)'); select healpix_ring(15, '(180d, -50.625d)'); select healpix_ring(15, '(180d, -45d)'); select healpix_nest(15, '(180d, -39.375d)'); select healpix_nest(15, '(180d, -33.75d)'); select healpix_ring(15, '(180d, -28.125d)'); select healpix_nest(15, '(180d, -22.5d)'); select healpix_nest(15, '(180d, -16.875d)'); select healpix_nest(15, '(180d, -11.25d)'); select healpix_nest(15, '(180d, -5.625d)'); select healpix_nest(15, '(180d, 0.0001)'); select healpix_ring(15, '(180d, 5.625d)'); select healpix_ring(15, '(180d, 11.25d)'); select healpix_nest(15, '(180d, 16.875d)'); select healpix_nest(15, '(180d, 22.5d)'); select healpix_ring(15, '(180d, 28.125d)'); select healpix_ring(15, '(180d, 33.75d)'); select healpix_nest(15, '(180d, 39.375d)'); select healpix_ring(15, '(180d, 45d)'); select healpix_ring(15, '(180d, 50.625d)'); select healpix_ring(15, '(180d, 56.25d)'); select healpix_nest(15, '(180d, 61.875d)'); select healpix_nest(15, '(180d, 67.5d)'); select healpix_nest(15, '(180d, 73.125d)'); select healpix_ring(15, '(180d, 78.75d)'); select healpix_nest(15, '(180d, 84.375d)'); select healpix_nest(15, '(180d, 90d)'); select healpix_nest(15, '(191.25d, -90d)'); select healpix_ring(15, '(191.25d, -84.375d)'); select healpix_ring(15, '(191.25d, -78.75d)'); select healpix_ring(15, '(191.25d, -73.125d)'); select healpix_ring(15, '(191.25d, -67.5d)'); select healpix_nest(15, '(191.25d, -61.875d)'); select healpix_nest(15, '(191.25d, -56.25d)'); select healpix_nest(15, '(191.25d, -50.625d)'); select healpix_ring(15, '(191.25d, -45d)'); select healpix_ring(15, '(191.25d, -39.375d)'); select healpix_ring(15, '(191.25d, -33.75d)'); select healpix_nest(15, '(191.25d, -28.125d)'); select healpix_ring(15, '(191.25d, -22.5d)'); select healpix_nest(15, '(191.25d, -16.875d)'); select healpix_nest(15, '(191.25d, -11.25d)'); select healpix_ring(15, '(191.25d, -5.625d)'); select healpix_ring(15, '(191.25d, 0.0001)'); select healpix_nest(15, '(191.25d, 5.625d)'); select healpix_ring(15, '(191.25d, 11.25d)'); select healpix_ring(15, '(191.25d, 16.875d)'); select healpix_nest(15, '(191.25d, 22.5d)'); select healpix_nest(15, '(191.25d, 28.125d)'); select healpix_ring(15, '(191.25d, 33.75d)'); select healpix_nest(15, '(191.25d, 39.375d)'); select healpix_nest(15, '(191.25d, 45d)'); select healpix_nest(15, '(191.25d, 50.625d)'); select healpix_ring(15, '(191.25d, 56.25d)'); select healpix_ring(15, '(191.25d, 61.875d)'); select healpix_ring(15, '(191.25d, 67.5d)'); select healpix_nest(15, '(191.25d, 73.125d)'); select healpix_ring(15, '(191.25d, 78.75d)'); select healpix_nest(15, '(191.25d, 84.375d)'); select healpix_ring(15, '(191.25d, 90d)'); select healpix_ring(15, '(202.5d, -90d)'); select healpix_nest(15, '(202.5d, -84.375d)'); select healpix_ring(15, '(202.5d, -78.75d)'); select healpix_nest(15, '(202.5d, -73.125d)'); select healpix_ring(15, '(202.5d, -67.5d)'); select healpix_nest(15, '(202.5d, -61.875d)'); select healpix_nest(15, '(202.5d, -56.25d)'); select healpix_ring(15, '(202.5d, -50.625d)'); select healpix_ring(15, '(202.5d, -45d)'); select healpix_ring(15, '(202.5d, -39.375d)'); select healpix_nest(15, '(202.5d, -33.75d)'); select healpix_ring(15, '(202.5d, -28.125d)'); select healpix_nest(15, '(202.5d, -22.5d)'); select healpix_nest(15, '(202.5d, -16.875d)'); select healpix_nest(15, '(202.5d, -11.25d)'); select healpix_nest(15, '(202.5d, -5.625d)'); select healpix_ring(15, '(202.5d, 0.0001)'); select healpix_ring(15, '(202.5d, 5.625d)'); select healpix_ring(15, '(202.5d, 11.25d)'); select healpix_ring(15, '(202.5d, 16.875d)'); select healpix_nest(15, '(202.5d, 22.5d)'); select healpix_nest(15, '(202.5d, 28.125d)'); select healpix_nest(15, '(202.5d, 33.75d)'); select healpix_ring(15, '(202.5d, 39.375d)'); select healpix_nest(15, '(202.5d, 45d)'); select healpix_ring(15, '(202.5d, 50.625d)'); select healpix_nest(15, '(202.5d, 56.25d)'); select healpix_nest(15, '(202.5d, 61.875d)'); select healpix_nest(15, '(202.5d, 67.5d)'); select healpix_nest(15, '(202.5d, 73.125d)'); select healpix_ring(15, '(202.5d, 78.75d)'); select healpix_ring(15, '(202.5d, 84.375d)'); select healpix_ring(15, '(202.5d, 90d)'); select healpix_nest(15, '(213.75d, -90d)'); select healpix_ring(15, '(213.75d, -84.375d)'); select healpix_ring(15, '(213.75d, -78.75d)'); select healpix_nest(15, '(213.75d, -73.125d)'); select healpix_nest(15, '(213.75d, -67.5d)'); select healpix_nest(15, '(213.75d, -61.875d)'); select healpix_ring(15, '(213.75d, -56.25d)'); select healpix_ring(15, '(213.75d, -50.625d)'); select healpix_nest(15, '(213.75d, -45d)'); select healpix_nest(15, '(213.75d, -39.375d)'); select healpix_ring(15, '(213.75d, -33.75d)'); select healpix_ring(15, '(213.75d, -28.125d)'); select healpix_ring(15, '(213.75d, -22.5d)'); select healpix_ring(15, '(213.75d, -16.875d)'); select healpix_nest(15, '(213.75d, -11.25d)'); select healpix_ring(15, '(213.75d, -5.625d)'); select healpix_nest(15, '(213.75d, 0.0001)'); select healpix_nest(15, '(213.75d, 5.625d)'); select healpix_nest(15, '(213.75d, 11.25d)'); select healpix_nest(15, '(213.75d, 16.875d)'); select healpix_ring(15, '(213.75d, 22.5d)'); select healpix_nest(15, '(213.75d, 28.125d)'); select healpix_ring(15, '(213.75d, 33.75d)'); select healpix_ring(15, '(213.75d, 39.375d)'); select healpix_ring(15, '(213.75d, 45d)'); select healpix_ring(15, '(213.75d, 50.625d)'); select healpix_nest(15, '(213.75d, 56.25d)'); select healpix_ring(15, '(213.75d, 61.875d)'); select healpix_nest(15, '(213.75d, 67.5d)'); select healpix_nest(15, '(213.75d, 73.125d)'); select healpix_ring(15, '(213.75d, 78.75d)'); select healpix_ring(15, '(213.75d, 84.375d)'); select healpix_nest(15, '(213.75d, 90d)'); select healpix_nest(15, '(225d, -90d)'); select healpix_ring(15, '(225d, -84.375d)'); select healpix_ring(15, '(225d, -78.75d)'); select healpix_ring(15, '(225d, -73.125d)'); select healpix_ring(15, '(225d, -67.5d)'); select healpix_nest(15, '(225d, -61.875d)'); select healpix_nest(15, '(225d, -56.25d)'); select healpix_ring(15, '(225d, -50.625d)'); select healpix_nest(15, '(225d, -45d)'); select healpix_nest(15, '(225d, -39.375d)'); select healpix_ring(15, '(225d, -33.75d)'); select healpix_ring(15, '(225d, -28.125d)'); select healpix_nest(15, '(225d, -22.5d)'); select healpix_ring(15, '(225d, -16.875d)'); select healpix_nest(15, '(225d, -11.25d)'); select healpix_nest(15, '(225d, -5.625d)'); select healpix_ring(15, '(225d, 0.0001)'); select healpix_nest(15, '(225d, 5.625d)'); select healpix_ring(15, '(225d, 11.25d)'); select healpix_nest(15, '(225d, 16.875d)'); select healpix_nest(15, '(225d, 22.5d)'); select healpix_ring(15, '(225d, 28.125d)'); select healpix_ring(15, '(225d, 33.75d)'); select healpix_nest(15, '(225d, 39.375d)'); select healpix_nest(15, '(225d, 45d)'); select healpix_nest(15, '(225d, 50.625d)'); select healpix_ring(15, '(225d, 56.25d)'); select healpix_ring(15, '(225d, 61.875d)'); select healpix_ring(15, '(225d, 67.5d)'); select healpix_ring(15, '(225d, 73.125d)'); select healpix_nest(15, '(225d, 78.75d)'); select healpix_ring(15, '(225d, 84.375d)'); select healpix_nest(15, '(225d, 90d)'); select healpix_nest(15, '(236.25d, -90d)'); select healpix_ring(15, '(236.25d, -84.375d)'); select healpix_nest(15, '(236.25d, -78.75d)'); select healpix_nest(15, '(236.25d, -73.125d)'); select healpix_ring(15, '(236.25d, -67.5d)'); select healpix_nest(15, '(236.25d, -61.875d)'); select healpix_ring(15, '(236.25d, -56.25d)'); select healpix_nest(15, '(236.25d, -50.625d)'); select healpix_nest(15, '(236.25d, -45d)'); select healpix_ring(15, '(236.25d, -39.375d)'); select healpix_ring(15, '(236.25d, -33.75d)'); select healpix_nest(15, '(236.25d, -28.125d)'); select healpix_ring(15, '(236.25d, -22.5d)'); select healpix_ring(15, '(236.25d, -16.875d)'); select healpix_ring(15, '(236.25d, -11.25d)'); select healpix_ring(15, '(236.25d, -5.625d)'); select healpix_nest(15, '(236.25d, 0.0001)'); select healpix_nest(15, '(236.25d, 5.625d)'); select healpix_nest(15, '(236.25d, 11.25d)'); select healpix_nest(15, '(236.25d, 16.875d)'); select healpix_nest(15, '(236.25d, 22.5d)'); select healpix_ring(15, '(236.25d, 28.125d)'); select healpix_ring(15, '(236.25d, 33.75d)'); select healpix_ring(15, '(236.25d, 39.375d)'); select healpix_nest(15, '(236.25d, 45d)'); select healpix_nest(15, '(236.25d, 50.625d)'); select healpix_nest(15, '(236.25d, 56.25d)'); select healpix_nest(15, '(236.25d, 61.875d)'); select healpix_ring(15, '(236.25d, 67.5d)'); select healpix_ring(15, '(236.25d, 73.125d)'); select healpix_nest(15, '(236.25d, 78.75d)'); select healpix_ring(15, '(236.25d, 84.375d)'); select healpix_ring(15, '(236.25d, 90d)'); select healpix_nest(15, '(247.5d, -90d)'); select healpix_nest(15, '(247.5d, -84.375d)'); select healpix_ring(15, '(247.5d, -78.75d)'); select healpix_nest(15, '(247.5d, -73.125d)'); select healpix_ring(15, '(247.5d, -67.5d)'); select healpix_nest(15, '(247.5d, -61.875d)'); select healpix_ring(15, '(247.5d, -56.25d)'); select healpix_ring(15, '(247.5d, -50.625d)'); select healpix_nest(15, '(247.5d, -45d)'); select healpix_ring(15, '(247.5d, -39.375d)'); select healpix_nest(15, '(247.5d, -33.75d)'); select healpix_nest(15, '(247.5d, -28.125d)'); select healpix_ring(15, '(247.5d, -22.5d)'); select healpix_nest(15, '(247.5d, -16.875d)'); select healpix_ring(15, '(247.5d, -11.25d)'); select healpix_nest(15, '(247.5d, -5.625d)'); select healpix_nest(15, '(247.5d, 0.0001)'); select healpix_ring(15, '(247.5d, 5.625d)'); select healpix_ring(15, '(247.5d, 11.25d)'); select healpix_ring(15, '(247.5d, 16.875d)'); select healpix_ring(15, '(247.5d, 22.5d)'); select healpix_ring(15, '(247.5d, 28.125d)'); select healpix_ring(15, '(247.5d, 33.75d)'); select healpix_ring(15, '(247.5d, 39.375d)'); select healpix_ring(15, '(247.5d, 45d)'); select healpix_nest(15, '(247.5d, 50.625d)'); select healpix_nest(15, '(247.5d, 56.25d)'); select healpix_nest(15, '(247.5d, 61.875d)'); select healpix_nest(15, '(247.5d, 67.5d)'); select healpix_nest(15, '(247.5d, 73.125d)'); select healpix_ring(15, '(247.5d, 78.75d)'); select healpix_nest(15, '(247.5d, 84.375d)'); select healpix_nest(15, '(247.5d, 90d)'); select healpix_nest(15, '(258.75d, -90d)'); select healpix_nest(15, '(258.75d, -84.375d)'); select healpix_nest(15, '(258.75d, -78.75d)'); select healpix_nest(15, '(258.75d, -73.125d)'); select healpix_nest(15, '(258.75d, -67.5d)'); select healpix_ring(15, '(258.75d, -61.875d)'); select healpix_ring(15, '(258.75d, -56.25d)'); select healpix_ring(15, '(258.75d, -50.625d)'); select healpix_nest(15, '(258.75d, -45d)'); select healpix_nest(15, '(258.75d, -39.375d)'); select healpix_ring(15, '(258.75d, -33.75d)'); select healpix_nest(15, '(258.75d, -28.125d)'); select healpix_ring(15, '(258.75d, -22.5d)'); select healpix_ring(15, '(258.75d, -16.875d)'); select healpix_nest(15, '(258.75d, -11.25d)'); select healpix_nest(15, '(258.75d, -5.625d)'); select healpix_ring(15, '(258.75d, 0.0001)'); select healpix_ring(15, '(258.75d, 5.625d)'); select healpix_nest(15, '(258.75d, 11.25d)'); select healpix_nest(15, '(258.75d, 16.875d)'); select healpix_nest(15, '(258.75d, 22.5d)'); select healpix_nest(15, '(258.75d, 28.125d)'); select healpix_ring(15, '(258.75d, 33.75d)'); select healpix_nest(15, '(258.75d, 39.375d)'); select healpix_nest(15, '(258.75d, 45d)'); select healpix_nest(15, '(258.75d, 50.625d)'); select healpix_ring(15, '(258.75d, 56.25d)'); select healpix_ring(15, '(258.75d, 61.875d)'); select healpix_ring(15, '(258.75d, 67.5d)'); select healpix_nest(15, '(258.75d, 73.125d)'); select healpix_ring(15, '(258.75d, 78.75d)'); select healpix_nest(15, '(258.75d, 84.375d)'); select healpix_ring(15, '(258.75d, 90d)'); select healpix_ring(15, '(270d, -90d)'); select healpix_nest(15, '(270d, -84.375d)'); select healpix_ring(15, '(270d, -78.75d)'); select healpix_nest(15, '(270d, -73.125d)'); select healpix_ring(15, '(270d, -67.5d)'); select healpix_ring(15, '(270d, -61.875d)'); select healpix_nest(15, '(270d, -56.25d)'); select healpix_nest(15, '(270d, -50.625d)'); select healpix_nest(15, '(270d, -45d)'); select healpix_nest(15, '(270d, -39.375d)'); select healpix_ring(15, '(270d, -33.75d)'); select healpix_nest(15, '(270d, -28.125d)'); select healpix_ring(15, '(270d, -22.5d)'); select healpix_nest(15, '(270d, -16.875d)'); select healpix_ring(15, '(270d, -11.25d)'); select healpix_nest(15, '(270d, -5.625d)'); select healpix_ring(15, '(270d, 0.0001)'); select healpix_nest(15, '(270d, 5.625d)'); select healpix_ring(15, '(270d, 11.25d)'); select healpix_ring(15, '(270d, 16.875d)'); select healpix_nest(15, '(270d, 22.5d)'); select healpix_nest(15, '(270d, 28.125d)'); select healpix_ring(15, '(270d, 33.75d)'); select healpix_nest(15, '(270d, 39.375d)'); select healpix_nest(15, '(270d, 45d)'); select healpix_ring(15, '(270d, 50.625d)'); select healpix_ring(15, '(270d, 56.25d)'); select healpix_nest(15, '(270d, 61.875d)'); select healpix_ring(15, '(270d, 67.5d)'); select healpix_nest(15, '(270d, 73.125d)'); select healpix_nest(15, '(270d, 78.75d)'); select healpix_nest(15, '(270d, 84.375d)'); select healpix_nest(15, '(270d, 90d)'); select healpix_ring(15, '(281.25d, -90d)'); select healpix_nest(15, '(281.25d, -84.375d)'); select healpix_nest(15, '(281.25d, -78.75d)'); select healpix_ring(15, '(281.25d, -73.125d)'); select healpix_ring(15, '(281.25d, -67.5d)'); select healpix_nest(15, '(281.25d, -61.875d)'); select healpix_ring(15, '(281.25d, -56.25d)'); select healpix_ring(15, '(281.25d, -50.625d)'); select healpix_ring(15, '(281.25d, -45d)'); select healpix_ring(15, '(281.25d, -39.375d)'); select healpix_ring(15, '(281.25d, -33.75d)'); select healpix_nest(15, '(281.25d, -28.125d)'); select healpix_nest(15, '(281.25d, -22.5d)'); select healpix_ring(15, '(281.25d, -16.875d)'); select healpix_nest(15, '(281.25d, -11.25d)'); select healpix_ring(15, '(281.25d, -5.625d)'); select healpix_nest(15, '(281.25d, 0.0001)'); select healpix_ring(15, '(281.25d, 5.625d)'); select healpix_ring(15, '(281.25d, 11.25d)'); select healpix_nest(15, '(281.25d, 16.875d)'); select healpix_nest(15, '(281.25d, 22.5d)'); select healpix_ring(15, '(281.25d, 28.125d)'); select healpix_nest(15, '(281.25d, 33.75d)'); select healpix_ring(15, '(281.25d, 39.375d)'); select healpix_ring(15, '(281.25d, 45d)'); select healpix_nest(15, '(281.25d, 50.625d)'); select healpix_ring(15, '(281.25d, 56.25d)'); select healpix_nest(15, '(281.25d, 61.875d)'); select healpix_ring(15, '(281.25d, 67.5d)'); select healpix_nest(15, '(281.25d, 73.125d)'); select healpix_nest(15, '(281.25d, 78.75d)'); select healpix_nest(15, '(281.25d, 84.375d)'); select healpix_ring(15, '(281.25d, 90d)'); select healpix_nest(15, '(292.5d, -90d)'); select healpix_ring(15, '(292.5d, -84.375d)'); select healpix_nest(15, '(292.5d, -78.75d)'); select healpix_nest(15, '(292.5d, -73.125d)'); select healpix_ring(15, '(292.5d, -67.5d)'); select healpix_nest(15, '(292.5d, -61.875d)'); select healpix_nest(15, '(292.5d, -56.25d)'); select healpix_ring(15, '(292.5d, -50.625d)'); select healpix_nest(15, '(292.5d, -45d)'); select healpix_ring(15, '(292.5d, -39.375d)'); select healpix_nest(15, '(292.5d, -33.75d)'); select healpix_ring(15, '(292.5d, -28.125d)'); select healpix_nest(15, '(292.5d, -22.5d)'); select healpix_nest(15, '(292.5d, -16.875d)'); select healpix_nest(15, '(292.5d, -11.25d)'); select healpix_ring(15, '(292.5d, -5.625d)'); select healpix_nest(15, '(292.5d, 0.0001)'); select healpix_ring(15, '(292.5d, 5.625d)'); select healpix_nest(15, '(292.5d, 11.25d)'); select healpix_ring(15, '(292.5d, 16.875d)'); select healpix_nest(15, '(292.5d, 22.5d)'); select healpix_ring(15, '(292.5d, 28.125d)'); select healpix_ring(15, '(292.5d, 33.75d)'); select healpix_ring(15, '(292.5d, 39.375d)'); select healpix_nest(15, '(292.5d, 45d)'); select healpix_ring(15, '(292.5d, 50.625d)'); select healpix_nest(15, '(292.5d, 56.25d)'); select healpix_ring(15, '(292.5d, 61.875d)'); select healpix_ring(15, '(292.5d, 67.5d)'); select healpix_ring(15, '(292.5d, 73.125d)'); select healpix_nest(15, '(292.5d, 78.75d)'); select healpix_ring(15, '(292.5d, 84.375d)'); select healpix_ring(15, '(292.5d, 90d)'); select healpix_ring(15, '(303.75d, -90d)'); select healpix_nest(15, '(303.75d, -84.375d)'); select healpix_nest(15, '(303.75d, -78.75d)'); select healpix_ring(15, '(303.75d, -73.125d)'); select healpix_nest(15, '(303.75d, -67.5d)'); select healpix_nest(15, '(303.75d, -61.875d)'); select healpix_ring(15, '(303.75d, -56.25d)'); select healpix_ring(15, '(303.75d, -50.625d)'); select healpix_nest(15, '(303.75d, -45d)'); select healpix_nest(15, '(303.75d, -39.375d)'); select healpix_nest(15, '(303.75d, -33.75d)'); select healpix_ring(15, '(303.75d, -28.125d)'); select healpix_ring(15, '(303.75d, -22.5d)'); select healpix_ring(15, '(303.75d, -16.875d)'); select healpix_nest(15, '(303.75d, -11.25d)'); select healpix_nest(15, '(303.75d, -5.625d)'); select healpix_nest(15, '(303.75d, 0.0001)'); select healpix_ring(15, '(303.75d, 5.625d)'); select healpix_nest(15, '(303.75d, 11.25d)'); select healpix_ring(15, '(303.75d, 16.875d)'); select healpix_ring(15, '(303.75d, 22.5d)'); select healpix_ring(15, '(303.75d, 28.125d)'); select healpix_nest(15, '(303.75d, 33.75d)'); select healpix_nest(15, '(303.75d, 39.375d)'); select healpix_nest(15, '(303.75d, 45d)'); select healpix_ring(15, '(303.75d, 50.625d)'); select healpix_nest(15, '(303.75d, 56.25d)'); select healpix_nest(15, '(303.75d, 61.875d)'); select healpix_ring(15, '(303.75d, 67.5d)'); select healpix_ring(15, '(303.75d, 73.125d)'); select healpix_nest(15, '(303.75d, 78.75d)'); select healpix_nest(15, '(303.75d, 84.375d)'); select healpix_nest(15, '(303.75d, 90d)'); select healpix_nest(15, '(315d, -90d)'); select healpix_nest(15, '(315d, -84.375d)'); select healpix_ring(15, '(315d, -78.75d)'); select healpix_ring(15, '(315d, -73.125d)'); select healpix_ring(15, '(315d, -67.5d)'); select healpix_nest(15, '(315d, -61.875d)'); select healpix_ring(15, '(315d, -56.25d)'); select healpix_nest(15, '(315d, -50.625d)'); select healpix_nest(15, '(315d, -45d)'); select healpix_nest(15, '(315d, -39.375d)'); select healpix_nest(15, '(315d, -33.75d)'); select healpix_ring(15, '(315d, -28.125d)'); select healpix_nest(15, '(315d, -22.5d)'); select healpix_ring(15, '(315d, -16.875d)'); select healpix_nest(15, '(315d, -11.25d)'); select healpix_ring(15, '(315d, -5.625d)'); select healpix_ring(15, '(315d, 0.0001)'); select healpix_nest(15, '(315d, 5.625d)'); select healpix_nest(15, '(315d, 11.25d)'); select healpix_nest(15, '(315d, 16.875d)'); select healpix_ring(15, '(315d, 22.5d)'); select healpix_nest(15, '(315d, 28.125d)'); select healpix_nest(15, '(315d, 33.75d)'); select healpix_nest(15, '(315d, 39.375d)'); select healpix_nest(15, '(315d, 45d)'); select healpix_nest(15, '(315d, 50.625d)'); select healpix_ring(15, '(315d, 56.25d)'); select healpix_ring(15, '(315d, 61.875d)'); select healpix_nest(15, '(315d, 67.5d)'); select healpix_nest(15, '(315d, 73.125d)'); select healpix_nest(15, '(315d, 78.75d)'); select healpix_nest(15, '(315d, 84.375d)'); select healpix_ring(15, '(315d, 90d)'); select healpix_ring(15, '(326.25d, -90d)'); select healpix_nest(15, '(326.25d, -84.375d)'); select healpix_ring(15, '(326.25d, -78.75d)'); select healpix_ring(15, '(326.25d, -73.125d)'); select healpix_ring(15, '(326.25d, -67.5d)'); select healpix_ring(15, '(326.25d, -61.875d)'); select healpix_nest(15, '(326.25d, -56.25d)'); select healpix_nest(15, '(326.25d, -50.625d)'); select healpix_nest(15, '(326.25d, -45d)'); select healpix_ring(15, '(326.25d, -39.375d)'); select healpix_nest(15, '(326.25d, -33.75d)'); select healpix_ring(15, '(326.25d, -28.125d)'); select healpix_ring(15, '(326.25d, -22.5d)'); select healpix_ring(15, '(326.25d, -16.875d)'); select healpix_nest(15, '(326.25d, -11.25d)'); select healpix_ring(15, '(326.25d, -5.625d)'); select healpix_ring(15, '(326.25d, 0.0001)'); select healpix_nest(15, '(326.25d, 5.625d)'); select healpix_ring(15, '(326.25d, 11.25d)'); select healpix_ring(15, '(326.25d, 16.875d)'); select healpix_ring(15, '(326.25d, 22.5d)'); select healpix_nest(15, '(326.25d, 28.125d)'); select healpix_ring(15, '(326.25d, 33.75d)'); select healpix_nest(15, '(326.25d, 39.375d)'); select healpix_nest(15, '(326.25d, 45d)'); select healpix_ring(15, '(326.25d, 50.625d)'); select healpix_ring(15, '(326.25d, 56.25d)'); select healpix_ring(15, '(326.25d, 61.875d)'); select healpix_ring(15, '(326.25d, 67.5d)'); select healpix_nest(15, '(326.25d, 73.125d)'); select healpix_ring(15, '(326.25d, 78.75d)'); select healpix_ring(15, '(326.25d, 84.375d)'); select healpix_ring(15, '(326.25d, 90d)'); select healpix_ring(15, '(337.5d, -90d)'); select healpix_nest(15, '(337.5d, -84.375d)'); select healpix_nest(15, '(337.5d, -78.75d)'); select healpix_ring(15, '(337.5d, -73.125d)'); select healpix_ring(15, '(337.5d, -67.5d)'); select healpix_ring(15, '(337.5d, -61.875d)'); select healpix_ring(15, '(337.5d, -56.25d)'); select healpix_ring(15, '(337.5d, -50.625d)'); select healpix_ring(15, '(337.5d, -45d)'); select healpix_ring(15, '(337.5d, -39.375d)'); select healpix_nest(15, '(337.5d, -33.75d)'); select healpix_ring(15, '(337.5d, -28.125d)'); select healpix_ring(15, '(337.5d, -22.5d)'); select healpix_nest(15, '(337.5d, -16.875d)'); select healpix_ring(15, '(337.5d, -11.25d)'); select healpix_ring(15, '(337.5d, -5.625d)'); select healpix_nest(15, '(337.5d, 0.0001)'); select healpix_ring(15, '(337.5d, 5.625d)'); select healpix_nest(15, '(337.5d, 11.25d)'); select healpix_nest(15, '(337.5d, 16.875d)'); select healpix_ring(15, '(337.5d, 22.5d)'); select healpix_nest(15, '(337.5d, 28.125d)'); select healpix_nest(15, '(337.5d, 33.75d)'); select healpix_nest(15, '(337.5d, 39.375d)'); select healpix_ring(15, '(337.5d, 45d)'); select healpix_nest(15, '(337.5d, 50.625d)'); select healpix_ring(15, '(337.5d, 56.25d)'); select healpix_nest(15, '(337.5d, 61.875d)'); select healpix_nest(15, '(337.5d, 67.5d)'); select healpix_ring(15, '(337.5d, 73.125d)'); select healpix_ring(15, '(337.5d, 78.75d)'); select healpix_ring(15, '(337.5d, 84.375d)'); select healpix_nest(15, '(337.5d, 90d)'); select healpix_nest(15, '(348.75d, -90d)'); select healpix_ring(15, '(348.75d, -84.375d)'); select healpix_nest(15, '(348.75d, -78.75d)'); select healpix_nest(15, '(348.75d, -73.125d)'); select healpix_ring(15, '(348.75d, -67.5d)'); select healpix_nest(15, '(348.75d, -61.875d)'); select healpix_nest(15, '(348.75d, -56.25d)'); select healpix_nest(15, '(348.75d, -50.625d)'); select healpix_ring(15, '(348.75d, -45d)'); select healpix_ring(15, '(348.75d, -39.375d)'); select healpix_ring(15, '(348.75d, -33.75d)'); select healpix_ring(15, '(348.75d, -28.125d)'); select healpix_nest(15, '(348.75d, -22.5d)'); select healpix_nest(15, '(348.75d, -16.875d)'); select healpix_ring(15, '(348.75d, -11.25d)'); select healpix_ring(15, '(348.75d, -5.625d)'); select healpix_ring(15, '(348.75d, 0.0001)'); select healpix_ring(15, '(348.75d, 5.625d)'); select healpix_ring(15, '(348.75d, 11.25d)'); select healpix_nest(15, '(348.75d, 16.875d)'); select healpix_nest(15, '(348.75d, 22.5d)'); select healpix_ring(15, '(348.75d, 28.125d)'); select healpix_ring(15, '(348.75d, 33.75d)'); select healpix_ring(15, '(348.75d, 39.375d)'); select healpix_ring(15, '(348.75d, 45d)'); select healpix_ring(15, '(348.75d, 50.625d)'); select healpix_ring(15, '(348.75d, 56.25d)'); select healpix_ring(15, '(348.75d, 61.875d)'); select healpix_ring(15, '(348.75d, 67.5d)'); select healpix_nest(15, '(348.75d, 73.125d)'); select healpix_ring(15, '(348.75d, 78.75d)'); select healpix_ring(15, '(348.75d, 84.375d)'); select healpix_nest(15, '(348.75d, 90d)'); select healpix_nest(15, '(360d, -90d)'); select healpix_ring(15, '(360d, -84.375d)'); select healpix_ring(15, '(360d, -78.75d)'); select healpix_ring(15, '(360d, -73.125d)'); select healpix_ring(15, '(360d, -67.5d)'); select healpix_nest(15, '(360d, -61.875d)'); select healpix_nest(15, '(360d, -56.25d)'); select healpix_nest(15, '(360d, -50.625d)'); select healpix_ring(15, '(360d, -45d)'); select healpix_ring(15, '(360d, -39.375d)'); select healpix_ring(15, '(360d, -33.75d)'); select healpix_ring(15, '(360d, -28.125d)'); select healpix_ring(15, '(360d, -22.5d)'); select healpix_ring(15, '(360d, -16.875d)'); select healpix_ring(15, '(360d, -11.25d)'); select healpix_ring(15, '(360d, -5.625d)'); select healpix_ring(15, '(360d, 0.0001)'); select healpix_ring(15, '(360d, 5.625d)'); select healpix_nest(15, '(360d, 11.25d)'); select healpix_ring(15, '(360d, 16.875d)'); select healpix_nest(15, '(360d, 22.5d)'); select healpix_ring(15, '(360d, 28.125d)'); select healpix_nest(15, '(360d, 33.75d)'); select healpix_nest(15, '(360d, 39.375d)'); select healpix_ring(15, '(360d, 45d)'); select healpix_nest(15, '(360d, 50.625d)'); select healpix_nest(15, '(360d, 56.25d)'); select healpix_nest(15, '(360d, 61.875d)'); select healpix_ring(15, '(360d, 67.5d)'); select healpix_nest(15, '(360d, 73.125d)'); select healpix_nest(15, '(360d, 78.75d)'); select healpix_nest(15, '(360d, 84.375d)'); select healpix_nest(15, '(360d, 90d)'); select centre_of_healpix_ring(28, 537730339933102080); select centre_of_healpix_nest(27, 201388984497553152); select centre_of_healpix_nest(21, 44196118059124); select centre_of_healpix_ring(27, 194581447837049088); select centre_of_healpix_nest(13, 419722720); select centre_of_healpix_nest(20, 6132786714249); select centre_of_healpix_ring(20, 8227328938956); select centre_of_healpix_nest(27, 54798618660893952); select centre_of_healpix_nest(15, 6392603127); select centre_of_healpix_ring(22, 115555464150489); select centre_of_healpix_nest(26, 9823337059771008); select centre_of_healpix_nest(24, 2278117826957604); select centre_of_healpix_ring(12, 26680361); select centre_of_healpix_ring(11, 9637138); select centre_of_healpix_nest(14, 2792184976); select centre_of_healpix_ring(4, 2732); select centre_of_healpix_ring(24, 3110211681589728); select centre_of_healpix_ring(4, 2307); select centre_of_healpix_nest(5, 9269); select centre_of_healpix_nest(21, 19605219971363); select centre_of_healpix_ring(10, 2683217); select centre_of_healpix_nest(23, 184729963468995); select centre_of_healpix_nest(6, 3622); select centre_of_healpix_nest(28, 534942473612104704); select centre_of_healpix_ring(27, 146758529656356864); select centre_of_healpix_ring(23, 382135742340279); select centre_of_healpix_nest(27, 152634205458995712); select centre_of_healpix_ring(28, 713459420104516608); select centre_of_healpix_ring(8, 405421); select centre_of_healpix_ring(6, 30504); select centre_of_healpix_ring(7, 87548); select centre_of_healpix_ring(13, 776006567); select centre_of_healpix_ring(25, 12950711827228800); select centre_of_healpix_ring(22, 111992516070519); select centre_of_healpix_ring(20, 3830060322857); select centre_of_healpix_ring(23, 184752358124289); select centre_of_healpix_ring(14, 2747491487); select centre_of_healpix_nest(28, 26976689329032192); select centre_of_healpix_nest(10, 10982692); select centre_of_healpix_ring(28, 861417470205514752); select centre_of_healpix_nest(19, 1025023444235); select centre_of_healpix_nest(14, 250621829); select centre_of_healpix_nest(23, 518845461144234); select centre_of_healpix_nest(25, 3407207856299664); select centre_of_healpix_ring(24, 82744934806992); select centre_of_healpix_nest(18, 136362875895); select centre_of_healpix_ring(26, 29151516978609024); select centre_of_healpix_nest(26, 41053381175033664); select centre_of_healpix_ring(24, 1095683934718560); select centre_of_healpix_nest(13, 704265631); select centre_of_healpix_ring(14, 268093232); select centre_of_healpix_nest(7, 146796); select centre_of_healpix_nest(7, 178782); select centre_of_healpix_ring(25, 469938201269808); select centre_of_healpix_ring(17, 53330314920); select centre_of_healpix_nest(16, 23042297401); select centre_of_healpix_nest(8, 488194); select centre_of_healpix_ring(20, 2248184383981); select centre_of_healpix_nest(19, 842672017628); select centre_of_healpix_nest(22, 170265834015278); select centre_of_healpix_nest(21, 5910543280040); select centre_of_healpix_nest(13, 184266675); select centre_of_healpix_ring(14, 2667648192); select centre_of_healpix_nest(22, 93236373840563); select centre_of_healpix_nest(16, 34092166004); select centre_of_healpix_nest(21, 12547642479303); select centre_of_healpix_nest(14, 1920063540); select centre_of_healpix_nest(18, 819693553060); select centre_of_healpix_nest(5, 2787); select centre_of_healpix_ring(28, 210546639978286080); select centre_of_healpix_ring(20, 11287795966293); select centre_of_healpix_nest(26, 1160601853988160); select centre_of_healpix_ring(20, 7896584759340); select centre_of_healpix_nest(8, 200830); select centre_of_healpix_ring(17, 94199292826); select centre_of_healpix_nest(6, 13985); select centre_of_healpix_ring(11, 41386383); select centre_of_healpix_ring(21, 35625085172533); select centre_of_healpix_ring(10, 3660152); select centre_of_healpix_ring(12, 141456730); select centre_of_healpix_nest(13, 785134104); select centre_of_healpix_nest(13, 724995839); select centre_of_healpix_ring(23, 478718004930834); select centre_of_healpix_nest(18, 700095158103); select centre_of_healpix_nest(28, 537172777510268928); select centre_of_healpix_ring(5, 1792); select centre_of_healpix_nest(15, 3421616616); select centre_of_healpix_ring(20, 10960258772104); select centre_of_healpix_nest(16, 26152664735); select centre_of_healpix_nest(6, 27586); select centre_of_healpix_nest(14, 1130732644); select centre_of_healpix_nest(8, 750730); select centre_of_healpix_nest(11, 3757411); select centre_of_healpix_ring(11, 5147858); select centre_of_healpix_nest(9, 2517930); select centre_of_healpix_nest(5, 1693); select centre_of_healpix_nest(14, 1441523729); select centre_of_healpix_nest(11, 17237236); select centre_of_healpix_ring(8, 418930); select centre_of_healpix_nest(24, 1668265634339076); select centre_of_healpix_ring(7, 115506); select centre_of_healpix_nest(22, 23361295754004); select centre_of_healpix_nest(26, 27153318689347968); select centre_of_healpix_nest(21, 29427698655517); select centre_of_healpix_nest(9, 410791); select centre_of_healpix_ring(25, 13499743064536176); select centre_of_healpix_nest(8, 551129); select centre_of_healpix_nest(21, 44016257494674); select centre_of_healpix_nest(14, 207841802); select centre_of_healpix_ring(12, 199193395); select centre_of_healpix_ring(9, 1626029); select centre_of_healpix_ring(20, 8358926913920); select centre_of_healpix_nest(21, 14462892588205); select centre_of_healpix_ring(28, 553448975120317440); select centre_of_healpix_nest(27, 182451037576376832); select centre_of_healpix_nest(25, 11258086296039696); select centre_of_healpix_nest(12, 39036434); select centre_of_healpix_nest(23, 32255266892451); select centre_of_healpix_ring(10, 9398705); select centre_of_healpix_nest(4, 1138); select centre_of_healpix_ring(12, 77447327); select centre_of_healpix_nest(15, 5690698366); select centre_of_healpix_ring(23, 228379414182522); select centre_of_healpix_ring(25, 13421573206491024); select centre_of_healpix_nest(19, 3237029635046); select centre_of_healpix_nest(23, 653047493772363); select centre_of_healpix_ring(5, 8453); select centre_of_healpix_nest(6, 17707); select centre_of_healpix_ring(20, 3656306695019); select centre_of_healpix_nest(23, 633776380932543); select centre_of_healpix_ring(10, 10559717); select centre_of_healpix_nest(27, 174358006860603648); select centre_of_healpix_ring(7, 95598); select centre_of_healpix_ring(25, 12720646885101360); select centre_of_healpix_nest(17, 32055127047); select centre_of_healpix_ring(19, 1507606380069); select centre_of_healpix_ring(28, 164123870569021440); select centre_of_healpix_nest(27, 172300653110093568); select centre_of_healpix_ring(22, 6910463642626); select centre_of_healpix_nest(26, 22492624630493760); select centre_of_healpix_nest(25, 6659060140801344); select centre_of_healpix_ring(20, 2203649323698); select centre_of_healpix_nest(9, 2235150); select centre_of_healpix_nest(11, 10617249); select centre_of_healpix_ring(17, 64938630037); select centre_of_healpix_ring(11, 40883797); select centre_of_healpix_nest(12, 19282855); select centre_of_healpix_nest(23, 623780293601457); select centre_of_healpix_ring(9, 3072501); select centre_of_healpix_ring(8, 307021); select centre_of_healpix_nest(27, 151738271099917824); select centre_of_healpix_ring(23, 538441050048837); select centre_of_healpix_ring(8, 575044); select centre_of_healpix_nest(6, 30763); select centre_of_healpix_nest(17, 52812136219); select centre_of_healpix_ring(22, 40208698630502); select centre_of_healpix_ring(5, 8535); select centre_of_healpix_ring(23, 232628212281579); select centre_of_healpix_ring(7, 110204); select centre_of_healpix_nest(13, 622800234); select centre_of_healpix_ring(8, 585024); select centre_of_healpix_ring(9, 2601756); select centre_of_healpix_ring(13, 746326751); select centre_of_healpix_nest(25, 1757052529154064); select centre_of_healpix_nest(8, 32662); select centre_of_healpix_ring(26, 117149321094336); select centre_of_healpix_ring(26, 15298421910153600); select centre_of_healpix_nest(14, 2518871769); select centre_of_healpix_ring(17, 103077161842); select centre_of_healpix_nest(27, 63784668416739072); select centre_of_healpix_nest(18, 631098472239); select centre_of_healpix_ring(13, 48600095); select centre_of_healpix_nest(23, 400344733238772); select centre_of_healpix_nest(10, 4023574); select centre_of_healpix_ring(15, 12166851947); select centre_of_healpix_ring(12, 35645541); select centre_of_healpix_nest(25, 6029463767298432); select centre_of_healpix_ring(23, 293379976031151); select centre_of_healpix_nest(8, 425016); select centre_of_healpix_ring(24, 1819410423699780); select centre_of_healpix_ring(18, 248548350469); select centre_of_healpix_ring(21, 21784662328254); select centre_of_healpix_ring(24, 1919910867680472); select centre_of_healpix_nest(11, 49569053); select centre_of_healpix_ring(4, 2302); select centre_of_healpix_ring(18, 755357167125); select centre_of_healpix_nest(14, 2953072407); select centre_of_healpix_nest(7, 120833); select centre_of_healpix_nest(23, 412827339199236); select centre_of_healpix_ring(22, 5521330266978); select centre_of_healpix_nest(27, 168370330808286720); select centre_of_healpix_nest(17, 83339807644); select centre_of_healpix_nest(6, 9178); select centre_of_healpix_nest(10, 499837); select centre_of_healpix_nest(27, 114801840312943104); select centre_of_healpix_ring(8, 359324); select centre_of_healpix_nest(8, 243307); select centre_of_healpix_ring(13, 331571919); select centre_of_healpix_ring(4, 996); select centre_of_healpix_nest(22, 152304766469933); select centre_of_healpix_ring(23, 213842515389360); select centre_of_healpix_ring(25, 7605691185820272); select centre_of_healpix_ring(17, 17344372343); select centre_of_healpix_ring(28, 552893874565555200); select centre_of_healpix_ring(8, 163219); select centre_of_healpix_nest(28, 856163252610493440); select centre_of_healpix_ring(8, 673143); select centre_of_healpix_nest(26, 48909027540191040); select centre_of_healpix_ring(22, 64899608502222); select centre_of_healpix_ring(9, 768037); select centre_of_healpix_ring(21, 32654589766489); select centre_of_healpix_nest(9, 1053660); select centre_of_healpix_nest(13, 96616303); select centre_of_healpix_nest(19, 575871286060); select centre_of_healpix_ring(25, 2625975271359840); select centre_of_healpix_ring(6, 21866); select centre_of_healpix_nest(27, 108902701335429120); select centre_of_healpix_nest(24, 1747788089627100); select centre_of_healpix_nest(25, 9387397184945568); select centre_of_healpix_nest(16, 21290390211); select centre_of_healpix_ring(23, 602118262698276); select centre_of_healpix_ring(22, 121019813893770); select centre_of_healpix_ring(23, 670925558888478); select centre_of_healpix_nest(8, 476579); select centre_of_healpix_nest(21, 1296612819316); select centre_of_healpix_nest(18, 744415163816); select centre_of_healpix_ring(7, 158513); select centre_of_healpix_nest(26, 8283332720144448); select centre_of_healpix_nest(8, 443510); select centre_of_healpix_ring(20, 10243296680507); select centre_of_healpix_nest(14, 524948749); select centre_of_healpix_nest(8, 268356); select centre_of_healpix_ring(25, 9927317814361344); select centre_of_healpix_nest(8, 420848); select centre_of_healpix_nest(18, 91891787035); select centre_of_healpix_nest(7, 190630); select centre_of_healpix_ring(14, 700837772); select centre_of_healpix_ring(16, 7300830501); select centre_of_healpix_ring(6, 31387); select centre_of_healpix_nest(12, 131514460); select centre_of_healpix_nest(28, 724400904310972416); select centre_of_healpix_nest(20, 6284135401219); select centre_of_healpix_ring(21, 19581388019467); select centre_of_healpix_ring(17, 40559382784); select centre_of_healpix_ring(26, 16374282674949888); select centre_of_healpix_ring(16, 21632474274); select centre_of_healpix_nest(13, 151449648); select centre_of_healpix_ring(17, 42728762216); select centre_of_healpix_nest(28, 352305614184480768); select centre_of_healpix_nest(21, 20095018204721); select centre_of_healpix_ring(10, 11340177); select centre_of_healpix_nest(26, 32893681947418176); select centre_of_healpix_ring(15, 6287458078); select centre_of_healpix_ring(23, 595068892059339); select centre_of_healpix_ring(8, 554008); select centre_of_healpix_ring(11, 24063730); select centre_of_healpix_nest(27, 175949729925654528); select centre_of_healpix_nest(25, 9751323561149424); select centre_of_healpix_ring(22, 76010226825232); select centre_of_healpix_ring(17, 192235443426); select centre_of_healpix_nest(25, 13353203720119488); select centre_of_healpix_nest(4, 188); select centre_of_healpix_ring(17, 150113787375); select centre_of_healpix_ring(28, 575022982193206272); select centre_of_healpix_nest(23, 38337620048880); select centre_of_healpix_nest(18, 105399907547); select centre_of_healpix_ring(10, 3599087); select centre_of_healpix_nest(17, 37005340465); select centre_of_healpix_nest(25, 8529145197921600); select centre_of_healpix_ring(8, 206512); select centre_of_healpix_ring(4, 1640); select centre_of_healpix_ring(24, 91000974883188); select centre_of_healpix_ring(28, 655076657276510208); select centre_of_healpix_nest(8, 354326); select centre_of_healpix_ring(28, 437289273741232128); select centre_of_healpix_nest(10, 1810016); select centre_of_healpix_nest(16, 5043389430); select centre_of_healpix_nest(20, 4890174394743); select centre_of_healpix_ring(16, 7585288994); select centre_of_healpix_nest(7, 35117); select centre_of_healpix_nest(23, 469154380672512); select centre_of_healpix_ring(21, 51124579290395); select centre_of_healpix_nest(21, 43061741590241); select centre_of_healpix_nest(6, 45011); select centre_of_healpix_ring(10, 11818725); select centre_of_healpix_nest(7, 82812); select centre_of_healpix_nest(11, 2973688); select centre_of_healpix_nest(26, 13177197635570496); select centre_of_healpix_ring(7, 104005); select centre_of_healpix_nest(13, 515003732); select centre_of_healpix_ring(23, 616923614077794); select centre_of_healpix_nest(12, 145580625); select centre_of_healpix_nest(13, 221832964); select centre_of_healpix_nest(27, 43743530156299008); select centre_of_healpix_ring(6, 11149); select centre_of_healpix_ring(24, 1986386821013076); select centre_of_healpix_nest(22, 89030521328388); select centre_of_healpix_nest(7, 104492); select centre_of_healpix_ring(24, 1890512933187240); select centre_of_healpix_ring(11, 42718289); select centre_of_healpix_ring(11, 37314260); select centre_of_healpix_ring(7, 16319); select centre_of_healpix_ring(16, 17063806146); select centre_of_healpix_nest(19, 482933093069); select centre_of_healpix_nest(13, 17886230); select centre_of_healpix_ring(14, 1659230217); select centre_of_healpix_nest(23, 556582830569202); select centre_of_healpix_nest(10, 9747713); select centre_of_healpix_ring(27, 53474052047600640); select centre_of_healpix_ring(9, 64472); select centre_of_healpix_nest(28, 230638103844280320); select centre_of_healpix_nest(26, 6737794664028480); select centre_of_healpix_ring(27, 88027640762867712); select centre_of_healpix_ring(11, 47786973); select centre_of_healpix_nest(7, 69760); select centre_of_healpix_nest(18, 63097617165); select centre_of_healpix_nest(25, 6285710215264320); select centre_of_healpix_ring(6, 13394); select centre_of_healpix_ring(26, 22939779420643200); select centre_of_healpix_ring(9, 266389); select centre_of_healpix_nest(27, 122009553180272640); select centre_of_healpix_nest(16, 24853447555); select centre_of_healpix_ring(9, 2529982); select centre_of_healpix_ring(17, 192098743383); select centre_of_healpix_nest(5, 7854); select centre_of_healpix_nest(18, 785919798058); select centre_of_healpix_nest(8, 395617); select centre_of_healpix_nest(6, 6044); select centre_of_healpix_nest(21, 34513392528579); select centre_of_healpix_nest(18, 148005059466); select centre_of_healpix_nest(8, 715649); select centre_of_healpix_nest(23, 351381100291209); select centre_of_healpix_nest(25, 4783646356031808); select centre_of_healpix_ring(22, 85496057792022); select centre_of_healpix_nest(19, 1207760446960); select centre_of_healpix_ring(12, 4537051); select centre_of_healpix_ring(25, 10113085274651520); select centre_of_healpix_ring(9, 59013); select centre_of_healpix_ring(21, 18299648502817); select centre_of_healpix_nest(25, 522136150124304); select centre_of_healpix_ring(27, 58005231034801152); select centre_of_healpix_ring(16, 21324213405); select centre_of_healpix_ring(18, 681197524109); select centre_of_healpix_nest(4, 2747); select centre_of_healpix_ring(12, 63242546); select centre_of_healpix_nest(23, 266330939391735); select centre_of_healpix_nest(9, 2527310); select centre_of_healpix_nest(6, 10625); select centre_of_healpix_ring(12, 108698312); select centre_of_healpix_ring(13, 448405209); select centre_of_healpix_ring(28, 171484986911913984); select centre_of_healpix_nest(9, 2931469); select centre_of_healpix_nest(11, 48351965); select centre_of_healpix_ring(9, 2852237); select centre_of_healpix_ring(9, 2124465); select centre_of_healpix_ring(20, 7920766156877); select centre_of_healpix_ring(15, 9477540416); select centre_of_healpix_ring(5, 5817); select centre_of_healpix_ring(25, 364214521001568); select centre_of_healpix_nest(9, 1500146); select centre_of_healpix_nest(9, 318689); select centre_of_healpix_nest(24, 3013812035436828); select centre_of_healpix_ring(15, 8625053502); select centre_of_healpix_nest(23, 301762129114665); select centre_of_healpix_ring(14, 1360364144); select centre_of_healpix_ring(21, 28831684353487); select centre_of_healpix_nest(7, 104120); select centre_of_healpix_ring(14, 2059339503); select centre_of_healpix_nest(22, 24116353817334); select centre_of_healpix_ring(8, 331229); select centre_of_healpix_ring(5, 1301); select centre_of_healpix_ring(6, 32102); select centre_of_healpix_ring(12, 78593144); select centre_of_healpix_nest(4, 1274); select centre_of_healpix_nest(26, 2951121583832448); select centre_of_healpix_ring(8, 177721); select centre_of_healpix_ring(15, 5126307896); select centre_of_healpix_nest(8, 336496); select centre_of_healpix_ring(5, 1433); select centre_of_healpix_nest(4, 2205); select centre_of_healpix_ring(8, 433554); select centre_of_healpix_nest(28, 763891381271079936); select centre_of_healpix_nest(4, 552); select centre_of_healpix_ring(16, 36844526833); select centre_of_healpix_nest(28, 304600187742953472); select centre_of_healpix_ring(4, 1070); select centre_of_healpix_ring(14, 1439319910); select centre_of_healpix_nest(26, 51738357988210752); select centre_of_healpix_ring(24, 3357764546304816); select centre_of_healpix_nest(14, 497728405); select centre_of_healpix_nest(5, 153); select centre_of_healpix_ring(15, 5946373304); select centre_of_healpix_ring(28, 696282245114216448); select centre_of_healpix_nest(10, 8775651); select centre_of_healpix_ring(7, 33605); select centre_of_healpix_nest(28, 546743161722971136); select centre_of_healpix_ring(19, 1530804674464); select centre_of_healpix_nest(5, 11024); select centre_of_healpix_nest(18, 638767380106); select centre_of_healpix_nest(18, 200627300011); select centre_of_healpix_ring(24, 2465246686601184); select centre_of_healpix_ring(16, 49149556174); select centre_of_healpix_ring(7, 64840); select centre_of_healpix_nest(18, 548367336389); select centre_of_healpix_ring(15, 8439007258); select centre_of_healpix_ring(10, 5853741); select centre_of_healpix_nest(25, 11843978463310176); select centre_of_healpix_ring(12, 127899067); select centre_of_healpix_ring(10, 3447899); select centre_of_healpix_ring(27, 105385457032640256); select centre_of_healpix_ring(7, 56074); select centre_of_healpix_nest(16, 6080447868); select centre_of_healpix_nest(26, 9443360004995328); select centre_of_healpix_ring(5, 7358); select centre_of_healpix_nest(22, 83115008093623); select centre_of_healpix_nest(22, 119661787861931); select centre_of_healpix_ring(10, 1741511); select centre_of_healpix_nest(28, 233601830524124160); select centre_of_healpix_nest(26, 25542715168258176); select centre_of_healpix_nest(25, 11683039506655248); select centre_of_healpix_nest(9, 2703723); select centre_of_healpix_ring(15, 2350431080); select centre_of_healpix_nest(20, 2167291092838); select centre_of_healpix_ring(25, 9924289250746704); select centre_of_healpix_ring(7, 39352); select centre_of_healpix_nest(6, 40574); select centre_of_healpix_ring(8, 165301); select centre_of_healpix_nest(12, 181533311); select centre_of_healpix_ring(15, 3425067326); select centre_of_healpix_nest(25, 1221534201635760); select centre_of_healpix_ring(13, 507906418); select centre_of_healpix_ring(23, 287308029832317); select centre_of_healpix_ring(26, 53135871436457472); select centre_of_healpix_nest(19, 1090670601536); select centre_of_healpix_ring(20, 3867641411341); select centre_of_healpix_ring(9, 2065273); select centre_of_healpix_ring(12, 135779992); select centre_of_healpix_ring(20, 10935521542147); select centre_of_healpix_nest(19, 114949887864); select centre_of_healpix_ring(5, 10883); select centre_of_healpix_ring(9, 391580); select centre_of_healpix_ring(26, 50284229585712576); select centre_of_healpix_ring(8, 210966); select centre_of_healpix_nest(6, 25485); select centre_of_healpix_nest(16, 40277340625); select centre_of_healpix_nest(27, 124500430430571264); select centre_of_healpix_ring(4, 2050); select centre_of_healpix_ring(15, 6278179983); select centre_of_healpix_ring(21, 19865305926466); select centre_of_healpix_ring(12, 42611685); select centre_of_healpix_ring(8, 425777); select centre_of_healpix_nest(5, 8088); select centre_of_healpix_ring(9, 1394154); select centre_of_healpix_ring(17, 70106593390); select centre_of_healpix_nest(25, 7468662076615776); select centre_of_healpix_nest(18, 308025039646); select centre_of_healpix_nest(26, 49821874966440960); select centre_of_healpix_ring(23, 322203559978023); select centre_of_healpix_ring(22, 173896119291346); select centre_of_healpix_ring(16, 693814171); select centre_of_healpix_ring(13, 298804590); select centre_of_healpix_nest(9, 896428); select centre_of_healpix_ring(18, 182043356873); select centre_of_healpix_ring(25, 12141108247773648); select centre_of_healpix_nest(18, 706452677992); select centre_of_healpix_ring(28, 10821196959267840); select centre_of_healpix_nest(6, 42704); select centre_of_healpix_nest(28, 83146726739002368); select centre_of_healpix_ring(19, 1818721106330); select centre_of_healpix_ring(21, 43567771002648); select centre_of_healpix_ring(4, 285); select centre_of_healpix_nest(12, 108829729); select centre_of_healpix_ring(7, 121332); select centre_of_healpix_nest(21, 13214198507927); select centre_of_healpix_nest(18, 818459787178); select centre_of_healpix_nest(15, 286984387); select centre_of_healpix_ring(28, 330620058047385600); select centre_of_healpix_nest(24, 2927095447682220); select centre_of_healpix_nest(15, 5976562503); select centre_of_healpix_nest(6, 47262); select centre_of_healpix_nest(8, 706033); select centre_of_healpix_ring(9, 439829); select centre_of_healpix_ring(22, 105872067443080); select centre_of_healpix_nest(22, 186380323353200); select centre_of_healpix_ring(22, 18009694346571); select centre_of_healpix_ring(24, 1849489461497676); select centre_of_healpix_ring(26, 6448642685073792); select centre_of_healpix_ring(15, 3626703168); select centre_of_healpix_ring(5, 2626); select centre_of_healpix_ring(11, 9697428); select centre_of_healpix_ring(13, 711811032); select centre_of_healpix_nest(25, 3493846776138384); select centre_of_healpix_nest(28, 738579839670079488); select centre_of_healpix_ring(19, 205996276047); select centre_of_healpix_nest(8, 221921); select centre_of_healpix_ring(28, 225046655046448128); select centre_of_healpix_ring(26, 38756175364167168); select centre_of_healpix_ring(5, 6369); select centre_of_healpix_ring(15, 5622641090); select centre_of_healpix_ring(13, 268460119); select centre_of_healpix_nest(23, 386756705319996); select centre_of_healpix_nest(24, 1868157948872844); select centre_of_healpix_nest(16, 42113264243); select centre_of_healpix_nest(8, 76545); select centre_of_healpix_ring(20, 2286133036507); select centre_of_healpix_ring(13, 600991966); select centre_of_healpix_nest(16, 47302719492); select centre_of_healpix_ring(16, 35315710213); select centre_of_healpix_ring(11, 30531997); select centre_of_healpix_ring(20, 9467064114415); select centre_of_healpix_nest(8, 365891); select centre_of_healpix_ring(20, 497243183126); select centre_of_healpix_ring(12, 29572415); select centre_of_healpix_nest(17, 123666065789); select centre_of_healpix_nest(22, 174709815316048); select centre_of_healpix_ring(18, 348731659907); select centre_of_healpix_ring(23, 275824916311884); select centre_of_healpix_nest(24, 2164146544751052); select centre_of_healpix_ring(21, 16310692827216); select centre_of_healpix_ring(28, 799536742754669568); select centre_of_healpix_ring(27, 93052091697524736); select centre_of_healpix_ring(19, 1091612438753); select centre_of_healpix_nest(13, 8074557); select centre_of_healpix_ring(9, 2819977); select centre_of_healpix_ring(5, 10805); select centre_of_healpix_nest(10, 5501413); select centre_of_healpix_nest(26, 37392938530485120); select centre_of_healpix_ring(14, 831021220); select centre_of_healpix_nest(26, 31258268057869824); select centre_of_healpix_nest(7, 57069); select centre_of_healpix_ring(22, 101667031522612); select centre_of_healpix_ring(18, 608913542939); select centre_of_healpix_ring(6, 18471); select centre_of_healpix_nest(21, 31527810935340); select centre_of_healpix_ring(22, 92078063934181); select centre_of_healpix_nest(13, 164187661); select centre_of_healpix_nest(24, 279431807745024); select centre_of_healpix_nest(28, 601827277442571264); select centre_of_healpix_ring(5, 8219); select centre_of_healpix_ring(10, 6154916); select centre_of_healpix_nest(14, 695675771); select centre_of_healpix_ring(22, 94858604681754); select centre_of_healpix_nest(26, 22385669837084544); select centre_of_healpix_nest(26, 19446327774759744); select centre_of_healpix_ring(11, 12201331); select centre_of_healpix_nest(17, 34462086549); select centre_of_healpix_nest(11, 31630711); select centre_of_healpix_nest(27, 113694813714710784); select centre_of_healpix_nest(23, 667784128403820); select centre_of_healpix_ring(11, 44687061); select centre_of_healpix_ring(18, 274977429575); select centre_of_healpix_nest(9, 2838773); select centre_of_healpix_ring(5, 1710); select centre_of_healpix_nest(6, 39938); select centre_of_healpix_ring(13, 238449072); select centre_of_healpix_nest(21, 23730825026814); select centre_of_healpix_ring(19, 1796609073007); select centre_of_healpix_ring(20, 6327661430434); select centre_of_healpix_nest(7, 195671); select centre_of_healpix_nest(14, 129747966); select centre_of_healpix_ring(15, 4335858267); select centre_of_healpix_ring(27, 131412997211631360); select centre_of_healpix_nest(22, 81837808796668); select centre_of_healpix_ring(25, 6572063630925072); select centre_of_healpix_ring(12, 99696856); select centre_of_healpix_ring(13, 185847849); select centre_of_healpix_nest(14, 905417853); select centre_of_healpix_nest(6, 22452); select centre_of_healpix_ring(16, 49817464016); select centre_of_healpix_ring(28, 393892648199740416); select centre_of_healpix_ring(14, 754240326); select centre_of_healpix_ring(24, 2816806896339684); select centre_of_healpix_nest(25, 8832214882961472); select centre_of_healpix_ring(14, 2251720605); select centre_of_healpix_ring(27, 152665212339125760); select centre_of_healpix_ring(13, 530729975); select centre_of_healpix_nest(6, 37419); select centre_of_healpix_nest(14, 2254665264); select centre_of_healpix_nest(21, 31472886052600); select centre_of_healpix_ring(14, 715531452); select centre_of_healpix_ring(20, 6288770027214); select centre_of_healpix_nest(11, 37491732); select centre_of_healpix_ring(6, 27598); select centre_of_healpix_nest(15, 10939572103); select centre_of_healpix_ring(11, 16055639); select centre_of_healpix_nest(24, 3284556376079004); select centre_of_healpix_nest(5, 4359); select centre_of_healpix_ring(10, 3378928); select centre_of_healpix_nest(26, 27634141140706560); select centre_of_healpix_ring(17, 10803296647); select centre_of_healpix_nest(26, 23709435232142208); select centre_of_healpix_nest(10, 1296378); select centre_of_healpix_nest(19, 1575245828144); select centre_of_healpix_nest(11, 2726999); select centre_of_healpix_nest(24, 3099636690545736); select centre_of_healpix_nest(15, 6264223126); select centre_of_healpix_nest(24, 2619536815491696); select centre_of_healpix_ring(18, 493881847077); select centre_of_healpix_ring(6, 14889); select centre_of_healpix_ring(21, 14870365099456); select centre_of_healpix_ring(17, 18052950446); select centre_of_healpix_ring(9, 3095970); select centre_of_healpix_nest(27, 49656729287612928); select centre_of_healpix_ring(16, 2535747372); select centre_of_healpix_ring(13, 103964507); select centre_of_healpix_ring(21, 27737721561370); select centre_of_healpix_nest(21, 12512002615129); select centre_of_healpix_nest(18, 165757354571); select centre_of_healpix_nest(7, 146565); select centre_of_healpix_ring(4, 2742); select centre_of_healpix_ring(13, 320301716); select centre_of_healpix_ring(17, 131409270184); select centre_of_healpix_ring(14, 3094170600); select centre_of_healpix_nest(27, 75391023158022912); select centre_of_healpix_nest(11, 27166235); select centre_of_healpix_ring(24, 565545348837204); select centre_of_healpix_nest(25, 2126640087028992); select centre_of_healpix_nest(25, 199961835361392); select centre_of_healpix_ring(9, 559379); select centre_of_healpix_ring(19, 2853546998659); select centre_of_healpix_nest(16, 47315822096); select centre_of_healpix_ring(22, 33960314204286); select centre_of_healpix_ring(28, 5868928751941632); select centre_of_healpix_ring(16, 1454567511); select centre_of_healpix_nest(15, 9769337559); select centre_of_healpix_nest(16, 1623946482); select centre_of_healpix_nest(25, 12005065586729760); select centre_of_healpix_nest(16, 49124069891); select centre_of_healpix_nest(25, 2230922650209216); select centre_of_healpix_ring(28, 342152606020439040); select centre_of_healpix_ring(26, 52426357665414528); select centre_of_healpix_nest(20, 5222772019166); select centre_of_healpix_ring(27, 1751055573934080); select centre_of_healpix_ring(24, 998003082512988); select centre_of_healpix_ring(24, 2469632848212456); select centre_of_healpix_nest(5, 5228); select centre_of_healpix_nest(10, 9270552); select centre_of_healpix_ring(22, 185551039603602); select centre_of_healpix_ring(19, 13530914066); select centre_of_healpix_nest(28, 597319441282249728); select centre_of_healpix_nest(10, 5425090); select centre_of_healpix_ring(15, 8121234206); select centre_of_healpix_ring(27, 1168408328913408); select centre_of_healpix_nest(16, 36161313850); select centre_of_healpix_nest(24, 31553009213232); select centre_of_healpix_ring(25, 3364032823619376); select centre_of_healpix_nest(13, 113854346); select centre_of_healpix_ring(12, 19181269); select centre_of_healpix_ring(21, 49860077119959); select centre_of_healpix_nest(5, 2942); select centre_of_healpix_nest(24, 1057202692327464); select centre_of_healpix_nest(23, 436114855314633); select centre_of_healpix_ring(20, 1063390092871); select centre_of_healpix_nest(16, 21420634573); select centre_of_healpix_ring(10, 12110604); select centre_of_healpix_nest(13, 346081569); select centre_of_healpix_nest(19, 1183542884248); select centre_of_healpix_nest(18, 683574460932); select centre_of_healpix_ring(5, 6590); select centre_of_healpix_nest(19, 420140468418); select centre_of_healpix_ring(22, 207184398224823); select centre_of_healpix_ring(23, 444693866890563); select centre_of_healpix_ring(12, 8875280); select centre_of_healpix_ring(11, 17715426); select centre_of_healpix_nest(22, 20268640037856); select centre_of_healpix_ring(21, 17615203451411); select centre_of_healpix_ring(22, 36062207977702); select centre_of_healpix_nest(18, 218572946343); select centre_of_healpix_ring(15, 1434908109); select centre_of_healpix_nest(13, 750839184); select centre_of_healpix_nest(17, 198155809389); select centre_of_healpix_nest(23, 113668850797485); select centre_of_healpix_ring(13, 161765910); select centre_of_healpix_ring(12, 129503779); select centre_of_healpix_ring(20, 6226959808163); select centre_of_healpix_ring(24, 2536325237566980); select centre_of_healpix_nest(26, 5557614260288256); select centre_of_healpix_nest(21, 46324118055801); select centre_of_healpix_nest(4, 1057); select centre_of_healpix_nest(6, 29624); select centre_of_healpix_ring(16, 29183080758); select centre_of_healpix_nest(27, 95935114026059520); select centre_of_healpix_nest(16, 44182642748); select centre_of_healpix_ring(23, 538679612339817); select centre_of_healpix_nest(10, 5996383); select centre_of_healpix_ring(21, 5758595135923); select centre_of_healpix_ring(6, 19258); select centre_of_healpix_ring(7, 119182); select centre_of_healpix_ring(25, 125860990243200); select centre_of_healpix_ring(21, 39057667543386); select centre_of_healpix_nest(10, 919012); select centre_of_healpix_nest(24, 2147335846674756); select centre_of_healpix_nest(28, 822724412295081984); select centre_of_healpix_nest(28, 225127735760489472); select centre_of_healpix_ring(9, 2310825); select centre_of_healpix_nest(17, 137170290591); select centre_of_healpix_ring(26, 20422921971689472); select centre_of_healpix_ring(5, 9545); select centre_of_healpix_ring(6, 39409); select centre_of_healpix_nest(27, 97747641148455168); select centre_of_healpix_ring(12, 23639076); select centre_of_healpix_ring(12, 156589092); select centre_of_healpix_nest(10, 7898846); select centre_of_healpix_nest(26, 8575286206583616); select centre_of_healpix_ring(7, 50755); select centre_of_healpix_nest(17, 198580473642); select centre_of_healpix_ring(7, 126763); select centre_of_healpix_ring(19, 1731132978273); select centre_of_healpix_nest(15, 4727946330); select centre_of_healpix_nest(8, 202866); select centre_of_healpix_ring(5, 1684); select centre_of_healpix_nest(6, 30592); select centre_of_healpix_nest(17, 18895710150); select centre_of_healpix_nest(16, 36556541); select centre_of_healpix_nest(6, 37672); select centre_of_healpix_ring(8, 334602); select centre_of_healpix_ring(9, 1620472); select centre_of_healpix_nest(18, 334249431051); select centre_of_healpix_ring(4, 775); select centre_of_healpix_ring(6, 19692); select centre_of_healpix_ring(19, 1938502919617); select centre_of_healpix_ring(27, 158155499442294528); select centre_of_healpix_nest(24, 3156659896819272); select centre_of_healpix_ring(15, 12868132370); select centre_of_healpix_nest(9, 1297166); select centre_of_healpix_nest(4, 1132); select centre_of_healpix_ring(15, 9446349215); select centre_of_healpix_nest(5, 269); select centre_of_healpix_nest(26, 12978495580532736); select centre_of_healpix_ring(10, 3320172); select centre_of_healpix_nest(13, 183816574); select centre_of_healpix_ring(11, 2159036); select centre_of_healpix_ring(22, 15660794913993); select centre_of_healpix_nest(26, 53218345157724864); select centre_of_healpix_nest(24, 3214377331206264); select centre_of_healpix_nest(17, 58757355986); select centre_of_healpix_nest(6, 25793); select centre_of_healpix_ring(22, 143504477729511); select centre_of_healpix_ring(20, 4252777630460); select centre_of_healpix_ring(8, 45524); select centre_of_healpix_ring(21, 21991618730082); select centre_of_healpix_nest(10, 5661014); select centre_of_healpix_ring(9, 177472); select centre_of_healpix_ring(23, 94151018134101); select centre_of_healpix_nest(24, 3251841897559872); select centre_of_healpix_nest(12, 22593063); select centre_of_healpix_nest(16, 50581110835); select centre_of_healpix_ring(26, 14476441975155264); select centre_of_healpix_nest(23, 500109778740276); select centre_of_healpix_ring(12, 28726413); select centre_of_healpix_nest(12, 85695251); select centre_of_healpix_nest(6, 37729); select centre_of_healpix_ring(22, 145885972453206); select centre_of_healpix_ring(17, 33609987894); select centre_of_healpix_ring(27, 47656973132542464); select centre_of_healpix_nest(25, 10560880425416976); select centre_of_healpix_nest(11, 8655639); select centre_of_healpix_ring(13, 607290142); select centre_of_healpix_nest(28, 541123539656103936); select centre_of_healpix_nest(6, 3386); select centre_of_healpix_ring(13, 384622849); select centre_of_healpix_nest(25, 7428787477467504); select centre_of_healpix_ring(21, 26510317798031); select centre_of_healpix_ring(27, 80940625510037760); select centre_of_healpix_ring(8, 12430); select centre_of_healpix_nest(4, 1604); select centre_of_healpix_ring(24, 3127655356275960); select centre_of_healpix_nest(26, 35903941340341056); select centre_of_healpix_nest(23, 220156505312616); select centre_of_healpix_ring(15, 6410546556); select centre_of_healpix_ring(12, 70870934); select centre_of_healpix_nest(18, 796344875135); select centre_of_healpix_nest(26, 32943386695570176); select centre_of_healpix_nest(24, 796828862563788); select centre_of_healpix_nest(4, 2611); select centre_of_healpix_nest(14, 1435532044); select centre_of_healpix_ring(7, 54677); select centre_of_healpix_ring(11, 37188057); select centre_of_healpix_ring(18, 717699494335); select centre_of_healpix_nest(17, 88295259690); select centre_of_healpix_nest(26, 50295206460953856); select centre_of_healpix_nest(13, 604197507); select centre_of_healpix_ring(7, 53681); select centre_of_healpix_nest(26, 29553050609915712); select centre_of_healpix_nest(23, 573802897123704); select centre_of_healpix_ring(16, 2916385746); select centre_of_healpix_ring(28, 713181272405919744); select centre_of_healpix_nest(9, 2802397); select centre_of_healpix_ring(22, 111842661570519); select centre_of_healpix_nest(10, 848225); select centre_of_healpix_ring(17, 38106811811); select centre_of_healpix_nest(14, 925009876); select centre_of_healpix_nest(18, 156616712796); select centre_of_healpix_nest(5, 1044); select centre_of_healpix_ring(25, 3879154053677472); select centre_of_healpix_ring(6, 9534); select centre_of_healpix_ring(14, 1567279613); select centre_of_healpix_nest(16, 28086844830); select centre_of_healpix_nest(15, 5923434133); select centre_of_healpix_nest(17, 157931199308); select centre_of_healpix_nest(13, 730302836); select centre_of_healpix_ring(20, 7843334530499); select centre_of_healpix_nest(7, 33271); select centre_of_healpix_ring(15, 8059818847); select centre_of_healpix_nest(25, 2822353174832832); select centre_of_healpix_ring(15, 7002952372); select centre_of_healpix_ring(13, 621203432); select centre_of_healpix_ring(14, 2077789940); select centre_of_healpix_nest(15, 8709767142); select centre_of_healpix_ring(21, 37201393479632); select centre_of_healpix_ring(17, 100556860212); select centre_of_healpix_ring(5, 6087); select centre_of_healpix_nest(20, 9305529977729); select centre_of_healpix_ring(28, 672180696943881216); select centre_of_healpix_ring(8, 154370); select centre_of_healpix_ring(27, 204140869291867392); select centre_of_healpix_nest(23, 584838544598424); select centre_of_healpix_ring(15, 5391830951); select centre_of_healpix_nest(25, 10247294107160352); select centre_of_healpix_ring(23, 433805540837073); select centre_of_healpix_nest(8, 753337); select centre_of_healpix_ring(12, 163316508); select centre_of_healpix_nest(24, 132313761289944); select centre_of_healpix_nest(11, 22447029); select centre_of_healpix_nest(15, 328716562); select centre_of_healpix_ring(8, 409496); select centre_of_healpix_nest(25, 7923715822875552); select centre_of_healpix_nest(13, 247418948); select centre_of_healpix_nest(14, 1195779886); select centre_of_healpix_nest(11, 27193973); select centre_of_healpix_ring(19, 7947332529); select centre_of_healpix_nest(5, 6451); select centre_of_healpix_nest(10, 8181427); select centre_of_healpix_nest(11, 14129363); select centre_of_healpix_ring(22, 58668935737888); select centre_of_healpix_nest(19, 2478922471255); select centre_of_healpix_nest(16, 49343427381); select centre_of_healpix_ring(23, 90087677211315); select centre_of_healpix_ring(6, 61); select centre_of_healpix_nest(7, 183325); select centre_of_healpix_ring(10, 3956521); select centre_of_healpix_nest(24, 1618756661694108); select centre_of_healpix_ring(9, 471411); select centre_of_healpix_nest(8, 81944); select centre_of_healpix_nest(21, 50336408282729); select centre_of_healpix_ring(7, 105426); select centre_of_healpix_ring(8, 551619); select centre_of_healpix_ring(6, 10826); select centre_of_healpix_ring(19, 456144295505); select centre_of_healpix_ring(8, 86919); select centre_of_healpix_nest(12, 32821840); select centre_of_healpix_nest(11, 10260771); select centre_of_healpix_nest(15, 12140314131); select centre_of_healpix_ring(15, 5585571293); select centre_of_healpix_nest(6, 10998); select centre_of_healpix_nest(23, 117828408342789); select centre_of_healpix_ring(27, 59064740134010880); select centre_of_healpix_nest(21, 33803177399951); select centre_of_healpix_nest(24, 1826775614454120); select centre_of_healpix_nest(28, 212880669794460672); select centre_of_healpix_nest(15, 3359620743); select centre_of_healpix_nest(19, 1127731680822); select centre_of_healpix_nest(22, 89212640176039); select centre_of_healpix_nest(12, 89747364); select centre_of_healpix_ring(6, 10409); select centre_of_healpix_nest(5, 11776); select centre_of_healpix_nest(11, 8686187); select centre_of_healpix_nest(10, 10876624); select centre_of_healpix_nest(24, 1894683396160176); select centre_of_healpix_nest(22, 182735075763924); select centre_of_healpix_ring(23, 590933913725286); select centre_of_healpix_ring(23, 104194933696725); select centre_of_healpix_nest(6, 22093); select centre_of_healpix_nest(14, 426353707); select centre_of_healpix_ring(23, 697517322959850); select centre_of_healpix_ring(6, 20934); select centre_of_healpix_ring(22, 162988335867693); select centre_of_healpix_nest(21, 18903077968495); select centre_of_healpix_ring(4, 1433); select centre_of_healpix_nest(26, 4534086012358464); select centre_of_healpix_ring(20, 2044035672759); select centre_of_healpix_nest(4, 2374); select centre_of_healpix_ring(24, 1742464464305352); select centre_of_healpix_ring(4, 1875); select centre_of_healpix_nest(20, 6380933467350); select centre_of_healpix_nest(21, 47966645501850); select centre_of_healpix_nest(16, 5566476229); select centre_of_healpix_nest(15, 11667645314); select centre_of_healpix_ring(28, 260837993758162944); select centre_of_healpix_ring(7, 42769); select centre_of_healpix_ring(16, 40700063880); select centre_of_healpix_nest(19, 1506495333618); select centre_of_healpix_nest(17, 175826983607); select centre_of_healpix_nest(27, 108957779962841856); select centre_of_healpix_nest(23, 540667416984510); select centre_of_healpix_nest(23, 137825919779085); select centre_of_healpix_nest(4, 1097); select centre_of_healpix_ring(10, 11095051); select centre_of_healpix_nest(26, 10898162737721472); select centre_of_healpix_ring(24, 525708146363268); select centre_of_healpix_nest(25, 7869751756360896); select centre_of_healpix_nest(26, 32666533368757440); select centre_of_healpix_nest(24, 630079962106392); select centre_of_healpix_ring(22, 73518473039645); select centre_of_healpix_nest(7, 21748); select centre_of_healpix_nest(27, 209387279675877120); select centre_of_healpix_ring(16, 43658314709); select centre_of_healpix_nest(20, 12244529311815); select centre_of_healpix_ring(8, 232218); select centre_of_healpix_nest(14, 3101754484); select centre_of_healpix_nest(9, 2876664); select centre_of_healpix_nest(11, 14885587); select centre_of_healpix_nest(9, 1715953); select centre_of_healpix_ring(13, 239458991); select centre_of_healpix_nest(21, 27799228047781); select centre_of_healpix_ring(4, 1082); select centre_of_healpix_nest(13, 611734915); select centre_of_healpix_ring(6, 15137); select centre_of_healpix_nest(21, 10705018741137); select centre_of_healpix_ring(23, 359597207691333); select centre_of_healpix_ring(10, 10645781); select centre_of_healpix_nest(20, 3923787457880); select centre_of_healpix_nest(5, 11063); select centre_of_healpix_ring(7, 99385); select centre_of_healpix_ring(13, 715189606); select centre_of_healpix_nest(4, 1659); select centre_of_healpix_nest(23, 433381862541534); select centre_of_healpix_nest(15, 12381569215); select centre_of_healpix_ring(28, 545178676896473088); select centre_of_healpix_ring(19, 721948443643); select centre_of_healpix_nest(25, 11785044488625696); select centre_of_healpix_ring(5, 3026); select centre_of_healpix_nest(4, 755); select centre_of_healpix_nest(4, 1006); select centre_of_healpix_ring(8, 589428); select centre_of_healpix_nest(8, 476910); select centre_of_healpix_nest(26, 20215913898550272); select centre_of_healpix_ring(8, 263230); select centre_of_healpix_nest(26, 23224023091153536); select centre_of_healpix_nest(4, 2775); select centre_of_healpix_nest(21, 50855213552015); select centre_of_healpix_nest(16, 22739550370); select centre_of_healpix_nest(21, 41537481248278); select centre_of_healpix_ring(13, 786405969); select centre_of_healpix_ring(6, 33657); select centre_of_healpix_ring(25, 4747485722356464); select centre_of_healpix_nest(12, 45443918); select centre_of_healpix_nest(18, 442269984503); select centre_of_healpix_nest(20, 5883419355687); select centre_of_healpix_ring(24, 2889283911166860); select centre_of_healpix_ring(5, 4263); select centre_of_healpix_ring(7, 60803); select centre_of_healpix_ring(7, 126414); select centre_of_healpix_ring(15, 5240814494); select centre_of_healpix_nest(15, 4679860430); select centre_of_healpix_ring(24, 2724511556131044); select centre_of_healpix_ring(12, 24290244); select centre_of_healpix_nest(23, 443737179389067); select centre_of_healpix_nest(16, 24595100522); select centre_of_healpix_ring(12, 150216911); select centre_of_healpix_nest(17, 166706256311); select centre_of_healpix_ring(19, 3012569586741); select centre_of_healpix_nest(5, 1184); select centre_of_healpix_ring(10, 4281154); select centre_of_healpix_ring(13, 524180690); select centre_of_healpix_nest(6, 42972); select centre_of_healpix_ring(21, 30787249416012); select centre_of_healpix_nest(27, 141057070214657280); select centre_of_healpix_nest(10, 9233852); select centre_of_healpix_nest(16, 5349298807); select centre_of_healpix_nest(26, 27966244521661056); select centre_of_healpix_nest(25, 3637003355050128); select centre_of_healpix_nest(28, 495823041389678592); select centre_of_healpix_ring(5, 4310); select centre_of_healpix_ring(9, 711781); select centre_of_healpix_ring(16, 6353025132); select centre_of_healpix_ring(27, 194339818944215040); select centre_of_healpix_nest(11, 22810257); select centre_of_healpix_nest(22, 156788698513444); select centre_of_healpix_nest(12, 84681028); select centre_of_healpix_ring(22, 41816477699847); select centre_of_healpix_nest(7, 191852); select centre_of_healpix_nest(21, 40736166015669); select centre_of_healpix_ring(8, 751918); select centre_of_healpix_ring(27, 197271692919226368); select centre_of_healpix_nest(26, 10155744003415488); select centre_of_healpix_nest(10, 8220217); select centre_of_healpix_nest(18, 303100606235); select centre_of_healpix_nest(24, 2785698734739600); select centre_of_healpix_nest(15, 7220087672); select centre_of_healpix_nest(27, 95141763424132608); select centre_of_healpix_ring(6, 48255); select centre_of_healpix_ring(23, 491080541059656); select centre_of_healpix_nest(20, 11176720369538); select centre_of_healpix_ring(23, 741909774374946); select centre_of_healpix_ring(22, 57419407468784); select centre_of_healpix_nest(8, 704709); select centre_of_healpix_nest(19, 893781667229); select centre_of_healpix_ring(12, 71752063); select centre_of_healpix_nest(16, 36831449562); select centre_of_healpix_nest(8, 55238); select centre_of_healpix_ring(15, 4319593095); select centre_of_healpix_ring(13, 352692945); select centre_of_healpix_nest(28, 116686047875343360); select centre_of_healpix_nest(10, 7721095); select centre_of_healpix_ring(6, 20913); select centre_of_healpix_nest(17, 176710528483); select centre_of_healpix_ring(11, 41896412); select centre_of_healpix_nest(25, 11056931037767040); select centre_of_healpix_nest(27, 21050182967750400); select centre_of_healpix_nest(11, 13996192); select centre_of_healpix_ring(16, 37213909794); select centre_of_healpix_nest(8, 624154); select centre_of_healpix_nest(20, 10928438563696); select centre_of_healpix_nest(13, 439438363); select centre_of_healpix_nest(23, 4300717187877); select centre_of_healpix_ring(23, 159114204510432); select centre_of_healpix_nest(10, 12068875); select centre_of_healpix_nest(26, 46385801361653376); select centre_of_healpix_nest(20, 723689301477); select centre_of_healpix_nest(27, 72600036203185152); select centre_of_healpix_ring(28, 519031082337119232); select centre_of_healpix_nest(24, 1452520726872312); select centre_of_healpix_ring(7, 14867); select centre_of_healpix_ring(12, 191787536); select centre_of_healpix_nest(9, 2530133); select centre_of_healpix_ring(21, 49860599721652); select centre_of_healpix_nest(27, 205171330321572096); select centre_of_healpix_ring(26, 33220039743394560); select centre_of_healpix_ring(9, 1015262); select centre_of_healpix_ring(7, 178213); select centre_of_healpix_nest(20, 7184631071659); select centre_of_healpix_ring(26, 38703172787616768); select centre_of_healpix_nest(8, 480072); select centre_of_healpix_ring(22, 185067465977314); select centre_of_healpix_nest(13, 515966125); select centre_of_healpix_nest(14, 1246677573); select centre_of_healpix_nest(11, 20023987); select centre_of_healpix_nest(12, 75575650); select centre_of_healpix_ring(5, 8969); select centre_of_healpix_ring(23, 170547538414200); select centre_of_healpix_nest(6, 21202); select centre_of_healpix_ring(26, 41344020049933440); select centre_of_healpix_ring(15, 880827815); select centre_of_healpix_ring(14, 1398400204); select centre_of_healpix_ring(13, 667594394); select centre_of_healpix_ring(19, 2955926820093); select centre_of_healpix_nest(16, 44426836500); select centre_of_healpix_nest(16, 51295516247); select centre_of_healpix_nest(18, 577743854748); select centre_of_healpix_ring(12, 75117969); select centre_of_healpix_ring(9, 2765628); select centre_of_healpix_nest(19, 419893029776); select centre_of_healpix_ring(9, 461229); select centre_of_healpix_ring(21, 26237298069973); select centre_of_healpix_nest(13, 585099177); select centre_of_healpix_ring(28, 745902712931622912); select centre_of_healpix_nest(19, 2425745544581); select centre_of_healpix_nest(17, 167545986422); select centre_of_healpix_nest(9, 2167450); select centre_of_healpix_nest(20, 5524610276077); select centre_of_healpix_ring(19, 3108844000319); select centre_of_healpix_nest(6, 27800); select centre_of_healpix_nest(27, 64863365879469312); select centre_of_healpix_nest(9, 380480); select centre_of_healpix_nest(20, 7179614470088); select centre_of_healpix_nest(24, 2252994948242088); select centre_of_healpix_ring(27, 121984399434180864); select centre_of_healpix_ring(14, 1343000756); select centre_of_healpix_ring(13, 350114120); select centre_of_healpix_ring(11, 6980524); select centre_of_healpix_nest(5, 1336); select centre_of_healpix_ring(5, 9037); select centre_of_healpix_nest(28, 849774482713525248); select centre_of_healpix_nest(4, 2221); select centre_of_healpix_nest(24, 320364357078852); select centre_of_healpix_nest(15, 9112365641); select centre_of_healpix_nest(8, 520786); select centre_of_healpix_nest(24, 3081263809215192); select centre_of_healpix_nest(26, 43803863391312192); select centre_of_healpix_ring(8, 687400); select centre_of_healpix_nest(26, 52219904624154048); select centre_of_healpix_ring(7, 31551); select centre_of_healpix_nest(15, 10308012275); select centre_of_healpix_ring(22, 194616343973793); select centre_of_healpix_nest(11, 15195578); select centre_of_healpix_ring(11, 18602747); select centre_of_healpix_ring(4, 2235); select centre_of_healpix_nest(5, 6590); select centre_of_healpix_nest(18, 678177580256); select centre_of_healpix_nest(17, 165747513538); select centre_of_healpix_nest(8, 747464); select centre_of_healpix_ring(24, 2546103820703280); select centre_of_healpix_nest(21, 37918915769211); select centre_of_healpix_nest(16, 31646135441); select centre_of_healpix_ring(28, 656590948524413952); select centre_of_healpix_ring(19, 2018901411087); select centre_of_healpix_ring(16, 50083935998); select centre_of_healpix_ring(4, 2755); select centre_of_healpix_ring(11, 9976702); select centre_of_healpix_ring(16, 32927310045); select centre_of_healpix_nest(11, 34556490); select centre_of_healpix_ring(21, 13836070822576); select centre_of_healpix_nest(1, 13); select centre_of_healpix_nest(2, 57); select centre_of_healpix_nest(1, 44); select centre_of_healpix_nest(2, 154); select centre_of_healpix_ring(2, 131); select centre_of_healpix_ring(2, 136); select centre_of_healpix_ring(3, 214); select centre_of_healpix_ring(1, 5); select centre_of_healpix_ring(2, 39); select centre_of_healpix_nest(0, 3); select centre_of_healpix_ring(1, 10); select centre_of_healpix_ring(1, 3); select centre_of_healpix_ring(3, 422); select centre_of_healpix_nest(3, 260); select centre_of_healpix_ring(1, 33); select centre_of_healpix_nest(2, 69); select centre_of_healpix_nest(0, 8); select centre_of_healpix_ring(1, 2); select centre_of_healpix_nest(3, 648); select centre_of_healpix_ring(2, 95); select centre_of_healpix_ring(2, 184); select centre_of_healpix_ring(3, 510); select centre_of_healpix_nest(1, 10); select nside2order(-1); select nside2order(-2); select nside2order(0); select nside2order(-15); select nside2order(3); select nside2order(5); select nside2order(7); select nside2order(9); select nside2order(15); select nside2order(17); select nside2order(31); select nside2order(65); select nside2order(129); select nside2order(255); select nside2order(519); select nside2order(1022); select nside2order(2049); select nside2order(4095); select nside2order(8191); select nside2order(16387); select nside2order(32767); select nside2order(65535); select nside2order(131071); select nside2order(262145); select nside2order(524289); select nside2order(1048546); select nside2order(2093151); select nside2order(4194303); select nside2order(8388609); select nside2order(16777217); select nside2order(33554430); select nside2order(67108860); select nside2order(134217722); select nside2order(268435457); select nside2order(536870911); select order2nside(-1); select order2nside(30); select order2nside(31); select order2nside(-29); select nside2npix(-1); select nside2npix(3); select nside2npix(5); select nside2npix(11); select nside2npix(17); select nside2npix(33); select nside2npix(63); select nside2npix(129); select nside2npix(257); select nside2npix(511); select nside2npix(1023); select nside2npix(2049); select nside2npix(4097); select nside2npix(8191); select nside2npix(16383); select nside2npix(32769); select nside2npix(65535); select nside2npix(131071); select nside2npix(262104); select nside2npix(524208); select nside2npix(1048076); select nside2npix(2097052); select nside2npix(4194301); select nside2npix(8388607); select nside2npix(16777217); select nside2npix(33554431); select nside2npix(67108865); select nside2npix(134217727); select nside2npix(268430456); select nside2npix(536870913); select npix2nside(-12); select npix2nside(49); select npix2nside(-2192); select npix2nside(767); select npix2nside(3071); select npix2nside(12280); select npix2nside(49150); select npix2nside(196607); select npix2nside(786431); select npix2nside(3145723); select npix2nside(12582911); select npix2nside(50331647); select npix2nside(201326591); select npix2nside(805306369); select npix2nside(3221225473); select npix2nside(12884901808); select npix2nside(51539607551); select npix2nside(206158430209); select npix2nside(824633720831); select npix2nside(3298534883327); select npix2nside(13194139533311); select npix2nside(52776558133247); select npix2nside(211106232532991); select npix2nside(844424930131969); select npix2nside(3377699720527873); select npix2nside(13510798882111487); select npix2nside(54043195528445951); select npix2nside(216172782113783807); select npix2nside(864691128455135231); select npix2nside(3458764513820540929); select centre_of_healpix_ring(1, 18471); select centre_of_healpix_nest(6, -0); select centre_of_healpix_ring(6, -1); select centre_of_healpix_nest(6, -49151); select centre_of_healpix_ring(6, 49151); select centre_of_healpix_ring(6, 49152); select centre_of_healpix_nest(6, 49153); -- examples taken from Figure 4 of Healpix article (page 764) select healpix_convert_nest(1, 2, 111); select healpix_convert_nest(1, 2, 91); select healpix_convert_nest(2, 1, 31); select healpix_convert_nest(1, 2, 123); select healpix_convert_ring(1, 2, 123); select healpix_convert_nest(1, 2, 124); select healpix_convert_nest(1, 2, 122); select healpix_convert_ring(1, 2, 122); select healpix_convert_ring(2, 1, 46); select healpix_convert_nest(2, 1, 46); select healpix_convert_ring(2, 1, 42); select nest2ring(1, 11); select nest2ring(1, 19); select nest2ring(2, 87); select nest2ring(2, 177); select nest2ring(2, 0); select ring2nest(1, 21); select ring2nest(1, 3); select ring2nest(1, 17); select ring2nest(2, 117); select ring2nest(2, 103); select ring2nest(2, 186); pgsphere-1.5.1/sql/index.sql000066400000000000000000000060311461140101500157530ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); \set ECHO all -- without idx SELECT count(*) FROM spheretmp1 WHERE p @ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1 WHERE p = spoint '(3.09 , 1.25)' ; SELECT count(*) FROM spheretmp2 WHERE c @ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp2 WHERE c && scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp3 WHERE b && scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp3 WHERE spoint '(3.09 , 1.25)' @ b ; SELECT count(*) FROM spheretmp4 WHERE l @ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp4 WHERE l && scircle '<(1,1),0.3>'; -- create idx CREATE TABLE spheretmp1b AS TABLE spheretmp1; ANALYZE spheretmp1; CREATE INDEX aaaidx ON spheretmp1 USING gist ( p ); CREATE INDEX spoint3_idx ON spheretmp1b USING gist (p spoint3); CREATE INDEX bbbidx ON spheretmp2 USING gist ( c ); CREATE INDEX cccidx ON spheretmp3 USING gist ( b ); CREATE INDEX dddidx ON spheretmp4 USING gist ( l ); --with idx SET enable_seqscan = OFF ; SELECT count(*) FROM spheretmp1 WHERE p @ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1b WHERE p @ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1 WHERE p <@ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1 WHERE p = spoint '(3.09 , 1.25)' ; SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)' ; SELECT count(*) FROM spheretmp2 WHERE c @ scircle '<(1,1),0.3>' ; SELECT count(*) FROM spheretmp2 WHERE c && scircle '<(1,1),0.3>' ; SELECT count(*) FROM spheretmp3 WHERE b && scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp3 WHERE spoint '(3.09 , 1.25)' @ b ; SELECT count(*) FROM spheretmp4 WHERE l @ scircle '<(1,1),0.3>' ; SELECT count(*) FROM spheretmp4 WHERE l && scircle '<(1,1),0.3>' ; -- test spoint3 operator class with and without index-only scan SET enable_bitmapscan = OFF; SET enable_indexonlyscan = ON; EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; SET enable_indexonlyscan = OFF; EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>'; EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)'; -- test hash opclass CREATE TABLE spheretmp1c AS TABLE spheretmp1; SELECT p FROM spheretmp1c WHERE p <@ scircle '<(1,1),0.2>' ORDER BY p::text; WITH points AS (SELECT DISTINCT p FROM spheretmp1c WHERE p <@ scircle '<(1,1),0.2>') SELECT p FROM points ORDER BY p::text; CREATE INDEX spheretmp1c_hash_idx ON spheretmp1c USING hash(p); EXPLAIN (COSTS OFF) SELECT * FROM spheretmp1c WHERE p = '(0.67 , 0.97)'; pgsphere-1.5.1/sql/init.sql000066400000000000000000000000771461140101500156130ustar00rootroot00000000000000-- -- Initialize the extension. -- CREATE EXTENSION pg_sphere; pgsphere-1.5.1/sql/init_extended.sql000066400000000000000000000006101461140101500174640ustar00rootroot00000000000000-- indexed operations..... -- spoint_data and scircle_data tables have to be created and indexed using \! testsuite/gen_point.pl 1 > results/gen_point_1.sql \i results/gen_point_1.sql -- and \! testsuite/gen_circle.pl 1 0.1 > results/gen_circle_1_0.1.sql \i results/gen_circle_1_0.1.sql -- \! testsuite/gen_poly.pl 1 0.1 4 > results/gen_poly_1_0.1_4.sql \i results/gen_poly_1_0.1_4.sql pgsphere-1.5.1/sql/init_test.sql000066400000000000000000000001111461140101500166370ustar00rootroot00000000000000SET client_min_messages TO WARNING; \set ECHO none \i pg_sphere.test.sql pgsphere-1.5.1/sql/knn.sql000066400000000000000000000012521461140101500154320ustar00rootroot00000000000000CREATE TABLE points (id int, p spoint, pos int); INSERT INTO points (id, p) SELECT x, spoint(random()*6.28, (2*random()-1)*1.57) FROM generate_series(1,314159) x; CREATE INDEX i ON points USING gist (p); SET enable_indexscan = true; EXPLAIN (costs off) SELECT p <-> spoint (0.2, 0.3) FROM points ORDER BY 1 LIMIT 100; UPDATE points SET pos = n FROM (SELECT id, row_number() OVER (ORDER BY p <-> spoint (0.2, 0.3)) n FROM points ORDER BY p <-> spoint (0.2, 0.3) LIMIT 100) sel WHERE points.id = sel.id; SET enable_indexscan = false; SELECT pos, row_number() OVER (ORDER BY p <-> spoint (0.2, 0.3)) n FROM points ORDER BY p <-> spoint (0.2, 0.3) LIMIT 100; DROP TABLE points; pgsphere-1.5.1/sql/line.sql000066400000000000000000000060001461140101500155670ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); \set ECHO all SET extra_float_digits TO -3; -- checking spherical line operators SELECT sline ( spoint '(0, 90d)', spoint '(0, -89d)' ) = sline ( spoint '(0, 90d)', spoint '(0, -89d)' ) ; SELECT sline ( spoint '(0, 90d)', spoint '(0, -89d)' ) <> sline ( spoint '(0, -89d)', spoint '(0, 90d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(5d, 5d)', spoint '(5d, -5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, 5d)', spoint '(10d, -5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(15d, 5d)', spoint '(15d, -5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, 0d)', spoint '(10d, -5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(5d, -5d)', spoint '(5d, 5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, -5d)', spoint '(10d, 5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(15d, -5d)', spoint '(15d, 5d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(10d, 0d)' ) # sline ( spoint '(10d, 0d)', spoint '(10d, 5d)' ) ; -- check small lines SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000005d, 0.0000005d)', spoint '(0.0000005d, -0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, 0.0000005d)', spoint '(0.000001d, -0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000015d, 0.0000005d)', spoint '(0.0000015d, -0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, 0d)', spoint '(0.000001d, -0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000005d, -0.0000005d)', spoint '(0.0000005d, 0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, -0.0000005d)', spoint '(0.000001d, 0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.0000015d, -0.0000005d)', spoint '(0.0000015d, 0.0000005d)' ) ; SELECT sline ( spoint '(0, 0d)', spoint '(0.000001d, 0d)' ) # sline ( spoint '(0.000001d, 0d)', spoint '(0.000001d, 0.0000005d)' ) ; -- checking the distance between a line and a point SELECT sline '( 90d, 0d, 0d, XYZ ), 40d ' <-> spoint '( 0d, 90d )'; SELECT sline '( 90d, 0d, 0d, XYZ ), 40d ' <-> spoint '( 0d, 90d )' = spoint '( 0d, 90d )' <-> sline '( 90d, 0d, 0d, XYZ ), 40d '; SELECT sline '( 0d, 0d, 0d, XYZ ), 0d ' <-> spoint '( 0d, 90d )'; SELECT sline '( 0d, 0d, 0d, XYZ ), 0d ' <-> spoint '( 0d, 0d )'; SELECT sline '( 0d, 0d, 0d, XYZ ), 30d ' <-> spoint '( 0d, 30d )'; pgsphere-1.5.1/sql/moc.sql000066400000000000000000000132261461140101500154260ustar00rootroot00000000000000SET client_min_messages = 'notice'; SET extra_float_digits = 0; -- make results compatible with 9.6 .. 11 SELECT smoc(''); -- expected: '0/' SELECT '0/'::smoc; -- expected: '0/' SELECT '29/'::smoc; -- expected: '29/' SELECT '0/0-3,7'::smoc; -- expected: '0/0-3,7' SELECT '0/0,1,2,3,7'::smoc; -- expected: '0/0-3,7' SELECT smoc_info('0/'::smoc); SELECT smoc_info('0/1-2'::smoc); SELECT area('0/'::smoc); SET extra_float_digits = -1; -- last digit deviating on i386 SELECT area('29/1'::smoc); SET extra_float_digits = 0; SELECT area('0/1-3'::smoc); SELECT area('0/0-11'::smoc); SELECT '(0.78, 0.81)'::spoint <@ '7/123-456,10000-20000'::smoc; SELECT '(0.78, 0.81)'::spoint <@ '7/123-456,1000-2000'::smoc; SELECT '0/'::smoc = '1/'::smoc AS eq; SELECT '0/1,3,7'::smoc = '0/1,3,7' AS eq; SELECT '0/1,4,7'::smoc = '0/1,3,7' AS eq; SELECT '0/1,2,3'::smoc <> '0/1-3'::smoc AS neq; SELECT '0/4-6'::smoc && '0/3,7-8'::smoc AS overlap; SELECT '0/4-6'::smoc && '0/3,6-8'::smoc AS overlap; SELECT '0/4-6'::smoc !&& '0/6'::smoc AS not_overlap; SELECT 1 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339,0-1')); SELECT 1 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); SELECT 2 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); SELECT 6 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); SELECT 29 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); SELECT 333 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); SELECT 555 <@ (smoc('29/2-5,20-29,123,444,17-21,33-39,332-339')); SELECT set_smoc_output_type(1); SELECT '29/0-3,7'::smoc; SELECT '29/0,1,2,3,7'::smoc; SELECT '29/3-11,70-88,22-34'::smoc; SELECT '29/5-11,70-88,2-4'::smoc; SELECT '29/11-18,22-27,31-35,42-55,62-69,100-111,15-49'::smoc; SELECT '29/1-3,20-30,7-17'::smoc; SELECT '29/16-32,10-20'::smoc; SELECT '29/1-3,11-14,17-21,40-50,9-33'::smoc; SELECT '29/10-20,16-32'::smoc; SELECT '29/20-30,64-72,89-93,26-100'::smoc; SELECT '29/3-11,20-30,64-72,89-93,26-100'::smoc; SELECT '29/3-11,20-30,64-72,89-93,222-333,26-100'::smoc; SELECT '29/20-30,64-72,89-93,222-333,26-100'::smoc; SELECT smoc(-1); -- expected: error SELECT smoc(15); -- expected: error SELECT smoc(0); -- expected: '0/' SELECT smoc(''); SELECT smoc('abc'); -- expected: error SELECT smoc('-1/'); -- expected: error SELECT smoc('30/'); -- expected: error SELECT smoc('0/'); SELECT smoc('0/0-3,7'); SELECT smoc('0/0,1,2,3,7'); select set_smoc_output_type(0); SELECT ''::smoc; SELECT 'abc'::smoc; -- expected: error SELECT '-1/'::smoc; -- expected: error SELECT '30/'::smoc; -- expected: error SELECT '0/'::smoc; -- expected: '0/' SELECT '0/0-3,7'::smoc; -- expected: '0/0-3,7' SELECT '0/0,1,2,3,7'::smoc; -- expected: '0/0-3,7' select set_smoc_output_type(1); SELECT smoc('2/0,1,2,3,7 4/17,21-33,111'); SELECT smoc('2/0,1,2,3,7 0/17,21-33,111'); SELECT max_order(smoc('')); SELECT max_order(smoc('1/')); SELECT max_order(smoc('1/1')); SELECT max_order(smoc('1/10-3')); SELECT max_order(smoc('1/0-3')); SELECT max_order(smoc('1/0-1')); SELECT max_order(smoc('29/0-1')); SELECT max_order(smoc('29/0-3')); SELECT max_order(smoc('29/0-7')); SELECT max_order(smoc('29/0-15')); select set_smoc_output_type(0); SELECT smoc('29/32-63'); SELECT smoc('29/64-127'); SELECT smoc('0/0-11'); SELECT smoc('0/1-3'); SELECT smoc('0/1'); SELECT smoc('0/3-5'); SELECT smoc('0/3-11'); SELECT smoc('0/0,3-11'); SELECT smoc('1/0,3-42'); SELECT smoc('29/3-42'); SELECT smoc('29/1'); SELECT smoc('28/1'); SELECT smoc('24/1'); SELECT smoc('24/1 29/1'); SELECT smoc('24/1 11/1 29/1'); SELECT smoc('24/1 11/1 29/1,3'); SELECT smoc('24/1 11/1 29/1,3 2/22-33'); SELECT smoc('2/22-33'); SELECT smoc('24/1 11/1 29/1,3 2/22-33'); SELECT smoc(''); SELECT smoc('1/6-7 2/22-23,32-33 11/1 24/1 29/1,3'); SELECT smoc('5/1-127,999-1103'); SELECT smoc('5/1024-1103'); SELECT smoc('28/1101-1103'); SELECT smoc_union('1/1,4-6', '1/3-5 2/8'); SELECT '1/1'::smoc | '1/2' AS union; SELECT sum(moc) FROM (VALUES ('0/1'::smoc), ('0/2'), ('0/4')) sub(moc); SELECT smoc_intersection('1/1,4-6', '1/3-5 2/8'); SELECT '0/1'::smoc & '1/3,5,7,9' AS intersection; SELECT '1/9,11,13,15'::smoc & '0/1,2' AS intersection; SELECT intersection(moc) FROM (VALUES ('0/1-4'::smoc), ('0/2-5'), (NULL)) sub(moc); SELECT smoc_degrade(6, '7/1,3,5,9'); SELECT smoc_degrade(5, '7/1,3,5,9'); SELECT smoc_degrade(0, '1/0'); SELECT smoc_degrade(0, '1/47'); WITH mocs(x) AS (VALUES ('0/'::smoc), ('0/1'), ('0/2'), ('0/4'), ('0/1,3'), ('0/1-3'), ('0/2-4')) SELECT a.x AS a, b.x AS b, a.x = b.x AS "=", a.x <> b.x AS "<>", a.x && b.x AS "&&", a.x <@ b.x AS "<@", a.x !<@ b.x AS "!<@", a.x !@> b.x AS "!@>", a.x @> b.x AS "@>", a.x | b.x AS "|", a.x & b.x AS "&" FROM mocs a, mocs b; SELECT smoc_disc(0, 0, 0, 1); SELECT smoc_disc(1, 0, 0, 1); SELECT smoc_disc(2, 0, 0, 1); SELECT smoc_disc(0, 0, 0, 3.2); SELECT smoc_disc(2, 0, 0, 3.2); SELECT smoc(6, '(0,0)'::spoint); SELECT smoc(1, '<(1,1),1>'::scircle); SELECT smoc(3, '<(0,1.3),.5>'::scircle); SELECT smoc(5, '{(.1,.1), (.2,.1), (.2,.2), (.1, .2)}'::spoly); SELECT smoc(3, '{(.1,.1), (-1,.1), (-1,-1), (.1, -1)}'::spoly); SELECT smoc(3, '{(.1,.1), (.1,-1), (-1,-1), (-1, .1)}'::spoly); CREATE TABLE g (p spoly); INSERT INTO g (p) VALUES (spoly '{(1.48062434277764d , -0.112757492761271d),(1.48062583213677d , -0.0763898467955446d),(1.44427278313068d, -0.0762453395638312d),(1.44413625055362d , -0.112726631135703d)}'); SELECT smoc(6, p) FROM g; -- lswscans/data/part1/Bruceplatten/FITS/B3558b.fits SELECT smoc(6, '{(1.28867804735846 , 0.421769766439468),(1.40564002826964 , 0.201070262502835),(1.27597340819331 , 0.210561432516079),(1.28707379974056 , 0.351693515652388)}'::spoly); pgsphere-1.5.1/sql/moc1.sql000066400000000000000000002442231461140101500155120ustar00rootroot00000000000000CREATE TABLE moc1 ( ivoid text, coverage smoc, ref_system_name text ); INSERT INTO moc1 VALUES ( 'ivo://cds.vizier/j/apjs/241/12', '4/994,2432-2433 5/279,324-325,333,353,381-382,429,485,514,531,541,576,579,604,630-631,662,669,704,716,726,728,757,766-767,778,791,802,817,822,971,974,988,996,1003,1018,1032,1335,1417,1532,1653,1677,1701-1702,1712,1766,1933,1975,2007,2027,2034,2041,2128,2311,2369,2387,2389,2391,2398,2418,2428,2468,2482,2509,2514,2518-2519,2537,2547,2549,2551,2554,2557,2648,2849,2900,2907,2909-2910,2929,2931,2933-2935,2939,2941,2973,2977,2996,3001,3010,3029-3030,3067,3085-3086,3098,3102,3127,3140,3192,3205,3216,3247,3264,3270,3287,3306,3456,3490,3492,3544,3583,3608,3619,3625,3628,3631,3645,3647-3648,3651,3675,3680,3685-3686,3688,3693-3694,3696-3697,3699,3704,3706,3713,3724,3726,3731,3738,3741,3743,3749,3753,3758,3762,3771,3773,3776,3788,3791-3793,3798-3802,3805,3810,3813,3816,3818,3820-3822,3825-3826,3829-3831,3833-3836,3838-3839,3850,3881-3882,3919,3923,3929,3933,3939-3940,3942-3943,3948-3950,3956,3961,3963-3965,3967-3968,3971,3990,4002,4007,4010,4012-4014,4018-4022,4024,4026-4027,4029-4030,4032,4034,4041,4052,4055,4063,4068,4072-4073,4077,4084,4092,4110,4257,4437,4768,4776,4806,4828,5028,5116,5124,5135,5139,5189,5192,5194,5224,5239,5299,5315,5324,5333,5337,5370,5379,5384,5421,5467,5510,5512,5518,5552,5564,5577,5604,5620,5706,5715,5729,5740,5850,5900,5912,5915,5928,5938,5949,5954,6032,6156,6174,6216,6237,6314,6487,6522,6691,6831,6969,7152,7169,7185,7188,7190,7286,7352,7410,7423,7451,7484,7557,7559,7571,7588,7612,7625,7648,7694,7718,7768,7773,7797,7904,7940,7946,7950,8006,8019,8022,8061,8085,8156,8160,8190,8195,8207-8208,8210,8212-8213,8217,8222,8234,8244,8259-8260,8265,8269,8271-8272,8285,8287,8317-8318,8321,8330,8448-8449,8451-8453,8455-8456,8461,8471,8473,8475,8482,8496,8500,8503,8507,8520,8522,8531,8539,8546-8547,8549,8565,8576,8593,9045,9049,9123,9220,9232,9234,9246,9267-9268,9272,9275-9276,9294,9309-9310,9312,9315,9319,9322-9323,9330-9331,9349-9350,9352,9355-9356,9361-9362,9364,9377-9379,9387,9389-9390,9400-9401,9404,9423,9450,9452-9453,9466,9477-9478,9482,9484,9487,9494,9505,9512,9565,9736-9737,9741,9752-9753,9755,9757-9761,9764-9765,9767-9768,9770,9772,9776,9778,9789,9802,9823,9828,9837,9839,9851,9853,9856,9858,9861,9864,9869-9870,9884,9893-9894,9898,9921,9924-9925,9931,9935-9936,9945,9947,9963,9984,9992,9994,10011,10051,10071,10099,10122,10140,10156,10167,10204,10216,10248,10266,10310,10346,10349,10362-10363,10370,10402,10404,10412,10480,10509,10516,10570,10579,10587,10631,10650,10655,10681,10687,10777,10779,10782,10794,10826,10846,10863,10877,10883,10908,10920,10954,10987,11027,11037,11040,11057,11265,11285,11319,11341,11349,11352,11448,11461,11487,11505,11579,11605,11614,11686,11784,11795-11796,11833,11852,11882,11910,11922,11937,11946-11947,11958,12086,12099,12106,12255,12274 6/0,7-8,10-12,14,16,20,22,24,29,31,33,39,41,48-50,54,56-57,60,62,71,73,75,77,79,81,89,93,95,107-108,110,120,129-130,132,134,140,142,145,150,160,192,257,259-260,277,288,491,495,500,506,508-509,511,622,632-634,636,638,653,655,666,668-669,671,678-679,681-684,686,690-692,696-697,703,706,710,713-714,716-717,719-720,722,724-725,727-728,732-733,738,740-741,744,746,750-753,755,757-758,760,766,787,789,794,798,801-802,808,811-812,815-817,823,826-829,831-832,837,843,845-846,848-849,852-853,856,861-863,868,870,872,875,878,881,883-884,886,890,892,895-896,901-902,907-908,912,916-917,919,922,924,929,932,934,936-937,944,946,948,951,953-954,956,958,960,963,965-966,968,971,973,977,979,984,986-988,990,992-993,998-999,1001-1003,1005,1008-1010,1015,1021,1079,1084,1087,1102,1108,1112,1115,1122,1124,1127-1130,1134,1138-1140,1146,1148-1150,1162,1166-1167,1169,1171,1177-1178,1181-1184,1186,1190-1191,1208,1214,1216,1219,1221,1223-1224,1227,1229-1232,1237-1238,1241-1242,1244,1246-1248,1252,1258,1262-1263,1265-1266,1271,1274-1276,1280-1282,1286,1289-1290,1293,1309-1310,1312,1314-1318,1321,1323,1331,1336-1337,1339-1342,1344,1347,1349-1352,1354-1355,1358,1364,1366-1367,1369,1371,1375,1378,1381,1383,1387-1389,1391-1392,1394,1396-1397,1399,1401,1404-1405,1407,1416,1418-1420,1422,1424-1425,1428,1431,1436,1438,1440-1441,1443-1445,1447,1449,1452,1455,1457-1458,1463-1464,1466,1468,1470-1474,1476-1477,1479,1481-1482,1484,1486,1488-1489,1495-1496,1498,1500,1502,1507,1511-1512,1514-1515,1517-1518,1520,1523,1540,1542-1543,1545,1547,1549-1550,1552,1556,1564-1565,1568,1570-1571,1573,1575,1577-1578,1580-1582,1588,1591,1594,1597,1603,1606-1607,1610,1617,1620,1623,1625,1627-1629,1633,1637,1642,1646,1650,1654-1655,1662-1664,1668,1670,1673-1677,1679-1680,1682,1684-1685,1687,1689-1692,1694,1696-1697,1702-1703,1706-1709,1711-1712,1722-1723,1725,1729,1731,1735,1737-1740,1742,1752,1755-1757,1765,1768-1769,1773,1775,1778-1782,1784,1787-1790,1792,1794,1796,1801,1807-1809,1811,1817-1819,1822-1823,1825,1827,1829,1834-1838,1852,1855,1857,1859-1861,1863,1865,1870-1871,1874,1876,1880,1883,1885,1887-1888,1890-1892,1894,1897-1898,1903,1907-1908,1911,1914-1915,1918,1922,1925,1927-1929,1932,1934,1936,1939,1948,1950,1955,1958-1960,1963,1965,1968-1970,1973,1977,1980-1981,1983-1985,2002,2004-2006,2010-2012,2014-2015,2021,2027-2028,2034-2036,2038,2040,2042-2043,2052-2053,2060,2062,2064-2065,2073,2075-2076,2080-2082,2086,2088,2090,2093-2094,2100,2102,2105,2107-2108,2110,2113-2114,2116-2117,2120-2121,2128,2130-2131,2135,2137,2139-2140,2143,2151-2153,2160,2162-2163,2169-2172,2177,2183,2186,2191,2196,2201,2210-2211,2213,2215,2219,2226-2229,2231-2233,2235,2237,2239-2240,2243-2244,2246-2248,2253-2254,2256,2258-2260,2262,2264,2270,2274-2277,2279-2280,2282-2285,2289,2292-2294,2299-2302,2308-2309,2311,2313,2315,2320-2321,2324-2325,2327,2331,2333-2336,2339,2342,2344,2346-2347,2349-2352,2354,2356-2357,2360,2362,2364-2365,2368,2370-2371,2373,2375-2378,2381-2384,2386-2387,2389,2391,2393,2395-2397,2402-2403,2405-2407,2409,2411,2421-2424,2426-2430,2433-2438,2441,2443,2447,2449-2452,2454-2456,2459,2461-2462,2464-2465,2467-2470,2472,2476,2479-2480,2483-2484,2488-2489,2493-2494,2496,2498-2500,2502-2506,2508,2510-2512,2515,2517,2519,2528,2530,2532-2533,2535-2537,2540,2544-2545,2547-2548,2550-2551,2562-2563,2565-2567,2570,2572,2577-2581,2583-2586,2592,2594,2596,2601,2606-2607,2609,2611,2614,2616,2624,2626,2628-2630,2633-2636,2638,2641,2645-2647,2652,2658-2661,2663,2665-2668,2671,2673-2675,2680-2682,2685-2689,2691,2693,2698-2701,2703-2704,2706,2709-2711,2714,2716-2717,2720,2723,2732-2733,2735-2736,2738-2739,2742-2744,2747-2749,2751,2753-2756,2758,2766,2768-2769,2772,2776,2779-2780,2783-2784,2789,2792,2795,2797,2801-2802,2804-2805,2813,2815,2821-2823,2825-2827,2829,2832-2834,2837,2839,2841,2845,2847-2848,2852-2853,2856-2857,2860,2862,2869-2872,2874,2877,2879-2881,2885,2888,2890,2893-2894,2896,2900-2902,2908-2909,2919,2921-2923,2930,2938,2940,2946,2950,2955,2958,2960,2970,2974,2976-2977,2980,2984,2988,2995-2996,2998,3002,3004-3006,3014,3017,3020,3024-3025,3027,3032-3034,3036-3037,3039,3041-3044,3047,3049,3051-3054,3056-3058,3060-3061,3063,3072-3074,3076,3079,3081,3083-3085,3087-3088,3090,3092,3094-3095,3097,3102,3105-3106,3109-3110,3117-3122,3127,3129-3130,3132,3139,3142,3144,3146-3148,3154,3170,3174,3178,3183,3185,3191,3195-3197,3199,3201-3203,3218,3228,3230,3232,3234,3236,3238,3242-3243,3245-3246,3249,3255,3257-3258,3260-3262,3264,3266,3278,3280,3282,3286,3292-3293,3295-3296,3298-3299,3303-3304,3307-3310,3312,3314,3318-3319,3326-3328,3332,3336,3338-3341,3349,3351-3352,3354-3355,3360-3361,3366-3368,3370-3371,3374-3375,3377-3379,3381,3387,3389,3394,3396,3399,3405,3407-3408,3410-3411,3418,3431,3433,3435-3436,3440-3441,3443,3446-3449,3452-3453,3456-3457,3463-3465,3468-3470,3483-3484,3488,3490,3495-3497,3499-3502,3504-3505,3507,3510,3513-3514,3516,3518-3519,3522,3525,3527,3531,3533,3542,3549-3552,3554,3560,3565-3566,3568,3570-3571,3573,3577,3581-3583,3591,3595,3598,3601,3605-3606,3609,3617,3626,3636,3638,3641,3645-3647,3649,3653,3660,3662-3665,3667,3669-3670,3676,3679,3681,3684,3689,3697,3699,3702,3706-3707,3711-3713,3716,3718-3719,3721-3722,3724,3726-3727,3729-3732,3737-3738,3741-3743,3748-3749,3751,3754-3755,3757-3760,3762-3765,3768-3770,3772,3777-3781,3783-3785,3787,3790,3792,3795-3797,3800-3802,3804-3805,3807-3808,3810,3815-3816,3818,3820-3821,3827,3829-3831,3835-3837,3839,3841,3848,3851-3854,3859,3862-3863,3865,3867-3868,3870,3872-3874,3876-3877,3880-3881,3888,3892-3893,3895,3900,3905-3906,3909,3911,3913-3914,3916,3918,3920,3926,3929,3932,3942-3943,3945-3946,3949,3957,3962,3967-3969,3973-3974,3976,3980,3982-3983,3989,3991-3993,3995,3997-3998,4000,4003,4005,4009,4011,4017-4019,4022,4025,4028-4029,4031,4035-4036,4039-4040,4042-4044,4047-4048,4053-4054,4058,4060,4062,4064-4066,4068-4069,4077,4081-4082,4084,4086,4090-4093,4095-4097,4099,4101,4105,4107,4109-4110,4113-4114,4117,4119,4124,4126,4132,4135,4141-4144,4153,4157-4158,4160-4161,4164,4167,4169,4171-4172,4194,4198,4226-4227,4231,4234,4238-4239,4242,4253-4254,4264,4268-4270,4274,4280-4281,4290,4296,4429,4437-4438,4441,4452,4454,4461,4464-4465,4468,4470,4475,4479,4509,4535,4537-4539,4545-4546,4553,4558,4560,4568-4570,4572-4574,4577,4581-4583,4586,4590,4598,4600,4602,4609-4610,4612,4620,4622,4640-4641,4644,4830,4854-4855,4860,4880,4882-4886,4892,4895,4901,4903,4909,4914,4917,4920,4922,4925,4929,4932,4936-4937,4939-4940,4944,4962-4963,4965,4967,4983,4990,4994,4996,5002-5005,5008,5013,5015,5018,5026-5027,5036,5043-5044,5046,5048,5054,5065,5070,5072,5081,5088,5091-5092,5094,5098,5101-5102,5105,5108-5109,5115,5118-5119,5121,5123-5124,5132,5134,5137-5138,5141,5147-5148,5151-5152,5154-5156,5158,5163,5167,5170,5176,5180,5182,5186-5187,5189-5190,5194-5197,5201-5202,5204,5209-5210,5212-5214,5216-5217,5220-5221,5225-5226,5233-5235,5237,5241-5242,5245,5248,5251,5254,5257-5259,5262-5263,5265-5266,5277-5278,5280,5289,5294-5297,5299,5302-5304,5306,5310,5312-5313,5316-5318,5323,5325,5327,5330,5333-5334,5336,5338-5339,5345,5348,5353,5360,5366,5368-5369,5371-5372,5375,5378,5382,5387,5392,5394-5395,5398-5399,5406-5407,5415,5418,5423,5425,5429,5434,5438,5440,5442,5444-5445,5449,5455,5457-5458,5464,5467-5468,5474,5476,5478,5482,5484,5486,5490-5492,5494,5497-5498,5503-5505,5508,5515-5516,5520-5522,5527-5528,5531,5535,5541,5543,5545,5547,5549,5553-5556,5558,5562,5564,5568,5570,5572,5576,5578,5580-5582,5589,5591,5593,5602,5605,5610,5612,5615-5616,5618,5627,5629,5636,5639,5644,5649,5652-5653,5659,5675,5682-5683,5688-5689,5695,5699,5704-5706,5709,5711-5712,5718,5721,5724,5726-5727,5729,5731,5733,5736,5742,5748,5750,5753,5758-5759,5762-5763,5771,5774,5777,5783-5785,5792-5793,5796,5802,5805,5814-5815,5817-5818,5820,5823,5826,5828,5830,5833,5836,5839,5852-5853,5856,5859,5862,5864-5866,5871,5877,5880-5881,5885,5887,5891,5895,5904,5907,5909-5910,5919,5925,5927,5930,5946,5949-5950,5952,5954,5956,5959,5964,5973-5974,5983,5986-5987,5993-5995,6003,6007,6009,6015-6016,6019,6021,6023,6025-6026,6028,6034,6038,6047,6052,6056,6060-6061,6066,6071,6073,6080,6089,6094,6103,6106,6109,6115-6116,6119,6122,6124,6139,6204-6205,6207,6214,6224-6225,6227,6235,6237,6242-6245,6247,6249,6253,6261-6262,6266-6269,6287,6289-6290,6294-6295,6297-6299,6301-6302,6308,6311-6312,6315-6316,6318-6319,6321,6325-6326,6330-6331,6333-6335,6338-6339,6341-6342,6344-6345,6347-6348,6350-6351,6353-6355,6357,6360,6364,6368-6369,6371-6372,6375-6377,6382-6385,6387,6389-6390,6392-6393,6397,6403-6404,6406-6408,6410-6413,6417-6418,6421-6423,6425,6429-6430,6432-6433,6435-6438,6440,6443,6453,6456-6457,6461,6463,6471,6473,6477,6479-6480,6483,6491,6494,6498-6499,6503,6506,6508,6516,6521,6524,6526,6529,6533,6537,6539,6541,6543,6546,6549-6550,6553,6560,6562,6565,6568,6570,6572,6574,6578,6581-6582,6584-6586,6588,6590,6592-6593,6601,6603-6604,6608-6609,6616,6621,6625-6626,6628-6629,6635,6640,6643-6645,6647-6650,6655-6657,6660-6661,6665-6668,6670-6671,6674,6676,6678,6680-6681,6683-6686,6688,6690-6691,6693,6697,6703,6706,6712,6715,6718,6722,6724,6726-6729,6732,6735,6737,6739,6743,6745-6746,6748,6750,6753,6755,6757-6760,6762,6764,6766-6767,6771-6772,6779,6781-6783,6789,6791-6793,6797,6802,6813,6816,6818-6819,6821-6824,6826-6827,6830,6834,6839,6841-6842,6846-6847,6853,6857,6865,6869-6870,6872-6873,6875,6877,6881-6885,6887-6890,6892-6893,6895-6897,6906-6908,6910,6913,6921,6923,6926,6929-6930,6932-6933,6935,6938,6941,6944,6946,6948,6950-6951,6954-6955,6958,6960,6965,6968,6974,6979-6980,6987-6988,6992-6993,6997-6999,7001,7005,7007-7008,7011,7013,7015,7017-7018,7021-7022,7030-7031,7035-7037,7042-7045,7047,7049,7051-7052,7054-7057,7060,7062-7063,7071-7073,7075-7076,7078-7080,7082-7084,7089,7091-7092,7094,7096,7098-7099,7102,7106,7109-7110,7112-7114,7116-7117,7122-7123,7128,7130-7134,7136,7138,7140,7146,7148,7152,7155-7156,7159,7161,7163,7165,7167,7169,7178-7179,7184,7186,7188-7189,7191-7192,7194,7196,7198,7202,7205,7209,7211-7212,7214,7220-7221,7224,7228,7237-7238,7248,7253-7254,7256,7258,7262,7265-7268,7272,7274-7275,7282,7291-7292,7298-7299,7302,7305,7313-7315,7325,7330-7333,7335,7337,7339-7340,7342-7344,7348,7351,7355,7361-7363,7372,7374-7376,7380,7390,7392,7410-7411,7413,7424-7425,7429-7430,7433-7434,7436,7444,7449,7456,7458,7461-7462,7465-7466,7468,7472,7477,7492,7497,7500,7506-7508,7511,7515,7517,7523,7530,7537,7540,7544-7545,7550-7552,7558,7560,7563,7565,7568-7569,7573,7575-7577,7580-7581,7586,7589,7591-7593,7595,7598,7600-7601,7604,7606,7608,7610-7611,7613,7620-7621,7632-7634,7639,7642,7644-7645,7648,7651,7653-7654,7657,7659,7661-7665,7668-7669,7671-7672,7674-7675,7678,7681,7685,7690-7691,7693,7695-7696,7698-7700,7703-7704,7707-7708,7711-7712,7715,7717-7718,7720-7721,7723,7725,7739,7741,7746-7747,7750,7753-7754,7756-7757,7759-7761,7763-7764,7769,7777,7781-7782,7794,7796,7799,7802-7803,7807,7809,7813,7815,7817,7821,7824,7826-7828,7834-7836,7838-7839,7841-7842,7845,7847-7849,7851-7852,7855-7857,7880,7885,7887,7890,7894-7897,7905-7906,7908,7910-7911,7914,7916,7918-7919,7922-7923,7926,7933-7934,7938,7943,7949,7952,7954,7958,7960,7962,7964,7971,7974,7976-7977,7983-7985,7988-7990,7992,7994,8004,8006,8008,8013,8016-8017,8019-8020,8023,8025-8026,8033,8035-8036,8039-8040,8049,8054-8055,8058,8060,8062,8065,8067,8070-8073,8076-8077,8080,8087,8090,8093-8094,8101-8102,8112,8114-8117,8119-8122,8124-8126,8129,8131-8132,8134,8141-8142,8144-8145,8148,8150,8152-8154,8156,8158,8162,8170,8173,8176-8178,8183,8185-8186,8190-8192,8194-8195,8199-8200,8204,8206-8210,8212,8214-8215,8219,8222,8224-8225,8228,8230,8233,8237-8238,8241,8249,8251,8256-8257,8260,8266,8271,8274-8275,8277,8282,8287,8289,8292,8301-8302,8305,8311,8319-8320,8324,8327-8328,8330,8332,8337-8338,8340-8341,8344,8348,8350,8353-8354,8356-8358,8365-8366,8378,8384-8385,8392,8397,8399,8401,8403-8404,8406,8408,8410,8419-8421,8423,8425,8427,8429,8433,8438,8441,8453,8456,8458-8459,8461,8463-8465,8467,8472-8473,8476,8478,8481,8485-8487,8489-8490,8493,8498,8501,8504,8509,8519,8521,8524-8525,8530,8533,8543-8544,8546-8547,8549,8556,8561,8565,8567-8569,8571,8583,8585-8586,8588,8590-8593,8602-8603,8606,8622,8626,8631,8640,8645,8647,8652,8667,8669,8672,8674,8677,8679,8692,8701,8705-8708,8716-8717,8724-8725,8728-8729,8733,8735,8740,8743,8748,8750,8755,8757-8759,8761-8762,8764,8766,8777,8779-8781,8786,8792,8798,8802-8803,8811,8816,8827,8832,8837,8843,8845-8847,8852,8856,8860,8862,8890,8894-8896,8905,8917-8918,8923,8935-8938,8946-8948,8950,8959,8961,8965,8975,8985,8987-8988,8995,9000,9008-9009,9011,9015,9019,9021,9024,9032,9037,9044-9045,9055,9059,9061,9065,9071-9072,9077,9083,9089,9092,9097,9100,9102,9105,9111,9116-9117,9125,9127,9130,9133,9137,9139,9145,9155,9159,9162,9165-9166,9171,9177,9179-9181,9187-9189,9191,9198-9199,9206,9208-9209,9211-9212,9214,9218-9219,9221,9224-9225,9227,9229,9231,9233-9234,9241,9248,9253,9257,9259,9261,9264,9271,9274-9275,9277-9278,9283,9285-9286,9291-9294,9297-9298,9300-9301,9303-9304,9306,9308,9312,9317,9321,9323-9324,9327,9330-9332,9336,9343,9345,9348,9350-9352,9359,9361-9362,9365,9372,9377,9379,9381,9389,9393,9395-9396,9398,9400,9402-9403,9408-9409,9412,9415-9416,9425,9429-9430,9435,9440,9442-9443,9447-9448,9450,9459-9460,9463,9467-9468,9470-9471,9473,9480,9483,9485,9489-9490,9492,9494-9495,9497-9498,9501-9503,9510,9514,9519,9521-9524,9528,9532,9535-9536,9538-9542,9545-9546,9552-9553,9560,9571-9572,9578-9579,9581,9585,9589-9591,9599,9601-9602,9604,9607-9608,9610-9612,9615,9617-9619,9621,9623-9625,9628-9630,9634-9635,9637,9640,9642-9643,9646,9648,9651,9653,9656,9659-9662,9665-9667,9669-9671,9676,9680,9682,9684-9685,9687-9688,9690-9691,9693,9695,9698-9700,9702-9705,9707-9708,9710,9717,9719-9721,9724,9729-9730,9736,9744,9759,9762,9764-9765,9767,9769,9774,9776,9781,9787,9793,9795-9796,9799,9807-9810,9812-9813,9818,9820,9828,9830-9831,9833-9836,9839-9841,9849-9852,9854,9857-9858,9861,9863,9866,9869,9876,9882,9886,9891,9893,9895,9898-9899,9902-9903,9905,9910,9912-9913,9916,9918-9922,9925-9926,9933-9934,9940,9944,9948,9951,9954-9955,9963,9965,9967,9969-9970,9972-9974,9976-9977,9982,9984,9986,9994-9995,10000,10002,10005-10006,10012-10014,10016,10019-10021,10023-10024,10027-10028,10031-10034,10041-10044,10047,10049-10053,10055,10061,10063-10064,10068-10070,10080,10082-10085,10089-10094,10096-10097,10099-10102,10105,10108,10110-10112,10114-10116,10118,10120,10122-10123,10129,10132-10134,10138-10142,10145-10146,10154-10155,10157,10159-10160,10164-10165,10168,10170-10173,10175-10177,10179-10181,10183-10184,10187,10192,10194-10195,10200-10201,10203,10208-10209,10211,10213-10215,10220-10221,10223,10225,10227,10232-10234,10236-10238,10250,10254,10275,10277,10283,10285,10290,10292,10296-10297,10300,10302,10305,10310,10312,10314,10324,10330,10332,10336,10343,10346,10351,10354,10356,10361,10363-10365,10375,10379-10382,10384-10385,10391,10397,10399-10402,10407,10410,10412,10420,10425-10426,10429,10436,10440,10444-10445,10447-10449,10458,10470,10474,10477,10479,10481,10488,10496,10500,10502,10504,10511,10525-10526,10533,10540,10549,10551,10555-10556,10559,10562,10569,10573,10576,10581,10583,10585,10590,10596,10598-10599,10601,10608-10609,10612-10614,10620,10627,10634,10639,10643,10649,10657,10663-10664,10667,10672-10673,10678,10680,10683,10685-10686,10695,10702-10703,10710,10712-10713,10716-10717,10724-10725,10729,10735,10737,10740-10741,10744-10746,10749-10751,10762,10764,10766,10772-10773,10776,10780,10783,10789-10790,10792,10796,10812,10817,10820,10824,10826-10828,10832,10835,10839-10840,10849-10850,10853,10858-10859,10863,10872,10890,10897,10899-10900,10906-10907,10911,10920,10922-10924,10926,10930,10936,10938,10941,10948,10950,10955,10959,10962,10967,10970,10987,11000,11004,11006,11016,11018,11024,11026,11028,11040,11051,11057,11059-11060,11064,11070-11071,11078,11081-11083,11087,11089,11093,11102,11106,11119,11130,11134-11135,11137,11140,11146,11154,11162-11163,11170,11174,11176,11181,11186,11188,11194-11197,11204-11205,11207-11208,11218-11220,11223,11225,11231,11235,11258-11260,11263,11265-11266,11269-11270,11274,11276,11279-11280,11287,11290,11292-11293,11296-11297,11299,11301-11303,11306,11309,11311,11314-11315,11317,11319,11322-11323,11326-11328,11330-11332,11335,11338-11339,11341-11342,11345-11347,11354,11357,11359-11360,11362,11364,11367-11369,11376-11377,11381,11383,11385,11389,11391-11392,11394-11395,11402-11403,11409,11415,11419-11420,11425-11427,11430,11434-11435,11440,11449-11450,11454,11456-11457,11460,11465-11467,11470,11475,11478,11480-11481,11484,11488,11496-11497,11500,11502,11508,11513-11514,11517-11518,11521,11523,11525-11527,11530-11532,11534-11536,11540-11541,11543,11545-11548,11551,11554,11556,11561,11563,11572-11573,11576,11579,11581,11584-11585,11587-11590,11592-11594,11597,11604,11608,11611,11613-11616,11620,11624,11633-11635,11644,11652,11657-11658,11663,11669,11673,11676-11678,11691,11693,11696-11697,11699,11701-11704,11706,11708,11710-11713,11715,11720-11721,11723,11728-11729,11731,11745-11747,11749-11753,11755,11760-11761,11768-11770,11772-11774,11777,11780,11782,11789,11791,11794-11796,11798-11802,11804,11806-11807,11809,11811-11813,11816,11819,11821,11826,11829,11838-11839,11844-11846,11848,11853-11854,11856,11858-11862,11864,11870,11875,11877-11879,11885-11887,11889-11890,11897-11902,11906-11907,11912,11917,11920,11926-11927,11929-11930,11932-11933,11937-11939,11941,11945,11951,11953,11955,11958,11963-11964,11967,11970,11973,11975-11977,11979-11981,11989,11996,11998-12000,12008,12011,12014-12015,12017,12019-12021,12026,12031,12034-12035,12044-12045,12047,12049,12051-12052,12055,12057-12059,12062-12064,12066,12070,12074-12075,12080,12086,12089-12090,12092-12093,12095-12098,12100,12102-12103,12107-12110,12112,12114-12115,12124-12125,12129-12131,12135,12137-12139,12142-12144,12147-12148,12151-12153,12155-12158,12160,12162,12168,12171-12172,12175,12177,12181-12183,12185-12186,12189,12192,12197,12200-12201,12204-12205,12208,12214,12217-12221,12223,12226,12229-12232,12234,12236-12238,12242-12246,12253-12255,12257,12259-12260,12264,12266,12274-12275,12280,12282-12283,12285,12289,12294,12296,12299-12300,12303-12304,12309,12312-12314,12317-12318,12321,12323,12326,12329-12331,12335-12337,12339,12348-12349,12353,12359,12362-12363,12365,12368-12369,12377,12380,12384,12390-12391,12397,12399-12401,12404,12406,12412,12414-12415,12418-12419,12421,12423-12425,12427-12428,12434-12436,12439-12440,12442,12445,12449-12451,12453-12454,12456-12457,12460,12464-12466,12470-12471,12473,12476-12477,12481-12483,12487-12488,12492,12494-12495,12497-12498,12501,12503,12507,12512,12516-12518,12521,12523-12524,12526,12528-12529,12531,12533,12537,12539,12541,12545,12548,12550-12554,12556,12558,12564,12567,12569,12575,12578,12584,12586,12594-12595,12597-12599,12602-12603,12606-12608,12610,12613,12615-12616,12619-12620,12625-12627,12629,12634,12637,12639,12642,12644-12646,12649,12652-12654,12660-12661,12664,12666,12668-12670,12673,12675,12678-12682,12684,12686-12687,12690-12691,12693,12695,12697,12699,12701-12703,12705,12707,12709-12710,12713-12717,12721,12723-12725,12727,12729,12731-12732,12735,12740,12742-12743,12745,12754,12756,12759,12761-12764,12766,12773,12776,12778,12781,12784-12785,12787,12789,12792,12795-12796,12798,12800-12801,12803,12806,12808,12810,12812-12813,12815-12816,12824,12827-12828,12830,12832,12834,12837,12840-12841,12846,12848,12850,12853-12855,12860,12868,12872-12874,12878-12881,12883,12886-12887,12890-12893,12899-12900,12902-12903,12905,12907,12909-12914,12916,12918-12921,12923-12924,12926,12928-12930,12934-12935,12938-12939,12946,12948,12951,12954,12964,12968-12969,12973,12975-12977,12979,12981-12983,12992,12996,12999-13000,13008-13009,13013-13014,13018-13020,13023,13025-13027,13031-13032,13034,13036-13038,13041-13046,13049-13050,13052,13054,13061-13062,13065,13067-13070,13074,13078-13079,13085-13087,13090,13092,13094,13098-13101,13105-13107,13109-13111,13118-13120,13122,13126-13127,13129,13131,13134-13136,13138,13140-13141,13143,13145-13146,13153,13157-13158,13160-13162,13165-13166,13168-13170,13172-13173,13175,13177,13179,13181,13184,13187,13191,13196,13198-13200,13206,13208,13212-13213,13216-13218,13220,13223,13229,13235-13237,13243,13246,13248,13251,13257,13260,13264-13265,13267,13269-13270,13274-13276,13284,13286-13290,13297-13298,13300-13301,13303,13305,13308,13310-13314,13316,13319-13320,13324-13325,13328,13330-13331,13334,13338,13342,13345-13347,13350,13352-13353,13365,13372,13383,13386,13390,13405,13408,13417,13421,13423,13438-13440,13442-13443,13445,13447,13449-13450,13453,13455,13459,13465-13466,13469,13474-13475,13478-13479,13481,13483-13484,13486-13487,13495-13496,13498,13505,13508,13515,13517,13522,13526,13535,13538-13539,13541,13545,13550,13552,13554,13557-13558,13562,13565,13567,13571,13573,13576,13581,13583-13585,13590,13593,13598-13599,13602-13603,13605,13607-13608,13611,13614-13615,13620,13624-13626,13633-13634,13636,13639,13645,13647,13649,13652-13654,13658-13659,13661-13662,13667,13670,13672-13673,13675,13678,13680,13683,13688,13697-13698,13706,13710,13713,13715,13719,13722,13725,13727,13730,13736,13741-13743,13749-13750,13755,13762,13765,13768,13770,13773,13776,13785,13787,13794-13795,13799-13800,13805-13806,13808,13811,13814-13817,13823,13828,13832,13836,13840,13843,13849-13851,13853,13855,13857-13858,13862,13864,13870-13872,13877,13881,13883-13885,13887,13892,13895,13898,13904-13906,13910,13925-13927,13929-13930,13936,13942,13947,13953,13955,13958,13966-13967,13973-13976,13978,13984,13986-13988,13990-13991,13995,14003-14004,14006-14009,14013,14015-14016,14019-14020,14029-14031,14039-14041,14045,14052,14063,14073,14078,14086,14089,14092,14097,14104,14107,14109-14112,14118-14119,14122,14124-14125,14131,14134-14135,14138-14139,14141-14144,14146,14149,14151,14155,14159-14160,14162,14165-14166,14169,14172-14174,14180-14181,14183,14185-14187,14192,14194,14196,14198,14201,14203-14206,14213,14221,14227,14229-14231,14233-14234,14237,14239,14243-14245,14250,14254,14256,14259-14261,14263,14265-14268,14271-14272,14274-14275,14280,14282,14286-14287,14289,14292-14294,14297-14299,14301-14305,14308,14311,14316,14318,14320,14323,14329,14339,14346,14348-14349,14351,14353,14356,14358-14359,14361-14362,14367-14368,14370-14372,14375-14377,14379,14382-14385,14387,14390,14392-14393,14396,14400-14401,14403-14404,14406,14408-14409,14412,14416-14417,14419-14421,14427,14431,14437,14439-14440,14445-14450,14453-14457,14459,14461,14463-14464,14468-14470,14472,14475,14481-14483,14488,14491-14492,14494,14496-14497,14499,14504,14508,14516,14518,14521-14522,14528-14529,14531-14533,14535-14538,14542,14545-14547,14549-14554,14557-14560,14562,14565-14566,14568,14570,14572-14573,14576,14579,14585-14587,14596-14597,14599,14602,14608,14611-14612,14614,14617-14621,14624,14626-14630,14632,14634-14637,14639,14641-14642,14645,14648-14650,14652,14654-14655,14657,14662,14666-14668,14670,14674,14678,14682,14684-14685,14688-14690,14692,14694,14698-14699,14704,14706,14711,14714-14715,14718,14725-14728,14731,14734-14735,14739,14748-14750,14756-14757,14759-14760,14762-14763,14766-14768,14770,14780,14782,14793-14795,14800,14802,14806-14809,14812-14813,14815,14821-14822,14829-14833,14835,14837-14840,14842-14843,14845-14846,14849,14851,14856-14857,14859-14862,14865,14867,14871,14873,14875-14878,14883-14884,14887-14889,14893,14895,14901,14903,14909-14912,14915-14916,14918-14920,14922-14923,14928,14930-14931,14933,14935-14937,14939-14940,14942,14946-14948,14950-14951,14957-14959,14961-14963,14968-14970,14976-14977,14979-14982,14984-14986,14990,14992,14994,15001-15004,15007-15009,15011,15016,15019-15021,15023,15025-15030,15036,15039-15041,15044,15046-15047,15052,15054,15058-15059,15062,15064-15065,15068,15070-15073,15075-15078,15080,15082,15089,15091,15096,15098,15101-15103,15108,15110-15114,15117-15119,15121-15124,15126-15128,15130-15133,15135-15136,15138-15139,15141-15145,15147-15148,15151,15156-15158,15161-15162,15176-15178,15181-15183,15185-15187,15189,15212-15213,15215-15218,15225-15227,15230-15231,15233-15235,15237,15245-15246,15248-15250,15256,15258-15260,15263,15271,15276,15278-15279,15292-15293,15296,15298-15299,15309,15311-15312,15314-15315,15328-15330,15348-15349,15351,15360,15363-15364,15367,15369,15372,15374-15375,15378-15379,15383-15384,15387,15396-15397,15404,15407,15409,15411,15416-15418,15433-15434,15438,15445,15448,15450,15452,15457,15466,15468,15482-15483,15485-15487,15489,15492-15494,15496,15498,15500,15502-15506,15513-15514,15519-15522,15533-15536,15549,15551,15554-15555,15557,15560,15562-15563,15574-15575,15578,15585,15593-15595,15598,15600,15604,15606-15607,15614,15616-15617,15619-15620,15622,15630-15631,15633-15636,15638-15642,15646,15649,15652-15653,15659-15661,15665-15670,15672-15674,15683,15685,15687,15691,15698-15699,15705-15710,15713,15715,15720-15722,15726-15729,15731,15736-15738,15745,15747-15749,15751,15754-15755,15764,15766-15767,15777-15779,15781,15785-15786,15789,15805,15807-15808,15811-15812,15815-15817,15819,15821-15823,15829-15830,15833,15835-15836,15838-15839,15841,15848-15849,15851,15864-15866,15876-15878,15881-15883,15888,15890,15892,15894,15920,15923-15924,15931,15934,15936,15938-15940,15944,15950-15951,15954-15956,15958,15964,15971-15972,15975-15976,15979,15981-15982,15984-15986,15988-15990,15993-15994,15997-16000,16002-16006,16012-16013,16015-16017,16027,16032,16034-16035,16044,16046-16047,16060,16062-16063,16066-16067,16070,16092-16093,16095,16100-16102,16112-16114,16124,16132-16134,16141,16144,16148,16152-16154,16160,16162-16163,16168,16170-16173,16175,16177,16179-16180,16182-16183,16185,16188-16189,16191-16194,16200,16202,16205,16212,16214-16215,16217,16219,16224,16226-16227,16229,16232,16234-16237,16239,16241-16244,16247,16251,16256,16259-16261,16264-16266,16268,16270,16279-16281,16285-16287,16296,16298-16300,16302-16305,16307,16312,16314-16315,16317-16322,16324-16326,16331,16334-16335,16341-16342,16344,16346-16347,16349-16353,16356-16358,16361-16362,16365,16372,16376-16378,16380,16382-16383,16385-16386,16391-16392,16395-16396,16398-16399,16402,16410,16412,16414-16415,16417,16422-16423,16428,16433,16444,16446,16450,16452-16453,16459,16469,16475,16482,16484-16485,16494,16497,16511-16513,16516,16519-16520,16522,16524,16527,16531-16532,16536-16537,16544-16546,16548,16552-16554,16557,16560-16561,16565,16569-16570,16572,16574,16581-16582,16588,16592,16599,16601,16604,16606,16609-16611,16617-16619,16624,16626-16627,16629,16631,16634-16635,16639,16641,16644,16650,16665,16678-16682,16685,16695,16697-16698,16718-16719,16726,16749,16751-16752,16757,16763,16769,16771-16772,16776,16779,16781-16784,16788,16790-16792,16794,16797-16798,16801,16807,16810,16814,16818,16823-16824,16826,16830,16837,16842,16844,16849,16857,16859,16862-16863,16865,16871-16873,16880,16883,16891-16892,16897-16898,16904,16908,16917-16920,16922,16924-16926,16929-16930,16937,16940,16943,16945-16947,16949,16953,16955-16957,16960-16961,16964,16970-16973,16982,16987,16996,16998-16999,17003-17004,17011,17016,17018,17020,17023-17024,17035-17037,17045-17046,17051-17053,17056,17061-17062,17065-17066,17068,17072,17075,17079-17081,17083-17084,17089-17091,17095,17098-17099,17102,17106-17107,17114-17115,17121-17122,17130,17137,17144,17161,17163-17164,17171,17174,17177-17178,17184,17188,17193,17196-17198,17200-17201,17206,17208,17211-17212,17215,17217,17222-17223,17225,17229-17230,17237,17243,17248,17260,17270,17272,17276,17280,17290,17296-17297,17301,17316,17328,17349,17360,17410-17412,17417,17419,17421,17426-17427,17437,17439,17441,17443,17447,17451,17456,17458,17462,17465-17466,17468,17472,17477-17478,17482,17486-17487,17490-17492,17496,17502,17504-17506,17513,17518,17531,17533-17534,17543,17545,17551-17552,17555-17556,17576,17578-17579,17582-17584,17588-17589,17601,17605-17606,17611,17631,17635,17638,17640-17642,17645,17650,17654-17655,17657-17658,17664,17666-17667,17669,17671,17677,17679,17682,17686-17687,17689,17691-17692,17695,17698,17702-17704,17707-17708,17710,17720-17721,17723-17725,17730,17735,17737-17740,17743-17745,17752,17754,17759,17761,17768,17770,17773,17775,17780,17785,17790,17792-17793,17796-17797,17802,17804,17808,17810,17813,17817,17820,17822,17827,17832,17838-17840,17844,17847,17852,17859-17862,17864,17866,17869,17872,17878,17881,17883,17888-17890,17893,17895,17900,17909,17912-17913,17925,17928,17931-17933,17938,17944,17948,17953,17962-17965,17970,17991,17994,17996,17998,18002,18004-18006,18009,18017,18178-18179,18192-18193,18196,18413-18414,18421-18422,18425,18427-18428,18434-18436,18438,18441,18449-18450,18452-18453,18670,18679,18682,18685,18687,18843-18844,18847,18849,18851-18852,18856,18860,18862,18868,18870,18877,18887,18889,18891,18894,18898,18907,18909,18912,18914,18923-18924,18927-18928,18932,18957,18959,18963-18966,18973-18975,18985-18986,18988,18990-18992,18996,19001-19002,19006,19012,19016,19021-19022,19024-19025,19027,19030,19032,19034,19036,19041,19043,19048-19049,19053,19056,19059,19063,19070-19071,19079,19081,19084-19085,19090,19092-19093,19096,19100-19101,19111,19114-19115,19117,19120-19121,19123,19125,19129-19130,19133,19135,19137-19139,19144,19146,19148,19153,19155,19157-19158,19160,19162,19164-19166,19168,19172,19174-19175,19178-19179,19181,19184-19185,19188-19189,19193,19195,19200-19201,19203,19205,19213,19215-19216,19219-19220,19229-19230,19235-19237,19241,19244-19245,19250-19251,19256-19257,19260,19262,19268,19272,19275-19277,19282-19283,19288,19294-19295,19309-19310,19316-19317,19320,19322-19323,19332,19336-19337,19339-19342,19345,19348-19350,19354-19355,19357,19362-19363,19367-19368,19371-19372,19374,19376-19378,19380-19382,19385-19386,19388,19390-19393,19396-19397,19399-19401,19406-19407,19410-19413,19417,19419-19420,19431,19434-19435,19438-19439,19443,19445,19448,19451-19454,19497,19507,19511,19517,19547,19556,19563,19566-19567,19569-19570,19578,19585-19586,19589,19592,19596,19599-19600,19619,19622,19626,19634,19641,19661-19662,19673-19675,19687,19699-19700,19702-19703,19724,19726-19728,19733,19736,19741-19742,19745-19747,19750,19755,19759-19760,19764,19766-19767,19770,19777-19778,19785,19788,19791,19793,19796-19797,19799,19805-19808,19813,19816-19817,19820,19826,19830,19833,19837,19840,19842-19843,19847-19849,19851,19853-19854,19858-19859,19863,19867,19872-19873,19878,19881-19882,19899,19901,19905,19907-19908,19912-19914,19917,19919,19922-19924,19926-19927,19929,19933-19934,19942-19943,19945,19947,19950,19954,19957,19961-19962,19965,19976,19979-19980,19983,19985-19986,19989,19993-19994,19998,20005,20008-20009,20015,20022-20023,20025,20033,20039,20043,20047-20048,20054,20056,20059,20067,20078-20079,20082,20093-20094,20104,20108,20110,20118,20120,20124-20125,20128-20129,20134,20137,20140,20142,20145,20149,20152,20162,20186,20188,20190,20198-20200,20206,20212,20214,20219,20221,20223,20225,20228,20231-20234,20236-20237,20239,20242,20244,20253-20254,20257,20264,20268-20269,20273,20275,20279,20285-20286,20290-20291,20293-20296,20298-20300,20307-20309,20313,20319-20321,20323,20325,20330-20331,20335-20336,20338-20340,20342,20345,20347,20351,20358,20365,20370,20372-20373,20382,20386,20389,20391-20392,20397,20399-20400,20409,20413,20416,20418,20422-20424,20428,20431,20434,20440,20442,20445-20447,20449-20450,20454,20459,20461,20468-20469,20472,20476,20481-20486,20489,20495,20501,20505-20507,20509-20510,20512-20513,20516,20518,20522-20524,20528,20530,20534-20536,20546-20548,20550-20554,20561-20563,20570-20572,20574,20576,20579-20581,20583-20584,20586,20588-20589,20591,20593,20597,20601,20603-20605,20607-20608,20613-20614,20616-20617,20621-20622,20625-20627,20629,20631,20641,20643-20644,20646,20648,20650,20652,20657,20659,20661,20665-20666,20673-20674,20688,20690-20691,20693,20696,20701,20703,20711,20713,20716,20726-20727,20732,20735-20736,20742,20744,20746-20748,20750,20753,20755,20760,20764,20766-20767,20772,20775,20783,20786,20792-20793,20798,20802,20804-20805,20807,20816-20817,20819-20820,20823-20824,20826-20828,20831,20835,20838,20840,20842,20844,20849,20851,20856,20864,20867,20869,20872,20874,20880,20887,20891,20893-20894,20903,20912-20913,20915-20916,20920,20922,20926,20934,20939,20942,20947,20950,20953-20955,20960,20962-20963,20966,20975,20977-20978,20981-20984,20988-20989,20994-20995,20997,21001,21003,21005,21010,21019,21023,21025,21027-21029,21039,21046,21048,21055,21058,21060,21062,21073-21077,21080-21082,21086-21087,21089,21091,21094-21095,21097,21099,21101-21102,21106-21107,21109,21115,21118-21119,21121,21128,21131-21133,21141-21142,21144,21151,21153,21157,21159-21160,21162-21163,21165,21168,21170-21171,21174-21176,21179,21182,21185-21186,21190,21194,21200,21205-21206,21212-21214,21219,21221-21222,21225-21229,21232,21235,21240-21241,21246-21247,21250,21253,21256,21265-21266,21270,21275,21278-21279,21281-21283,21285-21286,21288-21289,21294-21295,21302,21311-21312,21314-21316,21319,21323,21325,21327-21329,21331,21338,21342,21344-21346,21352,21354,21357,21359,21361-21363,21366,21369-21371,21373-21375,21377,21379,21381,21384,21391,21393,21395-21396,21398,21400-21401,21403-21406,21409-21410,21413-21418,21420-21421,21424,21426,21430-21431,21434-21435,21438,21441,21443-21445,21447-21448,21451-21454,21458-21459,21461-21465,21469,21471,21476,21479,21489-21491,21494,21496-21498,21501-21503,21505,21507-21508,21510-21511,21513-21515,21520,21522,21524,21526,21531,21540,21542-21543,21547-21548,21552,21556,21559,21564,21566,21568-21569,21571,21574-21575,21577-21578,21580-21581,21587-21588,21591,21600,21603,21614-21615,21618,21620-21621,21623,21625-21627,21631,21634-21635,21637-21638,21641-21644,21646,21648,21650,21652-21654,21656-21657,21661-21665,21668,21670-21671,21673,21677,21681,21690,21693-21694,21696,21699-21700,21702,21704-21705,21708-21709,21712-21714,21717,21719,21721,21724-21725,21728-21729,21731-21732,21735-21737,21740,21743-21744,21746-21747,21749-21750,21752,21754-21756,21758-21761,21763,21765,21767,21769,21771-21772,21775-21778,21780-21781,21784-21785,21789-21790,21797,21803,21809,21811-21813,21815,21818,21825,21827-21830,21834-21836,21841,21843,21847-21848,21851-21852,21860,21863-21866,21872-21873,21875,21882,21884,21887,21890,21893-21894,21900,21904,21906,21908-21909,21920,21924,21929,21931,21937,21939,21941-21943,21952,21955,21957-21959,21961,21964,21969,21977-21978,21982,21987,21989-21991,21998,22006-22007,22010-22011,22014,22017-22022,22024,22026,22029,22031-22032,22035,22037,22039,22045-22047,22052,22054-22055,22057,22059,22062-22066,22069,22076-22077,22081,22083-22084,22088,22090,22093-22094,22098,22100,22105-22106,22110,22113-22114,22116,22118-22119,22121-22122,22125-22128,22131-22132,22134,22136-22138,22142,22145-22146,22148,22150-22153,22155-22157,22159-22162,22165-22168,22170,22172,22175-22178,22180,22182,22184-22185,22189-22190,22193,22197-22200,22202-22206,22214-22215,22217-22219,22221-22222,22224-22225,22231,22235-22236,22238-22240,22242-22245,22248-22249,22252-22253,22260,22262-22264,22268-22269,22271-22272,22278,22280,22285,22287,22289,22293-22294,22296,22300,22302-22303,22307,22312-22314,22316-22318,22323-22324,22326-22330,22332,22336,22339-22340,22346-22347,22349,22354-22355,22358,22367,22369-22374,22376,22381,22383,22385,22388,22391,22397,22400-22402,22404,22406,22409,22412,22415,22422-22423,22425,22427-22429,22432,22434-22436,22439-22442,22444,22446-22448,22452-22453,22455-22456,22458,22461,22463-22465,22470,22474,22476-22477,22479,22484,22486,22490,22498-22500,22502-22503,22505-22507,22510,22529-22530,22537,22542-22543,22546,22550,22558-22559,22576,22590-22591,22594,22601,22605-22606,22608-22609,22618,22625-22627,22636,22639-22642,22649-22651,22654-22655,22660,22662-22663,22665,22667,22669,22671,22678,22683,22685,22687,22689,22691,22696,22702,22704,22706-22707,22714,22716-22717,22722,22730-22731,22736,22741,22743,22746,22748,22755,22757-22758,22762,22773,22775,22778-22780,22785-22788,22793-22794,22796,22799-22800,22803,22807,22809-22810,22812-22813,22815-22816,22819-22820,22822-22823,22828-22829,22831,22834-22835,22838,22840-22842,22844-22845,22847-22849,22851,22854,22856-22858,22864,22867,22869,22874-22875,22878-22879,22882,22887-22888,22892,22894-22895,22900,22902-22903,22909,22915,22920-22922,22925-22929,22932-22933,22935,22937-22938,22941,22946-22949,22953-22955,22958,22965-22966,22969-22970,22972,22976-22977,22980,22982,22984,22986-22989,22991-22992,22995,22998-22999,23001-23004,23006,23008,23014,23017-23018,23021,23024,23027,23029-23030,23035-23037,23039,23041,23048,23052,23054,23061,23065-23066,23070,23073,23076-23077,23080-23081,23084,23086,23093-23095,23097,23099,23105-23106,23113,23118-23120,23124,23126,23129,23132,23139-23141,23145,23147,23150,23155,23159,23161,23165,23168,23172-23174,23182-23183,23190-23192,23198,23201,23203,23205,23213-23214,23221,23223,23226,23228,23236-23237,23242,23244,23247,23261,23268,23270-23271,23273,23275-23276,23278,23281-23283,23287,23294,23301,23304,23306,23310,23312-23314,23318,23321-23322,23325-23327,23331,23338-23339,23342,23344,23351,23356-23357,23360-23361,23365,23367,23369,23372,23375,23377-23379,23382-23383,23387,23389,23391,23393-23396,23398,23408,23410,23413-23414,23417-23418,23423-23425,23431,23435,23441,23443,23445-23446,23455,23463-23464,23469-23470,23472,23478-23479,23485-23487,23491,23494,23496,23500-23501,23503,23505-23506,23508,23511,23514-23515,23517-23518,23520,23522,23525-23526,23530,23536,23553,23555-23557,23562-23563,23572-23573,23575,23586,23588,23592-23593,23604,23606,23608,23613-23618,23620,23623,23625,23627,23629-23632,23635,23639-23640,23643-23644,23646-23647,23655-23656,23664-23666,23668,23670,23674-23675,23677-23682,23684,23686,23691-23694,23696-23698,23701,23705-23707,23709-23711,23716,23718,23720,23722,23726,23728,23731-23732,23734,23738,23740,23744,23746-23749,23751,23757-23759,23761,23765-23766,23768,23770-23771,23775,23780-23781,23784-23785,23789-23790,23792-23794,23800,23808,23812,23814,23820-23821,23824,23826-23827,23829-23832,23834,23837,23840-23841,23843,23847,23849,23852-23853,23855-23856,23858,23862,23865-23866,23873-23874,23936-23938,23940-23942,23945-23946,24064-24065,24067-24069,24071-24072,24075,24080,24083,24086,24089-24090,24093-24097,24099-24100,24102,24105,24108,24113,24120-24122,24133-24134,24138,24193,24196,24405,24409-24410,24412,24414-24415,24421,24423-24424,24428-24430,24432-24433,24438-24439,24442,24447,24467,24469,24476-24478,24484,24487,24490,24494-24495,24502-24503,24506,24508-24510,24512-24514,24516,24518-24519,24521,24523,24526,24528,24530,24532,24534-24536,24543,24545,24547-24548,24550-24553,24556,24558-24559,24562,24568-24570,24574-24576,24579,24582-24584,24587,24591,24594,24596,24602-24604,24612,24617-24618,24620,24628-24629,24633-24635,24638-24639,24642,24645,24650-24651,24653-24654,24656,24658,24661-24662,24666,24669,24675,24681,24685,24689-24690,24700-24701,24707-24708,24711,24714,24719,24721,24727,24730-24732,24735,24737,24742-24744,24747,24751,24754,24763,24768,24773-24774,24793,24795,24797-24798,24807,24810,24813,24815,24818,24820,24825-24826,24828,24834-24835,24838,24841-24842,24845,24847-24848,24852,24854,24869-24870,24872-24874,24886,24888-24890,24893,24895-24897,24900-24901,24904-24906,24908,24910,24913,24923-24925,24927,24929,24932,24934-24936,24938,24940,24942-24944,24946-24947,24953,24964,24974-24977,24981-24982,24986,24989,24991,24993,24995,25001,25006-25009,25011-25012,25020,25023-25025,25030,25034,25036,25039,25043,25050,25052,25056,25058,25063-25064,25068,25074,25078,25082,25091,25096,25098,25120,25123,25133,25135,25142-25143,25159,25163,25172,25174,25183-25184,25186,25193,25198,25203,25209-25211,25215-25218,25222,25227,25229,25231-25232,25235,25237,25241,25248,25250,25253-25255,25262-25264,25269,25271-25273,25278-25279,25285,25291,25295,25307,25309,25311,25314,25318,25321,25326,25328,25331,25334,25336,25339-25340,25348,25359-25360,25365,25370,25372-25373,25375,25377-25378,25384,25394,25397-25398,25401-25402,25404-25405,25410,25415,25442,25445-25447,25452-25454,25473,25475,25482,25490-25491,25499,25505,25513,25515,25518-25519,25523,25526,25528,25531,25534,25537-25539,25546,25548,25571,25600-25601,25604,25610,25634,25813,25844,25851,25853,25860,25869-25871,25874,25878-25879,25882,25892-25893,25896,25902,25907,25913-25914,25919,25924,25929,25931,25934,25940,25943-25944,25952,25954,25957,25962,25965,25971-25972,25974-25975,25980-25982,25985,25996,26000-26001,26003,26009,26014,26024,26030-26031,26033,26036,26050-26051,26053,26060-26061,26063,26066,26068-26069,26071,26077,26082,26084,26092,26095,26097-26098,26101,26106,26110,26191,26197,26200,26204,26221,26224,26227,26229-26231,26309-26311,26317,26325,26334,26337,26345-26347,26350-26351,26357,26364,26366,26371,26378,26386,26389-26391,26398,26402,26412,26416,26420,26423,26427,26437-26438,26440-26441,26443,26445,26449,26451,26455,26465,26468-26469,26471,26477,26480-26482,26486-26487,26489,26491-26494,26499,26501,26504,26510,26521,26526,26529,26532,26538,26543,26546,26575-26576,26581-26583,26586-26587,26589,26597,26599-26600,26604,26615,26617,26619,26627-26628,26630-26631,26638,26644-26645,26648,26651,26656-26657,26660,26668-26669,26671,26674-26676,26678-26679,26692,26696,26700-26701,26704,26707,26716,26718,26723,26727-26729,26734,26739,26742-26743,26745,26749,26753-26754,26758-26759,26769-26770,26773-26774,26778-26782,26784-26786,26788,26791-26793,26795-26797,26802-26803,26806,26810-26811,26813,26817,26821-26822,26832,26834,26839,26843-26844,26851,26854,26857-26858,26862,26864,26866,26870,26873,26876-26877,26891,26893,26898,26901,26912,26914,26921,26934,26938,27008-27009,27014,27019,27021-27022,27032,27040-27041,27043,27045,27047-27048,27056,27136-27137,27140,27143-27144,27150,27155,27159-27160,27165-27166,27170-27172,27176,27178-27179,27182,27185,27187,27192,27195-27197,27201-27202,27205,27207-27210,27214,27216,27219,27222,27224,27227,27233,27236-27237,27242-27243,27246-27247,27249,27251,27253,27255,27259,27262,27265,27267-27268,27270-27272,27279,27281,27286,27288,27290,27292-27294,27296,27298-27299,27301-27306,27312-27313,27315,27318-27321,27329,27332,27337,27345-27348,27350,27352-27353,27356,27361-27363,27365,27375,27378,27380,27384,27386,27396,27403,27424,27434,27605,27614-27615,27641-27643,27647,27670,27676,27678,27709,27714-27715,27720,27729,27732,27734,27737,27741,27749,27755,27764,27766,27775,27793,27796,27799,27802-27803,27807,27813-27814,27821-27824,27827,27833,27838,27842,27846,27850,27853,27856,27858,27861,27863,27865,27867,27874,27882-27886,27892,27895-27896,27898,27900,27902,27911,27915,27920,27922,27929,27931,27935,27937,27943-27944,27948,27951-27952,27955,27958-27960,27964,27967-27969,27973,27978,27980,27984-27985,27991-27992,28001,28008-28010,28013,28016-28017,28019,28021,28023,28025-28026,28030,28041,28046,28048,28052-28054,28059,28061,28063,28076,28078,28085,28089,28093,28111,28116,28129-28130,28136,28140,28146,28152-28153,28159,28164,28166,28172,28174,28177-28179,28187,28189-28191,28193-28194,28199,28202,28207-28208,28210,28212,28214-28215,28218,28223,28233-28234,28237,28241-28243,28247-28248,28252-28253,28255,28258,28269-28272,28278,28281,28285,28289,28291-28292,28294,28301,28306,28312-28313,28316,28321-28322,28330-28332,28336-28337,28341,28348-28350,28352,28360,28362,28372,28374,28378,28380-28381,28384,28386,28392-28393,28395,28397,28401,28405,28409,28411,28423,28425,28430,28433-28434,28439-28440,28448,28450-28451,28453,28457-28458,28470-28472,28478-28480,28482,28492,28494,28496-28497,28502,28504,28511,28513-28514,28517,28519,28531,28533,28538,28544-28545,28549,28555-28558,28560,28567-28570,28579-28580,28582,28585,28593-28595,28598,28601,28603,28605,28614,28618,28625,28630,28635,28643,28645,28647,28650,28652-28653,28657,28659,28666,28670,28672,28675,28684,28686,28688,28690,28692-28694,28697-28699,28701,28703,28706,28708,28710,28714-28716,28719,28725,28730-28733,28738,28744,28746-28747,28749,28759,28769-28770,28773-28774,28776,28800-28801,28803,28812-28813,28815-28816,28819,28824,28838,28841-28843,29051,29054-29055,29113-29114,29118,29127,29131,29135-29136,29142-29143,29148,29156-29157,29159,29163,29167-29168,29172,29174,29176,29178-29179,29184,29299,29301,29308-29309,29311,29372,29381,29387-29389,29393-29398,29400,29402,29406-29407,29413-29414,29416,29428,29430-29431,29434,29437,29439,29447,29449,29453,29457-29458,29461-29462,29464-29465,29471,29474,29476-29477,29479,29482-29483,29488-29489,29491-29492,29498-29501,29509-29510,29515-29516,29518,29520,29522,29525,29529,29536,29541,29548,29553-29554,29557,29561-29562,29564,29566,29568,29571,29577,29579-29580,29588,29592-29593,29598,29604,29606,29608-29609,29612,29616,29620-29621,29625,29630-29631,29633,29636,29638,29647,29656-29658,29661,29667,29670,29674,29678-29681,29684,29687-29688,29711,29715-29717,29720-29721,29723,29726-29730,29732-29733,29735,29737-29740,29747-29750,29753-29757,29759,29766,29769,29772,29774-29775,29784-29785,29788,29795-29796,29800-29801,29803,29810-29811,29814,29818,29823-29825,29829,29831,29833,29835,29837,29840,29846,29849-29850,29854,29857,29859,29861-29862,29869,29872,29874,29876-29877,29881-29883,29885,29887,29889,29894-29896,29898-29901,29903,29907,29911,29913,29919-29922,29926,29930,29932,29934-29935,29940,29943,29945-29946,29950,29953-29954,29958,29961,29963,29966,29968,29974,29977,29980,29982,29987,29992,29995-29996,30001,30007-30008,30014-30015,30017-30018,30024,30026,30036,30040,30042-30043,30048,30052-30054,30056-30057,30059,30063,30065,30067-30068,30072-30074,30081,30087,30089,30091,30099-30101,30107,30114,30123,30125,30128-30130,30137,30141-30142,30144,30150,30152,30154,30156,30159,30161,30164-30166,30170-30173,30175,30181,30183,30187,30189-30191,30193,30195,30197,30200,30204,30206-30209,30212,30216,30218,30220,30224,30233,30241-30242,30244,30247-30249,30253,30264,30270,30272-30274,30277-30278,30280,30289,30291,30293,30295-30297,30299-30301,30303,30305-30306,30308,30310,30312,30315,30318-30319,30321,30324,30326,30328-30330,30332,30334-30337,30342,30348-30349,30358-30359,30364-30365,30367,30369-30371,30373-30376,30378,30380-30381,30385-30386,30393-30394,30396,30402,30405-30407,30410-30413,30417,30421,30424-30425,30427,30429,30431,30434-30435,30437-30439,30442,30444-30445,30447,30453,30458-30459,30462,30466,30468-30469,30471,30473,30475-30476,30478-30479,30483,30485-30486,30488,30492-30493,30495,30497-30498,30504,30508,30510,30513,30515,30522,30529,30533,30535,30539,30542,30544,30548-30550,30552-30553,30557-30558,30561,30565,30568,30570-30571,30574,30576,30578-30579,30581-30582,30584,30586,30588,30590,30597,30604-30606,30608-30609,30611,30614,30616-30618,30621,30627,30631,30633,30636-30637,30641-30642,30646-30648,30650-30652,30661-30663,30665-30666,30668,30670,30672,30675,30679-30682,30691,30693,30699-30700,30702,30704-30705,30707-30708,30711,30714-30716,30719,30737,30742,30745,30747,30759,30762,30765,30770-30773,30780-30782,30784-30785,30788,30790,30795,30797,30802,30804-30806,30809,30825-30826,30829-30830,30833-30836,30838,30840-30842,30847-30848,30852-30853,30855,30863-30864,30866,30871,30878,30887,30896,30898,30901,30904,30906,30911,30915-30917,30924,30926,30928,30930,30933,30937-30938,30941,30943,30951-30952,30956-30958,30965-30966,30968,30974-30975,30980-30981,30987,30989,30993,30995,31001,31003,31005-31006,31008,31013,31015,31020,31026-31027,31031,31036-31038,31043,31047-31048,31058,31060,31062,31066,31071,31076,31078,31082-31083,31086,31098,31108-31109,31113-31115,31119,31122,31125,31133-31135,31138-31140,31142-31144,31149,31151,31153-31154,31157-31158,31160,31162-31163,31169-31172,31175,31177,31181,31183,31187,31195,31199-31200,31204-31205,31207-31208,31210-31211,31214,31216,31218,31220-31222,31224-31225,31228,31231,31237,31241,31250,31252-31253,31255,31258,31265,31268,31270,31272-31274,31277,31284,31287-31289,31293,31298-31301,31303,31309-31310,31317,31319,31322,31324-31325,31328,31337-31338,31342,31346,31349,31352,31354,31356,31364-31365,31369,31374,31380,31383,31387,31389-31392,31394-31396,31400,31405-31407,31409,31416,31418,31420,31430,31432,31437,31439,31450,31458,31461,31463,31472,31474,31476,31478,31480-31481,31486,31491-31492,31494,31499-31500,31504-31505,31510,31512-31513,31517-31518,31521,31524,31526,31528-31529,31532,31534-31536,31538-31539,31541,31553,31556-31557,31561-31565,31569,31575,31577,31579,31582,31584-31585,31589,31592,31594,31599-31601,31603,31608,31613,31615,31625,31629-31630,31633,31636-31637,31642-31644,31659-31660,31662,31666,31668,31670,31672,31675,31679,31685-31686,31693,31695,31698,31700-31701,31707,31710,31712,31724,31728,31730,31732-31733,31736,31739-31740,31742,31745-31746,31748-31749,31751,31753-31754,31756,31758,31765-31767,31769,31774,31777-31781,31788-31790,31794-31795,31798-31799,31804-31806,31811,31813-31816,31818,31820-31821,31823,31826-31827,31830,31832,31841,31843,31845,31850-31852,31857,31860-31862,31864-31865,31872-31874,31877,31879,31884-31886,31889-31890,31894-31895,31900-31901,31903-31904,31907,31909,31911,31915,31920,31923-31924,31926,31929,31932-31933,31936,31938-31940,31944-31946,31948-31949,31953,31955,31961-31962,31966-31970,31974-31975,31977,31979-31980,31984-31986,31989-31990,31994,31998-32000,32002-32005,32008-32009,32012-32014,32016-32018,32020,32022,32028,32033,32036,32038,32044,32049,32052,32056-32058,32060,32064-32065,32067-32068,32070,32072,32074-32075,32081,32083-32084,32086-32087,32093,32095,32100,32106-32107,32111-32113,32115-32117,32120,32122,32124-32125,32128-32129,32134-32138,32140-32141,32146-32147,32150,32152,32155,32158-32159,32161,32163-32164,32166,32171-32172,32175-32176,32179,32181,32192-32193,32196,32207-32208,32210,32212-32213,32216,32219-32222,32225,32227,32230-32231,32233,32239,32241-32242,32248,32251-32254,32256,32259-32260,32266,32270-32271,32273,32277-32280,32282-32285,32289,32291,32293-32297,32299-32300,32304,32306,32308-32310,32312-32314,32316-32317,32321-32323,32325,32328,32331-32334,32336,32347-32348,32355-32358,32372,32375,32378,32380,32382,32385-32386,32391,32396,32398,32403,32409,32411,32413,32419,32421-32422,32428-32429,32436,32438,32440-32441,32444,32446-32448,32450-32451,32453,32456,32459,32461,32463,32465-32466,32468,32470-32472,32475,32477,32484-32485,32488,32493,32495,32497,32499,32502,32505-32507,32512-32513,32515,32518,32520-32522,32533,32535-32536,32540,32547,32552,32555-32556,32559-32560,32564,32570-32572,32578,32580,32583,32586-32587,32589,32593-32594,32599,32601,32603,32607-32608,32610,32612,32617-32622,32630-32631,32633,32639,32644-32646,32650,32653-32655,32657-32658,32660,32666,32668,32670,32672,32676,32682-32686,32690,32694,32696,32700-32701,32703-32704,32708-32709,32711-32713,32715-32716,32718,32720-32721,32723,32726-32727,32730-32732,32735-32736,32738-32739,32741-32742,32746-32749,32753,32755-32756,32758-32759,32765-32766,32768,32770-32772,32774,32778,32785-32787,32790-32791,32793-32796,32798,32800,32802,32805-32806,32809-32813,32815-32816,32818,32821-32822,32824,32836-32837,32839,32844,32847,32857,32859,32862,32864,32867,32874-32876,32878,32880,32884,32886,32893-32894,32896,32898,32900-32901,32903,32905,32908,32910,32913-32915,32917,32919,32921-32924,32926-32927,32929-32930,32933-32935,32941,32945-32949,32951-32953,32955-32957,32960,32962-32963,32965-32968,32970-32971,32973-32974,32980-32981,32986,32988,32993,32995,32998-32999,33002-33003,33005-33006,33010,33013,33016,33021-33022,33025,33027-33028,33030-33031,33033-33034,33044-33045,33047-33048,33050,33053,33055,33057,33059,33064-33065,33067,33069,33072-33073,33082,33092-33093,33095-33097,33102,33105,33107,33119-33120,33122-33123,33129-33130,33137,33144,33147,33153-33154,33157,33160-33161,33166-33168,33172,33175-33176,33178,33184-33186,33188-33190,33192-33193,33195-33196,33198,33202,33211,33214-33216,33219,33224,33227-33228,33232,33236-33238,33240-33241,33243,33245-33249,33251,33257-33258,33264-33265,33267,33279,33281-33283,33291-33294,33298-33299,33301,33305-33306,33308,33310-33311,33318-33319,33329-33331,33333-33334,33336,33338,33340,33342,33347,33350-33351,33353-33354,33364,33366,33368,33371-33373,33378,33380,33384,33386-33387,33389-33390,33393-33394,33402,33404-33405,33409,33411,33415-33418,33421-33422,33424,33428,33432,33436,33442-33443,33447,33449-33452,33454-33455,33457-33459,33461,33465,33468-33470,33474-33475,33483,33486-33489,33492,33496,33498-33499,33507,33509,33514,33517-33519,33521,33525-33526,33531,33535,33537-33538,33540-33541,33545,33552,33554,33556-33557,33559,33561-33562,33564,33568,33572,33575-33576,33578,33581,33583-33584,33589-33590,33595,33598-33600,33604,33606,33616-33618,33620-33621,33623-33626,33631-33632,33639,33641,33643,33645,33648-33649,33653,33655-33657,33659,33663,33665-33667,33674,33677-33678,33682-33684,33689,33691,33694,33704,33710-33711,33715-33718,33720-33721,33724-33725,33731,33733,33741,33743-33744,33748,33755-33756,33758-33759,33762,33768,33774,33778,33780,33782-33783,33785,33787-33789,33803,33816-33818,33829,33831-33832,33834,33838-33839,33841-33843,33849,33852-33854,33856,33858,33860-33861,33863,33865-33866,33868,33871,33873-33876,33878-33880,33882,33889-33890,33896-33897,33899,33905,33907-33910,33912-33913,33915-33916,33918,33920,33922-33923,33925,33927,33932-33934,33937-33938,33941,33943-33944,33946-33949,33951-33952,33954-33957,33959-33960,33962,33964-33965,33968-33970,33972-33974,33976,33980,33983,33988,33995-33997,33999,34004,34006-34010,34017,34019-34021,34023,34026,34032,34036,34044,34048-34049,34051,34054,34057,34060,34062,34064,34066-34067,34069-34070,34073-34075,34077-34079,34084,34093-34094,34096,34101,34109-34110,34112-34114,34116-34118,34120-34121,34123,34128-34129,34131,34134-34135,34138,34140-34141,34145-34146,34148,34152,34154-34155,34160,34163-34164,34167,34174,34178-34179,34182,34195,34201,34203-34204,34206,34211,34213,34215,34217,34219,34221-34222,34225,34233,34238-34242,34245,34248,34251-34253,34255,34257,34265,34274,34279,34286,34288,34290-34291,34293-34294,34296,34300,34303,34308,34311,34315-34316,34321,34323,34325-34329,34331,34337,34340-34342,34345,34347-34348,34350,34352-34353,34356-34357,34359-34361,34369-34371,34376-34377,34380,34384,34386,34388-34390,34392,34398-34399,34403,34405-34410,34412-34413,34416,34426,34431,34435,34439-34440,34444,34450,34453-34455,34457,34460,34464,34467,34475,34484,34490,34495-34497,34499-34500,34502,34504,34514,34517,34519,34522,34526-34527,34532,34535-34537,34540-34541,34548,34553,34556,34558,34561-34562,34570-34572,34576-34577,34582-34583,34586,34589-34591,34594,34599-34600,34606,34617,34621-34623,34626,34630,34632,34636-34637,34641,34644-34645,34650,34652,34660-34661,34664-34665,34667,34669,34671,34685,34688-34689,34695-34696,34702-34703,34709,34711,34714,34718,34724-34725,34730,34732,34736,34739,34744-34745,34747-34748,34754-34755,34759,34764-34765,34768-34769,34774,34776,34779,34781,34784-34785,34790,34793-34794,34798,34812,34814,34817,34819,34822,34824-34825,34827-34828,34832,34835-34836,34839,34841,34845,34849,34851,34854,34856,34864,34866,34870-34872,34876,34888-34890,34899,34905,34907,34912,34914-34915,34923,34928,34936-34937,34941,34947,34953,34955,34959-34961,34968,34972,34976-34977,34979,34981,34985,34994,34997,35004,35010,35014,35022,35025-35026,35029,35032,35034,35036,35038,35044,35053,35064-35066,35070,35075-35076,35080-35081,35086,35093,35100-35101,35108,35123,35126,35128-35129,35133,35137,35152,35158-35159,35161-35162,35164,35166,35174,35180,35183-35184,35196,35204-35205,35209-35210,35212,35223,35228,35235,35237,35251,35257,35260,35262,35267,35282,35286,35302,35304,35311,35318,35327,35330-35331,35333,35338,35343,35346-35347,35350,35353-35354,35362-35363,35371,35373-35375,35378,35380-35381,35386,35389-35390,35392,35395,35399,35404,35417-35419,35422,35424,35429,35435,35442,35450,35454,35465,35471-35474,35479-35480,35482-35483,35490,35496,35498-35499,35502,35505,35507,35509,35515-35516,35519,35525-35526,35530-35531,35547-35548,35552-35554,35558,35566,35571,35576,35583-35585,35594,35596,35598-35600,35611,35626-35627,35634,35643,35645,35651,35655,35663-35664,35666-35667,35675,35681,35684,35686,35690,35694,35700,35706,35717,35723,35733-35734,35736,35740,35742,35749,35752,35769,35779,35787,35796-35797,35799-35800,35811,35820,35822,35826,35828,35833-35834,35838,35841,35844,35848,35851,35854,35856,35858,35860-35861,35863,35865,35869,35871-35872,35877,35882,35884,35891,35897,35902-35903,35908-35909,35912,35916-35918,35921,35923,35925-35928,35934,35941,35948-35949,35952,35954,35963-35966,35968,35971,35978,35981-35982,35990,35993-35994,35997,36006,36009,36013,36017,36028-36029,36034-36035,36042,36047,36049-36050,36052,36066,36072,36074-36075,36084,36087,36091,36094-36095,36097-36098,36106-36108,36112,36115,36120,36126,36133,36136,36142-36143,36145,36149,36151,36153,36164,36172,36177-36178,36185,36189,36192,36201,36209,36215,36219-36220,36222,36224,36226,36229,36232,36238,36242-36243,36253,36256,36263,36269,36274,36277,36280,36286,36288,36297,36305,36308,36311-36313,36321,36323,36326,36329-36330,36338,36341,36343,36345,36347,36352,36354-36355,36360,36366,36368,36374,36378-36380,36386,36389-36391,36394-36395,36398,36400-36401,36403-36404,36410,36418,36421-36422,36429,36445-36446,36448,36452-36454,36462,36465,36467-36468,36471,36476,36484,36487,36502,36516,36524-36526,36530,36541-36543,36545,36549,36552,36559-36562,36564-36565,36569-36570,36573-36574,36576,36586,36588,36595-36596,36600,36607-36609,36612,36621-36622,36634-36637,36641-36642,36648,36650,36652,36655,36660-36661,36663-36665,36670-36672,36677,36684,36687-36688,36690-36691,36693,36695,36698,36702,36707,36710-36711,36713,36715-36717,36720,36723,36725,36728,36735,36737,36739,36742,36745-36746,36756,36759-36760,36762,36769-36771,36773,36775-36778,36781,36783-36784,36786,36789-36793,36800,36802-36803,36805,36808,36812,36824,36828,36830,36832,36835-36837,36841-36842,36844,36847-36849,36851-36852,36855,36857,36859-36860,36863,36867,36869,36871-36872,36874,36876-36877,36879,36884,36886-36889,36891-36892,36894-36895,36897,36900-36901,36906,36908,36912,36915-36916,36918-36919,36922-36924,36932-36933,36940,36942,36947,36950-36951,36953,36955,36959,36964-36965,36970-36971,36979-36981,36983,36988,36990-36991,36993-36996,36998,37000-37001,37003,37005,37008-37010,37013,37017,37020,37022-37026,37029-37031,37033,37035,37037-37038,37040-37041,37043,37045,37047-37050,37055,37057-37058,37060,37063-37064,37067,37077-37082,37084-37086,37092,37094-37095,37097-37099,37110-37112,37116-37117,37119-37120,37123-37126,37128,37131-37132,37134-37135,37137-37142,37144-37146,37148,37150-37153,37155,37157-37160,37162-37165,37167-37170,37173,37175,37180-37181,37183-37184,37186-37188,37190-37191,37193,37195-37196,37200-37201,37203,37205-37207,37209,37211,37214-37218,37220-37221,37224,37226-37228,37230-37231,37234,37244-37246,37252-37254,37256,37265-37267,37270-37274,37280-37282,37284-37285,37287,37298-37300,37303-37306,37308,37312,37314-37316,37318-37319,37329-37331,37333,37336,37339-37340,37342-37345,37347,37349-37350,37352-37354,37357-37358,37360,37363-37366,37370-37371,37376-37377,37380,37382,37384,37386-37388,37390-37391,37394,37404-37405,37407,37412-37414,37416,37418-37419,37428-37430,37432,37434-37438,37440-37441,37443,37452,37455,37460-37461,37463,37465-37466,37468-37469,37473,37480,37483,37487-37488,37491,37494,37504-37505,37507,37520-37521,37523-37524,37528,37531,37535-37538,37544-37545,37547,37555,37565-37567,37569-37570,37572-37573,37575,37577,37583,37585,37587-37589,37591,37595-37596,37598-37599,37609-37613,37615,37622-37624,37628-37629,37631-37632,37637,37643,37645-37646,37653-37654,37657-37659,37661,37668,37673-37674,37680,37684,37697,37700-37701,37703-37704,37709-37710,37713-37714,37719,37724,37726,37728,37732,37735,37737,37744,37746,37748-37749,37754,37757,37759-37760,37762,37764-37765,37767-37768,37770-37774,37780,37786-37787,37789,37791-37794,37796-37798,37805-37806,37816-37817,37821-37823,37833-37836,37838,37841,37845,37848-37849,37851-37852,37854-37858,37860,37862-37863,37868,37872,37874-37875,37877,37882-37883,37885-37887,37891,37894-37895,37898-37900,37905,37907,37916,37918-37921,37924-37925,37927,37933,37940-37941,37945-37947,37955-37956,37958-37960,37964-37966,37970-37971,37974-37975,37981-37982,37985-37989,37991-37992,37995-37997,37999-38002,38005,38008-38009,38012-38013,38017,38025-38026,38029,38034-38036,38039-38040,38044-38045,38056,38059-38060,38062,38064-38065,38075-38077,38085,38087,38090,38095-38096,38100-38102,38104,38106,38114-38115,38119,38126-38127,38130,38132,38135-38136,38138,38140,38142,38144,38147,38149-38152,38155-38156,38158-38159,38164,38166,38168-38170,38174,38176-38178,38181-38182,38184-38185,38187-38188,38191,38195,38198,38200,38205-38206,38208-38210,38213,38215-38216,38219,38227-38230,38232,38237-38238,38246,38248,38250,38252,38269,38279-38281,38285-38286,38289-38290,38293,38295,38298,38300-38302,38307-38308,38311,38313,38316,38320,38327,38330,38334-38335,38337,38349,38355-38356,38360,38364,38370,38372,38378-38380,38384-38385,38390,38393-38395,38397,38406,38409-38411,38414,38420-38421,38428-38430,38432-38433,38436,38438-38439,38443-38444,38448-38449,38452-38454,38458,38460-38461,38465-38466,38472,38478,38480,38484,38486,38488-38489,38493-38494,38496,38503,38505,38510-38511,38517,38530,38535,38537,38542-38543,38549,38552-38553,38555-38556,38558-38560,38562,38566,38568,38570-38572,38575,38578,38581-38583,38585-38586,38589-38590,38592,38595,38597,38600,38602,38604-38606,38610,38614,38616,38618,38620-38621,38623,38625,38627,38629-38630,38633,38638-38640,38642,38647-38648,38652,38655-38656,38660,38662,38665,38671-38673,38685-38687,38689,38691,38698-38699,38701,38714,38717,38721-38722,38724,38726,38732-38734,38737-38738,38753-38754,38777-38778,38781,38785,38787-38788,38790,38801,38805-38806,38809-38812,38814,38816-38817,38819,38822,38826,38828-38830,38832,38834,38842-38844,38849,38851,38855,38858,38860,38871-38872,38879,38881,38885-38887,38893,38895,38897,38905-38907,38909-38911,38952,38954-38955,38957-38959,38962-38963,38968,38970,38972-38974,38977,38979-38981,38983,38985-38988,38990,38993-38997,38999-39000,39002-39004,39007,39017-39018,39025-39027,39048-39050,39052-39053,39055,39064-39065,39067,39076,39079,39085-39086,39093,39096,39099,39101-39103,39109-39111,39117-39120,39122-39123,39125,39129,39132,39135-39137,39139,39141-39144,39146,39148-39150,39154,39162-39163,39166,39169-39172,39174-39176,39180,39182-39184,39186-39187,39189-39192,39194-39195,39197-39198,39200-39202,39204,39206-39207,39212-39213,39215-39216,39218-39219,39221-39225,39227-39229,39231,39236-39238,39241-39244,39246-39247,39249,39253,39257,39266,39268-39270,39272,39274-39275,39277-39279,39281-39282,39284-39285,39288-39289,39291,39296,39299-39301,39303,39305-39306,39308,39310-39311,39321-39326,39329,39331,39333-39336,39338,39340-39342,39344,39346-39347,39353,39355,39367-39368,39370,39380-39381,39386-39388,39390,39392,39397-39398,39401,39403,39411,39418,39421,39428-39430,39438-39442,39448-39449,39453,39460,39464,39467-39469,39471-39472,39474,39484-39485,39488,39490-39491,39493,39496,39498-39500,39503,39505-39506,39509-39513,39516-39518,39521-39525,39528-39529,39531,39540,39542-39544,39546-39547,39550-39552,39554-39555,39557,39562,39564,39566,39568,39571,39580,39582-39583,39586-39590,39596,39598,39601-39602,39604-39605,39607-39608,39610,39612-39614,39619-39620,39622-39626,39628,39631-39632,39638,39641-39642,39644-39646,39648,39650,39652-39654,39660,39664,39666-39667,39669,39673,39675,39678-39680,39689-39690,39692-39693,39695,39705-39706,39708-39709,39711,39714,39716,39718,39721,39728,39730-39731,39736,39738-39739,39751,39755-39758,39762-39764,39766-39769,39771-39774,39776-39778,39786,39792-39793,39795,39801,39805-39806,39808,39810,39812-39814,39817-39818,39821-39822,39825-39826,39828,39830,39832,39834-39835,39837-39839,39841-39843,39846-39847,39851,39857,39861,39863-39864,39866-39867,39870-39871,39875,39878,39881,39888-39890,39892-39893,39896,39899-39901,39903,39905,39908-39909,39913-39914,39921,39923-39924,39926,39931,39933,39935,39940-39942,39944,39946-39947,39949-39950,39952,39955-39957,39959,39962-39963,39973-39974,39982,39985-39986,39988,39990-39992,39995-39996,39998,40008,40012,40016,40018-40020,40023-40024,40027-40028,40030,40036-40037,40039-40040,40042-40043,40049,40052,40054-40055,40058-40059,40063,40065,40067-40069,40071-40073,40075-40076,40078,40080,40086,40090,40096,40103-40105,40108,40111,40115,40119-40120,40122,40125,40127-40129,40131,40134,40137-40140,40143-40146,40148-40149,40152,40155,40157-40158,40164,40170,40172,40175-40176,40179,40183,40188,40193,40195,40197-40199,40201,40208,40213-40214,40219,40225,40228-40230,40235,40237,40239-40242,40245,40247,40249-40251,40255-40258,40264,40267-40269,40271,40274,40278,40280,40282-40283,40289,40292,40297-40299,40301-40302,40305,40310-40311,40313,40317-40318,40320,40322,40324-40325,40332,40334-40336,40338-40339,40341-40343,40345-40348,40350-40352,40358,40362,40368,40370-40373,40375,40377,40379,40381-40382,40386,40390-40392,40394-40395,40400,40403,40406,40411-40412,40414-40416,40418-40422,40424,40427,40429,40432-40433,40436,40438-40441,40445,40447,40455,40461,40464,40466,40469-40470,40472-40473,40475-40476,40479-40480,40483,40485-40487,40493,40496,40504-40506,40511-40512,40514-40517,40520,40522,40524,40526-40529,40534-40535,40538-40539,40544,40548-40550,40553,40555,40558,40564-40565,40567,40569,40573,40575-40576,40578,40580-40582,40585-40586,40588-40590,40592-40593,40596,40599-40600,40602-40603,40605-40606,40613-40615,40617,40619-40622,40631-40634,40637,40642-40643,40646,40648-40649,40653,40655,40658,40662-40664,40666-40667,40672,40674-40675,40679,40682,40690,40697-40702,40704-40705,40707-40709,40711-40713,40715-40716,40718-40719,40721,40729-40733,40735,40740,40742-40744,40746,40749-40752,40754-40758,40761,40764,40767,40770,40773,40779,40786-40787,40791,40798,40803-40806,40808-40809,40812,40814-40815,40823,40826-40827,40829,40831,40834-40836,40838,40841,40847-40849,40851,40854,40856,40862-40863,40868-40869,40875-40877,40879-40881,40883,40891,40893,40899,40909,40911,40914,40916,40919,40921-40923,40925,40928-40930,40933-40935,40937,40939-40941,40948-40950,40958,40962-40966,40968,40972,40976,40980-40982,40984-40985,40988-40989,40997-41001,41003-41004,41008-41010,41013,41016-41017,41019-41022,41025-41027,41029,41031,41033,41035-41036,41039,41042-41043,41046-41048,41053,41055-41057,41059-41060,41062-41063,41068,41070,41072,41074-41078,41081,41084,41089,41093,41097-41098,41100-41101,41104,41106-41107,41110,41113,41115,41117,41121,41125,41132,41135-41136,41138,41143-41145,41147,41150-41151,41153-41155,41157,41159-41161,41168,41170,41172,41175-41176,41178,41182-41183,41185,41188,41190-41192,41194-41196,41198,41200,41202-41204,41210,41214-41215,41217-41218,41221-41222,41225,41228,41230,41237,41239,41244-41245,41247-41248,41251-41252,41254-41258,41260-41262,41265,41267,41272,41275-41277,41279,41283,41287,41289-41290,41292-41293,41295,41298,41303,41306,41308,41311,41315-41316,41319,41326,41328-41330,41334-41335,41337-41338,41340-41342,41345,41347,41351-41353,41355-41356,41358,41360,41362-41364,41366,41369-41370,41373,41376,41378-41379,41381,41383,41388,41390-41391,41394,41400,41405,41407,41411-41412,41415-41418,41420,41425,41428-41429,41432,41434-41438,41441,41444,41446-41447,41456,41459,41461,41463-41464,41467-41468,41472,41474,41477-41479,41485,41487-41488,41490,41492,41495-41498,41500-41502,41504,41509-41511,41515,41517,41519,41521,41523-41526,41528-41530,41532-41533,41538,41541,41543,41545,41547-41548,41550,41552-41553,41559,41562,41565,41567,41570-41572,41575-41577,41581-41582,41587,41592,41594,41596-41598,41600,41602-41604,41607,41613-41614,41620-41622,41625,41627,41629-41634,41637,41642,41645,41654,41656,41658,41660,41664-41666,41671-41673,41677-41678,41682,41684,41686-41688,41690-41691,41695-41696,41698,41703,41708,41710,41712,41719-41720,41724,41733,41735,41737-41739,41743,41745,41750-41751,41753,41755,41761-41765,41769,41774-41776,41781-41782,41784,41786,41788-41790,41793,41795,41799,41803,41806,41808,41811,41814-41815,41817-41819,41821,41824,41827-41828,41830-41831,41835,41837,41839-41840,41843,41846,41852-41853,41858-41859,41864,41867,41873,41875,41877-41882,41890,41901,41903,41907-41910,41913-41914,41917,41919,41925,41928-41929,41935-41936,41939,41941-41942,41944,41946-41947,41949,41954,41960,41963,41965-41968,41972-41973,41977-41979,41982,41984,41987-41988,41990,41994,41996-41998,42003,42005-42010,42014,42016-42017,42019-42022,42026-42027,42032,42034-42035,42041,42043-42044,42049,42051,42053-42054,42057-42058,42060-42061,42063,42068,42070-42072,42075-42076,42078-42079,42083,42085,42087,42089,42091-42093,42095,42097,42099-42101,42103-42104,42106,42109,42113-42115,42117,42120-42121,42124,42127-42128,42132,42134-42137,42140,42142,42145,42147,42150-42151,42153-42154,42156-42157,42160,42163,42165,42168-42169,42172,42174,42179-42180,42186,42198-42199,42201,42203,42205,42207,42213-42214,42220,42226-42227,42232,42237,42239,42245-42246,42248,42250,42252-42254,42256,42258-42262,42264-42266,42271,42274-42275,42279,42284,42287,42290-42292,42294-42295,42297,42299-42300,42303-42304,42306,42308-42309,42311-42312,42314-42315,42323-42324,42326,42329,42331-42332,42334,42338-42339,42341-42343,42346-42347,42352-42354,42358-42360,42362,42364-42366,42368-42370,42374-42375,42378,42380,42382-42383,42385-42386,42389,42393-42395,42403-42405,42409,42413-42415,42417-42419,42423,42431-42433,42437-42438,42440,42442,42444,42456-42458,42460,42463-42464,42467,42469-42470,42480-42481,42483,42486,42493,42495,42501-42502,42509,42512,42515,42522,42529,42531,42538-42539,42541-42542,42545,42548,42550-42551,42553-42557,42560-42561,42563,42569,42571,42577,42579-42580,42582-42584,42594-42597,42604,42607,42610,42612-42613,42617,42624,42631,42633,42635,42638,42640,42642,42644,42646,42649-42650,42658,42660-42661,42663-42666,42668,42671-42672,42674,42676-42678,42682-42683,42686-42688,42692,42700-42701,42706,42708-42709,42714-42716,42718,42722-42723,42736,42745-42747,42752,42757-42758,42769-42770,42775-42777,42779,42787-42788,42790-42792,42794,42797,42803-42806,42808,42810-42812,42814-42815,42820-42821,42823-42824,42827-42828,42830-42833,42836,42839,42844,42853,42855,42857-42858,42860-42862,42864,42881,42885,42887,42891,42893,42897,42899,42901-42903,42905,42907-42908,42912-42913,42916,42927,42929,42931,42937-42939,43010-43011,43017,43021,43023-43024,43027,43033-43035,43040-43041,43043,43048,43052,43055,43057-43058,43060,43064,43066,43072,43074-43075,43077-43078,43080,43082,43085,43087,43089-43090,43092-43093,43098-43101,43103-43104,43107,43113-43115,43120,43126-43127,43135-43137,43143,43145,43148,43150,43156,43161,43163,43168,43171,43180-43181,43189,43191,43193-43195,43198,43201,43204,43206,43208,43210-43212,43215,43217-43218,43220,43222-43223,43227-43229,43231-43232,43234-43236,43239,43241-43242,43245-43248,43250-43254,43256,43258,43260,43266-43267,43269-43271,43273-43275,43277,43282,43284-43285,43287,43290,43293-43295,43299,43302,43309,43311-43313,43316-43317,43320-43322,43325,43327-43330,43336,43340,43347-43348,43351-43352,43354-43356,43358-43361,43363-43364,43366,43368,43370-43371,43377-43380,43383,43388-43389,43391-43392,43394-43395,43401,43403,43405-43407,43409-43411,43413-43414,43416-43418,43422-43423,43426,43429,43431,43435,43440-43442,43446-43449,43459,43463,43467-43469,43472-43473,43475,43477-43480,43483-43484,43487-43488,43491,43495-43496,43498-43499,43501,43503,43505-43506,43512-43513,43515,43518,43522,43525,43529,43536-43537,43540,43544,43546,43549-43551,43553,43555-43558,43561,43563,43565,43567-43568,43570-43571,43577,43582-43583,43585,43588-43589,43591,43593,43595-43596,43599-43600,43604-43605,43608-43609,43611-43612,43614,43616-43618,43620,43623-43624,43629-43631,43636-43637,43639-43641,43644-43646,43648,43654,43657,43659,43663,43667,43670-43673,43675,43684,43688,43691,43697,43700,43702,43708-43709,43711,43713,43715-43718,43721-43722,43724-43726,43730-43732,43735-43736,43739,43741,43746,43749-43751,43753,43759-43760,43770,43772-43773,43775,43777-43778,43780,43782-43784,43786,43788,43790,43794,43796-43798,43801,43805,43808,43813,43815,43821,43826,43829,43831,43833-43834,43837-43839,43841-43843,43846-43848,43850-43852,43854-43857,43860-43861,43868,43870,43873-43874,43877,43879-43882,43884-43885,43887,43889-43890,43892,43897,43900,43903,43905,43909,43911-43914,43916-43917,43919-43920,43922-43923,43930,43935,43940,43943-43944,43946,43954-43955,43957,43960,43963,43966,43969-43970,43977-43978,43981,43983,43989,43991,43993-43998,44000-44001,44003-44004,44006-44007,44012-44013,44016,44019,44021,44026-44027,44037-44040,44043-44044,44046-44049,44051-44052,44056-44058,44060,44062,44064-44066,44069,44071,44075-44077,44079,44082-44085,44088,44090,44092-44093,44095-44098,44102,44105,44113,44116-44117,44122-44124,44126,44128,44131-44133,44136,44138-44140,44142,44147,44152,44154-44155,44157,44159,44164,44169-44171,44174,44176,44179-44180,44184,44186,44188-44189,44192,44194-44195,44199,44201-44202,44204-44205,44207-44208,44210,44212,44214,44218,44220-44221,44224-44225,44233,44235,44243-44244,44246,44248-44249,44251-44252,44258,44264,44267,44272,44274,44290-44291,44293,44296,44298-44299,44304,44323,44328,44330,44501-44503,44507-44508,44527,44530-44532,44535,44542-44543,44548,44550,44555-44556,44558,44562,44565,44567,44571-44573,44575-44577,44580,44585-44587,44591-44592,44595,44603,44606,44609,44611,44613-44614,44616-44618,44672,44674,44678-44679,44681,44684,44687,44705-44706,44708-44709,44717,44720,44862,44871,44879,44882-44883,44885,44887,44900,44902,44905,44909,44913,44915,44919,44921,44923,44925,44927,44950,44955-44956,44958,44976-44977,44983,44993,44999,45001-45003,45008-45010,45014,45017,45021-45022,45029,45031-45032,45037,45040,45042-45043,45045,45054-45055,45065-45066,45069-45071,45074-45075,45077-45079,45081-45082,45085-45086,45088-45089,45091-45092,45094,45096-45097,45100,45105-45106,45108,45111-45113,45116,45119,45122,45124-45125,45127,45129,45132,45135-45137,45144,45146-45147,45149,45154,45157,45159,45166,45168,45170-45171,45175-45176,45181-45185,45188-45190,45192,45194,45198,45205,45207,45209-45210,45213-45214,45217-45218,45220-45222,45226,45228,45231,45239-45240,45242,45245-45246,45249-45250,45252,45254-45258,45261,45263-45264,45270,45272-45273,45283,45286-45287,45289,45294,45296-45297,45299,45301-45302,45304,45306-45307,45309-45310,45312-45314,45318-45319,45321-45322,45332-45333,45337-45338,45343-45344,45348,45353,45359-45360,45362,45369,45372,45377-45379,45381-45382,45384,45394,45403,45405-45406,45419,45423,45427,45429-45432,45434-45436,45439,45443-45445,45447,45450-45451,45457-45458,45460-45462,45466,45472-45474,45477,45483,45485,45489-45491,45493-45496,45499,45501-45502,45504,45506,45509-45510,45513-45516,45520,45523,45525,45528,45530,45535,45537-45538,45541-45543,45548-45549,45552,45554,45556,45558,45565-45566,45570-45571,45573,45575,45578-45579,45585,45589,45593,45596,45598,45602-45605,45617-45618,45620,45624,45627,45632,45634,45647,45649-45651,45653,45656-45658,45662,45665,45669,45673,45676,45678-45680,45682,45684-45685,45689-45690,45696-45697,45699,45701-45702,45704,45710-45711,45713,45715,45723-45724,45726,45730,45738,45740,45742,45744,45750,45752,45756-45758,45760,45765,45767,45771-45774,45776,45783,45786,45796,45802,45804,45807,45810,45812-45813,45815,45820-45821,45823,45826,45829,45836,45839-45840,45842-45843,45851-45854,45856,45858,45863,45865,45870,45878-45879,45885,45888,45893,45895-45896,45904,45914-45916,45923-45926,45931,45933-45935,45937,45941-45942,45944,45946-45947,45952,45956,45962,45966-45968,45976,45978-45979,45981-45983,45985-45988,45990-45991,45996-45997,45999,46007-46009,46016-46018,46024-46026,46028-46029,46031-46032,46036,46038,46040-46041,46044,46049,46060,46062-46066,46068,46072,46074,46076-46077,46080,46082-46083,46089,46092,46094-46095,46097-46098,46100-46101,46103-46105,46107,46112-46113,46115,46119-46120,46123,46126,46131,46137,46139,46142-46143,46145,46155,46158,46170,46172-46173,46178,46182,46184,46190-46191,46193,46195,46197,46199,46203,46208-46209,46213,46217,46225,46230,46235,46238-46239,46246,46248,46250,46252-46253,46258,46264-46265,46270,46277,46287,46289,46291,46295,46297,46300-46301,46304-46306,46312,46320,46322,46324,46333,46335,46337,46351,46353,46355,46357,46373,46376,46385-46386,46393-46395,46398-46400,46406,46409,46411-46412,46418,46425-46426,46430,46438,46442,46445-46446,46450-46453,46460,46463,46466-46468,46470-46471,46473,46479-46481,46484,46488,46490,46494,46499,46502,46506-46507,46509-46513,46523,46525-46527,46529-46530,46535-46536,46541,46545-46546,46550,46554,46566,46568,46571-46573,46578,46583,46590,46593-46594,46606,46610,46612-46614,46619,46621,46625,46627-46628,46630,46635,46638-46640,46654-46655,46658,46661,46666-46668,46672,46677-46680,46683,46687-46688,46690,46695,46697,46699,46702-46704,46706-46708,46711,46713-46714,46717-46719,46721,46723,46726-46727,46730,46733,46749,46756,46763,46765,46767,46769,46771,46773,46775,46778,46784,46789-46791,46794,46809,46818,46820-46821,46829,46833,46840-46841,46844,46846,46849,46852,46854,46858,46866,46869,46874-46875,46877,46883,46889-46891,46893,46895,46899-46902,46904,46907,46910-46911,46913,46919,46921,46930,46934,46937,46943,46945,46958-46959,46964,46967-46968,46970,46975,46977,46982-46983,46988,46991,46994,47002,47004,47008,47010-47011,47013,47018-47019,47021-47023,47026-47027,47031,47034-47035,47037,47040,47046,47049,47052,47055,47058-47062,47068-47069,47071,47074,47079,47083,47086-47087,47091,47093-47094,47096-47097,47101,47105,47107,47109,47112,47114,47116,47118-47119,47122,47127,47129,47134,47143-47145,47147,47149-47151,47153,47156-47157,47159,47163,47165-47167,47174-47178,47190-47191,47195,47197-47198,47201-47203,47207-47208,47212-47213,47219-47220,47223,47231,47233-47235,47237-47238,47244-47246,47250,47253,47257-47259,47261,47263,47265-47266,47268,47270,47273-47274,47278,47280,47284,47290-47291,47293-47296,47300-47302,47307,47309,47311,47313,47315-47318,47322,47336,47339-47340,47342,47351-47352,47359-47361,47367-47368,47374-47375,47377,47379-47381,47383,47385-47387,47389,47391-47392,47396,47399,47402,47404,47407,47412-47413,47415-47417,47419,47423-47424,47426,47430,47440,47444,47449,47451,47454,47457-47458,47460-47461,47464-47465,47468-47469,47472,47475-47476,47478-47479,47483,47487,47495,47501-47504,47506,47511,47513,47515,47517,47519,47527,47532,47534,47540-47541,47543-47544,47546,47549-47550,47553,47555-47556,47559,47561,47565-47566,47568,47570-47571,47575,47577,47579,47582,47584,47586-47588,47590,47592,47595-47596,47598,47600,47603,47605,47609,47617,47620-47622,47625-47626,47630,47632-47633,47638-47639,47644,47648,47650-47651,47653-47654,47657-47660,47663,47666,47668,47670,47672,47676,47678,47680-47681,47687,47693,47696-47698,47702-47705,47707,47709-47710,47713,47715-47717,47719-47720,47722,47726-47728,47734,47739,47742-47745,47747,47753,47757-47761,47766,47768-47769,47771,47773-47775,47780,47783,47792,47794,47796-47798,47801,47803-47804,47806,47810-47811,47817-47820,47825-47826,47829-47831,47839-47840,47842-47844,47846-47847,47852,47855,47858-47860,47864-47866,47868,47870-47872,47874-47875,47879-47881,47883-47886,47889,47894,47897-47899,47904-47905,47909-47911,47915-47916,47919-47920,47922,47924-47926,47930,47932,47935,47940,47949,47953,47958,47960-47961,47964-47965,47969,47973,47978-47982,47986,48000-48001,48003-48004,48006-48007,48009-48013,48018,48020,48022,48025-48026,48031,48035-48036,48039-48040,48043-48044,48049,48064-48065,48128,48133-48134,48138,48140-48141,48143,48145-48146,48148,48156-48157,48163-48164,48166,48169-48170,48178-48179,48182,48188-48189,48193,48195,48199-48200,48202,48210,48214-48215,48219-48220,48223,48226-48227,48229,48231,48237,48250-48252,48254,48263,48266-48267,48269,48272-48273,48278,48281,48283-48286,48291-48292,48295,48298,48301-48302,48304-48305,48307,48319,48325,48328-48329,48331,48334,48337,48339-48340,48343,48350,48355,48358,48361-48362,48368,48370,48388,48391-48393,48400,48403-48404,48406,48411-48413,48415,48417,48419,48429,48435-48436,48454-48455,48459,48462,48464-48465,48469,48473,48485,48488,48501,48512-48513,48517-48518,48640-48641,48648,48656-48658,48672,48877,48883-48885,48890,48894,48959,49005-49010,49012,49016,49018-49019,49030,49034,49038-49039,49043,49045-49047,49049-49051,49054,49057,49060-49061,49065,49070,49073,49080,49082,49088,49090-49091,49101-49103,49108-49109,49111-49114,49120-49122,49126,49129,49132,49140,49142,49144,49146-49147,49151', NULL); -- seed shared_buffers VACUUM ANALYZE moc1; SELECT length(coverage::text) FROM moc1; -- verify that equality doesn't read the whole toasted value EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage = '0/'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage && '0/'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage && '0/1'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage && '0/0-11'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage @> '0/'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage <@ '0/'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage @> '0/1'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage <@ '0/1'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage @> '0/0-11'; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) SELECT coverage FROM moc1 WHERE coverage <@ '0/0-11'; SELECT smoc_degrade(4, coverage) FROM moc1; pgsphere-1.5.1/sql/moc100.sql000066400000000000000000007132451461140101500156570ustar00rootroot00000000000000CREATE TABLE moc100 ( ivoid text, coverage smoc, ref_system_name text ); COPY moc100 FROM STDIN; ivo://cds.vizier/b/assocdata 2/4,19,95 3/13,20,22,24,34,37,40-41,68,74,81-82,92-93,97-98,101,104,128,133,138,140-142,146,150,153,162,168,171,174,233,295,311,340,375,379,405-406,421-423,426,428,432,434-435,439,445 4/1-3,16,20-21,26,29,31,34,45,47,49-51,56-58,60-62,84-86,92,94-95,101,103,105,108-109,113-116,119-121,128,130-132,134,140,142-143,147,153,156,159,168-169,174,176,192,194-195,198,201,203,256-257,259-262,269-271,276,279-280,282-283,286,288,290,292-293,295,301-303,321-323,332,334-337,339,342-346,349,351-353,355-358,362,364,366-367,376-377,379-380,385-387,396-398,400,408,412-413,415,420,422-423,425,432-434,437,440-441,443-444,448-450,452-453,455,458,464,516,518-521,524,538,546-547,556,559,572-574,578-579,581-583,588,590-592,594-595,597,599,604-606,616-618,620-621,623-625,628-630,633-634,636,640-641,643,645-647,652-654,656-658,660-661,663-664,666,668-669,671,676-678,680-681,688-689,691,693-695,700,705,708-710,713-714,736,791,838,840-841,844,850,857,911,922-923,926,931,941,943-944,954,1103-1104,1108-1109,1111,1115,1118,1125,1127,1131-1133,1144,1167,1179,1188-1189,1191-1192,1196-1197,1199-1201,1203-1204,1206,1208,1212,1214-1217,1220,1228,1231,1237-1238,1251,1261-1263,1268,1270-1271,1273,1275-1278,1341,1364,1366,1369,1371-1372,1374-1375,1387,1390-1391,1393,1395,1397,1399,1402,1405-1406,1422,1425,1435,1443-1444,1446-1447,1449,1451-1452,1454,1463,1484-1485,1487-1489,1491,1494-1495,1497,1499,1511,1591,1597,1599,1613-1615,1617,1628,1630,1633-1634,1636-1637,1639-1640,1642-1644,1646-1647,1649-1654,1658-1659,1671,1680,1682,1696-1697,1699-1702,1708,1711,1717-1718,1722-1723,1726-1727,1733-1735,1744-1746,1748-1750,1752,1754-1755,1760-1762,1765,1767,1771,1773-1775,1777,1779,1785-1789,1791,1801,1803-1804,1818,1844-1845,1888,1891,1894,1919,1942,1956-1958,1962,1964-1965,1968,1971,1976,1983,1986,1993-1995,2017,2025,2029,2031,2038,2043,2045-2047,2300,2303,2370,2555,2558,2649,2652-2653,2815 5/0,2-3,16-18,20-21,24,26,32-33,35-38,48-49,51-52,54-55,60-61,63,72-73,75-76,93-95,98,110-111,115,121-123,130,142,161,164-166,170-171,174,185-187,193,195,237,239,252-254,348,350,372,374,400-402,408,416-417,426-429,440-441,443-446,449-451,468,470,472-473,475,488-489,492-493,497-501,504-506,516-517,519,532,542,564,566,581,583,618,633,635,680-682,687-689,691-692,700,708,710,712-713,742-743,745,748-749,754,772,774-775,785-786,791,797,801,803,809,811,816-817,819,825-826,832,834-835,840,897,900-901,928,932,1032-1033,1035,1053,1055,1057-1058,1060-1061,1064,1066,1072-1073,1075,1108-1110,1112-1114,1124-1126,1136,1138,1140-1141,1143,1149-1151,1158,1164,1166-1167,1200,1202-1203,1281,1283,1332-1333,1335,1352-1353,1355,1360-1362,1365-1367,1388,1390,1393,1395,1401-1402,1416,1418,1436-1437,1439-1442,1444-1445,1454-1455,1460-1461,1463,1512-1514,1524-1525,1528,1537-1539,1596-1598,1604,1606,1608,1610,1636-1637,1639,1656-1657,1687,1696-1697,1706,1709,1711-1712,1714-1718,1720-1722,1724,1740,1755,1758-1759,1769,1780,1782,1784-1786,1804-1805,1816-1817,1819,1824-1826,1830-1831,1836-1838,1840-1842,1844,1848,1864,1920-1921,2068,2070,2089,2091-2093,2100-2101,2104-2105,2110-2111,2116-2117,2119,2122,2125-2127,2146,2158-2159,2165,2167,2170,2173-2175,2178-2179,2181-2183,2192-2194,2196-2197,2199-2200,2202-2203,2205,2230,2232-2233,2300-2302,2306-2307,2358-2359,2373-2375,2384-2386,2392,2394-2395,2431-2434,2437,2447,2476,2478-2479,2488-2489,2491,2506-2507,2509-2511,2524,2526,2528,2530-2531,2540-2542,2552,2569-2571,2577-2579,2620-2622,2636-2638,2649,2651,2661-2663,2668-2669,2681,2683,2716,2718,2728-2730,2732-2733,2735,2761,2763,2769-2771,2817-2819,2824-2826,2831,2844,2848,2850-2851,2860,2862,2864-2865,2881,2884,2948,2950,2952-2953,2956,2986,3093,3146-3147,3150-3151,3153,3156,3158,3161-3163,3168-3169,3171-3173,3184-3185,3188-3189,3191,3197-3199,3243,3246,3285,3328-3329,3338-3340,3342-3343,3345,3347-3350,3356,3358-3359,3368-3370,3372-3373,3381-3386,3388-3389,3407-3409,3411-3412,3414,3417-3418,3423-3426,3437,3440,3442,3444-3445,3447,3456,3470-3471,3482,3491-3494,3564-3566,3570,3576-3578,3588-3589,3600,3602,3621-3623,3628-3629,3643,3652,3654,3656-3657,3660-3661,3663-3664,3666-3667,3670,3672,3677,3682-3683,3686-3687,3698-3699,3717-3719,3721,3723,3746,3749,3752,3754-3755,3759-3761,3769-3771,3780-3782,3784-3786,3792,3810-3811,3814-3815,3820,3825-3828,3840,3852,3858,3869,3907-3908,3920,4356,4391,4400,4402-4403,4408-4409,4411,4420,4422,4468-4470,4476,4478,4497,4507,4521,4523,4536,4538-4539,4542,4544,4546,4552,4554-4555,4558,4561,4563-4564,4566-4567,4573,4580-4581,4584-4585,4606-4607,4661-4663,4665,4667,4698-4699,4702-4703,4706,4709-4712,4715,4736,4738-4739,4743-4745,4760-4761,4773,4775,4792-4793,4809-4811,4820,4836-4837,4840,4845,4852,4854-4855,4872,4877,4884,4888,4890,4896,4898,4904,4906,4916,4945-4947,4956-4958,4968,4970,4975,4992,4994-4995,4998-4999,5001,5003,5023,5031-5032,5034-5035,5037,5039,5041-5043,5056,5061,5063,5066-5067,5069-5071,5076-5077,5079,5088-5090,5096-5097,5099,5116-5117,5119,5339,5342-5343,5358-5359,5361-5363,5372-5373,5387,5399,5405-5407,5409-5410,5417,5429,5438-5439,5461-5463,5468-5470,5472-5473,5475,5481-5482,5492,5494-5495,5510-5511,5514,5517,5519,5524-5525,5530,5536,5538,5541-5543,5553-5555,5558-5559,5568-5569,5577,5584-5585,5587,5593,5595,5602,5605,5607,5613-5616,5618,5671,5677,5682-5683,5694,5697,5707,5729,5731-5732,5734,5751,5757,5769,5771,5780,5782-5783,5793-5795,5800,5802,5812-5814,5820,5822-5823,5831-5832,5834,5837,5839,5842,5846-5850,5866-5867,5882-5883,5886-5887,5890,5893,5895,5901,5905,5909,5918,5922,5925,5927-5928,5930-5931,5934,5945,5947,5961,5968,5970-5971,5974-5975,5995,6017,6020,6036-6037,6039,6053,6055,6057-6059,6061-6063,6378,6385,6387,6393,6439,6442-6443,6445-6447,6449-6451,6465-6467,6473,6476,6478-6479,6516-6518,6524,6526,6529-6531,6541-6542,6552-6553,6555,6564,6566-6567,6580-6582,6592,6594-6595,6620-6622,6625,6641,6643-6644,6646-6650,6652-6653,6655,6711,6714-6715,6718,6724,6734-6735,6793,6795,6812,6814-6815,6836-6838,6840,6842-6843,6864-6865,6867,6876-6878,6885,6887,6896-6898,6928,6930-6931,6988-6989,6991,7004,7006,7013-7015,7052,7054,7056,7058,7067,7073-7076,7078-7082,7089,7091,7105,7107,7112-7113,7115,7137-7139,7160-7162,7178-7180,7182,7194-7195,7200,7202-7203,7208,7210-7211,7223-7226,7228-7230,7276,7278-7279,7290-7291,7296,7300,7316,7361,7364-7365,7389,7557-7561,7563,7568-7570,7573,7575,7582-7583,7585,7591,7600-7601,7604-7605,7608-7609,7611-7612,7614,7626,7648-7649,7651,7654-7655,7666,7673,7723,7726-7727,7739,7750-7751,7756-7757,7759,7762,7772,7774-7775,7793,7796,7798-7799,7801,7804-7805,7812-7813,7815,7821,7823,7838-7839,7841-7844,7846,7852,7854,7864-7865,7868,7878-7879,7881-7883,7896,7898-7899,7903,7908-7910,7913,7915-7916,7918-7921,7925,7927,7937,7950,7953,7956,7968-7970,7986,8051,8060,8065,8067,8073-8076,8078,8096-8098,8108-8109,8113-8115,8120-8121,8123,8129,8131-8132,8134,8137-8140,8142-8143,8147,8156,8158,8160-8162,8164-8165,8167-8168,8170,8176,8178-8179,8274-8275,8280,8329,9179,9182-9183,9189,9194-9195,9204-9205,9207,9211,9341,9436,9462,9467,9473,9475,9478,9504,9849,9974,9979,9981,10226-10227,10229-10231,10236-10237,10398-10399,10411-10412,10414,10416-10418,10424,10438-10441,10443-10444,10449-10453,10536,10538-10539,10541-10543,10550-10553,10556,10587,10589,10593-10595,10617,10620,10622-10624,10742,10748,10752-10754,10760,11088,11246-11247,11255,11258-11259,11635,12247,12251-12252,12254-12255,12273,12276-12277,12279 6/4-5,7,76,78,88,93,95,100,102,108,110-111,117,119,122-123,137,139,156-158,161,164-165,167,176-178,180-181,188,201,203,212,214-215,226,228-229,231-232,235,237,248-250,272,274,277,279-280,282-283,285,287,296-297,299,309-312,369,371,390,405,433-435,438-439,451,454-455,457-459,481-483,524,526-527,529,532,538,562,572,574,579,587,597,599,602,611-612,618,627-628,631,635,637-639,650-653,655,668-670,672-673,675,678-679,689-690,692-693,700,703,706,711,713,717,719,736-737,739,768-769,771,779,944-946,952,954,1020,1022-1023,1396,1398,1404,1406,1492,1494,1500,1502,1612-1613,1615,1637,1639-1640,1642,1645,1647,1672,1674,1676-1677,1679,1696-1697,1701-1703,1725,1768-1769,1771,1788-1790,1792-1794,1876-1878,1884,1886-1887,1896-1898,1960-1961,1963-1966,1976-1977,1980-1981,1983-1984,1986-1987,2008,2010,2013,2028-2030,2034,2072,2074-2075,2132-2134,2136,2138,2143,2160,2162,2167,2305,2308-2309,2314,2317,2329-2331,2347,2349,2437,2439-2440,2445,2447,2464,2466-2467,2476,2478-2481,2484-2485,2490-2491,2512-2514,2516-2517,2522-2524,2526-2529,2732-2734,2736-2738,2740,2742-2743,2747,2760-2761,2772,2776,2778,2781-2782,2808-2810,2836-2837,2856-2857,2860-2861,2864-2866,2874,2884-2885,2896-2897,2906,2921-2924,2927,2940,2947-2948,2957-2959,2963,2966-2967,2988-2989,3000-3001,3004-3006,3010-3012,3020,3024,3026,3029-3031,3033,3035-3036,3038,3040,3042,3044,3046-3047,3049-3050,3052,3054,3056-3057,3064,3066-3067,3069,3071,3092,3094,3137-3138,3148,3150-3154,3159-3162,3195-3198,3200-3201,3203,3209-3210,3232,3234,3240,3272-3274,3282,3288,3290,3293,3296,3298-3299,3308-3309,3312,3314-3316,3322,3326,3332,3334-3335,3345,3364-3366,3368-3369,3377,3389-3390,3417-3418,3430,3445,3459-3460,3478,3481,3494,3506-3507,3518,3526,3542,3550,3568,3596-3597,3599,3608-3610,3612,3618-3619,3621-3623,3625-3628,3630,3633,3639,3642,3648-3650,3652,3656,3659,3662,3668,3675,3681,3686,3690,3719,3723,3725,3727,3732,3737,3744-3745,3747,3751-3752,3754-3755,3759,3794,3820,3837,3840,3843,3849,3865,3871,3882,3884-3886,3889,3898,3902,3914-3915,3934,3970,3999,4012,4027,4041,4078-4079,4136-4137,4208-4209,4211,4216-4218,4225-4227,4236-4238,4248-4249,4252-4253,4260,4262,4268,4270-4271,4278-4279,4282,4285,4287,4297-4299,4444,4446-4447,4460,4462-4463,4509-4511,4548-4549,4551,4556,4558-4559,4568-4569,4571,4593-4595,4624,4626-4627,4629,4631,4637,4660-4662,4709,4714-4715,4806-4807,5120,5128-5129,5131,5336,5338-5339,5417,5419,5452,5454,5456,5458-5459,5556,5558,5564,5566-5569,5571,5577-5579,5601-5603,5612-5614,5668-5670,5677-5679,5752-5754,5772-5774,5784-5786,5788-5789,5791,5810-5811,5813-5815,5848,5850-5851,6062-6063,6104-6105,6110,6116,6119-6120,6123,6130,6137,6143,6145-6147,6396-6398,6420-6422,6428-6429,6431,6436-6438,6446-6448,6453,6455,6458-6459,6461-6463,6552-6554,6560-6561,6564-6565,6583,6633,6743-6744,6746-6747,6792-6793,6796,6818-6819,6828,6830,6852-6854,6876-6878,6892-6894,6906,6964-6965,6970-6971,6974-6976,6978-6979,6984,6986,6989,7008,7019,7084-7085,7087,7124-7126,7132,7134,7148-7150,7152-7154,7156,7224-7226,7228-7229,7231,7272-7273,7275,7308,7310-7311,7315,7318-7319,7356-7357,7372-7374,7380-7382,7384-7386,7390,7397-7398,7412-7414,7423,7440,7442,7445-7446,7460,7462,7464,7466,7472,7479,7485,7487,7489,7498,7504,7515,7523,7526,7533-7534,7536,7540,7542,7545,7547,7550,7552,7554-7556,7570,7577,7584,7600,7602-7604,7606-7607,7610,7619,7623,7627,7642,7649,7653,7655,7659,7668,7688-7690,7696-7697,7704,7708,7710,7729,7731,7741,7745,7748,7760,7763,7767,7777-7778,7781-7782,7790,7799,7807,7833,7850-7851,7857,7865,7869-7870,7876,7891,7896-7897,7916,7925,7936,7941,7944,7946,7956-7958,7966,7973,7975,7992,7997-7998,8001,8003,8023-8024,8031,8042,8045,8050,8055,8057,8063,8068,8084-8085,8093,8106,8123,8133-8135,8141,8156,8173,8278,8284,8286-8287,8352-8353,8355,8360-8361,8376-8378,8380-8382,8415,8424-8425,8427-8429,8431,8434-8435,8437-8439,8453,8455,8458,8460,8462,8472-8473,8480,8482,8485,8487,8492,8495,8497-8499,8576-8577,8588,8590-8591,8593,8596-8597,8602,8624,8626-8627,8630-8631,8640-8641,8646,8656-8657,8665,8673-8675,8686-8687,8689-8691,8704,8706-8707,8710-8711,8721-8723,8780,8782,8792-8793,8795,8804-8806,8817,8819,8828-8829,8831,8912,8914-8915,8917,8919,8925-8927,8936,8941-8943,9212-9214,9216,9218-9220,9222-9223,9232,9240,9242-9243,9245-9247,9284-9285,9287,9290,9293-9295,9424,9426-9427,9431,9489-9491,9548-9550,9572-9574,9712-9714,9717-9719,9723,9740,9742,9744-9745,9747,9753,9756-9757,9759-9762,9766,9768,9770-9771,9775,9781-9783,9786-9787,9908,9910,9960-9962,10017-10022,10032-10033,10035,10100-10102,10108,10116,10118-10119,10172-10174,10192,10212-10213,10228,10234,10239,10272-10273,10305-10307,10493-10495,10556,10558,10592-10593,10595,10601,10603,10640-10641,10643,10680,10682-10684,10686-10687,10720-10721,10723,10730,10868-10870,10876,10878-10879,10924-10925,10927,10937-10939,11040,11043,11072,11074-11075,11216-11218,11224,11227-11228,11230,11232-11234,11236,11239-11240,11245-11247,11253,11257,11259,11261-11263,11265,11267,11308,11310,11312-11314,11316-11317,11319,11323,11380-11382,11384-11385,11387,11389,11396,11398-11399,11444-11446,11453,11464,11466,11473,11475,11480,11482,11490,11492,11502-11503,11516,11519-11521,11523,11529,11532-11534,11544,11556,11564,11566,11571,11578,11582,11586,11596,11599,11601,11605,11607,11617,11620,11622-11623,11626,11633,11636,11638-11639,11641,11644,11649,11658,11671,11673,11681,11691,11696,11709,11715,11717,11728-11729,11738,11757-11758,11761,11773,11804,11806,11816-11817,11819-11821,11828,11832-11833,11838,11840,11845,11848,11851,11854,11862,11874,11878,11880,11884-11885,11887,11889,11908,11914-11915,11917,11926,11928-11930,11933,11936,11938,11942,11951,11958-11959,11962,12005,12025,12032,12056,12076-12077,12082,12091,12111,12116,12122,12130,12146,12166,12173,12211,12223,12238-12239,12241,12253,12264,12269,12271,12282,12291,12295,12300-12301,12303,12311,12315,12332,12337,12339-12340,12352,12368-12369,12371,12396,12413,12415,12420-12421,12424,12439,12451,12453,12455,12464,12467,12475,12501,12503,12511,12523,12526,12537,12544,12578-12580,12582,12592,12598-12599,12608-12609,12611,12620-12621,12623,12628-12629,12631,12636,12638-12640,12642,12680-12681,12683,12696-12697,12700-12701,12703-12704,12735,12744,12746,12785,12787,12847,12856,12859,12865,12880,12890,12899,12901-12902,12927,12934,12938,12943-12944,12953,12961-12963,12966,12969-12971,12980,12990-12991,13025,13028,13034-13035,13038,13048,13050-13051,13059,13065,13069,13075,13087,13114-13115,13136-13137,13139,13148-13149,13156,13158,13166,13201,13205,13227,13230,13238,13258,13262,13275,13282,13288,13290,13292,13296,13301,13332-13333,13338-13339,13342,13344,13346-13347,13349-13351,13364,13366-13367,13377,13379,13404,13407,13429-13431,13484-13486,13496-13497,13500-13501,13503,13520,13522-13523,13548-13550,13560-13562,13572-13573,13575-13576,13578-13579,13584-13585,13588-13589,13591,13620,13622-13623,13625-13627,13641,13643,13652-13654,13660,13662,13665-13667,13676,13678,13680-13682,13686-13688,13691,13708,13710,13728-13729,13733,13743,13745,13764,13766,13772,13785,13787,13792-13794,13803,13809,13812-13813,13832,13836,13841,13847,13879,13890,13907,13917,13927,13947,13957-13960,13980-13982,13984,13995,13997,13999,14002,14005,14011,14013,14015-14016,14018,14024,14031,14042,14052,14055,14057-14059,14061-14063,14066,14070,14073-14077,14082,14109,14126,14133,14146,14150-14151,14170,14175,14179-14180,14188-14189,14191,14197,14199,14217,14239-14240,14246-14249,14253-14255,14271-14274,14278-14279,14285-14287,14289-14294,14296,14298,14300,14302-14303,14316-14317,14319-14322,14329-14331,14335-14338,14340-14342,14348,14350,14363-14365,14369,14373,14385,14388,14404-14405,14407,14413,14416-14417,14419-14422,14425-14428,14430-14431,14447,14449,14452,14455-14457,14459-14460,14477,14479,14481-14483,14501,14522,14530,14534,14536,14538-14539,14558-14560,14567,14592,14594-14595,14597-14599,14601-14604,14606-14607,14614-14615,14620-14622,14632,14634-14636,14651,14661-14663,14673-14675,14678-14679,14685,14687,14692,14694,14696-14698,14700,14704,14706-14707,14712-14713,14716-14717,14721,14726-14727,14736,14738-14740,14743,14786-14788,14790,14808,14841-14842,14850,14852,14855,14861-14863,14865-14867,14881,14883,14889-14891,14976,14988,14990,15012-15014,15030-15031,15033-15035,15053,15055,15073-15075,15132-15134,15152-15153,15155,15161-15162,15167,15172-15174,15176-15177,15179,15185,15215,15222,15226-15227,15230,15232-15234,15237,15239,15249,15254,15284-15286,15288-15289,15297-15299,15316,15320-15322,15332,15335-15336,15344,15346,15354,15356,15364-15366,15368-15370,15376-15377,15380-15382,15385,15387,15390,15392,15394,15396,15412,15420,15426-15428,15430,15442-15444,15446,15448-15449,15451-15452,15455,15458,15460,15468,15472-15474,15481,15484,15511,15516-15517,15530,15536,15541,15548,15554,15589,15592-15593,15597-15598,15602,15616,15618-15621,15624,15626-15627,15636,15639-15640,15642,15645,15649,15652,15659,15664,15667,15670,15672-15673,15676,15684-15686,15691,15696,15698,15703,15712,15715,15718,15727,15730,15747,15759,15769,15781,15790,15816,15818-15819,15850,15857,15859,15881,15913-15914,15931,15936,15941,15960-15962,15964-15965,15967,15974,15976,15995,15998,16005,16011,16023,16025,16027,16031,16034-16035,16041-16043,16045,16049,16054,16056,16059,16061,16069,16078,16088,16094,16105,16113,16115,16128-16129,16131-16132,16136-16137,16139,16144,16148,16150-16151,16185-16186,16191-16193,16199,16208,16213,16220,16233,16252,16275,16281,16291,16298,16301-16302,16320,16342,16365,16378,16391,16417,16419,16427,16439,16441,16450-16451,16454-16455,16460,16471,16476,16479,16513,16529-16530,16592,16598,16605,16629,16645,16647,16655-16656,16678-16679,16690,16697,16702,16704-16705,16755,16764-16765,16789,16794,16805,16807,16812,16821,16865,16871,16880,16883,16886,16888,16892,16952,16958,16981-16982,17019,17066,17075-17076,17084,17091,17099,17110,17119,17124,17136-17137,17171,17183-17184,17215,17219,17230,17234,17237,17245,17249,17256-17257,17264,17266,17286,17299,17340-17341,17344,17351,17370-17371,17378,17380,17394-17395,17407,17414,17421,17428,17438,17451,17458,17460,17472,17486,17492-17494,17496,17499,17502,17506,17508-17509,17516,17525,17527,17532,17535,17541-17542,17547,17549,17551,17557-17559,17573-17574,17576,17578-17579,17581-17583,17588-17589,17591-17592,17594-17595,17598,17604-17606,17619,17627,17643,17685,17687,17693,17695-17696,17698,17703,17712-17713,17716-17718,17721,17725-17726,17761-17762,17764-17765,17767-17768,17773,17775,17812-17813,17817-17819,17822-17823,17829,17831-17834,17837,17857,17859-17861,17863,17865,17867,17870-17871,17884-17885,17908,17910,17916-17918,17925,17927,17941,17944,17947,17955,17957,17960,17963,17965,17972,17974,17986,17997,18021-18023,18025-18027,18060,18063,18067,18074,18078-18079,18090-18091,18149-18151,18160,18162-18163,18165-18167,18172,18174-18175,18180,18183,18188,18190,18192-18193,18195-18197,18200,18203-18204,18206,18212,18214-18215,18226-18227,18241-18243,18260,18262,18289-18291,18300-18301,18303,18328-18330,18346,18352,18373,18378-18379,18381,18384-18385,18387,18398,18401,18406,18413,18415,18433,18436-18437,18439-18440,18450-18451,18466,18475,18482,18496,18506,18526,18542,18553,18557,18561,18566,18605,18614,18624,18628,18639,18641-18643,18666,18688-18689,18709-18710,18712,18715,18726,18734,18753,18755,18760-18761,18773,18775,18781,18783,18800,18803-18804,18816,18818-18819,18821,18833-18835,18858-18859,18948,18950-18951,18965-18968,18970,18986-18987,18990,18997-18998,19050,19052-19053,19055,19088,19096-19097,19099,19104-19105,19108-19110,19112,19124-19125,19127,19129-19131,19179-19181,19183,19232-19234,19284,19286,19288,19290,19312,19320,19322-19323,19352-19353,19355-19358,19364,19366,19368,19370,19377,19384,19492-19493,19498,19503-19505,19507,19540-19542,19544-19546,19558,19564,19566-19567,19570,19572,19576,19579,19597,19605,19607,19609,19611,19613-19615,19629-19630,19670,19672,19674-19676,19678-19681,19684-19685,19726,19730,19741,19743,19745,19758,19765,19767,19778-19779,19836-19837,19839-19840,19843,19846-19848,19850-19851,19867,19888,19895,19897,19972,19974-19975,19986-19987,19990,20000-20002,20008-20009,20032,20034-20035,20038,20041-20042,20044,20046,20049,20052-20053,20061,20064,20066,20071-20072,20074-20075,20078-20080,20086-20087,20089-20091,20100-20102,20106,20110,20113,20118,20121-20123,20132,20134-20135,20144-20145,20147,20153,20155,20161,20163,20237,20241,20243,20249,20251,20258,20273,20275,20313-20315,20364-20365,20367,20393,20395,20473-20475,20483,20530,20574,20657,20678,20685,20707,20725,20753,20755,20759,20764,20767,20788,20804,20809,20820-20821,20823,20829,20831,20847,20857,20859,20862,20870,20886,20894,20896,20915,20929,20935,20949,20958-20959,20974,20979-20981,21010,21016-21017,21030,21032,21055,21060,21068,21073,21076,21082,21100,21111,21121,21143,21171,21177,21209,21215-21216,21233,21266,21269,21280,21303,21307,21316,21326-21327,21343,21352-21353,21355,21360,21386,21389,21409,21419,21421-21423,21427,21430,21440-21441,21443,21477-21480,21484,21497,21500-21501,21503,21507-21508,21511-21513,21518,21523,21526,21529,21536-21538,21540,21542-21544,21547,21554,21564,21580,21589,21591,21608-21609,21612,21617,21619,21633,21635,21644,21646,21650,21662,21666,21673,21677,21682-21683,21688,21690,21696,21699,21704,21713,21715,21720,21723,21725-21726,21729,21738-21739,21747,21750-21751,21841-21843,21884-21886,21896-21897,21899,21920,21922,21933-21935,21972,21974-21975,22016,22021-22023,22029-22030,22032,22034-22036,22038-22039,22048,22050,22053,22062,22065-22067,22073,22075,22080,22082,22085,22087-22088,22095,22105-22106,22108-22109,22111-22112,22114-22115,22117,22124-22126,22128,22132,22134,22137,22148,22150-22151,22156-22158,22160-22161,22163,22176-22178,22180-22181,22184-22185,22187,22189-22191,22208-22210,22226-22227,22230-22231,22280-22282,22284-22285,22287,22305,22312-22313,22316-22317,22319,22344-22345,22347,22370-22371,22376,22378-22379,22402,22405,22412,22414,22416-22417,22419,22424-22426,22450-22451,22468-22470,22476,22478,22513,22516-22517,22523,22527,22534-22535,22555,22558,22577,22594,22602,22622,22628,22632-22633,22635,22637,22645,22651,22654,22658-22659,22679,22701,22717,22721-22724,22751,22768,22770-22771,22773-22774,22780,22782,22784,22787,22796-22797,22799,22818,22822-22823,22833,22836,22841-22843,22850,22854-22856,22860-22861,22866,22868,22871,22873,22878-22879,22896,22900,22902-22903,22909,22913,22915,22921,22923,22933-22934,22940,22942-22943,22949-22951,22957,22959,22983,22995,22998-22999,23001,23003,23008,23010,23013-23014,23016,23018,23021-23022,23025,23027,23033,23036-23037,23051,23061,23063,23069-23071,23082-23083,23124,23126,23168-23170,23204,23207,23213-23215,23260-23261,23284,23286-23287,23306,23312-23313,23316-23317,23323,23332-23333,23335,23342,23344-23345,23347,23353,23360,23363-23364,23374-23375,23382-23383,23404-23406,23428,23431-23432,23451,23454,23459,23463,23473,23482,23487,23493,23514-23515,23518,23525-23527,23537-23540,23543,23553,23555-23557,23559,23564,23566-23568,23571,23576-23577,23579,23585,23589,23591-23593,23597,23600-23601,23603,23609,23611-23613,23615-23617,23619,23624,23626-23629,23631,23633,23635,23640,23644-23646,23648-23649,23656,23658-23659,23661-23666,23676,23678-23679,23682-23683,23692,23694-23695,23698,23704-23706,23716,23718-23719,23730,23733,23735,23742,23776-23777,23785,23840-23841,23843,23850,23853,23855,23876,23878,23888,23893-23895,23936,23938,23941,23943-23944,23946,23949,23951,23969,23971,23973-23976,23978-23979,24064-24065,24067,24074,24076-24077,24084,24087-24089,24096,24098-24099,24103-24104,24123,24130,24133,24152-24153,24155,24160,24169,24200-24201,24203,24205,24209,24211,24217-24219,24225-24227,24241-24243,24581,24608,24638,24671,24678-24679,24700,24715,24726,24733,24765,24777,24793,24828,24837,24839,24845,24853,24855,24877,24898,24902,24908,24913,24920,24924-24925,24942,24951,24964,24986,25013,25015,25018,25051,25060,25078-25079,25081,25083,25087,25089,25113,25137,25141,25145,25192,25196,25198,25200,25225,25228,25246,25255,25269,25274,25302,25312,25316,25333,25344,25356,25366,25407,25423,25428,25434-25435,25437-25439,25444-25445,25447,25450,25452-25453,25455,25490,25493,25500,25503,25509,25516,25518-25519,25526-25527,25530,25535-25537,25539,25545,25547,25569,25571,25579,25581-25583,25607,25610,25630,25641,25680,25692,25694,25711,25714-25715,25722,25724-25725,25727,25741-25742,25766-25767,25778-25779,25793,25795,25857-25859,25888-25889,25891,25898-25899,25901-25903,25909-25911,26076-26078,26100,26103,26110,26113-26115,26160-26162,26173-26175,26216-26217,26219,26260-26262,26332,26334,26372-26374,26492-26493,26495-26497,26499,26504,26507,26510-26512,26514,26516-26518,26521-26523,26526-26527,26561,26563,26569-26571,26580,26582-26583,26604,26606-26607,26617-26619,26657,26673,26676-26677,26690,26699,26706,26709,26711,26714-26715,26717-26719,26725-26727,26733,26758,26767,26783,26791,26797,26811,26813-26815,26832-26833,26836-26837,26839,26869,26871,26877-26879,26902,26904-26906,26909,26911,26929-26930,26933-26935,27168-27169,27171,27177,27179,27252,27254-27255,27356,27358-27359,27365-27367,27464,27466-27467,27516,27518,27520,27522,27524-27525,27527-27528,27534-27537,27539,27545,27596,27598,27600-27601,27603-27606,27608-27609,27613-27615,27716,27718-27719,27960,27962,28020-28021,28023,28028-28030,28049-28051,28212-28213,28220-28221,28223,28229-28230,28236-28237,28239,28256-28258,28261-28264,28289,28308,28310-28311,28332-28334,28355,28361-28363,28416-28417,28419,28425-28427,28456,28459,28545-28547,28653-28655,28682,28685-28687,28689,28696,28698,28701-28702,28704,28706,28709-28711,28725-28727,28733-28735,28749,28753,28755,28759,28762-28763,28765-28767,28770-28771,28773-28774,28786,28791-28792,28794,28798-28799,28804-28806,28837-28839,28880-28882,28884-28886,28888-28890,28908,28910-28911,28924-28926,28932,28937,28958-28960,28962-28963,28966,28970-28972,28975-28976,28987,29014,29016,29022,29032,29039,29052-29053,29058-29059,29061-29062,29064,29066-29068,29070-29071,29075,29077,29081,29084,29110-29111,29121,29142,29145,29152,29154,29168,29170-29171,29174,29176,29178,29188-29189,29191-29193,29196,29204,29207,29209-29210,29212-29214,29216,29218,29232-29233,29238,29247-29250,29252-29253,29255-29257,29259-29261,29270,29272-29274,29277,29279-29280,29284-29285,29287,29292,29295,29297,29301,29303,29306,29347,29349,29353,29362-29363,29366-29367,29372,29393,29427,29440,29448-29449,29453-29454,29465-29466,29469-29470,29476,29478,29481,29488,29494,29497,29502,29537,29539,29541,29543-29544,29548-29549,29552-29554,29564-29565,29567,29570,29572,29576,29589,29600,29623,29632,29653,29655,29657,29659-29660,29675,29680,29682,29714,29731,29755,29765-29766,29769,29776,29785,29790,29793,29795,29800-29801,29820,29823,29837,29839-29840,29843-29844,29848,29857,29861,29863,29865-29867,29869-29870,29875-29876,29883-29884,29886,29906,29912-29913,29920,29922,29926,29934-29935,29946,29951,29953,29963,29996,30025,30041,30048,30052-30053,30058,30062,30064-30065,30073-30075,30083,30099-30100,30103,30106,30110-30111,30122-30123,30125-30126,30128,30132,30135,30139,30142,30144,30147,30150,30153,30160,30163,30166,30174,30176,30183,30187-30188,30196-30197,30199,30204,30207,30225-30227,30248-30250,30284,30286,30288-30290,30297,30299,30320-30321,30323,30325,30337-30339,30344,30346,30348,30353-30355,30357,30359,30361-30363,30375,30377,30379-30381,30383-30385,30389,30391,30397,30409-30410,30413-30414,30424-30425,30428,30430,30440-30441,30443,30452,30460,30462,30464,30466-30467,30470,30472-30473,30475-30476,30479-30480,30496,30499,30501-30502,30511,30517-30519,30527,30529,30532,30535,30537,30545,30562,30565,30572,30575-30577,30579,30600-30602,30610-30611,30614-30615,30624-30626,30628-30629,30631,30633-30634,30640-30641,30644-30645,30647,30653,30658,30663,30668,30670-30671,30682,30687-30688,30690-30691,30697,30701,30730,30732-30733,30738,30741,30743,30745,30750,30771,30779,30792,30795,30798,30803-30804,30814,30818,30821-30822,30825,30833,30848,30861,30878,30887,30898-30899,30902-30903,30939,30944,30954-30955,30965,30970-30971,30973-30975,30989,30998-30999,31011,31019,31033,31041,31043,31054-31055,31062-31063,31066-31067,31069-31070,31093-31095,31121,31130,31144,31146-31147,31150,31158,31161,31176,31181-31183,31188,31190-31191,31202-31203,31211-31212,31228-31229,31231,31236-31237,31239-31240,31245,31256-31257,31259,31267,31279,31281,31283,31289,31291,31344-31346,31351,31360-31361,31363,31380-31381,31383,31388-31390,31412-31414,31422-31423,31465-31466,31468-31469,31478,31480,31486,31520-31521,31556,31559,31562,31576,31590,31611,31644-31646,31648-31649,31651,31656-31657,31668,31670-31671,31688-31690,31692-31693,31695,31697-31699,31705-31707,31716-31717,31719-31720,31722,31725,31744-31746,31752-31753,31755-31758,31760-31761,31763-31764,31766-31767,31769-31770,31773-31775,31794-31796,31798,31805-31807,31809,31817,31820-31821,31823,31828,31830,31832-31834,31841-31843,31848,31857,31885-31887,31936,31938-31939,31968,31970,31976,31978,31987,32000,32017,32019,32023,32034,32067,32070,32080,32083,32087,32089,32095-32096,32102,32117,32120,32175,32181-32182,32185-32186,32192,32197-32199,32202-32203,32208,32210-32211,32216-32217,32224-32225,32227,32256-32257,32259,32265,32289-32291,32308,32310-32311,32316,32318,32322,32325,32335,32343,32357,32366-32367,32378-32379,32381-32383,32396,32416,32418-32419,32424-32426,32450-32451,32489,32491,32515,32521,32523,32532,32534,32540-32542,32545-32547,32564,32566-32567,32580,32587,32594,32600,32602,32638,32652,32654,32665-32667,32676,32678,32686,32708-32709,32711,32812,32825,33015,33036,33045,33048,33051,33053-33054,33073,33076-33077,33079-33080,33091-33092,33094,33104,33107,33109,33112-33113,33115,33126,33128,33140,33175,33202,33243,33273-33274,33281,33294-33295,33297-33298,33304,33306,33311,33321,33323,33328,33330,33400,33456,33459-33461,33464,33543,33552-33553,33563,33580,33610,33668,33670,33692,33706,33717,33758,33764,33769,33783,33796-33797,33810,33865,33905,33912,33942,33945,33955-33956,33990,34017,34051,34060,34074,34104,34107,34122-34123,34126,34130,34139,34145,34207,34210,34250,34262,34264,34273,34304,34324,34326,34350,34355,34368,34385,34401,34445,34493,34498,34517,34531,34571,34580,34632,34675,34684,34694,34723,34737,34762,34765,34770,34821,34833,34839,34843,34849-34850,34864,34879,34881,34927,34935,34957,34962,34995,35032,35042-35043,35049,35051,35076,35079,35108,35118,35121,35158,35211,35314,35318,35321,35324,35347,35357,35364,35388,35396,35422,35440,35453,35481,35503,35567,35589,35626,35629,35631,35651,35654,35658,35673,35691,35696-35697,35702-35703,35713,35717,35724,35742,35759,35761,35763-35764,35766,35768,35786,35816,35875,35892,35911,35915,35935,35993-35994,36027,36035,36057,36078,36081,36126,36136,36155,36159,36188-36189,36194,36221,36253,36261,36266,36287,36336,36338,36342,36373,36377,36379,36388,36443,36446,36452,36489,36540,36554,36564,36586,36590,36598,36621,36632,36635,36651,36655,36659,36664,36671,36690,36693,36697-36698,36710-36711,36713-36715,36722-36724,36726,36745,36762,36765,36767,36770-36771,36773,36785,36789-36790,36793-36794,36796,36824-36826,36832-36833,36836-36837,36839,36842-36843,36938,36948,36956-36957,36986,37076,37089,37172,37186,37191,37204,37207,37212-37213,37235,37239,37242,37244-37245,37247,37303,37310,37317,37332,37334-37336,37340,37342-37343,37345,37347-37348,37355,37360-37361,37363,37369,37371,37421,37506,37546,37608,37625,37673,37686,37693,37697,37701,37703,37705,37708,37710-37711,37713-37715,37717,37720-37722,37724,37726-37727,37730-37732,37734,37736,37743,37748,37750,37752-37754,37757,37765,37785,37787,37791,37818-37819,37826,37828-37829,37831-37832,37834,37837,37839,37843-37844,37858,37861,37863-37865,37872,37876-37877,37881-37884,37886,37890-37891,37896-37898,37904-37906,37911,37916,37918,37936,37939,37941,37948,37959,37962,37978,37982,37991,38001,38024-38026,38031,38033-38034,38041,38047-38049,38052,38062-38063,38086,38088,38151,38175,38219,38268,38274,38360,38382,38391,38406,38408,38410,38412,38430,38432,38436,38449,38496,38526,38531,38533,38539,38541-38542,38561,38563,38569,38572,38579,38581,38591,38634,38653,38660,38704,38733,38741,38744,38763,38787-38788,38846,38907,38912,38936,38949-38950,38985,39069,39143,39183,39189,39193-39194,39199,39205,39209,39217,39220,39223,39232,39236,39238,39244-39246,39250,39257-39258,39261,39266-39270,39276,39278-39280,39283,39286,39291,39318,39320,39354,39360,39364,39366,39371-39372,39374,39379,39387,39391,39401,39404,39406-39407,39412,39418,39420,39434,39464,39544,39684,39693,39696,39702,39705,39709,39741,39745,39747-39749,39751,39753-39755,39757,39759,39762,39766,39774-39775,39781,39783,39793,39795,39800,39802,39804,39806,39836,39852,39860,39868,39871,39873-39874,39877,39888,39890,39892,39905,39907-39908,39910,39912,39915,39921,39923,39932-39934,39937,39956,40040,40060,40090,40095,40114,40117,40123-40124,40133,40143,40146,40159,40168,40177,40222,40237,40248,40279,40293,40305,40326,40336-40337,40344,40351,40395,40410,40442,40452,40480,40486,40496,40567,40571,40580,40587,40590,40608-40610,40614,40618-40619,40621,40624,40629,40635,40651,40679,40692,40716,40722,40725,40730,40740,40750,40771,40776,40779,40783,40789,40791,40795,40797,40812,40823,40825,40844,40858-40859,40862-40863,40869,40871,40877,40896,40899,40901-40903,40913,40915,40957-40959,41115,41132,41154,41213,41227,41231,41285,41300,41336,41404-41406,41428,41437,41450,41452,41454,41456,41463,41465-41468,41470-41472,41495,41525,41534,41551,41558,41567,41570,41572,41575,41580-41581,41583,41586,41590-41591,41602,41608,41610,41615,41622,41624,41629-41631,41636,41638-41639,41641,41652-41653,41655,41660,41662,41677-41680,41682-41684,41687,41692-41693,41695,41700-41702,41705,41710,41713,41715,41717-41718,41725,41728-41729,41732,41734,41736,41738,41741-41743,41745,41749-41751,41768-41770,41780-41781,41785-41786,41788,41792,41794-41795,41816-41817,41820,41822,41825-41828,41832,41837,41841,41854,41856,41858-41859,41862,41864,41869,41873-41874,41876-41877,41881-41882,41896,41903,41912,41917,41936,41943,41946,41950,41998,42027,42037,42056,42059,42081,42088,42090,42095,42101,42109,42133,42135,42137-42138,42140,42160,42162-42163,42176,42181,42186,42190-42191,42193-42196,42199,42216-42218,42220,42223,42228-42230,42232-42234,42237-42239,42248,42259,42274,42285-42286,42289,42296,42300-42302,42310,42313-42314,42335,42344-42346,42353,42361-42362,42364,42366-42367,42370-42371,42400-42401,42403,42410,42413,42417-42420,42422-42423,42431,42464-42465,42467,42474-42476,42479,42485-42487,42500-42502,42504,42508-42510,42512-42514,42516-42517,42519,42523,42526,42532,42536,42540,42547,42555,42560,42564,42568,42572,42575,42577,42583,42589,42595-42596,42598-42600,42609,42611,42614,42621,42639,42644,42669,42683,42704,42736,42738,42753,42758,42760,42770,42772,42777,42784,42801,42811,42819-42822,42824,42828,42832,42835-42837,42842,42863,42872,42883,42897-42898,42901,42907,42910,42952,42955,42959,42972,42977,42980-42982,42987,42989-42991,43000,43004,43020-43021,43024-43025,43027,43029-43030,43033-43034,43036,43044,43046,43048-43049,43051,43053-43054,43063-43064,43077,43080,43083,43086,43092,43105,43138,43144-43145,43150,43152,43163,43169,43187,43228,43236,43261-43263,43339,43358,43360,43366,43399,43444,43579,43627,43634,43677,43806,43822-43823,43874,43877,43881,43883-43884,43890,43901,43908,43927,43936,43970,43977,44006,44015,44026,44034,44043,44101,44155,44159,44191,44213-44214,44220,44227,44243,44247,44260,44278,44281,44284,44319,44356-44358,44360,44364,44366-44367,44369,44371,44374,44378-44379,44382,44384,44389,44439,44461,44499,44502,44507,44542,44569,44584,44593,44614,44633,44638,44644,44653,44661,44669-44671,44702,44713,44718,44722,44741,44748,44757,44771,44776,44783,44786,44795,44805,44809,44812,44816-44817,44822,44832,44842,44859-44861,44863-44864,44866-44867,44879,44892,44899-44900,44915,44921,44931,44937,44945,44955,44979,44982-44983,44992,44998,45003-45004,45011,45017-45019,45026,45029,45094,45107,45169,45223,45285,45417,45421,45424-45425,45438,45526,45536,45539,45554,45564,45668,45692,45766,45784,45794,45859,45862,45882-45883,45886,45893-45894,45925,45927,45946,45960,45964,46001,46008,46045,46055,46072,46079,46097,46130,46218,46234-46235,46239,46312,46315,46388,46399,46424,46444,46459,46463,46491,46494,46523,46525,46535,46545,46552-46554,46556,46558,46560,46562,46564-46566,46571,46574,46576,46584,46586,46588,46615,46628,46631,46636,46660,46681,46712,46734,46831,46851,46891,46939,46964,46997,47011,47014,47027,47078,47154,47185,47209,47287,47360,47395,47434,47509,47526,47533,47540,47559,47571,47574-47575,47674,47706,47742,47752,47793,47814,47825,47828,47836,47855,47868,47884,47941,47956,47967,47991,48023,48060,48105,48113,48223,48260,48263,48265,48274,48277,48283,48299,48313,48367,48394,48516,48519,48525,48556,48562,48572,48576,48587,48589,48595,48610-48611,48614,48652,48685-48686,48700,48724,48728,48736,48742,48749,48759,48768,48775,48798,48803,48819,48828,48871,48877,48906,48922,48964-48965,48981-48983,48997-48999,49001,49003,49013-49015,49026,49042,49049,49063,49066-49067,49088,49112-49114,49120-49121,49125,49128,49139,49141 \N ivo://vopdc.obspm/imcce/m4ast 0/0-11 \N ivo://ned.ipac/sia 0/0-11 \N ivo://cds.vizier/b/swift 5/67-68,73-74,280,447,480,595,602,616,655,666,889,928,1085,1121,1215,1279,1300,1354,1441,1457,1493,1544,1630,1662,1798,1811,1834,1857,1928,2007,2049,2123,2365,2367,2585,2640,2737,2744,2758,2785,2944,3101,3212,3215,3235,3251,3258,3276,3306,3369,3416,3437,3562,3585,3673,3683,3689-3690,3713,3898,3998,4118,4337,4361,4495,4499,4504,4517,4524,4551,4626,4714,4776,4891,4927,4976,5100,5173,5237,5254,5302,5321,5359,5422,5509,5531,5541,5561,5563,5633,5797,5802,5867,6064,6513,6702-6703,6741,6765,6781,6790,6793,6811,6814,6832,6835,6837,6934,6968,6984,6990,7002,7008,7020,7026,7032-7033,7179,7204,7206-7207,7212-7213,7215,7217,7221,7224,7228-7230,7242,7254,7275,7278,7301,7304,7322,7380,7383,7554,7561,7564,7578-7579,7582,7604-7605,7617,7626,7651,7849,8206,8269,8272-8274,8283,8286,8317,8323-8324,8326,8329,8353,8450,8456,8481,8488,8536,8575,8578,8610,8615-8616,8623,8659,8686,8816,8910,8943,8971,9046,9122,9335,9341,9355-9357,9359,9378,9380,9390,9408,9410,9446,9462,9478,9482,9504,9764,9871,9949,9973,10062,10120,10239,10535,10539,10551,10553,10556,10596,10875,10937,10946,11007,11072,11375,11440,11703,11814,12280 6/0,5-8,18-19,21-22,24,27,42-43,48-50,85,92,97,100,102,106-107,110,112,115-116,128,134,136,140,142,144,155-156,158,163,166,169,171-174,181,186,205,207-208,210-211,218-219,226-227,231,233,236,243,248,256,258,260-261,263,266-267,279-280,282,287,289,291,309,311,314,319-320,323,325,330,332,334,336,338,342,344,347,351,357-359,364-365,383,387,391-393,396,398-401,403,406,412,421,427-428,434,438,440,445,447-448,452-453,462-463,465,471-472,479,481,487,499-500,503,505-506,510-511,514,518,521,524,529,540,549,551,555-557,560,565,567,579,590,594,597,602,604,610-612,614-615,628,646,659,661-663,671,673-674,676,679,684-685,687,697-698,700,710-711,716,718-719,723,725,727,731,739,741,745-746,759,763-765,769-770,772,778,783,789-790,797,805,808,815-816,824-825,833,837,845,851,853,858,861,874,879,888,893,897,901,904,907-908,910-911,918-920,923,928,933,938-939,941,943-944,946,950,953,955,961-962,966,974,980,985,987,991-992,995-997,999,1001,1005,1007-1008,1012-1014,1017,1020-1022,1024-1025,1028,1036,1041,1044,1047,1049,1051,1063,1069,1074,1077,1085-1087,1093-1094,1102,1111,1113-1114,1128-1129,1133-1134,1137-1138,1151-1152,1154,1159,1166,1177-1179,1182,1191,1193,1199,1208,1226-1227,1231-1232,1239,1245,1250,1262-1263,1270,1272,1276,1284-1286,1295-1296,1320,1327,1330,1342,1357-1358,1382,1388,1390,1395,1397,1402,1405,1412,1419,1432,1434,1436,1446,1450,1453,1461,1465,1467-1468,1476,1493,1507,1509,1516,1520-1521,1523,1526-1527,1539,1546-1547,1551,1556,1558,1561,1566,1570,1572,1577,1580,1582-1583,1591,1596,1599,1603,1610,1613,1617-1618,1632,1634,1638-1639,1642,1652,1654,1666,1671,1677,1679,1682,1684,1687,1694-1695,1698-1702,1704-1705,1709,1716,1720,1722-1723,1737-1738,1757,1760,1768,1774-1776,1778-1779,1781-1784,1786,1796-1798,1803-1804,1806,1819,1821,1827-1828,1833,1836,1841,1848,1853,1858,1862-1863,1884,1886,1897,1918-1919,1931,1947,1952,1955,1959-1960,1962,1965,1967,1970,1973,1976,1979,1984,1988,1999,2004,2006,2009,2019,2028,2031,2035,2038,2044,2051,2058,2060-2062,2064,2066-2067,2069,2071,2073,2076,2078,2085,2089,2091-2092,2094,2096,2098,2100,2107,2110,2117,2121-2122,2127,2130,2132-2133,2138,2142-2143,2154-2155,2160-2161,2166,2169-2171,2176,2190-2192,2198,2201-2202,2206-2207,2214-2215,2217-2218,2220-2221,2227-2229,2232,2234,2241,2246,2249,2251-2252,2254,2258,2264-2266,2271,2273,2280-2282,2284,2287,2295-2296,2304,2311,2313,2315,2320,2323-2324,2329,2331-2333,2335-2336,2339-2341,2343,2347-2348,2352-2354,2357,2359,2365-2366,2372,2377-2378,2387-2390,2393,2395,2401-2402,2413-2415,2418-2419,2427,2433-2435,2440,2442-2443,2446,2456-2457,2468-2469,2472-2473,2478,2485-2486,2501,2505,2510,2512,2520,2534,2536-2537,2539,2542-2543,2546,2549,2551,2557,2559,2564,2568,2574,2584-2586,2589,2591,2599,2606,2613,2615,2627,2631,2634,2640-2641,2647,2658,2661,2668-2669,2676,2681-2682,2684,2686,2700-2701,2703-2704,2706,2708-2710,2721,2723,2729,2733,2735,2737,2741,2746,2750,2752,2755-2756,2760,2762-2764,2782-2783,2786,2790-2791,2798,2808,2822,2836-2837,2846,2854-2855,2858,2861,2864,2866,2879,2885,2888,2904,2906,2908,2911,2918,2921-2922,2924-2926,2931,2933,2938,2940,2944,2955-2956,2961-2962,2971-2972,2985-2986,3002,3007,3010,3018,3023-3024,3027,3029-3030,3035,3038-3039,3041-3042,3044,3056-3057,3059,3063,3070,3073,3075,3082-3083,3085,3089-3090,3093,3096,3099,3102-3105,3124,3140-3141,3149,3156-3158,3160-3161,3163-3164,3168-3169,3184-3186,3188,3201,3204,3209,3216,3219,3222-3223,3231,3237,3239,3242,3252,3263,3269-3271,3275-3276,3278-3279,3283,3293,3297,3299,3301-3302,3304-3305,3307-3309,3316,3322,3328,3331,3333,3341,3346,3348,3354,3364,3369,3375,3381,3383,3387,3389,3393,3405,3409,3412,3415-3416,3425,3431,3434,3437-3441,3469,3471,3474,3476,3480,3482-3483,3486,3495,3502,3505-3508,3516-3517,3519,3524-3525,3536,3543,3551,3553,3566,3582,3589,3596,3608,3610-3611,3614-3615,3618-3619,3626,3629-3630,3632-3634,3638,3644,3646,3649,3652,3659,3661,3675,3687,3693,3700,3703,3706,3723,3726,3728-3729,3737,3739,3745,3750-3751,3761-3762,3771-3772,3777,3785,3788-3789,3795,3820,3824,3826,3832,3839,3843,3845-3846,3849,3861,3873-3874,3876,3882,3886,3888,3894,3898,3904,3927,3929,3932,3940,3950-3951,3965,3979,3982,4000,4008,4013,4019,4025-4027,4032,4050,4053-4054,4070,4078-4079,4088,4096,4100-4101,4104,4108-4110,4114,4116,4121-4122,4134-4135,4138-4139,4141,4149-4150,4155,4159-4160,4173-4174,4178-4179,4181,4187-4190,4192-4193,4201,4204,4211-4213,4215,4225,4228,4230,4252,4255,4260-4261,4268,4272,4276,4278-4279,4285,4296,4298-4300,4308,4311-4313,4317,4322-4323,4328-4329,4331-4332,4336,4339,4345,4353,4365,4367,4369-4371,4373,4375-4377,4382,4384,4391,4397,4399,4404,4409-4410,4415,4419,4421,4432,4435-4436,4439,4444,4446,4449-4450,4453-4454,4460,4469,4473,4475-4477,4479,4488,4494,4501,4508,4510-4511,4522-4524,4534-4538,4540,4543-4544,4548-4550,4558,4565,4572,4577,4587-4588,4594,4597,4604,4610,4622,4640,4642,4646-4647,4650-4651,4653-4654,4656,4658,4665-4667,4669-4672,4684,4694-4696,4700,4705,4711,4716,4718,4720,4723,4725,4727,4731,4733,4735,4739-4742,4745-4746,4748,4750,4756-4757,4759,4761,4763,4768,4770,4772,4774-4775,4779-4781,4784,4788,4791,4793,4796,4800,4803,4805,4807,4809,4812-4813,4820,4824,4829-4830,4834,4838,4840,4850,4864-4865,4871,4880,4882,4892,4894,4896,4898,4900,4902-4903,4908-4909,4913,4918,4922,4928,4930,4940,4943,4950,4954-4955,4960,4962,4964,4966,4972,4974,4977,4987,4989-4993,4999,5005-5007,5009,5011,5014,5018,5020,5024,5028,5030,5035,5049,5051-5052,5061-5063,5067,5070,5072-5073,5080,5086,5089,5091,5093,5100,5110,5115,5120-5121,5124,5129,5132,5141-5142,5148-5149,5154,5156,5161-5164,5169,5174,5177,5181,5189,5191-5192,5197,5205,5210,5216,5222,5230-5231,5233,5246,5249,5257,5259-5260,5262,5267,5270,5282-5284,5286-5287,5290,5293,5312,5323,5328-5329,5334,5336,5342-5344,5346-5347,5353-5355,5358-5359,5361,5367,5371,5374-5376,5382,5385,5387,5395,5401,5409,5412,5423,5432,5437,5439-5441,5448,5455,5458,5461,5463,5469-5470,5476,5480,5482-5483,5485-5486,5489,5493,5495,5497,5504,5507,5509-5510,5514-5517,5522,5525-5526,5530,5532,5534,5539,5545-5547,5552,5555-5556,5558,5562,5565-5566,5569-5570,5572,5577,5579,5583-5584,5588,5591,5595-5597,5599,5602-5603,5605-5607,5609-5610,5614-5615,5618,5620,5622,5624-5625,5627-5629,5631,5633,5635-5637,5642,5647,5650,5654,5656-5657,5659-5660,5662,5665,5668,5677,5679-5682,5685,5688,5693,5696,5699,5701,5703,5708,5715,5717-5718,5721-5724,5726,5729,5731,5742,5745-5746,5749,5751-5752,5754-5755,5758,5761-5762,5769,5772-5773,5778,5780,5789,5791,5793-5797,5799-5802,5806-5807,5811,5814-5815,5817,5821,5825,5832-5833,5840,5844,5848,5855,5858,5862,5865-5867,5872-5874,5878-5881,5883,5894,5898-5899,5902,5906,5908,5911,5913,5915,5918,5926,5935,5937,5940-5941,5943,5951,5960,5966,5976,5978-5979,5983,5987,5989-5990,5994-5995,5998,6000,6004,6009-6011,6014-6015,6017-6018,6021,6025,6027-6030,6033,6035-6037,6039-6040,6043-6046,6048,6052-6053,6055,6062,6064-6065,6067,6070-6071,6074,6076-6077,6080-6081,6086-6088,6091,6093,6095-6098,6100-6102,6110-6113,6116,6121,6131,6137,6141,6143,6149,6152,6154,6158,6163-6164,6166-6167,6170-6171,6173-6174,6182,6184,6193,6200-6201,6204,6207,6211-6213,6217-6220,6222-6223,6227,6230-6231,6233-6236,6241-6243,6245-6246,6252,6256,6258,6260-6261,6270,6278-6279,6286,6294,6300,6303,6306,6315,6319,6324,6327,6332,6336,6341-6342,6346,6350,6352,6354-6355,6358,6361-6362,6364,6368,6375-6376,6381-6382,6386,6389,6391,6398-6399,6401,6404,6406,6408-6409,6415,6419-6420,6423,6425,6433,6436,6438-6439,6441-6442,6444-6445,6448-6449,6456-6458,6464,6466,6468,6470,6472,6477,6488,6490,6494,6496,6498-6499,6501-6503,6506-6507,6510-6511,6519,6528-6529,6531,6533-6536,6540,6542,6548,6554-6555,6557-6558,6560,6562-6563,6570,6572,6574-6577,6580,6582-6585,6589-6591,6593,6595,6597-6599,6601-6605,6609,6621-6623,6625,6628-6629,6633,6637-6642,6646-6647,6653,6655-6656,6658-6659,6665,6667,6670,6678-6679,6686,6690-6691,6694,6696,6705,6709,6716-6717,6723,6725,6729,6741,6747,6750-6752,6754-6755,6758,6760,6773-6774,6777,6787,6790-6791,6800,6802,6813,6815,6825,6829,6841,6845,6848,6853,6862,6872-6873,6875,6878,6882-6883,6885-6886,6888-6889,6892,6899,6901-6902,6904,6910,6913,6916-6917,6920-6921,6923,6928,6936-6937,6940,6943,6948,6953,6961-6963,6968,6970,6975,6977,6980-6982,6984,6988,6992,6996,6999,7004-7005,7011,7014,7017,7022,7025,7028-7029,7033-7034,7037-7039,7042-7045,7050,7056,7061,7063,7068,7077,7084,7086,7091,7094,7097,7099-7101,7103-7104,7106-7107,7118-7119,7124,7132,7140,7147,7156-7157,7159,7161,7163,7165-7166,7168-7169,7171-7172,7175-7177,7179-7181,7184,7186,7188,7196,7198-7199,7207,7210-7211,7213-7216,7219,7222-7223,7225-7226,7228,7230-7231,7233-7235,7237-7241,7248,7251,7253-7258,7265,7275-7277,7279-7280,7282,7285,7289,7291,7301,7306-7307,7309-7311,7315-7317,7320,7322,7324,7327-7328,7330-7331,7342-7343,7346,7349,7352,7354,7356,7361-7362,7365,7368,7370-7371,7374-7375,7377,7379-7380,7382,7386-7387,7389-7391,7395-7396,7401,7403,7405,7413,7421-7422,7424,7426,7436,7442,7444,7446,7448-7450,7452,7457,7460,7464,7466-7467,7469,7471,7475,7484,7486,7488,7494,7498,7501-7502,7504,7508-7509,7511-7512,7514-7518,7523,7528,7530,7539,7548,7550,7552-7553,7557-7558,7564,7570-7571,7576-7577,7582,7585,7587,7589,7593,7597-7600,7602-7604,7606-7607,7610-7611,7613-7614,7617-7618,7620,7622-7625,7627-7629,7631,7636,7641-7642,7647,7649-7650,7653,7655,7659,7662,7672,7681,7684-7685,7693,7699,7704,7706,7709,7720,7722,7727-7728,7732-7733,7738,7741-7743,7747,7750,7758,7761,7766-7769,7772,7777-7778,7782,7786,7791,7799-7800,7805,7808,7810-7811,7814-7817,7824,7826,7831,7835,7843-7845,7851-7852,7856-7857,7862,7866-7867,7869,7877-7878,7887,7893-7894,7896,7900,7903,7908,7910-7911,7915,7917,7919,7921,7923,7928,7930,7936,7941-7942,7946-7947,7951-7952,7956,7968-7970,7973,7980,7997-7998,8004,8006,8008,8011,8019,8037,8042,8044,8049,8057,8061,8066,8071-8072,8078,8085,8092,8094-8095,8097,8100,8106,8108-8109,8112,8116,8120-8121,8123,8127,8131,8134-8135,8147,8155,8163,8166,8175,8179,8182,8192,8195,8201,8204-8205,8207-8209,8211,8216-8218,8220,8223,8225,8230-8231,8235,8245-8246,8251,8254-8256,8258-8261,8264-8265,8268-8269,8271,8282,8284-8285,8290,8294,8296-8297,8299,8306,8314,8319,8321,8330,8336,8338-8339,8343,8345-8347,8357,8359,8361,8365,8373-8376,8383-8385,8387,8389,8391,8393,8397,8406-8407,8410,8412,8414,8425-8426,8428,8437,8446,8449-8452,8454,8463,8471,8473-8475,8478-8479,8482,8485-8487,8499,8501,8504,8506,8508,8510-8511,8513,8515,8523-8525,8527-8529,8532-8533,8540,8548,8551-8552,8556,8559,8561-8562,8564,8568,8577,8579,8589,8596-8598,8606,8610,8612-8613,8622,8630-8631,8636,8638,8641,8657-8658,8661,8663,8667,8669-8670,8673,8676,8693,8699,8704,8710-8711,8717,8719,8724,8726-8727,8731,8733,8742-8743,8746,8754-8755,8761,8763-8764,8777,8784-8785,8790,8798,8800,8804-8805,8807,8812,8821,8830,8833,8843,8845,8848,8853,8855,8861,8863,8866,8869-8871,8874,8880-8882,8897,8908,8915,8919,8921-8923,8928,8932,8939,8941,8945-8947,8954-8955,8958,8963,8965,8969-8970,8972,8977,8981,8983,8995-8997,9003,9005,9013,9018,9022,9024,9031-9032,9039,9042-9043,9047,9050,9056,9060,9064,9066,9069,9075,9077,9088,9093,9095,9098-9100,9104,9107,9114-9115,9125,9133,9136,9139,9143,9149,9151,9154-9155,9159,9165,9168,9172,9175,9181-9183,9191-9194,9197,9206,9212,9215,9217,9222-9223,9226,9229,9231-9233,9240,9242-9243,9245,9248,9258,9261-9262,9264,9267,9270,9272-9273,9287,9290,9299,9301,9305-9306,9308,9310,9312,9317,9321-9323,9325,9329-9331,9333-9336,9339,9341,9346-9347,9352-9353,9359,9364,9370,9375,9377,9379,9381-9382,9384-9385,9391,9393,9395-9396,9398,9406,9408,9416,9423,9431,9436,9439,9442-9443,9447,9452,9455,9467,9472-9473,9477,9479,9481-9482,9484,9488-9490,9492,9495,9501,9506,9509-9510,9512-9513,9519,9523-9526,9531,9535,9539-9540,9542,9545,9547,9549,9553,9566,9570,9578,9583,9589,9591,9601-9602,9604,9607,9612-9613,9618,9621,9629,9632-9633,9640,9643,9656-9658,9660,9662,9665-9666,9670,9672,9678,9681-9682,9696,9701,9705,9707,9711,9714,9723,9729,9732-9733,9737,9740,9747-9750,9753,9756,9762,9764,9773,9775,9783,9787,9796-9797,9800,9806-9807,9811-9812,9814,9819-9821,9823,9833,9838,9850,9855,9857,9860,9868,9873,9883,9889,9894,9897,9909,9914,9922,9926,9933,9935,9943-9944,9946,9948,9950,9954,9956,9960,9965,9973,9977,9981,9984,9989,9992-9994,9996,10006,10022,10027,10029-10030,10033,10035,10039,10046,10050,10056,10061,10063,10070-10071,10087,10092,10094,10097,10103,10109,10111,10118-10119,10122,10132,10134-10135,10137,10141,10148,10153-10154,10156,10160,10162-10163,10165-10166,10168,10170,10174,10178,10181-10184,10186,10191,10194-10195,10199,10202,10207,10210,10213,10216,10220,10222,10224,10228,10232,10240,10242,10249-10250,10252,10255,10263,10265,10267,10269,10278,10280,10282-10283,10292,10298,10303,10308,10312,10315-10316,10318-10319,10321,10325,10329,10335-10337,10348,10360,10363-10364,10367,10372,10376,10378-10380,10385,10388-10389,10391,10394,10400-10401,10404-10405,10411,10422,10424,10427,10435,10438,10440,10445,10447,10450,10454,10461,10463,10466,10468,10472,10474-10475,10479,10481-10484,10490-10492,10497,10510-10511,10514-10515,10519,10527-10528,10530,10532,10534,10538,10540,10544,10547-10548,10551,10556,10567-10568,10572-10574,10577-10578,10587,10592,10594-10595,10598-10599,10601,10603-10605,10607,10609-10610,10613-10614,10622,10624,10627-10628,10634,10637-10638,10642,10648-10649,10653,10656,10658-10659,10662-10663,10666,10674,10677,10679-10682,10684,10689,10691,10694,10697,10704-10705,10707,10709,10714-10716,10723,10725,10727,10732,10738,10744,10748-10749,10752,10755,10757-10759,10761-10762,10767,10769,10772-10773,10781,10786,10788-10790,10800-10802,10805,10807,10809-10812,10814-10815,10817-10819,10827,10830,10836,10840-10841,10843,10846-10847,10849,10852,10854,10856,10862,10869,10874,10881,10884-10885,10888,10895-10898,10900,10903,10905,10908,10911-10912,10914,10921,10925,10927,10930,10934-10935,10938-10939,10941,10959,10964,10970-10971,10974-10975,10980-10982,10984,10986,10988-10989,10991-10992,10994-10996,10998-10999,11003,11005-11006,11008,11010,11012,11017-11018,11023-11024,11027,11029-11031,11037-11038,11040-11041,11043-11046,11054-11055,11058,11060-11061,11064,11067-11069,11071-11072,11075,11080-11081,11084,11086-11087,11090-11092,11094-11095,11099,11101-11102,11104,11111-11112,11117-11120,11124,11126-11127,11134,11157-11161,11166,11168,11171,11173,11177-11178,11180,11193,11195,11199,11204-11206,11212-11213,11215-11218,11220,11227,11229-11232,11236,11238,11242,11246,11248,11253,11260,11262-11263,11267,11270,11273-11276,11279,11286-11287,11295,11297,11300,11307-11308,11310,11312-11314,11319,11321,11324,11326-11327,11332-11333,11340,11351-11353,11355,11357,11361,11368,11370-11371,11374-11375,11377-11379,11382-11383,11388-11389,11392,11394,11396,11400,11402,11407,11415-11417,11419-11420,11424-11425,11430,11434,11437-11438,11440,11442-11444,11447-11450,11454,11456-11457,11464-11465,11467,11473,11475-11476,11478,11481-11482,11485,11490-11491,11493,11514-11515,11518,11521,11529,11533,11535,11540,11545,11547,11556,11561,11574,11581-11582,11596-11597,11602,11605,11615,11621,11631,11637,11639-11641,11649,11657-11658,11660-11661,11665,11668,11672-11673,11681-11683,11686,11689,11692-11693,11695-11696,11698,11701,11705-11706,11713-11715,11717,11719,11721,11723,11725-11726,11734,11736,11738,11749,11756-11757,11759,11780,11790,11798,11800,11808-11810,11813,11816,11818,11825,11829,11831,11833,11838,11842,11844,11849,11872,11874,11882,11890,11892,11898-11899,11901,11905,11909,11912-11914,11920,11924,11933,11936-11937,11939,11941-11944,11947,11955,11961,11965,11971-11972,11974-11975,11984,11987-11988,12002-12003,12006-12007,12019-12020,12025,12031,12034-12035,12047,12068-12069,12071,12098,12102,12111,12121,12125,12132,12134,12141,12147,12154-12155,12162,12164,12173,12187-12188,12198-12199,12206,12210,12218,12227,12230-12231,12241,12246-12247,12251,12253-12254,12268,12271-12272,12274-12275,12285,12287-12290,12313,12315-12317,12323,12329,12345,12349,12351-12352,12367,12375,12379-12380,12384-12386,12389,12391,12400,12408,12416,12419,12424-12425,12438,12440,12443-12444,12446,12453,12455,12457-12460,12463-12464,12466,12471,12475-12476,12480,12497,12500,12504-12506,12509-12510,12513,12522-12523,12526,12531,12536,12544,12547-12548,12551,12553,12560,12565,12568,12570,12576,12578,12580,12582,12585,12592,12594,12597,12599,12604,12608,12612-12614,12616,12619,12622,12625,12627,12629,12632-12633,12636,12641,12643,12646-12647,12649,12656,12660,12663,12672,12687-12689,12693-12695,12700,12702-12703,12706,12708-12709,12711,12714,12723,12725,12737-12738,12744,12757-12758,12762,12765,12767,12770,12773,12783,12785,12790,12792,12822,12825-12828,12836-12837,12841,12854,12858-12859,12864,12870,12883,12886,12888,12892,12896,12902,12906,12910,12912,12918,12920-12922,12925,12927,12929,12932,12944-12946,12948,12954-12955,12958-12960,12964,12966,12969,12971-12973,12975-12977,12982-12986,12991-12992,12996,12998-13001,13003,13021,13024,13026,13029,13040,13042,13049,13051,13056,13059,13067,13069,13072,13076-13077,13079-13081,13085,13088,13091,13093,13095,13098-13099,13101,13103,13110,13118,13120,13124,13133,13138,13144-13145,13155-13157,13159,13161-13162,13165,13170,13175,13179,13181-13182,13185-13186,13188,13190-13191,13193,13195,13202,13209,13216-13218,13230,13234,13245,13251-13253,13261,13264,13266-13268,13272-13273,13280,13283,13287-13288,13291,13293,13298,13308,13312,13320,13324,13329,13331,13334-13335,13342,13344-13345,13349-13353,13357,13359,13363,13365,13367-13368,13370,13374,13379-13380,13383,13389,13393,13397-13399,13401-13402,13408,13410,13414,13421,13432-13433,13438,13440,13445,13447,13452,13456,13458-13459,13462-13465,13475,13485,13490,13492,13494,13496,13502,13505,13511-13512,13518,13522,13525,13536,13540-13541,13543-13545,13547,13550-13551,13555,13557-13560,13563,13570,13572,13581-13582,13586-13587,13593-13595,13604-13605,13613-13614,13636-13637,13643,13647,13651,13654,13660,13663,13668,13672-13673,13678,13682,13685-13687,13693-13695,13701,13705-13707,13711-13714,13719-13720,13725,13729-13732,13734,13736,13738,13741,13743,13762,13765,13767,13775,13779,13785,13787,13789-13790,13794,13797,13802-13803,13808,13814,13820,13828,13831-13832,13843,13849,13859,13862,13867-13868,13874-13875,13883-13885,13888-13889,13894-13898,13901,13904,13907,13912,13924,13927,13929,13944-13945,13951-13952,13963,13966,13969,13973-13975,13979-13980,13985-13986,13992,13995,13998-14000,14006,14009-14010,14017-14018,14020,14026,14031,14033,14035,14042,14044,14051-14052,14057,14059,14068,14072,14086,14105,14109,14129,14133,14135,14139,14141,14144,14148,14150,14154,14159-14160,14165,14172,14174,14177,14185,14187-14188,14190-14191,14196,14199,14205,14207,14210,14219-14220,14225-14226,14231,14233,14235,14245,14259,14261-14263,14270,14272,14274,14279,14285-14287,14290,14294-14296,14298-14299,14305-14306,14310-14311,14315-14316,14320,14324,14333-14336,14352-14354,14356-14357,14364-14365,14369,14379,14384,14400-14402,14410,14413-14414,14420,14424,14429,14437,14441,14447,14452-14453,14456,14458,14461,14463-14464,14471,14475,14477,14484,14489,14492,14496-14497,14505,14517-14521,14526,14528-14529,14534,14540-14541,14549,14551,14567,14573-14575,14583,14591,14601,14606,14608,14610,14615-14616,14619,14622-14623,14627,14631-14634,14636-14637,14640-14641,14643,14645,14650-14651,14653-14654,14662,14664-14665,14667,14671,14673-14675,14677,14679-14680,14683,14685-14686,14688-14690,14696-14697,14702,14704,14706,14708-14710,14712,14719-14720,14722-14724,14727,14730,14737-14738,14740-14741,14744,14746,14749,14751,14754,14764,14766-14768,14770-14771,14773,14777,14780-14782,14785,14788,14790-14792,14795,14797-14798,14801,14803-14805,14807,14810,14814-14817,14821,14825,14829,14831-14832,14835-14837,14840,14843,14847,14857-14858,14860,14863,14882,14892,14905-14907,14910,14913,14925,14928,14933,14935-14936,14941,14947,14951,14955,14960,14964,14969-14970,14977,14982,14985-14987,14994,15003-15004,15015,15023,15029-15031,15036,15042,15048,15054-15056,15059,15061,15067,15078,15085,15104-15105,15108,15112-15113,15116,15128-15129,15132-15133,15135,15140,15144,15146-15147,15150,15154-15155,15160,15169,15171,15181-15183,15194-15197,15202,15211-15212,15216,15218,15220,15224,15233-15234,15240,15246,15257,15259-15260,15263,15269,15272,15274-15275,15284,15286-15287,15292,15295,15300,15304-15305,15309-15311,15315,15320,15331,15339-15340,15344-15345,15348,15351,15358,15360,15362-15363,15367-15368,15370-15373,15376,15385,15387,15389-15390,15393,15396-15398,15401,15403,15406,15408,15410,15429,15432-15434,15451,15456,15465,15467-15468,15472-15473,15476,15478,15481,15483,15485-15486,15488,15492,15494,15498,15500,15502-15503,15505,15511,15513,15519,15522,15524,15527,15534,15548,15558-15560,15562,15568,15571,15573,15575-15576,15582,15585,15587,15589-15590,15613,15616,15626,15636-15637,15640,15648,15652-15653,15658,15662,15664,15669,15673-15674,15677,15683,15689,15691,15698,15702,15709-15710,15712-15713,15722,15733,15746,15759,15761,15763,15768-15770,15775,15778,15783,15785,15788,15790,15795,15802,15804,15808,15812,15816,15818-15819,15825,15858-15859,15865,15870,15874,15876,15878,15886-15887,15890,15895-15896,15901-15903,15907-15910,15912,15914-15918,15933,15935-15936,15947,15951-15952,15954-15955,15960,15969,15974,15982,15987,15990,15996,15998,16010,16013,16015-16016,16027,16033,16039,16041-16042,16044,16046,16049,16055,16058-16059,16069,16071-16072,16078,16086,16093,16095,16098,16100,16105-16106,16110,16112,16120,16131,16134,16136-16137,16144,16158,16165,16170,16172,16183-16184,16187,16189,16193,16212,16214,16216,16221,16223,16228,16230,16232,16247,16250,16254,16263,16266,16269,16272-16273,16281-16283,16286,16297-16298,16300-16302,16305,16308,16312,16333,16335,16344,16351,16359,16361,16367,16375,16386-16387,16391,16393,16396,16402,16408,16412-16414,16416,16422,16424,16432,16435-16436,16441,16446-16449,16451-16453,16455,16459-16460,16466,16489-16491,16493,16496,16500,16502,16504,16507,16510-16512,16519,16524,16529,16533-16534,16543-16544,16546,16548,16550,16561,16564,16567,16573,16576,16579-16581,16588-16589,16591,16598,16604-16606,16612,16617,16619,16631,16639,16646-16647,16649-16650,16652,16655,16660-16662,16671,16676-16677,16681,16685-16687,16690,16695,16697,16701,16703,16706,16709,16711,16718,16720,16723-16724,16731-16732,16736,16740,16744,16747,16750-16751,16765,16769,16772,16775-16776,16778-16779,16781,16783,16786-16787,16789-16790,16794-16796,16801,16804,16806,16808,16810,16812,16816-16817,16821-16822,16828,16831-16833,16840-16841,16844,16852-16854,16868-16869,16878-16880,16882,16887-16889,16892,16894,16898,16901,16903,16909,16911,16916-16917,16932,16952,16962,16968,16970-16971,16985,16991,16995,17003,17012,17030,17032,17043,17047-17048,17052,17059,17061,17066,17075,17088,17090,17092,17094-17095,17097,17107,17114,17121-17122,17124,17139-17140,17150,17152,17154,17165,17167-17168,17173,17177,17183-17184,17186-17187,17192,17197,17205,17213-17216,17221,17223,17228,17230-17231,17235-17237,17239,17242,17244,17248,17250-17251,17253,17260,17263,17271-17272,17279,17294,17304,17316,17320,17340-17341,17343,17359-17360,17364-17365,17370,17377,17384-17385,17387,17392,17401,17407-17408,17410-17412,17414,17416,17424,17427-17430,17435-17436,17440,17443,17448-17449,17451,17453,17465,17474,17487,17490-17492,17494-17495,17497,17500,17503,17507-17509,17515-17516,17519-17520,17522-17523,17525-17527,17532-17533,17536-17537,17541,17548,17553,17555,17558,17560-17561,17565,17572,17574,17579,17581-17582,17592,17594,17599-17602,17607,17612-17614,17618-17619,17624,17626-17627,17635,17638-17639,17648-17649,17651,17662,17665-17666,17670-17671,17673-17674,17677,17679,17681,17685,17688-17690,17693,17698,17703,17705,17710-17711,17714,17721,17724,17727,17729-17730,17733-17736,17739-17741,17743,17748-17750,17752,17754-17756,17759,17761,17766-17767,17770,17772,17775-17778,17781,17788-17789,17795,17797-17799,17804,17808-17810,17814,17816-17817,17819-17822,17827,17829,17832-17834,17837,17840-17841,17843,17851,17856-17857,17866,17868,17882-17883,17890,17895-17898,17900-17901,17904,17909,17911,17917,17927-17928,17937,17942,17945,17948-17949,17956-17957,17964-17966,17969,17971,17977,17979,17984,17987,17990-17994,18001-18003,18006-18010,18012-18014,18020-18022,18024-18025,18027-18028,18032,18035,18037,18041,18047-18049,18051,18055,18060-18061,18063-18064,18066,18072,18075,18079,18081,18083-18085,18088,18090,18092,18094,18102,18104,18106-18107,18110,18115,18118,18122-18123,18125,18127,18133-18136,18148,18151,18154-18155,18166,18172-18173,18177-18180,18184-18185,18187,18190,18194,18201,18209-18210,18212-18214,18216,18220,18228,18234-18235,18253,18264-18265,18268,18270-18271,18277,18284,18287,18295-18296,18302,18307,18309,18315,18319-18321,18325-18326,18328,18331,18334-18335,18343,18359,18371,18373,18375,18378,18380,18385,18387-18388,18390,18394,18396,18398-18399,18402,18407,18409-18410,18412,18419,18421,18425,18429,18434,18439,18450,18452,18457-18458,18466,18468,18473,18484,18486,18490-18491,18494,18498,18513,18516,18519-18521,18525,18527,18529,18531,18535,18542,18579,18581-18582,18590,18592,18596,18598,18601,18604,18607,18624-18625,18644,18646,18660-18661,18665-18666,18668,18671,18681,18683,18685,18687,18695,18707,18713,18716,18718,18726,18728,18735,18753-18757,18760,18762,18765,18769,18772-18773,18777-18780,18782,18784,18786,18789,18794,18800,18802-18803,18805,18809,18813,18817,18821,18838-18841,18843-18844,18846,18850,18852-18854,18860-18862,18865,18879,18883,18888-18889,18892,18895,18897,18900,18907-18908,18910-18912,18915,18918,18922-18923,18926,18929,18932,18934-18935,18939-18942,18945,18947,18950,18959,18965,18968,18978,18981,18985-18988,18991,18998,19017,19027,19029-19030,19034-19037,19039-19040,19043,19045-19046,19048-19049,19051-19052,19057,19064,19070,19087-19088,19091,19093,19095-19097,19099,19101-19102,19109,19111,19114-19115,19128,19145,19157,19161,19164,19166-19168,19170,19175,19177-19178,19180,19184,19187,19189-19190,19192,19194,19196,19200,19202,19214,19222,19227,19230,19236-19237,19239,19241,19257,19259,19262,19269,19271,19277,19281,19283,19287,19289,19291,19293,19296,19298,19306,19308,19312-19313,19315,19318,19320,19322,19325,19327,19331-19332,19339,19342-19343,19346,19356,19363,19366-19367,19370-19371,19376,19383,19385,19393,19398-19400,19407-19408,19410-19412,19414-19416,19418,19420,19424,19429,19431,19436-19438,19443,19449,19451-19452,19456,19460-19462,19467,19473,19477,19479,19485,19497-19499,19503-19504,19515-19516,19523-19526,19528,19531,19533,19537-19539,19543-19546,19553-19554,19557-19558,19560,19563,19570,19574,19576,19584,19593,19609,19611,19615-19616,19618-19619,19622,19625,19627,19633-19634,19638-19639,19645-19646,19648,19651-19652,19654,19656,19658,19661-19662,19668,19671-19673,19676,19689,19692,19694-19696,19706-19707,19716-19717,19723,19730-19732,19735-19736,19740-19741,19746,19751,19761,19764,19766-19767,19773,19779,19783,19786,19789,19791,19797,19799,19809-19810,19814-19815,19819,19826,19831,19833,19840-19842,19847,19858-19859,19861-19862,19864-19865,19868,19872-19873,19877,19882-19883,19888,19890-19891,19908-19909,19911-19914,19920,19932,19936,19940-19941,19946,19948-19950,19952,19954,19957-19960,19968,19971,19976,19978,19989-19991,19996,19999-20001,20006-20007,20010,20012,20014,20016-20018,20020,20026-20027,20030-20033,20046,20048-20049,20053,20057-20058,20060-20061,20072-20074,20076,20079,20082-20084,20087,20089,20095-20097,20099,20102,20106,20110,20118,20120-20121,20123-20124,20133,20136,20140-20141,20156,20164,20168,20170,20172,20177,20181-20183,20187-20188,20190-20191,20199,20201-20203,20212,20217,20219,20221,20223-20224,20230,20237,20249,20254,20257,20262-20263,20265,20269,20282-20283,20286-20288,20290,20292,20298-20301,20308-20309,20313-20315,20323,20325,20335,20342-20343,20346,20348,20351-20352,20358,20361-20362,20370-20374,20377,20379,20381,20385,20390,20392,20395,20405,20408,20411,20419,20421-20422,20425,20428,20431-20432,20439,20446-20447,20450,20456,20459-20460,20466,20468,20473,20476,20478,20481-20484,20489-20490,20494,20499,20502,20507,20509-20510,20519-20520,20530,20532,20534,20536-20538,20540-20541,20546-20547,20550,20552-20554,20556,20562,20564,20572,20576,20579,20585-20586,20591-20592,20594-20595,20597-20598,20604,20606,20611-20612,20618-20620,20624,20627,20631,20633-20635,20639,20641-20644,20649,20654-20655,20657,20660,20667-20668,20670,20672,20676,20679-20681,20688,20698,20702-20703,20708,20710,20712,20715-20718,20724-20725,20727,20729-20730,20734-20736,20747,20749-20750,20753,20756,20758-20760,20763,20773-20774,20776-20778,20780-20782,20784,20788-20789,20791-20793,20797,20799,20801,20805-20806,20808-20809,20815,20819,20821,20824-20825,20827,20830,20832-20833,20835,20838-20839,20841,20847,20849,20851-20854,20857,20859,20866-20867,20872,20874-20875,20879,20881-20883,20885,20887-20890,20892-20893,20896,20905,20908,20917,20920-20922,20924,20927-20928,20934-20935,20940-20941,20947,20952-20953,20957,20963,20968,20971,20978,20983-20984,20991,21000,21002-21004,21010,21012,21015,21020,21022-21023,21026-21028,21036-21037,21041,21043-21044,21047,21049,21051,21055-21058,21060-21061,21064,21066,21069-21070,21072-21073,21075-21078,21080,21082,21085-21086,21088-21090,21092,21094-21097,21101,21104,21109,21111,21117-21118,21121-21122,21124,21126,21128,21130,21136-21138,21140,21142,21144,21147,21155,21157-21160,21170,21175,21179,21183-21184,21186,21188,21198-21199,21201-21202,21204,21207,21214,21217-21218,21220,21225,21227,21230,21237,21239,21244,21247,21256-21258,21266-21267,21275,21277-21278,21281-21282,21289,21296,21300,21302,21305-21306,21310,21321,21331,21336,21338,21341,21346,21348-21349,21352,21358,21360,21362,21370,21375-21378,21390,21393,21400-21402,21404,21408,21411,21416,21421,21442,21449-21450,21454,21456,21461,21466,21470-21471,21473,21480,21482-21483,21490,21498,21501,21503-21504,21509,21512,21515-21516,21520-21521,21523,21528-21529,21531,21536,21538,21542-21545,21549-21550,21553-21554,21560-21561,21564,21567-21568,21572,21576,21583-21585,21588,21590,21594,21604,21609,21615,21618,21622-21624,21634-21637,21639,21643,21645-21648,21650,21653,21656-21657,21659-21660,21667,21680-21682,21685,21687,21692,21694,21699,21704,21706,21711-21712,21715,21718-21719,21724,21734,21746,21748,21750,21754,21758,21760,21768,21782,21784-21785,21791-21792,21797,21801-21802,21804,21806,21808-21810,21816,21820,21824,21826,21832-21833,21844-21845,21847,21850,21854,21860,21862-21863,21866,21872,21879,21885,21890,21894,21899,21903,21905,21911,21913,21915-21916,21918,21923,21927,21929,21934-21935,21937-21938,21940-21941,21950-21951,21953,21958,21960,21962-21963,21967-21968,21972,21977-21980,21982,21989-21990,21993,21996,22002,22005,22010-22012,22020-22021,22026,22040,22044-22045,22047,22051,22053,22060,22062,22065-22067,22069,22071,22077,22082,22090,22100-22102,22108-22109,22114-22115,22117-22120,22122-22123,22129,22135,22139-22140,22148-22149,22154,22157,22159,22168-22170,22172,22177,22179,22181,22186,22188,22196,22209,22211,22213-22214,22217,22221-22222,22230-22231,22237,22240-22241,22243,22250,22256,22258,22261,22265,22267,22270-22271,22281-22282,22293,22298,22300-22301,22306,22310,22318,22334,22339,22341,22343,22355,22358-22359,22363-22365,22367,22372,22374-22375,22389,22391,22396,22398,22400,22404,22406,22420-22422,22429,22431-22433,22435,22448,22460,22467,22472,22474,22478,22485,22491,22495,22499,22501,22507,22513,22515,22517-22519,22530,22538,22540-22541,22543,22545,22548-22549,22552,22561-22563,22569,22571,22574-22575,22580,22585,22590,22597,22604,22611-22612,22622,22624,22626,22628,22630,22632-22633,22637-22638,22642,22650,22658,22665,22668,22672,22676,22686-22687,22692-22693,22696,22699,22701,22708,22712,22716,22721,22732,22738-22739,22743-22744,22753,22758,22760,22762,22766-22769,22772,22774,22780-22781,22784,22788-22789,22793,22799,22804,22806,22808,22810-22811,22816,22818,22825-22830,22832,22834,22837,22840,22842,22844,22847,22854-22858,22860,22863,22869-22870,22873-22874,22878,22880-22881,22884,22886,22889-22890,22894-22895,22898,22909,22914,22917,22920,22929,22932,22936-22937,22942-22944,22946-22947,22949-22950,22953,22963,22966-22967,22969,22972,22974-22975,22977,22979,22985-22988,22993-22995,23001,23003,23009-23010,23013-23015,23017-23019,23023,23025,23027,23030-23031,23033,23035,23037,23039,23047-23048,23053,23056,23060,23062,23064,23066-23069,23071-23073,23077-23078,23083,23085,23092,23094-23095,23097,23099,23101-23103,23106,23113,23121,23126-23127,23134-23135,23138,23142,23144-23145,23151,23158,23160,23165,23167,23171,23174,23176-23178,23181,23197,23203,23205,23212,23214-23216,23218-23219,23222,23227,23237,23240,23247-23248,23254-23255,23258-23259,23261,23263-23264,23269,23273,23275,23278,23282,23284,23292,23294,23306,23320,23322-23324,23332,23334-23335,23339,23344-23345,23353,23355,23364,23366,23368,23379,23384,23387-23389,23393,23397-23399,23402,23406,23416,23427,23436,23440,23447,23457,23461-23463,23465,23473,23476,23480,23482-23483,23485,23492,23509-23510,23513-23514,23516,23518,23523,23529,23535-23537,23539,23542,23544,23547-23548,23550,23552,23560,23566,23571,23573,23575-23578,23585-23587,23592-23594,23599,23601,23616,23618,23621-23622,23624,23633-23637,23642,23644,23646,23652,23659,23663,23668-23669,23678-23680,23685,23690-23691,23702,23705-23706,23710,23714,23718-23719,23721,23724,23728,23734,23736,23738-23739,23757-23758,23761-23762,23764-23765,23767-23769,23772-23773,23782-23783,23789,23794,23798,23805,23808-23809,23815,23820,23826,23828,23830,23835-23836,23852,23857,23869,23884,23892-23893,23897,23906,23909,23913,23916,23920,23924,23932,23938,23946,23949,23960,23964,23966-23968,23970-23971,23974-23975,23979-23980,23982,23984-23985,23995,23998,24000-24001,24004,24007,24011,24017,24019,24022-24023,24027,24035-24036,24038,24040,24044,24054,24056-24057,24061,24063-24064,24072,24076,24080-24081,24084,24086-24088,24097-24098,24103,24107,24109,24114-24115,24119,24121,24123-24125,24134,24141,24145,24151,24154,24157,24163,24165,24167,24169,24171,24174-24175,24177,24179-24180,24182-24183,24185-24186,24191,24214-24215,24217,24219,24227,24234-24235,24238,24241,24260,24264,24266,24272-24273,24275,24278-24280,24283,24288,24295,24297,24305,24311,24313,24319-24321,24326-24327,24334,24338,24340,24342-24343,24346,24359-24360,24371,24375,24381,24387,24389,24396-24398,24403-24404,24409,24411,24414-24415,24417,24424-24425,24431-24433,24441,24448-24449,24451,24455,24466,24480,24482-24483,24495,24499,24502,24506-24507,24512,24517,24527,24533-24534,24537,24539-24540,24542-24543,24552,24555,24557,24559,24566-24567,24571,24592,24604,24608,24620,24631,24635,24641,24655,24658,24661,24672,24677,24687,24689,24704,24709,24724-24725,24741,24747-24748,24765-24766,24770,24779,24783,24785,24789,24793,24797-24798,24806,24809,24815,24818,24823-24824,24829,24836-24837,24842-24843,24845,24848-24849,24857,24864,24873,24885,24895,24905-24906,24908,24911-24912,24926,24928,24941,24949-24950,24952,24973,24975-24976,24980,24984,24986-24987,24994,25000,25013,25016-25018,25022,25035,25039,25047-25048,25051,25054,25060-25061,25065-25066,25073,25079,25082-25083,25085,25088,25090,25095,25098,25113,25123,25129,25132-25133,25142,25153,25158,25171,25174,25176-25177,25182,25188,25192,25196,25201,25203-25204,25206,25209,25219,25234,25238-25240,25246-25248,25252-25253,25255-25257,25267-25268,25273,25293,25302,25304-25305,25315,25332,25344,25347-25348,25360,25365-25366,25368,25370,25374,25384,25386-25387,25391,25394,25399,25403,25407-25409,25413,25415-25416,25426,25433,25435,25438,25443,25455,25471-25473,25476,25478,25480,25486,25488,25491,25493-25494,25501,25503,25508,25513,25516,25525,25529,25540,25542,25549,25553,25561-25562,25568,25572,25574,25576,25580,25582-25583,25585,25594-25597,25599,25607,25619-25620,25623,25630,25637,25647,25649,25659-25662,25665,25667,25671,25673,25675-25676,25679,25684-25685,25690,25697,25699,25704-25706,25710,25712,25733-25735,25742,25745,25750,25752,25756-25757,25759-25760,25764,25769,25775,25788,25790,25793-25795,25800,25807,25814,25818,25822,25830,25833,25836,25839,25844,25847-25848,25853,25857,25864-25865,25868,25871,25873,25881,25891-25893,25900-25902,25906-25907,25926,25931-25932,25934-25935,25938,25941,25944,25946,25952,25954-25955,25958,25960-25962,25965,25969,25971,25974-25975,25978,25981,25994,25996,25999-26000,26009,26011,26013,26025,26032,26036-26037,26041-26043,26047,26050,26056,26064,26071,26073-26075,26081,26083,26085,26087,26092,26094-26095,26098,26104,26106,26109,26115,26117,26121,26125,26127,26129-26131,26134,26136,26141,26148-26150,26157,26159,26161,26164-26165,26167,26169,26174-26176,26186-26187,26191,26195,26198,26201,26205-26206,26209-26210,26214,26217,26221,26223,26226,26228,26233,26237-26239,26242,26244,26247-26248,26251,26254,26256,26261,26264,26269,26271,26276-26277,26282,26287,26292,26294-26295,26297,26300-26301,26303,26307,26310,26312,26322-26323,26325,26327,26334,26336-26337,26339-26341,26346,26351,26356,26359,26362,26365,26369,26371-26372,26375-26377,26379,26385,26387,26390,26395-26398,26402-26403,26405-26406,26415,26424,26426,26432-26434,26436,26439,26441,26451-26454,26470,26474-26475,26480,26483,26486,26488,26490-26493,26495,26501,26503,26509,26515,26519-26521,26523,26525,26532,26539,26542,26544-26545,26547,26550-26551,26561-26565,26569,26571,26583-26584,26587-26588,26594,26597,26604-26605,26614-26615,26623-26625,26634,26643,26650,26657,26659,26662,26671,26679,26687,26695,26702,26708,26719,26722,26725,26728,26734,26736,26740,26749,26755,26758,26767,26778,26780-26781,26787,26792,26794,26798,26803,26829-26830,26833,26835,26838,26841,26844,26854,26858,26860-26862,26866,26872,26874,26877,26897-26898,26900,26903,26905,26907,26910,26915-26916,26921,26925,26930,26936,26945-26946,26949,26951,26961,26968,26970,26973,26975,26977,26979,26981,26983,26985-26987,26989-26990,26992,26994-26995,26998,27004-27005,27008-27009,27012-27014,27022,27025,27027,27030,27033,27036,27043,27045,27049,27051-27053,27055-27056,27064,27066,27074,27076,27078-27079,27081,27085,27088-27089,27092,27097,27104-27106,27110-27111,27113-27114,27116,27121-27122,27131,27141,27143,27145,27149-27150,27152-27154,27156,27159,27165,27167,27169,27184-27186,27188-27189,27191,27196-27197,27199,27203-27204,27208-27209,27219,27222-27223,27225,27229-27230,27233-27235,27238,27242-27243,27248-27249,27251,27254,27262,27270,27274-27276,27281,27284-27285,27288-27289,27291,27293,27295,27301-27302,27306,27310,27314-27315,27318,27320-27321,27323-27325,27327,27334,27336,27338-27339,27356,27359,27362,27365-27369,27371,27375,27381-27383,27391,27405,27407,27409-27411,27414-27415,27417-27418,27420,27423,27425,27428,27430,27437,27442,27448-27449,27451,27455,27458,27464-27466,27468,27470-27471,27474-27475,27477,27479,27486-27487,27489,27491,27493-27494,27498-27499,27501,27503-27504,27509,27512,27514-27515,27518,27520-27521,27523-27524,27527,27534,27536,27541,27543,27545,27550,27560-27561,27563-27564,27566,27568,27572-27574,27580,27582,27584,27586,27591,27595,27598,27603-27604,27608,27612,27622,27628,27631,27633-27634,27640,27642-27643,27645,27648,27651,27654,27656,27668-27669,27674,27676-27677,27681-27682,27685,27691,27698-27699,27705-27707,27711-27712,27714,27716-27717,27719-27720,27722-27723,27725,27729-27732,27735,27741-27743,27745,27751,27755-27757,27761-27763,27765,27767,27770,27772-27773,27775,27777,27779,27785,27793,27795,27797-27798,27800,27803-27804,27806-27810,27815,27821,27825,27827-27829,27841,27846,27852-27854,27856-27858,27861-27864,27866-27867,27876,27881,27883,27890,27895-27896,27902,27906-27908,27911,27913-27914,27918,27921-27922,27926,27930-27933,27935,27943,27945-27947,27950-27953,27955,27957-27959,27964-27966,27968,27973,27976,27981-27983,27986,27991,27993-27994,27999,28002-28005,28015-28016,28022,28026,28037-28038,28040,28043,28046-28050,28053-28054,28058-28059,28061-28063,28068,28071,28074-28075,28077,28084,28086-28087,28091-28093,28095-28096,28103,28112-28113,28115,28117,28119,28121,28123-28124,28126-28127,28137-28139,28141,28143-28144,28147-28150,28152-28153,28162,28164-28165,28167,28172-28173,28178,28184-28185,28189,28198-28200,28202,28204,28211,28213,28216,28220-28221,28224-28225,28230,28234-28237,28244-28245,28251-28252,28259,28267,28275,28278,28290-28291,28294,28297,28299,28315,28319,28327,28329,28339,28342-28343,28345,28347,28350,28352,28356,28359,28364,28367,28370,28372,28374,28377,28379,28384-28385,28388,28391,28393,28395-28398,28400,28408,28414,28426,28429,28431-28433,28440-28442,28446-28447,28453,28455,28458,28467-28468,28471,28473,28476,28479,28487,28490,28492-28494,28496-28497,28501-28502,28508-28510,28514-28515,28517-28518,28521-28523,28526-28527,28529,28532,28535,28538,28541,28545-28546,28553,28555,28560-28561,28563,28565,28570-28571,28578-28579,28581,28583,28587,28589,28594-28597,28599,28601,28605,28608,28610,28615,28618-28620,28622,28626-28628,28630-28631,28637-28639,28643,28650-28651,28653-28654,28658,28660,28663-28664,28666,28669,28672-28673,28675,28680-28681,28690,28692,28695,28697,28701-28703,28705,28707,28709,28711-28712,28720-28721,28723-28724,28726-28730,28733-28735,28737,28742,28744-28745,28748,28750-28751,28754,28761-28762,28765,28768,28772,28774,28778-28779,28785-28786,28796,28798-28799,28803-28805,28807-28809,28811,28814-28815,28820,28822-28823,28835,28837-28839,28842-28846,28856-28857,28859,28865-28867,28872,28874-28875,28877,28879-28882,28888-28889,28891-28892,28894-28895,28900-28901,28903,28905-28908,28910-28911,28924-28925,28943,28947-28948,28950,28953,28955,28959-28960,28962,28973-28974,28987,28990-28991,29002,29004,29006-29007,29025,29028,29034,29045,29047,29049,29062,29067,29072,29080,29090,29093-29097,29109,29116,29118,29125-29127,29131,29139,29142,29146,29151-29152,29156,29160,29162-29163,29165,29167,29171,29176-29177,29179-29182,29184-29185,29187,29192-29193,29195,29200,29203,29210,29213,29222-29223,29226,29229-29231,29233-29234,29244,29246,29249,29251,29253-29254,29259,29261-29262,29265,29267-29268,29272,29274,29276,29278,29285,29287,29294,29306-29309,29311,29315,29318,29321,29323,29331,29336-29338,29346-29347,29358-29359,29369,29373,29375-29377,29384,29391,29398,29400,29409,29418,29424,29426-29427,29439,29456,29459-29461,29463,29466,29469,29471,29476-29477,29486,29504-29506,29509,29514-29515,29517,29524,29526,29528-29529,29531,29536-29537,29540,29542,29547,29550,29553,29558-29559,29563-29565,29570,29574,29576,29580,29582-29583,29588-29589,29598,29607,29612-29613,29620,29633,29636-29637,29647-29648,29652-29653,29657-29660,29664,29668,29672-29673,29675,29679,29691,29693,29695,29699,29704,29706,29714-29715,29717-29718,29728,29730-29732,29746,29752,29772,29784,29787,29795,29801,29805,29814,29816,29823,29843-29844,29850,29859,29867,29870-29871,29881,29884-29885,29902,29905-29906,29910,29923-29925,29951,29969,29977,29986-29987,29990-29991,29996,30009,30012,30015,30027,30029,30031,30036-30037,30039,30041-30044,30055,30058,30066,30071,30088,30100,30105,30114,30121,30131,30135,30140-30141,30152,30154,30160,30162,30169,30178,30181,30184,30188,30193,30195,30199,30207,30210,30222-30223,30229,30239-30241,30250-30251,30253,30260,30262-30263,30265,30268-30269,30283-30285,30294-30295,30299,30303,30306-30307,30310,30321-30322,30334,30340-30341,30343,30352,30356-30357,30361,30363,30373-30374,30378-30379,30385,30388-30389,30394,30400-30401,30405,30408,30415,30424-30425,30428-30429,30437,30439,30442,30446,30448,30453,30460-30461,30474,30479,30486,30491,30499-30500,30502-30503,30512,30515,30521,30523,30527,30530,30538-30539,30553,30555,30557-30558,30566,30568-30570,30580,30585,30592-30593,30595,30597-30598,30600-30601,30603,30608,30612,30617-30620,30622,30625,30634,30636,30640,30645,30648,30650,30670-30671,30678,30684-30685,30691-30692,30696,30700,30712,30715-30716,30719,30729,30743-30744,30747,30750,30753-30755,30757-30758,30760,30763-30764,30769,30771-30774,30776,30778,30780-30781,30783-30785,30788,30793-30794,30803,30806,30808-30810,30812,30820,30822,30824,30836,30842,30850,30859,30862,30866,30872-30873,30880-30881,30883-30884,30889,30923,30934-30935,30940-30941,30946,30948,30952,30959-30960,30968,30970,30985,30993,30995,30998-31001,31003,31011,31019,31028,31043,31061,31066,31073,31082,31091,31093,31101,31106,31111,31115-31116,31118,31120-31121,31129,31143-31145,31147,31158,31164,31176-31177,31180,31185,31187,31190,31193,31201,31212,31218,31221,31223,31228,31230,31238,31252-31253,31269,31274,31281,31292,31295,31309,31315,31318,31321-31322,31327,31331,31334-31335,31344,31348,31355,31357-31359,31362,31373,31378-31381,31383,31385-31386,31389,31391,31401-31402,31407-31408,31411-31412,31416-31417,31422,31430-31431,31433,31439-31442,31445-31446,31451,31456,31458,31461-31463,31466,31474,31478,31485,31488,31494,31500,31503,31509-31510,31516,31527,31529-31530,31533-31534,31543,31545,31559-31560,31578,31583,31588,31595,31600,31607,31614,31628-31629,31635,31638,31641,31643,31645,31647,31650,31657-31658,31660,31662-31665,31667,31672,31679-31681,31685-31686,31688-31689,31699-31700,31707,31720-31721,31723,31730,31732,31744-31745,31757,31759,31770,31779,31781-31782,31785,31787-31789,31795-31796,31822-31823,31830,31833,31837,31844,31847,31857,31873,31877,31879,31893-31894,31902,31920,31934,31940,31957,31959,31964,31967,31982,31984,31995-31996,32000,32006,32017,32022,32028,32034,32039,32054,32059,32062,32065,32071-32074,32077,32086,32092,32096,32104,32106-32107,32110,32112,32127,32136,32143,32146,32155,32160-32161,32163,32169,32171,32173-32174,32177,32185-32186,32191,32203,32222-32223,32227,32230,32233,32239-32240,32244,32247,32254,32256,32261-32262,32278-32279,32288,32292,32304,32310-32311,32320,32330,32338,32345,32349,32353,32361-32363,32370,32382,32384-32385,32402,32408-32409,32412,32415,32424,32428-32429,32431-32432,32435-32436,32440-32441,32443,32454,32472-32474,32481,32483-32484,32486,32490,32495,32501,32503-32504,32507-32509,32514,32516,32539,32554,32556,32559-32561,32565,32567,32572,32576,32582-32583,32596,32601-32602,32604-32606,32609,32611,32620-32621,32630,32635,32640,32646,32651,32657-32658,32660,32664-32665,32667,32674,32677,32681-32682,32687,32691,32693,32695-32696,32699-32702,32707,32710,32712-32713,32715-32716,32718,32722,32729,32736,32738,32740,32743-32745,32748,32757,32764-32765,32768,32778,32780,32786,32790,32792,32796,32798,32805,32808,32814,32831-32832,32834,32837,32841,32847-32849,32856,32863-32864,32866,32868,32870,32891-32892,32902,32904-32905,32908,32914,32920,32930-32931,32933,32937,32943,32945,32951,32955-32956,32959,32967-32968,32970,32976,32978,32980,32986,32988,32994,33000,33003-33004,33006,33008-33009,33011,33013,33017,33030-33031,33033-33034,33040,33042,33046-33047,33050-33051,33053-33055,33058,33061,33070,33073-33075,33085,33087,33100-33101,33103-33104,33106-33108,33110-33113,33115-33117,33119-33121,33123-33124,33126,33129,33131,33136,33139-33140,33142,33150-33151,33155,33161,33164,33167,33173,33175,33178,33180,33182,33186,33193,33198,33202-33203,33205,33210,33214,33218-33219,33221,33223-33225,33227-33230,33232-33233,33237-33240,33242-33245,33247-33249,33251-33252,33254-33257,33259-33262,33265,33272,33275,33277-33279,33282,33287-33288,33291,33300,33303,33312-33313,33315,33321,33323-33325,33327-33328,33330,33336,33344,33348,33350-33352,33357-33359,33366,33368,33378,33385,33391,33393,33395-33396,33398,33409,33416,33418-33419,33421-33422,33431,33442,33448,33452,33457-33458,33460-33461,33463,33467,33471-33472,33474-33477,33479,33482,33488,33490-33491,33499,33509,33512,33514-33515,33519,33525,33536-33537,33540-33541,33543,33549-33550,33552,33555,33560,33564,33568,33570-33571,33575,33577,33580,33582-33583,33593-33594,33598-33599,33606,33609,33612,33614-33615,33617-33619,33621,33623-33626,33629,33632,33634-33637,33639-33640,33644-33645,33650,33652,33654-33656,33658,33662-33663,33668,33678-33679,33681,33683-33686,33700,33717-33718,33725,33730,33735,33737-33738,33741,33743,33749,33751,33753-33755,33765,33769,33774,33785-33786,33789,33795-33796,33799,33804-33805,33808,33810,33812-33813,33816-33818,33822,33828-33829,33832,33834-33835,33838-33840,33845,33850,33852,33854-33856,33860-33861,33864,33866,33869,33875,33880-33881,33886-33887,33897,33901,33903,33910,33912-33914,33918,33920-33921,33928,33930,33933,33935,33944,33950,33958,33960-33962,33964,33966,33968,33970-33971,33977,33982,33985,33989-33992,33995,33997-33999,34001,34008,34011-34014,34020,34023,34029,34032,34034,34036-34038,34041,34043,34046,34050-34051,34058,34062,34064-34065,34068,34070,34072-34074,34076-34077,34085-34087,34092,34095,34097-34099,34101,34103-34104,34111,34121-34126,34128,34130-34131,34133,34135,34138-34141,34152,34161,34163,34167-34169,34171,34174,34177-34178,34181,34184,34189,34195,34201,34209,34214,34218,34232,34242-34243,34250-34251,34254,34260,34264,34266-34267,34272-34274,34281,34284-34285,34288,34290-34291,34293-34294,34296-34297,34299,34304,34307,34310,34316,34318-34321,34324,34326,34328,34332-34333,34335,34337-34338,34341,34343,34346,34349,34352,34356,34361,34364-34365,34370,34374,34392,34397,34400-34401,34403,34412,34414,34420,34428,34430,34433,34435,34437,34444,34449,34454,34456,34458-34459,34468,34470-34471,34475-34476,34478-34481,34483-34484,34491,34499,34501,34506,34516-34517,34519-34520,34524-34526,34528-34529,34531-34532,34534-34535,34540-34541,34544,34564-34565,34567-34568,34571-34572,34577-34578,34582,34590,34592,34599,34602,34605-34606,34608,34614-34617,34620,34623-34624,34641,34643,34646,34649-34650,34652-34653,34655-34656,34661,34663,34665,34667,34669,34673,34675,34679,34682-34683,34690-34691,34701,34703,34713-34714,34717,34721,34724-34726,34728-34730,34732,34738,34742,34748,34755,34764,34767-34768,34771-34772,34774,34776,34786,34788,34793,34796,34799,34805,34809-34810,34812,34814,34816,34818,34823-34826,34832,34837,34844,34850,34855,34857-34858,34861,34864-34865,34867,34870-34872,34876,34881,34891-34892,34899,34907,34913,34915,34921,34928,34931,34939,34944,34949,34963,34968-34969,34971,34975,34978,34986,34991,35001,35005-35007,35012-35014,35018-35019,35027,35037-35039,35041,35045,35049,35052,35055,35060-35062,35070-35071,35073,35076,35078-35079,35086,35088,35093,35099-35100,35104,35113,35116,35119,35121,35125,35130-35134,35136,35138,35140-35141,35145,35148,35150,35154,35156,35158-35159,35162,35168,35170,35177,35179-35180,35184,35187-35189,35192,35197,35199-35200,35203,35206,35208-35209,35219,35222,35224,35226,35229-35230,35233,35238,35240,35244-35246,35248-35249,35252,35255-35256,35263,35271,35274,35281,35284-35285,35288,35290,35292,35298,35301,35304,35306,35308,35312,35315,35317-35320,35325,35330,35332-35333,35344,35346,35362,35365-35366,35380,35383-35384,35386,35391-35392,35395,35397,35401,35406-35408,35412,35415-35418,35423,35426-35428,35432,35434,35438,35440-35441,35445,35447-35448,35455-35456,35460,35462,35465-35467,35482-35483,35485,35487-35489,35495,35497,35499,35501,35505,35507,35511-35512,35514,35516-35517,35521,35524-35525,35533,35535-35536,35538,35541-35542,35547-35548,35559,35561,35566-35567,35575-35576,35581,35584-35586,35590-35591,35594,35604-35606,35608,35610-35612,35614-35615,35617,35623,35626-35627,35629,35631,35633,35638,35647-35648,35653-35654,35657,35660,35666,35668,35671-35672,35674,35676,35685,35690-35691,35699,35702,35704,35706,35710,35717-35718,35721-35722,35724,35729-35730,35734-35735,35738,35741,35743,35754,35758,35764,35770,35781-35782,35785-35786,35788-35789,35791,35794,35797,35801-35802,35804,35806,35808,35813-35815,35817,35820-35821,35823-35824,35827,35829,35832,35836,35841,35844-35845,35848-35850,35852,35863-35866,35875,35879,35893-35895,35899,35901,35903,35907,35913,35918-35919,35923,35930-35931,35934-35937,35942,35944,35946,35951-35952,35954,35957,35962,35966,35971,35974,35976,35978-35979,35981,35983-35985,35987,35990,35993-35994,36000,36006,36008,36010-36011,36014-36015,36017-36022,36031,36033-36035,36038,36043,36045,36053,36058,36062-36063,36066-36067,36069,36073,36081,36090,36094,36100,36102,36107,36111,36113,36116-36117,36122,36126,36128-36129,36131-36132,36134-36135,36148-36149,36151-36152,36156,36158,36163-36165,36167,36172,36181,36188-36189,36194-36195,36201,36205,36210-36211,36216,36218-36220,36223,36231-36232,36234-36235,36241,36243,36257-36259,36266,36278,36287-36288,36293-36294,36297,36304,36314,36319,36323,36328-36329,36332,36334,36340,36342,36346,36349,36351,36353,36357,36359-36360,36366-36367,36370-36371,36373-36374,36377,36382,36389,36394,36396-36398,36404,36411,36414,36425,36428,36435,36445,36448,36452-36454,36458,36460,36463,36482,36487,36492,36494,36500,36503,36506,36510-36511,36515-36516,36519,36521,36524-36525,36528-36530,36532-36533,36544,36551-36554,36561,36563,36569-36570,36573,36576,36579-36580,36582-36583,36586,36590,36592,36600,36614-36615,36618-36619,36621,36630,36632,36646,36648-36649,36652,36666,36669,36677,36687,36691,36694,36701,36708,36714,36716,36719,36721,36725,36729,36739-36740,36749,36756,36760-36762,36764-36765,36775-36777,36780,36785-36786,36789-36790,36793,36795,36798,36805,36812,36815,36819,36821,36828,36837,36842,36844,36846,36857,36861-36864,36866,36870-36871,36877,36880,36882,36884,36890,36893,36896-36897,36899,36901,36906,36909,36919,36928,36930,36941,36946,36951,36956-36958,36962,36971,36974-36975,36982,36984,36999-37000,37007,37012-37013,37022,37034,37037-37038,37040,37045,37047,37049-37050,37054,37068,37071,37079,37085,37087,37091,37096,37100,37102,37104,37112-37113,37116-37118,37120,37126-37128,37156,37171-37172,37176-37177,37187,37190-37192,37201,37204,37212,37229,37231-37234,37240,37244,37246-37247,37252,37254,37256-37257,37261,37271,37275,37283,37287,37293-37294,37296,37299,37303-37304,37307,37309-37312,37314,37321,37323-37324,37326,37333,37335,37338,37346,37351,37363,37369,37376-37377,37379-37380,37383,37385,37387-37388,37390-37392,37395,37398-37399,37403-37404,37407,37411,37419,37434-37435,37449-37451,37453-37455,37457,37463-37464,37467,37469,37474-37475,37479-37480,37482,37486,37490-37492,37509,37511,37516-37518,37526-37529,37532-37534,37536,37538,37541,37545,37547-37548,37550-37551,37554,37567-37569,37571,37580-37581,37587,37591-37593,37595,37600,37610-37611,37625,37628-37629,37636,37648,37651-37652,37654,37657,37660,37662,37667,37670,37675-37676,37686,37691,37704,37706-37707,37717,37720-37721,37732,37740-37741,37745-37746,37752,37754,37760,37769,37779,37783,37788-37789,37800,37805,37808,37810,37819,37823,37829-37830,37839-37840,37852,37855,37857,37859,37861,37865,37871-37872,37878,37881,37883-37884,37888,37890,37892,37897,37899-37900,37902-37903,37906,37908,37910,37916,37919-37921,37923-37926,37932,37935-37936,37940-37941,37947,37951-37952,37957,37961,37968,37974,37976,37978-37979,37984,37990,37994,38000,38022,38024,38026,38032,38039-38040,38045-38046,38053,38068,38073,38087,38090,38092,38102,38108,38113,38116,38123,38127-38129,38136,38139,38145-38146,38156,38160-38161,38166,38169,38174,38176,38178-38179,38186,38188,38191-38192,38199-38201,38205,38217,38238,38242,38261,38268,38277,38280,38282,38288-38289,38296,38299,38301-38303,38310,38314,38322-38323,38325,38331,38337,38354-38355,38361,38364,38369,38373,38379-38380,38382,38392,38397,38399,38404,38406-38407,38412-38414,38416,38418,38421-38422,38424,38448,38450,38454,38456,38460-38461,38463-38465,38467,38469-38471,38473,38475-38477,38479,38481,38483,38488,38493,38504,38509-38511,38519,38526,38534,38547,38549,38559,38571,38574,38576,38579-38580,38598-38599,38620-38621,38638-38640,38644,38646,38651,38653,38657-38658,38663-38664,38668,38674,38678,38683,38696,38698-38699,38701-38706,38711,38713,38720,38722-38723,38725-38726,38741-38742,38744-38745,38758-38759,38763,38766-38767,38778,38784,38786-38787,38792,38794,38797,38806,38814,38817-38818,38821-38822,38825,38829,38832,38834-38836,38841,38844,38846,38849,38852-38853,38867-38869,38872,38874,38876-38877,38883,38885,38895,38906,38913,38916,38923,38925-38926,38936,38938,38940-38941,38944,38946-38949,38956,38960,38962,38966-38967,38969,38971,38973,38975-38976,38985,38996,38998,39000-39001,39004,39006-39008,39010,39016,39018,39023-39024,39028-39029,39031,39033-39035,39041,39048-39049,39055,39065,39067,39071,39075-39077,39085,39087-39088,39094,39097,39100,39102,39117-39118,39120,39127,39132,39137-39139,39141-39142,39146,39148-39149,39156-39157,39160,39162,39164-39165,39170,39172,39181-39182,39186,39190,39192,39199,39201,39208,39210-39211,39213-39215,39220,39222,39224,39226,39235,39238,39241-39242,39246,39249,39254,39258,39268,39273,39280-39281,39284,39288,39298,39301,39303-39304,39310,39319,39322,39327,39331,39345,39349,39354,39361,39363,39368,39370,39373-39374,39383-39384,39394-39396,39409,39432,39435,39438-39440,39443,39446-39447,39450-39451,39458-39459,39464,39466,39475,39477-39479,39481,39483,39489,39494,39497,39505,39508,39512,39517,39519-39520,39531,39533,39536,39538,39540,39542,39545,39552-39553,39555,39559,39561,39566,39577-39578,39582,39591,39594,39597,39600,39602,39607-39608,39613,39615,39619,39623-39625,39630,39634,39640,39642,39644,39650,39656,39658-39659,39663,39673-39674,39691,39707,39715,39717-39718,39722-39723,39728,39737,39744,39759,39766,39770,39772-39773,39775,39778,39782,39786,39790,39792-39793,39795,39801-39802,39805,39807,39816,39818-39819,39822,39825,39827,39829-39830,39832,39836,39838,39847-39849,39858,39867,39869,39872,39881,39884,39886,39888,39890-39891,39899,39901-39904,39909-39910,39912,39918,39921,39925,39927,39930,39933,39936-39937,39941-39942,39946-39947,39954,39956,39960,39963,39966,39971,39973-39974,39977-39978,39987-39989,39991,39993,39997,40000-40001,40011,40013,40022,40024,40034,40036-40038,40050-40051,40057,40059-40060,40062,40071,40081,40086,40091,40101-40102,40104,40106,40112-40113,40120,40124,40130,40141,40147,40156,40158-40160,40162-40163,40174,40190,40194,40199,40205,40209-40211,40214,40216,40221,40223,40227-40228,40234,40242-40243,40255,40258,40261,40264-40265,40272,40274-40275,40280-40282,40285-40288,40291,40294,40299,40316,40318-40319,40322-40323,40328,40331-40332,40337,40339,40344,40351,40355-40356,40358,40360,40372-40374,40379,40384,40386,40389,40399,40402-40404,40410,40415,40419-40420,40424,40432-40433,40435,40440,40447,40452,40456,40467,40472,40479,40486,40488,40490,40497,40506-40507,40510,40512,40527,40532-40534,40548,40555-40556,40566,40568,40575,40582-40585,40588,40596-40597,40599,40601,40608,40610-40613,40615-40617,40619,40624-40625,40633,40635-40636,40638,40641-40642,40647,40652-40653,40655,40666,40679-40680,40686,40689,40692,40699,40701,40705,40719,40723-40724,40728,40730,40735-40736,40740,40748,40762,40766,40768,40777-40778,40789,40792,40794-40795,40800,40809,40811,40813-40814,40816,40818,40830-40831,40837-40838,40845-40846,40851,40854-40855,40858,40867-40868,40880,40883,40885,40890,40893,40902,40905,40907-40909,40911,40915,40920,40922-40924,40929,40936,40938-40939,40941,40944-40945,40952,40955,40960,40962,40965,40975,40996-40997,41009,41011,41014-41015,41020-41021,41027,41031,41042-41043,41058-41059,41064,41072-41073,41086-41088,41091,41101,41110,41122,41135-41136,41143,41151,41153,41157,41171,41178,41187,41197,41199,41208,41229,41231,41248,41255,41257-41258,41272,41279,41285,41289,41298,41303-41304,41307,41310-41311,41325,41330-41331,41335,41339,41345,41347,41352,41354,41359,41363,41370,41389,41393,41396-41397,41404,41407,41409,41423,41426,41429,41431,41434-41435,41442,41444,41446-41447,41460,41463-41464,41478-41479,41493,41499,41503-41504,41507,41511,41518,41522,41524,41530,41541-41542,41544,41547,41551,41555,41559-41560,41564,41570,41573,41583,41586,41591,41593-41596,41598-41599,41604-41605,41607,41610,41618,41623,41629,41631,41645,41647,41653-41655,41657,41660,41662,41667,41670,41672,41674-41675,41677-41679,41681,41683-41684,41689-41691,41695-41698,41701,41706-41707,41713-41714,41720,41727,41730,41735-41738,41743,41749,41754-41756,41758,41765,41767-41770,41772-41773,41777-41780,41782,41786,41791,41794-41795,41798,41802,41804-41805,41810-41814,41816-41817,41822,41830,41832,41841,41847,41852,41857,41860,41871,41873-41874,41876-41877,41893,41897,41901,41913,41917-41919,41929,41933,41937-41938,41946,41949,41963-41964,41968,41974,41982,41987-41989,42005,42008-42009,42012,42016,42018,42021,42025,42027,42032-42033,42048,42056,42060,42071,42083-42084,42096,42099,42107,42117,42120,42122,42125-42126,42129-42130,42132,42134-42137,42147,42150-42152,42163,42165,42167,42169-42172,42174-42176,42178-42180,42183-42184,42189-42190,42193-42194,42196,42198,42209,42211,42217,42220-42222,42228-42229,42233-42235,42248,42254,42261,42268-42270,42278-42279,42288,42290,42294-42295,42299,42309,42311,42314-42315,42319-42320,42323-42324,42330,42332-42333,42335,42342,42347,42350,42357,42360-42361,42364-42365,42370-42371,42375,42377-42379,42381-42382,42391-42393,42396-42398,42401,42412,42417,42419-42420,42422,42425,42432-42434,42436,42438,42440,42444-42446,42449-42450,42453-42458,42460-42461,42463-42465,42467-42468,42473-42476,42481,42483-42485,42489,42491,42493-42494,42500,42508,42511,42514-42515,42526,42528,42530,42533,42545,42547,42556,42565-42566,42570-42571,42580,42583,42594,42601,42603,42610,42621,42629-42630,42633,42654,42663,42669,42672-42673,42676-42677,42679,42683,42696,42700,42704,42715,42719,42727,42731,42743,42753,42760,42767,42772,42779-42780,42784,42787,42789,42796,42802,42808,42812,42822-42823,42825,42827,42831,42840-42842,42844,42852-42853,42858,42860,42865,42878,42880-42881,42892,42901,42903,42906,42909,42911,42914,42920,42922-42923,42931,42946,42951-42953,42955,42958,42970,42972,42976,42979-42981,42986,42989-42990,43000,43003,43005-43006,43009,43012,43014-43015,43020,43023,43028,43031-43032,43034-43038,43043,43045,43056-43057,43064-43065,43075,43085,43105-43109,43111,43122,43125,43136,43139,43145,43155-43156,43158,43160-43161,43164,43170-43171,43173,43175,43193-43194,43196,43208,43217,43222-43223,43225,43227-43228,43230-43234,43238,43242,43247,43249,43254,43256,43258-43259,43262,43269,43275,43278,43280-43281,43283,43292,43294,43299-43300,43302,43306,43317,43319,43321,43326,43333-43334,43339,43343,43354,43358,43366,43374,43380,43382,43389,43401-43402,43412,43420,43424,43429-43430,43434-43435,43441,43447,43449,43451-43452,43454,43458,43460,43463-43464,43469,43471,43476,43479,43483,43489,43499,43504,43518,43527-43528,43530,43533,43538,43544,43546,43549,43556,43572-43573,43585,43589-43590,43594,43596-43597,43600,43605,43610,43616,43626-43628,43630,43632,43634,43649,43654,43662,43664,43667,43673,43677,43679,43687,43695,43698,43706,43710,43712,43716,43722,43727,43734-43736,43738,43746,43763,43768,43778-43779,43788,43795,43797,43800,43803,43805-43806,43808,43810,43815,43820,43822-43823,43825,43828-43829,43834,43840-43841,43854-43855,43860-43861,43865,43873-43874,43876-43877,43881,43883-43884,43886,43888,43891,43898-43899,43905,43910,43913-43915,43920,43925,43937,43941-43942,43945,43947,43953,43955,43957,43959,43972,43983,43985-43986,43992,43996,43998,44008,44012,44017,44021-44022,44025,44043,44049,44052,44059,44068-44069,44073,44078,44080,44082-44083,44088,44093-44094,44106,44122-44123,44128,44133,44138-44140,44144,44147-44148,44153,44160,44165,44168,44170,44175-44176,44191-44192,44195,44197-44198,44202,44208,44212-44213,44225,44241,44245-44248,44253,44264-44265,44277-44278,44293-44295,44299,44302,44310,44313-44314,44317,44320,44322,44328,44341,44356-44357,44365,44367,44371,44374,44379,44381,44387,44398,44409,44419,44427,44431,44438,44448,44452,44457,44465,44481,44491,44493-44494,44504,44515,44517,44526,44529,44539-44540,44553-44554,44560,44568-44569,44571-44572,44584-44585,44587,44592,44598,44614,44617,44628,44632,44637,44644,44646-44647,44654,44658,44660,44664,44668,44672,44685,44687,44692-44693,44698,44705,44709,44715,44718,44720,44722,44730,44739-44740,44742,44748,44750,44756,44758,44771-44772,44774,44777,44785,44790-44791,44797,44799,44802,44805,44812-44813,44816,44818-44819,44822,44835,44840,44842,44848,44857,44861,44883,44887,44892-44893,44897,44902,44908,44913,44915-44916,44918,44920-44921,44927-44929,44947-44948,44958,44964,44971,44975-44976,44978,44997,45008,45011,45016,45018,45022,45032,45038,45040,45043,45046,45055-45056,45065,45068-45070,45075-45077,45081,45084,45088,45091,45098,45101,45116-45117,45119,45133,45137,45140,45146,45150,45158,45176,45178-45180,45189,45192,45196-45198,45202,45205,45214,45218,45220,45222,45226-45227,45230,45242,45253,45258-45259,45263,45279,45284,45287-45290,45295,45305,45307,45315,45321,45328-45329,45344,45358-45359,45361,45367,45370-45371,45376,45381,45384,45397,45401-45402,45409,45420-45422,45433,45438,45443,45446,45457,45463,45468-45469,45472,45478,45480,45486,45490-45492,45506,45513,45516,45524,45527,45531,45533,45537,45540,45543,45548,45552,45560-45561,45567,45575,45584,45587,45600,45609,45611,45620-45621,45637,45640,45662,45674,45693,45700,45707,45709,45722,45725,45728-45729,45732,45735-45737,45745,45748,45754,45773-45774,45777,45780,45782,45785,45787,45795,45802-45803,45805,45820,45835-45836,45838,45847,45849,45852,45856,45865,45868,45874,45883,45903-45904,45907,45910,45912,45914,45937-45939,45942-45943,45945,45963,45972-45973,45976-45977,45983,45985,45988,45992,46005,46009,46016,46019,46022-46023,46025,46032-46033,46050,46055,46067,46070-46071,46079,46081-46082,46087,46095,46101-46103,46107,46109,46113,46117,46119,46122,46124,46128,46130,46134,46139,46141,46143,46150,46157,46159-46160,46163,46165,46174,46178-46179,46191,46199,46204,46208,46212,46218,46236-46237,46244,46248,46250-46251,46259,46270,46272-46273,46276,46281-46282,46284-46285,46294,46299,46301,46305,46310,46314,46321,46325-46326,46337,46339,46342,46353-46354,46363,46369,46373,46382,46389,46392,46394-46395,46399,46405,46408,46416,46421,46424,46438,46444-46446,46453,46460,46469-46472,46477,46481,46491,46495,46500,46510,46513,46515,46517,46521-46522,46529,46533-46534,46544-46545,46549,46564,46567-46569,46572,46578,46581,46587-46588,46593-46594,46597,46603,46608,46612,46615,46626,46629,46631,46634,46636,46642,46647,46650-46651,46656-46657,46659,46662,46665,46678-46679,46692,46705,46709,46715,46730,46734,46737,46739-46740,46743,46755,46770,46782,46787,46789,46794-46795,46811,46826,46828,46831,46835,46847,46851-46852,46858,46865,46867,46871,46882,46887,46893,46899,46914,46924,46932,46934,46950,46952-46953,46963-46965,46967,46984,46987-46989,46994-46995,46998-46999,47001-47002,47005,47007,47011,47014,47016-47017,47027,47029,47031,47047,47050,47053,47057,47060,47064-47065,47072,47074,47076-47078,47080,47093,47104,47106-47107,47117-47118,47120,47125,47136,47141,47151-47152,47160,47162,47165,47167-47170,47181,47187-47188,47196,47203,47217,47222,47226,47229,47232,47244-47245,47248-47249,47251,47253,47268-47269,47274,47277,47282,47291,47306,47308,47310,47319,47353-47354,47367,47375,47381-47383,47386,47392,47394,47397-47398,47412-47414,47417,47419,47429,47436,47447,47453-47455,47459,47461,47463,47469,47471,47485,47487,47491,47497,47506,47509-47510,47518,47525,47540,47542,47574,47579,47583,47585,47595,47600,47605,47611,47618,47632,47649,47655,47663,47666,47690,47695-47696,47708,47713-47714,47729,47731,47734,47742,47749,47764-47765,47777,47779-47780,47785-47789,47800,47805,47809,47822,47824-47826,47838,47854,47856,47864,47866,47868,47871,47873,47876,47900,47903,47912,47916,47919-47922,47928,47935,47945,47948,47954,47960-47961,47963,47969,47971,47977,47980,47991,47999-48000,48006-48007,48017-48018,48021-48023,48025,48034-48035,48041,48054,48063,48075,48079,48105,48123,48127,48133,48137,48144-48145,48151,48156,48171,48181,48189,48209,48217,48224,48233,48259,48263,48267,48270-48271,48274,48281-48282,48292,48297,48300,48302,48304,48306,48319,48333,48341,48357,48362,48371,48376,48385,48387-48388,48394,48398,48405,48419,48421-48422,48434,48444,48446-48447,48458-48459,48481,48484,48486-48487,48491,48493,48496,48498,48504,48511,48528,48532-48533,48536,48546,48548,48575,48578,48580,48591,48593-48595,48597,48603,48610,48614,48624,48646,48655,48661,48665-48666,48670,48672-48673,48676,48685,48694,48698,48703,48708,48724,48741,48771,48783,48792,48797-48798,48829,48846-48847,48854,48856,48858,48868,48873,48875,48882,48885,48896,48898,48914,48917-48918,48921-48922,48924,48928,48934,48936,48939,48942-48944,48951-48953,48957,48959,48962,48965,48975,48980,48985,48996-48997,49001,49004,49006-49007,49011,49013-49015,49019-49020,49029,49037,49039,49042,49048,49066,49068,49070-49071,49083,49087-49089,49094,49097,49100,49102-49103,49112-49114,49129,49135 \N ivo://chivo/openngc/q/data 0/0-11 \N ivo://ned.ipac/tap 0/0-11 \N ivo://chivo/gaia/q/dr1 0/0-11 \N ivo://cds.vizier/i/150 6/375,1196,1293,1300,1302-1303,1323,1332,1539,1558,1777,1790,1935,2910,2940,3004,3011,3032,3037,3048,3053-3054,3060,3066,3247,3251,3253-3258,3260-3261,3263,3274,3283-3284,3296,3298,3300-3301,3305,3307-3308,3324,3329,3334,3430,3585,3598,3600-3601,3604,3623,3625,3632,3641,3644,3660,3662,3681,3713-3714,3721,3724,3726,12943,12972,12981,13557,13999,14006,14008,14079,14179,14197,14209,14223,14236,14240,14246-14248,14255,14264,14283,14287,14295,14301-14302,14306,14311-14312,14353,14355-14356,14358-14360,14411,14431,14456,14459,14630-14631,14636,14646-14647,14649,14653-14654,14658,14690-14691,14712,14743,14824-14825,14858,15369,15392,15396,15399,15445,15478,15481,15622-15625,15631,15640,15656,15659,15672,15677,15745,20613,20860,21438-21439,21635,21647,21655,22088,22123,22208,22240,22243,22246,22249,22253,22258,22854,23637-23638,23670,23717,23780,23851,23962,23982-23983,23995,23998,24333-24334,24338,24340,24370,24379-24380,24424,24464,24477,24555,27498,28704,28890,28900,28913,28915,28919,29025,29036,29084,29089,29091,29094-29095,29098,29106,29162,29460,29463,29467,29504,29513,29600,30332,30359,30627,30718,30818,31756,37231,37333,37696,37871,37877,37897,37900-37901,37905,37914,37919,37932,38016,38024,38026,39003,39209,39216,39236,39238,39327,39374,39831,39907,40068,41464,41562,41630,41689,41692,42116,42190,42203,42206,42213-42214,42221,42236,42299,42368,42383,42394-42395,42405,42410,42416-42417,42444,42449,42470,42477,42483,42905,43011,43033,43036,43086,47648 \N ivo://cds.vizier/i/206 6/381,465,470,510,666,727,733,749,824,920,959,963,989,1231,1348,1412,1452,1511,1700,1718,1907,2047,2125,2254,2287,2304-2305,2456,2488,2675,2693,2728,2747,2749,2851,2861,2870,2919,2961,2979,2982,3079,3153,3515,3536,3611,3658,3678,3743,3809,4143,4493,4822,4873,4884,5015,5077,5091,5133,5377,5450,5501,5561,5581,5689,5762-5763,5781,5875,5891,6003,6028,6308,6539,6557,6656,6665,6702-6703,6714,6892,6962,7015,7209,7735,7964,8424,8942,9014,9063,9160,9235,9313,9362,9399,9429,9442,9502,9541,9767,9774,9982,10106,10215,10320,10327,10481,10556,10564,10750,10891,10954,11290,11450,11951,12185,12274,12669,12798,12864,13161,13211,13238,13244,13266,13308,13406,13578,13600,13618,13627,13659,13713,13729,13736,13745,13766,13777,13781,13960,14005-14006,14112,14233,14314,14383,14400,14426-14427,14515,14628,14636,14639,14652-14653,14819,14849,14863,14887,14918,14998,15010,15166,15300,15367,15386,15469,15504,15522,15629,15757,15760,15819,15860,16490,16989,17137,17783,18123,20078,20290,20472,20673,20826,21365,21439,21506,21526,22708,22854,23523,23637,23854,24011,24198,24227,24278,24374,24419,24479,24503,24516,26174,26489,27192,27374,27822,28026,28033,28394,28412,28489,28582,28869,29210,29728,31328,31491,32271,32388,32509,32556,32629,32670,33691,33930,34767,37109,37224,37271,37284,37297,37443,37645,37746,37874,38426,38506,38756,39154,39211,39308,39832,39877,40127,40297,40322,40485,40596,40610,40838,40943,41157,41314,41322,41373,41392,41478,41519,41556,41573,41603,41607,41610,41637,42127,42213,42347,44049,46566,47262 \N ivo://cds.vizier/i/212 6/38199,38205,38242-38243,38248 \N ivo://cadc.nrc.ca/archive/cfht 0/0-11 \N ivo://cadc.nrc.ca/archive/hst 0/0-11 \N ivo://cds.vizier/i/221 3/520 4/2064-2065,2067-2070,2088 5/8215,8235-8236,8238,8265-8267,8284-8286,8288-8289,8292-8293,8295,8304-8306,8336,8338-8339,8344,8356,8360,8448-8450,9354,9376,9378,9384,9386,9728,9730,11328-11329,11332-11333,11344-11345,11348 6/32855,32859,32885,32895,32923,32935,32939,32950,32956,32958-32959,32981-32983,33001-33003,33056-33057,33059,33148-33150,33161,33164-33165,33176-33177,33179,33228-33230,33232-33234,33248-33249,33348,33350,33380-33382,33384-33386,33428-33430,33432-33434,33444-33446,33448-33450,33804-33806,33808-33810,33824-33826,37376,37378,37384,37386,37408,37410-37411,37414,37420,37422,37508,37510,37516,37518,37540,38944-38946,45143,45149,45320-45321,45324-45325,45336-45337,45340-45341,45384-45385,45388-45389,45396-45398,45400-45401 \N ivo://mssl.ucl.ac.uk/xmmsuss_dsa/xmmsuss 0/0-11 \N ivo://cds.vizier/i/241 6/15,63,79,90,128,137,155,161,236,290,309,341,346,377,428-429,435,463,472,474,487,560,587,618,630,649,661,689,737,752,770,826,867,903,934,1040,1121,1153,2106,2127,2209,4146,4181,4191,4206,4224,4297,4367,4415,4419,4491,4559,4574,4630,4690,4706,4711,4724,4737,4772,4846,4854,4869,4929,4949,5010,5137,5154,5180,6154,6166,6196,6203,6211,6219,6224,8214,8248,8274,8306,8372,8421,8476,8496,8509,8518,8534,8577,8626,8671,8687,8717,8767,8803,8843,8845,8935,8969,8985,9012,9048,9092,9125,9219,9237,9250,10263,10309,10375,12311,12359,12396,12464,12472,12523,12526,12544,12561,12655,12694,12720,12766,12770,12848,12865,12915,12953,12960,12964,13018,13065,13115,13332-13333,13363,13392,13440,14365,14373,14396,14405,14478,16476,16495,16543,16606,16686,16694,16704,16763,16818,16834,16903,16955,16976,16990,17000,17061,17085,17158,17194,17223,17266,17299,17322,17337,17357,17368,17391,17394,17425,17458,17486-17487,17551,17576,17608,17629,17656,17676,17754,17852,17860,17919,17937,17966,18018,18034,18102,18139,18166,18204,18210,18276,18311,18315,18373,18416,18466,18493,18498,18547,18560,18591,18651,18688,18702,18797,18804,18827,18856,18893,18911,18915,18942,18952,18966,18978,19025,19045,19113,19142,19202,19263,19286,19309,19329,19402,19454,19507,19534,19585,19613,19676,19733,19766,19797,19825,19844,19879,19930,19985,19997,20012,20054,20134,20178,20184,20235,20261,20308,20322,20587,20662,20725,20759,20783,20862,20915,20981,20998,21050,21060,21073,21089,21112,21196,21233,21285,21289,21324,21362,21401,21438,21484,21526,21543,21612,21677,21723,21738,21788,21792,21806,21885,21939,21967,22015,22058,22070,22104,22160,22214,22250,22269,22334,22381,22412,22473,22511,22553,22560,22615,22637,22711,22759,22772,22787,22790,22822,22862,22884,22888,22920,22966,23007,23047,23081,23102,23115,23190,23201,23230,23281,23298,23360,23369,23383,23423,23426,23442,23483,23514,23533,23540,23547,23552,23576,23611,23621,23675,23717,23769,23820,23864,23876,23922,23963,23996,24020,24048,24108,24144,24160,24179,24207,24223,24315,24333,24379,24420,24480,24694,24760,24799-24800,24835,24858,24877,24924,24942,25015-25016,25071,25098,25138,25182,25199,25246,25278,25304,25353,25447,25487,25571,25617,25656,25659,25693,25708,25769,25789,25816,25869,25902,25930,25941,25973,26014,26024,26078,26120,26141,26145,26254,26302,26317,26320,26364,26381,26412,26446,26552,26575,26633,26676,26705,26736,26754,26758,26783,26799,26855,26867,26926,26929,26959,26975,27040,27082,27088,27102,27106,27130,27163,27178,27198,27322,27345,27366,27402,27464,27498,27506,27553,27574,27610,27694,27699,27735,27752,27884,27890,27893,27957,28019,28049,28062,28128,28151,28208,28252,28324,28352,28383,28480,28773,28831,28838,28940,28944,28968,28980,28987,29005,29020,29024,29089,29136,29161,29208,29212,29217,29255,29311,29321,29359,29384,29446,29468,29525,29533,29540,29582,29589,29640,29712,29729,29774,29876,29893,29939,30014,30024,30035,30083,30128,30165,30171,30210,30229,30234,30286,30339,30343,30398,30419,30475,30518,30529,30543-30544,30567,30623,30655,30665,30735,30798,30804,30818,30893,30953,30958,30965,30995,31017,31072,31160,31169,31187,31230,31281,31325,31373,31448,31475,31544,31576,31600,31619,31716,31756,31776,31784,31821,31830,31849,31894,31929,31987,32023,32061,32085,32133,32182,32192,32243,32288,32311,32348,32384,32477,32496,32562,32575,32602,32610,32645,34680,34745,34777,35676,35756,35796,35836,36072,36081,36104,36145,36177,36240,36298,36317,36379,36433,36498,36548,36564,36575,36609,36635,36651,36693,36697,36711,36759,36787,36850,38779,38812,38875,39831,39853,39864,39868,39893,39926,40062,40095,40195,40213,40300,40336,40355,40421,40476,40486,40519,40606,40617,40654,40706,40757,40795,40838,40872,40922,40943,40959,42948,42977,43959,43996,44015,44125,44156,44204,44248,44258,44284,44305,44360,44386,44389,44411,44437,44451,44471,44479,44502,44518,44554,44569,44584-44585,44651,44722,44771,44785,44789,44799,44833,44859,44883,44903,44931,44993,45032,46939,47028,47056,47098,47101,47967,48021,48051,48088,48250,48302,48330,48344,48355,48414,48516,48572,48587,48589,48606,48636,48694,48753,48804,48856,48872,48886,48900,48910,48963,48992,49047,49049,49060,49114,49123 \N ivo://cds.vizier/ii/170 5/7554 6/418,8278,8463,8498,12390,12396,12992,12996,13007,16641,16685,16689,16697,17254,17303,17391,17397-17398,18094,18783,19466-19467,19490,20547,20556,20761,20764,21317,21324,21328,21336,21436,21438-21439,21447,21456,21519,21530-21531,21638,21643,21646-21647,21656,21668,21690,22047,22058,22088,22091,22112,22114,22209,22223,22304,22315,22331,22615,22645,22663,22674,22680,22721,22727,22730,22753,22769,22772,22828-22829,22839,22849,22852,22854,22894-22895,22911,22920,22981,23644,23665,23669,23683,23689,23704,23707,23717,23735,23795,23798,23800,23809,23850,23937,23940,24449,24451-24452,24621,24705,25600,25942,25950,26125,26130,26770,26855,26867,28692,28714,28726,28801,28803-28804,28808,28853,28855,28891,28898,28915,28921,28970,29021,29089,29110,29113,29116,29239,29255,29257,29266,29513,29516,29623,29728-29729,29800,29841,29898,29913,30083,30087,30101,30106,30146,30214,30220-30221,30251,30467,30476-30477,30590,30614,30640,30659,30673,30681,30687,30693,32066,32072,32076,32091,32783,32969,32994,33043,33073,33076-33078,33089,33091-33092,33094,33098-33100,33102,33114,33120,33298-33299,33304,33306,33328,33549,33584,33589,33637,33639,33648,35723,35756,36022,36028-36029,36315,36337,36573,36956-36957,36986,37089-37090,37093,37099,37128,37139,37212-37213,37232,37235,37332-37333,37339,37362,37370,37716,37735,37746,37752,37822,37891,37894-37895,37900-37901,37906-37907,37916,37918,37930-37931,37965-37966,37970,38016,38018,38026,38028,38048-38049,38053,38117,38137,38287,38298,38305,38967,38990,39008,39163,39188-39189,39191,39238,39245,39283,39336,39373,39384,39397,39524,39562,39592-39593,39658,39671,39674,39679,39705,39776,39786,39854,39861,39863,39869,39872,39876-39877,39879,39882,39904,39908,39916,39922,39928,40089,40138,40235,40307,40311,40321,40323,40480-40481,41147,41497,41524,41534,41622,41630,41633,41879,41916,42023,42038,42177,42237,42383,42394,42406-42407,42423,42425,42428-42430,42474,42511,42532,42587,42609,42611,42617,42959,42972,42981,42988,42994,43012,43020,43043,43051,43137,43140,43146,43153,43230,43286,43602,43605,43778,43981,43992,43994,44411,44502,44508,44594,44597-44598,44676,44721,44859,45001,45050,45538,45549,45737,46065,46367,46430,46436,46729,46734,47110,47112,47137,47214,47302,47305,47518-47519,47539,47561,47661,47663,47740,47807,47814,47828,47848,47891,47910,47919,48505,48507,48516,48519,48531,48534,48900 \N ivo://cds.vizier/ii/188 5/7554 6/1083,1086,1169,8278,8463,8498,12390,12396,12992,12996,13007,16641,17303,17391,17397-17398,18094,19466,20547,20556,20761,20764,21316-21317,21324,21328,21336,21365,21389,21402,21422-21424,21436,21438-21439,21447,21456,21492-21493,21519,21530-21531,21643,21647,21668,21696,21698,21711,22047,22058-22059,22088,22091,22095,22178,22209,22223,22304,22315,22331,22615,22645,22663,22674,22680,22683,22707,22710,22721,22727,22753,22769,22772,22805,22828-22829,22849,22856,22858,22873,22875,22878,22894-22895,22920,22981,23683,23689,23704,23707,23717,23735,23795,23798,23800,23809,24277,24362,24621,24705,25600,25942,25950,26770,26855,26867,28690,28692,28714,28723,28726,28801,28804,28853,28855,28891,28898,28916,28978,28984,29021,29089,29110,29113,29116,29239,29255,29257,29513,29516,29623,29728-29729,29800,29841,29898,29913,30083,30087,30214,30220-30221,30251,30435,30438,30467,30476-30477,30590,30614,30640,30659,30673,30681,30687,30693,32066,32072,32076,32091,32783,32969,32994,33043,33073,33077,33091,33094,33098-33100,33102,33113,33121,33304,33306,33328,33637,33639,33648,33800,34535,34541,35536,35538,35723,35756,36573,36986,37089-37090,37093,37099,37139,37212-37213,37232,37235,37312,37330,37332-37333,37339,37362,37370,37408,37536,37716,37735,37746,37752,37822,37891,37894,37900-37901,37906,37916,37918,37930-37931,37965-37966,37970,38016,38018,38028,38048-38049,38053,38117,38137,38287,38298,38305,38967,38990,39008,39163,39188-39189,39191,39336,39373,39384,39397,39524,39562,39592-39593,39658,39671,39674,39679,39705,39757,39786,39789,39806,39861,39863,39872,39876-39877,39879,39882,39895,39904,39908,39921-39922,39926,39928,40089,40138,40235,40239,40242,40307,40311,40321,40323,40480-40481,40494,40588,41147,41178-41179,41419,41436,41438,41441,41497,41524,41534,41622,41627,41630,41633,41769,42023,42038,42139,42161,42177,42383,42387,42389,42394,42405,42423,42425-42426,42428-42430,42434,42474,42511,42525,42532,42587,42611,42617,42959,42988,43012,43020,43051,43137,43155,43161,43602,43605,43778,43981,43992,43994,44411,44502,44508,44594,44597-44598,44676,44721,44859,45001,45050,45538,45549,45737,46367,46430,46436,47110,47112,47137,47214,47302,47305,47518-47519,47539,47561,47661,47740,47807,47814-47815,47828,47848,47891,47910,47919,48505,48507,48516,48519,48531,48534,48900 \N ivo://cds.vizier/ii/200 6/12390,12396,17058,20547,20556,20761,20764,21299,21310,21317,21324,21328,21336,21365,21389,21402,21422-21424,21436,21439,21447,21456,21519,21530-21531,21631,21696,21698,21711,21717,21888,22058-22059,22095,22209,22223,22304,22315,22331,22615,22645,22663,22674,22680,22769,22772,22828-22829,22856,22858,22873,22875,22878,22920,23809,25600,26770,28690,28714,28723,28726,28801,28804,28853,28855,28898,28916,28978,28984,29021,29023,29045,29110,29113,29116,29513,29516,29623,29728-29730,29913,30083,30087,30214,30217,30220-30221,30251,30435,30438,30467,30476-30477,30590,30673,30687,32783,32817,32819,32828,32969,32994,33043,33073,33077,33091,33094,33098-33100,33102,33108,33111,33121,33304,33306,33328,33637,33639,33648,34535,34541,34562,34568,35003,35333,35344,35619,35630,35723,36169,36196-36197,36986,37089-37090,37093,37099,37139,37232,37235,37332-37333,37339,37362,37370,37546,37716,37735,37746,37752,37900,37906,37916,37918,37930-37931,38016,38018,38028,38048-38049,38053,38117,38137,38287,38298,38305,39163,39189,39191,39336,39373,39384,39397,39524,39658,39671,39674,39679,39705,39757,39786,39789,39806,39863,39872,39876-39877,39879,39895,39904,39908,39921-39922,39926,39928,40186-40187,40235,40239,40242,40307,40311,40321,40323,40480-40481,40494,40528,40588-40589,40613,40630,41147,41419,41497,41524,42023,42038,42177,42383,42387,42389,42394,42405,42416,42423,42425-42426,42428-42430,42434,42474,42587,42611,42617,42959,42988,43051,43137,44310,44312,44319,44411,44502,44508,44676,44721,45737,46095,46098,46470,46473,47110,47112,47137,47214,47302,47305,47518,47539,47740,47828,47891,48125,48531,48534,48810-48811,48900 \N ivo://cds.vizier/ii/202 6/12390,12396,20547,20556,20761,20764,21299,21310,21317,21324,21328,21336,21365,21389,21402,21422-21424,21436,21439,21447,21456,21631,21696,21698,21711,21717,21888,22058-22059,22095,22209,22223,22304,22315,22331,22615,22645,22828-22829,22856,22858,22873,22875,22878,23809,25600,25669,26770,28714,28723,28726,28801,28804,28916,28978,28984,29021,29023,29045,29110,29113,29116,29623,29728-29730,29913,30083,30087,30214,30217,30220-30221,30251,30467,30476-30477,30590,30673,30687,32783,32817,32819,32828,32969,32994,33043,33073,33077,33091,33094,33098-33100,33102,33108,33111,33121,33304,33306,33328,33637,33639,33648,34562,34568,35003,35333,35344,35619,35630,35723,36196,36986,37089-37090,37093,37139,37232,37235,37332-37333,37339,37362,37370,37546,37716,37735,37746,37752,37900,37906,37916,37918,37930-37931,38016,38018,38028,38048-38049,38287,38298,38305,39163,39189,39191,39336,39373,39384,39397,39400,39524,39658,39671,39674,39679,39705,39757,39786,39789,39806,39861,39863,39872,39876-39877,39879,39882,39895,39904,39908,39922,39928,40186-40187,40235,40239,40242,40307,40311,40321,40323,40494,40528,40588-40589,40613,40630,41147,41419,41441,41497,41524,42023,42038,42177,42383,42387,42389,42394,42405,42423,42425-42426,42428-42430,42434,42474,42587,42611,42617,42959,43051,43137,44310,44312,44319,44411,44502,44508,44676,44721,45737,47110,47112,47137,47214,47302,47305,47518,47539,47740,47828,47891,48125,48531,48534,48810-48811,48900 \N ivo://cds.vizier/ii/208 6/2619,2622-2623,2666-2667,2705,2708-2709,2752 \N ivo://cds.vizier/iii/147 4/2068 5/8263,8268-8269,8276,8278,8280-8281,8284 6/33046-33047,33049,33051,33085,33108,33110-33111,33116,33128,33133,37514 \N ivo://cds.vizier/iv/12 1/14,42 2/6,10,15,28,47,50-52,54-55,60,62,80-81,83-85,87,89,92-93,96,112-113,117,119,125,135,148,150-153,155-156,158,163-165,185-188 3/19-22,28-29,31,33-35,37-39,44,46-48,50,52,56,58-59,64,71-73,75,78-80,88-90,98,100,102,104,106,109-111,121,123,125-127,144,148-150,164,166,172,176,181,183-184,192,194,198-199,212,214-215,246,253-256,258,260,264,272,275,288,291,296,299,303,313,317,319,328,330-331,344-345,347,353-354,362,380,382,389-390,393,401,418,420,456,458-459,463-466,472,475,488,493,496,504,506-509,511,531,533-534,537-539,546,552,555,557-559,564-565,570,583,585,587,589-591,596-597,599,616-617,619,628,630,636,638,647,651,664-665,668-670,688-690,692,697,699,717,719,727-728,730-731,734-738,756,758-761,763-764,766-767 4/0,2,6,8-9,13-14,18,23-24,27-29,31,34-35,38-39,42,44,46-47,50,52,55,57-61,63,69,71,74-75,92-94,120,122-123,128,131,145-147,181-183,197-199,204-205,207,214-216,218-221,223,228,230-231,260-262,265-267,271,274-275,280,282,296-297,299,305-307,309-311,324-325,330-331,334-338,341-344,347-348,350-351,364,366-368,371,373-377,379-380,382,385-389,391,396,398-399,404-405,407,413-415,420-421,423,428,431-432,434-435,464,466-467,469-471,473-476,478-479,481-483,488,490-491,496,499,512,517-518,520,523-524,526,531-533,541,543-544,547,549,552-553,555-556,559,562,565-566,568,570-571,573-574,580,583-584,586-589,591,605-608,610-614,617-622,624-626,628,630-631,633,637,639-640,642,644-645,648,650,652-653,661-663,669,671,673-676,678-681,683-684,687,695,697-700,703,709-711,713-715,717-719,721-723,729-730,741-742,744-745,750-751,773-775,780,782-784,786-789,852,854-855,976,978-982,990-991,1008,1010-1011,1028-1029,1031,1038-1039,1044-1045,1050-1052,1060,1063-1064,1066-1070,1072,1074-1077,1080,1082,1085,1092-1094,1097,1104,1106-1108,1110,1112-1114,1117,1119,1122-1123,1126-1127,1132-1133,1135,1137-1138,1140,1142,1145,1151,1156-1157,1159,1161-1163,1169-1170,1172,1175,1178-1179,1182-1183,1189,1192,1194-1195,1201-1202,1204-1206,1209-1210,1216,1218,1220,1222,1225-1226,1229,1231,1235,1238,1240-1241,1243-1245,1247-1248,1251,1256-1257,1261-1263,1265-1266,1273,1275,1316-1317,1319,1384-1386,1408,1410-1411,1420,1422-1423,1440-1442,1445-1447,1454-1455,1457-1461,1465-1466,1468-1469,1504,1506-1507,1509-1512,1514,1518,1524-1525,1527,1532-1533,1535,1552-1554,1564-1565,1567-1570,1576,1579-1581,1584,1588,1590-1591,1593-1594,1596,1600-1602,1608-1609,1611-1612,1616-1618,1623,1629-1630,1632-1634,1636-1637,1642,1645-1648,1650,1652,1655-1656,1658,1662-1666,1669-1671,1676,1678-1679,1686,1689,1691,1695-1696,1698-1700,1702-1703,1706-1707,1709-1713,1721,1724,1728,1730,1734,1736-1737,1739,1741-1742,1746-1747,1751,1753-1754,1757,1762-1763,1767,1769-1770,1772-1773,1777,1779,1781,1783,1785,1787-1789,1828,1830-1831,1840,1844-1846,1848-1850,1868,1870-1871,1892,1894-1897,1926,1928-1929,1931-1932,1934-1935,1937-1938,1940-1941,1943-1944,1946,1948-1949,1951,1960-1962,1965,1968-1969,1971,1976-1977,1979-1982,1988-1989,1991-1993,1995,1998-1999,2020,2022-2023,2040,2042-2043,2050,2054,2056-2058,2061-2062,2066,2068,2071-2072,2076-2077,2079,2081,2088,2091,2093-2095,2097-2099,2101,2103-2106,2108-2109,2111,2113-2117,2119-2121,2123,2128-2130,2141-2146,2179,2181-2182,2189-2192,2195-2196,2198-2200,2202-2203,2205,2207,2212-2214,2217-2218,2224,2226-2227,2240,2242-2243,2245-2247,2249-2251,2253-2255,2266-2268,2270,2272,2274-2277,2279,2285-2286,2289-2293,2295,2298,2300,2302,2304,2308-2309,2312,2316,2318,2322,2327,2329,2331,2338,2353-2355,2392-2394,2472-2473,2475,2516-2517,2519,2525-2527,2548-2549,2551,2556,2558-2559,2566,2577-2578,2587,2593,2595,2600-2601,2664,2666-2668,2670-2671,2684-2686,2764-2766,2772-2774,2776-2778,2781,2783-2786,2792-2793,2800-2801,2803-2804,2806-2807,2809,2814,2817,2820,2825,2827,2831,2840,2842-2845,2847,2856-2858,2862-2863,2865-2866,2872,2874-2875,2881-2886,2888-2889,2891,2893-2895,2897-2900,2902-2904,2906-2907,2916,2918-2919,2928,2930-2934,2956-2958,3031,3050-3051,3061-3063 5/4-6,12,14-18,20-21,23,29-31,40,42-43,46-49,51,60,62-63,65-70,77-81,84-85,87-88,90-91,100-102,104-105,107,120,122-123,131-134,145,149-150,161-164,166-167,172,180-181,183,192-194,196-197,199,204,206-207,212,214,217-219,225-227,249-251,256,258-260,263-264,267,271-273,275,280-282,288,290-291,293-295,380-381,383,484,486-487,517,519,521-522,576,578-579,720-721,723,784,786-787,824-826,848-850,852-853,855,869-870,888,890-891,916,918-919,1052,1054-1056,1058-1059,1072-1073,1077-1082,1088,1091,1093-1095,1104-1105,1107-1110,1112-1114,1116-1118,1124-1126,1132,1135,1192-1193,1195,1216-1218,1232,1234-1235,1304,1306,1308,1310-1311,1313,1315-1317,1319,1328-1330,1332,1334-1335,1356-1357,1359,1361-1363,1380,1382-1386,1396-1397,1399,1460,1462-1463,1476-1477,1479-1482,1488-1490,1513-1515,1524-1526,1532-1534,1536-1538,1560-1561,1563,1588-1589,1591,1625-1627,1649-1651,1688-1689,1691,1717-1720,1722-1723,1732-1733,1735,1861-1863,1872,1874-1875,1888,1890-1891,1908,1911,1920,1922-1923,1957,1959,1988,1990-1991,1993-1995,2052-2054,2056-2057,2059-2060,2062-2064,2066-2067,2076-2077,2079,2085-2088,2090,2100-2101,2103,2113-2116,2118-2121,2123,2136,2138-2139,2141-2143,2145-2150,2152,2155-2157,2159-2162,2168,2170-2171,2181-2183,2185-2186,2192-2194,2201-2203,2205,2207,2216-2217,2219,2229-2234,2240-2241,2243-2246,2252-2254,2257-2259,2269-2271,2277-2279,2289-2291,2300,2302-2303,2324-2326,2328,2330-2331,2340-2342,2360,2362-2363,2417-2419,2436-2437,2439,2460-2461,2463-2465,2467,2492-2494,2508-2510,2516-2517,2519,2528-2530,2537-2539,2541-2546,2552,2554-2555,2564-2566,2573-2574,2584,2586-2587,2589-2591,2598,2604,2607,2617-2619,2621-2623,2641-2642,2672-2673,2675,2680,2682-2683,2689-2691,2708,2710-2711,2728-2730,2741-2743,2745-2747,2769-2771,2773-2777,2779,2784-2786,2805-2810,2832-2834,2848-2849,2851,2865-2867,2880-2882,2913-2915,2925-2927,2960-2962,2972-2974,2985,2988-2990,2992-2994,2996,2998-2999,3089,3091,3125-3127,3140-3141,3143,3161-3163,3165,3167,3413-3415,3908-3910,3933-3935,3952-3954,3956-3957,3959,4037-4039,4120-4121,4123,4144,4146-4147,4149-4151,4184-4185,4187,4189-4194,4197-4199,4212,4214-4216,4218,4221-4223,4245-4249,4251,4260,4262-4263,4284,4286-4287,4293-4295,4312,4315,4317-4319,4324-4326,4332-4334,4336,4339,4344,4347-4348,4350-4351,4381-4383,4385-4387,4392-4394,4396-4397,4399,4420,4422-4423,4437-4439,4445-4447,4460,4462-4463,4465,4467,4472-4473,4475,4482-4486,4496-4497,4499,4501,4503,4512-4514,4516-4517,4519-4522,4524-4525,4536-4537,4539,4545-4547,4556-4558,4564,4566-4567,4572,4574,4577-4579,4584-4586,4589-4592,4595-4596,4598-4601,4603,4633-4635,4640-4641,4643,4672-4673,4675,4684,4686-4687,4692,4694-4698,4705-4709,4711,4720-4721,4723,4725-4727,4752-4753,4755,4760-4761,4763-4765,4767,4775,4800-4801,4803,4813-4815,4828-4830,4832-4834,4845-4847,4868,4870-4871,4876-4877,4879,4884-4886,4894-4895,4897-4899,4909-4910,4913-4915,4921-4923,4928,4931,4933-4934,4937,4939,4944,4946-4949,4956-4958,4968-4969,4971,4985-4987,4997-4999,5001-5003,5032-5033,5035-5038,5041-5042,5056,5058-5059,5068,5070-5071,5088,5090,5096-5098,5272-5274,5549-5551,5636-5637,5639,5685-5687,5773-5778,5808-5810,5813,5824-5825,5827,5848-5850,5852,5855-5857,5868,5870-5871,5880-5881,5883-5886,6020,6022-6023,6032,6034-6035,6053-6055,6060,6062-6065,6067-6070,6077-6079,6105-6107,6136,6138-6139,6220,6222-6223,6264,6266,6284-6286,6308-6310,6312-6314,6328,6330-6332,6334-6335,6341-6346,6349-6351,6356,6358-6359,6368-6370,6380-6381,6383,6388,6390-6391,6393-6394,6396-6397,6399,6412-6413,6415,6440,6442-6443,6452-6454,6456-6458,6460,6476-6477,6480-6482,6484-6486,6488,6490-6491,6496-6498,6501-6503,6505-6509,6511-6512,6514-6515,6525-6527,6540,6543,6552-6554,6558,6560,6562-6565,6567,6572-6573,6577-6579,6597-6598,6604,6607,6612,6614-6618,6628-6629,6631,6637-6638,6642-6646,6668-6670,6672-6673,6675,6708-6710,6736-6738,6740-6741,6743,6748-6749,6751-6754,6761-6763,6769-6772,6774-6777,6779,6788-6790,6805,6807,6816-6818,6820-6821,6823,6833-6835,6857-6862,6864-6866,6868-6869,6873,6877,6879-6880,6882-6883,6888-6889,6891-6893,6895,6900-6902,6904-6905,6907-6908,6910-6911,6916,6918-6919,6924,6926-6930,6932-6933,6935,6940-6942,6953,6955,6960-6961,6963,6972,6974-6977,6979-6980,6992-6993,6998-6999,7001-7003,7008,7011,7020,7022-7023,7025-7027,7032-7034,7037-7039,7041-7042,7044,7056,7060,7062-7066,7072-7073,7075,7084,7086,7096,7098-7100,7102,7105-7106,7112,7114,7120-7122,7131,7136,7144-7145,7147,7160,7162-7166,7316-7317,7319,7364-7366,7368,7370-7374,7388-7389,7391,7404,7406-7407,7476-7478,7572-7573,7575,7592,7594-7596,7598-7599,7680-7682,7684,7686,7688,7690-7691,7693-7698,7701-7703,7708-7709,7711,7720,7722-7723,7734-7735,7744-7745,7756,7758-7759,7768-7769,7771,7780-7781,7783,7788,7790,7800-7801,7824-7825,7827,7829-7831,7833-7834,7836-7837,7839,7852-7853,7855,7857-7859,7864-7865,7867-7868,7871,7881-7883,7912,7914-7915,7933-7935,7960,7962-7963,7976-7978,7984-7986,7988-7990,8084-8086,8164-8166,8195,8198-8199,8204-8206,8209-8210,8213-8215,8221,8236,8239,8241-8243,8252-8254,8256,8258,8260-8262,8269-8271,8277-8278,8280-8282,8294,8296-8298,8301-8303,8312-8314,8320-8321,8323,8331-8334,8337-8342,8345-8346,8349,8351,8357-8358,8360-8362,8369-8370,8384-8386,8401,8403,8408-8410,8429-8431,8440-8441,8443,8449-8451,8472,8474-8475,8488-8489,8491,8524-8525,8527,8561-8563,8588-8589,8591,8705-8707,8709-8713,8715,8722-8723,8732,8734,8753-8755,8772-8774,8776-8778,8789-8791,8805-8807,8817-8819,8824,8826-8827,8860,8863,8865-8867,8876-8877,8879,8900,8902-8903,8964-8965,8967,8976-8977,8979,8992-8993,8995,9008,9010-9011,9056-9057,9059-9061,9076,9078,9084-9086,9092-9094,9112-9113,9115,9136-9138,9149,9151-9153,9155,9177-9179,9184-9186,9189-9191,9196-9198,9204-9206,9212,9215,9220-9221,9223-9224,9228-9229,9231,9240-9242,9245,9247,9252-9253,9255,9257-9258,9261-9263,9269,9271,9277,9280,9282-9284,9286-9287,9292-9294,9296-9297,9299-9301,9303-9304,9307,9312,9314-9315,9320-9322,9345-9347,9350,9356-9357,9359,9376,9378-9381,9383,9388-9389,9391,9409-9411,9581-9583,9897-9899,10072,10074-10075,10096-10097,10099,10200,10202-10203,10228-10230,10243,10245-10250,10254-10255,10259,10262-10263,10268-10269,10273-10277,10279,10281-10282,10284-10285,10287,10291-10292,10294,10296,10298-10300,10302-10303,10305-10307,10317-10319,10321-10323,10325-10327,10329-10330,10333-10336,10338,10340,10342,10344-10346,10368-10370,10377-10379,10384,10386,10388-10390,10392-10393,10395,10397-10399,10408,10410,10413-10415,10660-10661,10663,10677-10679,10750,11068,11070-11071,11100-11102,11116-11117,11119-11121,11123,11128,11130-11131,11148-11150,11176-11177,11179,11182,11208-11209,11211,11220,11222-11223,11232-11233,11235,11240-11242,11244-11245,11248,11250,11252-11254,11260-11261,11264-11265,11267,11273-11277,11284-11285,11289-11292,11294-11295,11297,11305-11307,11313-11317,11320,11322-11323,11328,11330-11332,11334-11335,11337,11339-11341,11343-11344,11346-11348,11350-11354,11358-11359,11364,11366,11384-11385,11387,11392,11394-11395,11397,11399-11401,11403,11405-11408,11410-11411,11414,11416,11418-11419,11421-11422,11436,11438-11441,11443-11444,11446-11447,11457-11459,11468-11470,11493-11495,11520,11522-11523,11548-11550,11561-11563,11568-11569,11571,11585-11587,11604-11606,11620-11621,11623,11668-11670,11717-11719,11740-11741,11743,11836,11838-11839,12112,12115-12118,12121-12123,12192,12194-12195,12197-12199,12240-12241,12243 6/28,30-31,52-54,77-79,88-90,113-114,164,166-167,176-177,179,181,183,200,202-203,245,247,256-257,259,284-286,304-305,307,329-333,335,344-346,356-357,359,412,414-415,425-427,485-487,513-518,520-521,541-543,576-578,585-590,592,594-595,604,606-607,640-641,643,661-663,692-694,696-697,699-701,703,728-729,731,780-781,783,792-793,795,820,822-823,852-854,861-865,867,897,899,992,994-995,1028,1030-1031,1044-1046,1048-1050,1060-1061,1063-1066,1072-1073,1075,1077,1079,1081-1083,1097-1099,1132,1134-1135,1156,1158-1159,1168-1169,1171,1528,1530-1531,1940,1942-1943,2064-2065,2067,2072-2073,2075,2080,2082-2083,2093-2095,2308-2309,2311,2888,2890-2891,3140,3142-3143,3308-3309,3311,3404-3405,3407,3417-3419,3472-3473,3475,3484-3485,3487,3556,3558-3559,3668-3669,3671,4212-4213,4215,4229-4231,4296-4298,4300-4301,4303-4304,4306-4307,4332-4334,4356,4358-4361,4363,4368-4369,4371,4424,4426-4427,4444,4446-4447,4460-4461,4463,4476-4477,4479,4508,4510,4533-4537,4539,4776-4777,4779,4876,4878-4879,4932-4933,4935,5220-5221,5223,5228,5230-5231,5237,5239,5248,5250-5251,5257-5259,5272,5274-5275,5325-5327,5332-5334,5432,5434,5440-5442,5524,5527,5548-5549,5551,5593-5594,5845-5847,5914-5915,5932,5934-5935,5964,5966-5967,6049-6051,6108-6109,6111,6140-6142,6156-6157,6159,6248-6249,6251,6360-6362,6496-6498,6592-6594,6760-6762,6864-6866,6884,6886-6887,6936-6938,7440,7442-7443,7492-7494,7557-7559,7637-7642,7684-7685,7687,7824-7825,7827,7832,7834-7835,7956,7958-7959,7968,7970-7971,8221-8223,8232-8234,8244,8246,8260,8312,8314,8336-8338,8356-8358,8364-8366,8408-8410,8432-8433,8435,8437-8439,8441-8445,8447,8449-8451,8468-8470,8489-8491,8549-8551,8560-8561,8563,8577-8579,8604,8606-8607,8612,8614-8615,8617-8619,8632-8633,8635,8652-8653,8655,8677-8679,8720-8721,8723,8736,8738-8739,8748,8750,8780-8781,8783,8800,8802-8803,8816,8818-8819,8824-8825,8827,8873,8875,8912,8914-8915,8941-8943,8968-8970,8988-8990,9021-9024,9026-9027,9072,9074-9075,9104-9105,9153-9155,9205-9207,9309-9311,9316-9318,9372-9373,9375,9445-9447,9664,9666-9667,9752-9754,9849-9851,9865-9867,9981-9983,10044-10046,10073-10075,10124-10126,10144-10146,10161-10163,10188-10190,10212,10214-10215,10268,10270-10271,10290-10291,10302-10303,10341,10343,10352-10354,10384-10386,10388,10390-10391,10396,10398-10399,10420-10421,10423-10426,10464,10466-10467,10480-10481,10483,10560,10562-10563,10572-10574,10696,10698-10699,10725-10727,10752-10753,10836,10838-10839,10924,10926-10927,10960-10962,10976,10978-10979,11073-11075,11088-11089,11091,11112-11114,11148-11150,11217-11219,11245-11247,11340-11341,11343,11400,11402-11403,11456-11457,11459,11532,11534-11535,11648-11649,11651,11696,11698-11699,11852-11854,11900-11902,11936-11937,11939,11944-11946,11948-11949,11951,11964,11966-11967,11981-11983,11988-11990,12352,12354-12355,12361-12363,12496-12498,12568-12569,12571,12640-12642,12657-12659,12664-12666,13649-13651,15644-15646,15728-15730,15821-15823,15832-15833,15835,16144-16145,16147,16489-16491,16581-16582,16592-16594,16745-16747,16752,16754-16755,16780-16781,16783-16785,16787,16853-16855,16868,16870-16871,16876-16878,16880,16882-16883,16976-16977,16979,17000-17001,17003,17046-17047,17140,17142,17169-17171,17252,17254-17256,17258-17259,17264-17266,17308,17310-17311,17341-17343,17348-17350,17352-17353,17355,17380-17381,17383-17386,17397-17399,17521-17523,17536-17538,17581-17583,17592-17593,17595,17684,17686-17687,17744-17746,17777-17779,17844,17846-17847,17856-17857,17859,17864-17866,17896-17898,17921-17925,17927,17948-17949,17951,17993-17995,18001-18003,18008-18009,18011,18061-18063,18072-18074,18093-18095,18104-18105,18107-18110,18152-18153,18155,18176-18177,18179,18236-18238,18260-18262,18293-18295,18300,18302-18304,18306-18307,18348,18350-18353,18355,18373-18376,18378-18379,18388-18390,18408-18410,18528-18529,18531,18568,18570-18571,18696-18698,18740,18742-18743,18772-18773,18775,18796-18797,18799,18817-18819,18840-18841,18843,18888-18889,18891,18896,18898-18899,19016-19018,19048,19050-19051,19064-19065,19067,19088-19090,19092-19093,19095,19097-19099,19208-19209,19211,19248-19249,19251,19325-19327,19341-19343,19376,19378-19379,19476-19478,19512-19514,19548-19549,19551,19569-19574,19585-19587,19633-19635,19644,19646-19647,19649-19651,19680-19682,19716,19718-19722,19728,19730-19731,19740-19741,19743,19745-19747,19752,19754-19755,19780-19782,19800,19802-19803,19805-19807,19836-19838,19880-19882,19936,19938-19939,19985-19987,20000-20002,20137-20139,20156-20157,20159-20160,20163,20173-20175,20229-20231,20276,20278-20279,20357-20359,20364-20366,20396-20397,20399,21100-21102,22192-22193,22195,22552-22553,22555,22736-22738,23088-23090,23116,23118-23119,23244,23246-23249,23251,23257-23261,23263,23305-23307,23404-23406,23413-23418,23432,23434-23438,23476,23478-23479,23529-23531,23548-23550,24084-24085,24087,24132,24134-24135,24208-24209,24244,24246-24247,24264-24266,24284-24285,24287,24304-24306,24417-24419,24548-24549,24551,24884,24886-24887,25060-25061,25063,25068,25070-25071,25149-25151,25245-25247,25260,25262-25263,25316-25318,25332-25333,25335,25360-25361,25363,25388-25389,25391-25394,25429-25431,25484-25485,25487,25528,25530-25531,25556-25557,25559,25568-25569,25571,25582-25583,25593-25595,25656,25658-25659,25764,25766-25767,25820-25822,25837-25839,25844-25846,25849,25851-25854,25912-25914,25916-25917,25919,25933-25935,25948,25950-25951,25956-25958,25996-25998,26000-26001,26003,26016-26018,26040-26042,26052-26053,26096-26098,26164-26165,26167-26170,26221-26225,26227-26228,26230-26231,26236,26238-26239,26244-26246,26264,26266-26267,26296,26298-26300,26302-26306,26385-26387,26397-26399,26420,26423-26426,26453-26455,26477-26479,26520-26522,26544,26546-26547,26556-26558,26560,26562-26564,26566-26567,26588-26589,26591,26684-26685,26687,26696-26698,26844-26846,26956-26957,26959,26968-26969,26971,27001-27003,27020-27021,27023,27040-27041,27043,27072-27073,27075,27092,27095,27112-27113,27115,27164-27166,27217-27219,27224,27226-27227,27277,27279,27288,27290-27291,27328,27331,27424-27426,27452-27454,27468,27470-27471,27480-27481,27483-27485,27487-27489,27491,27496-27498,27500-27502,27504,27506-27507,27512-27513,27515,27524-27525,27527,27560-27562,27577-27579,27612,27614-27615,27624,27626-27627,27636-27637,27639,27669-27671,27701-27703,27724-27726,27736-27738,27772,27774-27775,27808-27809,27811,27816,27818-27819,27848-27850,27892-27893,27895,27913-27915,27924-27926,27928,27930-27931,27933-27935,27976,27978-27980,27982-27985,27987-27988,27990-27991,28000-28001,28003,28036-28037,28039,28041-28042,28085-28086,28097-28099,28141-28144,28146-28147,28161-28163,28172-28174,28180-28182,28184-28186,28189-28191,28228-28230,28233-28235,28237-28239,28244-28245,28247,28268,28270-28271,28296-28298,28340-28342,28348-28350,28389-28391,28405-28407,28412-28413,28416-28417,28419,28428,28430-28431,28452-28453,28455,28461,28463,28492-28494,28513-28518,28520-28521,28523,28549-28553,28555-28557,28584-28585,28587,28644-28645,28647,28668,28670-28671,29272,29274-29275,29468,29470-29471,29476-29478,29500-29501,29503,29561-29563,29620-29621,29623,29916,29918-29919,30297-30299,30372,30374-30375,30388,30390-30391,30732-30733,30735,30740,30742-30743,30748,30750-30751,30756,30758-30759,30768-30770,30796-30798,30800-30802,30841-30843,30885-30887,30928-30930,30932-30933,30935,30984,30987-30989,30991,31028-31029,31031,31080-31081,31083,31128-31130,31156-31157,31159,31164-31165,31167,31208-31209,31211-31212,31214-31215,31304-31305,31307,31313-31315,31328,31330-31331,31340-31342,31352-31353,31355,31416,31418-31419,31424-31425,31427,31465-31467,31477-31482,31520-31522,31652-31654,31728,31730-31731,31844,31846-31847,31916-31917,31919,31948,31950-31951,31965-31967,32348-32349,32351,32668-32670,32769-32773,32775-32777,32779,32784-32785,32787-32788,32790-32791,32828,32830-32831,32834-32835,32844-32845,32847-32849,32851,32880,32882-32883,32888-32889,32891,32893-32895,32948,32950-32954,32960,32962-32963,33020-33021,33023,33028-33030,33036-33037,33039,33052-33053,33055,33072-33074,33105-33107,33116-33117,33119,33133-33135,33168-33169,33171,33173-33175,33180,33182-33183,33196-33198,33201-33203,33260-33261,33263,33288,33290-33291,33312-33313,33315-33318,33320,33322-33323,33340-33342,33344-33345,33347,33372,33374-33378,33388-33389,33392,33395,33400-33402,33424,33426-33427,33436-33437,33439,33452-33454,33472-33474,33485-33487,33548-33550,33600,33602-33603,33608-33609,33611,33645-33647,33713-33715,33768,33770-33771,33792-33794,33893-33895,33960-33962,34104-34105,34107,34240,34242-34243,34360-34361,34363,34816-34817,34832-34833,34835,34856,34858-34859,34880-34882,34885-34886,34933-34935,34941-34943,35008-35010,35100-35102,35116-35118,35152-35154,35216-35218,35264,35266-35267,35300-35302,35444-35445,35447-35449,35451,35456-35457,35459,35512-35513,35515,35604-35606,35864-35866,35912,35914-35915,35977-35979,36036,36038-36039,36232-36234,36248-36249,36251-36254,36308-36309,36311,36316-36318,36348,36350-36351,36380-36381,36383,36456,36458-36459,36556-36557,36559,36593-36595,36600,36602-36603,36617-36619,36704-36705,36707,36748-36750,36752,36754-36755,36797-36799,36828,36830-36831,36852,36854-36857,36859,36888-36889,36891,36900-36902,36904-36905,36907,36909-36911,36921-36923,36973-36976,36978-36979,36984,36986-36987,37017-37018,37024,37026-37027,37036,37038-37042,37073-37075,37080,37082,37105-37107,37113-37117,37119,37125-37127,37140-37142,37181-37183,37193-37195,37208-37209,37211,37220-37221,37223-37225,37227,37253-37255,37293-37294,37376,37378-37379,37393-37396,37398-37399,37404-37405,37407,37432,37435,37508-37509,37511,37528,37530-37531,37536-37538,37540,37542-37546,37548-37549,37551,37561-37563,37633-37635,38320-38321,38323,39584,39586-39587,40292-40293,40295,40392,40394-40395,40804-40805,40807,40924-40925,40927,40960,40963-40966,40968-40969,40971,40976-40977,40979,41004-41005,41007-41008,41012,41014-41015,41025-41027,41029-41030,41032-41034,41040-41041,41043-41044,41047,41081-41084,41086-41089,41112-41113,41115,41120-41122,41132-41134,41145-41147,41152,41154-41155,41157-41159,41161-41163,41173-41175,41180-41181,41183,41188,41190-41191,41204-41205,41207,41216-41218,41264-41266,41280-41282,41296,41298-41299,41312,41314-41315,41325-41328,41331,41348-41350,41356-41358,41364-41366,41373-41375,41388-41389,41391,41485-41487,41505-41507,41540,41542-41543,41549-41551,41565,41567,41576-41578,41584,41587,41636-41638,41644-41646,41648,41651,42649-42651,42705-42707,42994-42997,42999,43004-43005,43007,44276-44278,44412,44414-44415,44472,44474-44475,44488-44490,44516,44518-44519,44604-44605,44607,44712-44714,44720-44722,44724,44726-44727,44732-44733,44735,44841-44843,44885-44887,44936-44937,44939,44973-44975,44984-44986,44989-44991,44996,44998-44999,45004-45006,45020-45022,45048,45050-45052,45054-45055,45064-45065,45088,45090-45091,45113-45118,45144-45146,45148-45150,45152-45154,45173-45175,45185-45187,45193-45195,45197-45199,45216-45217,45219,45248-45249,45251,45272-45274,45276-45277,45279,45285-45287,45316,45319,45332-45334,45344-45345,45352-45353,45355,45369-45371,45380-45382,45397-45399,45420-45421,45423-45424,45426-45427,45429-45431,45460,45462-45463,45468-45470,45544-45545,45547,45572-45573,45575,45584-45585,45587,45592-45594,45608,45610,45616-45617,45619,45636-45637,45639,45648-45650,45652-45654,45661-45663,45668-45669,45671,45680-45682,45692,45694-45695,45749-45751,45769-45771,45780,45782-45783,45824,45826-45827,45885-45887,45968,45970-45971,46084,46087,46205-46207,46241-46243,46281-46283,46336-46337,46339,46429-46431,46488,46490-46491,46685-46687,46864-46866,46969-46971,47349-47351,48452,48454-48458,48478-48481,48483,48772-48774,48784-48786,48968-48970 \N ivo://cds.vizier/ix/13 4/2068 5/118,2179,2693,2903,4496,4509,5563,5715,5884,5886-5887,6932,6941,8278,8329,11610,11775 6/13,15,18,42,50,60,87,110,131,134,137,158,180,206-207,211,214,217,219-220,222,242,247,311,325,336,342,351,375,377,398,461-463,478,485,496,532,538,546,550-551,557,572-573,579,582,595,597,601,638,683,686,737,768,770,792-793,845,863,911,924,940-941,958,975,980,986,1006,1025,1048,1050-1051,1058,1074-1075,1077,1114-1115,1143,1154,1156,1168-1169,1171,1196,1198-1199,1263,1405,1443,1467,1470,1504,1521,1523,1546,1556,1558,1642,1694,1700-1702,1704,1791,1852,1938-1939,2017,2025,2052,2062,2127,2133,2154-2155,2164,2174-2175,2207,2214,2216-2217,2220-2221,2227,2229,2233,2236,2241,2245,2250-2251,2254,2256,2260-2261,2273,2321,2324,2340,2381,2388,2412,2414,2432,2464,2490,2551,2564,2569,2571,2593,2600,2622-2623,2630-2631,2660-2661,2666,2708-2709,2737,2740,2806,2883,3005,3020,3029,3054,3063,3066,3073,3094,3097,3102,3241,3304,3308-3309,3311,3383,3389,3428,3430,3444,3446,3504-3506,3649,3651,3675,3678,3681,3712,3728,3818-3819,3849,3851,3886,3923,3932,4014,4028-4029,4108,4110,4127,4146,4149,4155,4180-4181,4188,4203,4206,4215,4240-4241,4280,4285,4321,4324,4340-4341,4360-4361,4365,4394,4427,4436,4438-4439,4444,4455,4472,4474,4488,4506-4507,4511,4648-4649,4676,4691,4693,4695-4696,4735,4759,4765,4767-4768,4770,4790,4802,4804,4820,4829,4831,4833,4835,4859,4862,4923,4964,4989-4991,4996,5005-5006,5008-5009,5016,5027,5030,5041,5088,5091,5102-5104,5161,5163,5181,5200,5241,5244,5247,5262,5312,5332-5333,5352,5377,5413,5423,5432,5437,5439,5463,5483-5484,5486,5534,5558,5616,5618,5627,5629,5689,5694,5701,5742,5766-5767,5793,5806,5817,5820,5838,5853,5872-5873,5918,5930,5975,5982,5989,6002,6004,6008,6018,6025,6028,6034,6036-6037,6047,6063,6066,6123,6147,6164,6219,6241,6252,6305,6308,6337,6340,6365,6382,6534-6536,6538,6611,6618,6726,6853,6951,6999,7011,7026,7059,7061,7205,7225,7241,7262,7329,7332,7334,7349,7351,7354-7355,7374,7428,7508,7510,7548-7549,7551,7577,7579,7582,7604,7606,7610,7624,7633,7636,7642,7658,7664,7684,7686,7696,7713,7743,7752-7754,7761-7763,7768-7769,7781,7814,7869,7871,7878,7888,7890,7896,7902,7925,7967,7980,7982-7983,7988-7989,7998,8017,8041,8043,8058,8066-8068,8071,8094,8116,8144,8173,8196,8207,8220,8258,8264-8266,8268,8270-8271,8274-8275,8283,8299-8300,8325,8330,8345,8359,8365,8373,8440-8442,8452,8458,8479,8483,8485-8487,8492,8513-8515,8518,8520,8523-8524,8526-8528,8545,8547-8548,8555-8556,8558,8575,8577,8580,8606,8612-8614,8624,8626,8631,8636,8641,8648,8659,8663,8665,8669,8673,8681,8689,8711,8735,8751,8778,8788,8790,8793,8812,8843-8845,8906,8909,8915,8922-8923,8927,8941,8943,8945-8946,8952,8962-8963,8965-8966,8968-8969,8971-8972,8989,9007,9009,9024,9031,9036,9039,9044,9046,9048,9050,9052,9072,9083,9093,9101,9125,9129,9181,9219,9238,9252,9261-9262,9268,9272-9274,9287,9305,9333,9346,9348,9354,9357,9359,9371-9372,9374-9375,9397,9402-9403,9442-9443,9468,9470-9471,9476,9490,9504,9506,9512,9514,9531,9612-9613,9632-9633,9706-9707,9709-9711,9723,9764,9776,9809,9811-9812,9828,9830-9831,9866,9888,9925,10007,10048,10055,10089-10090,10131-10132,10137,10156-10157,10202,10206,10214,10217,10219-10220,10235-10237,10255,10271,10288,10307,10312,10337,10375,10379,10381,10383,10385-10388,10400-10401,10407,10416,10420,10422,10430-10433,10435,10473-10475,10481,10556-10557,10636,10639,10642,10664,10710,10716,10743,10755,10760-10761,10765,10769,10771,10777,10780,10783,10804,10826,10845,10888,10899,10911-10912,10927,10938,10959,11099,11127,11132,11195,11203,11213,11225,11252-11253,11258-11259,11290,11354,11388-11389,11391-11392,11399,11403,11408,11410-11411,11419,11426-11427,11430,11434-11435,11437,11448,11512,11514,11534,11543,11549-11550,11589,11591,11597,11601,11606,11624,11626,11636,11639,11645,11657,11668,11670,11673,11685,11690-11691,11706,11723,11725,11730,11736,11755,11795,11806-11807,11813,11845-11846,11851,11873,11898,11910,11916-11917,11920,11936,11941,11943,11960-11961,11974,11981,11987,11995,12000-12001,12009,12012,12018,12024-12025,12034,12047-12048,12053,12056,12072,12074-12075,12081,12091,12118,12121,12123-12124,12155,12241,12311,12352,12380,12454,12459,12466,12472,12523,12569,12571,12581,12592,12604,12619,12621,12632,12642,12675,12684,12749,12859,12864,12945,12974-12975,12983,12993,12996,13007,13024,13110,13120,13151,13164,13203-13205,13208,13224,13226,13236-13237,13250,13301,13314,13320,13333,13410,13427,13494,13496,13511,13522,13564,13673,13688,13695,13699,13722,13778,13802,13808,13855,13927,13933,13935,13946-13947,14008,14018,14035,14056,14124,14126,14259,14263-14264,14266-14267,14285,14305-14306,14317,14340,14353,14368,14409,14431,14437,14441,14444,14454,14486,14531,14593,14631-14632,14641,14643-14644,14646,14649-14650,14670,14692,14710,14727,14744,14772,14777,14789,14791,14797,14800,14853,14855,14858,14865,14899,14906,14964,15045,15047,15052,15064,15067,15090,15106,15112,15130-15131,15135,15159,15165,15170,15174,15176,15217,15241,15243,15250,15261,15284,15314,15320,15351,15355-15356,15369,15385,15392,15409,15478-15479,15495,15506,15534,15577,15592-15594,15631,15667,15683,15759,15861,16023,16029-16031,16034,16042-16043,16045-16046,16051,16058-16059,16066,16069,16072,16105,16108-16109,16120-16121,16131,16144,16185-16187,16192,16280-16281,16298,16301,16312,16382,16409,16411-16412,16432,16434,16441,16541,16550,16584,16586,16629,16655,16666,16696,16700-16701,16713,16715,16736,16834,16878,16886,16926,16941,16952-16953,16955,17052,17058,17075,17119,17141,17184,17186,17192-17193,17219,17228,17237,17247-17248,17286,17293,17300,17307,17357,17368,17397,17412,17448,17472,17485,17487,17492,17500,17502,17504,17571,17574,17579,17607,17613,17639,17645,17657,17662,17693,17713,17726-17727,17730-17731,17734,17740-17741,17753-17755,17758,17761,17763,17776,17779-17780,17803,17815,17819-17820,17827-17828,17839,17848-17850,17865-17867,17890,17898,17909,17930,17952,17977,17979,17982,17989,18001-18003,18009,18011,18022,18027-18028,18030,18035,18040-18041,18065,18068,18084,18086,18097-18099,18112-18113,18116,18125,18168,18184,18188-18190,18194,18206-18207,18209,18212,18234,18236,18309,18321-18326,18365,18398,18411,18431,18450,18457,18553,18566,18590,18596,18599,18622,18660-18662,18666,18668-18670,18683,18769,18794-18795,18802,18809,18812-18813,18817,18827,18870-18871,18889,18935,18953,18956,19002,19009,19022-19023,19053,19055,19077,19088,19094,19101,19140,19144,19150-19151,19157,19162-19163,19170,19190,19270-19271,19283,19318,19347,19383,19398,19416,19433,19507,19513,19527,19553,19567,19584-19585,19606,19608-19609,19670,19700,19723,19730,19734,19740,19746,19767,19783,19789,19797,19802,19831,19842,19846,19848-19850,19872,19895,19900,19905-19907,19912,19921,19923,19925,19930,19932,19935,20012,20020,20051,20054-20055,20060-20061,20071,20081-20083,20099-20100,20102,20116,20145,20148,20176,20178,20192,20205,20271,20282,20286,20302,20308,20328,20355,20358,20371,20416,20426,20481,20613,20618,20624,20656-20657,20659,20707,20725,20759,20761,20764,20766,20782-20783,20854,20881-20882,20888-20889,20896,20899,20915,20940,21012,21038-21039,21089,21121,21125-21126,21131,21134,21156,21169-21170,21196,21198,21242,21266,21285,21287,21326,21348,21358,21387,21401-21402,21430,21433,21435-21436,21438-21439,21448,21450,21479,21526,21584,21641,21643,21656,21667,21670,21690,21694,21731,21758,21766,21804,21806,21882,21934-21935,21939,21956,21960,21968-21970,21972-21973,21988-21989,22021,22035-22036,22040,22076,22100,22148,22180,22182,22209,22247,22249,22258,22266,22270,22277,22289,22292,22300,22321,22363-22365,22374-22375,22379,22452,22464,22479,22514,22517,22519,22533,22544,22546,22573,22577-22578,22584,22607,22624-22625,22627-22630,22632,22642,22658-22659,22680,22707-22709,22746,22753-22754,22787,22790,22804-22805,22818,22820,22822,22837,22848,22850-22851,22854-22855,22866-22867,22870,22873,22880,22884,22886,22890,22904,22909,22912,22915,22917,22922,22947,22959,22964,22966,22970,22972,23010,23027-23028,23075,23078,23099,23101,23121,23127,23134,23137,23191,23222,23230,23237,23248,23259,23269,23277,23279-23280,23323,23342,23344-23345,23383,23393,23395,23403,23410,23429,23431,23451,23468-23469,23476,23478,23515,23523,23525-23527,23532-23533,23535,23542,23621,23633,23637,23644,23646,23658,23678,23699,23704-23705,23717,23719,23735,23738,23741,23764,23830,23850,23853,23864,23866,23872-23873,23952-23953,23955,23960,23980,23982,23995,24041,24084,24105,24116,24120-24121,24150-24151,24160,24179,24185,24297,24327,24333,24336,24370,24417,24420,24513,24661,24681,24733,24777,24793,24843,24912,24943,24951,24954,25042,25055,25083,25100,25135,25205,25220,25300,25302,25344-25345,25428,25487,25498,25513,25518,25520,25577,25580,25585,25630,25647,25659,25682,25710,25735,25742,25745,25793,25828,25830-25832,25849,25852,25897,25906-25907,25919,25964-25965,25967,25980-25982,25986,25989,26049,26051,26061,26069,26071,26082-26083,26086,26100,26109,26111,26119,26125,26130-26131,26148,26185,26188-26189,26200,26208,26210,26221,26223,26245,26271-26272,26274,26280,26292,26297,26303,26310,26313,26316,26323,26327,26365,26374-26375,26381,26386,26392,26396,26454,26460,26466,26472,26509,26521,26542,26550,26552,26555,26569,26614-26615,26703,26736,26753,26755-26756,26769-26770,26780-26781,26783,26808,26810,26867,26923,26963,26966,26972,26975,27005,27009,27045,27127,27172,27174,27186,27192,27224,27248,27293,27310,27314,27352,27374,27382-27383,27419,27423,27462,27481,27484,27486,27489,27492,27494,27498,27509,27514,27562,27574,27580,27582,27592,27595,27600,27604-27605,27612,27649,27652,27654,27681,27714,27717-27722,27736-27737,27739,27741-27743,27757,27769-27771,27773,27775,27803,27805,27825,27856-27857,27861-27863,27868,27906-27909,27913-27914,27917-27919,27936-27938,27944-27945,27948-27949,27951,27955,27961-27962,27964,27966,27982,27984,28015,28026,28033-28035,28037-28039,28044-28045,28059-28060,28081,28132,28138-28139,28141,28149,28151-28152,28164,28172,28178,28184,28220-28221,28227,28249,28251-28252,28254,28271,28275,28281,28294,28356,28361,28371-28372,28414-28415,28423,28430,28454,28467,28471,28476,28481,28491-28492,28494,28517,28519,28527,28532,28538-28540,28542,28557,28583,28589,28605,28613,28631,28637,28646,28736-28737,28748,28764,28768,28778,28803,28808-28809,28816,28825,28827,28830,28835,28849,28890,28896,28903,28919-28920,28955,28973,29016,29094,29116,29170,29200,29211,29259,29265,29288,29310-29311,29334,29340-29341,29360,29385,29513-29515,29519,29521,29523,29533,29535,29569-29571,29574,29603,29718,29793,29795,29798,29870,29923,30001,30029,30031,30040,30042,30216,30218-30219,30245,30259,30262,30291-30292,30315,30317,30319,30328,30341,30389,30391,30419,30454,30502,30505-30506,30508,30511,30543,30592,30614,30616,30618,30622,30624,30626,30657,30659,30675,30687,30692-30693,30695,30700,30718-30719,30741,30788,30818,30833,30941,30946,30958,30989,30995,31019,31112,31120,31132,31148,31211,31257,31383,31389,31391,31398-31399,31430,31451,31465,31484,31501,31509,31529,31532,31534,31537,31552,31559,31636,31652,31660,31663-31664,31685,31717,31751,31781,31843,31857,31866,31880,31894,31929,31967,31973,31984,31986,31989,31998,32028,32030-32031,32056,32059,32070,32085-32087,32089,32092,32141,32158,32175,32185-32186,32189,32191-32192,32307,32311,32317,32348,32350-32351,32394,32484,32486,32500,32516,32521,32527,32645,32656,32658,32686,32720,32760,32894,32961,33047,33049,33052-33053,33055,33067,33075-33077,33079,33106-33108,33116,33120-33122,33124,33153,33187,33193,33225,33227-33228,33235,33271,33277,33287,33291,33295,33297-33298,33305-33306,33312-33313,33320-33321,33323-33325,33328,33378,33403,33490,33496,33551,33628,33630,33634,33639,33650,33804,33866,33914,33920-33921,33937,33954,33958,34093,34104,34123,34181,34210,34216,34259,34264,34355,34493,34513-34517,34531,34534-34535,34543,34568,34570-34571,34805,34826,34881,34896,34898,35055,35077,35150,35163-35164,35242-35243,35251,35256,35272,35275,35447,35497-35498,35585,35623,35683,35686,35690,35742-35743,35786-35787,35801,35808,35830,35985,35993,36062,36070,36083,36086,36107,36111,36119,36125,36129-36130,36132,36134,36139-36141,36144,36152,36155,36158,36216,36231,36234,36247-36248,36260-36261,36276,36315,36417,36419,36423,36446,36494,36526-36527,36567,36573,36580,36621,36623,36661-36664,36697,36711,36717,36721,36769,36782,36785-36786,36956-36957,37020,37022,37128,37209,37230-37232,37246,37327,37335,37343,37369,37379,37382,37385,37425,37473,37475,37550,37735,37770,37779,37823,37890,37895,37897,37900,37904,37906-37908,37921,37923-37926,37928,37930,37934,37937,38016,38026,38032,38081,38083,38095,38219,38268,38348,38421,38474,38653,38693,38763,38773,38836,38842,38849,38853,38913,38916,38919,38925,38955,38973,38975,39044,39047,39053,39055,39079,39085,39087-39088,39095,39143,39149,39154,39170,39201,39216,39235,39245,39258,39327,39397,39804,39828,39831,39833,39861,39864,39866,39868-39869,39892-39893,39907,39910,39916,39942,40028,40030,40208,40221,40231,40240,40242,40264,40328-40329,40331,40399,40408,40410-40411,40432,40486,40514,40527,40620,40640,40692,40728,40730,40776-40777,40784,40809,40814,40818,40823,40829,40836,40838,40885,40929,40932,40939,41078,41212,41214,41318,41359,41376,41528,41530,41576,41591,41595-41596,41598,41628,41630,41658,41679,41681,41683,41689,41696-41697,41701,41758,41763,41812,41814-41815,41963,42016,42059-42060,42080,42115,42118,42124,42169,42171-42172,42196,42214,42278,42285,42393-42394,42416-42417,42449,42456,42464-42465,42496,42704,42746,42749,42789,42831,42862,42905,42948,42956,42958,42970,42980-42981,42983,42992,43011-43012,43014-43015,43024,43040,43087,43227-43230,43262-43263,43318,43321,43339,43409,43417,43420,43523,43601,43603,43610,43626-43627,43669,43671,43677,43694,43712,43714,43806,43828,43837,43874,43876-43877,43881-43883,43947-43948,43950,43977,44015,44026,44043,44084,44094,44113,44220,44247,44316-44318,44360,44362,44367,44378-44379,44389,44401,44540,44598,44616,44645,44648,44650,44658,44776,44785,44805,44832,44892,44894,44908,44924,44988,44992-44993,45032,45220,45222,45294,45309,45474,45563-45564,45633,45636,45641,45643,45726,45738,45748-45749,45754,45821,45962,45984,46085,46101,46205,46207,46398-46399,46459,46471,46481-46482,46484,46552,46554,46568,46615,46704,46776,46855,46892,46911,46925,47011,47014,47169,47235,47524-47525,47588,47593,47595,47648-47649,47777,47825,47828,48023,48035,48124,48132,48274,48344,48346,48360,48423,48440,48447,48489-48490,48518,48572,48587,48589,48595,48610,48612,48614-48616,48707,48735,48798,48856,48858,48965,48974,49125 \N ivo://cds.vizier/j/a+a/265/32 6/24471 \N ivo://cds.vizier/j/a+a/278/36 6/2622-2623,2666,2708-2709,2752 \N ivo://cds.vizier/j/a+a/278/379 5/1904 6/6007,6011,6071,6079,6094-6095,6101,6105-6106,6110,6113,6127,6137,7448-7449,7476,7480-7481,7484-7485,7487,7493,7513,7515-7518,7531,7535,7538-7539,7550-7551,7572,7581,7583,7624,7631,7633,7638-7639,7644,7656-7657,7666,7669-7670,7673-7674,7676,8001,8003,8013,11131-11132,11195,11213,11229,11234,11239-11241,11250-11254,11257,11259-11260,11447,11467,11489,11493,11514,11786,11794-11795,11798-11799,11805,11809,11814,11816,11818,11821,11846,11851,11903,11905,11907,11912,11917,11920,11927,11932,11936,11938,11940,11943,11957-11958,11967,11974,11983,11985,11987-11988,11992,11995,12006-12007,12009-12010,12023-12024,12029,12034,12040,12064,12072,12088,12161,12164 \N ivo://cds.vizier/j/a+a/299/238 6/1123,1264,2903,3080,3195,3459,3552,3648,3719,3986,6318,12987,14267,14333,14343,14354-14355,14361,14468,14566,14614,14618,14666,15588,15627,20764,20831,21637,21666,23671,23707,23889,23970,24353,24425,29157,29162-29164,29178,29182,29468,29470,29513-29514,29517,29530,29554,29557,29915,30240,30273,30331,30414,30419,30422,30428,30506,30600,30603,30606,30610,30621,30625,30631,30642,30653,30664,30678,30688,30696,30699,30707,32068,32081,32088,32117,40492 \N ivo://cds.vizier/j/a+a/299/696 5/115,118 6/455,466,478,484-485,487,496-498 \N ivo://cds.vizier/j/a+a/312/74 6/9664,9666 \N ivo://cds.vizier/j/a+a/312/818 5/9398 6/37587 \N ivo://cxc.harvard.edu/csc 0/0-11 \N ivo://cds.vizier/j/a+a/314/541 6/1340,1426,1429,1431-1432,1445,1467,1824,1829,1836,1858,3045,3263,3285,3361,3600,3616,12934,12968,12970,13288,13310,14205,14262,14292,14303,14328,14407,14409,14411,14427,14431,14449,14625,14630,14653,14690,14698,14709,14718,14736,15360,15393,15461,15585,15618,15698,21671,22071,23619,23622,23654,23922,24372,28717,28819,28916,29089,29095,29126,29166,29533,29665,30222,30245,30258,30270,30321-30322,30333,30646,32064,33804,37223,37235,37303,37336,37340,37741,37746,37757,37867,37870,37888,37917,37926-37927,37929-37931,38020,38022-38024,38049,39244,39410,39766,39771,39790,39796,39889,39892,39908,39933,41461,41599,41608,41667,41673,41722,41768,41810,41813,41833,42378,42445,42500,43017,43023 \N ivo://cds.vizier/j/a+a/316/147 6/7,311,538,1185,1283,1307,1890,2078,2568,2585,2734,2809,3204,3343,3566,3693,4733,5025,5176,5321,5569,5752,5871,5893,5899,5902,5936,5941,6040,6070,6201,7212,7220,7398,7631,8155,8717,9066,9433,9506,9562,9602,9614,9651,9962,10194,10198,10386,10519,10969,11339,11400,11514,11576,11612,11621,11690,11813,11973,12088,12111,12349,12698,12908,13013,13182,13440,14263,14654,14667,15169,15287,15351,15391,15393,16046,16052,16158,16614,16886,17415,18341,18549,19541,19970,20287,20423,20716,20760,20940,21257,21416,21885,22051,22069,22616,22749,22846,22857,22870,23101,23260,23465,23545,23644,23678,23789,23964,25138,25585,25693,26668,26678,26851,26911,26969,28026,28126,28129,28243,28259,28389,28459,28982,30406,30878,32681,32781,32847,32954,33313,33576,33639,34197,34676,34822,35093,35573,35626,35796,36589,36739,36836,37427,37808,38325,38804,38913,39206,39354,39464,39825,39880,40356,40944,41068,41283,42149,42760,45380,45782,45815,45909,45963,46180,46385,46700,46922,47002,47011,47029,47180,47459,48313,48516 \N ivo://cds.vizier/j/a+a/317/448 6/33125 \N ivo://cds.vizier/j/a+a/319/18 5/1109,1429,4438,5044,6270,6930 6/4444-4445,5715,5916,5918,5940,5973,5975,5981,7214-7215,7300-7301,7603-7604,7606,7612,7640,7642,7664,8767,8810,8922-8923,8944-8945,9146-9147,10451,10454,10457,10460,10473-10475,10478,10512-10513,10817,10820,10912-10914,10927,10936,10938,10977,10979-10980,11179,11182,11955,11958,11961,20167,27912,27914,27918,28492-28494,28534-28535,28540-28541,28661,28663,33066-33067,33153,33174-33175,33180-33181,33955-33956,33958,34531,34537,35986-35987,35989,35992-35993,36060-36061,36063,36232,36234,36653,36655,36664,36666,40410,40421,40432,43211,43214,43233,43235-43236,43262-43263,43604,43945,43947-43948,43950,45303,45309,45474,46204-46205,46207,46615,46656,46658,47047,47053,47058 \N ivo://cds.vizier/j/a+a/319/33 6/7642,7664,8922-8923,8944-8945,10451,10454,10460,27720,27722 \N ivo://cds.vizier/j/a+a/319/413 6/60,110,124,513,674,696,911,1521,1546,1680,1875,2052,2074,2098,2164,2172,2201,2245,2248,2280,2405,2619,2710,2721,2836,2867,3016,3309,3820,3839,3886,3930,3971,4027,4114,4118,4285,4303,4324,4341,4345,4436,4473,4475,4506,4511,4523,4572,4693,4696,4698,4820,4831,4974,4992,5023,5091,5154,5163,5212,5244,5255,5264,5306,5312,5353,5359,5371,5415,5437,5439,5448,5481,5574,5576,5588,5597,5687,5689,5693,5722,5731,5742,5767,5771,5795,5806,5817,5831,5848,5918,5974,6033,6037,6111,6143,6161,6164,6252,6264,6267-6268,6377,6379,6390,6409,6496,6511,6535,6548,6618,6641,6723,6853,6934,7178,7181,7226,7273,7346,7351,7371,7389,7404,7426,7488,7508,7604,7642,7656,7708,7741,7745,7763,7777,7857,7969,7998,8017,8031,8057,8067,8071,8123,8282-8283,8299,8305,8345,8452,8483,8524-8525,8528,8553,8577,8636,8641,8780,8812,8845,8858,8881,8906,8912,8915,8927,8939,8941,8952,9002,9108,9181,9194,9262,9268,9272-9273,9299,9375,9402,9442,9457,9460,9463,9467,9490,9497,9512,9545-9546,9568,9588,9632-9633,9655,9705,9709,9714,9723,9754,9955,9959,9976,9986,9998,10006,10051-10052,10162-10163,10186,10206,10217,10228,10239,10265,10288,10295,10307,10314,10337,10374,10422,10432,10466,10472,10501,10578,10634,10691,10694-10695,10709,10755,10769,10774,10788,10807,10832,10841,10863,10881,10898,10912,10969,10987,11094,11104,11203,11514,11529,11603,11640,11668,11715,11723,11774,11782,11829,11845,11924,11991,12025,12038,12047,12057,12301,12311,12317,12380,12400,12459,12547,12580,12604,12722,13320,13496,13565,13783,13800,13810,13905,14831,14842,14996,15023,15036,15067,15178,15351,16027,16039,16049,16093,16113,16184,16261,16323,16434,16478,16676,17011,17075,17184,17188,17212,17346,17488,17541,17639,17730,17751,17763,17785,17819,17839,17866,17909,17917,17990,18002,18004-18005,18022,18035,18125,18177,18206,18208-18209,18214,18320,18506,18524,18661,18669,18726,18756,18769,18809,18907,18981,19101,19190,19287,19308,19315,19341,19372,19398,19413,19416,19433,19483,19567,19609,19618,19700,19712,19724,19730,19746,19757,19803,19857,19872,19932,20019,20099,20116,20202,20224,20286,20290,20390,20426,20468,20657,21049,21117,21126,21134,21260,21266,21358,21924,21935,21955,22396,22658-22659,22754,22965,23099,23121,23210,23952,24084,24116,24349,24571,24661,24775,24845,25082,25112,25255,25302,25472,25503,25549,25580,25585,25603,25630,25673,25677,25742,25864,25932,25956,25965,25990,26036,26083,26100,26111,26115,26131,26292,26297,26301,26303,26363,26374,26382,26454,26499,26509,26736,26769,26923,26996,27023,27060,27127,27227,27230,27238,27310,27349,27394,27423,27486,27493,27514,27561,27720,27727,27857,27862,27909,27955,27965,28045,28083,28086,28138,28141,28148,28167,28208,28216,28258,28315,28339,28356,28439,28471,28479,28527,28532,28538-28540,28555,28575,28581,28589,29570,29675,29795,30021,30042,31190,31211,31391,31430,31439,31529,31532,31650,31664,31685-31686,31857,31894,31995,32344,32384,32424,32594,32647,32764,32841,32948,32961,33364,33504,33684,33827,33829,33990,34013,34065,34099,34123,34210,34233,34363,34428,34461,34517,34534,34570-34571,34665,34669,34672,34675,34870,35079,35225,35413,35440,35475,35501,35528,35771,35801,35833,36005,36100,36178,36313,36417,36550,36554,36655,36769,36863,37032,37056,37064,37385,37474,37650,38189,38277,38311,38474,38725,38763,38770,38836,39557,40296,40344,40360,40730,40838,42901,43417,43743,43980,44028,44043,44785,44908,44938,44988,45409,45474,45819,45857,46055,46251,46310,46373,46588,46764,46798,46851,46964,47016,47100,47327,47352,47534,47540,47615,47941,48023,48210,48228,48460,48483,48496,48561,48589,48595,48610,48614,48736,48797-48798,48846,48965,49042 \N ivo://cds.vizier/j/a+a/320/74 5/116 6/365,367,376,378,382,407,413-415,439,449,451,453-456,458,463,468-470,472,474-476,478-481,485-487,489,493-496,498-502,504-505,508,510,833,837,848,1152,1154,1162-1163,1184,1186 \N ivo://cds.vizier/j/a+a/324/549 6/1539 \N ivo://cds.vizier/j/a+a/325/159 6/546,2737,4444,5000,5420,5534,11636,13688,14266,14772,15311,16391,16758,17348,18450,18496,22148,22309,22709,26699,26972,27462,27731,28955,30771,31781,34181,34448,36526,37332,41591,42290,42314,46566,46632,46776 \N ivo://cds.vizier/j/a+a/326/1044 6/1293,1397,1753,3830,15669,15686,18468,20853,21394,21526,21866,25098,28687,31838,32788,33027,34914,35055,36936,37012,37357,37827,37923,40545,40826,41715,42071,42674,42791,44795 \N ivo://cds.vizier/j/a+as/100/517 6/8219,8433,8614,8746,16520,17029,17058,19094,19100,19376,19437,24591,24609,25212,25420,25810,26180,26224,27481,27740,27926,27985,28005,28981,28986,29161,29252,29382,29486,29690,29881,30418,30448,30557,31073,31140,31192,31226,31788,31796,31962,37158,37175,38727,41560,41573,41589,41603,41677,41692,41816,41841,41874,42005,42110,42243-42244,42278,42296,42338,42868,42893,43166,43307,43325,43406,43793,43802,43810,43843,44079,44099,44150,44478,44575,44781,45224,45258,45947,46119,46213,46598,46676,46883,47325,47499,47828,47930,48162,48205,48388 \N ivo://cds.vizier/j/a+as/104/161 5/2584 6/10293,10314-10315 \N ivo://cds.vizier/j/a+as/105/311 6/15,254,661,1892,4355,4614,4683,6196,8475,8532,8573,9813,12770,12877,13813,14033,14373,14968,15196,15674,15988,16132,16452,17192,17502,18018,18498,18547,18691,18702,18772,18775,19286,19761,19879,19929,20091,20261,21155,21241,22147,22721,22966,24151,24800,25656,25769,26312,26320,26825,27078,27457,27540,27553,27694,28364,28799,30606,30958,31828,32291,32891,33142,33233,33249,33251,33286,33467,34616,34935,35118,36233,36317,36498,36787,36943,38171,38718,38913,39144,40300,41061,42644,44248,44728,45131,45300,45450,45522,45787,45790,46334,46515,47361,47967,48269,48344,48753,49123 \N ivo://cds.vizier/j/a+as/105/503 6/351,368,411,439,469,472,474-475,752,954,1016,1088,1348,1388,1475,2224,2342,2392,2429,2460,2581,2591,2606,2780,2851,2872,2875,2940,2948,2953,2974,3030,3066,3196,3205,3220,4143,4207,4316,4437,4548,4689,4797-4798,4895,4942,5362,5406,5476,5856,5995,6106,6147,6204,6251,6430,7252,7319,7695,8237,8463,8597,8610-8611,8679,8735,8948,9048,9096,9433,9510,9695,9799,9875,10043,10433,10496,10907,11172,11221,11399,11547,11554,12250,12330,12348,12390,12472,12599,12621,12669,12774,12784,12864,12965,13155,13243,13292,13690,13721,13723,13752,13771,13776,13887,13961,13995,14016,14084,14093,14165,14204,14277,14316,14525,14620,14654,14680,14687,14753,15019,15533,15569,15577,15686,15722,15760,15901,15906,16144,16338,17513,17611,17775,17875,17907,17965,18130,18259,18360,18636,18654,19525,19556,19817,20320,20402,20423,21926,21950,21976,22513,23403,23527,23538-23539,23655,23658,23997,24134,24159,24192,24289,24333,24336,24366,26478,26529,27295,27520,27581,27641,27731,27980,27984,28128,30553,30585-30586,30675,30833,31393,31781,32225,32356,32516,32748,45045 \N ivo://cds.vizier/j/a+as/107/277 6/16994,17000,33015,33300,34764,35048,46083,46855 \N ivo://cds.vizier/j/a+as/108/79 6/38,61,172,195,267,311,426,489,524,573,579,963,1000,1010,2051,2262,2311,2313,2330,2337,2352,4108,4110,4276,4315,4322,4435,4602,5046,5048,5066,5089,5103,5229,5243,5303,5328,5334-5335,5357,5448,5505,5697,6204,6269,6337,6376,6427,6430,6434,6444,6531,6738,6766,8216,8248,8262,8337,8369,8392,8409,8566,8617,8728,8741,8873,8981,9083,9155,9158,9171,9422,9431,9463,9518,9609,9758,9767,10367,10511,12327,12355,12372,12509,12537,12546,12560,12638,12693,12713,13387,13571,16480-16481,16500,16514,16518,16523,16528,17213,17227,17232,17264,17283,17306,17375,17399,17403,17417,17424,17741,17768,17823,18026,18057,18112,18144,18186,18220,18278,18290,18311,18401,18514,18544,18649,18758,18825,18878,18981,18991,19005,19008,19066,19069,19071,19172,19196,19199,19218,19268,19335,19370,19426,19485,19567,19576,19581,19589,19710,19713,19791,19810,19822,19869,19875,19912,20110,20342,20356,20624,20703,21020,21122,21180,21200,21286,21404,21418,21957,22517,22643,22672,22689,22769,22893,22960,23053,23069,23166,23236,23250,23274,23307,23450,23535,24622,24668,24761-24762,24765,24771,24804,24832,24835,24841,24923,24932,25013,25017,25031,25044,25144,25197,25226,25270,25281,25325,25364,25411,25426,25479,25485,25522,25545,25573,25598,25675,25677,25800,25819,25835,25882,25919,25940,26003,26008,26025,26168,26185,26243,26263,26316,26343,26419,26427,26445,26451,26460,26497,26612,26684,26717,26758-26759,26843,26851,26948,26971,27019,27242,27244,27321,27366,27374,27473,27501,27684,27697,27722,27761,27826,27902,27937,27961,27998,28176,28213,28285,28334,28600,29760,29762,29781,29788,29991,30754,30972,31085,31107,31112,31129,31220,31286,31294,31297,31332,31368,31393,31427,31482,31666,31710,31717,31891,31918,32297,32330,32358,32393,32431,32622,32631,32727,32737,32743,34764,35719,35721,35728,35788,35806,36013,36049,36082,36110,36184,36189,36228,36337,36567,36588,36601,36629,36695,36699,36722,36772,36828,38391,38396,38707,38805,38906,40194,40240,40279,40379,40385,40427,40439,40444,40733,40756,40883,40940,43739,43854,43936,44020,44024,44266,44284,44337,44518,44535,44556,44755,44796,44913,46591,46840,46950,47049,47605,48115,48157,48271,48436,48476,48484,48603,48609,48700,48744,49073,49136 \N ivo://cds.vizier/j/a+as/109/447 6/33096-33098 \N ivo://cds.vizier/j/a+as/111/229 6/20543,21242,22043,22709,23137,33922,35948,37714,37736,38440,38500,38649,39189,39275,39281,39315,39319,39323,39373,39380,39440,39460,39464,39595,39658,39744,39808,40322,40576,43014,43650 \N ivo://cds.vizier/j/a+as/112/367 6/33113,33115,33124-33125,33127 \N ivo://cds.vizier/j/a+as/113/539 4/2059,2081,2083,2088 5/8321,8323,8328,8330-8331 6/32875,32882,32894-32895,32914,32921-32922,32933,32941-32943,32961,32965,32975,32980,32994-32995,33003,33006,33281-33283,33289-33291,33316,33318-33319,33346-33348,33352,33354,33424-33425,33428,33432,45332,45376,45380 \N ivo://cds.vizier/j/a+as/114/109 5/9237,9280,9282,10282 6/25348,36884,36886,36888,36891,36895,36901,36914-36916,36919,36926,36928,36935,36938-36940,36942-36943,36946,36952-36954,36956-36958,36960-36961,36963,36966-36967,36969-36973,36975,36978,36981,36983-36984,36986,37012-37013,37056,37058,37060-37062,37064-37065,37067,37072,37125-37126,37137,37153,40998,41000,41004,41007,41092,41098,41101,41106-41107,41114,41119-41120,41122-41123,41133,41135,41142,41144-41145,41148,41150,41472-41474,41476,41478,41480-41481,41484-41486,41488,41505-41506 \N ivo://cds.vizier/j/a+as/114/465 6/311,493,674,924,1077,1283,1504,1704,1762,1890,2078,3137,3715,3750,4444,4708,5025,5377,5423,5558,5569-5570,5578,5772,5774,5839,5871,5893,5899,5902,5936,5941,6036,6040,6070,6122,6241,6340,7212,7220,7246,7273,7610,7631,7763,7860,7948,8717,8788,8790,8843,8845,8856-8857,8896,8922,8945,8972,9194,9229,9433,9442,9470,9506,9512,9602,9614,9649,9651,10130,10156,10194,10303,10373,10375,10386,10481,10519,10771,10800,10927,10969,11290,11391,11514,11636,11690,11764,11861,11973,12111,12698,12770,12908,12983,13024,13110,13203,13250,13301,13743,13778,13802,13947,13966,14263,14654,14667,14697,14702,15090,15243,15287,15391,15500,15502,15703,16046,16052,16105,16186,16220,16338,16671,16707,16834,17058,17194,17314,17415,17752,17790,17989,18007,18234,18549,18859,19283,19567,19931,19970,20071,20099,20178,20286,20327,20423,20492,20760,20915,20940,21050,21386,21416,21431,21436,21885,22051,22069,22300,22325,22459,22485,22616,22749,22753,22805,22846,22856-22857,22939,23101,23140,23523,23538,23542,23545,23549,23644,23717,23740,23789,23960,24185,24239,24957,25138,25585,25659,25793,25959,26174,26292,26851,27545,27855,27962,27980,28026,28126-28127,28151,28221,28243,28252,28259,28389,28480-28481,28561,28605,28778,28879,28890,28982,30406,30614,32516,32617,32743,32836,32847,33067,33106,33116,33125,33287,33306,33313,33378,33405,33471,33639,33691,33694,33930,34074,34191,34197,34244,34280,34354,34360,34398,34464,34515,34540,34652,34676,34822-34823,35150,35573,35690,36057,36129-36130,36234,36526,36697,37241,37252,37427,37585,37808,38529,38804,38936,39245,39354,39464,39612,39825,39829,39853,39880,39904,40131,40408,40466,40640,40776,40784,41591,41763,41981,42314,42316,42420,42454,42701,42705,42712,42751,42760,43321,43828,43947,45419,45475,45564,45580,45746,45782,45909,45963,46180,46299,46385,46574,46612,46700,46974,47002,47011,47014,47027,47029,47180,47287,47496,48163,48263,48274,48572,48589,48710,49112 \N ivo://cds.vizier/j/a+as/114/487 6/6340,8790,16565,16587-16588,16665,16672,16692,16771,16849,16990,17010,17137,17145,17301,17326,17441,17496,17721,17752,17996,18441,18463,18647,19029,20673,20735,20804,20956,21017,21060,21091,21367,22637,22680,22854,22882,23191,23549,24633,24743,24825,25074,25360,25466,25559,25713,25860,25888,26174,28696,28968,29119,29183,29196,29248,29349,29368,29414,29422,29633,29644,29701,29728,29966,30269,30859,31328,33211,33340,33498,33526,33580,33922,33930,33943,34048,34455,34464,34509,34740,34823,34832,34839,34896,34907,35077,35163,35327,35434,35564,35796,35842,35948,36018,37214,37677,37765,37816,37902,37969,38018,38048,38187,38260,38300,38561,38619,38988,39023,39165,39220,39243,39440,39443,39562,39718,40018,40090,40213,40610,40690,40713,40904,41314,41393,41465,41533,41565,41598,41630,41763,41794,41812,41943,41947,41959,42029,42068,42118,42189,42192,42213,42216,42220,42264,42285,42291,42318,42430,42459,42583,42611,42618,42620,42633,42640,42645,42649,42684,42808,42886,42899,42903,42956,42977,42994,43014,43042,43062,43069,43140,43305,43652,43805,43819,43843,43852,44049,44095,44228,44258,44284,44303,44306,44329,44389,44436,44639,44643,44763,44792,44844,44871,44887,45391,45530,45578,45689,45835,45883,45929,45962,46077,46155,46191,46199,46203,46247,46291,46334,46409,46482,46711,46744,46915,46958,47116,47205,47235,47353,47357,47427,47463,47553,47570,47589,47606,47742,47777,47852,47930,48003,48050,48076,48249,48299,48330,48351,48455,48505,48723,48734,48749,48915,49027,49101 \N ivo://cds.vizier/j/a+as/114/489 6/15681-15684,15686,15689 \N ivo://cds.vizier/j/a+as/115/295 6/26138,26159-26162,26164,26166,26168-26169,26171,26253,27470,27492,27494-27495,27499-27500,27584-27585,27587,27592 \N ivo://cds.vizier/j/a+as/115/407 6/559,611,664,697,700,2333,3073,3909,3922,4405,4839,5061,5183,5504,5589,5594,6050,6066,6178,7966,8492,9437,9535,9600,9894,10544,10627,10637,10787,10847,10930,10941,10979,10990,11000,11207,11217,11253,11323,11446,11480,11726,11832,12619,13106,13130,16098,16120,16322,18379,19843,20113,20188,20225,20270,20371,27603,27823,28529 \N ivo://org.gavo.dc/usnob/res/usnob/data 0/1-11 \N ivo://cds.vizier/j/a+as/116/403 6/2414,4695,8915,9612,9711,12466,13927,21972,28451,28454,28492,28517,32261 \N ivo://byu.arvo/dfbsspec/q/getssa 2/0,2,8,19-20,40,102,106 3/36-38,40-41,66,73-75,84-86,88-90,96-97,99-100,102,105,117,119,122-123,125-126,129-133,135-137,139,141-145,147-150,152-154,164-165,168-170,181-183,185-190,212,273-277,279-281,285,287,289-290,292-293,295,298-299,309,311,314-315,341,353-355,358,361-364,399,403-404,413-415,419-421,428,430-434,436-438,440,442,444,490-491,507-508,510-511,574-575,639,703,765,767 4/26,48,50,56,58-59,61-63,104-106,156,168-169,172,176,192,215,221-223,244-245,256,258-262,268,270-273,275-277,279,281-282,284-285,287,289,291,348,364,368,383,393,395,404-405,407,412,425,427-428,432-434,447-448,463,467,472-474,483-486,496,498-499,508,512-513,515,536-537,552-553,555,561-563,584,586,604,620,624,639,664,666-667,684,688,703-704,719,723,739,764,768,773,775,784,786-787,789,836-837,839,843-846,852,854,857,868-869,938-939,959,1055,1071,1076-1077,1079-1080,1082-1083,1091,1112-1114,1128-1129,1132-1133,1135-1136,1138-1139,1144-1145,1147,1155,1164-1166,1177,1186,1188,1190-1191,1202-1204,1206-1210,1212-1213,1215,1218,1220-1221,1223-1225,1227,1232,1234-1235,1240-1241,1243,1249-1252,1254-1255,1268-1269,1271-1272,1274-1275,1411,1426,1436,1438-1441,1443,1460,1464,1589-1591,1593-1595,1605-1607,1609-1611,1626-1628,1630-1631,1649-1651,1669-1671,1673-1675,1688,1690,1693,1695,1716,1718,1740-1741,1743,1757,1759,1765-1767,1772,1774,1780-1781,1783,1787,1789-1791,1876-1877,1929-1930,1952,1954-1955,1958,1978-1980,1982-1983,2021-2023,2025-2027,2038,2271,2287,2291-2294,2549-2551,2553,2555,2805-2807,2809-2811,3039,3059,3064-3065,3067 5/64-66,72,74-75,96-98,109-111,120,122,196-198,206,223,228,230-231,243,392,394-395,397-399,410,428,432,434,503,509,511,628-630,632-634,681,684-685,692-694,696-697,708-710,712-714,772,774,776-778,853-855,857,859,877,879,881-883,985,988,1013-1014,1028-1030,1052-1054,1076,1078-1079,1096-1097,1099,1113-1115,1123,1132,1134,1144-1145,1147,1152-1153,1155,1161-1163,1396-1398,1400-1402,1460-1462,1464-1466,1476-1478,1480-1482,1527,1531,1568-1569,1571,1577,1624,1652-1654,1656-1658,1669,1671,1677-1679,1705,1716-1718,1720-1722,1740,1783,1787,1796-1798,1800-1802,1847,1851,1863,1867,1900-1901,1927,1931,1948-1949,1990-1991,2036-2038,2040,2057,2059,2152-2154,2157-2159,2216,2218,2241-2243,2340-2341,2343,2350-2351,2420-2422,2424-2426,2484-2486,2488-2490,2500-2502,2504-2506,2551,2555,2660,2662-2663,2673-2678,2682,2740-2742,2744-2746,2756-2758,2760-2762,2807,2811,2820-2822,2824-2826,2871,2875,2887,2891,2951,2955,3060-3062,3064-3066,3076-3078,3080-3082,3089,3099,3116,3118-3121,3124-3125,3140,3142-3143,3155,3160-3161,3164,3168-3170,3328-3329,3332-3334,3353-3355,3365-3367,3369-3371,3388,3390,3414,3420,3422,3424-3425,3433-3438,3440-3442,3457,3461,3463,3469,3480-3482,3484,3520,3522,3737-3740,3744,3746-3747,3749-3751,3760-3762,3768-3770,3835,4031,4074-4075,4078,4090,4215,4219,4279,4283,4299,4302,4313,4324,4326-4327,4340-4341,4343-4344,4346-4347,4350,4357-4359,4361-4363,4461,4520-4521,4523,4537,4539,4550-4551,4584-4586,4615,4619,4668,4704-4705,4717,4736-4738,4740-4741,4743,4749-4751,4756,4758-4759,4801-4803,4806-4807,4820,4822-4823,4844-4846,4856-4857,4859,4871,4888-4889,4891,4904-4905,4907,4914,4916-4917,4920,4922-4923,4933-4935,4969,5012,5014-5015,5061,5064,5066-5067,5081,5092,5094-5095,5109,5114,5307,5310,5444-5445,5447,5455,5477,5492-5493,5495,5499,5585,5588-5589,5621,5623,5631,5639,5641-5643,5698,5709-5711,5722,5750,5769,5844,5848,5860,5864,5866,5973,5981,5983,6271,6335,6351,6355,6371,6415,6419,6435,6480,6485,6487,6490,6496,6498-6499,6501,6518-6519,6671,6675,6691,6756-6758,6764,6766-6769,6771,6777,6779,6868-6869,6876,6878-6879,6969,7024-7025,7027,7034-7035,7057-7059,7092-7094,7100,7102-7103,7128-7129,7131,7136-7137,7139-7140,7142-7143,7145-7147,7155,7492-7493,7495,7512-7513,7516-7517,7715,7724-7726,7730,7736,7738-7739,7814,7838-7839,7899,7904,7906-7907,7911,7924,7926-7927,7999,8046,8079,8083,8099,8144,8146-8147,8156,8158-8159,8702,9041,9044-9046,9077-9079,9081-9083,9141-9143,9145-9147,9157-9159,9162-9163,9180-9182,10111,10191-10192,10194-10195,10211,10216-10217,10219,11135,11199,11215,11219,11235,12151,12155,12215,12231,12235,12264-12265,12267 6/268-270,272,274,292,294-295,312,314,396,398-400,415,432,434-435,456,458-459,484,486-487,492,796,798,816,818-819,828,830-832,887,891,916,918,967,970-971,1547,1572,1574-1575,1585-1587,1634-1635,1646,1716-1718,1720-1722,1732-1734,1740,1760,2005-2007,2009,2011,2033,2035,2041,2043,2524-2526,2540-2542,2544-2546,2720-2721,2723,2745,2748-2749,2780-2782,2792-2793,2796-2797,2800-2802,2844-2846,2860-2862,2864-2866,2880-2882,2944-2946,3100,3102,3116-3118,3120-3122,3200-3202,3407,3409-3411,3487,3523,3861,3863,3869,3936-3937,3948-3949,3951,3956-3957,3959-3960,3965,3967,4051,4060,4125-4127,4220-4222,4310,4392-4393,4395,4448-4450,4484-4485,4487,4490-4491,4532-4533,4535,4540,4542-4543,4584-4585,4587,4616-4617,4619,4641-4643,5596,5598,5612,5614,5616-5618,5852-5854,5868,5872,5874,5916,5918,5932-5934,5936-5937,5952-5953,6016-6018,6101-6103,6105-6107,6117-6119,6121-6123,6281,6316-6317,6319,6500-6501,6503-6504,6506,6620-6622,6636-6637,6640-6642,6672-6673,6675,6701,6703,6705-6707,6789,6799,6819,6825,6828-6829,6876-6878,6892-6894,6896-6898,6964-6966,6968-6970,6976-6978,6984,6986,7040-7042,7125-7127,7129-7131,7141-7143,7146-7147,7196,7198,7212-7214,7216-7218,7232-7234,7296-7298,7381-7383,7385-7387,7397-7399,7401-7403,7445-7447,7449-7451,7461-7463,7465-7467,7608-7610,7612-7613,7615,7701-7703,7705-7707,7717-7719,7721-7723,7800,7802,7807,7955,7957-7959,8156,8164-8166,8168-8170,8225,8235,8620,8623-8625,8627,8869-8870,8876,8878-8879,8960,8962-8963,9368-9369,9394,9396-9397,9399,9692-9694,9708-9710,9712-9714,9948-9950,9964-9966,9968-9970,10012-10014,10028-10030,10032-10034,10048-10050,10112-10114,10199,10203,10213-10215,10217-10219,10644-10646,10688-10689,10691,10716,10718,10720,10722-10726,10732,10734,10736-10737,10972-10974,10988,10992,10994,11036,11038,11052-11054,11056-11057,11072-11074,11136,11138,11221-11223,11225-11227,11237-11239,11241-11243,11292-11293,11308-11310,11312-11314,11328,11330,11392-11394,11477-11479,11481-11483,11493-11495,11498-11499,11541-11543,11545-11547,11557-11559,11561-11563,11797-11799,11801-11803,11813-11815,11817-11819,12268,12272,12316,12332,12336,12352-12353,12365,12389-12391,12393-12395,12416,12437,12439,12453-12455,12461,12470,12488-12489,12491-12494,12508-12509,12511,12566,12613,12615,12619,12648-12650,12653,12660,12664,12684,12688,12692-12693,12704,12799,12817,12820,13320,13324-13325,13327,13340-13341,13360,13375,13409,13411,13455,13459,13475,13564,13566-13567,13648,13650-13651,13660,13662,13684,13686,13692,13704,13708-13709,13711,13731,13756,13772,13776,13792,13824-13825,13827,13836,13840-13841,13843,13885,13933,13935,13940-13942,13944-13946,14017,14019-14020,14022,14084-14086,14092,14888,14890-14891,14911,14927,14938-14939,14942-14943,14964-14966,14968,14970,14980,14982-14983,15052,15054-15056,15066-15067,15084-15086,15088-15090,15114,15333-15335,15339,16032-16034,16040,16042-16043,16046-16047,16058-16059,16062-16063,16106-16107,16110-16111,16121-16123,16316,16318-16319,16364,16767,16853-16855,16857-16859,16869,16871,16873,16875,17109-17111,17113-17115,17125-17127,17129-17131,17173-17175,17180-17181,17183,17190-17191,17193-17195,17202,17214,17248-17249,17251,17260-17261,17263,17300,17302-17303,17352,17354-17355,17368-17369,17371,17380,17382-17383,17394,17396-17397,17399,17406,17423,17427,17443,17840-17842,17848,17852-17853,17855,18088-18089,18091,18096-18098,18100,18104,18145,18155,18192,18194-18195,18199,18349-18350,18453-18455,18457-18459,18470-18471,18473-18475,18676-18678,18680-18682,18824-18826,18828-18829,18831,18864-18865,18867,18876-18877,18879,18956,18958,18968-18969,18993-18995,19030,19203,19218,19223,19284-19286,19388-19390,19433,19464,19466-19467,19479,19508-19509,19511-19512,19514-19515,19560-19561,19563,19624-19626,19650,19652-19653,19655,19662,19676-19677,19679,19684,19686-19687,19704,19706-19707,19729-19731,19872-19873,19875,19884-19885,19887,19973,19978,19981-19983,20052,20054-20055,20232,20234-20235,20240-20241,20243,20252-20253,20255,20260,20262-20263,20280,20282-20283,20286,20320-20321,20323,20332-20333,20335,20372,20374-20375,20424,20426-20427,20432-20433,20435,20444-20445,20447-20448,20450-20451,20460,20462-20463,21222-21223,21225-21227,21246,21765,21785,21813-21815,21817,21819,21905,21917,21952-21954,21957,21977,21991,21995,22005,22008,22010-22011,22013-22015,22337,22339,22348-22349,22351,22360-22362,22397-22399,22481-22483,22488-22489,22491,22516-22517,22519,22523,22549-22551,22553-22555,22563,22786,22798,22814,22833-22835,22882,22894,22994,23006,23072-23073,23085-23087,23380-23381,23384-23385,23396-23398,23400,23402,23444-23445,23448-23450,23460-23462,23468,23470-23471,23714,23720,23722,23889,23891,23901,23903,23923,23929,24021,25079,25083,25335,25339,25399,25403,25415,25419,25479,25483,25655,25659,25671,25675,25735,25739,25924-25926,25928-25930,25936-25937,25939,25945,25947,25954,25972-25973,25988,25990,26001,26010,26015,26066,26071,26368-26370,26372-26373,26375-26376,26378-26379,26679,26683,26695,26699,26759,26763,27036-27038,27062,27080-27081,27083,27113-27115,27480-27482,27484-27485,27487,27510-27511,27872-27874,27885,27887,28104-28105,28107,28130,28132-28133,28135,28224,28226-28227,28380-28382,28404,28406-28407,28520-28521,28523,28553,28564,28566,28579,28612-28613,28615,28618-28619,29956-29957,29976-29977,29979,30005,30007,30056-30057,30059-30062,30076-30077,30079,30779,30782,30855,30859,30908-30909,30911,30914,30950,31248,31250-31251,31260,31262-31263,31296-31297,31299-31300,31302,31305-31307,31310,31344,31346-31347,31350,31530,31593-31595,31610,31622,31637-31639,31641-31643,31702,31995,32170,32175,32190,32235,32311,32315,32327,32331,32391,32394-32395,32580,32582-32583,32600,32602,32628,32630-32631,34797-34799,34814,36161,36163,36172-36173,36175,36188-36190,36208-36209,36223,36287,36303,36307,36323,36479,36543,36559,36563,36579,36627,36643,36645-36647,36732,36734-36735,40426-40427,40439,40443,40725-40727,40732-40733,40735,40759,40763,40772,40774-40775,40839,40843,40873,44535,44539,44791,44795,44855,44859,44871,44875,44935,44939,48597-48599,48601-48603,48613-48615,48617-48619,48853-48855,48857,48859,48884-48885,48887,48917-48919,48921-48923,48933-48935,48937-48939,49065 \N ivo://cds.vizier/j/a+as/117/335 6/342,377,845,1031,1074,1159,1168-1169,1231,1704,4355,4444,5041,8926,9442,10255,10474,10481,12592,13207,14632,14646,14692,14855,18889,20071,20286,20764,21530,21643,22148,22289,22707,23191,23548-23549,26057,26555,27731,28890,29507,30087,30606,31984,33116,40131,41920,42956,44378-44379 \N ivo://cds.vizier/j/a+as/118/105 6/31256,31269,31271,31277-31278,31280,31366 \N ivo://cds.vizier/j/a+as/118/277 5/6056-6057 6/24203,24206-24207,24233,24236-24237,24240,24242 \N ivo://cds.vizier/j/a+as/118/407 6/38205,38242,38248 \N ivo://cds.vizier/j/a+as/119/547 6/161,4123,4808,16586,16759,16812,16834,16916,16990,17000,17085,17171,17219,17245,17266,17425,17551,17578,17606,17777,17820,17840,18213,18227,18457,18473,18591,18612,18978,19045,19116,19121,19130,19214,19237,19476,20012,20512,20593,20886,20940,20981,21060,21112,21233,21285,21379,21438,21457,21484,21578,21612,21738,21768,21788,21844,21928,21941,22664,22805,22854,23007,23230,23243,23545,23555,23864,24715,24793,24877,25015-25016,25278,25925,25966,26024,26158,26296,26302,26521,26633,26758,26772,27178,27215,27366,27694,28692,28696,28704-28705,28737,28776,28890,28959,29001,29005,29021,29024,29291,29390,29423,29589,29893,30014,30229,30518,30732,31488,33107,33111,33224,33249,33281,33351,33361,33490,33552,33715,34054,34392,34394,34446,34465,34471,34479,34520,34664,34666-34667,34817,34819,34935,35025,35054,35064,35095,35185,35358,35473-35474,35541,35984,36081,36095,36233,36433,36446,36498,36572,36693,36697,36745,36943,36983,37108,37188,37206,37231,37239,37438,37595,37660,37816,37858,37873,37933-37934,38117,38216,38238,38262,38296,38333,38489,38545,38549,38562,38788,38853,38918,38929,39085,39112,39137,39209,39263,39283,39461,39486,39500,39693,39695,39709,39714,39743,40062,40195,40204,40242,40251,40408,40635,40750,40786,40795,40820,40957,41295,41397,41633,41669,41672,41759,41763,41839,41941,41964,42081,42172,42268,42270,42325,42331,42445,42514,42623,42760,42818,42910,42977,43074,43099,43141,43233,43331,43359,43397,43521,43538-43540,43561,43575,43595,43630,43809,44015,44075,44248,44304,44327,44554,44833,44903,45032,45364,45485,45535,45564,45668-45669,45904,46077,46081,46131,46140,46287,46297,46321,46334,46367,46380,46474,46615,46683,46743,46765,46777,46802,46939,46982,47006,47030,47126,47143,47147,47353,47424,47514,47584,47717,47727,47734,47740,47763,47910,47985,48355,48516,48537,48572,48580,48587,48613,48672,48884,48886,49049,49123 \N ivo://cds.vizier/j/a+as/120/139 6/43225,43227 \N ivo://cds.vizier/j/a+as/120/275 5/7209-7211 6/28814,28833-28835,28850-28851,28856,29185,29188,42492 \N ivo://cds.vizier/j/a+as/121/243 5/1838,2359,2659,2714,3476,4401,6472,6533,6928,6953,7164,10071 6/520,624,626,632,911,929,933,983,989,1666,1678-1679,1700-1701,1707,1712,2121-2122,2124,2154-2155,2158,2165-2167,2173,2214,2220,2240,2280,2333,2335,2375-2376,2380,2581,2623,2686-2687,2708-2709,2711,2772-2773,3072-3073,3084-3085,3096,4105,4109-4110,4358-4359,4436-4438,4651-4652,4654,4690-4692,4694,4697,4741,4801-4804,4806,4837-4839,4848,4850,4989-4991,5004,5006-5007,5120,5122,5139,5142-5143,5148-5149,5189,5191,5200-5201,5203,5235,5241,5244,5246,5282-5283,5288,5672,5674,5700,5702-5703,5750-5751,5757,5805-5806,5816,5818,5920,5975,5981,5983,6014,6100,6102,6533,6535,6544,6546,7173,7184,7219,7224-7226,7228,7606,7609,7612,7739,7742,7824-7825,7827-7828,7893,7903,7925,8065,8074,8166,8168-8169,8173,8184,8192-8193,8195-8197,8457-8458,8493,8504,8506,8533,8551,8562-8563,8568,8592,8705,8708,8922-8923,8926,8944-8945,8948,9216,9430-9431,9608,10381-10383,10394,10451-10452,10454,10457,10460,10474-10476,10521-10523,10526,10544,10548,10584,10587,10648,10725-10727,10736-10738,10751,10817,10820,10843-10844,10850-10851,10890,10912-10914,11025-11028,11030,11032,11093,11389,11391,11432,11434-11436,11460-11461,11463,11554,11560,11730,11736,11738-11739,11760,11776-11777,11789,11800,11802,11951,11962,12025,12111,12133,12618,12622,12640,12737,12739-12740,12742-12743,12748,13117,13119,13160,13162-13163,13328,13330-13331,13337,13401,13403,13488-13490,13517,13520,13522-13523,13528,13912,14970,15045,15056-15057,15587,15592-15593,15595,15954-15955,15958,15960,16111,16121-16122,16892-16893,17281,17283,17472,17474,17519,17612,17761,17763,17772,17777,17924-17925,17927,17938,17980-17982,18100-18101,18103,18114,18146,18208,18211,18269,18323-18326,18395,18417,18420,18456,18458,18480,18506-18507,18529,18531,18712,18714,18736,18810-18811,18899-18900,18933,18935,18941,19295,19609,19611,19614-19615,19618,19624,19633,19636,19941,19943,19949,19960,19979,20000,20011,20014-20015,20054-20055,20101,20176-20178,20320,20874,20896,21195,21198,21824-21825,22342-22343,22655,22773,22824,22826-22827,22922,22944-22946,22956,23077,23090,23885-23887,23899,23921,23924,25335,25489-25491,25512,25596,25598,25650-25651,25656,25777-25779,25784,25951,25968,25972,26061,26066,26072-26073,26141,26270,26293,26311-26312,26314,26323,26329,26336,26346,26371,26376,26423,26429,26466-26467,26472,26474-26475,26611,26614,26617,26619-26620,27030,27033,27049,27052,27175,27186-27187,27255,27426,27513,27515,27518,27601,27604,27669,27698-27699,27704-27705,27720,27767,27772-27773,27775,27809,27811,27861,27863,27906-27907,27910,27939,27944-27946,28032,28074-28075,28121-28123,28126,28142-28143,28148,28191,28213,28215,28220,28223,28234-28235,28245,28257-28258,28264,28416,28419,28494-28495,28510,28516-28517,28593,28596,28598,28660,29763-29764,29766,29792-29793,29795,30174-30175,30197,30970,31197,31315,31319,31406-31407,31743,31880,31882-31883,31955,31958-31959,31961,31964-31965,31991,32160,32162,32168-32169,32174-32175,32186,32424,32426,32522-32523,32544-32545,32548,36146,36152,36245,36253,36288,36615,36632,36716-36717,40150-40151,40158,40251-40252,40254-40255,40321,40323,40377,40379-40380,40382,40410,40421,40432,40722-40723,40771-40772,40774,40895,40938-40939,44244,44655,44752-44754,49008,49010,49052 \N ivo://cds.vizier/j/a+as/122/201 5/3845,3849,3852-3853,3858,3864 6/14002,14004-14005,14007-14008,14010,14013-14015,14048,14051,14056,14058-14059,14062,15364,15372-15373,15375,15377,15385-15386,15388,15390-15391,15393,15395,15400-15401,15403-15406,15416-15418,15420-15421,15423-15426,15436,15464,15466,15488 \N ivo://cds.vizier/j/a+as/122/235 5/1118,1508,2910 6/14,18,29,49-50,62,100,110,124-125,139,141,195,220,233,250,255,267,311,316,358,361-362,392,403,434,436,441,447,452,459,466,477,480,504,506,508,513,557,583,595,615,671,674,696,715,742,744,790,797,811,821,845,888,893,895,900-901,904,911,917,938,974,986,988,990,999,1019,1034,1064,1085,1109,1117-1118,1120,1140,1149,1216-1217,1232,1263,1267,1297,1312,1332,1334,1466,1509,1546,1576,1593,1603,1617,1654,1661,1682,1688,1696,1700-1701,1705,1714,1722,1728,1762,1782,1926,1975,1997,2024,2027-2029,2053,2058,2073-2074,2083,2087,2091-2092,2094-2095,2098-2100,2104,2134,2147,2164,2172,2178,2195,2198,2201,2208,2214,2225,2245,2248,2251,2273,2280,2295,2298,2320,2324,2354,2358,2402,2405,2432,2448,2456,2464,2472,2543,2549,2551,2562,2569,2601,2605,2610,2616,2619,2625,2628,2650,2663,2687,2692,2708-2710,2721,2729,2741,2744,2756,2762,2784,2791-2792,2821,2841,2857,2859-2860,2867,2879,2886,2929,2938,2949,2970,2983,2990,3023,3030,3042,3049-3050,3096,3115,3123,3176,3219,3267,3272,3308-3309,3318,3331,3351,3366,3428,3431,3448,3462,3492,3536,3562,3569,3585,3591,3616,3629,3667,3681,3710,3784,3816,3826-3827,3857,3859,3863,3870,3886,3892,3909,4096,4098,4114,4118-4119,4143,4150,4152,4158,4193,4209-4210,4220,4223,4255,4258,4285,4301,4320,4324,4341,4394,4400,4402,4407,4436,4439,4442,4454,4463,4466,4477,4507,4523,4542,4550-4551,4557,4572,4575,4587,4589,4614,4641,4665,4668,4672,4676,4695,4705,4717,4730,4733,4741,4747,4768,4770,4820,4831,4852,4863,4882,4918-4919,4922,4928,4930,4954,4960,4964,4974,4992,5023,5028,5034,5048,5070,5091,5103,5106,5113,5139,5154-5155,5163,5180,5212,5233,5251,5255,5264,5278,5284,5289,5305-5306,5309,5312,5319,5325,5329,5353,5359,5369,5371,5394,5398,5415,5423,5429,5438-5439,5448,5469,5483,5494,5510,5523,5529,5536,5547,5550,5574,5585,5588,5597-5598,5614,5672-5674,5676,5680,5689,5693,5703,5706,5717,5722-5723,5730,5740,5748-5749,5767,5769,5771,5779,5801,5807,5817,5842,5848,5864,5868,5870,5893,5918,5920,5929,5974-5975,5986,6004,6011,6013,6015-6016,6018-6019,6021,6023,6027,6029,6038,6044,6056,6064,6067,6078,6082,6088,6092,6094,6098,6101,6111,6137,6143,6161,6164,6167,6173,6189,6204,6234,6252,6264,6266-6268,6296,6324,6338,6353,6361-6362,6367,6379,6383,6390-6391,6396,6398,6406,6409,6457,6459,6477,6479,6483,6496,6499,6501-6502,6511,6514,6532,6548-6549,6552,6565,6582-6583,6595,6607,6611,6618,6620,6628,6631,6640,6644,6647-6648,6650,6678,6719-6720,6723,6754,6762,6764,6768,6800,6823,6848-6849,6857,6894,6901,6920,6933-6934,6951,6962,6994,6996,6999,7001,7004,7011,7018-7019,7023,7038,7138,7176,7181,7192,7198,7204,7207,7223,7233,7235,7238,7265,7272,7280,7292,7317-7318,7329,7341,7343,7345-7346,7351,7354,7371,7381,7383,7385,7404,7410,7423-7426,7446,7448-7449,7479,7488,7492,7505,7508,7513,7516,7518,7521,7548,7569-7570,7576,7604,7606,7610,7617-7618,7636,7639-7640,7642,7656,7659,7670,7684,7689,7696,7699,7708,7716,7728,7740,7743-7746,7756,7759,7769,7781,7794,7799,7804,7824,7828,7851,7869,7872,7880,7882,7887,7891,7894,7896,7902,7921,7940,7953-7954,7966,7969,7978,7981,7989,8004,8067,8207,8216,8220,8223,8234,8258,8264,8272,8305,8321,8323,8328,8335,8344,8353,8367,8371,8374,8376-8377,8399,8427,8432,8440,8450,8452,8473,8483-8484,8487-8488,8523,8525-8526,8528,8543,8556,8559,8575,8577,8595,8641,8659,8663,8678,8716,8729,8756,8769,8773,8780,8789,8793,8812,8822-8823,8858-8859,8868,8881,8894,8912,8915,8927,8930,8934,8938,8943,8945,8953,8955,8958,9004,9013,9021,9049,9052,9060,9070,9072,9104,9108,9112,9118,9134,9145-9146,9164,9175,9181,9185,9191,9196,9210,9217,9231,9240,9245,9264,9268,9272-9273,9280,9299,9304,9314,9327,9335,9338,9352-9353,9359,9372,9376,9383,9403,9410-9411,9442-9443,9445-9446,9452-9453,9463-9464,9467-9468,9470,9479,9481-9483,9490,9497,9505-9506,9508,9510,9513,9517,9520,9524,9531,9543,9546,9554,9560,9566,9568,9570,9588-9589,9605-9606,9612-9613,9615,9632-9633,9637,9655,9660,9664-9665,9669,9681,9684,9687,9694,9700,9703,9705,9707,9709,9711,9714,9723,9727,9743,9750,9754,9761-9762,9772-9773,9783,9795,9805,9809,9811,9820,9831,9869,9892,9900,9908,9911,9915,9934,9955,9965,9976,9988,9991,9996-9998,10006,10020,10033,10051,10055,10061,10071,10078,10087,10103,10109,10118,10124,10133,10137,10152,10154,10156,10158,10161,10163,10168,10178,10182,10186,10198,10204,10206-10207,10216-10217,10221,10225,10228,10236,10239,10265,10271,10280,10284,10288,10292,10295,10307,10312-10314,10316,10318,10322-10323,10337,10352,10386,10400,10402,10419,10422,10426,10432,10451,10454-10455,10460-10461,10465-10466,10472,10474-10475,10485,10501,10510,10512,10518,10526,10538,10545,10550-10551,10553,10556-10557,10561,10565,10572,10584,10587,10591,10595,10598-10599,10605,10607-10608,10613,10627,10631,10634,10650,10656-10657,10662,10664,10673,10688,10691,10695,10706,10715,10732,10737,10741,10743,10755,10758,10761,10766,10779,10783,10788,10798,10800,10817,10827,10832,10840-10841,10847,10852,10854,10856,10863,10874,10881,10886,10893,10898,10900,10905,10911-10912,10921,10923,10927,10938,10948-10949,10967,10969,10976,10978,10980,10982,10986-10987,10992,11004,11015-11016,11027,11029,11032,11035,11041-11042,11045-11046,11048-11049,11054,11062,11066,11068,11079-11081,11091,11094,11100,11104,11117-11118,11124,11126,11128,11138,11141,11143,11148,11160,11162,11172,11195,11203,11209,11212,11241-11242,11246,11254,11260,11274,11286-11287,11290,11297,11300,11311,11321,11334,11347,11364,11374,11388,11390-11391,11396,11402,11408,11412,11416,11419,11426,11429-11430,11449,11456,11461-11462,11476,11490-11491,11516,11523,11529,11536,11545,11552,11557,11567,11570,11572-11573,11586,11603,11605-11606,11613,11620,11631,11639,11644,11646,11649,11658,11661,11669,11672,11676,11682,11684,11692,11705,11708,11715,11719,11728,11732,11734,11736,11741,11747-11748,11754,11781-11782,11785,11792,11806,11825,11839,11845,11849,11851-11852,11896-11897,11917-11918,11936,11971,11982-11983,11988,11991,12019,12038,12047,12057,12063,12073,12079,12096,12100,12160,12301,12315,12317,12329,12332,12341,12343,12347,12351,12355,12391,12400,12458-12459,12473,12487,12497,12538,12547,12560,12571,12592,12604,12609,12632,12639,12642,12645,12648,12668,12683,12689,12722,12730,12732,12750,12822,12853,12870,12874,12894,12902,12915,12917,12921,13012,13040,13058,13065,13098-13099,13112,13148,13174,13179,13185-13186,13204,13206-13207,13224,13271,13273,13294,13300,13320,13344,13349,13353,13359,13362,13369,13380,13405-13406,13408,13418,13432,13450,13457-13458,13464,13494,13496,13500,13504,13517,13522,13537,13545,13563,13586,13588,13605,13610,13622,13625,13628,13674,13695,13699,13705,13711,13728-13729,13736,13743,13769,13800,13840,13842,13855,13862-13863,13881,13897,13905,13917,13927-13928,13947,14017,14036,14062,14085,14088,14111,14147,14244,14275,14279,14305,14467,14470,14507,14522,14562,14574,14636,14646,14649,14654,14692,14745,14788,14795,14797,14812,14833,14842,14850,14854,14857-14858,14863,14865,14870-14871,14879,14898,14955,14985,14994,14996-14997,14999,15002-15003,15012,15021,15023,15027,15034,15037,15045,15056,15058-15060,15067,15084-15085,15098-15099,15102,15106,15158,15211,15243,15245,15250,15260-15262,15268-15269,15281,15286,15288,15290,15292,15294,15308,15311-15312,15339,15342,15351,15368,15377,15387,15410,15475,15488,15495,15515,15520,15522,15525,15536,15561-15562,15591-15592,15629,15669,15711,15714,15760,15772-15773,15818,15856,15877,15895,15902,15915,15948,15986,16019,16027,16030-16034,16039,16042,16044-16046,16049-16051,16059,16070,16076,16101,16106,16113,16115,16118,16138,16179,16184,16261,17775,17782,17784-17785,17790,17817,17839,17843,17845,17858,17908-17909,17917,18009,18021-18022,18035,18037,18043,18077,18079,18085,18114,18120,18122,18125,18136,18158,18176-18177,18182,18208-18209,18214,18241,18259,18270,18275,18320,18366,18384-18385,18389,18398,18402,18410-18411,18809,18838,18865,18883,18907,18916,19047,19067,19097,19101,19110,19124,19127,19156-19157,19159,19170,19175,19190,19227-19228,19246,19269,19283,19287,19301,19308-19309,19315,19333,19341,19370,19372-19373,19398,19417,19431-19432,19447,19449,19451,19462,19476,19516-19517,19531,19533-19534,19540,19543,19567,19622,19624,19652,19655,19667,19696,19700,19712,19714,19724,19757,19768,19775,19789,19803,19831,19852,19857,19872,19874,19878,19886,19905,19907,19910,19912,19916,19930,19936,19941,19947,19952,19968,19970-19971,20005,20010,20016,20018-20020,20072,20078,20083,20099,20109-20110,20116,20119-20120,20141-20142,20144,20202,20218,20224,20227,20246,20290,20292,20313,20315,20323-20325,20335,20343,20358,20392,20395,20468,21869,21873,21935,21955,21961,21972,21996,21999,22167,22189,22199,22216,22228,22239,22245,22261,22270,22276,22279,22282,22291,22305,22319,22363,22372,22381,22396,22404,22437,22441,22470,22479,22482,22490,22502,22907,22960,22962,22979,22986,23011,23014-23015,23022-23023,23025,23030,23036,23127,23134,23191,23222,23234,23284,23306,23315,23323-23324,23369,23384,23387,23403,23408,23410,23427,23440,23472,23476,23515,23524,23527,23545,23691,23708,23718-23719,23739,23819,23823,23833,23835,23861,23880,23889,23913,23927,23932,23961,23963,23977,23998,24022,24027,24037,24039,24041,24059,24084,24109,24116,24123,24178,24185,24222,24242,24260,24275,24288,24342,24346,24349,24387,24390,24401,24425,24430,24528,24535,24545,26090,26100,26111,26268,26278,26292,26297,26301,26303,26329,26358,26363,26404,26454,26483,26499,26532,26595-26596,26623,26974,26990,26996,27060,27064,27080,27087,27093,27095,27099,27115,27230,27238,27243,27248,27310,27315,27324,27327,27350,27360,27370,27372,27394,27406,27423,27428,27486,27493,27561,27604,27652,27658-27659,27671-27672,27711,27714,27719,27722,27726-27727,27744-27745,27749-27750,27765,27816,27838,27854,27889,27891,27907-27909,27936,27943,27955,27961-27962,27965,28005,28015,28018,28022,28028,28031,28037,28042,28046,28055,28062,28083,28128,28131-28132,28134,28138-28139,28141,28153,28162,28167,28176,28192,28196,28199,28206,28208,28214,28216,28245,28248,28251,28255,28258,28270,28288,28315,28319,28328,28339,28352,28359-28360,28369,28378,28406,28423,28426,28429,28443,28445-28447,28450,28454,28462-28463,28465,28471,28476-28477,28479,28483,28492,28495,28498,28501,28517,28520,28527,28529-28530,28532,28534,28539-28540,28542,28545,28549,28555,28575,28589,28594,28616-28617,28621-28622,28643,28647,30039,30059,30068,30171,30195-30196,30200,30315,30379,30394,30398,30439,30445,30506,30595,30602,30616,31143,31146,31153-31154,31158-31159,31180,31190,31198,31211,31346,31349,31389,31391,31399,31407,31430,31439,31461,31472,31477,31509,31517,31529-31530,31535,31537,31547,31628,31634,31652,31662-31664,31679,31685-31686,31751,31779,31824,31857,31886,31894,31905,31923,31989,31993,31995,31997,32009,32035,32069,32073,32139,32171,32174,32242,32247,32261,32289,32311,32344-32346,32357,32362,32384,32412,32417,32423-32424,32443-32444,32448,32450,32452,32473,32479,32485-32486,32500-32501,32552,32572,32594,32596,32605,32607,32617-32618,32621,32623,32631,32636,32647,32660,32674,32677,32683,32687,32691,32693,32696,32712,32715,32730,32739,32749,32764,32766 \N ivo://org.gavo.dc/usnob/res/usnob/spurious 0/1-11 \N ivo://irsa.ipac/2mass/images/asky-ql 0/0-11 \N ivo://irsa.ipac/2mass/catalog/psc 0/0-11 \N ivo://irsa.ipac/2mass/catalog/xsc 0/0-11 \N ivo://irsa.ipac/cosmos/images 0/0-11 \N ivo://cds.vizier/j/a+as/122/409 6/10378-10379,10400-10401 \N ivo://irsa.ipac/iras/images/issa 0/0-11 \N ivo://svo.cab/cat/catlib 3/101,153,251,367,483 4/8,15,20-21,23,27,36,42,46,49,62,64,66,80-81,83,85,97,102,113,121,142,144,146,151-154,171,174,182-183,187-189,191-193,198,202-204,225,227-228,232,237,244,254,268,273,276-277,284-285,293,298,301-303,305,313,322,326,331,336,345,349,351,354,364-365,370,373,377-379,381,384-385,387,389,393,396,398,419-420,422,426,428,432,441,443,452,454,456,466,475,485,513,517,519-521,529,536,541,543,547,552,557,560-561,566-567,570,576,585,587,589,592-593,596,603-604,607,609,616-617,628,631,646-648,650,654,656,660,668,673,675,677,687,695,699-700,712-713,717,726,729,740,742,745,751,753,756,758,761,766,768,771,776,778,788,794-795,799,805,808-810,817,830,833,840,842,855,858,861-862,867,870,875,881,884-886,888-889,891-894,897,899,901,908-909,913-915,918-919,928-929,931,933,935,938,940,943,948-949,952,954,956,960,962,969,974,976,978-979,982,984-985,991,1001-1002,1042,1055,1058,1062,1068,1070-1071,1077,1079,1089,1105,1109,1113,1119,1121-1122,1133,1135,1137,1144,1153,1159-1161,1165,1168-1170,1180-1181,1187,1201-1202,1205,1207,1224,1237,1239,1244,1253-1254,1265,1267,1269,1275,1301,1305,1311,1316,1318,1329,1338,1341,1350,1358,1367-1368,1371,1375,1386-1388,1391,1395,1399,1403,1405,1412,1419,1425,1443,1449,1451,1458,1460,1462-1466,1475,1480,1488,1492,1495,1498,1505,1509,1513-1514,1522,1530,1557,1565,1577,1590,1599-1600,1616,1619,1622-1623,1626,1636,1643,1645-1647,1653,1659-1660,1672,1685,1699,1716,1733,1735,1743,1748,1751,1755,1758,1760,1771,1777,1780,1787,1791,1809,1814,1817,1821,1845-1846,1855,1857-1858,1862,1866,1879,1889,1893-1894,1896,1899,1901-1902,1907-1908,1910-1911,1915-1916,1918-1919,1923,1926,1928,1938,1940,1942-1943,1948,1961-1964,1967-1968,1973-1974,1976,1980-1981,1984-1986,1990,1995,1999,2001,2005-2006,2008,2011,2015-2016,2022,2034-2035,2038,2040-2041,2045,2047,2263,2273,2290,2293,2493-2495,2535,2539,2544,2549,2555,2677,2761,2767,2783,2790,2795,2798,2801,2803,2807,3013,3024,3040,3045-3046,3055,3060,3062,3066,3069 \N ivo://svo.cab/cat/chiu06 4/13,24,27,31,46,265,269,298,321,357,455,522,525,529,549,567,590,598,732,746,839,1072,1143,1238,1241,1258,1277,1331,1366,1407,1417,1422,1563,1638,1678,1694,1716,1750,1753,1906,1927,1957,2017,2021,2026,2287,2538,2558,2747,2767,2800,3037,3061 \N ivo://svo.cab/cat/spex 3/308,410 4/13,15,20,27,31,34,39,43,45-48,50,53,64-65,67,69,72-73,96-97,110,130,137,143,152,158,162,166,215,257,266,269,278,283,293-294,298-299,301,304,309,316-317,321,325,332,335-336,338-339,346-348,354,357,369,385,391,412-414,423,439,450-451,455,460,474,482,486,488,490,513,517,519,521,525,529-531,539,544-546,548-549,551,555-556,563,566-567,571,573,582,591,597-599,607,611,613,619,622,624,629,645,652,664-665,669,676,678,692-693,697,700,703,705,709,715,724,729-730,737,739,746,773,776,779,783,786-788,796-797,833,839,846,848,854,865,867,872,942-943,946,978,985-986,995,997-999,1038,1046,1053-1054,1063,1067,1069,1072-1073,1077,1082,1089,1092-1093,1095,1113,1115,1127,1134,1137,1141-1143,1153,1162,1167,1174-1175,1179,1188,1193,1195-1196,1215,1219,1227-1228,1237-1238,1241,1246,1258,1265,1267,1270,1273,1275,1277-1278,1292,1312,1320,1322,1331,1339,1367,1393,1407,1415,1417,1422,1425,1428-1429,1449,1454,1469,1471,1483,1535,1539,1543-1544,1546,1549,1555,1563,1567-1568,1581-1582,1590,1594,1615,1619,1626,1632,1636-1638,1657,1661,1666,1678,1687,1691-1692,1700,1713,1716,1718-1719,1728,1730-1731,1733,1739,1749,1756-1757,1759,1767,1769,1771,1775,1779,1781-1783,1801,1839,1848,1865,1874,1878,1906,1909,1921,1927,1932,1935,1938,1941-1943,1953,1957,1963,1980-1982,1991,1995,1999,2002,2020-2021,2025-2026,2028,2034-2035,2037,2040,2045,2110,2137,2143,2150-2151,2158,2173,2191,2200,2218-2219,2221,2223,2226,2232,2243-2244,2250,2254,2276,2285,2287,2290-2291,2296,2301,2386,2397,2404,2412,2417,2419,2467,2480,2511-2512,2514,2520,2523-2524,2541,2546,2555,2664,2671,2682,2685,2717,2723,2741,2747,2757,2760,2767,2769,2779,2800,2808,2895,2898-2899,2912,2917,2927,2938,2959,2977,2982,2988,2991,2993-2994,3018-3019,3025,3037,3045,3047,3056-3057,3059,3061,3071 \N ivo://svo.cab/cat/stelib 4/10,15,34,83,109,117-118,214,262,273,276,281,287,301-303,305,307,313,317,321-322,324,327,331-332,335-336,338,348-349,357,360,362,370,377-380,383-384,389,391,393,396,404,406,422-423,426,453,475,513,517,533,543-544,547,549,552,557,561-562,566-567,570,584,592,595-596,606,613-615,617,621-622,627-628,675,695,699-700,712-713,717,740,744,756,758,899-900,902,907,910,918-919,926,931,948,959,992,996,1007,1122,1139,1144,1169,1283,1319,1327,1336,1339,1357,1367,1370,1382,1390,1392,1400,1409,1449,1460,1475-1477,1485,1492,1495-1496,1503,1509,1513,1521,1523,1526,1530,1542,1592,1598,1611,1616,1619,1623,1625,1643,1645,1653,1657-1660,1673,1685,1692,1694,1718,1723,1730,1738,1741,1750-1751,1763,1766,1768,1771,1780,1787,1883,1888,1894,1898,1911,1913,1919,1934-1935,1942,1945,1948-1949,1963,1967-1968,1971,1974-1975,1984-1985,1999,2001,2003,2015,2020,2022,2028,2034-2035,2038,2041,2047,2067-2070,2235,2335,2368,2376,2481,2551,2558 \N ivo://svo.cab/cat/uves 4/0,548,1038,1071,1096,1202,1217,1292,1596,1666,1999,2124,2196,2288,2393,2524,2613,2771,2785,2920 \N ivo://irsa.ipac/mast/scrapbook 0/0-11 \N ivo://irsa.ipac/spitzer/images/swire 0/0-11 \N ivo://vopdc.iap/fss 0/0-11 \N ivo://cds.vizier/j/a+as/122/507 5/8325,8327 6/32863,32875,32882,32884-32885,32914,32921-32922,32933,32942,32946-32947,32951,32953,32965,32994-32995,33003,33006,33034,33282,33290,33299,33312-33314,33323,33333,33335,33342,33346,33352,33408,33410,33415,33418-33422,33425,33428,45332,45376,45380 \N ivo://cds.vizier/j/a+as/124/283 6/25188 \N ivo://vopdc.obspm/imcce/skybot 0/0-11 \N ivo://vopdc.obspm/lesia/bestars/besc 0/0-11 \N ivo://vopdc.obspm/lesia/bestars/bess 0/0-11 \N ivo://vopdc.obspm/luth/exoplanet 0/0-11 \N ivo://vopdc.obspm/luth/hess 0/0-11 \N ivo://vopdc.obspm/imcce/miriade 0/0-11 \N ivo://svo.cab/cat/xshooter 4/0,182,273,285,388,547,552,794,809,831,1007,1089,1181,1382,1393,1443,1471,1544,1643,1653,1659,1685,1741,1791,1929,2080,2194,2252,2293,2379,2388,2610,2630,2640,2783 \N ivo://svo.cab/cat/comovinggaiadr2 4/2370 5/482,784,3436,3514,3566,3638,3650,3657,3661,4122,5388,5411,5420,5514,5726,5909,6518,7120,7180,7201,7258,7277,7674,7767,7953,7966,9332-9333,9337,9341,9398,9419,9425,9430,9471,9476,9486,9505,9808,9813,9820,9846-9847,9924,9940,9943,9966-9967,9970,9973,10361,10389,10417,10442,10552,10605,10621,10755 6/53,55,62,314,336,357,399,451,457,461-463,472,474-475,484-485,496-497,499,511,544,600,672,720,739,796,874,893,930,950,1007,1023,1025,1032-1033,1035,1079,1096,1107,1114-1116,1133,1197,1208,1213,1224,1244,1270-1271,1276-1277,1279,1289,1296-1297,1301-1302,1304,1308,1313,1329,1333,1337-1339,1345-1348,1350-1352,1354,1372,1374,1377,1382-1383,1386,1388,1391,1394,1408,1414,1423,1427,1431,1433-1434,1436,1445,1447,1450,1456-1457,1459,1461,1464,1466,1472,1482,1525,1527,1533,1536,1538,1551,1554,1556-1557,1572,1576,1625,1627,1656,1660-1661,1670,1679,1684,1687,1693,1715,1717,1719,1721,1725,1727,1735-1736,1738,1741,1753-1755,1757,1768,1770-1771,1794-1795,1801,1807-1808,1811,1824,1826,1843,1851,1854,1856,1860,1888,1905,1912-1913,1920,1922-1923,1935-1936,1941,1947-1948,1950,1971,1976,1979,1981,2024,2075,2111,2160,2285,2338-2339,2347,2350-2351,2368,2378,2395,2400,2406-2407,2419,2422,2427,2433,2435-2436,2438,2463,2469,2483,2500,2507,2520,2523,2592-2593,2598,2604,2626,2630,2745,2784-2785,2798,2807,2826,2828,2833,2839,2843,2859,2862,2890,2896,2898,2903,2908,2910,2920,2929,2940,2945,2947-2949,2961,2964-2965,2973,2983,2988,2994,3004-3005,3009,3012,3022,3027,3029,3032,3034,3038,3044-3046,3055,3065-3066,3077-3079,3093,3097,3100-3101,3107,3109,3115,3119,3144,3151,3168,3179,3182,3186,3192,3201,3203-3204,3213,3227,3230,3237,3246-3247,3249,3251-3252,3255-3256,3258-3259,3261-3263,3271,3277,3279,3283-3284,3289,3296,3301,3304,3307-3309,3311,3313,3316-3317,3322,3332,3334,3344-3346,3369,3384,3407,3428,3436,3461,3466,3476,3486,3508,3510,3514,3517,3555,3584,3589,3593,3595-3598,3600-3601,3603-3606,3608,3617,3625-3628,3633-3634,3645,3654,3659,3662,3680,3684,3710,3712,3732,3738,3752,3755,3764-3765,3774,3783,3796-3798,3803,3822-3823,3843,3848-3849,3854,3866,3870,3893,3924,3953-3954,4014,4062,4238,4277,4285,4296,4298,4305,4385,4543,4588,4590,4613,4624-4625,4685,4687,4696,4698-4699,4702,4709,4720-4722,4738,4821,4836,4866,4881-4882,4954,4987,5010,5037,5342,5363,5399,5440,5667,5754,5788,6138,6214,6258,6298-6299,6310,6326-6327,6359,6384,6412,6416,6426,6452,6594,6596,6628,6661,6668,6679-6680,6694,6700,6704,6716-6717,6719,6737,6745,6758,6760,6762,6771,6777,6794,6799,6822,6826-6827,6840-6842,6846,6855,6859,6868,6881,6889,6892,6894,6898,6901,6952,6969,7007,7015,7017,7026,7052,7071,7077,7088,7183,7194,7266,7451,7477,7499,7581,7821,7846,7856,7876,7889,7892-7893,8093,8160,8297,8417,8606,8750,8803,8866,8876,8878,9173,9304,9315,9513,9721,9745,9835,9916,9975,10017,10151,10234,10292,10453,11029,11110,11137,11491,11528,11589,11593,11692,11739,11890,12087,12337,12350,12363,12425,12455,12494,12497,12500,12508,12579,12598,12604,12613,12634,12656,12769,12801,12807,12818,12834,12864,12877,12883,12888,12890-12891,12893,12908,12913,12920-12921,12936,12938-12941,12943,12949,12955,12960,12972,12979,12982,12985,12990,13000,13012,13015,13024,13033,13048-13049,13052-13053,13059,13066,13085,13090-13091,13094,13096-13097,13103,13117,13119,13129,13145,13151,13162,13167,13179-13180,13182,13190,13192,13195,13198,13202,13224,13229-13230,13232,13240,13249,13259,13266-13267,13279,13282,13286,13290,13301,13304,13310,13312,13362,13375,13387,13474,13482,13495,13537,13556,13558,13565-13566,13659,13728-13729,13731,13735-13736,13741,13755-13756,13772-13774,13778,13782,13784,13800,13818,13831,13870,13874,13883,13926,13943,13948,13951-13953,13958,13962,13969,13975,13982,13984,13999,14001,14008,14010,14013,14015,14018,14022,14033,14036,14038,14041,14043,14046,14051,14054,14063-14064,14066-14067,14069-14071,14075-14076,14081,14087-14088,14090,14094,14103,14112,14116,14119,14129,14132,14134,14136,14154,14160,14162,14164-14165,14167,14172-14173,14175-14176,14180,14182,14186-14187,14191,14203-14204,14207,14210,14214-14215,14219-14220,14227-14230,14232-14233,14236,14238,14243,14246-14249,14251-14252,14254,14256,14258,14261-14262,14273,14283,14285,14288,14293,14306-14308,14310,14312,14322,14326,14330-14331,14336,14338,14346-14347,14353,14358,14361,14364,14367,14370,14374,14381,14383-14384,14391,14401,14403-14404,14406,14409-14411,14414,14418,14420-14421,14423-14425,14427-14428,14430,14432-14433,14436,14440-14441,14444,14454-14455,14460,14464,14466,14479,14482,14485,14497,14504,14507-14508,14510,14524,14528,14532,14535,14545,14549,14556,14558-14559,14571,14586,14592,14597,14606,14613,14615,14619-14622,14624,14627,14632-14633,14635,14637,14640,14642-14643,14648,14653,14655-14656,14661,14663,14666-14667,14687-14689,14692-14693,14696-14697,14699,14713,14715-14718,14720,14724-14725,14732,14738,14740,14743,14749,14751-14752,14767,14774-14775,14786-14787,14789,14791-14794,14796,14799,14805,14810-14811,14813,14815,14817,14846,14853,14855,14858,14863,14876,14878-14879,14900,14922,15009,15017,15038,15049,15082,15109,15111,15121,15154,15173,15206,15213,15215,15219,15224,15226,15243,15246,15253,15272,15304,15366,15369,15373-15374,15378,15381,15384,15386,15393-15397,15404,15406,15425,15430,15432-15433,15435-15436,15439-15442,15448-15449,15454,15459,15473,15476,15478-15479,15481,15484-15485,15488,15499,15509,15515,15520,15524-15525,15554-15555,15557,15567-15568,15570,15574,15577-15578,15581,15583,15607,15620,15622,15632,15640,15642,15653,15655-15656,15661-15663,15667,15669,15672,15675-15678,15686,15690,15692-15693,15695,15699,15706,15709,15712,15729,15731-15732,15745,15747,15750-15751,15755,15757,15760-15761,15771,15774,15793,15804,15809,15811-15812,15814,15824,15841,15857,15864,15881,15891,15910-15911,15920,15922,15928,15933,15941,15946,15961,16144,16164,16178,16214-16215,16242,16285,16292,16341,16440,16447,16533,16560,16808,16982,16989,17009,17058,17064,17321,17339,17749,17776,17778,17820,17864,18069,18117,18128,18260,18292,18405,18423,18488,18496,18514,18605,18643,18649,18765,18767,18773,18878,18916,18956,19016,19120,19155,19193,19231,19263,19333,19456,19459,19634,19704,19728,19915,19968,20040,20055,20156,20158,20293-20296,20323,20452,20457,20460,20510,20562,20587,20604,20630,20632,20669,20690,20734,20747,20752,20757-20759,20761,20763-20765,20776,20781,20784,20790,20796-20797,20799-20802,20808,20810,20814,20819,20822,20826-20827,20831-20833,20835-20836,20839,20845,20853,20855,20862,20888,20890,20919,20924,20926,20930,20934,20937,20939,20950-20951,20956-20957,20959,20962,20966,20968,20975,20977,20979,20991,20999,21020,21049,21122,21204,21252,21263-21264,21267,21269-21270,21313,21328,21331-21332,21338,21341,21354,21359,21392,21416,21418,21423,21436,21439,21450,21459,21462,21465-21467,21472,21480-21481,21493,21495,21509-21511,21514,21520,21523,21528-21529,21531,21534,21549-21550,21558-21562,21571,21576,21584,21601-21602,21608,21614,21617,21620,21628,21638-21639,21641,21643,21648-21649,21656-21658,21660,21665,21668,21671-21672,21677,21684,21686,21688,21691-21692,21695,21698,21722,21726,21729,21732,21736,21738,21740-21741,21745,21748,21752,21760,21762,21774-21775,21796,21837,21850,21861,21872,21902,21930,21947,21969,21988,22016,22021,22024,22026,22028,22030,22032,22034-22037,22039-22041,22044,22046-22047,22051-22053,22062,22065-22067,22071,22073,22081,22096,22104,22107,22112-22114,22117,22121,22123-22124,22126-22127,22138,22140-22141,22144,22146,22148,22158-22159,22170,22179-22181,22183,22185,22189,22196-22197,22205,22211-22212,22217,22220,22222-22226,22228-22230,22237,22241-22243,22249,22256,22258,22260-22262,22266,22268,22270,22272,22282-22283,22292,22298,22300,22305,22310-22311,22320,22335,22345,22356,22358,22394,22403,22415-22416,22419,22421,22434,22436,22439-22440,22457-22458,22461-22462,22470,22495,22504,22508,22511,22515,22522,22524,22526-22527,22536,22615,22634,22750,22762-22763,22772,22796,22799,22804,22808,22814,22821,22829,22832,22836,22849,22858,22860,22862-22863,22869,22880-22882,22884-22885,22892,22894-22895,22898,22930,22936,22968,22971,22976,22986,22993,22995,22999,23001,23007,23027,23281,23283,23317,23360,23371,23379,23404,23410,23416-23417,23446,23514,23537,23539,23545,23547-23548,23554,23569,23572,23581,23585,23591,23593,23607,23614,23618,23624-23625,23629,23631,23641,23651-23652,23655,23660,23663,23668,23674,23677,23695,23700,23715,23733,23742,23755,23760,23762,23764,23766,23768-23769,23772,23774,23776,23794,23814,23818,23832,23846,23852,23861,23866,23883,23885-23886,23902,23904,23909,23912,23918,23929,23932,23935,23937,23943,23947,23950-23951,23958,23977-23979,23982,23987,23997-23998,24002,24008,24011-24013,24047,24058,24062,24092,24094,24118,24138,24143,24156,24181,24188,24228,24230,24253,24255,24272,24289-24291,24295,24321,24324,24326,24329,24333-24334,24339-24341,24345,24348,24355-24356,24367,24369,24375,24377-24378,24385,24387,24393,24396,24404,24414,24423,24429,24441,24443,24450,24452,24461,24472,24478,24493,24495-24496,24499,24504,24510,24519-24520,24522,24528,24538,24547,24562,24616,24640,24653,24673,24703,24801,24803,24837,25001,25003,25083,25103,25184,25356,25507,25516,25552,25576,25677,25756,25838,25840,25898,25943,25953,25967,26012-26013,26033,26180,26419,26634,26697,26725,26735,26764,26836,26867,26892,27008,27010,27022,27046,27112,27249,27271,27404,27486,27518,27564,27600-27601,27639,28085,28093,28096,28137,28229,28302,28373,28375,28445,28469,28484-28485,28490,28559,28672,28674,28681-28683,28685,28691-28692,28697-28698,28702,28705,28707,28709-28711,28713-28714,28716-28718,28728-28729,28731-28732,28738,28745,28769,28771,28778-28779,28781,28790,28800-28801,28808-28809,28812-28813,28818,28821,28824,28828,28830,28832-28834,28836,28850,28852-28854,28864,28868-28869,28875,28881,28884,28886,28888,28890,28893-28895,28901,28907,28917,28919-28920,28922,28928,28930,28945,28950,28970,28973,28976,28981,28983,28986,28990,29026-29028,29036,29038,29043,29045,29047,29058,29068,29070,29072-29073,29076,29078-29079,29081,29084,29086,29089,29091-29092,29100,29102,29106,29113,29115-29116,29118,29121,29124,29130,29141,29155-29156,29158,29160,29164-29166,29169,29172,29174,29176,29180-29182,29208-29209,29248,29253,29263,29269,29271,29277,29293,29299-29300,29309,29317,29359,29377,29425,29440,29445,29447-29448,29460,29470,29483,29491,29494,29498,29512,29516-29517,29519,29564,29583,29616,29619,29665,29668,29701,29727-29728,29730,29732,29734,29736,29779,29804,29818,29837,29839,29841,29851,29860,29862-29863,29868-29870,29873,29878,29881-29882,29889,29934,30088,30117,30152,30173,30199,30209,30211,30214,30217,30220,30222,30224,30245,30247,30254,30258,30276,30279,30287,30293-30294,30301,30309,30322,30326,30351,30370,30405,30429,30438-30439,30444-30445,30450,30456,30459,30488,30560,30564,30567,30569,30572-30573,30576,30587,30589-30590,30596,30600,30605,30614,30616,30626,30635,30655,30661-30662,30678,30686,30691,30703,30709,30711,30717-30718,30728,30790,30957,31093,31102,31329,31363,31487,31499,31554,31582-31583,31756,31787,31790,31809,31824,31827-31828,31837,31872,31936,31938,31940,31946,31960,31968,32007,32016-32018,32021,32031,32053,32066,32069,32071,32073,32081-32082,32084,32116,32123,32126,32164,32166,32170,32194,32196,32198,32218,32220-32221,32223,32313,32316,32330,32345,32478,32494,32519,32523,32529,32537,32553,32572,32657,32659,32669,32678,32810,32834-32835,32881,32896,32998,33046,33051,33099,33102,33236,33256,33364,33385,33469,33531,33745,33760,33844,33868,33972,34006,34046,34293,34326,34541,34645,34649,34656,34712,35202,35483,35557,35740,35745,35750,35881,36061,36177,36243,36281,36565,36568,36729,36819,36874,37062-37063,37068,37086-37087,37089,37093,37108-37110,37116,37145,37152,37157,37159,37166,37168,37171,37188-37189,37196-37197,37212,37217,37229-37231,37237,37239-37240,37242,37245,37252,37264,37271,37277,37294,37297,37304,37311,37315-37317,37319,37326-37327,37336,37338,37340,37343-37344,37353-37356,37362-37363,37368-37369,37371-37372,37375,37443,37459,37461,37475,37479,37571,37586-37587,37589,37607,37613-37614,37617-37618,37624,37639,37641,37644,37651,37653,37662-37663,37668,37672,37684,37694-37695,37698,37705,37708-37709,37711-37714,37717,37719,37724-37725,37727,37729-37730,37733,37736-37737,37739,37741,37744-37745,37747-37748,37750,37753,37755,37760-37761,37780-37781,37785,37787-37790,37811-37812,37816,37830,37836,37839,37851,37855,37857,37859,37863,37865-37870,37874-37875,37878,37880,37882,37891-37892,37894-37895,37897,37900-37902,37909-37910,37912,37914-37917,37919,37937-37939,37942-37943,37948,37950,37952,37954,37959,37969-37970,37973,37976-37977,37983,37986,37992,38012,38016,38018,38024,38028-38029,38032,38034-38037,38041-38043,38046,38051-38054,38056-38057,38060,38064,38067,38069,38073,38091,38107,38118-38119,38137,38153,38162-38163,38165,38169,38180,38183,38205,38242,38248,38268,38277,38282,38314,38321,38336,38347,38349,38376,38400,38403,38412,38414,38423,38437,38451,38457,38466,38468,38471,38516,38528,38536,38549,38561-38562,38566,38615,38673,38686,38703,38784,38885,38899,39005-39006,39012,39031-39032,39039,39115,39124,39154,39160,39166,39178-39181,39183-39184,39187,39189-39191,39193-39194,39197,39199,39201,39205-39207,39211,39213-39214,39216,39218-39219,39221-39222,39224,39229,39236-39237,39240,39242,39244,39249,39251,39256-39257,39264,39269-39271,39273-39277,39285-39286,39288,39290,39295-39297,39300,39303,39309,39320,39327,39329,39340-39342,39346,39353-39356,39358,39361-39362,39365,39367,39371-39374,39377-39378,39380,39383,39395,39397-39399,39406-39408,39410,39412,39416,39418,39420,39484,39486,39514,39520,39527,39543,39548-39550,39623,39627,39676,39685-39686,39700-39701,39704,39707,39709,39714-39715,39718,39720,39726-39727,39733,39739,39741,39749,39751,39766,39768-39770,39779,39783,39785,39789,39793,39795,39801,39805,39810-39811,39819,39825-39826,39837-39838,39856,39858,39860-39861,39877,39885,39890,39896-39897,39901-39902,39905-39909,39911-39912,39916,39920,39924,39926,39929,39934,39937,39960,39963,39984-39986,40064,40075-40076,40078,40088,40095,40098,40101,40104,40106,40112,40117,40160,40181,40205,40254,40363,40454,40457,40459-40461,40475,40481,40487,40490,40500,40519-40520,40554-40555,40559,40562,40574,40578,40586,40588,40600,40608,40613-40615,40620,40625,40634,40650,40660,40665,40674,40695-40696,40779,40812,40869,40871,40878,40917,40950,40991,40999-41001,41097,41136,41140-41141,41146-41147,41149,41152,41158,41169,41175,41185,41192-41194,41201,41204,41228,41242,41278,41312-41313,41318,41322,41324,41366,41375,41378,41381,41388,41391,41393,41395-41396,41398,41401,41403,41413,41415,41423,41433,41436,41438-41439,41443,41455,41457,41460-41461,41463,41478-41479,41521,41525,41532,41546,41548,41555,41561,41564,41566,41577-41578,41583,41585,41587,41590,41595-41596,41598-41599,41602,41608,41610,41615,41621,41628,41630-41631,41633,41635,41637,41641,41643,41646,41648-41649,41652,41654,41657,41659,41662-41663,41666-41667,41672-41673,41675-41677,41679-41682,41685-41688,41690,41692-41693,41695-41696,41699,41702-41704,41710-41712,41715-41716,41720,41724,41726,41728,41732,41740,41742,41745,41747,41749-41753,41759-41762,41764-41765,41772,41776,41782,41784,41789,41791,41797,41799,41801,41811,41815-41817,41819-41821,41823-41824,41829,41831-41832,41834,41836,41839,41841-41843,41845-41846,41848-41849,41853,41856-41858,41861-41864,41869,41871,41874-41875,41878-41879,41884,41893,41895,41908,41917,41923-41925,41928,41939,41944,41954,41958-41959,41970-41971,41995,42017,42024,42026-42027,42029,42035,42057,42071,42095,42098-42099,42101,42106,42110-42111,42113,42120-42121,42124-42125,42127,42132,42135,42138,42142-42143,42145,42147-42150,42153,42156,42159,42161,42164-42166,42169,42173,42175-42176,42181,42191,42197,42200,42203-42206,42212-42214,42216-42217,42220,42222,42224-42225,42227-42228,42230,42238-42239,42259-42260,42264-42266,42268-42270,42272,42274,42279,42284,42286,42289-42291,42293,42312-42313,42316,42320,42329,42331,42336-42337,42340-42342,42345-42348,42350,42362,42364,42369,42377,42381-42383,42385,42389,42399,42407,42413-42417,42419,42427-42429,42435-42436,42439,42442,42448,42453-42454,42459,42464-42465,42469-42470,42474,42476,42481-42483,42489-42490,42493,42498-42499,42503,42508,42510-42511,42514-42516,42518,42522-42523,42528,42535,42541,42543,42546-42548,42552,42583,42589,42591,42606,42635,42646,42652,42661,42666,42673,42682,42688,42710,42728,42749,42751,42754,42757,42799,42801,42804,42807,42826,42829,42831-42832,42836,42840,42846-42847,42850,42912,42919,42925,42932,42936,42947,42953,43015-43016,43018,43024,43029-43033,43035-43038,43044-43045,43047-43048,43050-43052,43055,43057,43059-43062,43064,43066,43072-43073,43077,43080,43088,43092,43098,43104,43111,43126,43133,43136-43137,43140,43142,43146,43152,43159,43161,43167-43168,43189,43197,43203,43207,43217-43218,43221,43232,43258,43272,43274,43279,43291,43296,43300-43301,43307,43333,43335,43342,43363,43369,43374,43376,43392,43399,43402,43414,43417,43421,43458,43477,43491,43518,43520,43558,43660,43671,43684,43698,43745,43783,43798,43800,43857,43860-43861,43866,43876,43901,43924,44005,44027,44030,44032,44058-44059,44064-44065,44069,44080,44114,44116,44121,44195,44201,44276,44288,44304,44306-44307,44312,44352,44354,44368,44371,44404,44466,44482,44498,44544,44558,44685,44765,44819,44881,44885,44923,45110,45199,45227,45261,45308,45449,45644,45736,45762,45765,45818,45844,45946,46102,46223,46480,46716,46720,46778,46857,46977,47111,47117,47145,47159,47235,47237,47256,47301,47324,47328,47355,47529,47565,47619,47621,47623,47675,47736,47742-47744,47746,47748,47752,47784,47786,47791,47797,47800,47812,47818,47839,47847,47853,47856,47858,47861,47865,47885,47925,47993,48009,48072-48073,48093,48118-48119,48122,48142,48230,48415,48481-48482,48497,48575,48581,48656,48681,48689,48749,48757,49070-49071 \N ivo://svo.cab/hsa 3/75,97,192,198,204,349 4/8,19,25,35,39,45,57,61,63,106,122-123,125-127,137,154,177,180,231,242-243,247,252,256,259-260,264,266-268,273,280,283,285,289,291-294,296,298-299,305,323,334,349,355,384,392,394,400,402,407,410,414,418-421,433,447,458,466,472,474,490,503,507,515-517,519,533,537-538,550,555,564,577-580,582,584,589,591-592,594,597,599,607,610,612,627,632,639,643,686,722,724,728,739,742,773-774,779,782-783,791,832,834,839,845,853,860,862,869,884,937-939,959,971,985,987,993,1000,1002,1009,1016-1017,1075,1078,1098,1110,1150,1162,1183-1184,1186-1187,1190,1193-1195,1198,1214,1222,1231,1237,1265,1276,1299,1360-1361,1364,1366-1367,1374-1375,1403,1405-1406,1415,1421,1432,1440,1442,1462,1470,1472,1502-1503,1506-1507,1510,1514-1515,1518-1519,1524,1527,1532-1533,1576,1594,1607,1620,1622,1628,1638,1695,1700,1706-1707,1709,1738,1744,1754,1763-1764,1770,1773,1789,1837,1839,1861,1876-1877,1879,1887,1909,1925,1927,1933,1951,1955,1960,1964-1965,1973,1977,1982,1992,1994,2003-2004,2006,2009,2011-2012,2026-2027,2030-2031,2033,2035,2040,2042-2043,2047,2299,2787,3053,3055,3061,3063,3067-3068,3070 \N ivo://svo.cab/cat/bdsslow 4/13,24,27,31,46,265,269,298,321,357,455,522,525,529,549,567,590,598,732,746,839,1072,1143,1238,1241,1258,1277,1331,1366,1407,1417,1422,1563,1638,1678,1694,1716,1750,1753,1906,1927,1957,2017,2021,2026,2287,2538,2558,2747,2767,2800,3037,3061 \N ivo://svo.cab/cat/miles 3/75,101,113,151,192,244,314,342,356,362,404,496 4/6,11,13-15,20-21,23,27-30,36,44-45,49-50,57,64,66,72,75,78,81,83,85,88-89,95,97,102,107,111,113,115,117,133,137-138,151-152,154,156-157,162,164,167,171,173-174,182,185,187,189,193-194,196,198,204,218,225-228,232,241,244,248,254,258,261,268,270,273,276-277,279,281-282,284-285,287,291,293,298,304,306,313,315-317,319,322,329,331,338-339,343,345,349-351,354,357,364-365,370,373-374,378-379,383-385,387,389,391-393,396,398,408,420,422-424,426,428,430,432,441,443,446,451,456,458,466-467,470,475-476,481,485,497,505,508,513,517,520-521,528-529,536-537,543-544,547-548,552,557,560-561,565-567,570,574,576,584,586-587,589,592-593,595-596,599,609,612,614-617,625,634,640-642,646-648,656,662,668,671,673,675,693,699,712-713,717,724,727,729-730,739-740,742,745,753,756,758,766,774,776,778-779,782,784,789,794,796,799,808,810,814,817,822,827,830-831,833-834,837-838,842,845,850-852,854-855,857-858,861-862,867,870,875,878,881,884-886,889,891-894,899-901,907-908,910,914-915,920,922,924-925,928-929,931-932,935,938,943-945,948,952-953,956,960,962,967,969,974,982-984,999,1001-1004,1007,1009,1011-1013,1017-1018,1021-1022,1039-1040,1042,1051,1055,1059,1061,1067-1068,1070-1071,1077-1079,1081,1089,1091,1093,1096,1098,1100,1105,1107,1109,1113,1121-1122,1124,1126,1133,1135-1137,1139,1143-1144,1146,1148,1151-1154,1159-1160,1168-1169,1174,1176,1180-1181,1186-1187,1193,1198,1202-1203,1205,1207,1211,1224,1229,1236,1238,1242,1244-1246,1254,1261,1267,1269-1270,1273-1275,1277,1292,1300,1305,1311,1313,1316-1317,1325,1327,1329,1331,1335-1336,1338,1341,1343,1345-1346,1348,1350,1356-1358,1363-1364,1367,1374-1376,1378,1382,1386-1387,1391-1392,1397,1399,1405,1407,1412,1414,1419,1422,1429,1431,1435,1441,1443,1452,1457,1462-1464,1466,1469-1471,1473,1475-1476,1480,1486,1488,1491-1492,1495-1496,1498,1500,1503,1506,1510,1512-1513,1521-1522,1524,1531,1542,1548-1549,1551-1552,1554,1557-1559,1563,1574-1575,1587,1590,1600,1602,1608,1611-1613,1615,1621-1622,1624,1626,1632,1635,1638,1643-1645,1653-1654,1657,1660,1666-1667,1669,1673,1684-1686,1688,1692-1693,1698-1699,1703,1707,1710,1714,1719,1735,1741,1743,1750,1752,1758-1760,1763,1771,1780,1783,1786-1787,1791,1798-1799,1802,1809-1810,1817,1819,1824,1831,1834-1835,1845-1846,1853,1858,1860-1861,1866,1880,1888,1892,1894-1897,1902,1904,1907-1908,1911,1916,1919-1920,1923,1925-1926,1928,1930,1933-1935,1940,1942,1948,1954-1955,1959,1962-1963,1965,1967-1969,1971,1974,1976,1980-1982,1992,1998-1999,2001,2005-2006,2011-2012,2018,2021-2022,2028-2029,2034-2036,2038,2040-2041,2047,2167,2229,2233,2235,2249,2252,2257,2263,2273,2283,2285,2290,2293,2295-2298,2491,2494-2495,2505,2508-2509,2513,2521,2530,2535-2536,2539,2543-2546,2548-2550,2555-2556,2558-2559,2681,2684,2687,2743,2750,2761,2763,2765-2767,2772,2777,2781,2783,2785,2790,2798,2801,2803,2805,2808,2937,2997,2999,3007,3013,3018,3032,3035-3036,3046,3060,3064-3065 \N ivo://svo.cab/cat/gbs 4/0,182,273,285,388,547,552,794,809,831,1007,1089,1181,1382,1393,1443,1471,1544,1643,1653,1659,1685,1741,1791,1929,2080,2194,2252,2293,2379,2388,2610,2630,2640,2783 \N ivo://cds.vizier/j/a+as/124/353 6/24603,24796,25383,26065,27212,29368,29399,31018,31258,37132,37341,37368,37839,38172,38336,40233,40819,40923,41095,41369,42053,42077,42289,42371,42691,42948,43013,43076,43238,43515,43882,43962,43976,44113,44157,44810,44836,47606 \N empty 0/ \N \. ANALYZE moc100; CREATE INDEX ON moc100 USING GIN (coverage); SELECT ivoid FROM moc100 WHERE coverage && '4/0' ORDER BY ivoid; -- PG 10 does not have JIT, ignore errors on SET DO $$ begin set jit = off; exception when undefined_object then null; when others then raise; end; $$; SELECT explain ($$SELECT * FROM moc100 WHERE coverage && '0/'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage && '4/0'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/0-11'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '6/43225,43227'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/0-11'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/'$$); SET enable_seqscan = off; SELECT explain ($$SELECT * FROM moc100 WHERE coverage && '4/0'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <@ '4/0'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage @> '4/0'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/0-11'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '6/43225,43227'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage = '0/'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/0-11'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'$$); SELECT explain ($$SELECT * FROM moc100 WHERE coverage <> '0/'$$); pgsphere-1.5.1/sql/moc_options.sql000066400000000000000000000012111461140101500171700ustar00rootroot00000000000000create table moc_opt (m smoc); insert into moc_opt select format('9/%s', i)::smoc from generate_series(1, 1000) g(i); analyze moc_opt; create index moc_opt5 on moc_opt using gin (m); explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; drop index moc_opt5; create index moc_opt8 on moc_opt using gin (m smoc_gin_ops_fine); explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; drop index moc_opt8; create index moc_opt9 on moc_opt using gin (m smoc_gin_ops (order = 9)); explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; pgsphere-1.5.1/sql/mocautocast.sql000066400000000000000000000075611461140101500171770ustar00rootroot00000000000000-- These are MOCs generated by -- SELECT smoc(mocorder, scircle '<(27d, -43d), 0.1d>'); -- intended to check automatic casts of other geometries. CREATE TABLE varorders ( mocorder smallint, geo smoc); INSERT INTO varorders (mocorder, geo) VALUES (1, smoc('1/32 34 1/')), (-3, smoc('1/32 34 3/')), (3, smoc('3/547-548 550 553 3/')), (7, smoc('7/140857-140860 140862 140944-140945 7/')), (-7, smoc('1/32 34 7/')); -- OVERLAPS smoc/scircle SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsupc FROM varorders WHERE geo @> scircle '<(30d, -43d), 1d>'; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsupc FROM varorders WHERE geo !@> scircle '<(30d, -43d), 1d>'; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) csubg FROM varorders WHERE scircle '<(30d, -43d), 1d>' <@ geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnsubg FROM varorders WHERE scircle '<(30d, -43d), 1d>' !<@ geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsubc FROM varorders WHERE geo <@ scircle '<(30d, -43d), 1d>'; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsubc FROM varorders WHERE geo !<@ scircle '<(30d, -43d), 1d>'; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) csupg FROM varorders WHERE scircle '<(30d, -43d), 1d>' @> geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnsupg FROM varorders WHERE scircle '<(30d, -43d), 1d>' !@> geo; -- OVERLAPS smoc/spoly SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsupp FROM varorders WHERE geo @> spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsupp FROM varorders WHERE geo !@> spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) psubg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') <@ geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) pnsubg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') !<@ geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gsubp FROM varorders WHERE geo <@ spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) gnsubp FROM varorders WHERE geo !<@ spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}'); SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) psupg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') @> geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) pnsupg FROM varorders WHERE spoly('{(26d,-42d), (26d,-41d), (27d,-41d)}') !@> geo; -- INTERSECTS smoc/scircle SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgim FROM varorders WHERE scircle '<(45d, -40d), 1d>' && geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgnim FROM varorders WHERE scircle '<(45d, -40d), 1d>' !&& geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cmig FROM varorders WHERE geo && scircle '<(45d, -40d), 1d>'; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnim FROM varorders WHERE geo !&& scircle '<(45d, -40d), 1d>'; -- INTERSECTS smoc/spoly SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgim FROM varorders WHERE spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}' && geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cgnim FROM varorders WHERE spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}' !&& geo; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cmig FROM varorders WHERE geo && spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}'; SELECT string_agg(to_char(mocorder, '9'), '/' ORDER BY mocorder) cnim FROM varorders WHERE geo !&& spoly '{(51.1d, -50.1d), (45.8d, -47.5), (46.7d, -43.7d)}'; DROP TABLE varorders; pgsphere-1.5.1/sql/output_precision.sql000066400000000000000000000041051461140101500202570ustar00rootroot00000000000000-- -- Test default and custom output precisions for double values. -- SELECT set_sphere_output( 'RAD' ); -- -- Check default precision -- SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; -- -- Check option extra_float_digits -- SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO -2; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO 0; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO 1; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO 2; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO 3; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO 6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; -- -- Check compatibility behaviour -- SELECT set_sphere_output_precision(10); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT set_sphere_output_precision(12); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT set_sphere_output_precision(15); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT set_sphere_output_precision(17); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT set_sphere_output_precision(20); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT set_sphere_output_precision(0); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT set_sphere_output_precision(-3); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; -- -- Check extra_float_digits after set_sphere_output_precision. -- The change of extra_float_digits should not affect the precision of pgsphere -- output because set_sphere_output_precision enables compatibility mode. -- SELECT set_sphere_output_precision(10); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO -10; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; -- -- Check reset_sphere_output_precision. -- It should disable compatibility mode - extra_float_digits should work. -- SELECT reset_sphere_output_precision(); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SET extra_float_digits TO -6; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; pgsphere-1.5.1/sql/overlaps.sql000066400000000000000000000710721461140101500165060ustar00rootroot00000000000000/* This set of tests is designed to verify the compliance of the overlap operation with the DE-9IM model */ -- sline vs sline -- the lines have no common points select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(20d,0d)', spoint'(30d,0d)') as actual; -- the point of intersection of the lines is the boundary for both select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(10d,0d)', spoint'(20d,0d)') as actual; -- one line intersects the other at the boundary point of the latter select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,90d)', spoint'(0d,-10d)') as actual; -- the interiors of the lines intersect at one point select 'sline && sline', 'f' as expected, sline( spoint'(-10d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,90d)', spoint'(0d,-10d)') as actual; -- the lines match select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,0d)', spoint'(10d,0d)') as actual; -- one line lies completely in the other and they have an intersection at the boundary point select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,0d)', spoint'(5d,0d)') as actual; -- one line lies completely in the other and they have no intersection at the boundary point select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(2d,0d)', spoint'(5d,0d)') as actual; -- one line partially lies in the other select 'sline && sline', 't' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(5d,0d)', spoint'(20d,0d)') as actual; -- the line degenerated into the point lies on the boundary of another select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(0d,0d)', spoint'(0d,0d)') as actual; -- the line degenerated into the point lies in the interior of another select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(10d,0d)') && sline( spoint'(5d,0d)', spoint'(5d,0d)') as actual; -- both lines are degenerated into the point and coincide select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(0d,0d)') && sline( spoint'(0d,0d)', spoint'(0d,0d)') as actual; -- both lines are degenerated into the point and do not coincide, but lie close to each other select 'sline && sline', 'f' as expected, sline( spoint'(0d,0d)', spoint'(0d,0d)') && sline( spoint'(1d,0d)', spoint'(1d,0d)') as actual; -- scircle vs scircle -- the circles have no common points select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(30d , 0d) , 5d>' as actual; -- the point of intersection of the circles is the boundary for both select 'scircle && scircle', 'f' as expected, scircle'<(-10d , 0d) , 10d>' && scircle'<(10d , 0d) , 10d>' as actual; -- the circles match select 'scircle && scircle', 'f' as expected, scircle'<(-10d , 0d) , 10d>' && scircle'<(-10d , 0d) , 10d>' as actual; -- one circle lies completely in the other and they have an intersection at the boundary point select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(-10d , 0d) , 10d>' as actual; -- one circle lies completely in the other and they have no intersection at the boundary point select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(0d , 0d) , 5d>' as actual; -- one circle partially lies in the other select 'scircle && scircle', 't' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(10d , 0d) , 20d>' as actual; -- the circle degenerated into the point lies on the boundary of another select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(20d , 0d) , 0d>' as actual; -- the circle degenerated into the point lies in the interior of another select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 20d>' && scircle'<(0d , 0d) , 0d>' as actual; -- both circles are degenerated into the point and coincide select 'scircle && scircle', 'f' as expected, scircle'<(0d , 0d) , 0d>' && scircle'<(0d , 0d) , 0d>' as actual; -- both circles are degenerated into the point and do not coincide, but lie close to each other select 'scircle && scircle', 'f' as expected, scircle'<(1d , 0d) , 0d>' && scircle'<(0d , 0d) , 0d>' as actual; -- sellipse vs sellipse -- the ellipses have no common points select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' && sellipse'<{ 45d , 20d }, (50 , 0d) , 0d>' as actual; -- the point of intersection of the ellipses is the boundary for both select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' && sellipse'<{ 45d , 20d }, (45d , 0d) , 0d>' as actual; -- the ellipses match select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' && sellipse'<{ 45d , 20d }, (-45d , 0d) , 0d>' as actual; -- one ellipse lies completely in the other and they have an intersection at the boundary point select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 20d , 5d }, (-20d , 0d) , 0d>' as actual; -- one ellipse lies completely in the other and they have no intersection at the boundary point select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 10d , 5d }, (-20d , 0d) , 0d>' as actual; -- one ellipse partially lies in the other select 'sellipse && sellipse', 't' as expected, sellipse'<{ 45d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 20d , 5d }, (30d , 0d) , 0d>' as actual; -- the ellipse degenerated into the line lies completely in the interior of another (non-degenerate) ellipse select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 10d , 0d }, (10d , 0d) , 0d>' as actual; -- the ellipse degenerated into the line partially lies in the interior of another (non-degenerate) ellipse select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 20d , 0d }, (30d , 0d) , 0d>' as actual; -- the ellipse degenerated into the point lies on the boundary of another select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (30d , 0d) , 0d>' as actual; -- the ellipse degenerated into the point lies in the interior of another select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 40d , 30d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (40d , 0d) , 0d>' as actual; -- both ellipses are degenerated into the point and coincide select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' as actual; -- both ellipses are degenerated into the point and do not coincide, but lie close to each other select 'sellipse && sellipse', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && sellipse'<{ 0d , 0d }, (1d , 0d) , 0d>' as actual; -- sellipse vs scircle -- the ellipse and circle have no common points select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(30d , 0d) , 5d>' as actual; -- the point of intersection of the ellipse and circle is the boundary for both select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(30d , 0d) , 10d>' as actual; -- the ellipse and circle match select 'sellipse && scircle', 'f' as expected, sellipse'<{ 10d , 10d }, (30d , 0d) , 0d>' && scircle'<(30d , 0d) , 10d>' as actual; -- the ellipse lies completely in the circle and they have an intersection at the boundary point select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(20d , 0d) , 40d>' as actual; -- the ellipse lies completely in the circle and they have no intersection at the boundary point select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (20d , 0d) , 0d>' && scircle'<(20d , 0d) , 40d>' as actual; -- the circle lies completely in the ellipse select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(0d , 0d) , 5d>' as actual; -- the circle partially lies in the ellipse select 'sellipse && scircle', 't' as expected, sellipse'<{ 20d , 10d }, (0d , 0d) , 0d>' && scircle'<(20d , 0d) , 15d>' as actual; -- the ellipse degenerated into the line lies completely in the interior of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 0d }, (0d , 0d) , 0d>' && scircle'<(0d , 0d) , 20d>' as actual; -- the ellipse degenerated into the line partially lies in the interior of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 20d , 0d }, (10d , 0d) , 0d>' && scircle'<(0d , 0d) , 20d>' as actual; -- the ellipse degenerated into the point lies on the boundary of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (10d , 0d) , 0d>' && scircle'<(0d , 0d) , 10d>' as actual; -- the ellipse degenerated into the point lies in the interior of circle select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (5d , 0d) , 0d>' && scircle'<(0d , 0d) , 10d>' as actual; -- the ellipse and circle are degenerated into the point and coincide select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && scircle'<(0d , 0d) , 0d>' as actual; -- the ellipses are degenerated into the point and do not coincide, but lie close to each other select 'sellipse && scircle', 'f' as expected, sellipse'<{ 0d , 0d }, (0d , 0d) , 0d>' && scircle'<(1d , 0d) , 0d>' as actual; -- spath vs spath -- the opened paths have no common points select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d,0d),(45d,15d) }' && spath'{ (60d, 15d),(70d, 20d),(75d, 20d) }' as actual; -- the points of intersection of the opened paths is the boundary for both select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (-10d, 0d),(0d, 10d),(45d, 15d) }' as actual; -- one opened path intersects the other at the boundary point of the latter select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (-20d, -10d),(-10d, 0d),(0d, 10d),(45d, 15d),(60d, 15d) }' as actual; -- the interiors of the opened paths intersect at one point select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (0d, 10d),(0d, -10d),(10d, -10d) }' as actual; -- the interiors of the opened paths intersect at two points select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (0d, 10d),(0d, -10d),(5d, 0d) }' as actual; -- the opened paths match select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' as actual; -- the closed paths match select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' && spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' as actual; -- one opened path lies completely in the other and they have an intersection at the boundary point select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 15d),(70d, 20d) }' && spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' as actual; -- one opened path lies completely in the other and they have no intersection at the boundary point select 'spath && spath', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 15d),(70d, 20d) }' && spath'{ (10d, 0d),(45d, 15d),(60d, 15d) }' as actual; -- one opened path partially lies in the other select 'spath && spath', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && spath'{ (45d, 15d),(60d, 15d),(70d, 20d) }' as actual; -- one closed path partially lies in the other select 'spath && spath', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' && spath'{ (45d, 15d),(60d, 15d),(70d, 20d),(45d, 15d) }' as actual; -- the opened path partially lies in the closed path select 'spath && spath', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(-10d, 0d) }' && spath'{ (45d, 15d),(60d, 15d),(70d, 20d) }' as actual; -- spath vs sline -- the opened path and line have no common points select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(20d, 0d)', spoint'(30d, 0d)') as actual; -- the points of intersection of the opened path and line is the boundary for both select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(-10d, 0d)', spoint'(45d, 15d)') as actual; -- the interiors of the opened path and line intersect at one point select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(0d, 10d)', spoint'(0d, -10d)') as actual; -- the path and line match select 'spath && sline', 'f' as expected, spath'{ (0d, 10d),(0d, -10d) }' && sline( spoint'(0d, 10d)', spoint'(0d, -10d)') as actual; -- the line lies completely in the opened path and they have an intersection at the boundary point select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 20d) }' && sline( spoint'(-10d, 0d)', spoint'(10d, 0d)') as actual; -- the line lies completely in the opened path and they have no intersection at the boundary point select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d),(60d, 20d) }' && sline( spoint'(10d, 0d)', spoint'(45d, 15d)') as actual; -- the line partially lies in the open path select 'spath && sline', 't' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(5d, 0d)', spoint'(20d, 0d)') as actual; -- the line degenerated into the point lies in the boundary of open path select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(-10d, 0d)', spoint'(-10d, 0d)') as actual; -- the line degenerated into the point lies in the interior of open path select 'spath && sline', 'f' as expected, spath'{ (-10d, 0d),(10d, 0d),(45d, 15d) }' && sline( spoint'(0d, 0d)', spoint'(0d, 0d)') as actual; -- spoly vs spoly -- the polygons have no common points select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (10d, 0d),(20d, 0d),(10d, 10d) }' as actual; -- the point of intersection of the polygons is the boundary for both select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (10d, 0d),(20d, 0d),(0d, 10d) }' as actual; -- the interiors of the polygons intersect at one line select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (0d, 0d),(20d, 0d),(0d, 10d) }' as actual; -- the polygons matches select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' as actual; -- one polygon lies completely in the other and they have an intersection at the boundary line select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- one polygon lies completely in the other and they have no intersection at the boundary line or point select 'spoly && spoly', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && spoly'{ (5d, 5d),(15d, 5d),(15d, 15d),(5d,15d) }' as actual; -- one polygon partially lies in the other select 'spoly && spoly', 't' as expected, spoly'{ (0d, 0d),(-10d, 0d),(0d, 10d) }' && spoly'{ (5d, 5d),(30d, 5d),(30d, 15d),(5d,15d) }' as actual; -- spoly vs scircle -- the polygon and circle have no common points select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 90d) , 10d>' as actual; -- the point of intersection of the polygon and circle is the boundary for both select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 90d) , 80d>' as actual; -- the circle lies completely in the polygon and they have an intersection at the boundary point select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(5d , 1d) , 1d>' as actual; -- the circle lies completely in the polygon and they have no intersection at the boundary point select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(5d , 2d) , 1d>' as actual; -- the polygon lies completely in the circle select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 15d) , 20d>' as actual; -- the polygon partially lies in the circle select 'spoly && scircle', 't' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 5d) , 5d>' as actual; -- the circle degenerated into the point lies in the boundary of polygon select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(0d , 0d) , 0d>' as actual; -- the circle degenerated into the point lies in the interior of polygon select 'spoly && scircle', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && scircle'<(2d , 2d) , 0d>' as actual; -- spoly vs sellipse -- the polygon and ellipse have no common points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 30d , 20d }, (0d , 90d) , 0d>' as actual; -- the point of intersection of the polygon and ellipse is the boundary for both select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 80d , 20d }, (0d , 90d) , 90d>' as actual; -- the ellipse lies completely in the polygon and they have an intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && sellipse'<{ 10d , 5d }, (10d , 10d), 0d>' as actual; -- the ellipse lies completely in the polygon and they have no intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' && sellipse'<{ 7d , 5d }, (10d , 10d), 0d>' as actual; -- the polygon lies completely in the ellipse and they have an intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 5d),(10d, 10d),(20d, 5d),(10d, 0d) }' && sellipse'<{ 10d , 5d }, (10d , 5d), 0d>' as actual; -- the polygon lies completely in the ellipse and they have no intersection at the boundary points select 'spoly && sellipse', 'f' as expected, spoly'{ (1d, 5d),(10d, 9d),(19d, 5d),(10d, 1d) }' && sellipse'<{ 10d , 5d }, (10d , 10d), 0d>' as actual; -- the ellipse partially lies in the polygon select 'spoly && sellipse', 't' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 10d , 2d }, (0d , 5d) , 0d>' as actual; -- the ellipse degenerated into the point lies in the boundary of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 0d , 0d }, (0d , 0d), 0d>' as actual; -- the ellipse degenerated into the point lies in the interior of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 0d , 0d }, (5d , 2d), 0d>' as actual; -- the ellipse degenerated into the line lies in the boundary of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 5d , 0d }, (5d , 0d), 0d>' as actual; -- the ellipse degenerated into the line lies in the interior of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 2d , 0d }, (1d , 4d), 90d>' as actual; -- the ellipse degenerated into the line partially lies in the interior of polygon select 'spoly && sellipse', 'f' as expected, spoly'{ (0d, 0d),(10d, 0d),(0d, 10d) }' && sellipse'<{ 10d , 0d }, (1d , 4d), 0d>' as actual; -- sbox vs sbox -- the boxes have no common points select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((30d , 30d), (50d , 50d))' as actual; -- the point of intersection of the boxes is the boundary for both select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((20d , 20d), (50d , 50d))' as actual; -- the boundaries of the boxes intersect at one line select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((20d , 0d), (50d , 20d))' as actual; -- the boxes matches select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (10d , 10d))' as actual; -- one box lies completely in the other and they have no intersection at the boundary line or point select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (10d , 10d))' as actual; -- one box partially lies in the other select 'sbox && sbox', 't' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((10d , 10d), (30d , 30d))' as actual; -- one box degenerated into the line lies in the boundary of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((0d , 0d), (20d , 0d))' as actual; -- one box degenerated into the line lies in the interior of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (10d , 5d))' as actual; -- one box degenerated into the point lies in the boundary of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((0d , 0d), (0d , 0d))' as actual; -- one box degenerated into the point lies in the interior of other select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sbox'((5d , 5d), (5d , 5d))' as actual; -- the boxes are degenerated into the point and coincide select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && sbox'((0d , 0d), (0d , 0d))' as actual; -- the boxes are degenerated into the point and not coincide select 'sbox && sbox', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && sbox'((10d , 10d), (10d , 10d))' as actual; -- sbox vs scircle -- the box and circle have no common points select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(0d , 90d) , 10d>' as actual; -- the point of intersection of the box and circle is the boundary for both select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(30d , 0d) , 10d>' as actual; -- the circle lies completely in the box and they have an intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(10d , 10d) , 10d>' as actual; -- the circle lies completely in the box and they have no intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(10d , 10d) , 5d>' as actual; -- the box lies completely in the circle and they have an intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((-4d , -3d), (3d , 4d))' && scircle'<(0d , 0d) , 5d>' as actual; -- the box lies completely in the circle and they have no intersection at the boundary points select 'sbox && scircle', 'f' as expected, sbox'((-4d , -3d), (3d , 4d))' && scircle'<(0d , 0d) , 10d>' as actual; -- the box degenerated into the line intersects circle select 'sbox && scircle', 'f' as expected, sbox'((-20d , 0d), (20d , 0d))' && scircle'<(0d , 0d) , 10d>' as actual; -- the circle partially lies in the box select 'sbox && scircle', 't' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(15d , 15d) , 10d>' as actual; -- the circle degenerated into the point lies in the boundary of box select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(0d , 10d) , 0d>' as actual; -- the circle degenerated into the point lies in the interior of box select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && scircle'<(10d , 10d) , 0d>' as actual; -- the box degenerated into the point lies in the boundary of circle select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(10d , 0d) , 10d>' as actual; -- the box degenerated into the point lies in the interior of circle select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(0d , 0d) , 10d>' as actual; -- the box and circle are degenerated into the point and coincide select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(0d , 0d) , 0d>' as actual; -- the box and circle are degenerated into the point and not coincide select 'sbox && scircle', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && scircle'<(5d , 5d) , 0d>' as actual; -- sbox vs spoly -- the box and polygon have no common points select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (30d, 0d),(40d, 0d),(30d, 20d) }' as actual; -- the point of intersection of the box and polygon is the boundary for both select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (30d, 0d),(40d, 0d),(30d, 20d) }' as actual; -- the boundaries of the boxes intersect at one line select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (20d, 0d),(30d, 0d),(20d, 20d) }' as actual; -- the box and circle matches select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (0d, 0d),(20d, 0d),(20d, 20d),(0d, 20d) }' as actual; -- the polygon lies completely in the box and they have an intersection at the boundary line select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- the polygon lies completely in the box and they have no intersection at the boundary select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (1d, 1d),(11d, 1d),(1d, 19d) }' as actual; -- the box lies completely in the polygon and they have an intersection at the boundary line select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (10d , 10d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- the box lies completely in the polygon and they have no intersection at the boundary select 'sbox && spoly', 'f' as expected, sbox'((1d , 1d), (2d , 2d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- the polygon partially lies in the box select 'sbox && spoly', 't' as expected, sbox'((0d , 0d), (20d , 20d))' && spoly'{ (15d, 0d),(35d, 0d),(15d, 35d) }' as actual; -- the box degenerated into the line lies in the boundary of polygon select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (20d , 0d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- the box degenerated into the line lies in the interior of polygon select 'sbox && spoly', 'f' as expected, sbox'((0d , 5d), (10d , 5d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- the box degenerated into the point lies in the boundary of polygon select 'sbox && spoly', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- the box degenerated into the point lies in the interior of polygon select 'sbox && spoly', 'f' as expected, sbox'((5d , 5d), (5d , 5d))' && spoly'{ (0d, 0d),(20d, 0d),(0d, 20d) }' as actual; -- sbox vs sellipse -- the box and ellipse have no common points select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sellipse'<{ 20d , 10d }, (0d, 90d) , 0d>' as actual; -- the point of intersection of the box and ellipse is the boundary for both select 'sbox && sellipse', 'f' as expected, sbox'((-10d , -10d), (10d , 10d))' && sellipse'<{ 80d , 10d }, (0d, 90d) , 90d>' as actual; -- the ellipse lies completely in the box and they have an intersection at the boundary points select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sellipse'<{ 10d , 5d }, (10d, 10d) , 0d>' as actual; -- the ellipse lies completely in the box and they have no intersection at the boundary points select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (20d , 20d))' && sellipse'<{ 9d , 5d }, (10d, 10d) , 0d>' as actual; -- the box lies completely in the ellipse and they have no intersection at the boundary points select 'sbox && sellipse', 'f' as expected, sbox'((-10d , -10d), (10d , 10d))' && sellipse'<{ 30d , 20d }, (0d, 0d) , 0d>' as actual; -- the ellipse partially lies in the box select 'sbox && sellipse', 't' as expected, sbox'((-10d , -10d), (10d , 10d))' && sellipse'<{ 10d , 5d }, (10d, 10d) , 90d>' as actual; -- the box degenerated into the point lies in the boundary of ellipse select 'sbox && sellipse', 'f' as expected, sbox'((30d , 0d), (30d , 0d))' && sellipse'<{ 30d , 20d }, (0d, 0d) , 0d>' as actual; -- the box degenerated into the point lies in the interior of ellipse select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (10d , 0d))' && sellipse'<{ 30d , 20d }, (0d, 0d) , 0d>' as actual; -- the box and ellipse are degenerated into the point and coincide select 'sbox && sellipse', 'f' as expected, sbox'((0d , 0d), (0d , 0d))' && sellipse'<{ 0d , 0d }, (0d, 0d) , 0d>' as actual; pgsphere-1.5.1/sql/path.sql000066400000000000000000000131301461140101500155760ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); \set ECHO all -- -- ellipse and path -- -- negators , commutator @,&& SELECT spath '{(280d, -9d),(280d, -8d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d,-12d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d,-11d),(280d,-12d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d, -8d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d,-12d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d,-11d),(280d,-12d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d, -8d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d,-12d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d,-11d),(280d,-12d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d, -8d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -9d),(280d,-12d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d,-11d),(280d,-12d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spath '{(280d, -9d),(280d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spath '{(280d, -9d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spath '{(280d,-11d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spath '{(280d, -9d),(280d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spath '{(280d, -9d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spath '{(280d,-11d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spath '{(280d, -9d),(280d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spath '{(280d, -9d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spath '{(280d,-11d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spath '{(280d, -9d),(280d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spath '{(280d, -9d),(280d,-12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spath '{(280d,-11d),(280d,-12d)}'; -- path is a line , ellipse is point SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{0d,0d},(280d, -8d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{0d,0d},(280d, -8d),90d>'; -- path is a line , ellipse is circle SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,5d},(280d, -8d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,5d},(280d, -8d),90d>'; -- path is a line , ellipse is path SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{5d,0d},(280d, -8d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{5d,0d},(280d, -8d),90d>'; -- path is a line , ellipse is a real ellipse SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' @ sellipse '<{10d,5d},(280d, -8d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spath '{(280d, -8d),(280d, -9d)}' && sellipse '<{10d,5d},(280d, -8d),90d>'; -- create path as aggregate SELECT spath(data.p) FROM ( SELECT spoint '(0,1)' as p UNION ALL SELECT spoint '(1,1)' UNION ALL SELECT '(1,0)' ) AS data ; -- -- checking path other operators -- \set poly 'spoly \'{(0.1,0),(0.2,0),(0.2,0.1),(0.3,0.1),(0.3,-0.1),(0.4,-0.1),(0.5,0.1),(0.4,0.2),(0.1,0.2)}\'' \set path1 'spath \'{(0.1,0),(0.2,0),(0.2,0.1),(0.3,0.1),(0.3,-0.1),(0.4,-0.1),(0.5,0.1),(0.4,0.2),(0.1,0.2)}\'' \set path2 'spath \'{(0,0),(1,0),(2,0),(3,0)}\'' \set path3 'spath \'{(0,0),(0,1),(0,1.5)}\'' SELECT @-@ spath '{(0,0),(1,0),(2,0),(3,0)}'; SELECT :path1 = :path2; SELECT :path1 = :path1; SELECT :path1 <> :path2; SELECT :path1 <> :path1; SELECT :poly && :path1; SELECT :path1 && :poly ; SELECT :path1 @ :poly ; SELECT :path2 @ :poly ; SELECT :path1 && :path1; SELECT :path1 && :path1; SELECT :poly && :path2; SELECT :path2 && :poly ; SELECT :path2 && :path1; SELECT :poly && :path3; SELECT :path3 && :poly ; SELECT :path3 && :path1; SELECT :path3 && :path2; SELECT :path1 @ scircle '<(0,1),1>'; SELECT :path3 @ scircle '<(0,1),1>'; SELECT :path3 @ scircle '<(0,1),0.7>'; SELECT :path1 && scircle '<(0,1),1>'; SELECT :path3 && scircle '<(0,1),1>'; SELECT :path3 && scircle '<(0,1),0.7>'; SELECT :path3 && scircle '<(0,-1),0.7>'; SELECT :path3 @ scircle '<(0,-1),0.7>'; SELECT :path3 && sline ( spoint '(0,-1)', spoint '(0,1)' ); SELECT :path3 && sline ( spoint '(-1,0)', spoint '(1,0)' ); SELECT :path3 && sline ( spoint '(-1,0)', spoint '(-0.3,0)' ); SELECT spath '{(0.11,0.15),(0.12,0.15),(0.13,0.15)}' @ :poly; -- create path SELECT spath(data.p) FROM ( SELECT spoint '(0,1)' as p UNION ALL SELECT spoint '(1,1)' UNION ALL SELECT '(1,0)' ) AS data ; SELECT set_sphere_output( 'DEG' ); -- test stored data SELECT spoint(p,2) FROM spheretmp6 WHERE id=2; SELECT set_sphere_output( 'RAD' ); -- get n-th point and array representation path points tests SELECT spoint( spath '{(0, 0),(1, 1)}', 1 ); SELECT spoint( spath '{(0, 0),(1, 1)}', 2 ); SELECT spath_as_array( spath '{(0, 0),(1, 1)}'); pgsphere-1.5.1/sql/points.sql000066400000000000000000000155661461140101500161750ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); SET extra_float_digits TO -2; \set ECHO all -- operators SELECT spoint '(0, 90d)' = spoint '(0, 90d)'; SELECT spoint '(0, 90d)' = spoint '(0,-90d)'; SELECT spoint '(0,-90d)' = spoint '(0,-90d)'; SELECT spoint '(0, 90d)' != spoint '(0, 90d)'; SELECT spoint '(0, 90d)' != spoint '(0,-90d)'; SELECT spoint '(0,-90d)' != spoint '(0,-90d)'; SELECT spoint '(0d, 0)' = spoint '(360d,0)'; -- I/O test -- -- Output --- SELECT set_sphere_output( 'DEG' ); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 1h 3m 30s , -1d 3m 3.6s)'::spoint; SELECT '( 0h 3m 30s , -0d 3m 3.6s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT set_sphere_output( 'DMS' ); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT set_sphere_output( 'HMS' ); SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT set_sphere_output( 'RAD' ); SELECT '( 0h 0m 0s , 0d 0m 0s)'::spoint; -- "incorrect dec. values" SELECT set_sphere_output( 'DEG' ); SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 5d 0m 0s)'::spoint; SELECT '( -0h 2m 30s , -5d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -95d 0m 0s)'::spoint; -- Input -- SELECT '( 0.625d , -0.04166666667d)'::spoint; SELECT '(0.0109083078249646 , -0.000727220521664407)'::spoint; -- functions for point -------------- -- spoint(float8, float8) SELECT spoint(0.0109083078249646 , -0.000727220521664407); SELECT spoint_deg(57.2958, 57.2958); SELECT spoint_deg(0, 0); SELECT spoint_deg(114.5916, 0); SELECT set_sphere_output( 'RAD' ); SELECT spoint(7.28318530717958623 , 0.00); SELECT spoint(0.0 , 2.141592653589793116); -- dist(spoint,spoint) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 0m 30s , 0d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , 10d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 95d 0m 0s)'::spoint,'( 12h 2m 30s , 85d 0m 0s)'::spoint); SELECT dist('( 24h 2m 30s , 10d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 90d 0m 0s)'::spoint,'( 12h 2m 30s , 90d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , -90d 0m 0s)'::spoint,'( 12h 2m 30s , -90d 0m 0s)'::spoint); -- long(spoint) SELECT long('( 0h 2m 30s , 0d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,95d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,85d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,-95d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,-85d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,90d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,-90d 0m 0s)'::spoint); SELECT long('(24h 2m 30s , 0d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,95d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,85d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,-95d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,-85d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,90d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,-90d 0m 0s)'::spoint); -- lat(spoint) SELECT lat('( 0h 2m 30s , 0d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,95d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,85d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,-95d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,-85d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,90d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,-90d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s , 0d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,95d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,85d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,-95d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,-85d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,90d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,-90d 0m 0s)'::spoint); -- operators for points ------------- -- = operator ----------------------- SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 24h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 24h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint='( 12h 2m 30s , 85d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint='( 0h 2m 30s , 10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint='( 12h 2m 30s , 45d 0m 0s)'::spoint; -- <> operator ----------------------- SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 24h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 24h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<>'( 12h 2m 30s , 85d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<>'( 0h 2m 30s , 10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<>'( 12h 2m 30s , 45d 0m 0s)'::spoint; -- <-> operator --------------------- SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 0m 30s , 0d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , 10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<->'( 12h 2m 30s , 85d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<->'( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<->'( 12h 2m 30s , -90d 0m 0s)'::spoint; -- spoint_dwithin function ---------- SELECT a, b, radius, a <-> b AS "<->", spoint_dwithin(a, b, radius) FROM (VALUES ('(0, 0)'::spoint, '(0, 0)'::spoint, 0), ('(0, 0)', '(0, 1)', 1), ('(0, 0)', '(0.1, 0.1)', 0.14), ('(0, 0)', '(0.1, 0.1)', 0.15) ) sub (a, b, radius); pgsphere-1.5.1/sql/poly.sql000066400000000000000000000711741461140101500156410ustar00rootroot00000000000000\set ECHO none SELECT set_sphere_output_precision(8); SET extra_float_digits = 0; \set ECHO all -- checking polygon operators \set poly 'spoly \'{(0.1,0),(0.2,0),(0.2,0.1),(0.3,0.1),(0.3,-0.1),(0.4,-0.1),(0.5,0.1),(0.4,0.2),(0.1,0.2)}\'' SELECT spoint '(0.15,0.10)' @ :poly; -- point inside polygon SELECT spoint '(0.20,0.00)' @ :poly; -- point contained polygon SELECT spoint '(0.10,0.10)' @ :poly; -- point contained polygon SELECT spoint '(0.25,0.50)' @ :poly; -- point outside polygon SELECT spoint '(0.25,0.00)' @ :poly; -- point outside polygon SELECT scircle '<(0.15,0.10),0.03>' @ :poly; -- circle inside polygon SELECT scircle '<(0.20,0.00),0.00>' @ :poly; -- circle contained polygon SELECT scircle '<(0.20,0.30),0.05>' @ :poly; -- circle outside polygon SELECT scircle '<(0.25,0.00),0.05>' @ :poly; -- circle overlaps polygon SELECT scircle '<(0.25,0.00),0.10>' @ :poly; -- circle overlaps polygon SELECT scircle '<(0.15,0.10),0.03>' && :poly; -- circle inside polygon SELECT scircle '<(0.20,0.00),0.00>' && :poly; -- circle contained polygon SELECT scircle '<(0.20,0.30),0.05>' && :poly; -- circle outside polygon SELECT scircle '<(0.25,0.00),0.05>' && :poly; -- circle overlaps polygon SELECT scircle '<(0.25,0.00),0.10>' && :poly; -- circle overlaps polygon SELECT sline ( spoint '(0.00, 0.00)', spoint '(0.10,0.20)' ) @ :poly; -- line touches polygon SELECT sline ( spoint '(0.00, 0.10)', spoint '(0.10,0.10)' ) @ :poly; -- line touches polygon SELECT sline ( spoint '(0.50, 0.00)', spoint '(0.50,0.20)' ) @ :poly; -- line touches polygon SELECT sline ( spoint '(0.10, 0.20)', spoint '(0.20,0.00)' ) @ :poly; -- line touches and inside polygon SELECT sline ( spoint '(0.45,-0.20)', spoint '(0.45,0.20)' ) @ :poly; -- line overlaps polygon SELECT sline ( spoint '(0.45, 0.10)', spoint '(0.45,0.20)' ) @ :poly; -- line overlaps polygon SELECT sline ( spoint '(0.24, 0.17)', spoint '(0.25,0.14)' ) @ :poly; -- line inside polygon SELECT sline ( spoint '(0.00, 0.00)', spoint '(0.10,0.20)' ) && :poly; -- line touches polygon SELECT sline ( spoint '(0.00, 0.10)', spoint '(0.10,0.10)' ) && :poly; -- line touches polygon SELECT sline ( spoint '(0.50, 0.00)', spoint '(0.50,0.20)' ) && :poly; -- line touches polygon SELECT sline ( spoint '(0.10, 0.20)', spoint '(0.20,0.00)' ) && :poly; -- line touches and inside polygon SELECT sline ( spoint '(0.45,-0.20)', spoint '(0.45,0.20)' ) && :poly; -- line overlaps polygon SELECT sline ( spoint '(0.45, 0.10)', spoint '(0.45,0.20)' ) && :poly; -- line overlaps polygon SELECT sline ( spoint '(0.24, 0.17)', spoint '(0.25,0.14)' ) && :poly; -- line inside polygon \unset poly \set poly1 'spoly \'{(0,0),(1,0),(0,1)}\'' \set poly2 'spoly \'{(1,0),(0,0),(0,1)}\'' \set poly3 'spoly \'{(0,1),(0,0),(1,0)}\'' \set poly4 'spoly \'{(0.1,0.9),(0.1,0.1),(0.9,0.1)}\'' \set poly5 'spoly \'{(0.2,0.0),(1.2,0.0),(0.2,1)}\'' SELECT :poly1 = :poly2; SELECT :poly2 = :poly3; SELECT :poly3 = :poly1; SELECT :poly1 && :poly2; SELECT :poly2 && :poly3; SELECT :poly3 && :poly1; SELECT :poly1 @ :poly2; SELECT :poly2 @ :poly3; SELECT :poly3 @ :poly1; SELECT :poly1 @ :poly4; SELECT :poly4 @ :poly1; SELECT :poly1 && :poly4; SELECT :poly4 && :poly1; SELECT :poly1 @ :poly5; SELECT :poly5 @ :poly1; SELECT :poly1 && :poly5; SELECT :poly5 && :poly1; \unset poly1 \unset poly2 \unset poly3 \unset poly4 \unset poly5 -- From testsuite/poly_test.sql SELECT set_sphere_output('DEG'); SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; SELECT spoly '{(359d,0d),(359d,1d),(4d,0d)}'; SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; SELECT spoly(ARRAY[0.017453292519943295, 0.03490658503988659, 0.05235987755982988, 0.06981317007977318, 0.08726646259971647, 0.10471975511965977]); SELECT spoly(ARRAY[0.17453292519943295, 0.0, 0.17453292519943295, 0.017453292519943295, 0.2617993877991494, 0.0]); SELECT spoly_deg(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0, 6.0]); SELECT spoly_deg(ARRAY[10.0, 0.0, 10.0, 1.0, 15.0, 0.0]); --- Constructors SELECT spoly(NULL::spoint[]); SELECT spoly(ARRAY[]::spoint[]); SELECT spoly(ARRAY[spoint_deg(0, 0)]); SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0)]); SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10, 10)]); SELECT spoly(ARRAY[spoint_deg(0, 0), spoint_deg(10, 0), spoint_deg(10, 10), spoint_deg(0, 10)]); --- incorrect input ----- SELECT spoly '{(10d,0d),(10d,1d)}'; SELECT spoly(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0]); SELECT spoly(ARRAY[1.0, 2.0, 3.0, NULL, 5.0, 6.0]); SELECT spoly(ARRAY[]::float8[]); SELECT spoly(NULL::float8[]); SELECT spoly_deg(ARRAY[1.0, 2.0, 3.0, 4.0, 5.0]); SELECT spoly_deg(ARRAY[1.0, 2.0, 3.0, NULL, 5.0, 6.0]); SELECT spoly_deg(ARRAY[]::float8[]); SELECT spoly_deg(NULL::float8[]); --- self-crossing input ----- SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}'; --- degenerate polygons ----- SELECT spoly '{(0d,1d),(0d,2d),(0d,3d)}'; SELECT spoly '{(1d,0d),(2d,0d),(3d,0d)}'; --- functions SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d)}'); SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d),(5d,-5d)}'); --SELECT npoints( spoly '{(0d,0d),(0d,90d),(15d,90d),(15d,0d)}'); SELECT area(spoly '{(0d,0d),(0d,90d),(1,0d)}'); SELECT area(spoly '{(0d,0d),(0d,90d),(90d,0d)}')/(4.0*pi()); --- operations --- = operator --- should be true SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(2d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(2d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; --- should be false SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(3d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; --- <> operator --- should be false SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(2d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(2d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; --- should be true SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(3d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; --- spoint @ spoly --- should be true SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(3d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; --- spoint @ spoly --- should be true SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0d,0d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0d,89.9d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '(0d,90d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '(0d,-89.9d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '(0d,-90d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; --- should be false SELECT '(0.1d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(45d,-89d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '(0d,1d)'::spoint @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; --- spoly ~ spoint --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0.5d)'::spoint; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0d)'::spoint; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,89.9d)'::spoint; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,90d)'::spoint; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-89.9d)'::spoint; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-90d)'::spoint; --- should be false SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.1d,0.5d)'::spoint; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(45d,-89d)'::spoint; SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '(0d,1d)'::spoint; --- scircle @ spoly --- should be true SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,89.9d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,90d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,-89.9d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-90d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; --- should be false SELECT '<(0.1d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(45d,-89d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,1d),0.1d>'::scircle @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; --- spoly ~ scircle --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,89.9d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,90d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-89.9d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-90d),0.1d>'::scircle; --- should be false SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(45d,-89d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '<(0d,1d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.1d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.6d,0.5d),0.1d>'::scircle; --- spoly @ scircle --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),2.0d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ '<(0d,90d),1.0d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' @ '<(180d,-90d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; --- should be false SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),0.99d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(60d,0d),0.99d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}' @ '<(0d,90d),1.0d>'::scircle; SELECT spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}' @ '<(180d,-90d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(2d,0d)}' @ '<(0d,0d),1.0d>'::scircle; --- scircle ~ spoly --- should be true SELECT '<(0d,0d),2.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; --- should be false SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(60d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}'; SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(2d,0d)}'; --- scircle && spoly --- should be true SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,89.9d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-89.9d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-90d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0d,0d),2.0d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' && '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),1.0d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(180d,-90d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(0d,2d),1.0d>'::scircle; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(2d,0d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; --- should be false SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(1.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,88.0d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.3d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-87d),0.1d>'::scircle; --- spoly && scircle --- should be true SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,89.9d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,90d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,-89.9d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-90d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,0d),2.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(0d,90d),1.0d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(180d,-90d),1.0d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT '<(0d,2d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT '<(2d,0d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; --- should be false SELECT '<(1.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,88.0d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0.3d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,-87d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; --- spoly @ spoly --- should be true SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; --- should be false --SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; --- spoly ~ spoly --- should be true SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; --- should be false SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}'; SELECT spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; --- spoly && spoly --- should be true SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; --- should be false SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(3d,-1d),(3d,1d),(5d,1d),(5d,-1d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-1d,3d),(-1d,5d),(1d,5d),(1d,3d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(179d,-1d),(179d,1d),(181d,1d),(181d,-1d)}'; -- -- ellipse and polygon -- -- negators , commutator @,&& SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' @ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' && sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' !@ sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}' !&& sellipse '<{10d,5d},(280d,-20d),90d>'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' ~ spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !~ spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spoly '{(280d, -9d),(280d,-12d),(279d, -8d)}'; SELECT sellipse '<{10d,5d},(280d,-20d),90d>' !&& spoly '{(280d,-11d),(280d,-12d),(279d, -12d)}'; -- ellipse is point SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' @ sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{0d,0d},(280d,-20d),90d>'; SELECT sellipse '<{0d,0d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{0d,0d},(280d,-20d),90d>' @ spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}'; SELECT sellipse '<{0d,0d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{0d,0d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}'; -- ellipse is circle SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}' @ sellipse '<{2d,2d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{5d,5d},(280d,-20d),90d>'; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{2d,2d},(280d,-20d),90d>' @ spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}'; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{5d,5d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-18d),(279d, -12d)}'; -- ellipse is line SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}' @ sellipse '<{2d,0d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{5d,0d},(280d,-20d),90d>'; SELECT sellipse '<{5d,0d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{2d,0d},(280d,-20d),90d>' @ spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}'; SELECT sellipse '<{5d,0d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{5d,0d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-18d),(279d, -12d)}'; -- ellipse is a real ellipse SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' @ sellipse '<{5d,2d},(280d,-20d),90d>'; SELECT spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}' @ sellipse '<{2d,1d},(280d,-20d),90d>'; SELECT spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' && sellipse '<{5d,2d},(280d,-20d),90d>'; SELECT spoly '{(280d,-11d),(280d,-20d),(279d, -12d)}' && sellipse '<{5d,2d},(280d,-20d),90d>'; SELECT sellipse '<{5d,2d},(280d,-20d),90d>' @ spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{2d,1d},(280d,-20d),90d>' @ spoly '{(280d,-10d),(290d,-30d),(270d, -30d)}'; SELECT sellipse '<{5d,2d},(280d,-20d),90d>' && spoly '{(280d, -9d),(280d, -8d),(279d, -8d)}' ; SELECT sellipse '<{5d,2d},(280d,-20d),90d>' && spoly '{(280d,-11d),(280d,-18d),(279d, -12d)}'; -- create polygon as aggregate SELECT spoly(data.p) FROM ( SELECT spoint '(0,1)' as p UNION ALL SELECT spoint '(1,1)' UNION ALL SELECT '(1,0)' ) AS data ; -- test stored data SELECT count(id) FROM spheretmp5 WHERE id=2 AND area(p) BETWEEN 5.735555 AND 5.735556 ; -- check to create this small polygon without errors SELECT area( spoly '{ (3.09472232280407 , 1.47261266025223), (3.0947320190777 , 1.47261266025223), (3.0947320190777 , 1.47262235652586), (3.09472232280407 , 1.47262235652586) }') >= 0 ; SELECT npoints( spoly '{ (1.51214841579108 , -2.90888208684947e-05), (1.5121581120647 , -2.90888208684947e-05), (1.5121581120647 , -1.93925472462553e-05), (1.51214841579108 , -1.93925472462553e-05) }'); SELECT set_sphere_output( 'RAD' ); SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 1 ); SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 2 ); SELECT spoint( spoly '{(0,0),(1,0),(1,1)}', 3 ); SELECT spoly_as_array( spoly '{(0,0),(1,0),(1,1)}' ); -- spoly is convex SELECT spoly_is_convex(spoly'{(53d 45m 35.0s, 37d 6m 30.0s), (52d 21m 36.0s, 41d 36m 7.0s), (54d 14m 18.0s, 45d 1m 35.0s), (51d 23m 3.0s, 45d 22m 49.0s), (51d 2m 12.0s, 41d 52m 1.0s), (50d 41m 47.0s, 38d 22m 0s) }'); SELECT spoly_is_convex(spoly'{(12d,32d),(34d,12d),(59d,21d),(69d,21d)}'); SELECT spoly_is_convex(spoly'{(12d,32d),(34d,12d),(59d,21d),(34d,40d)}'); SELECT spoly_is_convex(NULL); -- Complex but valid polygon SELECT '{ (3.30474723646012 , 1.08600456205300), (3.30341855309927 , 1.08577960186707), (3.30341054542378 , 1.08578643990271), (3.30297351563319 , 1.08633534556428), (3.30357156120003 , 1.08643683957210), (3.30358891855857 , 1.08643995044436), (3.30360894676365 , 1.08644306147078), (3.30361829343581 , 1.08644430596871), (3.30362630482521 , 1.08644555030213), (3.30364633346451 , 1.08644866102000), (3.30365300940335 , 1.08645052692055), (3.30366102096957 , 1.08645177113937), (3.30367036769496 , 1.08645363721023), (3.30367837934959 , 1.08645488137174), (3.30368906174976 , 1.08645612569695), (3.30370107936906 , 1.08645799183673), (3.30370642025712 , 1.08645985750225), (3.30373179124734 , 1.08646358962156), (3.30374514456618 , 1.08646545561358), (3.30410706158729 , 1.08652886672786), (3.30427803417922 , 1.08655868846497), (3.30429673329093 , 1.08655930694968), (3.30432478121775 , 1.08655930174652), (3.30433278932944 , 1.08655308246640), (3.30446348355532 , 1.08638330933224) }'::spoly; pgsphere-1.5.1/sql/sbox_brin.sql000066400000000000000000000174771461140101500166510ustar00rootroot00000000000000SELECT set_sphere_output_precision(8); CREATE TABLE test_boxes ( b sbox ); COPY test_boxes (b) FROM stdin; ( (0.349065850398866, 0.174532925199433), (0.350065850398866, 0.174632925199433) ) ( (1.59875999207035, 0.771416330759722), (1.5997599920703498, 0.771516330759722) ) ( (1.59876348272885, 0.77141458543047), (1.5997634827288498, 0.77151458543047) ) ( (1.59876697338736, 0.771412840101218), (1.5997669733873598, 0.771512840101218) ) ( (1.59877046404586, 0.771411094771966), (1.5997704640458599, 0.771511094771966) ) ( (1.59877395470437, 0.771409349442714), (1.59977395470437, 0.771509349442714) ) ( (1.59877744536287, 0.771407604113461), (1.59977744536287, 0.771507604113461) ) ( (1.59878093602137, 0.77140585878421), (1.59978093602137, 0.77150585878421) ) ( (1.59878442667988, 0.771404113454958), (1.59978442667988, 0.771504113454958) ) ( (1.59878791733838, 0.771402368125706), (1.59978791733838, 0.7715023681257059) ) ( (1.59879140799689, 0.771400622796454), (1.5997914079968898, 0.771500622796454) ) ( (1.59879489865539, 0.771398877467202), (1.5997948986553898, 0.771498877467202) ) ( (1.59879838931389, 0.77139713213795), (1.5997983893138898, 0.77149713213795) ) ( (1.5988018799724, 0.771395386808698), (1.5998018799723999, 0.771495386808698) ) ( (1.5988053706309, 0.771393641479446), (1.5998053706309, 0.771493641479446) ) ( (1.59880886128941, 0.771391896150194), (1.59980886128941, 0.771491896150194) ) ( (1.59881235194791, 0.771390150820941), (1.59981235194791, 0.771490150820941) ) ( (1.59881584260641, 0.77138840549169), (1.59981584260641, 0.77148840549169) ) ( (1.59881933326492, 0.771386660162438), (1.59981933326492, 0.7714866601624379) ) ( (1.59882282392342, 0.771384914833186), (1.5998228239234198, 0.771484914833186) ) ( (1.59882631458193, 0.771383169503934), (1.5998263145819298, 0.771483169503934) ) ( (1.59882980524043, 0.771381424174682), (1.5998298052404298, 0.771481424174682) ) ( (1.59883329589893, 0.77137967884543), (1.5998332958989299, 0.77147967884543) ) ( (1.59883678655744, 0.771377933516178), (1.5998367865574399, 0.771477933516178) ) ( (1.59884027721594, 0.771376188186926), (1.59984027721594, 0.771476188186926) ) ( (1.59884376787445, 0.771374442857673), (1.59984376787445, 0.771474442857673) ) ( (1.59884725853295, 0.771372697528422), (1.59984725853295, 0.771472697528422) ) ( (1.59885074919145, 0.77137095219917), (1.59985074919145, 0.77147095219917) ) ( (1.59885423984996, 0.771369206869918), (1.5998542398499598, 0.7714692068699179) ) ( (1.59885773050846, 0.771367461540666), (1.5998577305084598, 0.771467461540666) ) ( (1.59886122116697, 0.771365716211414), (1.5998612211669698, 0.771465716211414) ) ( (1.59886471182547, 0.771363970882162), (1.5998647118254699, 0.771463970882162) ) ( (1.59886820248397, 0.77136222555291), (1.5998682024839699, 0.77146222555291) ) ( (1.59887169314248, 0.771360480223658), (1.59987169314248, 0.771460480223658) ) ( (1.59887518380098, 0.771358734894406), (1.59987518380098, 0.771458734894406) ) ( (1.59887867445948, 0.771356989565154), (1.59987867445948, 0.771456989565154) ) ( (1.59888216511799, 0.771355244235902), (1.59988216511799, 0.771455244235902) ) ( (1.59888565577649, 0.77135349890665), (1.5998856557764898, 0.7714534989066499) ) ( (1.598889146435, 0.771351753577398), (1.5998891464349998, 0.771451753577398) ) ( (1.5988926370935, 0.771350008248146), (1.5998926370934998, 0.771450008248146) ) ( (1.59889612775201, 0.771348262918894), (1.5998961277520098, 0.771448262918894) ) ( (1.59889961841051, 0.771346517589642), (1.5998996184105099, 0.771446517589642) ) ( (1.59890310906901, 0.77134477226039), (1.59990310906901, 0.77144477226039) ) ( (1.59890659972752, 0.771343026931138), (1.59990659972752, 0.771443026931138) ) ( (1.59891009038602, 0.771341281601886), (1.59991009038602, 0.771441281601886) ) ( (1.59891358104452, 0.771339536272634), (1.59991358104452, 0.771439536272634) ) ( (1.59891707170303, 0.771337790943382), (1.59991707170303, 0.7714377909433819) ) ( (1.59892056236153, 0.77133604561413), (1.5999205623615298, 0.77143604561413) ) ( (1.59892405302004, 0.771334300284878), (1.5999240530200398, 0.771434300284878) ) ( (1.59892754367854, 0.771332554955626), (1.5999275436785398, 0.771432554955626) ) ( (1.59893103433705, 0.771330809626374), (1.5999310343370499, 0.771430809626374) ) ( (1.59893452499555, 0.771329064297122), (1.59993452499555, 0.771429064297122) ) ( (1.59893801565405, 0.77132731896787), (1.59993801565405, 0.77142731896787) ) ( (1.59894150631256, 0.771325573638618), (1.59994150631256, 0.771425573638618) ) ( (1.59894499697106, 0.771323828309366), (1.59994499697106, 0.771423828309366) ) ( (1.59894848762957, 0.771322082980114), (1.59994848762957, 0.7714220829801139) ) ( (1.59895197828807, 0.771320337650862), (1.5999519782880698, 0.771420337650862) ) ( (1.59895546894657, 0.77131859232161), (1.5999554689465698, 0.77141859232161) ) ( (3.61121537674092, -1.33598496521933), (3.6122153767409197, -1.33588496521933) ) ( (3.61121886739942, -1.33598321989008), (3.6122188673994198, -1.33588321989008) ) ( (3.61122235805792, -1.33598147456083), (3.61222235805792, -1.33588147456083) ) ( (3.61122584871643, -1.33597972923158), (3.61222584871643, -1.33587972923158) ) ( (3.61122933937493, -1.33597798390233), (3.61222933937493, -1.33587798390233) ) ( (3.61123283003344, -1.33597623857307), (3.61223283003344, -1.33587623857307) ) ( (3.61123632069194, -1.33597449324382), (3.61223632069194, -1.33587449324382) ) ( (3.61123981135044, -1.33597274791457), (3.61223981135044, -1.33587274791457) ) ( (3.61124330200895, -1.33597100258532), (3.6122433020089497, -1.33587100258532) ) ( (3.61124679266745, -1.33596925725607), (3.6122467926674497, -1.33586925725607) ) ( (3.61125028332595, -1.33596751192682), (3.6122502833259498, -1.33586751192682) ) ( (3.61125377398446, -1.33596576659756), (3.61225377398446, -1.33586576659756) ) ( (3.61125726464296, -1.33596402126831), (3.61225726464296, -1.33586402126831) ) ( (3.61126075530147, -1.33596227593906), (3.61226075530147, -1.33586227593906) ) ( (3.61126424595997, -1.33596053060981), (3.61226424595997, -1.33586053060981) ) ( (3.61126773661847, -1.33595878528056), (3.61226773661847, -1.33585878528056) ) ( (3.61127122727698, -1.3359570399513), (3.6122712272769797, -1.3358570399513001) ) ( (3.61127471793548, -1.33595529462205), (3.6122747179354797, -1.33585529462205) ) ( (3.61127820859399, -1.3359535492928), (3.61227820859399, -1.3358535492928) ) \. CREATE OR REPLACE FUNCTION qnodes(q text) RETURNS text LANGUAGE 'plpgsql' AS $$ DECLARE exp TEXT; mat TEXT[]; ret TEXT[]; BEGIN FOR exp IN EXECUTE 'EXPLAIN ' || q LOOP --RAISE NOTICE 'EXP: %', exp; mat := regexp_matches(exp, ' *(?:-> *)?(.*Scan on (test_boxes|test_boxes_brin_idx))'); --RAISE NOTICE 'MAT: %', mat; IF mat IS NOT NULL THEN ret := array_append(ret, mat[1]); END IF; --RAISE NOTICE 'RET: %', ret; END LOOP; RETURN array_to_string(ret,','); END; $$; CREATE INDEX test_boxes_brin_idx ON test_boxes USING brin (b); SET enable_indexscan = OFF; SET enable_bitmapscan = OFF; SET enable_seqscan = ON; SELECT 'scan_seq', qnodes('SELECT * FROM test_boxes WHERE b <@ sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_boxes WHERE b <@ sbox '( (10d,10d), (20d,20d) )'; SELECT 'scan_seq', qnodes('SELECT * FROM test_boxes WHERE b && sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_boxes WHERE b && sbox '( (10d,10d), (20d,20d) )'; SET enable_indexscan = OFF; SET enable_bitmapscan = ON; SET enable_seqscan = OFF; SELECT 'scan_idx', qnodes('SELECT * FROM test_boxes WHERE b <@ sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_boxes WHERE b <@ sbox '( (10d,10d), (20d,20d) )'; SELECT 'scan_idx', qnodes('SELECT * FROM test_boxes WHERE b && sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_boxes WHERE b && sbox '( (10d,10d), (20d,20d) )'; ---- cleanup DROP INDEX test_boxes_brin_idx; DROP TABLE test_boxes; DROP FUNCTION qnodes(text); SET enable_indexscan = ON; SET enable_bitmapscan = ON; SET enable_seqscan = ON; pgsphere-1.5.1/sql/selectivity.sql000066400000000000000000000033311461140101500172100ustar00rootroot00000000000000-- test selectivity estimator functions create table spoint10k (star spoint); insert into spoint10k select spoint(i, i*i) from generate_series(1, 10000) g(i); create index on spoint10k using gist (star); analyze spoint10k; -- "explain analyze" wrapper that removes 'cost=...' since it varies across architectures -- (we can't use "costs off" since that also removes the estimated row count) create or replace function explain(query text, do_analyze text default 'true') returns setof text language plpgsql as $$ declare line text; begin for line in execute format('explain (analyze %s, timing off, summary off) %s', do_analyze, query) loop return next regexp_replace(line, 'cost=\S+ ', ''); end loop; return; end; $$; -- <@ operator selectivity select explain('select * from spoint10k where star <@ scircle(spoint(1,1), 1)'); select explain('select * from spoint10k where star <@ scircle(spoint(1,1), .1)'); select explain('select * from spoint10k where star <@ scircle(spoint(1,1), .01)'); select explain('select * from spoint10k where scircle(spoint(1,1), 1) @> star'); select explain('select * from spoint10k where scircle(spoint(1,1), .1) @> star'); select explain('select * from spoint10k where scircle(spoint(1,1), .01) @> star'); select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), 1)'); select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), .1)'); select explain('select * from spoint10k where star !<@ scircle(spoint(1,1), .01)'); select explain('select * from spoint10k where scircle(spoint(1,1), 1) !@> star'); select explain('select * from spoint10k where scircle(spoint(1,1), .1) !@> star'); select explain('select * from spoint10k where scircle(spoint(1,1), .01) !@> star'); pgsphere-1.5.1/sql/spoint_brin.sql000066400000000000000000000111021461140101500171650ustar00rootroot00000000000000CREATE TABLE test_points ( p spoint ); COPY test_points (p) FROM stdin; (0.349065850398866 , 0.174532925199433) (1.59875999207035 , 0.771416330759722) (1.59876348272885 , 0.77141458543047) (1.59876697338736 , 0.771412840101218) (1.59877046404586 , 0.771411094771966) (1.59877395470437 , 0.771409349442714) (1.59877744536287 , 0.771407604113461) (1.59878093602137 , 0.77140585878421) (1.59878442667988 , 0.771404113454958) (1.59878791733838 , 0.771402368125706) (1.59879140799689 , 0.771400622796454) (1.59879489865539 , 0.771398877467202) (1.59879838931389 , 0.77139713213795) (1.5988018799724 , 0.771395386808698) (1.5988053706309 , 0.771393641479446) (1.59880886128941 , 0.771391896150194) (1.59881235194791 , 0.771390150820941) (1.59881584260641 , 0.77138840549169) (1.59881933326492 , 0.771386660162438) (1.59882282392342 , 0.771384914833186) (1.59882631458193 , 0.771383169503934) (1.59882980524043 , 0.771381424174682) (1.59883329589893 , 0.77137967884543) (1.59883678655744 , 0.771377933516178) (1.59884027721594 , 0.771376188186926) (1.59884376787445 , 0.771374442857673) (1.59884725853295 , 0.771372697528422) (1.59885074919145 , 0.77137095219917) (1.59885423984996 , 0.771369206869918) (1.59885773050846 , 0.771367461540666) (1.59886122116697 , 0.771365716211414) (1.59886471182547 , 0.771363970882162) (1.59886820248397 , 0.77136222555291) (1.59887169314248 , 0.771360480223658) (1.59887518380098 , 0.771358734894406) (1.59887867445948 , 0.771356989565154) (1.59888216511799 , 0.771355244235902) (1.59888565577649 , 0.77135349890665) (1.598889146435 , 0.771351753577398) (1.5988926370935 , 0.771350008248146) (1.59889612775201 , 0.771348262918894) (1.59889961841051 , 0.771346517589642) (1.59890310906901 , 0.77134477226039) (1.59890659972752 , 0.771343026931138) (1.59891009038602 , 0.771341281601886) (1.59891358104452 , 0.771339536272634) (1.59891707170303 , 0.771337790943382) (1.59892056236153 , 0.77133604561413) (1.59892405302004 , 0.771334300284878) (1.59892754367854 , 0.771332554955626) (1.59893103433705 , 0.771330809626374) (1.59893452499555 , 0.771329064297122) (1.59893801565405 , 0.77132731896787) (1.59894150631256 , 0.771325573638618) (1.59894499697106 , 0.771323828309366) (1.59894848762957 , 0.771322082980114) (1.59895197828807 , 0.771320337650862) (1.59895546894657 , 0.77131859232161) (3.61121537674092 , -1.33598496521933) (3.61121886739942 , -1.33598321989008) (3.61122235805792 , -1.33598147456083) (3.61122584871643 , -1.33597972923158) (3.61122933937493 , -1.33597798390233) (3.61123283003344 , -1.33597623857307) (3.61123632069194 , -1.33597449324382) (3.61123981135044 , -1.33597274791457) (3.61124330200895 , -1.33597100258532) (3.61124679266745 , -1.33596925725607) (3.61125028332595 , -1.33596751192682) (3.61125377398446 , -1.33596576659756) (3.61125726464296 , -1.33596402126831) (3.61126075530147 , -1.33596227593906) (3.61126424595997 , -1.33596053060981) (3.61126773661847 , -1.33595878528056) (3.61127122727698 , -1.3359570399513) (3.61127471793548 , -1.33595529462205) (3.61127820859399 , -1.3359535492928) \. CREATE OR REPLACE FUNCTION qnodes(q text) RETURNS text LANGUAGE 'plpgsql' AS $$ DECLARE exp TEXT; mat TEXT[]; ret TEXT[]; BEGIN FOR exp IN EXECUTE 'EXPLAIN ' || q LOOP --RAISE NOTICE 'EXP: %', exp; mat := regexp_matches(exp, ' *(?:-> *)?(.*Scan on (test_points|brin_spoint))'); --RAISE NOTICE 'MAT: %', mat; IF mat IS NOT NULL THEN ret := array_append(ret, mat[1]); END IF; --RAISE NOTICE 'RET: %', ret; END LOOP; RETURN array_to_string(ret,','); END; $$; CREATE INDEX brin_spoint ON test_points USING brin (p) WITH (pages_per_range = 16); set enable_indexscan = off; set enable_bitmapscan = off; set enable_seqscan = on; SELECT 'scan_seq', qnodes('SELECT * FROM test_points WHERE p <@ sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_points WHERE p <@ sbox '( (10d,10d), (20d,20d) )'; SELECT 'scan_seq', qnodes('SELECT * FROM test_points WHERE p && sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_points WHERE p && sbox '( (10d,10d), (20d,20d) )'; set enable_indexscan = off; set enable_bitmapscan = on; set enable_seqscan = off; SELECT 'scan_idx', qnodes('SELECT * FROM test_points WHERE p <@ sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_points WHERE p <@ sbox '( (10d,10d), (20d,20d) )'; SELECT 'scan_idx', qnodes('SELECT * FROM test_points WHERE p && sbox ''( (10d,10d), (20d,20d) )'''); SELECT * FROM test_points WHERE p && sbox '( (10d,10d), (20d,20d) )'; -- cleanup DROP INDEX brin_spoint; DROP TABLE test_points; DROP FUNCTION qnodes(text); set enable_indexscan = on; set enable_bitmapscan = on; set enable_seqscan = on; pgsphere-1.5.1/sql/tables.sql000066400000000000000000000024431461140101500161210ustar00rootroot00000000000000-- Create tables SET client_min_messages = 'warning'; CREATE TABLE spheretmp1 (p spoint); \copy spheretmp1 from 'data/test_spherepoint.data' \copy spheretmp1 from 'data/test_spherepoint.data' \copy spheretmp1 from 'data/test_spherepoint.data' \copy spheretmp1 from 'data/test_spherepoint.data' CREATE TABLE spheretmp2 (c scircle); \copy spheretmp2 from 'data/test_spherecircle.data' \copy spheretmp2 from 'data/test_spherecircle.data' \copy spheretmp2 from 'data/test_spherecircle.data' \copy spheretmp2 from 'data/test_spherecircle.data' CREATE TABLE spheretmp3 (b sbox); \copy spheretmp3 from 'data/test_spherebox.data' CREATE TABLE spheretmp4 AS SELECT sline ( p , p - strans '-15d,-15d,-15d,ZXZ' ) AS l FROM spheretmp1; CREATE TABLE spheretmp5 (id int PRIMARY KEY , p spoly ); \copy spheretmp5 from 'data/test_spherepolygon.data' CREATE TABLE spheretmp6 (id int PRIMARY KEY , p spath ); \copy spheretmp6 from 'data/test_spherepath.data' -- Aggregate data from tables SELECT set_sphere_output_precision(12); CREATE TABLE spheretmp7 (p spoint); \copy spheretmp7 from 'data/test_spherepolygon_aggregate.data' SELECT spoly(p) FROM spheretmp7; CREATE TABLE spheretmp8 (p spoint); \copy spheretmp8 from 'data/test_spherepoint.data' SELECT spath(p) FROM spheretmp8 WHERE p IS NOT NULL; pgsphere-1.5.1/sql/version.sql000066400000000000000000000000771461140101500163350ustar00rootroot00000000000000-- Check current pgsphere version SELECT pg_sphere_version(); pgsphere-1.5.1/src/000077500000000000000000000000001461140101500141135ustar00rootroot00000000000000pgsphere-1.5.1/src/box.c000066400000000000000000001030611461140101500150500ustar00rootroot00000000000000#include "box.h" PG_FUNCTION_INFO_V1(spherebox_in); PG_FUNCTION_INFO_V1(spherebox_in_from_points); PG_FUNCTION_INFO_V1(spherebox_sw); PG_FUNCTION_INFO_V1(spherebox_ne); PG_FUNCTION_INFO_V1(spherebox_se); PG_FUNCTION_INFO_V1(spherebox_nw); PG_FUNCTION_INFO_V1(spherebox_area); PG_FUNCTION_INFO_V1(spherebox_circ); PG_FUNCTION_INFO_V1(spherebox_equal); PG_FUNCTION_INFO_V1(spherebox_equal_neg); PG_FUNCTION_INFO_V1(spherebox_cont_point); PG_FUNCTION_INFO_V1(spherebox_cont_point_neg); PG_FUNCTION_INFO_V1(spherebox_cont_point_com); PG_FUNCTION_INFO_V1(spherebox_cont_point_com_neg); PG_FUNCTION_INFO_V1(spherebox_cont_circle); PG_FUNCTION_INFO_V1(spherebox_cont_circle_neg); PG_FUNCTION_INFO_V1(spherebox_cont_circle_com); PG_FUNCTION_INFO_V1(spherebox_cont_circle_com_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_box); PG_FUNCTION_INFO_V1(spherecircle_cont_box_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_box_com); PG_FUNCTION_INFO_V1(spherecircle_cont_box_com_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_circle); PG_FUNCTION_INFO_V1(spherebox_overlap_circle_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_circle_com); PG_FUNCTION_INFO_V1(spherebox_overlap_circle_com_neg); PG_FUNCTION_INFO_V1(spherebox_cont_line); PG_FUNCTION_INFO_V1(spherebox_cont_line_neg); PG_FUNCTION_INFO_V1(spherebox_cont_line_com); PG_FUNCTION_INFO_V1(spherebox_cont_line_com_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_line); PG_FUNCTION_INFO_V1(spherebox_overlap_line_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_line_com); PG_FUNCTION_INFO_V1(spherebox_overlap_line_com_neg); PG_FUNCTION_INFO_V1(spherebox_cont_path); PG_FUNCTION_INFO_V1(spherebox_cont_path_neg); PG_FUNCTION_INFO_V1(spherebox_cont_eq_path_com); PG_FUNCTION_INFO_V1(spherebox_cont_path_com); PG_FUNCTION_INFO_V1(spherebox_cont_path_com_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_path); PG_FUNCTION_INFO_V1(spherebox_overlap_path_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_path_com); PG_FUNCTION_INFO_V1(spherebox_overlap_path_com_neg); PG_FUNCTION_INFO_V1(spherebox_cont_poly); PG_FUNCTION_INFO_V1(spherebox_cont_poly_neg); PG_FUNCTION_INFO_V1(spherebox_cont_poly_com); PG_FUNCTION_INFO_V1(spherebox_cont_poly_com_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_box); PG_FUNCTION_INFO_V1(spherepoly_cont_box_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_box_com); PG_FUNCTION_INFO_V1(spherepoly_cont_box_com_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_poly); PG_FUNCTION_INFO_V1(spherebox_overlap_poly_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_poly_com); PG_FUNCTION_INFO_V1(spherebox_overlap_poly_com_neg); PG_FUNCTION_INFO_V1(spherebox_cont_ellipse); PG_FUNCTION_INFO_V1(spherebox_cont_ellipse_neg); PG_FUNCTION_INFO_V1(spherebox_cont_ellipse_com); PG_FUNCTION_INFO_V1(spherebox_cont_ellipse_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_box); PG_FUNCTION_INFO_V1(sphereellipse_cont_box_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_box_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_box_com_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_ellipse); PG_FUNCTION_INFO_V1(spherebox_overlap_ellipse_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_ellipse_com); PG_FUNCTION_INFO_V1(spherebox_overlap_ellipse_com_neg); PG_FUNCTION_INFO_V1(spherebox_cont_box); PG_FUNCTION_INFO_V1(spherebox_cont_box_neg); PG_FUNCTION_INFO_V1(spherebox_cont_box_com); PG_FUNCTION_INFO_V1(spherebox_cont_box_com_neg); PG_FUNCTION_INFO_V1(spherebox_overlap_box); PG_FUNCTION_INFO_V1(spherebox_overlap_box_neg); /* * Checks the box: if the latitude of a south-west corner is larger * than that of a north-east corner, swap both positions. */ static void sbox_check(SBOX *box) { if (FPgt(box->sw.lat, box->ne.lat)) { /* swap */ SPoint sp; memcpy((void *) &sp, (void *) &box->sw, sizeof(SPoint)); memcpy((void *) &box->sw, (void *) &box->ne, sizeof(SPoint)); memcpy((void *) &box->ne, (void *) &sp, sizeof(SPoint)); } if (FPeq(box->sw.lng, box->ne.lng) && FPne(box->sw.lat, box->ne.lat)) { box->sw.lng = 0.0; box->ne.lng = PID; } } /* * Puts the 'center' of a box b' into a point 'c' and returns it. */ static void sbox_center(SPoint *c, const SBOX *b) { c->lat = (b->ne.lat + b->sw.lat) / 2.0; c->lng = (b->ne.lng + b->sw.lng) / 2.0; if (FPgt(b->sw.lng, b->ne.lng)) c->lng += PI; } /* * Relationship between a circle and a box as PGS_BOX_CIRCLE_REL int8 value. */ static int8 sbox_circle_pos(const SCIRCLE *sc, const SBOX *sb) { if (FPlt((sc->center.lat + sc->radius), sb->sw.lat)) { return PGS_BOX_CIRCLE_AVOID; } else if (FPgt((sc->center.lat - sc->radius), sb->ne.lat)) { return PGS_BOX_CIRCLE_AVOID; } else if (FPzero(sb->sw.lng) && FPeq(sb->ne.lng, PID)) { /* full latitude range */ const SPoint tmpn = {0.0, PIH}; const SPoint tmps = {0.0, -PIH}; if (spoint_eq(&sb->ne, &tmpn) && FPge(sc->center.lat - sc->radius, sb->sw.lat)) { if (spoint_eq(&sc->center, &tmpn) && FPeq(sc->radius, (PIH - sb->sw.lat))) { return PGS_BOX_CIRCLE_EQUAL; } else { return PGS_BOX_CONT_CIRCLE; } } else if (spoint_eq(&sb->sw, &tmps) && FPle(sc->center.lat + sc->radius, sb->ne.lat)) { if (spoint_eq(&sc->center, &tmps) && FPeq(sc->radius, (PIH + sb->ne.lat))) { return PGS_BOX_CIRCLE_EQUAL; } else { return PGS_BOX_CONT_CIRCLE; } } else if (FPle((sc->center.lat + sc->radius), sb->ne.lat) && FPge((sc->center.lat - sc->radius), sb->sw.lat) ) { return PGS_BOX_CONT_CIRCLE; } else { return PGS_BOX_CIRCLE_OVER; } } else { bool lat_b_cont_c = ((sc->center.lat + sc->radius) <= sb->ne.lat) && ((sc->center.lat - sc->radius) >= sb->sw.lat); bool bcc = sbox_cont_point(sb, &sc->center); bool ccb = false; int8 pw, pe; SLine bw, be; /* west and east boundary */ SPoint bc; SPoint p1, p2; /* center */ sbox_center(&bc, sb); ccb = spoint_in_circle(&bc, sc); p1.lat = sb->sw.lat; p2.lat = sb->ne.lat; /* west */ p1.lng = p2.lng = sb->sw.lng; sline_from_points(&bw, &p1, &p2); /* east */ p1.lng = p2.lng = sb->ne.lng; sline_from_points(&be, &p1, &p2); /* check E/W boundaries */ pw = sphereline_circle_pos(&bw, sc); pe = sphereline_circle_pos(&be, sc); if (pw == PGS_CIRCLE_LINE_AVOID && pe == PGS_CIRCLE_LINE_AVOID) { if (bcc && lat_b_cont_c) { return PGS_BOX_CONT_CIRCLE; } return PGS_BOX_CIRCLE_AVOID; } if (pw == PGS_CIRCLE_CONT_LINE && pe == PGS_CIRCLE_CONT_LINE) { if (ccb) { return PGS_CIRCLE_CONT_BOX; } return PGS_BOX_CIRCLE_OVER; } if (bcc && lat_b_cont_c) { bool touw = false, toue = false; if (pw == PGS_CIRCLE_LINE_OVER) { touw = sline_circle_touch(&bw, sc); } if (pw == PGS_CIRCLE_LINE_OVER) { toue = sline_circle_touch(&be, sc); } if (touw && toue) { return PGS_BOX_CONT_CIRCLE; } else if (touw && pe == PGS_CIRCLE_LINE_AVOID) { return PGS_BOX_CONT_CIRCLE; } if (toue && pw == PGS_CIRCLE_LINE_AVOID) { return PGS_BOX_CONT_CIRCLE; } return PGS_BOX_CIRCLE_OVER; } return PGS_BOX_CIRCLE_OVER; } return PGS_BOX_CIRCLE_AVOID; } /* * Relationship between a line and a box as PGS_BOX_LINE_REL int8 value. */ static int8 sbox_line_pos(const SLine *sl, const SBOX *sb) { SPoint p1, p2, pbg, ped; SPoint lc[4]; int8 pw, pe, lcn, lcs; SLine bw, be; float8 minlat, maxlat; sline_begin(&pbg, sl); sline_end(&ped, sl); if (FPzero(sl->length)) { if (sbox_cont_point(sb, &pbg)) { return PGS_BOX_CONT_LINE; } else { return PGS_BOX_LINE_AVOID; } } sline_min_max_lat(sl, &minlat, &maxlat); if (FPgt(minlat, sb->ne.lat)) return PGS_BOX_LINE_AVOID; if (FPlt(maxlat, sb->sw.lat)) return PGS_BOX_LINE_AVOID; if (FPzero(sb->sw.lng) && FPeq(sb->ne.lng, PID)) { /* full latitude range */ if (FPle(sb->sw.lat, minlat) && FPle(maxlat, sb->ne.lat)) { return PGS_BOX_CONT_LINE; } return PGS_BOX_LINE_OVER; } /* create east/west boundaries */ p1.lat = sb->sw.lat; p2.lat = sb->ne.lat; /* west */ p1.lng = p2.lng = sb->sw.lng; sline_from_points(&bw, &p1, &p2); /* east */ p1.lng = p2.lng = sb->ne.lng; sline_from_points(&be, &p1, &p2); /* special case: east/west boundaries are connected */ if ((FPeq(sb->ne.lat, PIH) || FPeq(sb->sw.lat, -PIH)) && FPeq(fabs(sb->sw.lng - sb->ne.lng), PI)) { if (FPeq(sb->ne.lat, PIH)) { /* west */ p1.lat = sb->sw.lat; p2.lat = sb->ne.lat; p1.lng = p2.lng = sb->sw.lng; sline_from_points(&bw, &p1, &p2); bw.length *= 2; } if (FPeq(sb->ne.lat, PIH)) { /* west */ p1.lat = sb->ne.lat; p2.lat = sb->sw.lat; p1.lng = p2.lng = sb->ne.lng; sline_from_points(&be, &p1, &p2); be.length *= 2; } } pw = sline_sline_pos(&bw, sl); pe = sline_sline_pos(&be, sl); if (pw == PGS_LINE_EQUAL || pe == PGS_LINE_EQUAL) { return PGS_BOX_CONT_LINE; } if (pw == PGS_LINE_CONT_LINE || pe == PGS_LINE_CONT_LINE) { return PGS_BOX_CONT_LINE; } if (pw == PGS_LINE_CROSS || pe == PGS_LINE_CROSS) { if (pw == PGS_LINE_CROSS) { if (!spoint_at_sline(&pbg, &bw) && !spoint_at_sline(&ped, &bw)) { return PGS_BOX_LINE_OVER; } } if (pe == PGS_LINE_CROSS) { if (!spoint_at_sline(&pbg, &be) && !spoint_at_sline(&ped, &be)) { return PGS_BOX_LINE_OVER; } } } if (pw == PGS_LINE_OVER || pe == PGS_LINE_OVER) { return PGS_BOX_LINE_OVER; } /* check latitude */ lcn = sphereline_latitude_points(sl, sb->ne.lat, &lc[0], &lc[1]); if (lcn < 0) lcn = 0; lcs = sphereline_latitude_points(sl, sb->sw.lat, &lc[lcn], &lc[lcn + 1]); if (lcs < 0) lcs = 0; lcn += lcs; pw = sbox_cont_point(sb, &pbg); pe = sbox_cont_point(sb, &ped); if (pw && pe) { SPoint sp; int i; for (i = 0; i < lcn; i++) { if (sbox_cont_point(sb, &lc[i]) && (!spoint_eq(&pbg, &lc[i]) && !spoint_eq(&ped, &lc[i]))) { return PGS_BOX_LINE_OVER; } } /* check center */ sline_center(&sp, sl); if (sbox_cont_point(sb, &sp)) { return PGS_BOX_CONT_LINE; } else { return PGS_BOX_LINE_OVER; } } else if (!pw && !pe) { int i; for (i = 0; i < lcn; i++) { if (sbox_cont_point(sb, &lc[i])) { return PGS_BOX_LINE_OVER; } } return PGS_BOX_LINE_AVOID; } return PGS_BOX_LINE_OVER; } /* * Returns the relationship between a box and a path as * PGS_BOX_PATH_REL int8 value. */ static int8 sbox_path_pos(const SPATH *path, const SBOX *box) { int8 pos; int32 i; SLine sl; int32 n; const int8 sb_in = (1 << PGS_BOX_CONT_LINE); const int8 sb_ov = (1 << PGS_BOX_LINE_OVER); const int8 sb_os = (1 << PGS_BOX_LINE_AVOID); n = path->npts - 1; pos = 0; if (spoint_eq(&box->sw, &box->ne)) { if (spath_cont_point(path, &box->sw)) { return PGS_BOX_PATH_OVER; } else { return PGS_BOX_PATH_AVOID; } } for (i = 0; i < n; i++) { spath_segment(&sl, path, i); pos |= (1 << sbox_line_pos(&sl, box)); if (pos & sb_ov) { return PGS_BOX_PATH_OVER; } } if (pos == sb_in) { /* all lines inside box */ /* box contains path */ return PGS_BOX_CONT_PATH; } else if (pos == sb_os) { /* all lines outside box */ /* box outside path */ return PGS_BOX_PATH_AVOID; } /* box and polygon overlap */ return PGS_BOX_PATH_OVER; } /* * Returns the relationship between a polygon and a box as * PGS_BOX_POLY_REL int8 value. */ static int8 sbox_poly_pos(const SPOLY *poly, const SBOX *box) { int8 pos = 0; int32 i; SLine sl; SPoint sp; bool pcp; const int8 sb_in = (1 << PGS_BOX_CONT_LINE); const int8 sb_ov = (1 << PGS_BOX_LINE_OVER); const int8 sb_os = (1 << PGS_BOX_LINE_AVOID); sbox_center(&sp, box); pcp = spoly_contains_point(poly, &sp); if (spoint_eq(&box->sw, &box->ne)) { if (pcp) { return PGS_POLY_CONT_BOX; } else { return PGS_BOX_POLY_AVOID; } } for (i = 0; i < poly->npts; i++) { spoly_segment(&sl, poly, i); pos |= (1 << sbox_line_pos(&sl, box)); if (((pos & sb_in) && (pos & sb_os)) || (pos & sb_ov)) { /* overlaps */ return PGS_BOX_POLY_OVER; } } if ((pos & sb_in) == pos) { /* all lines inside box; box contains polygon */ return PGS_BOX_CONT_POLY; } else if ((pos & sb_os) == pos) { /* all lines outside box */ if (pcp) { /* polygon contains box */ return PGS_POLY_CONT_BOX; } else { /* box outside polygon */ return PGS_BOX_POLY_AVOID; } } /* box and polygon overlap */ return PGS_BOX_POLY_OVER; } /* * Relationship between an ellipse and a box as PGS_BOX_ELLIPSE_REL int8 value. */ static int8 sbox_ellipse_pos(const SELLIPSE *ell, const SBOX *box) { SCIRCLE sco, sci; SPoint ec; int8 pw, pe, po, pi; SLine bw, be; if (spoint_eq(&box->sw, &box->ne)) { bool scp = sellipse_cont_point(ell, &box->sw); if (scp) { return PGS_ELLIPSE_CONT_BOX; } else { return PGS_BOX_ELLIPSE_AVOID; } } /* init circles */ sco.center.lng = sci.center.lng = 0.0; if (box->sw.lat >= 0.0 && box->ne.lat >= 0.0) { sco.center.lat = sci.center.lat = PIH; sco.radius = PIH - box->sw.lat; sci.radius = PIH - box->ne.lat; if (FPlt(sco.radius, PIH)) sco.radius += EPSILON; } else if (box->sw.lat <= 0.0 && box->ne.lat <= 0.0) { sco.center.lat = sci.center.lat = -PIH; sco.radius = PIH + box->sw.lat; sci.radius = PIH + box->ne.lat; if (FPlt(sco.radius, PIH)) sco.radius += EPSILON; } else { sco.center.lat = -PIH; /* south */ sci.center.lat = PIH; /* north */ sco.radius = PIH + box->sw.lat; sci.radius = PIH - box->ne.lat; if (FPgt(sco.radius, 0.0)) sco.radius -= EPSILON; } if (FPgt(sci.radius, 0.0)) sci.radius -= EPSILON; po = sellipse_circle_pos(ell, &sco); pi = sellipse_circle_pos(ell, &sci); /* check by latitude */ if (pi == PGS_CIRCLE_CONT_ELLIPSE || pi == PGS_ELLIPSE_CIRCLE_EQUAL) { return PGS_BOX_ELLIPSE_AVOID; } if (FPeq(sco.center.lat, sci.center.lat)) { if (po == PGS_ELLIPSE_CIRCLE_AVOID) { return PGS_BOX_ELLIPSE_AVOID; } if (FPzero(box->sw.lng) && FPeq(box->ne.lng, PID)) { /* full latitude range */ if ((po == PGS_CIRCLE_CONT_ELLIPSE || po == PGS_ELLIPSE_CIRCLE_EQUAL) && pi == PGS_ELLIPSE_CIRCLE_AVOID) { return PGS_BOX_CONT_ELLIPSE; } else { return PGS_BOX_ELLIPSE_OVER; } } } else { /* equator modus */ if (po == PGS_CIRCLE_CONT_ELLIPSE || po == PGS_ELLIPSE_CIRCLE_EQUAL) { return PGS_BOX_ELLIPSE_AVOID; } if (FPzero(box->sw.lng) && FPeq(box->ne.lng, PID)) { /* full latitude range */ if (po == PGS_ELLIPSE_CIRCLE_AVOID && pi == PGS_ELLIPSE_CIRCLE_AVOID) { return PGS_BOX_CONT_ELLIPSE; } else { return PGS_BOX_ELLIPSE_OVER; } } } sellipse_center(&ec, ell); if (FPgt(box->sw.lng, 0.0)) { sline_meridian(&bw, box->sw.lng - EPSILON); } else { sline_meridian(&bw, box->sw.lng); } sline_meridian(&be, box->ne.lng + EPSILON); pw = sellipse_line_pos(ell, &bw); pe = sellipse_line_pos(ell, &be); /* check meridians */ if (pw == PGS_ELLIPSE_LINE_AVOID && pe == PGS_ELLIPSE_LINE_AVOID) { /* center is between west and east meridians */ if ((FPgt(box->sw.lng, box->ne.lng) && (FPle(ec.lng, box->ne.lng) || FPgt(ec.lng, box->sw.lng))) || (FPle(box->sw.lng, box->ne.lng) && (FPge(ec.lng, box->sw.lng) && FPle(ec.lng, box->ne.lng)))) { if (FPeq(sco.center.lat, sci.center.lat)) { if ((po == PGS_CIRCLE_CONT_ELLIPSE || po == PGS_ELLIPSE_CIRCLE_EQUAL) && pi == PGS_ELLIPSE_CIRCLE_AVOID) { return PGS_BOX_CONT_ELLIPSE; } else { return PGS_BOX_ELLIPSE_OVER; } } else { /* equator modus */ if (po == PGS_ELLIPSE_CIRCLE_AVOID && pi == PGS_ELLIPSE_CIRCLE_AVOID) { return PGS_BOX_CONT_ELLIPSE; } else { return PGS_BOX_ELLIPSE_OVER; } } } return PGS_BOX_ELLIPSE_AVOID; } else { SPoint p1, p2; /* create east/west boundaries */ p1.lat = box->sw.lat; p2.lat = box->ne.lat; /* west */ p1.lng = p2.lng = box->sw.lng; sline_from_points(&bw, &p1, &p2); /* east */ p1.lng = p2.lng = box->ne.lng; sline_from_points(&be, &p1, &p2); pw = sellipse_line_pos(ell, &bw); pe = sellipse_line_pos(ell, &be); sbox_center(&ec, box); /* ellipse contains box */ if (pw == PGS_ELLIPSE_CONT_LINE && pe == PGS_ELLIPSE_CONT_LINE && sellipse_cont_point(ell, &ec)) { return PGS_ELLIPSE_CONT_BOX; } } return PGS_BOX_LINE_OVER; } /* * Relationship between two boxes as PGS_BOX_REL int8 value. */ static int8 sbox_box_pos(const SBOX *b1, const SBOX *b2, bool recheck) { SPoint p1, p2, bc; int8 pw, pe; SLine bw, be; bool scp; if (spoint_eq(&b2->sw, &b2->ne)) { scp = sbox_cont_point(b1, &b2->sw); if (scp) { return PGS_BOX_CONT; } else { return PGS_BOX_AVOID; } } if (FPzero(b1->sw.lng) && FPeq(b1->ne.lng, PID)) { /* full latitude range */ if (FPge(b2->sw.lat, b1->sw.lat) && FPle(b2->ne.lat, b1->ne.lat)) { return PGS_BOX_CONT; } else if (FPgt(b2->sw.lat, b1->ne.lat) || FPlt(b2->ne.lat, b1->sw.lat)) { return PGS_BOX_AVOID; } return PGS_BOX_OVER; } /* create east/west boundaries from b2 */ p1.lat = b2->sw.lat; p2.lat = b2->ne.lat; /* west */ p1.lng = p2.lng = b2->sw.lng; sline_from_points(&bw, &p1, &p2); /* east */ p1.lng = p2.lng = b2->ne.lng; sline_from_points(&be, &p1, &p2); pe = sbox_line_pos(&be, b1); pw = sbox_line_pos(&bw, b1); sbox_center(&bc, b2); scp = sbox_cont_point(b1, &bc); if (scp && pe == PGS_BOX_CONT_LINE && pw == PGS_BOX_CONT_LINE) { return PGS_BOX_CONT; } if (pe > PGS_BOX_LINE_AVOID || pw > PGS_BOX_LINE_AVOID) { return PGS_BOX_OVER; } if (!recheck) { pe = sbox_box_pos(b2, b1, true); if (pe == PGS_BOX_CONT) { return PGS_BOX_OVER; } } return PGS_BOX_AVOID; } bool sbox_eq(SBOX *b1, SBOX *b2) { return (spoint_eq(&b1->sw, &b2->sw) && spoint_eq(&b1->ne, &b2->ne)); } bool sbox_cont_point(const SBOX *b, const SPoint *p) { if ((FPeq(p->lat, b->ne.lat) && FPeq(p->lat, PIH)) || (FPeq(p->lat, b->sw.lat) && FPeq(p->lat, -PIH))) { return true; } if (FPlt(p->lat, b->sw.lat) || FPgt(p->lat, b->ne.lat)) { return false; } if (FPgt(b->sw.lng, b->ne.lng)) { if (FPlt(p->lng, b->sw.lng) && FPgt(p->lng, b->ne.lng)) return false; } else { if (FPlt(p->lng, b->sw.lng) || FPgt(p->lng, b->ne.lng)) return false; } return true; } Datum spherebox_in(PG_FUNCTION_ARGS) { SBOX *box = (SBOX *) palloc(sizeof(SBOX)); char *c = PG_GETARG_CSTRING(0); void sphere_yyparse(void); init_buffer(c); sphere_yyparse(); if (!get_box(&box->sw.lng, &box->sw.lat, &box->ne.lng, &box->ne.lat)) { reset_buffer(); pfree(box); elog(ERROR, "spherebox_in: wrong data type"); PG_RETURN_NULL(); } spoint_check(&box->sw); spoint_check(&box->ne); sbox_check(box); reset_buffer(); PG_RETURN_POINTER(box); } Datum spherebox_in_from_points(PG_FUNCTION_ARGS) { SBOX *box = (SBOX *) palloc(sizeof(SBOX)); SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); SPoint *p2 = (SPoint *) PG_GETARG_POINTER(1); memcpy((void *) &box->sw, (void *) p1, sizeof(SPoint)); memcpy((void *) &box->ne, (void *) p2, sizeof(SPoint)); sbox_check(box); PG_RETURN_POINTER(box); } Datum spherebox_sw(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) palloc(sizeof(SPoint)); SBOX *box = (SBOX *) PG_GETARG_POINTER(0); memcpy((void *) p, (void *) &box->sw, sizeof(SPoint)); PG_RETURN_POINTER(p); } Datum spherebox_ne(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) palloc(sizeof(SPoint)); SBOX *box = (SBOX *) PG_GETARG_POINTER(0); memcpy((void *) p, (void *) &box->ne, sizeof(SPoint)); PG_RETURN_POINTER(p); } Datum spherebox_se(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) palloc(sizeof(SPoint)); SBOX *box = (SBOX *) PG_GETARG_POINTER(0); p->lng = box->ne.lng; p->lat = box->sw.lat; PG_RETURN_POINTER(p); } Datum spherebox_nw(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) palloc(sizeof(SPoint)); SBOX *box = (SBOX *) PG_GETARG_POINTER(0); p->lng = box->sw.lng; p->lat = box->ne.lat; PG_RETURN_POINTER(p); } Datum spherebox_area(PG_FUNCTION_ARGS) { SBOX *box = (SBOX *) PG_GETARG_POINTER(0); float8 a; if (FPgt(box->sw.lng, box->ne.lng)) { a = PID + box->ne.lng - box->sw.lng; } else { a = box->ne.lng - box->sw.lng; } a *= (sin(box->ne.lat) - sin(box->sw.lat)); PG_RETURN_FLOAT8(a); } Datum spherebox_circ(PG_FUNCTION_ARGS) { SBOX *box = (SBOX *) PG_GETARG_POINTER(0); float8 a; if (FPgt(box->sw.lng, box->ne.lng)) { a = PID + box->ne.lng - box->sw.lng; } else { a = box->ne.lng - box->sw.lng; } a = (a * cos(box->ne.lat) + a * cos(box->sw.lat)); a += 2 * (box->ne.lat - box->sw.lat); PG_RETURN_FLOAT8(a); } Datum spherebox_equal(PG_FUNCTION_ARGS) { SBOX *b1 = (SBOX *) PG_GETARG_POINTER(0); SBOX *b2 = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_eq(b1, b2)); } Datum spherebox_equal_neg(PG_FUNCTION_ARGS) { SBOX *b1 = (SBOX *) PG_GETARG_POINTER(0); SBOX *b2 = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!sbox_eq(b1, b2)); } Datum spherebox_cont_point(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_cont_point(b, p)); } Datum spherebox_cont_point_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!sbox_cont_point(b, p)); } Datum spherebox_cont_point_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_cont_point(b, p)); } Datum spherebox_cont_point_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!sbox_cont_point(b, p)); } Datum spherebox_cont_circle(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos == PGS_BOX_CONT_CIRCLE || pos == PGS_BOX_CIRCLE_EQUAL); } Datum spherebox_cont_circle_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos != PGS_BOX_CONT_CIRCLE && pos != PGS_BOX_CIRCLE_EQUAL); } Datum spherebox_cont_circle_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos == PGS_BOX_CONT_CIRCLE || pos == PGS_BOX_CIRCLE_EQUAL); } Datum spherebox_cont_circle_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos != PGS_BOX_CONT_CIRCLE && pos != PGS_BOX_CIRCLE_EQUAL); } Datum spherecircle_cont_box(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SBOX *b = (SBOX *) PG_GETARG_POINTER(1); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos == PGS_CIRCLE_CONT_BOX || pos == PGS_BOX_CIRCLE_EQUAL); } Datum spherecircle_cont_box_neg(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SBOX *b = (SBOX *) PG_GETARG_POINTER(1); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos != PGS_CIRCLE_CONT_BOX && pos != PGS_BOX_CIRCLE_EQUAL); } Datum spherecircle_cont_box_com(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); SBOX *b = (SBOX *) PG_GETARG_POINTER(0); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos == PGS_CIRCLE_CONT_BOX || pos == PGS_BOX_CIRCLE_EQUAL); } Datum spherecircle_cont_box_com_neg(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); SBOX *b = (SBOX *) PG_GETARG_POINTER(0); int pos = sbox_circle_pos(c, b); PG_RETURN_BOOL(pos != PGS_CIRCLE_CONT_BOX && pos != PGS_BOX_CIRCLE_EQUAL); } Datum spherebox_overlap_circle(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_circle_pos(c, b) > PGS_BOX_CIRCLE_AVOID); } Datum spherebox_overlap_circle_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_circle_pos(c, b) > PGS_BOX_CIRCLE_AVOID)); } Datum spherebox_overlap_circle_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_circle_pos(c, b) > PGS_BOX_CIRCLE_AVOID); } Datum spherebox_overlap_circle_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_circle_pos(c, b) > PGS_BOX_CIRCLE_AVOID)); } Datum spherebox_cont_line(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_line_pos(l, b) == PGS_BOX_CONT_LINE); } Datum spherebox_cont_line_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_line_pos(l, b) == PGS_BOX_CONT_LINE)); } Datum spherebox_cont_line_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_line_pos(l, b) == PGS_BOX_CONT_LINE); } Datum spherebox_cont_line_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_line_pos(l, b) == PGS_BOX_CONT_LINE)); } Datum spherebox_overlap_line(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_line_pos(l, b) > PGS_BOX_LINE_AVOID); } Datum spherebox_overlap_line_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_line_pos(l, b) > PGS_BOX_LINE_AVOID)); } Datum spherebox_overlap_line_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_line_pos(l, b) > PGS_BOX_LINE_AVOID); } Datum spherebox_overlap_line_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_line_pos(l, b) > PGS_BOX_LINE_AVOID)); } Datum spherebox_cont_path(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPATH *p = PG_GETARG_SPATH(1); PG_RETURN_BOOL(sbox_path_pos(p, b) == PGS_BOX_CONT_PATH); } Datum spherebox_cont_path_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPATH *p = PG_GETARG_SPATH(1); PG_RETURN_BOOL(!(sbox_path_pos(p, b) == PGS_BOX_CONT_PATH)); } Datum spherebox_cont_path_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPATH *p = PG_GETARG_SPATH(0); PG_RETURN_BOOL(sbox_path_pos(p, b) == PGS_BOX_CONT_PATH); } Datum spherebox_cont_path_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPATH *p = PG_GETARG_SPATH(0); PG_RETURN_BOOL(!(sbox_path_pos(p, b) == PGS_BOX_CONT_PATH)); } Datum spherebox_overlap_path(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPATH *p = PG_GETARG_SPATH(1); PG_RETURN_BOOL(sbox_path_pos(p, b) > PGS_BOX_PATH_AVOID); } Datum spherebox_overlap_path_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPATH *p = PG_GETARG_SPATH(1); PG_RETURN_BOOL(!(sbox_path_pos(p, b) > PGS_BOX_PATH_AVOID)); } Datum spherebox_overlap_path_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPATH *p = PG_GETARG_SPATH(0); PG_RETURN_BOOL(sbox_path_pos(p, b) > PGS_BOX_PATH_AVOID); } Datum spherebox_overlap_path_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPATH *p = PG_GETARG_SPATH(0); PG_RETURN_BOOL(!(sbox_path_pos(p, b) > PGS_BOX_PATH_AVOID)); } Datum spherebox_cont_poly(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPOLY *p = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(sbox_poly_pos(p, b) == PGS_BOX_CONT_POLY); } Datum spherebox_cont_poly_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPOLY *p = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(!(sbox_poly_pos(p, b) == PGS_BOX_CONT_POLY)); } Datum spherebox_cont_poly_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPOLY *p = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(sbox_poly_pos(p, b) == PGS_BOX_CONT_POLY); } Datum spherebox_cont_poly_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPOLY *p = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(!(sbox_poly_pos(p, b) == PGS_BOX_CONT_POLY)); } Datum spherepoly_cont_box(PG_FUNCTION_ARGS) { SPOLY *p = PG_GETARG_SPOLY(0); SBOX *b = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_poly_pos(p, b) == PGS_POLY_CONT_BOX); } Datum spherepoly_cont_box_neg(PG_FUNCTION_ARGS) { SPOLY *p = PG_GETARG_SPOLY(0); SBOX *b = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_poly_pos(p, b) == PGS_POLY_CONT_BOX)); } Datum spherepoly_cont_box_com(PG_FUNCTION_ARGS) { SPOLY *p = PG_GETARG_SPOLY(1); SBOX *b = (SBOX *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_poly_pos(p, b) == PGS_POLY_CONT_BOX); } Datum spherepoly_cont_box_com_neg(PG_FUNCTION_ARGS) { SPOLY *p = PG_GETARG_SPOLY(1); SBOX *b = (SBOX *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_poly_pos(p, b) == PGS_POLY_CONT_BOX)); } Datum spherebox_overlap_poly(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPOLY *p = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(sbox_poly_pos(p, b) > PGS_BOX_POLY_AVOID); } Datum spherebox_overlap_poly_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SPOLY *p = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(!(sbox_poly_pos(p, b) > PGS_BOX_POLY_AVOID)); } Datum spherebox_overlap_poly_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPOLY *p = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(sbox_poly_pos(p, b) > PGS_BOX_POLY_AVOID); } Datum spherebox_overlap_poly_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SPOLY *p = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(!(sbox_poly_pos(p, b) > PGS_BOX_POLY_AVOID)); } Datum spherebox_cont_ellipse(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_ellipse_pos(e, b) == PGS_BOX_CONT_ELLIPSE); } Datum spherebox_cont_ellipse_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_ellipse_pos(e, b) == PGS_BOX_CONT_ELLIPSE)); } Datum spherebox_cont_ellipse_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_ellipse_pos(e, b) == PGS_BOX_CONT_ELLIPSE); } Datum spherebox_cont_ellipse_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_ellipse_pos(e, b) == PGS_BOX_CONT_ELLIPSE)); } Datum sphereellipse_cont_box(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SBOX *b = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_ellipse_pos(e, b) == PGS_ELLIPSE_CONT_BOX); } Datum sphereellipse_cont_box_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SBOX *b = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_ellipse_pos(e, b) == PGS_ELLIPSE_CONT_BOX)); } Datum sphereellipse_cont_box_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SBOX *b = (SBOX *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_ellipse_pos(e, b) == PGS_ELLIPSE_CONT_BOX); } Datum sphereellipse_cont_box_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SBOX *b = (SBOX *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_ellipse_pos(e, b) == PGS_ELLIPSE_CONT_BOX)); } Datum spherebox_overlap_ellipse(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_ellipse_pos(e, b) > PGS_BOX_ELLIPSE_AVOID); } Datum spherebox_overlap_ellipse_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(0); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_ellipse_pos(e, b) > PGS_BOX_ELLIPSE_AVOID)); } Datum spherebox_overlap_ellipse_com(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_ellipse_pos(e, b) > PGS_BOX_ELLIPSE_AVOID); } Datum spherebox_overlap_ellipse_com_neg(PG_FUNCTION_ARGS) { SBOX *b = (SBOX *) PG_GETARG_POINTER(1); SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_ellipse_pos(e, b) > PGS_BOX_ELLIPSE_AVOID)); } Datum spherebox_cont_box(PG_FUNCTION_ARGS) { SBOX *box1 = (SBOX *) PG_GETARG_POINTER(0); SBOX *box2 = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_box_pos(box1, box2, false) == PGS_BOX_CONT); } Datum spherebox_cont_box_neg(PG_FUNCTION_ARGS) { SBOX *box1 = (SBOX *) PG_GETARG_POINTER(0); SBOX *box2 = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!(sbox_box_pos(box1, box2, false) == PGS_BOX_CONT)); } Datum spherebox_cont_box_com(PG_FUNCTION_ARGS) { SBOX *box1 = (SBOX *) PG_GETARG_POINTER(1); SBOX *box2 = (SBOX *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sbox_box_pos(box1, box2, false) == PGS_BOX_CONT); } Datum spherebox_cont_box_com_neg(PG_FUNCTION_ARGS) { SBOX *box1 = (SBOX *) PG_GETARG_POINTER(1); SBOX *box2 = (SBOX *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!(sbox_box_pos(box1, box2, false) == PGS_BOX_CONT)); } Datum spherebox_overlap_box(PG_FUNCTION_ARGS) { SBOX *box1 = (SBOX *) PG_GETARG_POINTER(0); SBOX *box2 = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_box_pos(box1, box2, false) > PGS_BOX_AVOID); } Datum spherebox_overlap_box_neg(PG_FUNCTION_ARGS) { SBOX *box1 = (SBOX *) PG_GETARG_POINTER(0); SBOX *box2 = (SBOX *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sbox_box_pos(box1, box2, false) == PGS_BOX_AVOID); } pgsphere-1.5.1/src/box.h000066400000000000000000000235641461140101500150660ustar00rootroot00000000000000#ifndef __PGS_BOX_H__ #define __PGS_BOX_H__ #include "path.h" /* Box datatype declarations */ /* * Spherical box structure. The definition of a spherical box * using two spherical points: south-west and north-east. */ typedef struct { SPoint sw; /* South-west value of a box */ SPoint ne; /* North-east value of a box */ } SBOX; /* PGS_RELATIONSHIPS */ /* PGS_BOX_CIRCLE_REL Box and circle */ #define PGS_BOX_CIRCLE_AVOID 0 /* box avoids circle */ #define PGS_BOX_CONT_CIRCLE 1 /* box contains circle */ #define PGS_CIRCLE_CONT_BOX 2 /* circle contains box */ #define PGS_BOX_CIRCLE_EQUAL 3 /* circle equals box */ #define PGS_BOX_CIRCLE_OVER 4 /* circle and box overlap */ /* PGS_BOX_LINE_REL Box and line */ #define PGS_BOX_LINE_AVOID 0 /* box avoids line */ #define PGS_BOX_CONT_LINE 1 /* box contains line */ #define PGS_BOX_LINE_OVER 2 /* box and line overlap */ /* PGS_BOX_PATH_REL Box and path */ #define PGS_BOX_PATH_AVOID 0 /* box avoids path */ #define PGS_BOX_CONT_PATH 1 /* box contains path */ #define PGS_BOX_PATH_OVER 2 /* box and path overlap */ /* PGS_BOX_POLY_REL Box and polygon */ #define PGS_BOX_POLY_AVOID 0 /* box avoids polygon */ #define PGS_BOX_CONT_POLY 1 /* box contains polygon */ #define PGS_POLY_CONT_BOX 2 /* polygon contains box */ #define PGS_BOX_POLY_OVER 3 /* polygon and box overlap */ /* PGS_BOX_ELLIPSE_REL Box and ellipse */ #define PGS_BOX_ELLIPSE_AVOID 0 /* box avoids ellipse */ #define PGS_BOX_CONT_ELLIPSE 1 /* box contains ellipse */ #define PGS_ELLIPSE_CONT_BOX 2 /* ellipse contains box */ #define PGS_BOX_ELLIPSE_OVER 3 /* ellipse and box overlap */ /* PGS_BOX_REL Box and box */ #define PGS_BOX_AVOID 0 /* box avoids other box */ #define PGS_BOX_CONT 1 /* box contains other box */ #define PGS_BOX_OVER 2 /* boxes overlap */ /* * Checks whether two boxes are equal. */ extern bool sbox_eq(SBOX *b1, SBOX *b2); /* * Checks whether a point is contained by a box. */ extern bool sbox_cont_point(const SBOX *b, const SPoint *p); /* * Input function of a box. */ extern Datum spherebox_in(PG_FUNCTION_ARGS); /* * Input function of a box from two points. The first point * is the south-west position, the second the north-east position. */ extern Datum spherebox_in_from_points(PG_FUNCTION_ARGS); /* * Returns the south-west edge of a box. */ extern Datum spherebox_sw(PG_FUNCTION_ARGS); /* * Returns the north-east edge of a box. */ extern Datum spherebox_ne(PG_FUNCTION_ARGS); /* * Returns the south-east edge of a box. */ extern Datum spherebox_se(PG_FUNCTION_ARGS); /* * Returns the north-west edge of a box. */ extern Datum spherebox_nw(PG_FUNCTION_ARGS); /* * Returns the area of a box. */ extern Datum spherebox_area(PG_FUNCTION_ARGS); /* * Returns the circumference of a box. */ extern Datum spherebox_circ(PG_FUNCTION_ARGS); /* * Checks whether two boxes are equal. */ extern Datum spherebox_equal(PG_FUNCTION_ARGS); /* * Checks whether two boxes are not equal. */ extern Datum spherebox_equal_neg(PG_FUNCTION_ARGS); /* * Checks whether a point is contained by a box. */ extern Datum spherebox_cont_point(PG_FUNCTION_ARGS); /* * Checks whether a point isn't contained by a box. */ extern Datum spherebox_cont_point_neg(PG_FUNCTION_ARGS); /* * Checks whether a point is contained by a box. */ extern Datum spherebox_cont_point_com(PG_FUNCTION_ARGS); /* * Checks whether a point isn't contained by a box. */ extern Datum spherebox_cont_point_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a circle. */ extern Datum spherebox_cont_circle(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a circle. */ extern Datum spherebox_cont_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a circle. */ extern Datum spherebox_cont_circle_com(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a circle. */ extern Datum spherebox_cont_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a box. */ extern Datum spherecircle_cont_box(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a box. */ extern Datum spherecircle_cont_box_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a box. */ extern Datum spherecircle_cont_box_com(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a box. */ extern Datum spherecircle_cont_box_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and a box overlap. */ extern Datum spherebox_overlap_circle(PG_FUNCTION_ARGS); /* * Checks whether a circle and a box don't overlap. */ extern Datum spherebox_overlap_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and a box overlap. */ extern Datum spherebox_overlap_circle_com(PG_FUNCTION_ARGS); /* * Checks whether a circle and a box don't overlap. */ extern Datum spherebox_overlap_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a line. */ extern Datum spherebox_cont_line(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a line. */ extern Datum spherebox_cont_line_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a line. */ extern Datum spherebox_cont_line_com(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a line. */ extern Datum spherebox_cont_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box and a line overlap. */ extern Datum spherebox_overlap_line(PG_FUNCTION_ARGS); /* * Checks whether a box and a line don't overlap. */ extern Datum spherebox_overlap_line_neg(PG_FUNCTION_ARGS); /* * Checks whether a box and a line overlap. */ extern Datum spherebox_overlap_line_com(PG_FUNCTION_ARGS); /* * Checks whether a box and a line don't overlap. */ extern Datum spherebox_overlap_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a path. */ extern Datum spherebox_cont_path(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a path. */ extern Datum spherebox_cont_path_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a path. */ extern Datum spherebox_cont_path_com(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a path. */ extern Datum spherebox_cont_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box and a path overlap. */ extern Datum spherebox_overlap_path(PG_FUNCTION_ARGS); /* * Checks whether a box and a path don't overlap. */ extern Datum spherebox_overlap_path_neg(PG_FUNCTION_ARGS); /* * Checks whether a box and a path overlap. */ extern Datum spherebox_overlap_path_com(PG_FUNCTION_ARGS); /* * Checks whether a box and a path don't overlap. */ extern Datum spherebox_overlap_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a polygon. */ extern Datum spherebox_cont_poly(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a polygon. */ extern Datum spherebox_cont_poly_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains a polygon. */ extern Datum spherebox_cont_poly_com(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain a polygon. */ extern Datum spherebox_cont_poly_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a box. */ extern Datum spherepoly_cont_box(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a box. */ extern Datum spherepoly_cont_box_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a box. */ extern Datum spherepoly_cont_box_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a box. */ extern Datum spherepoly_cont_box_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a box overlap. */ extern Datum spherebox_overlap_poly(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a box don't overlap. */ extern Datum spherebox_overlap_poly_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a box overlap. */ extern Datum spherebox_overlap_poly_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a box don't overlap. */ extern Datum spherebox_overlap_poly_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains an ellipse. */ extern Datum spherebox_cont_ellipse(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain an ellipse. */ extern Datum spherebox_cont_ellipse_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains an ellipse. */ extern Datum spherebox_cont_ellipse_com(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain an ellipse. */ extern Datum spherebox_cont_ellipse_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a box. */ extern Datum sphereellipse_cont_box(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a box. */ extern Datum sphereellipse_cont_box_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a box. */ extern Datum sphereellipse_cont_box_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a box. */ extern Datum sphereellipse_cont_box_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a box overlap. */ extern Datum spherebox_overlap_ellipse(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a box don't overlap. */ extern Datum spherebox_overlap_ellipse_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a box overlap. */ extern Datum spherebox_overlap_ellipse_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a box don't overlap. */ extern Datum spherebox_overlap_ellipse_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains another box. */ extern Datum spherebox_cont_box(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain another box. */ extern Datum spherebox_cont_box_neg(PG_FUNCTION_ARGS); /* * Checks whether a box contains another box. */ extern Datum spherebox_cont_box_com(PG_FUNCTION_ARGS); /* * Checks whether a box doesn't contain another box. */ extern Datum spherebox_cont_box_com_neg(PG_FUNCTION_ARGS); /* * Checks whether two boxes overlap. */ extern Datum spherebox_overlap_box(PG_FUNCTION_ARGS); /* * Checks whether two boxes don't overlap. */ extern Datum spherebox_overlap_box_neg(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/brin.c000066400000000000000000000172771461140101500152270ustar00rootroot00000000000000/* * BRIN SUPPORT for spheric objects: * * The stored type is the spherekey, as for GiST support, * so include some already defined stuffs. We have to define * then all the cross-type functions needed by the OpFamilies. */ #include "brin.h" #include "gist.h" #include /* * Functions needed to build a BRIN index */ PG_FUNCTION_INFO_V1(spoint_brin_inclusion_add_value); PG_FUNCTION_INFO_V1(sbox_brin_inclusion_add_value); /* * Functions needed to define supported operators */ PG_FUNCTION_INFO_V1(spoint_overlaps_spherekey); PG_FUNCTION_INFO_V1(spoint_contains_spherekey); PG_FUNCTION_INFO_V1(spoint_iscontained_spherekey); PG_FUNCTION_INFO_V1(sbox_overlaps_spherekey); PG_FUNCTION_INFO_V1(sbox_contains_spherekey); PG_FUNCTION_INFO_V1(sbox_iscontained_spherekey); PG_FUNCTION_INFO_V1(spherekey_overlaps_spherekey); PG_FUNCTION_INFO_V1(spherekey_contains_spherekey); PG_FUNCTION_INFO_V1(spherekey_iscontained_spherekey); PG_FUNCTION_INFO_V1(spoint_overlaps_sbox); PG_FUNCTION_INFO_V1(sbox_iscontained_spoint); Datum spoint_brin_inclusion_add_value(PG_FUNCTION_ARGS) { BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1); SPoint *newval = (SPoint *) DatumGetPointer(PG_GETARG_DATUM(2)); bool isnull = PG_GETARG_BOOL(3); int32 spointkey[6]; int32 *skey = (int32 *) column->bv_values[INCLUSION_UNION]; /* * If the new value is null, we record that we saw it if it's the first * one; otherwise, there's nothing to do. */ if (isnull) { if (column->bv_hasnulls) PG_RETURN_BOOL(false); column->bv_hasnulls = true; PG_RETURN_BOOL(true); } spherepoint_gen_key(spointkey, newval); /* * If spherekey pointer is NULL, we consider the spoint entry as 'empty'. * * The OpClass support empty entries: we need to set the "contains empty" * flag in the element (unless already set). */ /* if (spointkey == NULL) { if (!DatumGetBool(column->bv_values[INCLUSION_CONTAINS_EMPTY])) { column->bv_values[INCLUSION_CONTAINS_EMPTY] = BoolGetDatum(true); PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } */ /* if the recorded value is null, we just need to store the spherekey */ if (column->bv_allnulls) { column->bv_values[INCLUSION_UNION] = datumCopy((Datum) spointkey, false, (sizeof(int32) * 6)); column->bv_values[INCLUSION_UNMERGEABLE] = BoolGetDatum(false); column->bv_values[INCLUSION_CONTAINS_EMPTY] = BoolGetDatum(false); column->bv_allnulls = false; PG_RETURN_BOOL(true); } /* * Check if the stored spherekey already contains the key of the new value */ if (spherekey_interleave(skey, spointkey) == SCKEY_IN) { PG_RETURN_BOOL(false); } /* * Otherwise, we need to enlarge it to contains the current spoint */ spherekey_union_two(skey, spointkey); PG_RETURN_BOOL(true); } Datum sbox_brin_inclusion_add_value(PG_FUNCTION_ARGS) { BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1); SBOX *newval = (SBOX *) DatumGetPointer(PG_GETARG_DATUM(2)); bool isnull = PG_GETARG_BOOL(3); int32 sboxkey[6]; int32 *skey = (int32 *) column->bv_values[INCLUSION_UNION]; /* * If the new value is null, we record that we saw it if it's the first * one; otherwise, there's nothing to do. */ if (isnull) { if (column->bv_hasnulls) PG_RETURN_BOOL(false); column->bv_hasnulls = true; PG_RETURN_BOOL(true); } spherebox_gen_key(sboxkey, newval); /* * If spherekey pointer is NULL, we consider the spoint entry as 'empty'. * * The OpClass support empty entries: we need to set the "contains empty" * flag in the element (unless already set). */ /* if (sboxkey == NULL) { if (!DatumGetBool(column->bv_values[INCLUSION_CONTAINS_EMPTY])) { column->bv_values[INCLUSION_CONTAINS_EMPTY] = BoolGetDatum(true); PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } */ /* if the recorded value is null, we just need to store the spherekey */ if (column->bv_allnulls) { column->bv_values[INCLUSION_UNION] = datumCopy((Datum) sboxkey, false, (sizeof(int32) * 6)); column->bv_values[INCLUSION_UNMERGEABLE] = BoolGetDatum(false); column->bv_values[INCLUSION_CONTAINS_EMPTY] = BoolGetDatum(false); column->bv_allnulls = false; PG_RETURN_BOOL(true); } /* * Check if the stored spherekey already contains the key of the new value */ if (spherekey_interleave(skey, sboxkey) == SCKEY_IN) { PG_RETURN_BOOL(false); } /* * Otherwise, we need to enlarge it to contains the current spoint */ spherekey_union_two(skey, sboxkey); PG_RETURN_BOOL(true); } /* */ /* Define operators procedures below */ /* */ Datum spoint_overlaps_spherekey(PG_FUNCTION_ARGS) { int32 k1[6]; SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); spherepoint_gen_key(k1, p1); if (spherekey_interleave(k1, k2) == SCKEY_OVERLAP) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum spoint_contains_spherekey(PG_FUNCTION_ARGS) { int32 k1[6]; SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); spherepoint_gen_key(k1, p1); if (spherekey_interleave(k1, k2) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum spoint_iscontained_spherekey(PG_FUNCTION_ARGS) { int32 k1[6]; SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); spherepoint_gen_key(k1, p1); if (spherekey_interleave(k2, k1) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum sbox_overlaps_spherekey(PG_FUNCTION_ARGS) { int32 k1[6]; SBOX *p1 = (SBOX *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); spherebox_gen_key(k1, p1); if (spherekey_interleave(k1, k2) == SCKEY_OVERLAP) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum sbox_contains_spherekey(PG_FUNCTION_ARGS) { int32 k1[6]; SBOX *p1 = (SBOX *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); spherebox_gen_key(k1, p1); if (spherekey_interleave(k1, k2) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum sbox_iscontained_spherekey(PG_FUNCTION_ARGS) { int32 k1[6]; SBOX *p1 = (SBOX *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); spherebox_gen_key(k1, p1); if (spherekey_interleave(k2, k1) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum spherekey_overlaps_spherekey(PG_FUNCTION_ARGS) { int32 *k1 = (int32 *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); if (spherekey_interleave(k1, k2) == SCKEY_OVERLAP) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum spherekey_contains_spherekey(PG_FUNCTION_ARGS) { int32 *k1 = (int32 *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); if (spherekey_interleave(k1, k2) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum spherekey_iscontained_spherekey(PG_FUNCTION_ARGS) { int32 *k1 = (int32 *) PG_GETARG_POINTER(0); int32 *k2 = (int32 *) PG_GETARG_POINTER(1); if (spherekey_interleave(k2, k1) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum spoint_overlaps_sbox(PG_FUNCTION_ARGS) { int32 k1[6]; SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); int32 k2[6]; SBOX *p2 = (SBOX *) PG_GETARG_POINTER(1); spherepoint_gen_key(k1, p1); spherebox_gen_key(k2, p2); if (spherekey_interleave(k1, k2) == SCKEY_OVERLAP) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } Datum sbox_iscontained_spoint(PG_FUNCTION_ARGS) { int32 k1[6]; SBOX *p1 = (SBOX *) PG_GETARG_POINTER(0); int32 k2[6]; SPoint *p2 = (SPoint *) PG_GETARG_POINTER(1); spherebox_gen_key(k1, p1); spherepoint_gen_key(k2, p2); if (spherekey_interleave(k1, k2) == SCKEY_IN) { PG_RETURN_BOOL(true); } PG_RETURN_BOOL(false); } pgsphere-1.5.1/src/brin.h000066400000000000000000000021111461140101500152110ustar00rootroot00000000000000#ifndef __PGS_BRIN_H__ #define __PGS_BRIN_H__ /* * BRIN declarations */ #include "postgres.h" #include "fmgr.h" #include "key.h" #include #include #include #include #include "access/brin_tuple.h" #include "utils/datum.h" #define INCLUSION_UNION 0 #define INCLUSION_UNMERGEABLE 1 #define INCLUSION_CONTAINS_EMPTY 2 Datum spoint_brin_inclusion_add_value(PG_FUNCTION_ARGS); Datum sbox_brin_inclusion_add_value(PG_FUNCTION_ARGS); Datum spoint_overlaps_spherekey(PG_FUNCTION_ARGS); Datum spoint_contains_spherekey(PG_FUNCTION_ARGS); Datum spoint_iscontained_spherekey(PG_FUNCTION_ARGS); Datum sbox_overlaps_spherekey(PG_FUNCTION_ARGS); Datum sbox_contains_spherekey(PG_FUNCTION_ARGS); Datum sbox_iscontained_spherekey(PG_FUNCTION_ARGS); Datum spherekey_overlaps_spherekey(PG_FUNCTION_ARGS); Datum spherekey_contains_spherekey(PG_FUNCTION_ARGS); Datum spherekey_iscontained_spherekey(PG_FUNCTION_ARGS); Datum spoint_overlaps_sbox(PG_FUNCTION_ARGS); Datum sbox_iscontained_spoint(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/circle.c000066400000000000000000000216071461140101500155260ustar00rootroot00000000000000#include "circle.h" #include "pgs_util.h" /* Circle functions */ PG_FUNCTION_INFO_V1(spherecircle_in); PG_FUNCTION_INFO_V1(spherecircle_equal); PG_FUNCTION_INFO_V1(spherecircle_equal_neg); PG_FUNCTION_INFO_V1(spherecircle_distance); PG_FUNCTION_INFO_V1(spherecircle_point_distance); PG_FUNCTION_INFO_V1(spherecircle_point_distance_com); PG_FUNCTION_INFO_V1(spherepoint_in_circle); PG_FUNCTION_INFO_V1(spherepoint_in_circle_neg); PG_FUNCTION_INFO_V1(spherepoint_in_circle_com); PG_FUNCTION_INFO_V1(spherepoint_in_circle_com_neg); PG_FUNCTION_INFO_V1(spherecircle_in_circle); PG_FUNCTION_INFO_V1(spherecircle_in_circle_neg); PG_FUNCTION_INFO_V1(spherecircle_in_circle_com); PG_FUNCTION_INFO_V1(spherecircle_in_circle_com_neg); PG_FUNCTION_INFO_V1(spherecircle_overlap); PG_FUNCTION_INFO_V1(spherecircle_overlap_neg); PG_FUNCTION_INFO_V1(spherecircle_center); PG_FUNCTION_INFO_V1(spherecircle_radius); PG_FUNCTION_INFO_V1(spherepoint_to_circle); PG_FUNCTION_INFO_V1(spherecircle_by_center); PG_FUNCTION_INFO_V1(spherecircle_by_center_deg); PG_FUNCTION_INFO_V1(spherecircle_area); PG_FUNCTION_INFO_V1(spherecircle_circ); PG_FUNCTION_INFO_V1(spheretrans_circle); PG_FUNCTION_INFO_V1(spheretrans_circle_inverse); bool scircle_eq(const SCIRCLE *c1, const SCIRCLE *c2) { return (spoint_eq(&c1->center, &c2->center) && FPeq(c1->radius, c2->radius)); } bool spoint_in_circle(const SPoint *p, const SCIRCLE *c) { float8 dist = spoint_dist(p, &c->center); if (FPle(dist, c->radius)) { return true; } return false; } void euler_scircle_trans(SCIRCLE *out, const SCIRCLE *in, const SEuler *se) { euler_spoint_trans(&out->center, &in->center, se); out->radius = in->radius; } Datum spherecircle_in(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) palloc(sizeof(SCIRCLE)); char *s = PG_GETARG_CSTRING(0); double lng, lat, radius; init_buffer(s); sphere_yyparse(); if (get_circle(&lng, &lat, &radius)) { c->center.lng = lng; c->center.lat = lat; c->radius = radius; reset_buffer(); /* * It's important to allow circles with radius 90 degrees! */ if (FPgt(c->radius, PIH)) { pfree(c); c = NULL; elog(ERROR, "spherecircle_in: radius must not be greater than 90 degrees or less than 0"); } else if (FPeq(c->radius, PIH)) { /* set "exact" 90 degrees */ c->radius = PIH; } spoint_check(&c->center); } else { reset_buffer(); pfree(c); c = NULL; elog(ERROR, "spherecircle_in: parse error"); } PG_RETURN_POINTER(c); } Datum spherecircle_equal(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(scircle_eq(c1, c2)); } Datum spherecircle_equal_neg(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!scircle_eq(c1, c2)); } Datum spherecircle_distance(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c1->center, &c2->center); dist -= (c1->radius + c2->radius); if (dist < 0.0) { dist = 0.0; } PG_RETURN_FLOAT8(dist); } Datum spherecircle_point_distance(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c->center, p); dist = dist - c->radius; if (dist < 0.0) { dist = 0.0; } PG_RETURN_FLOAT8(dist); } Datum spherecircle_point_distance_com(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c->center, p); dist = dist - c->radius; if (dist < 0.0) { dist = 0.0; } PG_RETURN_FLOAT8(dist); } Datum spherepoint_in_circle(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(spoint_in_circle(p, c)); } Datum spherepoint_in_circle_neg(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!spoint_in_circle(p, c)); } Datum spherepoint_in_circle_com(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(spoint_in_circle(p, c)); } Datum spherepoint_in_circle_com_neg(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!spoint_in_circle(p, c)); } Datum spherecircle_in_circle(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c1->center, &c2->center); if (scircle_eq(c1, c2)) { PG_RETURN_BOOL(true); } else if (FPle((dist + c1->radius), c2->radius)) { PG_RETURN_BOOL(true); } else { PG_RETURN_BOOL(false); } } Datum spherecircle_in_circle_neg(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c1->center, &c2->center); if (scircle_eq(c1, c2)) { PG_RETURN_BOOL(false); } else if (FPgt((dist + c1->radius), c2->radius)) { PG_RETURN_BOOL(true); } else { PG_RETURN_BOOL(false); } } Datum spherecircle_in_circle_com(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(1); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(0); float8 dist = spoint_dist(&c1->center, &c2->center); if (scircle_eq(c1, c2)) { PG_RETURN_BOOL(true); } else if (FPle((dist + c1->radius), c2->radius)) { PG_RETURN_BOOL(true); } else { PG_RETURN_BOOL(false); } } Datum spherecircle_in_circle_com_neg(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(1); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(0); float8 dist = spoint_dist(&c1->center, &c2->center); if (scircle_eq(c1, c2)) { PG_RETURN_BOOL(false); } else if (FPgt((dist + c1->radius), c2->radius)) { PG_RETURN_BOOL(true); } else { PG_RETURN_BOOL(false); } } Datum spherecircle_overlap(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c1->center, &c2->center); if (scircle_eq(c1, c2)) { PG_RETURN_BOOL(true); } else if (FPlt((c1->radius + c2->radius), dist)) { PG_RETURN_BOOL(false); } else { PG_RETURN_BOOL(true); } } Datum spherecircle_overlap_neg(PG_FUNCTION_ARGS) { SCIRCLE *c1 = (SCIRCLE *) PG_GETARG_POINTER(0); SCIRCLE *c2 = (SCIRCLE *) PG_GETARG_POINTER(1); float8 dist = spoint_dist(&c1->center, &c2->center); if (scircle_eq(c1, c2)) { PG_RETURN_BOOL(false); } else if (FPge((c1->radius + c2->radius), dist)) { PG_RETURN_BOOL(false); } else { PG_RETURN_BOOL(true); } } Datum spherecircle_center(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) palloc(sizeof(SPoint)); memcpy((void *) p, (void *) &c->center, sizeof(SPoint)); PG_RETURN_POINTER(p); } Datum spherecircle_radius(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(c->radius); } Datum spherepoint_to_circle(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) palloc(sizeof(SCIRCLE)); memcpy((void *) &c->center, (void *) p, sizeof(SPoint)); c->radius = 0; PG_RETURN_POINTER(c); } Datum spherecircle_by_center(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); float8 rad = PG_GETARG_FLOAT8(1); SCIRCLE *c; if (FPgt(rad, PIH) || FPlt(rad, 0.0)) { elog(ERROR, "radius must not be greater than 90 degrees or less than 0"); PG_RETURN_NULL(); } c = (SCIRCLE *) palloc(sizeof(SCIRCLE)); memcpy((void *) &c->center, (void *) p, sizeof(SPoint)); c->radius = rad; PG_RETURN_POINTER(c); } Datum spherecircle_by_center_deg(PG_FUNCTION_ARGS) { Datum res; SPoint *p = (SPoint *) PG_GETARG_POINTER(0); const float8 rad = deg_to_rad(PG_GETARG_FLOAT8(1)); res = DirectFunctionCall2( spherecircle_by_center, PointerGetDatum(p), Float8GetDatum(rad) ); PG_RETURN_DATUM(res); } Datum spherecircle_area(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(spherecircle_area_float(c->radius)); } Datum spherecircle_circ(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(PID * (sin(c->radius))); } Datum spheretrans_circle(PG_FUNCTION_ARGS) { SCIRCLE *sc = (SCIRCLE *) PG_GETARG_POINTER(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SCIRCLE *out = (SCIRCLE *) palloc(sizeof(SCIRCLE)); euler_scircle_trans(out, sc, se); PG_RETURN_POINTER(out); } Datum spheretrans_circle_inverse(PG_FUNCTION_ARGS) { Datum sc = PG_GETARG_DATUM(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SEuler tmp; Datum ret; spheretrans_inverse(&tmp, se); ret = DirectFunctionCall2(spheretrans_circle, sc, PointerGetDatum(&tmp)); PG_RETURN_DATUM(ret); } pgsphere-1.5.1/src/circle.h000066400000000000000000000071121461140101500155260ustar00rootroot00000000000000#ifndef __PGS_CIRCLE_H__ #define __PGS_CIRCLE_H__ #include "euler.h" /* Spherical circle declarations */ /* * Spherical circle data structure: center and radius. */ typedef struct { SPoint center; /* the center of circle */ float8 radius; /* the circle radius in radians */ } SCIRCLE; /* * Checks whether two circles are equal. */ extern bool scircle_eq(const SCIRCLE *c1, const SCIRCLE *c2); /* * Checks whether a circle contains a point. */ extern bool spoint_in_circle(const SPoint *p, const SCIRCLE *c); /* * Transforms a circle using an Euler transformation. */ extern void euler_scircle_trans(SCIRCLE *out, const SCIRCLE *in, const SEuler *se); /* * Takes the input and stores it as a spherical circle. */ extern Datum spherecircle_in(PG_FUNCTION_ARGS); /* * Checks whether two circles are equal. */ extern Datum spherecircle_equal(PG_FUNCTION_ARGS); /* * Checks whether two circles are not equal. */ extern Datum spherecircle_equal_neg(PG_FUNCTION_ARGS); /* * Calculate the distance of two circles. If they overlap, this function * returns 0.0. */ extern Datum spherecircle_distance(PG_FUNCTION_ARGS); /* * Calculate the distance of a circle and a point. If a circle contains a point, * this function returns 0.0. */ extern Datum spherecircle_point_distance(PG_FUNCTION_ARGS); /* * Calculate the distance of a point and a circle. If a circle contains a point, * this function returns 0.0. */ extern Datum spherecircle_point_distance_com(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a point. */ extern Datum spherepoint_in_circle(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a point. */ extern Datum spherepoint_in_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a point. */ extern Datum spherepoint_in_circle_com(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a point. */ extern Datum spherepoint_in_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle is contained by other circle. */ extern Datum spherecircle_in_circle(PG_FUNCTION_ARGS); /* * Checks whether a circle is not contained by other circle. */ extern Datum spherecircle_in_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains other circle. */ extern Datum spherecircle_in_circle_com(PG_FUNCTION_ARGS); /* * Checks whether circle does not contain other circle. */ extern Datum spherecircle_in_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether two circles overlap. */ extern Datum spherecircle_overlap(PG_FUNCTION_ARGS); /* * Checks whether two circles overlap. */ extern Datum spherecircle_overlap_neg(PG_FUNCTION_ARGS); /* * Returns the center of a circle. */ extern Datum spherecircle_center(PG_FUNCTION_ARGS); /* * Returns the radius of a circle. */ extern Datum spherecircle_radius(PG_FUNCTION_ARGS); /* * Converts a point to a circle. */ extern Datum spherepoint_to_circle(PG_FUNCTION_ARGS); /* * Creates a circle from center and radius. */ extern Datum spherecircle_by_center(PG_FUNCTION_ARGS); /* * Creates a circle from center and radius(in degrees). */ extern Datum spherecircle_by_center_deg(PG_FUNCTION_ARGS); /* * Calculates the area of a circle in square radians. */ extern Datum spherecircle_area(PG_FUNCTION_ARGS); /* * Calculates the circumference of a circle in radians. */ extern Datum spherecircle_circ(PG_FUNCTION_ARGS); /* * Transforms a circle using an Euler transformation. */ extern Datum spheretrans_circle(PG_FUNCTION_ARGS); /* * Inverse transformation of a circle using an Euler transformation. */ extern Datum spheretrans_circle_inverse(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/circle_sel.c000066400000000000000000000135661461140101500163760ustar00rootroot00000000000000#include "circle.h" #include #include /* Circle selectivity functions */ PG_FUNCTION_INFO_V1(spherepoint_in_circle_sel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_joinsel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_neg_sel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_neg_joinsel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_com_sel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_com_joinsel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_com_neg_sel); PG_FUNCTION_INFO_V1(spherepoint_in_circle_com_neg_joinsel); /* * Common code for spherepoint_in_circle_sel() */ static double spherepoint_in_circle_sel_funcexpr(Node *other) { FuncExpr *ofunc = (FuncExpr *)other; char *func_name = get_func_name(ofunc->funcid); Const *arg2; double radius; double selec; /* * Safety checks: are we called on a function called scircle that takes a * const double as 2nd argument? */ if (strcmp(func_name, "scircle") != 0) { ereport(DEBUG1, (errmsg("<@ selectivity called on function that is not scircle"))); return DEFAULT_SCIRCLE_SEL; } if (list_length(ofunc->args) != 2) { ereport(DEBUG1, (errmsg("<@ selectivity called on function that does not have 2 arguments"))); return DEFAULT_SCIRCLE_SEL; } if (!IsA(lsecond(ofunc->args), Const)) { ereport(DEBUG1, (errmsg("<@ selectivity called on scircle() with non-const 2nd arg"))); return DEFAULT_SCIRCLE_SEL; } arg2 = (Const *) lsecond(ofunc->args); if (arg2->consttype != FLOAT8OID) { ereport(DEBUG1, (errmsg("<@ selectivity called on scircle() with non-float8 2nd arg"))); return DEFAULT_SCIRCLE_SEL; } radius = DatumGetFloat8(arg2->constvalue); selec = spherecircle_area_float(radius) / SPHERE_SURFACE; CLAMP_PROBABILITY(selec); return selec; } static double spherepoint_in_circle_sel_internal(PG_FUNCTION_ARGS, bool commute, bool negate) { PlannerInfo *root = (PlannerInfo *) PG_GETARG_POINTER(0); Oid operator = PG_GETARG_OID(1); List *args = (List *) PG_GETARG_POINTER(2); int varRelid = PG_GETARG_INT32(3); //Oid collation = PG_GET_COLLATION(); VariableStatData vardata; Node *other; bool varonleft; double selec; /* * When asked about <>, we do the estimation using the corresponding = * operator, then convert to <> via "1.0 - eq_selectivity - nullfrac". */ if (negate) { operator = get_negator(operator); if (!OidIsValid(operator)) { /* Use default selectivity (should we raise an error instead?) */ return 1.0 - DEFAULT_SCIRCLE_SEL; } } /* * If expression is not variable = something or something = variable, then * punt and return a default estimate. */ if (!get_restriction_variable(root, args, varRelid, &vardata, &other, &varonleft)) return negate ? (1.0 - DEFAULT_SCIRCLE_SEL) : DEFAULT_SCIRCLE_SEL; /* * We can do a lot better if the something is a constant. (Note: the * Const might result from estimation rather than being a simple constant * in the query.) * Look only at var op circle_const, not var op point_const. */ if (IsA(other, Const) && varonleft != commute) { Const *constnode = (Const *) other; SCIRCLE *c; Assert(!constnode->constisnull); /* operators are strict, shouldn't have NULLs here */ c = (SCIRCLE *) constnode->constvalue; selec = spherecircle_area_float(c->radius) / SPHERE_SURFACE; CLAMP_PROBABILITY(selec); } /* * Check for <@ scircle(..., radius) */ else if (IsA(other, FuncExpr) && varonleft != commute) { selec = spherepoint_in_circle_sel_funcexpr(other); // p *((double * )&((*(Const *)((((FuncExpr*) other)->args->elements)[1].ptr_value)).constvalue)) } else { ereport(DEBUG1, (errmsg("<@ selectivity not const, other node tag %i", other->type))); selec = DEFAULT_SCIRCLE_SEL; } ReleaseVariableStats(vardata); return negate ? (1.0 - selec) : selec; } /* * Common code for spherepoint_in_circle_joinsel() */ static double spherepoint_in_circle_joinsel_internal(PG_FUNCTION_ARGS, bool commute) { #ifdef NOT_USED PlannerInfo *root = (PlannerInfo *) PG_GETARG_POINTER(0); Oid operator = PG_GETARG_OID(1); List *args = (List *) PG_GETARG_POINTER(2); JoinType jointype = (JoinType) PG_GETARG_INT16(3); SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) PG_GETARG_POINTER(4); Oid collation = PG_GET_COLLATION(); double selec; double selec_inner; VariableStatData vardata1; VariableStatData vardata2; double nd1; double nd2; bool isdefault1; bool isdefault2; Oid opfuncoid; AttStatsSlot sslot1; AttStatsSlot sslot2; bool join_is_reversed; RelOptInfo *inner_rel; get_join_variables(root, args, sjinfo, &vardata1, &vardata2, &join_is_reversed); ReleaseVariableStats(vardata1); ReleaseVariableStats(vardata2); #endif /* return a constant default for now; practically joins should use the * spoint_dwithin function instead which has join support with the * additional advantage that it's symmetric */ return DEFAULT_SCIRCLE_SEL; } Datum spherepoint_in_circle_sel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(spherepoint_in_circle_sel_internal(fcinfo, false, false)); } Datum spherepoint_in_circle_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(spherepoint_in_circle_joinsel_internal(fcinfo, false)); } Datum spherepoint_in_circle_neg_sel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(spherepoint_in_circle_sel_internal(fcinfo, false, true)); } Datum spherepoint_in_circle_neg_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(DEFAULT_INEQ_SEL); } Datum spherepoint_in_circle_com_sel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(spherepoint_in_circle_sel_internal(fcinfo, true, false)); } Datum spherepoint_in_circle_com_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(spherepoint_in_circle_joinsel_internal(fcinfo, true)); } Datum spherepoint_in_circle_com_neg_sel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(spherepoint_in_circle_sel_internal(fcinfo, true, true)); } Datum spherepoint_in_circle_com_neg_joinsel(PG_FUNCTION_ARGS) { PG_RETURN_FLOAT8(DEFAULT_INEQ_SEL); } pgsphere-1.5.1/src/ellipse.c000066400000000000000000000720621461140101500157230ustar00rootroot00000000000000#include "ellipse.h" /* Ellipse functions */ PG_FUNCTION_INFO_V1(sphereellipse_in); PG_FUNCTION_INFO_V1(sphereellipse_infunc); PG_FUNCTION_INFO_V1(sphereellipse_incl); PG_FUNCTION_INFO_V1(sphereellipse_rad1); PG_FUNCTION_INFO_V1(sphereellipse_rad2); PG_FUNCTION_INFO_V1(sphereellipse_center); PG_FUNCTION_INFO_V1(sphereellipse_trans); PG_FUNCTION_INFO_V1(sphereellipse_circle); PG_FUNCTION_INFO_V1(spherepoint_ellipse); PG_FUNCTION_INFO_V1(spherecircle_ellipse); PG_FUNCTION_INFO_V1(sphereellipse_equal); PG_FUNCTION_INFO_V1(sphereellipse_equal_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_point); PG_FUNCTION_INFO_V1(sphereellipse_cont_point_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_point_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_point_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_line); PG_FUNCTION_INFO_V1(sphereellipse_cont_line_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_line_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_line_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_line); PG_FUNCTION_INFO_V1(sphereellipse_overlap_line_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_line_com); PG_FUNCTION_INFO_V1(sphereellipse_overlap_line_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_circle); PG_FUNCTION_INFO_V1(sphereellipse_cont_circle_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_circle_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_circle_com_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_ellipse); PG_FUNCTION_INFO_V1(spherecircle_cont_ellipse_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_ellipse_com); PG_FUNCTION_INFO_V1(spherecircle_cont_ellipse_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_circle); PG_FUNCTION_INFO_V1(sphereellipse_overlap_circle_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_circle_com); PG_FUNCTION_INFO_V1(sphereellipse_overlap_circle_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_ellipse); PG_FUNCTION_INFO_V1(sphereellipse_cont_ellipse_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_ellipse_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_ellipse_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_ellipse); PG_FUNCTION_INFO_V1(sphereellipse_overlap_ellipse_neg); PG_FUNCTION_INFO_V1(spheretrans_ellipse); PG_FUNCTION_INFO_V1(spheretrans_ellipse_inv); /* * This function returns the arccos of a value. If variable 'a' is outside * the range (-1.00 .. 1.00), the function returns corresponding PI/2 or 3*PI/2. */ static float8 my_acos(float8 a) { if (a > 1.0) a = 1.0; if (a < -1.0) a = -1.0; return acos(a); } /* * Checks the parameter of an ellipse. */ static void sellipse_check(SELLIPSE *e) { SPoint sp; sp.lng = e->phi; spoint_check(&sp); if (PI - sp.lng >= PI_EPS) e->phi = sp.lng; else e->phi = sp.lng - PI; sp.lng = 0.0; sp.lat = e->theta; spoint_check(&sp); e->theta = sp.lat; sp.lng = e->psi; sp.lat = 0.0; spoint_check(&sp); e->psi = sp.lng; } /* * Returns the boundary circle of an ellipse. */ static void sellipse_circle(SCIRCLE *sc, const SELLIPSE *e) { SPoint sp; sellipse_center(&sp, e); memcpy((void *) &sc->center, (void *) &sp, sizeof(SPoint)); sc->radius = e->rad[0]; } /* * Returns an ellipse from axes, center and inclination. The largest axis * length is chosen for large axis. */ static SELLIPSE * sellipse_in(float8 r1, float8 r2, const SPoint *c, float8 inc) { SELLIPSE *e = (SELLIPSE *) palloc(sizeof(SELLIPSE)); e->rad[0] = Max(r1, r2); e->rad[1] = Min(r1, r2); e->phi = inc; e->theta = -c->lat; e->psi = c->lng; if (FPge(e->rad[0], PIH) || FPge(e->rad[1], PIH)) { pfree(e); e = NULL; elog(ERROR, "sphereellipse_in: radius must be less than 90 degrees"); } else { sellipse_check(e); } return e; } /* * Returns the radius of an ellipse depending on position angle. * * rada - major axis length * radb - minor axis length * ang - position angle in radians */ static float8 sellipse_dist(float8 rada, float8 radb, float8 ang) { float8 e; e = (1 - Sqr(sin(radb)) / Sqr(sin(rada))); return (asin(sin(radb) / sqrt(1 - e * Sqr(cos(ang))))); } /* * Returns distance between an ellipse and a point. */ static float8 sellipse_point_dist(const SELLIPSE *se, const SPoint *sp) { SEuler e; SPoint p; float8 dist, rad, ang; sellipse_trans(&e, se); spheretrans_inv(&e); euler_spoint_trans(&p, sp, &e); dist = my_acos(cos(p.lng) * cos(p.lat)); if (FPzero(dist)) { return -1.0; } else { if (FPeq(dist, PIH)) { ang = p.lat; } else { ang = my_acos(tan(p.lng) / tan(dist)); } rad = sellipse_dist(se->rad[0], se->rad[1], ang); if (FPzero((dist - rad))) { return 0.0; } else if (FPgt(dist, rad)) { return (dist - rad); } else { return -1.0; } } return -1.0; } /* * Performs an Euler transformation of an ellipse. */ static void euler_sellipse_trans(SELLIPSE *out, const SELLIPSE *in, const SEuler *se) { SEuler et; SLine sl[2]; SPoint p[2]; sellipse_trans(&et, in); sl[0].length = PIH; sl[0].phi = sl[0].theta = sl[0].psi = 0.0; euler_sline_trans(&sl[1], &sl[0], &et); euler_sline_trans(&sl[0], &sl[1], se); sline_begin(&p[0], &sl[0]); sline_end(&p[1], &sl[0]); et.psi = p[0].lng; et.theta = -p[0].lat; et.phi = 0.0; et.phi_a = EULER_AXIS_X; et.theta_a = EULER_AXIS_Y; et.psi_a = EULER_AXIS_Z; out->psi = et.psi; out->theta = et.theta; spheretrans_inv(&et); euler_sline_trans(&sl[1], &sl[0], &et); sphereline_to_euler(&et, &sl[1]); out->phi = et.theta; out->rad[0] = in->rad[0]; out->rad[1] = in->rad[1]; } /* * Returns the relationship between two ellipses as PGS_ELLIPSE_ELLIPSE_REL * int8 value. */ static int8 sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2) { int8 r; /* equality */ if (sellipse_eq(se1, se2)) { return PGS_ELLIPSE_CONT; } /* se2 is circle or point */ if (FPeq(se2->rad[0], se2->rad[1])) { SCIRCLE c; sellipse_circle(&c, se2); r = sellipse_circle_pos(se1, &c); switch (r) { case PGS_ELLIPSE_CIRCLE_AVOID: return PGS_ELLIPSE_AVOID; case PGS_CIRCLE_CONT_ELLIPSE: return PGS_ELLIPSE_OVER; case PGS_ELLIPSE_CONT_CIRCLE: return PGS_ELLIPSE_CONT; case PGS_ELLIPSE_CIRCLE_OVER: return PGS_ELLIPSE_OVER; default: return PGS_ELLIPSE_AVOID; } } /* se1 is circle or point */ if (FPeq(se1->rad[0], se1->rad[1])) { SCIRCLE c; sellipse_circle(&c, se1); r = sellipse_circle_pos(se2, &c); switch (r) { case PGS_ELLIPSE_CIRCLE_AVOID: return PGS_ELLIPSE_AVOID; case PGS_CIRCLE_CONT_ELLIPSE: return PGS_ELLIPSE_CONT; case PGS_ELLIPSE_CONT_CIRCLE: return PGS_ELLIPSE_OVER; case PGS_ELLIPSE_CIRCLE_OVER: return PGS_ELLIPSE_OVER; default: return PGS_ELLIPSE_AVOID; } } /* se2 is line */ if (FPzero(se2->rad[1])) { SLine l; sellipse_line(&l, se2); r = sellipse_line_pos(se1, &l); switch (r) { case PGS_ELLIPSE_LINE_AVOID: return PGS_ELLIPSE_AVOID; case PGS_ELLIPSE_CONT_LINE: return PGS_ELLIPSE_CONT; case PGS_ELLIPSE_LINE_OVER: return PGS_ELLIPSE_OVER; default: return PGS_ELLIPSE_AVOID; } } /* se1 is line */ if (FPzero(se1->rad[1])) { SLine l; sellipse_line(&l, se1); r = sellipse_line_pos(se2, &l); switch (r) { case PGS_ELLIPSE_LINE_AVOID: return PGS_ELLIPSE_AVOID; case PGS_ELLIPSE_CONT_LINE: return PGS_ELLIPSE_OVER; case PGS_ELLIPSE_LINE_OVER: return PGS_ELLIPSE_OVER; default: return PGS_ELLIPSE_AVOID; } } /* now we have two real ellipses */ do { SPoint p1, p2; float8 dist; /* check inner and outer circles */ sellipse_center(&p1, se1); sellipse_center(&p2, se2); dist = spoint_dist(&p1, &p2); if (FPle((se1->rad[0] + se2->rad[0]), dist)) { return PGS_ELLIPSE_AVOID; } else if (FPle((dist + se1->rad[0]), se2->rad[1])) { return PGS_ELLIPSE_OVER; } else if (FPle((dist + se2->rad[0]), se1->rad[1])) { return PGS_ELLIPSE_CONT; } else { SEuler eul; SELLIPSE etmp, e; SPoint sp[3]; int i; float8 diff[3]; float8 elng; const int maxcntr = 100000; int cntr; /* transform se1 to north pol */ sellipse_trans(&eul, se1); spheretrans_inv(&eul); euler_sellipse_trans(&etmp, se2, &eul); eul.phi = PIH; eul.theta = PIH; eul.psi = 0; eul.phi_a = EULER_AXIS_Z; eul.theta_a = EULER_AXIS_X; eul.psi_a = EULER_AXIS_Z; euler_sellipse_trans(&e, &etmp, &eul); etmp.rad[0] = se1->rad[0]; etmp.rad[1] = se1->rad[1]; etmp.phi = 0.0; etmp.theta = -PIH; etmp.psi = PIH; /* search for minimum distance */ sp[0].lat = sp[2].lat = PIH - se1->rad[0]; sellipse_center(&sp[1], &e); if (FPeq(sp[1].lat, PIH)) { elng = PIH; } else { elng = sp[1].lng; } if (sin(elng) < 0) { sp[0].lng = PI; sp[1].lng = 3 * PIH; sp[2].lng = PID; } else { sp[0].lng = 0.0; sp[1].lng = PIH; sp[2].lng = PI; } sp[1].lat = PIH - se1->rad[1]; cntr = 0; do { for (i = 0; i < 3; i++) { diff[i] = sellipse_point_dist(&e, &sp[i]); if (diff[i] < 0.0) { return PGS_ELLIPSE_OVER; } } if (diff[0] <= diff[1] && diff[1] <= diff[2]) { memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } else if (diff[0] <= diff[2] && diff[2] <= diff[1]) { if (fabs(sp[0].lng - elng) < fabs(sp[2].lng - elng)) { memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } else { memcpy((void *) &sp[0], (void *) &sp[1], sizeof(SPoint)); } } else if (diff[1] <= diff[0] && diff[0] <= diff[2]) { memcpy((void *) &sp[2], (void *) &sp[0], sizeof(SPoint)); memcpy((void *) &sp[0], (void *) &sp[1], sizeof(SPoint)); } else if (diff[1] <= diff[2] && diff[2] <= diff[0]) { memcpy((void *) &sp[0], (void *) &sp[1], sizeof(SPoint)); } else if (diff[2] <= diff[0] && diff[0] <= diff[1]) { if (fabs(sp[0].lng - elng) < fabs(sp[2].lng - elng)) { memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } else { memcpy((void *) &sp[0], (void *) &sp[1], sizeof(SPoint)); } } else if (diff[2] <= diff[1] && diff[1] <= diff[0]) { memcpy((void *) &sp[0], (void *) &sp[2], sizeof(SPoint)); memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } if (sp[2].lng < sp[0].lng) { /* switch here too */ memcpy((void *) &sp[1], (void *) &sp[0], sizeof(SPoint)); memcpy((void *) &sp[0], (void *) &sp[2], sizeof(SPoint)); memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } sp[1].lng = (sp[0].lng + sp[2].lng) / 2.0; sp[1].lat = PIH - sellipse_dist(etmp.rad[0], etmp.rad[1], sp[1].lng); cntr++; } while (cntr < maxcntr && ((sp[2].lng - sp[0].lng) > FLT_EPSILON)); if (cntr >= maxcntr) { elog(ERROR, "Bug found in pg_sphere function 'sellipse_ellipse_pos' ! \n Please report it to pg_sphere team."); } sellipse_center(&sp[1], &e); if (sellipse_cont_point(&etmp, &sp[1])) { return PGS_ELLIPSE_CONT; } else { return PGS_ELLIPSE_AVOID; } } } while (0); return PGS_ELLIPSE_AVOID; } void sellipse_trans(SEuler *se, const SELLIPSE *e) { se->psi = e->psi; se->theta = e->theta; se->phi = e->phi; se->phi_a = EULER_AXIS_X; se->theta_a = EULER_AXIS_Y; se->psi_a = EULER_AXIS_Z; } /* Returns center of ellipse */ void sellipse_center(SPoint *sp, const SELLIPSE *e) { sp->lng = e->psi; sp->lat = -e->theta; } bool sellipse_line(SLine *sl, const SELLIPSE *e) { if (!FPzero(e->rad[0])) { SEuler se; SLine slt; SPoint p[2]; p[0].lat = p[1].lat = 0.0; p[0].lng = -e->rad[0]; p[1].lng = e->rad[0]; sline_from_points(&slt, &p[0], &p[1]); sellipse_trans(&se, e); euler_sline_trans(sl, &slt, &se); return true; } else { return false; } } bool sellipse_eq(const SELLIPSE *e1, const SELLIPSE *e2) { if (FPne(e1->rad[0], e2->rad[0]) || FPne(e1->rad[1], e2->rad[1])) { return false; } else if (FPzero(e1->rad[0])) { /* point */ SPoint p[2]; sellipse_center(&p[0], e1); sellipse_center(&p[1], e2); return spoint_eq(&p[0], &p[1]); } else if (FPeq(e1->rad[0], e1->rad[1])) { /* circle */ SCIRCLE c[2]; sellipse_circle(&c[0], e1); sellipse_circle(&c[1], e2); return scircle_eq(&c[0], &c[1]); } else { SEuler se[2]; sellipse_trans(&se[0], e1); sellipse_trans(&se[1], e2); return strans_eq(&se[0], &se[1]); } return false; } bool sellipse_cont_point(const SELLIPSE *se, const SPoint *sp) { SPoint c; float8 dist; sellipse_center(&c, se); dist = spoint_dist(sp, &c); if (FPgt(dist, se->rad[0])) { return false; } if (FPle(dist, se->rad[1])) { return true; } if (FPzero(se->rad[1])) { SLine l; sellipse_line(&l, se); return spoint_at_sline(sp, &l); } else { SEuler et; SPoint p; float8 a, e; sellipse_trans(&et, se); spheretrans_inv(&et); euler_spoint_trans(&p, sp, &et); if (FPeq(dist, PIH)) { e = p.lat; } else { e = my_acos(tan(p.lng) / tan(dist)); } a = sellipse_dist(se->rad[0], se->rad[1], e); if (FPge(a, dist)) { return true; } else { return false; } } return false; } int8 sellipse_line_pos(const SELLIPSE *se, const SLine *sl) { /* line is point */ if (FPzero(sl->length)) { SPoint p; sline_begin(&p, sl); if (sellipse_cont_point(se, &p)) { return PGS_ELLIPSE_CONT_LINE; } else { return PGS_ELLIPSE_LINE_AVOID; } } /* ellipse is point */ if (FPzero(se->rad[0])) { SPoint p; sellipse_center(&p, se); if (spoint_at_sline(&p, sl)) { return PGS_ELLIPSE_LINE_OVER; } else { return PGS_ELLIPSE_LINE_AVOID; } } /* ellipse is line */ if (FPzero(se->rad[1])) { SLine l; int8 res; sellipse_line(&l, se); res = sline_sline_pos(&l, sl); if (res == PGS_LINE_AVOID) { return PGS_ELLIPSE_LINE_AVOID; } else if (res == PGS_LINE_CONT_LINE || res == PGS_LINE_EQUAL) { return PGS_ELLIPSE_CONT_LINE; } else { return PGS_ELLIPSE_LINE_OVER; } } /* ellipse is circle */ if (FPeq(se->rad[0], se->rad[1])) { SCIRCLE c; int8 res; sellipse_circle(&c, se); res = sphereline_circle_pos(sl, &c); if (res == PGS_CIRCLE_LINE_AVOID) { return PGS_ELLIPSE_LINE_AVOID; } else if (res == PGS_CIRCLE_CONT_LINE) { return PGS_ELLIPSE_CONT_LINE; } else { return PGS_ELLIPSE_LINE_OVER; } } /* begin or end of line inside ellipse */ { bool bb, be; SPoint p; sline_begin(&p, sl); bb = sellipse_cont_point(se, &p); sline_end(&p, sl); be = sellipse_cont_point(se, &p); if (bb || be) { if (bb && be) { return PGS_ELLIPSE_CONT_LINE; } if (!(bb && be)) { return PGS_ELLIPSE_LINE_OVER; } } } /* compare with bounding circle */ { SCIRCLE c; int8 res; sellipse_circle(&c, se); res = sphereline_circle_pos(sl, &c); if (res == PGS_CIRCLE_LINE_AVOID) { return PGS_ELLIPSE_LINE_AVOID; } } /* compare in detail */ { SEuler e; SPoint c; SELLIPSE set; sphereline_to_euler(&e, sl); spheretrans_inv(&e); euler_sellipse_trans(&set, se, &e); sellipse_center(&c, &set); if (sin(c.lng + se->rad[0]) < 0.0) { return PGS_ELLIPSE_LINE_AVOID; } if (sin(c.lng - se->rad[0] - sl->length) < 0.0) { return PGS_ELLIPSE_LINE_AVOID; } if ((c.lat >= 0) && (se->rad[0] - c.lat) > 0.0) { return PGS_ELLIPSE_LINE_AVOID; } if ((c.lat < 0) && (se->rad[0] + c.lat) > 0.0) { return PGS_ELLIPSE_LINE_AVOID; } else { SPoint cn; float8 eps, dist, sinr; float8 d[3]; int i; SPoint lp[3]; SPoint lpt[3]; sellipse_trans(&e, &set); spheretrans_inv(&e); lp[0].lng = 0.0; lp[1].lng = sl->length / 2; lp[2].lng = sl->length; lp[0].lat = lp[1].lat = lp[2].lat = 0.0; cn.lng = 0.0; cn.lat = 0.0; eps = (1 - Sqr(sin(se->rad[1])) / Sqr(sin(se->rad[0]))); sinr = sin(se->rad[1]); while (FPgt(lp[2].lng, lp[0].lng)) { for (i = 0; i < 3; i++) { euler_spoint_trans(&lpt[i], &lp[i], &e); dist = spoint_dist(&lpt[i], &cn); if (FPeq(dist, PIH)) { d[i] = lpt[i].lat; } else { d[i] = tan(lpt[i].lng) / tan(dist); } d[i] = asin(sinr / sqrt(1 - eps * Sqr(d[i]))); if (FPge(d[i], dist)) { return PGS_ELLIPSE_LINE_OVER; } } /* get the best values */ for (i = 0; i < 3; i++) { if (d[i] <= d[(i + 1) % 3] && d[i] <= d[(i + 2) % 3]) { lpt[0].lng = lp[i].lng; if (d[(i + 1) % 3] <= d[(i + 2) % 3]) { lpt[1].lng = lp[(i + 1) % 3].lng; } else { lpt[1].lng = lp[(i + 2) % 3].lng; } if (lpt[0].lng > lpt[1].lng) { dist = lpt[0].lng; lpt[0].lng = lpt[1].lng; lpt[1].lng = dist; } lp[0].lng = lpt[0].lng; lp[1].lng = (lpt[0].lng + lpt[1].lng) / 2; lp[2].lng = lpt[1].lng; } } } } } return PGS_ELLIPSE_LINE_AVOID; } int8 sellipse_circle_pos(const SELLIPSE *se, const SCIRCLE *sc) { /* circle is point */ if (FPzero(sc->radius)) { if (sellipse_cont_point(se, &sc->center)) { return PGS_ELLIPSE_CONT_CIRCLE; } else { return PGS_ELLIPSE_CIRCLE_AVOID; } } /* ellipse is circle */ if (FPeq(se->rad[0], se->rad[1])) { SCIRCLE tc; float8 dist; sellipse_circle(&tc, se); if (scircle_eq(&tc, sc)) { return PGS_ELLIPSE_CIRCLE_EQUAL; } dist = spoint_dist(&tc.center, &sc->center); if (FPle((dist + sc->radius), tc.radius)) { return PGS_ELLIPSE_CONT_CIRCLE; } if (FPle((dist + tc.radius), sc->radius)) { return PGS_CIRCLE_CONT_ELLIPSE; } if (FPgt((sc->radius + tc.radius), dist)) { return PGS_ELLIPSE_CIRCLE_OVER; } else { return PGS_ELLIPSE_CIRCLE_AVOID; } } /* ellipse is line */ if (FPzero(se->rad[1])) { SLine l; int8 res; sellipse_line(&l, se); res = sphereline_circle_pos(&l, sc); if (res == PGS_CIRCLE_LINE_AVOID) { return PGS_ELLIPSE_CIRCLE_AVOID; } else if (res == PGS_CIRCLE_CONT_LINE) { return PGS_CIRCLE_CONT_ELLIPSE; } else { return PGS_ELLIPSE_CIRCLE_OVER; } } else { /* * now ellipse is a real ellipse and * circle is a real circle */ float8 dist; SPoint c; sellipse_center(&c, se); dist = spoint_dist(&sc->center, &c); if (FPzero(dist)) { if (FPle(sc->radius, se->rad[1])) { return PGS_ELLIPSE_CONT_CIRCLE; } else if (FPge(sc->radius, se->rad[0])) { return PGS_CIRCLE_CONT_ELLIPSE; } else { return PGS_ELLIPSE_CIRCLE_OVER; } } else { SEuler et; SPoint p; float8 a, e; sellipse_trans(&et, se); spheretrans_inv(&et); euler_spoint_trans(&p, &sc->center, &et); if (FPeq(dist, PIH)) { e = p.lat; } else { e = my_acos(tan(p.lng) / tan(dist)); } a = sellipse_dist(se->rad[0], se->rad[1], e); if (FPle((dist + sc->radius), a)) { return PGS_ELLIPSE_CONT_CIRCLE; } else if (FPle((dist + a), sc->radius)) { return PGS_CIRCLE_CONT_ELLIPSE; } else if (FPgt((a + sc->radius), dist)) { return PGS_ELLIPSE_CIRCLE_OVER; } else { return PGS_ELLIPSE_CIRCLE_AVOID; } } } return PGS_ELLIPSE_CIRCLE_AVOID; } Datum sphereellipse_in(PG_FUNCTION_ARGS) { SELLIPSE *e = NULL; char *s = PG_GETARG_CSTRING(0); SPoint p; double r1, r2, inc; void sphere_yyparse(void); init_buffer(s); sphere_yyparse(); if (get_ellipse(&p.lng, &p.lat, &r1, &r2, &inc)) { e = sellipse_in(r1, r2, &p, inc); reset_buffer(); } PG_RETURN_POINTER(e); } Datum sphereellipse_infunc(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); float8 r1 = PG_GETARG_FLOAT8(1); float8 r2 = PG_GETARG_FLOAT8(2); float8 inc = PG_GETARG_FLOAT8(3); SELLIPSE *e = sellipse_in(r1, r2, p, inc); PG_RETURN_POINTER(e); } Datum sphereellipse_incl(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(e->phi); } Datum sphereellipse_rad1(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(e->rad[0]); } Datum sphereellipse_rad2(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(e->rad[1]); } Datum sphereellipse_center(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) palloc(sizeof(SPoint)); sellipse_center(p, e); PG_RETURN_POINTER(p); } Datum sphereellipse_trans(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SEuler *t = (SEuler *) palloc(sizeof(SEuler)); sellipse_trans(t, e); PG_RETURN_POINTER(t); } Datum sphereellipse_circle(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) palloc(sizeof(SCIRCLE)); sellipse_circle(c, e); PG_RETURN_POINTER(c); } Datum spherepoint_ellipse(PG_FUNCTION_ARGS) { SPoint *c = (SPoint *) PG_GETARG_POINTER(0); SELLIPSE *e = sellipse_in(0.0, 0.0, c, 0.0); if (e) { PG_RETURN_POINTER(e); } PG_RETURN_NULL(); } Datum spherecircle_ellipse(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SELLIPSE *e = sellipse_in(c->radius, c->radius, &c->center, 0.0); if (e) { PG_RETURN_POINTER(e); } PG_RETURN_NULL(); } Datum sphereellipse_equal(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(0); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_eq(e1, e2)); } Datum sphereellipse_equal_neg(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(0); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!sellipse_eq(e1, e2)); } Datum sphereellipse_cont_point(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_cont_point(e, p)); } Datum sphereellipse_cont_point_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!sellipse_cont_point(e, p)); } Datum sphereellipse_cont_point_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sellipse_cont_point(e, p)); } Datum sphereellipse_cont_point_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!sellipse_cont_point(e, p)); } Datum sphereellipse_cont_line(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b == PGS_ELLIPSE_CONT_LINE); } Datum sphereellipse_cont_line_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b != PGS_ELLIPSE_CONT_LINE); } Datum sphereellipse_cont_line_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b == PGS_ELLIPSE_CONT_LINE); } Datum sphereellipse_cont_line_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b != PGS_ELLIPSE_CONT_LINE); } Datum sphereellipse_overlap_line(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b > PGS_ELLIPSE_LINE_AVOID); } Datum sphereellipse_overlap_line_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b == PGS_ELLIPSE_LINE_AVOID); } Datum sphereellipse_overlap_line_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b > PGS_ELLIPSE_LINE_AVOID); } Datum sphereellipse_overlap_line_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); int8 b = sellipse_line_pos(e, l); PG_RETURN_BOOL(b == PGS_ELLIPSE_LINE_AVOID); } Datum sphereellipse_cont_circle(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos == PGS_ELLIPSE_CONT_CIRCLE || pos == PGS_ELLIPSE_CIRCLE_EQUAL); } Datum sphereellipse_cont_circle_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos != PGS_ELLIPSE_CONT_CIRCLE && pos != PGS_ELLIPSE_CIRCLE_EQUAL); } Datum sphereellipse_cont_circle_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos == PGS_ELLIPSE_CONT_CIRCLE || pos == PGS_ELLIPSE_CIRCLE_EQUAL); } Datum sphereellipse_cont_circle_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos != PGS_ELLIPSE_CONT_CIRCLE && pos != PGS_ELLIPSE_CIRCLE_EQUAL); } Datum spherecircle_cont_ellipse(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos == PGS_CIRCLE_CONT_ELLIPSE || pos == PGS_ELLIPSE_CIRCLE_EQUAL); } Datum spherecircle_cont_ellipse_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos != PGS_CIRCLE_CONT_ELLIPSE && pos != PGS_ELLIPSE_CIRCLE_EQUAL); } Datum spherecircle_cont_ellipse_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos == PGS_CIRCLE_CONT_ELLIPSE || pos == PGS_ELLIPSE_CIRCLE_EQUAL); } Datum spherecircle_cont_ellipse_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int pos = sellipse_circle_pos(e, c); PG_RETURN_BOOL(pos != PGS_CIRCLE_CONT_ELLIPSE && pos != PGS_ELLIPSE_CIRCLE_EQUAL); } Datum sphereellipse_overlap_circle(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_circle_pos(e, c) > PGS_ELLIPSE_CIRCLE_AVOID); } Datum sphereellipse_overlap_circle_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_circle_pos(e, c) == PGS_ELLIPSE_CIRCLE_AVOID); } Datum sphereellipse_overlap_circle_com(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sellipse_circle_pos(e, c) > PGS_ELLIPSE_CIRCLE_AVOID); } Datum sphereellipse_overlap_circle_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sellipse_circle_pos(e, c) == PGS_ELLIPSE_CIRCLE_AVOID); } Datum sphereellipse_cont_ellipse(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(0); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_ellipse_pos(e1, e2) == PGS_ELLIPSE_CONT); } Datum sphereellipse_cont_ellipse_neg(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(0); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_ellipse_pos(e1, e2) != PGS_ELLIPSE_CONT); } Datum sphereellipse_cont_ellipse_com(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(1); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sellipse_ellipse_pos(e1, e2) == PGS_ELLIPSE_CONT); } Datum sphereellipse_cont_ellipse_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(1); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(sellipse_ellipse_pos(e1, e2) != PGS_ELLIPSE_CONT); } Datum sphereellipse_overlap_ellipse(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(0); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_ellipse_pos(e1, e2) > PGS_ELLIPSE_AVOID); } Datum sphereellipse_overlap_ellipse_neg(PG_FUNCTION_ARGS) { SELLIPSE *e1 = (SELLIPSE *) PG_GETARG_POINTER(0); SELLIPSE *e2 = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sellipse_ellipse_pos(e1, e2) == PGS_ELLIPSE_AVOID); } Datum spheretrans_ellipse(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SELLIPSE *out = (SELLIPSE *) palloc(sizeof(SELLIPSE)); euler_sellipse_trans(out, e, se); sellipse_check(out); PG_RETURN_POINTER(out); } Datum spheretrans_ellipse_inv(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SELLIPSE *out = (SELLIPSE *) palloc(sizeof(SELLIPSE)); SEuler tmp; spheretrans_inverse(&tmp, se); euler_sellipse_trans(out, e, &tmp); sellipse_check(out); PG_RETURN_POINTER(out); } pgsphere-1.5.1/src/ellipse.h000066400000000000000000000171311461140101500157240ustar00rootroot00000000000000#ifndef __PGS_ELLIPSE_H__ #define __PGS_ELLIPSE_H__ #include "line.h" /* Ellipse declarations */ /* * Spherical ellipse data structure. A spherical ellipse is represented using * two radii and an Euler transformation (ZXZ-axis). The "untransformed" ellipse * is located on equator at position (0,0). The large radius is along equator. */ typedef struct { /* * rad[0] is the large radius, rad[1] is the small radius of an ellipse in * radians */ float8 rad[2]; float8 phi, /* the first rotation angle around z axis */ theta, /* the second rotation angle around x axis */ psi; /* the last rotation angle around z axis */ } SELLIPSE; /* * PGS_RELATIONSHIPS */ /* PGS_ELLIPSE_LINE_REL Ellipse and line */ #define PGS_ELLIPSE_LINE_AVOID 0 /* ellipse avoids line */ #define PGS_ELLIPSE_CONT_LINE 1 /* ellipse contains line */ #define PGS_ELLIPSE_LINE_OVER 2 /* ellipse overlaps line */ /* PGS_ELLIPSE_CIRCLE_REL Ellipse and circle */ #define PGS_ELLIPSE_CIRCLE_AVOID 0 /* ellipse avoids circle */ #define PGS_CIRCLE_CONT_ELLIPSE 1 /* circle contains ellipse */ #define PGS_ELLIPSE_CONT_CIRCLE 2 /* ellipse contains circle */ #define PGS_ELLIPSE_CIRCLE_EQUAL 3 /* ellipse equals circle */ #define PGS_ELLIPSE_CIRCLE_OVER 4 /* ellipse overlaps circle */ /* PGS_ELLIPSE_ELLIPSE_REL Ellipse and ellipse */ #define PGS_ELLIPSE_AVOID 0 /* ellipse avoids other ellipse */ #define PGS_ELLIPSE_CONT 1 /* ellipse contains other ellipse */ #define PGS_ELLIPSE_OVER 2 /* ellipse overlaps other ellipse */ /* * Checks whether two ellipses are equal . */ extern bool sellipse_eq(const SELLIPSE *e1, const SELLIPSE *e2); /* * Returns the center of an ellipse. */ extern void sellipse_center(SPoint *sp, const SELLIPSE *e); /* * Checks whether a ellipse contains point. */ extern bool sellipse_cont_point(const SELLIPSE *se, const SPoint *sp); /* * Returns the large axis of an ellipse as line. */ extern bool sellipse_line(SLine *sl, const SELLIPSE *e); /* * Relationship between a line and an ellipse as PGS_ELLIPSE_LINE_REL int8 value. */ extern int8 sellipse_line_pos(const SELLIPSE *se, const SLine *sl); /* * Relationship between a circle and an ellipse as PGS_ELLIPSE_CIRCLE_REL int8 value. */ extern int8 sellipse_circle_pos(const SELLIPSE *se, const SCIRCLE *sc); /* * Returns the Euler transformation of an ellipse. */ extern void sellipse_trans(SEuler *se, const SELLIPSE *e); /* * Input of the spherical ellipse. */ extern Datum sphereellipse_in(PG_FUNCTION_ARGS); /* * Input of the spherical ellipse from center, axes and inclination. */ extern Datum sphereellipse_infunc(PG_FUNCTION_ARGS); /* * Returns the inclination of an ellipse. */ extern Datum sphereellipse_incl(PG_FUNCTION_ARGS); /* * Returns the length of the major axis of an ellipse. */ extern Datum sphereellipse_rad1(PG_FUNCTION_ARGS); /* * Returns the length of the minor axis of an ellipse. */ extern Datum sphereellipse_rad2(PG_FUNCTION_ARGS); /* * Returns the center of an ellipse. */ extern Datum sphereellipse_center(PG_FUNCTION_ARGS); /* * Returns the Euler transformation of an ellipse. */ extern Datum sphereellipse_trans(PG_FUNCTION_ARGS); /* * Casts a spherical ellipse as circle. The created circle is the boundary * circle of ellipse. The diameter of returned circle is equal to length of * major axis of ellipse. */ extern Datum sphereellipse_circle(PG_FUNCTION_ARGS); /* * Casts a spherical point to an ellipse. */ extern Datum spherepoint_ellipse(PG_FUNCTION_ARGS); /* * Casts a spherical circle to an ellipse. */ extern Datum spherecircle_ellipse(PG_FUNCTION_ARGS); /* * Checks whether two ellipses are equal. */ extern Datum sphereellipse_equal(PG_FUNCTION_ARGS); /* * Checks whether two ellipses are not equal. */ extern Datum sphereellipse_equal_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a point. */ extern Datum sphereellipse_cont_point(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a point. */ extern Datum sphereellipse_cont_point_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a point. */ extern Datum sphereellipse_cont_point_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a point. */ extern Datum sphereellipse_cont_point_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a line. */ extern Datum sphereellipse_cont_line(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a line. */ extern Datum sphereellipse_cont_line_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a line. */ extern Datum sphereellipse_cont_line_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a line. */ extern Datum sphereellipse_cont_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a line overlap. */ extern Datum sphereellipse_overlap_line(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a line don't overlap. */ extern Datum sphereellipse_overlap_line_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a line overlap. */ extern Datum sphereellipse_overlap_line_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a line don't overlap. */ extern Datum sphereellipse_overlap_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a circle. */ extern Datum sphereellipse_cont_circle(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a circle. */ extern Datum sphereellipse_cont_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a circle. */ extern Datum sphereellipse_cont_circle_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a circle. */ extern Datum sphereellipse_cont_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains an ellipse. */ extern Datum spherecircle_cont_ellipse(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain an ellipse. */ extern Datum spherecircle_cont_ellipse_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains an ellipse. */ extern Datum spherecircle_cont_ellipse_com(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain an ellipse. */ extern Datum spherecircle_cont_ellipse_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and an ellipse overlap. */ extern Datum sphereellipse_overlap_circle(PG_FUNCTION_ARGS); /* * Checks whether a circle and an ellipse don't overlap. */ extern Datum sphereellipse_overlap_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and an ellipse overlap. */ extern Datum sphereellipse_overlap_circle_com(PG_FUNCTION_ARGS); /* * Checks whether a circle and an ellipse don't overlap. */ extern Datum sphereellipse_overlap_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains other ellipse. */ extern Datum sphereellipse_cont_ellipse(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain other ellipse. */ extern Datum sphereellipse_cont_ellipse_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse is contained by other ellipse. */ extern Datum sphereellipse_cont_ellipse_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse isn't contained by other ellipse. */ extern Datum sphereellipse_cont_ellipse_com_neg(PG_FUNCTION_ARGS); /* * Checks whether two ellipses overlap. */ extern Datum sphereellipse_overlap_ellipse(PG_FUNCTION_ARGS); /* * Checks whether two ellipses don't overlap. */ extern Datum sphereellipse_overlap_ellipse_neg(PG_FUNCTION_ARGS); /* * Transforms an ellipse using an Euler transformation. */ extern Datum spheretrans_ellipse(PG_FUNCTION_ARGS); /* * Transforms an ellipse using an Euler transformation. */ extern Datum spheretrans_ellipse_inv(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/epochprop.c000066400000000000000000000135011461140101500162560ustar00rootroot00000000000000/* Handling of (conventional) proper motions. This code is largely based on a FORTRAN function written by Lennart Lindegren (Lund Obs) in 1995 that implements the procedure described in The Hipparcos and Tycho Catalogues (ESA SP-1200), Volume 1, Section 1.5.5, 'Epoch Transformation: Rigorous Treatment'; cf. . */ #include #include "pgs_util.h" #include "point.h" #include "epochprop.h" #include "vector3d.h" PG_FUNCTION_INFO_V1(epoch_prop); /* Astronomical unit in kilometers */ #define AU 1.495978701e8 /* Julian year in seconds */ #define J_YEAR (365.25*86400) /* A_nu as per ESA/SP-1200 */ #define A_NU (AU/(J_YEAR)) /* Following SOFA, we use 1e-7 arcsec as minimal parallax ("celestial sphere"); parallax=0 exactly means "infinite distance", which leads to all sorts for problems; our parallaxes come in in mas, so: */ #define PX_MIN 1e-7*1000 /* propagate an object at a phase vector over a time difference of delta_t, stuffing an updated phase vector in result. This does not propagate errors. */ static void propagate_phasevec( const phasevec *pv, const double delta_t, phasevec *result) { double distance_factor, mu0abs, zeta0, parallax; Vector3D p0, r0, q0; Vector3D mu0, pprime, qprime, mu, muprime, u, uprime; /* for very small or null parallaxes, our algorithm breaks; avoid that and, if we did emergency measures, do not talk about parallax and radial velocity in the output */ if (pv->parallax_valid) { parallax = pv->parallax; } else { parallax = PX_MIN; } result->parallax_valid = pv->parallax_valid; /* compute the normal triad as Vector3D-s, eq. (1.2.15)*/ spoint_vector3d(&r0, &(pv->pos)); p0.x = -sin(pv->pos.lng); p0.y = cos(pv->pos.lng); p0.z = 0; q0.x = -sin(pv->pos.lat) * cos(pv->pos.lng); q0.y = -sin(pv->pos.lat) * sin(pv->pos.lng); q0.z = cos(pv->pos.lat); /* the original proper motion vector */ mu0.x = mu0.y = mu0.z = 0; vector3d_addwithscalar(&mu0, pv->pm[0], &p0); vector3d_addwithscalar(&mu0, pv->pm[1], &q0); mu0abs = vector3d_length(&mu0); /* radial velocity in mas/yr ("change of parallax per year"). eq. (1.5.24) We're transforming this to rad/yr so the units work out below */ zeta0 = (pv->rv * parallax / A_NU) / 3.6e6 / RADIANS; /* distance factor eq. (1.5.25) */ distance_factor = 1/sqrt(1 + 2 * zeta0 * delta_t + (mu0abs * mu0abs + zeta0 * zeta0) * delta_t * delta_t); /* the propagated proper motion vector, eq. (1.5.28) */ muprime.x = muprime.y = muprime.z = 0; vector3d_addwithscalar(&muprime, (1 + zeta0 * delta_t), &mu0); vector3d_addwithscalar(&muprime, -mu0abs * mu0abs * delta_t, &r0); mu.x = mu.y = mu.z = 0; vector3d_addwithscalar(&mu, pow(distance_factor, 3), &muprime); /* parallax, eq. (1.5.27) */ result->parallax = distance_factor*parallax; /* zeta/rv, eq. (1.5.29); go back from rad to mas, too */ result->rv = (zeta0 + (mu0abs * mu0abs + zeta0 * zeta0) * delta_t) * distance_factor * distance_factor * 3.6e6 * RADIANS * A_NU / result->parallax; /* propagated position, eq. (1.5.26) */ uprime.x = uprime.y = uprime.z = 0; vector3d_addwithscalar(&uprime, (1 + zeta0 * delta_t), &r0); vector3d_addwithscalar(&uprime, delta_t, &mu0); u.x = u.y = u.z = 0; vector3d_addwithscalar(&u, distance_factor, &uprime); vector3d_spoint(&(result->pos), &u); /* compute a new triad for the propagated position, eq (1.5.15) */ pprime.x = -sin(result->pos.lng); pprime.y = cos(result->pos.lng); pprime.z = 0; qprime.x = -sin(result->pos.lat) * cos(result->pos.lng); qprime.y = -sin(result->pos.lat) * sin(result->pos.lng); qprime.z = cos(result->pos.lat); /* use it to compute the proper motions, eq. (1.5.32) */ result->pm[0] = vector3d_scalar(&pprime, &mu); result->pm[1] = vector3d_scalar(&qprime, &mu); } /* Propagate a position with proper motions and optionally parallax and radial velocity. Arguments: pos0 (spoint), pm_long, pm_lat (in rad/yr) par (parallax, mas), rv (in km/s), delta_t (in years) This returns a 6-array of lat, long (in rad), parallax (in mas) pmlat, pmlong (in rad/yr), rv (in km/s). */ Datum epoch_prop(PG_FUNCTION_ARGS) { double delta_t; phasevec input, output; ArrayType *result; Datum retvals[6]; if (PG_ARGISNULL(0)) { ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("NULL position not supported in epoch propagation"))); } memcpy(&(input.pos), (void*)PG_GETARG_POINTER(0), sizeof(SPoint)); if (PG_ARGISNULL(1)) { input.parallax = 0; } else { input.parallax = PG_GETARG_FLOAT8(1); } input.parallax_valid = fabs(input.parallax) > PX_MIN; if (PG_ARGISNULL(2)) { input.pm[0] = 0; } else { input.pm[0] = PG_GETARG_FLOAT8(2); } if (PG_ARGISNULL(3)) { input.pm[1] = 0; } else { input.pm[1] = PG_GETARG_FLOAT8(3); } if (PG_ARGISNULL(4)) { input.rv = 0; } else { input.rv = PG_GETARG_FLOAT8(4); } if (PG_ARGISNULL(5)) { ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("NULL delta t not supported in epoch propagation"))); } delta_t = PG_GETARG_FLOAT8(5); propagate_phasevec(&input, delta_t, &output); /* change to internal units: rad, rad/yr, mas, and km/s */ retvals[0] = Float8GetDatum(output.pos.lng); retvals[1] = Float8GetDatum(output.pos.lat); retvals[2] = Float8GetDatum(output.parallax); retvals[3] = Float8GetDatum(output.pm[0]); retvals[4] = Float8GetDatum(output.pm[1]); retvals[5] = Float8GetDatum(output.rv); { bool isnull[6] = {0, 0, 0, 0, 0, 0}; int lower_bounds[1] = {1}; int dims[1] = {6}; #ifdef USE_FLOAT8_BYVAL bool embyval = true; #else bool embyval = false; #endif if (! output.parallax_valid) { /* invalidate parallax and rv */ isnull[2] = 1; isnull[5] = 1; } result = construct_md_array(retvals, isnull, 1, dims, lower_bounds, FLOAT8OID, sizeof(float8), embyval, 'd'); } PG_RETURN_ARRAYTYPE_P(result); } pgsphere-1.5.1/src/epochprop.h000066400000000000000000000012741461140101500162670ustar00rootroot00000000000000/* Definitions for handling proper motions */ #include extern Datum epoch_prop(PG_FUNCTION_ARGS); /* a cartesian point; this is like geo_decl's point, but you can't have both geo_decls and pg_sphere right now (both define a type Point, not to mention they have different ideas on EPSILON */ typedef struct s_cpoint { double x, y; } CPoint; typedef struct s_phasevec { SPoint pos; /* Position as an SPoint */ double pm[2]; /* Proper motion long/lat in rad/year, PM in * longitude has cos(lat) applied */ double parallax; /* in rad */ double rv; /* radial velocity in km/s */ int parallax_valid; /* 1 if the parallax really is a NULL */ } phasevec; pgsphere-1.5.1/src/euler.c000066400000000000000000000231021461140101500153710ustar00rootroot00000000000000#include "euler.h" /* Euler transformation functions */ PG_FUNCTION_INFO_V1(spheretrans_in); PG_FUNCTION_INFO_V1(spheretrans_from_float8); PG_FUNCTION_INFO_V1(spheretrans_from_float8_and_type); PG_FUNCTION_INFO_V1(spheretrans_equal); PG_FUNCTION_INFO_V1(spheretrans_not_equal); PG_FUNCTION_INFO_V1(spheretrans_phi); PG_FUNCTION_INFO_V1(spheretrans_theta); PG_FUNCTION_INFO_V1(spheretrans_psi); PG_FUNCTION_INFO_V1(spheretrans_type); PG_FUNCTION_INFO_V1(spheretrans_zxz); PG_FUNCTION_INFO_V1(spheretrans); PG_FUNCTION_INFO_V1(spheretrans_invert); PG_FUNCTION_INFO_V1(spheretrans_trans); PG_FUNCTION_INFO_V1(spheretrans_trans_inv); PG_FUNCTION_INFO_V1(spheretrans_point); PG_FUNCTION_INFO_V1(spheretrans_point_inverse); /* * Checks and modifies the Euler transformation. */ static void spheretrans_check(SEuler *e) { SPoint sp[3]; sp[0].lat = sp[1].lat = sp[2].lat = 0.0; sp[0].lng = e->phi; sp[1].lng = e->theta; sp[2].lng = e->psi; spoint_check(&sp[0]); spoint_check(&sp[1]); spoint_check(&sp[2]); e->phi = sp[0].lng; e->theta = sp[1].lng; e->psi = sp[2].lng; } Datum spheretrans_in(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) palloc(sizeof(SEuler)); char *c = PG_GETARG_CSTRING(0); unsigned char etype[3]; int i; void sphere_yyparse(void); init_buffer(c); sphere_yyparse(); if (get_euler(&se->phi, &se->theta, &se->psi, etype)) { for (i = 0; i < 3; i++) { switch (i) { case 0: se->phi_a = etype[i]; break; case 1: se->theta_a = etype[i]; break; case 2: se->psi_a = etype[i]; break; } } spheretrans_check(se); } else { reset_buffer(); pfree(se); se = NULL; elog(ERROR, "spheretrans_in: parse error"); } reset_buffer(); PG_RETURN_POINTER(se); } Datum spheretrans_from_float8(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) palloc(sizeof(SEuler)); se->phi = PG_GETARG_FLOAT8(0); se->theta = PG_GETARG_FLOAT8(1); se->psi = PG_GETARG_FLOAT8(2); seuler_set_zxz(se); spheretrans_check(se); PG_RETURN_POINTER(se); } Datum spheretrans_from_float8_and_type(PG_FUNCTION_ARGS) { SEuler *se; Datum d[3]; int i; char *c = PG_GETARG_CSTRING(3); unsigned char t = 0; d[0] = PG_GETARG_DATUM(0); d[1] = PG_GETARG_DATUM(1); d[2] = PG_GETARG_DATUM(2); se = (SEuler *) DatumGetPointer( DirectFunctionCall3(spheretrans_from_float8, d[0], d[1], d[2])); for (i = 0; i < 3; i++) { switch (c[i]) { case 'x': case 'X': t = EULER_AXIS_X; break; case 'y': case 'Y': t = EULER_AXIS_Y; break; case 'z': case 'Z': t = EULER_AXIS_Z; break; default: t = 0; } if (t == 0) { pfree(se); elog(ERROR, "invalid axis format"); } switch (i) { case 0: se->phi_a = t; break; case 1: se->theta_a = t; break; case 2: se->psi_a = t; break; } } PG_RETURN_POINTER(se); } void seuler_set_zxz(SEuler *se) { se->phi_a = EULER_AXIS_Z; se->theta_a = EULER_AXIS_X; se->psi_a = EULER_AXIS_Z; } bool strans_eq(const SEuler *e1, const SEuler *e2) { SPoint in[2], p[4]; in[0].lng = 0.0; in[0].lat = 0.0; in[1].lng = PIH; in[1].lat = 0.0; euler_spoint_trans(&p[0], &in[0], e1); euler_spoint_trans(&p[1], &in[1], e1); euler_spoint_trans(&p[2], &in[0], e2); euler_spoint_trans(&p[3], &in[1], e2); return spoint_eq(&p[0], &p[2]) && spoint_eq(&p[1], &p[3]); } Datum spheretrans_equal(PG_FUNCTION_ARGS) { SEuler *e1 = (SEuler *) PG_GETARG_POINTER(0); SEuler *e2 = (SEuler *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(strans_eq(e1, e2)); } Datum spheretrans_not_equal(PG_FUNCTION_ARGS) { SEuler *e1 = (SEuler *) PG_GETARG_POINTER(0); SEuler *e2 = (SEuler *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!strans_eq(e1, e2)); } Datum spheretrans_phi(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(se->phi); } Datum spheretrans_theta(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(se->theta); } Datum spheretrans_psi(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(se->psi); } Datum spheretrans_type(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) PG_GETARG_POINTER(0); BpChar *result = (BpChar *) palloc(3 + VARHDRSZ); char ret[4]; int i; unsigned char t = 0; for (i = 0; i < 3; i++) { switch (i) { case 0: t = se->phi_a; break; case 1: t = se->theta_a; break; case 2: t = se->psi_a; break; } switch (t) { case EULER_AXIS_X: ret[i] = 'X'; break; case EULER_AXIS_Y: ret[i] = 'Y'; break; case EULER_AXIS_Z: ret[i] = 'Z'; break; } } ret[3] = '\0'; SET_VARSIZE(result, 3 + VARHDRSZ); memcpy((void *) VARDATA(result), (void *) &ret[0], 3); PG_RETURN_BPCHAR_P(result); } void spheretrans_inv(SEuler *se) { float8 lng[3]; const unsigned char c = se->phi_a; lng[2] = -se->phi; lng[1] = -se->theta; lng[0] = -se->psi; se->phi = lng[0]; se->theta = lng[1]; se->psi = lng[2]; se->phi_a = se->psi_a; se->psi_a = c; } void spheretrans_inverse(SEuler *se_out, const SEuler *se_in) { memcpy((void *) se_out, (void *) se_in, sizeof(SEuler)); spheretrans_inv(se_out); } void strans_zxz(SEuler *ret, const SEuler *se) { if (se->phi_a == EULER_AXIS_Z && se->theta_a == EULER_AXIS_X && se->psi_a == EULER_AXIS_Z) { memcpy((void *) ret, (void *) se, sizeof(SEuler)); } else { SEuler tmp; tmp.psi = 0.0; tmp.theta = 0.0; tmp.phi = 0.0; seuler_set_zxz(&tmp); seuler_trans_zxz(ret, se, &tmp); } } Datum spheretrans_zxz(PG_FUNCTION_ARGS) { SEuler *si = (SEuler *) PG_GETARG_POINTER(0); SEuler *ret = (SEuler *) palloc(sizeof(SEuler)); strans_zxz(ret, si); PG_RETURN_POINTER(ret); } Datum spheretrans(PG_FUNCTION_ARGS) { Datum d = PG_GETARG_DATUM(0); PG_RETURN_DATUM(d); } Datum spheretrans_invert(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) PG_GETARG_POINTER(0); SEuler *ret = (SEuler *) palloc(sizeof(SEuler)); spheretrans_inverse(ret, se); PG_RETURN_POINTER(ret); } void seuler_trans_zxz(SEuler *out, const SEuler *in, const SEuler *se) { SPoint sp[4]; sp[0].lng = 0.0; sp[0].lat = 0.0; sp[1].lng = PIH; sp[1].lat = 0.0; euler_spoint_trans(&sp[2], &sp[0], in); euler_spoint_trans(&sp[3], &sp[1], in); euler_spoint_trans(&sp[0], &sp[2], se); euler_spoint_trans(&sp[1], &sp[3], se); spherevector_to_euler(out, &sp[0], &sp[1]); } Datum spheretrans_trans(PG_FUNCTION_ARGS) { SEuler *se1 = (SEuler *) PG_GETARG_POINTER(0); SEuler *se2 = (SEuler *) PG_GETARG_POINTER(1); SEuler *out = (SEuler *) palloc(sizeof(SEuler)); seuler_trans_zxz(out, se1, se2); PG_RETURN_POINTER(out); } Datum spheretrans_trans_inv(PG_FUNCTION_ARGS) { SEuler *se1 = (SEuler *) PG_GETARG_POINTER(0); SEuler *se2 = (SEuler *) PG_GETARG_POINTER(1); SEuler *out = (SEuler *) palloc(sizeof(SEuler)); SEuler tmp; spheretrans_inverse(&tmp, se2); seuler_trans_zxz(out, se1, &tmp); spheretrans_check(out); PG_RETURN_POINTER(out); } void euler_spoint_trans(SPoint *out, const SPoint *in, const SEuler *se) { Vector3D v, o; spoint_vector3d(&v, in); euler_vector_trans(&o, &v, se); vector3d_spoint(out, &o); } Datum spheretrans_point(PG_FUNCTION_ARGS) { SPoint *sp = (SPoint *) PG_GETARG_POINTER(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SPoint *out = (SPoint *) palloc(sizeof(SPoint)); euler_spoint_trans(out, sp, se); PG_RETURN_POINTER(out); } Datum spheretrans_point_inverse(PG_FUNCTION_ARGS) { Datum sp = PG_GETARG_DATUM(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SEuler tmp; Datum ret; spheretrans_inverse(&tmp, se); ret = DirectFunctionCall2(spheretrans_point, sp, PointerGetDatum(&tmp)); PG_RETURN_DATUM(ret); } /* * Transforms a spherical vector from 'spb' to 'spe' into an inverse Euler * transformation. Returns true if the transformation was successful. */ static bool spherevector_to_euler_inv(SEuler *se, const SPoint *spb, const SPoint *spe) { if (spoint_eq(spb, spe)) { return false; } else { Vector3D vbeg, vend, vtmp; SPoint spt[2]; SEuler set; spoint_vector3d(&vbeg, spb); spoint_vector3d(&vend, spe); vector3d_cross(&vtmp, &vbeg, &vend); vector3d_spoint(&spt[0], &vtmp); set.phi = -spt[0].lng - PIH; set.theta = spt[0].lat - PIH; set.psi = 0.0; seuler_set_zxz(&set); euler_spoint_trans(&spt[1], spb, &set); set.psi = -spt[1].lng; memcpy((void *) se, (void *) &set, sizeof(SEuler)); } return true; } bool spherevector_to_euler(SEuler *se, const SPoint *spb, const SPoint *spe) { bool ret; ret = spherevector_to_euler_inv(se, spb, spe); if (ret) { spheretrans_inv(se); } return ret; } void euler_vector_trans(Vector3D *out, const Vector3D *in, const SEuler *se) { int i; unsigned char t; const double *a; double u[3], vr[3], sa, ca; t = 0; a = NULL; u[0] = in->x; u[1] = in->y; u[2] = in->z; for (i = 0; i < 3; i++) { switch (i) { case 0: a = &se->phi; t = se->phi_a; break; case 1: a = &se->theta; t = se->theta_a; break; case 2: a = &se->psi; t = se->psi_a; break; } if (FPzero(*a)) { continue; } sa = sin(*a); ca = cos(*a); switch (t) { case EULER_AXIS_X: vr[0] = u[0]; vr[1] = ca * u[1] - sa * u[2]; vr[2] = sa * u[1] + ca * u[2]; break; case EULER_AXIS_Y: vr[0] = ca * u[0] + sa * u[2]; vr[1] = u[1]; vr[2] = ca * u[2] - sa * u[0]; break; case EULER_AXIS_Z: vr[0] = ca * u[0] - sa * u[1]; vr[1] = sa * u[0] + ca * u[1]; vr[2] = u[2]; break; } memcpy((void *) &u[0], (void *) &vr[0], sizeof(u)); } out->x = u[0]; out->y = u[1]; out->z = u[2]; } pgsphere-1.5.1/src/euler.h000066400000000000000000000077341461140101500154130ustar00rootroot00000000000000#ifndef __PGS_EULER_H__ #define __PGS_EULER_H__ #include "point.h" /* * Euler transformation declarations */ /* * Data structure of spherical (Euler) transformation. */ typedef struct { unsigned char phi_a:2, /* first axis */ theta_a:2, /* second axis */ psi_a:2; /* third axis */ float8 phi, /* first rotation angle */ theta, /* second rotation angle */ psi; /* third rotation angle */ } SEuler; /* * Transforms a spherical point and returns the pointer to a transformed spherical * point. */ extern void euler_spoint_trans(SPoint *out, const SPoint *in, const SEuler *se); /* * Transforms a spherical vector from 'spb' to 'spe' into an Euler transformation. * Returns true if the transformation was successful. */ extern bool spherevector_to_euler(SEuler *se, const SPoint *spb, const SPoint *spe); /* * Sets the axes of transformation to ZXZ. */ extern void seuler_set_zxz(SEuler *se); /* * Checks equality of two transformations. */ extern bool strans_eq(const SEuler *e1, const SEuler *e2); /* * Transforms a vector using an Euler transformation. Returns the pointer to * the result vector. */ extern void euler_vector_trans(Vector3D *out, const Vector3D *in, const SEuler *se); /* * Inverts an Euler transformation. Returns the pointer to the * inverted transformation. */ extern void spheretrans_inverse(SEuler *se_out, const SEuler *se_in); /* * Inverts an Euler transformation replacing the original Euler transformation. * Returns the pointer to the inverted transformation. */ extern void spheretrans_inv(SEuler *se); /* * Converts an Euler transformation to a ZXZ-axis transformation. Returns * the pointer to the converted transformation. */ extern void strans_zxz(SEuler *ret, const SEuler *se); /* * Transforms an Euler transformation 'in' into 'out' using 'se'. The result * is always a ZXZ-axis transformation. Returns the pointer to the transformed * transformation. */ extern void seuler_trans_zxz(SEuler *out, const SEuler *in, const SEuler *se); /* * Input of an Euler transformation. */ extern Datum spheretrans_in(PG_FUNCTION_ARGS); /* * Input of an Euler transformation with axis Z,X,Z from three angles * (phi, theta, psi) in radians. */ extern Datum spheretrans_from_float8(PG_FUNCTION_ARGS); /* * Returns the first angle of an Euler transformation in radians. */ extern Datum spheretrans_phi(PG_FUNCTION_ARGS); /* * Returns the second angle of an Euler transformation in radians. */ extern Datum spheretrans_theta(PG_FUNCTION_ARGS); /* * Returns the third angle of an Euler transformation in radians. */ extern Datum spheretrans_psi(PG_FUNCTION_ARGS); /* * Returns the axis of an Euler transformation as three letter code. */ extern Datum spheretrans_type(PG_FUNCTION_ARGS); /* * Returns the Euler transformation (does nothing). This function is needed * for +strans operator. */ extern Datum spheretrans(PG_FUNCTION_ARGS); /* * Returns the inverse Euler transformation. */ extern Datum spheretrans_invert(PG_FUNCTION_ARGS); /* * Convert an Euler transformation to a ZXZ-axis transformation. */ extern Datum spheretrans_zxz(PG_FUNCTION_ARGS); /* * This function creates an Euler transformation from 3 angle values in * radians and three letter code used for axes. A letter can be X, Y or Z * (case-insensitive). */ extern Datum spheretrans_from_float8_and_type(PG_FUNCTION_ARGS); /* * Checks equality of two Euler transformations. */ extern Datum spheretrans_equal(PG_FUNCTION_ARGS); /* * Checks inequality of two Euler transformations. */ extern Datum spheretrans_not_equal(PG_FUNCTION_ARGS); /* * Transforms an Euler transformation. */ extern Datum spheretrans_trans(PG_FUNCTION_ARGS); /* * Transforms inverse an Euler transformations. */ extern Datum spheretrans_trans_inv(PG_FUNCTION_ARGS); /* * Transforms a spherical point. */ extern Datum spheretrans_point(PG_FUNCTION_ARGS); /* * Perform inverse transformation of a spherical point. */ extern Datum spheretrans_point_inverse(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/gist.c000066400000000000000000001710701461140101500152330ustar00rootroot00000000000000#include "gist.h" /* * Functions needed to build a GIST index */ PG_FUNCTION_INFO_V1(pointkey_in); PG_FUNCTION_INFO_V1(pointkey_out); PG_FUNCTION_INFO_V1(pointkey_volume); PG_FUNCTION_INFO_V1(pointkey_area); PG_FUNCTION_INFO_V1(pointkey_perimeter); PG_FUNCTION_INFO_V1(spherekey_in); PG_FUNCTION_INFO_V1(spherekey_out); PG_FUNCTION_INFO_V1(g_spherekey_decompress); PG_FUNCTION_INFO_V1(g_scircle_compress); PG_FUNCTION_INFO_V1(g_spoint_compress); PG_FUNCTION_INFO_V1(g_spoint3_compress); PG_FUNCTION_INFO_V1(g_sline_compress); PG_FUNCTION_INFO_V1(g_spath_compress); PG_FUNCTION_INFO_V1(g_spoly_compress); PG_FUNCTION_INFO_V1(g_sellipse_compress); PG_FUNCTION_INFO_V1(g_sbox_compress); PG_FUNCTION_INFO_V1(g_spherekey_union); PG_FUNCTION_INFO_V1(g_spherekey_same); PG_FUNCTION_INFO_V1(g_spoint3_union); PG_FUNCTION_INFO_V1(g_spoint3_same); PG_FUNCTION_INFO_V1(g_spoint_consistent); PG_FUNCTION_INFO_V1(g_spoint3_consistent); PG_FUNCTION_INFO_V1(g_scircle_consistent); PG_FUNCTION_INFO_V1(g_sline_consistent); PG_FUNCTION_INFO_V1(g_spath_consistent); PG_FUNCTION_INFO_V1(g_spoly_consistent); PG_FUNCTION_INFO_V1(g_sellipse_consistent); PG_FUNCTION_INFO_V1(g_sbox_consistent); PG_FUNCTION_INFO_V1(g_spherekey_penalty); PG_FUNCTION_INFO_V1(g_spherekey_picksplit); PG_FUNCTION_INFO_V1(g_spoint3_penalty); PG_FUNCTION_INFO_V1(g_spoint3_picksplit); PG_FUNCTION_INFO_V1(g_spoint_distance); PG_FUNCTION_INFO_V1(g_spoint3_distance); PG_FUNCTION_INFO_V1(g_spoint3_fetch); /* * Returns the relationship between two keys as PGS_KEY_REL. */ uchar spherekey_interleave(const int32 *k1, const int32 *k2) { uchar i; char tb; /* i represents x,y,z */ tb = 0; for (i = 0; i < 3; i++) { tb |= ((k2[i] > k1[i + 3]) || (k1[i] > k2[i + 3])); if (tb) break; } if (tb) { return SCKEY_DISJ; } tb = 1; for (i = 0; i < 3; i++) { tb &= ((k1[i] == k2[i]) && (k1[i + 3] == k2[i + 3])); if (!tb) break; } if (tb) { return SCKEY_SAME; } tb = 1; for (i = 0; i < 3; i++) { tb &= (k1[i] <= k2[i] && k1[i + 3] >= k2[i + 3]); if (!tb) break; } if (tb) { /* v2 in v1 */ return SCKEY_IN; } return SCKEY_OVERLAP; } Datum spherekey_in(PG_FUNCTION_ARGS) { elog(ERROR, "Not implemented!"); PG_RETURN_POINTER(NULL); } Datum spherekey_out(PG_FUNCTION_ARGS) { const float8 ks = (float8) MAXCVALUE; int32 *k = (int32 *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(1024); sprintf(buffer, "(%.9f,%.9f,%.9f),(%.9f,%.9f,%.9f)", k[0] / ks, k[1] / ks, k[2] / ks, k[3] / ks, k[4] / ks, k[5] / ks); PG_RETURN_CSTRING(buffer); } static bool get_sizes(GiSTSPointKey *k, float8 sizes[3]) { int i; const float8 ks = (float8) MAXCVALUE; if (IS_LEAF(k)) return false; for (i = 0; i < 3; i++) { sizes[i] = (((uint64) k->k[i + 3] - (uint64) k->k[i]) + 1) / ks; } return true; } Datum pointkey_volume(PG_FUNCTION_ARGS) { GiSTSPointKey *k = (GiSTSPointKey *) PG_GETARG_POINTER(0); float8 sizes[3]; if (!get_sizes(k, sizes)) PG_RETURN_FLOAT8(0.0); PG_RETURN_FLOAT8(sizes[0] * sizes[1] * sizes[2]); } Datum pointkey_area(PG_FUNCTION_ARGS) { GiSTSPointKey *k = (GiSTSPointKey *) PG_GETARG_POINTER(0); float8 sizes[3]; if (!get_sizes(k, sizes)) PG_RETURN_FLOAT8(0.0); PG_RETURN_FLOAT8(sizes[0] * sizes[1] + sizes[0] * sizes[2] + sizes[1] * sizes[2]); } Datum pointkey_perimeter(PG_FUNCTION_ARGS) { GiSTSPointKey *k = (GiSTSPointKey *) PG_GETARG_POINTER(0); float8 sizes[3]; if (!get_sizes(k, sizes)) PG_RETURN_FLOAT8(0.0); PG_RETURN_FLOAT8(sizes[0] + sizes[1] + sizes[2]); } Datum pointkey_in(PG_FUNCTION_ARGS) { elog(ERROR, "Not implemented!"); PG_RETURN_POINTER(NULL); } Datum pointkey_out(PG_FUNCTION_ARGS) { const float8 ks = (float8) MAXCVALUE; GiSTSPointKey *k = (GiSTSPointKey *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(1024); if (IS_LEAF(k)) { sprintf(buffer, "(%.9f,%.9f)", k->lng, k->lat); } else { sprintf(buffer, "(%.9f,%.9f,%.9f),(%.9f,%.9f,%.9f)", k->k[0] / ks, k->k[1] / ks, k->k[2] / ks, k->k[3] / ks, k->k[4] / ks, k->k[5] / ks); } PG_RETURN_CSTRING(buffer); } Datum g_spherekey_decompress(PG_FUNCTION_ARGS) { PG_RETURN_DATUM(PG_GETARG_DATUM(0)); } /* * General compress method for all data types. Uses genkey to generate key * value (see key.c). */ #define PGS_COMPRESS(type, genkey, detoast) \ do \ { \ GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); \ GISTENTRY *retval; \ if (entry->leafkey) \ { \ retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); \ if (DatumGetPointer(entry->key) != NULL) \ { \ int32 *k = (int32 *) palloc(KEYSIZE); \ if (detoast) \ genkey(k, (type *) (PG_DETOAST_DATUM(entry->key))); \ else \ genkey(k, (type *) DatumGetPointer(entry->key)); \ gistentryinit(*retval, PointerGetDatum(k), \ entry->rel, entry->page, \ entry->offset, false); \ } \ else \ { \ gistentryinit(*retval, (Datum) 0, \ entry->rel, entry->page, \ entry->offset, false); \ } \ } \ else \ { \ retval = entry; \ } \ PG_RETURN_POINTER(retval); \ } \ while (0) Datum g_scircle_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SCIRCLE, spherecircle_gen_key, 0); } Datum g_spoint_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SPoint, spherepoint_gen_key, 0); } Datum g_sline_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SLine, sphereline_gen_key, 0); } Datum g_spath_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SPATH, spherepath_gen_key, 1); } Datum g_spoly_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SPOLY, spherepoly_gen_key, 1); } Datum g_sellipse_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SELLIPSE, sphereellipse_gen_key, 0); } Datum g_sbox_compress(PG_FUNCTION_ARGS) { PGS_COMPRESS(SBOX, spherebox_gen_key, 0); } Datum g_spoint3_compress(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); GISTENTRY *retval; if (entry->leafkey) { retval = palloc(sizeof(GISTENTRY)); if (DatumGetPointer(entry->key) != NULL) { GiSTSPointKey *key; SPoint *p = (SPoint *) DatumGetPointer(entry->key); ALLOC_LEAF_KEY(key); key->lat = p->lat; key->lng = p->lng; gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, entry->offset, false); } else { gistentryinit(*retval, (Datum) 0, entry->rel, entry->page, entry->offset, false); } } else { retval = entry; } PG_RETURN_POINTER(retval); } Datum g_spherekey_union(PG_FUNCTION_ARGS) { GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); int *sizep = (int *) PG_GETARG_POINTER(1); int numranges, i; int32 *ret = (int32 *) palloc(KEYSIZE); numranges = entryvec->n; memcpy((void *) ret, (void *) DatumGetPointer(entryvec->vector[0].key), KEYSIZE); for (i = 1; i < numranges; i++) { spherekey_union_two(ret, (int32 *) DatumGetPointer(entryvec->vector[i].key)); } *sizep = KEYSIZE; PG_RETURN_POINTER(ret); } Datum g_spoint3_union(PG_FUNCTION_ARGS) { GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); int *sizep = (int *) PG_GETARG_POINTER(1); int numranges, i; GiSTSPointKey *ret; ALLOC_INTERNAL_KEY(ret); numranges = entryvec->n; for (i = 0; i < numranges; i++) { GiSTSPointKey *key; int32 *p; int32 k[6]; key = (GiSTSPointKey *) DatumGetPointer(entryvec->vector[i].key); if (IS_LEAF(key)) { SPoint point; point.lat = key->lat; point.lng = key->lng; spherepoint_gen_key(k, &point); p = k; } else { p = key->k; } if (i == 0) memcpy(ret->k, p, KEYSIZE); else spherekey_union_two(ret->k, p); /* checkKey(ret); */ } *sizep = KEYSIZE; PG_RETURN_POINTER(ret); } Datum g_spherekey_same(PG_FUNCTION_ARGS) { int32 *c1 = (int32 *) PG_GETARG_POINTER(0); int32 *c2 = (int32 *) PG_GETARG_POINTER(1); bool *result = (bool *) PG_GETARG_POINTER(2); int i; *result = true; if (c1 && c2) { for (i = 0; i < 6; i++) { *result &= (c1[i] == c2[i]); } } else { *result = (c1 == NULL && c2 == NULL) ? true : false; } PG_RETURN_POINTER(result); } Datum g_spoint3_same(PG_FUNCTION_ARGS) { GiSTSPointKey *key1 = (GiSTSPointKey *) PG_GETARG_POINTER(0); GiSTSPointKey *key2 = (GiSTSPointKey *) PG_GETARG_POINTER(1); bool *result = (bool *) PG_GETARG_POINTER(2); *result = true; if (key1 && key2) { if (VARSIZE(key1) == VARSIZE(key2)) { *result = memcmp(key1, key2, VARSIZE(key1)) ? false : true; } else { *result = false; } } else { *result = (key1 == NULL && key2 == NULL) ? true : false; } PG_RETURN_POINTER(result); } /* * General interleave method with query cache. genkey function is used to * generate the key value. "dir" defines which value is the first for * spherekey_interleave: 0 - query key, 1 - entry key. */ #define SCK_INTERLEAVE(type, genkey, dir) \ do \ { \ int32 * q = NULL; \ if (!gq_cache_get_value (PGS_TYPE_##type, query, &q)) \ { \ q = (int32 *) malloc(KEYSIZE); \ genkey(q, (type * )query); \ gq_cache_set_value(PGS_TYPE_##type, query, q); \ free(q); \ gq_cache_get_value(PGS_TYPE_##type, query, &q); \ } \ if (dir) \ i = spherekey_interleave(ent, q); \ else \ i = spherekey_interleave(q , ent); \ } \ while (0) Datum g_spoint_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 13: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 14: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 15: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 16: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 39: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 40: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 41: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 42: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_OVERLAP) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } Datum g_spoint3_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); GiSTSPointKey *key = (GiSTSPointKey *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = false; if (!IS_LEAF(key)) { int32 *ent = key->k; switch (strategy) { case 1: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 13: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 14: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 15: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 16: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 39: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 40: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 41: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 42: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; } switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { SPoint point; point.lat = key->lat; point.lng = key->lng; switch (strategy) { case 1: result = spoint_eq(&point, (SPoint *) query); break; case 11: result = spoint_in_circle(&point, (SCIRCLE *) query); break; case 12: result = spoint_at_sline(&point, (SLine *) query); break; case 13: result = spath_cont_point((SPATH *) query, &point); break; case 14: result = spoly_contains_point((SPOLY *) query, &point); break; case 15: result = sellipse_cont_point((SELLIPSE *) query, &point); break; case 16: result = sbox_cont_point((SBOX *) query, &point); break; case 37: result = spoint_in_circle(&point, (SCIRCLE *) query); break; case 38: result = spoint_at_sline(&point, (SLine *) query); break; case 39: result = spath_cont_point((SPATH *) query, &point); break; case 40: result = spoly_contains_point((SPOLY *) query, &point); break; case 41: result = sellipse_cont_point((SELLIPSE *) query, &point); break; case 42: result = sbox_cont_point((SBOX *) query, &point); break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } static double distance_vector_point_3d(Vector3D *v, double x, double y, double z) { /* as v has length = 1 by design */ return acos((v->x * x + v->y * y + v->z * z) / sqrt(x * x + y * y + z * z)); } Datum g_spoint3_distance(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); SPoint *query = (SPoint *) PG_GETARG_POINTER(1); /* StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); */ GiSTSPointKey *key = (GiSTSPointKey *) DatumGetPointer(entry->key); if (IS_LEAF(key)) { SPoint point; point.lat = key->lat; point.lng = key->lng; PG_RETURN_FLOAT8(spoint_dist(&point, query)); } else { Vector3D v; float8 sum = 0.0, x_min, x_max, y_min, y_max, z_min, z_max; spoint_vector3d(&v, query); x_min = (float8) key->k[0] / (float8) MAXCVALUE; x_max = (float8) (key->k[3] + 1) / (float8) MAXCVALUE; if (v.x < x_min) sum += Sqr(v.x - x_min); else if (v.x > x_max) sum += Sqr(v.x - x_max); y_min = (float8) key->k[1] / (float8) MAXCVALUE; y_max = (float8) (key->k[4] + 1) / (float8) MAXCVALUE; if (v.y < y_min) sum += Sqr(v.y - y_min); else if (v.y > y_max) sum += Sqr(v.y - y_max); z_min = (float8) key->k[2] / (float8) MAXCVALUE; z_max = (float8) (key->k[5] + 1) / (float8) MAXCVALUE; if (v.z < z_min) sum += Sqr(v.z - z_min); else if (v.z > z_max) sum += Sqr(v.z - z_max); PG_RETURN_FLOAT8(sqrt(sum)); } } Datum g_spoint3_fetch(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); GiSTSPointKey *key = (GiSTSPointKey *) DatumGetPointer(entry->key); GISTENTRY *retval; SPoint *p; retval = palloc(sizeof(GISTENTRY)); p = palloc(sizeof(SPoint)); p->lat = key->lat; p->lng = key->lng; gistentryinit(*retval, PointerGetDatum(p), entry->rel, entry->page, entry->offset, false); PG_RETURN_POINTER(retval); } Datum g_scircle_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 13: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 14: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 21: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 22: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 23: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 24: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 25: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 26: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 27: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 31: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 32: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 33: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 34: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 35: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 36: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 39: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 40: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 43: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 44: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 45: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 46: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 47: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 48: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 49: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } Datum g_sline_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: case 2: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 13: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 14: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 21: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 31: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 32: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 33: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 34: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 35: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 36: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 39: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 40: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 43: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } Datum g_spath_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 13: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 14: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 21: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 31: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 32: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 33: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 34: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 35: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 36: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 39: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 40: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 43: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } Datum g_spoly_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 13: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 14: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 21: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 22: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 23: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 24: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 25: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 26: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 27: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 31: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 32: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 33: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 34: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 35: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 36: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 39: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 40: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 43: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 44: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 45: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 46: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 47: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 48: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 49: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } Datum g_sellipse_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 13: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 14: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 21: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 22: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 23: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 24: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 25: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 26: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 27: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 31: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 32: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 33: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 34: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 35: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 36: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 39: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 40: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 43: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 44: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 45: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 46: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 47: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 48: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 49: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } Datum g_sbox_consistent(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); void *query = (void *) PG_GETARG_POINTER(1); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); bool result = false; if (DatumGetPointer(entry->key) == NULL || !query) { PG_RETURN_BOOL(false); } else { bool *recheck = (bool *) PG_GETARG_POINTER(4); int32 *ent = (int32 *) DatumGetPointer(entry->key); int i = SCKEY_DISJ; *recheck = true; switch (strategy) { case 1: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 11: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 12: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 13: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 14: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 21: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 22: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 23: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 24: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 25: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 26: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 27: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; case 31: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 32: SCK_INTERLEAVE(SLine, sphereline_gen_key, 0); break; case 33: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 0); break; case 34: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 35: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 36: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 37: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 0); break; case 38: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 0); break; case 39: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 0); break; case 40: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 0); break; case 43: SCK_INTERLEAVE(SPoint, spherepoint_gen_key, 1); break; case 44: SCK_INTERLEAVE(SCIRCLE, spherecircle_gen_key, 1); break; case 45: SCK_INTERLEAVE(SLine, sphereline_gen_key, 1); break; case 46: SCK_INTERLEAVE(SPATH, spherepath_gen_key, 1); break; case 47: SCK_INTERLEAVE(SPOLY, spherepoly_gen_key, 1); break; case 48: SCK_INTERLEAVE(SELLIPSE, sphereellipse_gen_key, 1); break; case 49: SCK_INTERLEAVE(SBOX, spherebox_gen_key, 1); break; } if (GIST_LEAF(entry)) { switch (strategy) { case 1: if (i == SCKEY_SAME) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } else { switch (strategy) { case 1: if (i > SCKEY_OVERLAP) result = true; break; default: if (i > SCKEY_DISJ) result = true; break; } } PG_RETURN_BOOL(result); } PG_RETURN_BOOL(false); } typedef int32 coord_t; typedef struct { coord_t coord[3]; } Point3D; typedef struct { Point3D low; Point3D high; } Box3D; #ifdef NOT_USED static void checkBox3D(Box3D *box) { int i; for (i = 0; i < 3; i++) { if (box->low.coord[i] < -MAXCVALUE || box->low.coord[i] > MAXCVALUE) { elog(ERROR, "Invalid key!"); } if (box->high.coord[i] < -MAXCVALUE || box->high.coord[i] > MAXCVALUE) { elog(ERROR, "Invalid key!"); } } } #endif static void adjustBox3D(Box3D *b, Box3D *addon) { int i; for (i = 0; i < 3; i++) { if (b->high.coord[i] < addon->high.coord[i]) b->high.coord[i] = addon->high.coord[i]; if (b->low.coord[i] > addon->low.coord[i]) b->low.coord[i] = addon->low.coord[i]; } } static inline double sizeBox3D(Box3D *b) { return (double) ((int64) b->high.coord[0] - (int64) b->low.coord[0]) / MAXCVALUE * (double) ((int64) b->high.coord[1] - (int64) b->low.coord[1]) / MAXCVALUE * (double) ((int64) b->high.coord[2] - (int64) b->low.coord[2]) / MAXCVALUE; } static inline double unionSizeBox3D(Box3D *a, Box3D *b) { return (double) ((int64) Max(a->high.coord[0], b->high.coord[0]) - (int64) Min(a->low.coord[0], b->low.coord[0])) / MAXCVALUE * (double) ((int64) Max(a->high.coord[1], b->high.coord[1]) - (int64) Min(a->low.coord[1], b->low.coord[1])) / MAXCVALUE * (double) ((int64) Max(a->high.coord[2], b->high.coord[2]) - (int64) Min(a->low.coord[2], b->low.coord[2])) / MAXCVALUE; } /* * Trivial split: half of entries will be placed on one page * and another half - to another. */ static void fallbackSplit(Box3D *boxes, OffsetNumber maxoff, GIST_SPLITVEC *v) { OffsetNumber i; Box3D *unionL = NULL, *unionR = NULL; int nbytes; nbytes = (maxoff + 2) * sizeof(OffsetNumber); v->spl_left = (OffsetNumber *) palloc(nbytes); v->spl_right = (OffsetNumber *) palloc(nbytes); v->spl_nleft = v->spl_nright = 0; for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { Box3D *cur = &boxes[i]; if (i <= (maxoff - FirstOffsetNumber + 1) / 2) { v->spl_left[v->spl_nleft] = i; if (unionL == NULL) { unionL = (Box3D *) palloc(sizeof(Box3D)); *unionL = *cur; } else adjustBox3D(unionL, cur); v->spl_nleft++; } else { v->spl_right[v->spl_nright] = i; if (unionR == NULL) { unionR = (Box3D *) palloc(sizeof(Box3D)); *unionR = *cur; } else adjustBox3D(unionR, cur); v->spl_nright++; } } if (v->spl_ldatum_exists) adjustBox3D(unionL, (Box3D *) DatumGetPointer(v->spl_ldatum)); v->spl_ldatum = PointerGetDatum(unionL); if (v->spl_rdatum_exists) adjustBox3D(unionR, (Box3D *) DatumGetPointer(v->spl_rdatum)); v->spl_rdatum = PointerGetDatum(unionR); v->spl_ldatum_exists = v->spl_rdatum_exists = false; } Datum g_spoint_distance(PG_FUNCTION_ARGS) { GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); Box3D *box = (Box3D *) DatumGetPointer(entry->key); double retval; SPoint *point = (SPoint *) PG_GETARG_POINTER(1); Vector3D v_point, v_low, v_high; switch (strategy) { case 17: /* Prepare data for calculation */ spoint_vector3d(&v_point, point); v_low.x = (double) box->low.coord[0] / MAXCVALUE; v_low.y = (double) box->low.coord[1] / MAXCVALUE; v_low.z = (double) box->low.coord[2] / MAXCVALUE; v_high.x = (double) box->high.coord[0] / MAXCVALUE; v_high.y = (double) box->high.coord[1] / MAXCVALUE; v_high.z = (double) box->high.coord[2] / MAXCVALUE; /* * a box splits space into 27 subspaces (6+12+8+1) with different * distance calculation */ if (v_point.x < v_low.x) { if (v_point.y < v_low.y) { if (v_point.z < v_low.z) { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_low.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_low.y, v_point.z); } else { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_low.y, v_high.z); } } else if (v_point.y < v_high.y) { if (v_point.z < v_low.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_point.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2plane distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_point.y, v_point.z); } else { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_point.y, v_high.z); } } else { if (v_point.z < v_low.z) { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_high.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_high.y, v_point.z); } else { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_low.x, v_high.y, v_high.z); } } } else if (v_point.x < v_high.x) { if (v_point.y < v_low.y) { if (v_point.z < v_low.z) { /* p2line distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_low.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2plane distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_low.y, v_point.z); } else { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_low.y, v_high.z); } } else if (v_point.y < v_high.y) { if (v_point.z < v_low.z) { /* point2plane distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_point.y, v_low.z); } else if (v_point.z < v_high.z) { /* inside cube */ retval = 0; } else { /* point2plane distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_point.y, v_high.z); } } else { if (v_point.z < v_low.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_high.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2plane distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_high.y, v_point.z); } else { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_point.x, v_high.y, v_high.z); } } } else { if (v_point.y < v_low.y) { if (v_point.z < v_low.z) { /* p2p distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_low.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_low.y, v_point.z); } else { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_low.y, v_high.z); } } else if (v_point.y < v_high.y) { if (v_point.z < v_low.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_point.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2plane distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_point.y, v_point.z); } else { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_point.y, v_high.z); } } else { if (v_point.z < v_low.z) { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_high.y, v_low.z); } else if (v_point.z < v_high.z) { /* point2line distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_high.y, v_point.z); } else { /* point2point distance */ retval = distance_vector_point_3d(&v_point, v_high.x, v_high.y, v_high.z); } } } elog(DEBUG1, "distance (%lg,%lg,%lg %lg,%lg,%lg) <-> (%lg,%lg) = %lg", v_low.x, v_low.y, v_low.z, v_high.x, v_high.y, v_high.z, point->lng, point->lat, retval ); break; default: elog(ERROR, "unrecognized cube strategy number: %d", strategy); retval = 0; /* keep compiler quiet */ break; } PG_RETURN_FLOAT8(retval); } /* * Represents information about an entry that can be placed to either group * without affecting overlap over selected axis ("common entry"). */ typedef struct { /* Index of entry in the initial array */ int index; /* Delta between penalties of entry insertion into different groups */ double delta; } CommonEntry; /* * Context for g_box_consider_split. Contains information about currently * selected split and some general information. */ typedef struct { int entriesCount; /* total number of entries being split */ Box3D boundingBox; /* minimum bounding box across all entries */ /* Information about currently selected split follows */ bool first; /* true if no split was selected yet */ coord_t leftUpper; /* upper bound of left interval */ coord_t rightLower; /* lower bound of right interval */ float4 ratio; float4 overlap; int dim; /* axis of this split */ double range; /* width of general MBR projection to the * selected axis */ } ConsiderSplitContext; /* * Interval represents projection of box to axis. */ typedef struct { coord_t lower, upper; } SplitInterval; /* * Interval comparison function by lower bound of the interval; */ static inline int interval_cmp_lower(const void *i1, const void *i2) { coord_t lower1 = ((const SplitInterval *) i1)->lower, lower2 = ((const SplitInterval *) i2)->lower; if (lower1 < lower2) return -1; else if (lower1 > lower2) return 1; else return 0; } /* * Interval comparison function by upper bound of the interval; */ static inline int interval_cmp_upper(const void *i1, const void *i2) { coord_t upper1 = ((const SplitInterval *) i1)->upper, upper2 = ((const SplitInterval *) i2)->upper; if (upper1 < upper2) return -1; else if (upper1 > upper2) return 1; else return 0; } /* * Replace negative value with zero. */ static inline float non_negative(float val) { if (val >= 0.0f) return val; else return 0.0f; } /* Minimum accepted ratio of split */ #define LIMIT_RATIO 0.3 /* * Consider replacement of currently selected split with the better one. */ static inline void g_box_consider_split(ConsiderSplitContext *context, int dimNum, coord_t rightLower, int minLeftCount, coord_t leftUpper, int maxLeftCount) { int leftCount, rightCount; float4 ratio, overlap; double range; /* * Calculate entries distribution ratio assuming most uniform distribution * of common entries. */ if (minLeftCount >= (context->entriesCount + 1) / 2) { leftCount = minLeftCount; } else { if (maxLeftCount <= context->entriesCount / 2) leftCount = maxLeftCount; else leftCount = context->entriesCount / 2; } rightCount = context->entriesCount - leftCount; /* * Ratio of split - quotient between size of lesser group and total * entries count. */ ratio = ((float4) Min(leftCount, rightCount)) / ((float4) context->entriesCount); if (ratio > LIMIT_RATIO) { bool selectthis = false; /* * The ratio is acceptable, so compare current split with previously * selected one. Between splits of one dimension we search for minimal * overlap (allowing negative values) and minimal ration (between same * overlaps. We switch dimension if find less overlap (non-negative) * or less range with same overlap. */ range = (float8) context->boundingBox.high.coord[dimNum] - (float8) context->boundingBox.low.coord[dimNum]; overlap = ((float8) leftUpper - (float8) rightLower) / range; /* If there is no previous selection, select this */ if (context->first) selectthis = true; else if (context->dim == dimNum) { /* * Within the same dimension, choose the new split if it has a * smaller overlap, or same overlap but better ratio. */ if (overlap < context->overlap || (overlap == context->overlap && ratio > context->ratio)) selectthis = true; } else { /* * Across dimensions, choose the new split if it has a smaller * *non-negative* overlap, or same *non-negative* overlap but * bigger range. This condition differs from the one described in * the article. On the datasets where leaf MBRs don't overlap * themselves, non-overlapping splits (i.e. splits which have zero * *non-negative* overlap) are frequently possible. In this case * splits tends to be along one dimension, because most distant * non-overlapping splits (i.e. having lowest negative overlap) * appears to be in the same dimension as in the previous split. * Therefore MBRs appear to be very prolonged along another * dimension, which leads to bad search performance. Using range * as the second split criteria makes MBRs more quadratic. Using * *non-negative* overlap instead of overlap as the first split * criteria gives to range criteria a chance to matter, because * non-overlapping splits are equivalent in this criteria. */ if (non_negative(overlap) < non_negative(context->overlap) || (range > context->range && non_negative(overlap) <= non_negative(context->overlap))) selectthis = true; } if (selectthis) { /* save information about selected split */ context->first = false; context->ratio = ratio; context->range = range; context->overlap = overlap; context->rightLower = rightLower; context->leftUpper = leftUpper; context->dim = dimNum; } } } /* * Compare common entries by their deltas. */ static int common_entry_cmp(const void *i1, const void *i2) { double delta1 = ((const CommonEntry *) i1)->delta, delta2 = ((const CommonEntry *) i2)->delta; if (delta1 < delta2) return -1; else if (delta1 > delta2) return 1; else return 0; } /* * -------------------------------------------------------------------------- * Double sorting split algorithm. This is used for both boxes and points. * * The algorithm finds split of boxes by considering splits along each axis. * Each entry is first projected as an interval on the X-axis, and different * ways to split the intervals into two groups are considered, trying to * minimize the overlap of the groups. Then the same is repeated for the * Y-axis, and the overall best split is chosen. The quality of a split is * determined by overlap along that axis and some other criteria (see * g_box_consider_split). * * After that, all the entries are divided into three groups: * * 1) Entries which should be placed to the left group * 2) Entries which should be placed to the right group * 3) "Common entries" which can be placed to any of groups without affecting * of overlap along selected axis. * * The common entries are distributed by minimizing penalty. * * For details see: * "A new double sorting-based node splitting algorithm for R-tree", A. Korotkov * http://syrcose.ispras.ru/2011/files/SYRCoSE2011_Proceedings.pdf#page=36 * -------------------------------------------------------------------------- */ static void do_picksplit(Box3D *boxes, OffsetNumber maxoff, GIST_SPLITVEC *v) { OffsetNumber i; ConsiderSplitContext context; Box3D *box, *leftBox, *rightBox; int dim, commonEntriesCount; SplitInterval *intervalsLower, *intervalsUpper; CommonEntry *commonEntries; int nentries; double leftBoxSize, rightBoxSize; memset(&context, 0, sizeof(ConsiderSplitContext)); nentries = context.entriesCount = maxoff - FirstOffsetNumber + 1; /* Allocate arrays for intervals along axes */ intervalsLower = (SplitInterval *) palloc(nentries * sizeof(SplitInterval)); intervalsUpper = (SplitInterval *) palloc(nentries * sizeof(SplitInterval)); /* * Calculate the overall minimum bounding box over all the entries. */ for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { box = &boxes[i]; if (i == FirstOffsetNumber) context.boundingBox = *box; else adjustBox3D(&context.boundingBox, box); } /* * Iterate over axes for optimal split searching. */ context.first = true; /* nothing selected yet */ for (dim = 0; dim < 3; dim++) { coord_t leftUpper, rightLower; int i1, i2; /* Project each entry as an interval on the selected axis. */ for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { box = &boxes[i]; intervalsLower[i - FirstOffsetNumber].lower = box->low.coord[dim]; intervalsLower[i - FirstOffsetNumber].upper = box->high.coord[dim]; } /* * Make two arrays of intervals: one sorted by lower bound and another * sorted by upper bound. */ memcpy(intervalsUpper, intervalsLower, sizeof(SplitInterval) * nentries); qsort(intervalsLower, nentries, sizeof(SplitInterval), interval_cmp_lower); qsort(intervalsUpper, nentries, sizeof(SplitInterval), interval_cmp_upper); /*---- * The goal is to form a left and right interval, so that every entry * interval is contained by either left or right interval (or both). * * For example, with the intervals (0,1), (1,3), (2,3), (2,4): * * 0 1 2 3 4 * +-+ * +---+ * +-+ * +---+ * * The left and right intervals are of the form (0,a) and (b,4). * We first consider splits where b is the lower bound of an entry. * We iterate through all entries, and for each b, calculate the * smallest possible a. Then we consider splits where a is the * uppper bound of an entry, and for each a, calculate the greatest * possible b. * * In the above example, the first loop would consider splits: * b=0: (0,1)-(0,4) * b=1: (0,1)-(1,4) * b=2: (0,3)-(2,4) * * And the second loop: * a=1: (0,1)-(1,4) * a=3: (0,3)-(2,4) * a=4: (0,4)-(2,4) */ /* * Iterate over lower bound of right group, finding smallest possible * upper bound of left group. */ i1 = 0; i2 = 0; rightLower = intervalsLower[i1].lower; leftUpper = intervalsUpper[i2].lower; while (true) { /* * Find next lower bound of right group. */ while (i1 < nentries && rightLower == intervalsLower[i1].lower) { leftUpper = Max(leftUpper, intervalsLower[i1].upper); i1++; } if (i1 >= nentries) break; rightLower = intervalsLower[i1].lower; /* * Find count of intervals which anyway should be placed to the * left group. */ while (i2 < nentries && intervalsUpper[i2].upper <= leftUpper) i2++; /* * Consider found split. */ g_box_consider_split(&context, dim, rightLower, i1, leftUpper, i2); } /* * Iterate over upper bound of left group finding greates possible * lower bound of right group. */ i1 = nentries - 1; i2 = nentries - 1; rightLower = intervalsLower[i1].upper; leftUpper = intervalsUpper[i2].upper; while (true) { /* * Find next upper bound of left group. */ while (i2 >= 0 && leftUpper == intervalsUpper[i2].upper) { rightLower = Min(rightLower, intervalsUpper[i2].lower); i2--; } if (i2 < 0) break; leftUpper = intervalsUpper[i2].upper; /* * Find count of intervals which anyway should be placed to the * right group. */ while (i1 >= 0 && intervalsLower[i1].lower >= rightLower) i1--; /* * Consider found split. */ g_box_consider_split(&context, dim, rightLower, i1 + 1, leftUpper, i2 + 1); } } /* * If we failed to find any acceptable splits, use trivial split. */ if (context.first) { fallbackSplit(boxes, maxoff, v); return; } /* * Ok, we have now selected the split across one axis. * * While considering the splits, we already determined that there will be * enough entries in both groups to reach the desired ratio, but we did * not memorize which entries go to which group. So determine that now. */ /* Allocate vectors for results */ v->spl_left = (OffsetNumber *) palloc(nentries * sizeof(OffsetNumber)); v->spl_right = (OffsetNumber *) palloc(nentries * sizeof(OffsetNumber)); v->spl_nleft = 0; v->spl_nright = 0; /* Allocate bounding boxes of left and right groups */ leftBox = palloc0(sizeof(Box3D)); rightBox = palloc0(sizeof(Box3D)); leftBoxSize = sizeBox3D(leftBox); rightBoxSize = sizeBox3D(rightBox); /* * Allocate an array for "common entries" - entries which can be placed to * either group without affecting overlap along selected axis. */ commonEntriesCount = 0; commonEntries = (CommonEntry *) palloc(nentries * sizeof(CommonEntry)); /* Helper macros to place an entry in the left or right group */ #define PLACE_LEFT(box, off) \ do { \ if (v->spl_nleft > 0) \ adjustBox3D(leftBox, box); \ else \ *leftBox = *(box); \ v->spl_left[v->spl_nleft++] = off; \ } while(0) #define PLACE_RIGHT(box, off) \ do { \ if (v->spl_nright > 0) \ adjustBox3D(rightBox, box); \ else \ *rightBox = *(box); \ v->spl_right[v->spl_nright++] = off; \ } while(0) /* * Distribute entries which can be distributed unambiguously, and collect * common entries. */ for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { coord_t lower, upper; /* * Get upper and lower bounds along selected axis. */ box = &boxes[i]; lower = box->low.coord[context.dim]; upper = box->high.coord[context.dim]; if (upper <= context.leftUpper) { /* Fits to the left group */ if (lower >= context.rightLower) { /* Fits also to the right group, so "common entry" */ commonEntries[commonEntriesCount++].index = i; } else { /* Doesn't fit to the right group, so join to the left group */ PLACE_LEFT(box, i); /* checkBox3D(leftBox); */ } } else { /* * Each entry should fit on either left or right group. Since this * entry didn't fit on the left group, it better fit in the right * group. */ Assert(lower >= context.rightLower); /* Doesn't fit to the left group, so join to the right group */ PLACE_RIGHT(box, i); /* checkBox3D(rightBox); */ } } /* * Distribute "common entries", if any. */ if (commonEntriesCount > 0) { /* * Calculate minimum number of entries that must be placed in both * groups, to reach LIMIT_RATIO. */ int m = ceil(LIMIT_RATIO * (double) nentries); /* * Calculate delta between penalties of join "common entries" to * different groups. */ for (i = 0; i < commonEntriesCount; i++) { box = &boxes[i]; commonEntries[i].delta = fabs((unionSizeBox3D(leftBox, box) - leftBoxSize) - (unionSizeBox3D(rightBox, box) - rightBoxSize)); } /* * Sort "common entries" by calculated deltas in order to distribute * the most ambiguous entries first. */ qsort(commonEntries, commonEntriesCount, sizeof(CommonEntry), common_entry_cmp); /* * Distribute "common entries" between groups. */ for (i = 0; i < commonEntriesCount; i++) { box = &boxes[commonEntries[i].index]; /* * Check if we have to place this entry in either group to achieve * LIMIT_RATIO. */ if (v->spl_nleft + (commonEntriesCount - i) <= m) { PLACE_LEFT(box, commonEntries[i].index); /* checkBox3D(leftBox); */ } else if (v->spl_nright + (commonEntriesCount - i) <= m) { PLACE_RIGHT(box, commonEntries[i].index); /* checkBox3D(rightBox); */ } else { /* Otherwise select the group by minimal penalty */ if (unionSizeBox3D(leftBox, box) - leftBoxSize < unionSizeBox3D(rightBox, box) - rightBoxSize) { PLACE_LEFT(box, commonEntries[i].index); /* checkBox3D(leftBox); */ } else { PLACE_RIGHT(box, commonEntries[i].index); /* checkBox3D(rightBox); */ } } } } /* * checkBox3D(leftBox); checkBox3D(rightBox); */ v->spl_ldatum = PointerGetDatum(leftBox); v->spl_rdatum = PointerGetDatum(rightBox); } Datum g_spherekey_picksplit(PG_FUNCTION_ARGS) { GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); GIST_SPLITVEC *v = (GIST_SPLITVEC *) PG_GETARG_POINTER(1); OffsetNumber i, maxoff; Box3D *boxes; maxoff = entryvec->n - 1; boxes = (Box3D *) palloc(sizeof(Box3D) * entryvec->n); for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) boxes[i] = *((Box3D *) DatumGetPointer(entryvec->vector[i].key)); do_picksplit(boxes, maxoff, v); PG_RETURN_POINTER(v); } Datum g_spoint3_picksplit(PG_FUNCTION_ARGS) { GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0); GIST_SPLITVEC *v = (GIST_SPLITVEC *) PG_GETARG_POINTER(1); OffsetNumber i, maxoff; Box3D *boxes; GiSTSPointKey *leftKey, *rightKey; maxoff = entryvec->n - 1; boxes = (Box3D *) palloc(sizeof(Box3D) * entryvec->n); for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i)) { GiSTSPointKey *key = (GiSTSPointKey *) DatumGetPointer(entryvec->vector[i].key); /* checkKey(key); */ if (IS_LEAF(key)) { SPoint point; point.lat = key->lat; point.lng = key->lng; spherepoint_gen_key((int32 *) &boxes[i], &point); } else { boxes[i] = *((Box3D *) key->k); } /* checkBox3D(&boxes[i]); */ } do_picksplit(boxes, maxoff, v); ALLOC_INTERNAL_KEY(leftKey); ALLOC_INTERNAL_KEY(rightKey); memcpy(leftKey->k, DatumGetPointer(v->spl_ldatum), KEYSIZE); memcpy(rightKey->k, DatumGetPointer(v->spl_rdatum), KEYSIZE); v->spl_ldatum = PointerGetDatum(leftKey); v->spl_rdatum = PointerGetDatum(rightKey); /* checkKey(leftKey); */ /* checkKey(rightKey); */ PG_RETURN_POINTER(v); } /* * The GiST Penalty method for boxes. We have to make panalty as fast as * possible ( offen called ! ) */ Datum g_spherekey_penalty(PG_FUNCTION_ARGS) { GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0); GISTENTRY *newentry = (GISTENTRY *) PG_GETARG_POINTER(1); float *result = (float *) PG_GETARG_POINTER(2); Box3D *o = (Box3D *) DatumGetPointer(origentry->key); if (newentry != NULL) { Box3D *n = (Box3D *) DatumGetPointer(newentry->key); *result = (float) (((uint64) (Max(o->high.coord[0], n->high.coord[0]) - Min(o->low.coord[0], n->low.coord[0])) >> 10) * ((uint64) (Max(o->high.coord[1], n->high.coord[1]) - Min(o->low.coord[1], n->low.coord[1])) >> 10) * ((uint64) (Max(o->high.coord[2], n->high.coord[2]) - Min(o->low.coord[2], n->low.coord[2])) >> 10) - ((uint64) (o->high.coord[0] - o->low.coord[0]) >> 10) * ((uint64) (o->high.coord[1] - o->low.coord[1]) >> 10) * ((uint64) (o->high.coord[2] - o->low.coord[2]) >> 10)); PG_RETURN_POINTER(result); } else { PG_RETURN_POINTER(NULL); } } /* * The GiST Penalty method for spherical points. * We have to make panalty as fast as possible (offen called !) */ Datum g_spoint3_penalty(PG_FUNCTION_ARGS) { GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0); GISTENTRY *newentry = (GISTENTRY *) PG_GETARG_POINTER(1); float *result = (float *) PG_GETARG_POINTER(2); GiSTSPointKey *origkey = (GiSTSPointKey *) DatumGetPointer(origentry->key); GiSTSPointKey *newkey = (GiSTSPointKey *) DatumGetPointer(newentry->key); Box3D *o, *n; int32 k[6], ok[6]; if (IS_LEAF(origkey)) { SPoint point; point.lat = origkey->lat; point.lng = origkey->lng; spherepoint_gen_key(ok, &point); o = (Box3D *) ok; } else { o = (Box3D *) origkey->k; } if (newentry == NULL) PG_RETURN_NULL(); if (IS_LEAF(newkey)) { int32 *ptr; SPoint point; point.lat = newkey->lat; point.lng = newkey->lng; if (!gq_cache_get_value(PGS_TYPE_SPoint, &point, &ptr)) { spherepoint_gen_key(k, &point); gq_cache_set_value(PGS_TYPE_SPoint, &point, k); n = (Box3D *) k; } else { n = (Box3D *) ptr; } } else { n = (Box3D *) newkey->k; } *result = ((float) ((int64) Max(o->high.coord[0], n->high.coord[0]) - (int64) Min(o->low.coord[0], n->low.coord[0]))) * ((float) ((int64) Max(o->high.coord[1], n->high.coord[1]) - (int64) Min(o->low.coord[1], n->low.coord[1]))) * ((float) ((int64) Max(o->high.coord[2], n->high.coord[2]) - (int64) Min(o->low.coord[2], n->low.coord[2]))) - ((float) ((int64) o->high.coord[0] - (int64) o->low.coord[0])) * ((float) ((int64) o->high.coord[1] - (int64) o->low.coord[1])) * ((float) ((int64) o->high.coord[2] - (int64) o->low.coord[2])); PG_RETURN_POINTER(result); } pgsphere-1.5.1/src/gist.h000066400000000000000000000102571461140101500152370ustar00rootroot00000000000000#ifndef __PGS_GIST_H__ #define __PGS_GIST_H__ #include "key.h" /* * GIST index declarations */ /* An alias for unsigned char */ typedef unsigned char uchar; /* PGS_KEY_REL Key relationships */ #define SCKEY_DISJ 0 /* two keys are disjunct */ #define SCKEY_OVERLAP 1 /* two keys are overlapping */ #define SCKEY_IN 2 /* first key contains second key */ #define SCKEY_SAME 3 /* keys are equal */ extern uchar spherekey_interleave(const int32 *k1, const int32 *k2); /* * For given "query" of "pgstype" of PGS_DATA_TYPES type, puts key of cached * query into "key" pointer. Returns true when given query is equal to * current query. */ extern bool gq_cache_get_value(unsigned pgstype, const void *query, int32 **key); /* * Copy current query, type and its key value to cache. */ extern void gq_cache_set_value(unsigned pgstype, const void *query, const int32 *key); /* * Input function of key value. Just a dummy. But PostgreSQL need this * function to create a data type. */ extern Datum spherekey_in(PG_FUNCTION_ARGS); /* * Output function of key value. Just a dummy. But PostgreSQL need this * function to create a data type. */ extern Datum spherekey_out(PG_FUNCTION_ARGS); /* * GIST's decompress method. This function does nothing. */ extern Datum g_spherekey_decompress(PG_FUNCTION_ARGS); /* * GIST's compress method for circle. Creates the key value from a spherical * circle. */ extern Datum g_scircle_compress(PG_FUNCTION_ARGS); /* * GIST's compress method for point. Creates the key value from a spherical point. */ extern Datum g_spoint_compress(PG_FUNCTION_ARGS); /* * GIST's compress method for line. Creates the key value from a spherical line. */ extern Datum g_sline_compress(PG_FUNCTION_ARGS); /* * GIST's compress method for path. Creates the key value from a spherical path. */ extern Datum g_spath_compress(PG_FUNCTION_ARGS); /* * GIST's compress method for polygon. Creates the key value from a spherical * polygon. */ extern Datum g_spoly_compress(PG_FUNCTION_ARGS); /* * GIST's compress method for ellipse. Creates the key value from a spherical * ellipse. */ extern Datum g_sellipse_compress(PG_FUNCTION_ARGS); /* * GIST's compress method for box. Creates the key value from a spherical box. */ extern Datum g_sbox_compress(PG_FUNCTION_ARGS); /* * The GiST Union method for boxes. Returns the minimal bounding box that * encloses all the entries in entryvec. */ extern Datum g_spherekey_union(PG_FUNCTION_ARGS); /* * GIST's equality method. */ extern Datum g_spherekey_same(PG_FUNCTION_ARGS); /* * GIST's consistent method for a point. */ extern Datum g_spoint_consistent(PG_FUNCTION_ARGS); /* * GIST's consistent method for a circle. */ extern Datum g_scircle_consistent(PG_FUNCTION_ARGS); /* * GIST's consistent method for a line. */ extern Datum g_sline_consistent(PG_FUNCTION_ARGS); /* * GIST's consistent method for a path. */ extern Datum g_spath_consistent(PG_FUNCTION_ARGS); /* * GIST's consistent method for a polygon. */ extern Datum g_spoly_consistent(PG_FUNCTION_ARGS); /* * GIST's consistent method for an ellipse. */ extern Datum g_sellipse_consistent(PG_FUNCTION_ARGS); /* * GIST's consistent method for a box. */ extern Datum g_sbox_consistent(PG_FUNCTION_ARGS); /* * GIST's penalty method. */ extern Datum g_spherekey_penalty(PG_FUNCTION_ARGS); /* * GIST's picksplit method. This method is using the double sorting node * splitting algorithm for R-Trees. See "A new double sorting-based node * splitting algorithm for R-tree", A. Korotkov. */ extern Datum g_spherekey_picksplit(PG_FUNCTION_ARGS); extern Datum pointkey_in(PG_FUNCTION_ARGS); extern Datum pointkey_out(PG_FUNCTION_ARGS); extern Datum pointkey_volume(PG_FUNCTION_ARGS); extern Datum pointkey_area(PG_FUNCTION_ARGS); extern Datum pointkey_perimeter(PG_FUNCTION_ARGS); extern Datum g_spoint3_compress(PG_FUNCTION_ARGS); extern Datum g_spoint3_union(PG_FUNCTION_ARGS); extern Datum g_spoint3_same(PG_FUNCTION_ARGS); extern Datum g_spoint3_consistent(PG_FUNCTION_ARGS); extern Datum g_spoint3_penalty(PG_FUNCTION_ARGS); extern Datum g_spoint3_picksplit(PG_FUNCTION_ARGS); extern Datum g_spoint3_distance(PG_FUNCTION_ARGS); extern Datum g_spoint3_fetch(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/gist_support.c000066400000000000000000000160021461140101500170200ustar00rootroot00000000000000/********************************************************************** * * pgsphere gist_support.c * based on gserialized_supportfn.c from PostGIS * * PostGIS - Spatial Types for PostgreSQL * http://postgis.net * * PostGIS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * PostGIS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PostGIS. If not, see . * **********************************************************************/ /* PostgreSQL */ #include "postgres.h" #if PG_VERSION_NUM >= 120000 #include "funcapi.h" #include "access/htup_details.h" #include "access/stratnum.h" #include "catalog/namespace.h" #include "catalog/pg_opfamily.h" #include "catalog/pg_type_d.h" #include "catalog/pg_am_d.h" #include "nodes/supportnodes.h" #include "nodes/nodeFuncs.h" #include "nodes/makefuncs.h" #include "optimizer/optimizer.h" #include "parser/parse_func.h" #include "parser/parse_type.h" #include "utils/array.h" #include "utils/builtins.h" #include "utils/lsyscache.h" #include "utils/numeric.h" #include "utils/selfuncs.h" #include "utils/syscache.h" #include "point.h" #include "circle.h" static Oid scircleTypeOid(Oid callingfunc) { /* type must be in same namespace as the caller */ char *nspname = get_namespace_name(get_func_namespace(callingfunc)); List *type_name_list = list_make2(makeString(nspname), makeString("scircle")); TypeName *type_name = makeTypeNameFromNameList(type_name_list); Oid type_oid = LookupTypeNameOid(NULL, type_name, true); if (type_oid == InvalidOid) elog(ERROR, "%s: unable to lookup type 'scircle'", __func__); return type_oid; } static Oid scircleFunctionOid(Oid geotype, Oid callingfunc) { const Oid radiustype = FLOAT8OID; /* Should always be FLOAT8OID */ const Oid scircle_function_args[2] = {geotype, radiustype}; const bool noError = true; /* Expand function must be in same namespace as the caller */ char *nspname = get_namespace_name(get_func_namespace(callingfunc)); List *scircle_function_name = list_make2(makeString(nspname), makeString("scircle")); Oid scircle_function_oid = LookupFuncName(scircle_function_name, 2, scircle_function_args, noError); if (scircle_function_oid == InvalidOid) elog(ERROR, "%s: unable to lookup 'scircle(Oid[%u], Oid[%u])'", __func__, geotype, radiustype); return scircle_function_oid; } PG_FUNCTION_INFO_V1(spherepoint_dwithin_supportfn); Datum spherepoint_dwithin_supportfn(PG_FUNCTION_ARGS) { Node *rawreq = (Node *) PG_GETARG_POINTER(0); Node *ret = NULL; if (IsA(rawreq, SupportRequestSelectivity)) { SupportRequestSelectivity *req = (SupportRequestSelectivity *) rawreq; Node *radiusarg = (Node *) list_nth(req->args, 2); float8 selec; ereport(DEBUG1, (errmsg("spherepoint_dwithin_supportfn sel called on %d", req->funcid))); /* * If the radius is a constant, compute the circle constant. */ if (IsA(radiusarg, Const)) { Const *constarg = (Const *) radiusarg; float8 radius = DatumGetFloat8(constarg->constvalue); selec = spherecircle_area_float(radius) / SPHERE_SURFACE; ereport(DEBUG1, (errmsg("spherepoint_dwithin_supportfn const radius %g", radius))); } else { selec = DEFAULT_SCIRCLE_SEL; ereport(DEBUG1, (errmsg("spherepoint_dwithin_supportfn non-const radius"))); } if (req->is_join) { req->selectivity = selec; } else { req->selectivity = selec; } CLAMP_PROBABILITY(req->selectivity); ereport(DEBUG1, (errmsg("spherepoint_dwithin_supportfn selectivity %g is_join %d", req->selectivity, req->is_join))); ret = rawreq; } else if (IsA(rawreq, SupportRequestIndexCondition)) { SupportRequestIndexCondition *req = (SupportRequestIndexCondition *) rawreq; FuncExpr *clause = (FuncExpr *) req->node; Oid funcid = clause->funcid; Oid opfamilyoid = req->opfamily; /* OPERATOR FAMILY of the index */ Node *leftarg, *rightarg, *radiusarg; Oid leftdatatype, oproid; Oid scircle_type_oid = scircleTypeOid(funcid); Expr *scircle_expr; Expr *expr; /* * Extract "leftarg" as the arg matching the index and "rightarg" as * the other, even if they were in the opposite order in the call. */ if (req->indexarg == 0) { leftarg = linitial(clause->args); rightarg = lsecond(clause->args); } else if (req->indexarg == 1) { rightarg = linitial(clause->args); leftarg = lsecond(clause->args); } else PG_RETURN_POINTER((Node *)NULL); leftdatatype = exprType(leftarg); Assert(leftdatatype == exprType(rightarg)); /* expect spoint, spoint */ radiusarg = (Node *) list_nth(clause->args, 2); /* * Given the index operator family and the arguments and the desired * strategy number we can now lookup the operator we want. */ oproid = get_opfamily_member(opfamilyoid, leftdatatype, scircle_type_oid, 37); /* spoint <@ scircle */ if (!OidIsValid(oproid)) elog(ERROR, "no spatial operator found for '%s': opfamily %u types %d %d strategy %d", "scircle", opfamilyoid, leftdatatype, scircle_type_oid, 37); /* * If both the right argument and the radius are a constant, compute * the circle constant. (makeFuncExpr won't constify by itself * unfortunately.) */ if (IsA(rightarg, Const) && IsA(radiusarg, Const)) { Datum center = ((Const *) rightarg)->constvalue; Datum radius = ((Const *) radiusarg)->constvalue; Datum circle = DirectFunctionCall2(spherecircle_by_center, center, radius); scircle_expr = (Expr *) makeConst(scircle_type_oid, -1, InvalidOid, sizeof(SCIRCLE), circle, false, false); ereport(DEBUG1, (errmsg("spherepoint_dwithin_supportfn index condition const"))); } else { Oid scircle_function_oid = scircleFunctionOid(leftdatatype, clause->funcid); scircle_expr = (Expr *) makeFuncExpr(scircle_function_oid, leftdatatype, list_make2(rightarg, radiusarg), InvalidOid, InvalidOid, COERCE_EXPLICIT_CALL); ereport(DEBUG1, (errmsg("spherepoint_dwithin_supportfn index condition function"))); } /* * The comparison expression has to be a pseudo constant, * (not volatile or dependent on the target index table) */ #if PG_VERSION_NUM >= 140000 if (!is_pseudo_constant_for_index(req->root, (Node*)scircle_expr, req->index)) #else if (!is_pseudo_constant_for_index((Node*)scircle_expr, req->index)) #endif PG_RETURN_POINTER((Node*)NULL); /* OK, we can make an index expression */ expr = make_opclause(oproid, BOOLOID, false, (Expr *) leftarg, scircle_expr, InvalidOid, InvalidOid); ret = (Node *)(list_make1(expr)); /* This is an exact index lookup */ req->lossy = false; } PG_RETURN_POINTER(ret); } #endif /* PG_VERSION_NUM */ pgsphere-1.5.1/src/gnomo.c000066400000000000000000000033421461140101500154000ustar00rootroot00000000000000#include #include #include "gnomo.h" #include "point.h" /* SPoint from pgsphere */ #include PG_FUNCTION_INFO_V1(gnomonic_proj); PG_FUNCTION_INFO_V1(gnomonic_inv); /* * Direct gnomonic projection. * * point gnomonic_proj(spoint spherical_point, spoint tangential_point) */ Datum gnomonic_proj(PG_FUNCTION_ARGS) { Point* g = (Point*) palloc(sizeof(Point)); SPoint* p = (SPoint*) PG_GETARG_POINTER(0); SPoint* t = (SPoint*) PG_GETARG_POINTER(1); double delta_lng = p->lng - t->lng; double sin_lat = sin(p->lat); double cos_lat = cos(p->lat); double sin_lat_t = sin(t->lat); double cos_lat_t = cos(t->lat); double sin_delta = sin(delta_lng); double cos_delta = cos(delta_lng); double cos_lat__cos_delta = cos_lat * cos_delta; double cos_dist = sin_lat_t * sin_lat + cos_lat_t * cos_lat__cos_delta; g->x = cos_lat * sin_delta / cos_dist; g->y = (cos_lat_t * sin_lat - sin_lat_t * cos_lat__cos_delta) / cos_dist; if (p->lng == t->lng && p->lat == t->lat) { g->x = 0; g->y = 0; } PG_RETURN_POINTER(g); } /* * Inverse gnomonic projection. * * spoint gnomonic_inv(point plane_point, spoint tangential_point) */ Datum gnomonic_inv(PG_FUNCTION_ARGS) { SPoint* p = (SPoint*) palloc(sizeof(SPoint)); Point* g = (Point*) PG_GETARG_POINTER(0); SPoint* t = (SPoint*) PG_GETARG_POINTER(1); double rho_sq = g->x * g->x + g->y * g->y; double rho = sqrt(rho_sq); double cos_c = 1 / sqrt(1 + rho_sq); double sin_c = 1 / sqrt(1 + 1 / rho_sq); double cos_lat_t = cos(t->lat); double sin_lat_t = sin(t->lat); p->lng = t->lng + atan2(g->x * sin_c, rho * cos_lat_t * cos_c - g->y * sin_lat_t * sin_c); p->lat = asin(cos_c * sin_lat_t + g->y *sin_c * cos_lat_t / rho); PG_RETURN_POINTER(p); } pgsphere-1.5.1/src/gnomo.h000066400000000000000000000003271461140101500154050ustar00rootroot00000000000000#ifndef __GNOMO_H__ #define __GNOMO_H__ /* function prototypes for the direct and inverse gnomonic projections */ extern Datum gnomonic_proj(PG_FUNCTION_ARGS); extern Datum gnomonic_inv(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/gq_cache.c000066400000000000000000000061241461140101500160140ustar00rootroot00000000000000#include "gist.h" /* * GIST's query cache */ /* Holds the parent type of PGS_DATA_TYPES for cached key. */ static unsigned keytype = 0; /* the cached key */ static int32 kcache[6]; /* pointer to cached query */ static void *cquery = NULL; /* Holds the count of points, if cached query is a path or polygon. */ static int32 npts = 0; /* If query type and value are equal, this value is true */ static bool res = false; /* * Depending on type of PGS_DATA_TYPES, compare current query and cached query. * If query cache and current query are equal, set ref to true. */ #define GQ_MEMCMP(type) \ do \ { \ if (keytype == PGS_TYPE_##type) \ { \ if (memcmp((void *) cquery, (void *) query, sizeof(type)) == 0) res = true; \ } \ } while(0); bool gq_cache_get_value(unsigned pgstype, const void *query, int32 **key) { if (keytype == 0) { return false; } else { res = false; switch (pgstype) { case PGS_TYPE_SPoint: GQ_MEMCMP(SPoint); break; case PGS_TYPE_SCIRCLE: GQ_MEMCMP(SCIRCLE); break; case PGS_TYPE_SELLIPSE: GQ_MEMCMP(SELLIPSE); break; case PGS_TYPE_SLine: GQ_MEMCMP(SLine); break; case PGS_TYPE_SBOX: GQ_MEMCMP(SBOX); break; case PGS_TYPE_SPATH: if (keytype == pgstype && ((SPATH *) query)->npts == npts) { if (memcmp((void *) cquery, (void *) &((SPATH *) query)->p, ((SPATH *) query)->npts * sizeof(SPoint)) == 0) res = true; } break; case PGS_TYPE_SPOLY: if (keytype == pgstype && ((SPOLY *) query)->npts == npts) { if (memcmp((void *) cquery, (void *) &((SPOLY *) query)->p, ((SPOLY *) query)->npts * sizeof(SPoint)) == 0) res = true; } break; default: res = false; break; } if (res) { *key = &kcache[0]; } return res; } return false; } /* * Depending on type of PGS_DATA_TYPES, copy current query to cache. */ #define GQ_MEMCPY(type) \ do \ { \ cquery = (void *) malloc(sizeof(type)); \ memcpy((void *) cquery, (void *) query, sizeof(type)); \ } while(0); void gq_cache_set_value(unsigned pgstype, const void *query, const int32 *key) { if (cquery) { free(cquery); cquery = NULL; } keytype = pgstype; switch (pgstype) { case PGS_TYPE_SPoint: GQ_MEMCPY(SPoint); break; case PGS_TYPE_SCIRCLE: GQ_MEMCPY(SCIRCLE); break; case PGS_TYPE_SELLIPSE: GQ_MEMCPY(SELLIPSE); break; case PGS_TYPE_SLine: GQ_MEMCPY(SLine); break; case PGS_TYPE_SBOX: GQ_MEMCPY(SBOX); break; case PGS_TYPE_SPATH: cquery = (void *) malloc(((SPATH *) query)->npts * sizeof(SPoint)); npts = ((SPATH *) query)->npts; memcpy((void *) cquery, (void *) &((SPATH *) query)->p, ((SPATH *) query)->npts * sizeof(SPoint)); break; case PGS_TYPE_SPOLY: cquery = (void *) malloc(((SPOLY *) query)->npts * sizeof(SPoint)); npts = ((SPOLY *) query)->npts; memcpy((void *) cquery, (void *) &((SPOLY *) query)->p, ((SPOLY *) query)->npts * sizeof(SPoint)); break; default: keytype = 0; } if (keytype > 0) { memcpy((void *) &kcache[0], (void *) key, KEYSIZE); } } pgsphere-1.5.1/src/healpix.c000066400000000000000000000130301461140101500157060ustar00rootroot00000000000000/* this goes in front to detect the chealpix API break */ #include "pgs_healpix.h" #include #include #include #include "point.h" /* SPoint */ #include #include "pgs_util.h" PG_FUNCTION_INFO_V1(pg_nest2ring); PG_FUNCTION_INFO_V1(pg_ring2nest); PG_FUNCTION_INFO_V1(healpix_convert_nest); PG_FUNCTION_INFO_V1(healpix_convert_ring); PG_FUNCTION_INFO_V1(pg_nside2order); PG_FUNCTION_INFO_V1(pg_order2nside); PG_FUNCTION_INFO_V1(pg_nside2npix); PG_FUNCTION_INFO_V1(pg_npix2nside); PG_FUNCTION_INFO_V1(healpix_nest); PG_FUNCTION_INFO_V1(healpix_ring); PG_FUNCTION_INFO_V1(inv_healpix_nest); PG_FUNCTION_INFO_V1(inv_healpix_ring); static int ilog2(hpint64 x) { int log = 0; unsigned w; for (w = 32; w; w >>= 1) { hpint64 y = x >> w; if (y) { log += w; x = y; } } return log; } int order_invalid(int order) { return (order < 0 || order > 29); } static int nside_invalid(hpint64 nside) { return (nside <= 0 || (nside - 1) & nside || order_invalid(ilog2(nside))); } static hpint64 c_nside(int order) { hpint64 one_bit = 1; return one_bit << order; } hpint64 c_npix(int order) { return nside2npix(c_nside(order)); } void check_order(int order) { if (order_invalid(order)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("Healpix level out of valid range [0..29]"))); } static void check_index(int order, hpint64 i) { check_order(order); if (i < 0 || i >= c_npix(order)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("Healpix index out of range"), errhint("Use nside2npix(order2nside(level)) to calculate" " the respective limit\nfor Healpix indices.\n" "Use healpix_convert(idx, from_level, to_level)" " to move indices to another level."))); } static void check_nside(hpint64 nside) { if (nside_invalid(nside)) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("nside value invalid"), errhint("Valid nside values are only" " order2nside(level)," " for level in [0..29]."))); } Datum pg_nest2ring(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); hpint64 nest = PG_GETARG_INT64(1); check_index(order, nest); PG_RETURN_INT64(nest2ring(c_nside(order), nest)); } Datum pg_ring2nest(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); hpint64 ring = PG_GETARG_INT64(1); check_index(order, ring); PG_RETURN_INT64(ring2nest(c_nside(order), ring)); } hpint64 c_healpix_convert_nest(hpint64 idx, int32 from_order, int32 to_order) { check_order(to_order); if (from_order > to_order) idx >>= (from_order - to_order) * 2; else idx <<= (to_order - from_order) * 2; return idx; } Datum healpix_convert_nest(PG_FUNCTION_ARGS) { int32 to_order = PG_GETARG_INT32(0); int32 from_order = PG_GETARG_INT32(1); hpint64 nest = PG_GETARG_INT64(2); check_index(from_order, nest); PG_RETURN_INT64(c_healpix_convert_nest(nest, from_order, to_order)); } Datum healpix_convert_ring(PG_FUNCTION_ARGS) { int32 to_order = PG_GETARG_INT32(0); int32 from_order = PG_GETARG_INT32(1); hpint64 ring = PG_GETARG_INT64(2); hpint64 nest; check_index(from_order, ring); //nest = ring2nest(c_nside(from_order), ring); //nest = c_healpix_convert_nest(nest, from_order, to_order); nest = c_healpix_convert_nest(ring2nest(c_nside(from_order), ring), from_order, to_order); PG_RETURN_INT64(nest2ring(c_nside(to_order), nest)); } Datum pg_nside2order(PG_FUNCTION_ARGS) { hpint64 nside = PG_GETARG_INT64(0); check_nside(nside); PG_RETURN_INT32(ilog2(nside)); } Datum pg_order2nside(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); check_order(order); PG_RETURN_INT64(c_nside(order)); } Datum pg_nside2npix(PG_FUNCTION_ARGS) { hpint64 nside = PG_GETARG_INT64(0); check_nside(nside); PG_RETURN_INT64(nside2npix(nside)); } Datum pg_npix2nside(PG_FUNCTION_ARGS) { hpint64 npix = PG_GETARG_INT64(0); hpint64 nside; if (npix < 12) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("npix value must be at least 12"))); nside = floor(sqrt(npix * (1.0 / 12)) + 0.5); if (nside_invalid(nside) || nside2npix(nside) != npix) ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("npix value invalid"), errhint("Valid npix values are only" " nside2npix(order2nside(level))," " for level in [0..29]."))); PG_RETURN_INT64(nside); } hpint64 healpix_nest_c(int32 order, SPoint* p) { hpint64 i; t_ang angle = { conv_theta(p->lat), p->lng }; i = ang2nest(c_nside(order), angle); return i; } Datum healpix_nest(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); SPoint* p = (SPoint*) PG_GETARG_POINTER(1); check_order(order); PG_RETURN_INT64(healpix_nest_c(order, p)); } Datum healpix_ring(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); SPoint* p = (SPoint*) PG_GETARG_POINTER(1); t_ang angle = { conv_theta(p->lat), p->lng }; check_order(order); PG_RETURN_INT64(ang2ring(c_nside(order), angle)); } Datum inv_healpix_nest(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); hpint64 i = PG_GETARG_INT64(1); SPoint* p = (SPoint*) palloc(sizeof(SPoint)); t_ang angle; check_index(order, i); angle = nest2ang(c_nside(order), i); p->lat = conv_theta(angle.theta); p->lng = angle.phi; PG_RETURN_POINTER(p); } Datum inv_healpix_ring(PG_FUNCTION_ARGS) { int32 order = PG_GETARG_INT32(0); hpint64 i = PG_GETARG_INT64(1); SPoint* p = (SPoint*) palloc(sizeof(SPoint)); t_ang angle; check_index(order, i); angle = ring2ang(c_nside(order), i); p->lat = conv_theta(angle.theta); p->lng = angle.phi; PG_RETURN_POINTER(p); } pgsphere-1.5.1/src/key.c000066400000000000000000000212041461140101500150460ustar00rootroot00000000000000#include "key.h" #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif /* Functions to create the key values */ /* * Unites a key with the key value of a point. */ static void key_add_point(int32 *key, const SPoint *p) { int32 k[6]; spherepoint_gen_key(&k[0], p); spherekey_union_two(key, &k[0]); } void spherekey_union_two(int32 *kunion, const int32 *key) { kunion[0] = Min(kunion[0], key[0]); kunion[1] = Min(kunion[1], key[1]); kunion[2] = Min(kunion[2], key[2]); kunion[3] = Max(kunion[3], key[3]); kunion[4] = Max(kunion[4], key[4]); kunion[5] = Max(kunion[5], key[5]); } bool spherekey_inter_two(int32 *kinter, const int32 *key) { if (kinter[3] < key[0] || key[3] < kinter[0]) return false; if (kinter[4] < key[1] || key[4] < kinter[1]) return false; if (kinter[5] < key[2] || key[5] < kinter[2]) return false; kinter[0] = Max(kinter[0], key[0]); kinter[1] = Max(kinter[1], key[1]); kinter[2] = Max(kinter[2], key[2]); kinter[3] = Min(kinter[3], key[3]); kinter[4] = Min(kinter[4], key[4]); kinter[5] = Min(kinter[5], key[5]); return true; } void spherepoint_gen_key(int32 *k, const SPoint *sp) { Vector3D v; const int32 ks = MAXCVALUE; spoint_vector3d(&v, sp); if (v.x < -1.0) v.x = -1.0; if (v.y < -1.0) v.y = -1.0; if (v.z < -1.0) v.z = -1.0; if (v.x > 1.0) v.x = 1.0; if (v.y > 1.0) v.y = 1.0; if (v.z > 1.0) v.z = 1.0; k[0] = v.x * ks; k[1] = v.y * ks; k[2] = v.z * ks; k[3] = v.x * ks; k[4] = v.y * ks; k[5] = v.z * ks; } void spherecircle_gen_key(int32 *k, const SCIRCLE *c) { double r, d; const int32 ks = MAXCVALUE; int i; Vector3D v[8]; Vector3D tv; Vector3D mm[2]; SEuler se; r = sin(c->radius); d = cos(c->radius); v[0].x = -r; v[0].y = -r; v[0].z = d; v[1].x = -r; v[1].y = +r; v[1].z = d; v[2].x = +r; v[2].y = -r; v[2].z = d; v[3].x = +r; v[3].y = +r; v[3].z = d; v[4].x = -r; v[4].y = -r; v[4].z = 1.0; v[5].x = -r; v[5].y = +r; v[5].z = 1.0; v[6].x = +r; v[6].y = -r; v[6].z = 1.0; v[7].x = +r; v[7].y = +r; v[7].z = 1.0; se.psi_a = EULER_AXIS_X; se.theta_a = EULER_AXIS_Z; se.phi_a = EULER_AXIS_X; se.phi = PIH - c->center.lat; se.theta = PIH + c->center.lng; se.psi = 0.0; /* min */ mm[0].x = mm[0].y = mm[0].z = 1.0; /* max */ mm[1].x = mm[1].y = mm[1].z = -1.0; for (i = 0; i < 8; i++) { euler_vector_trans(&tv, &v[i], &se); if (tv.x >= -1.0 && tv.x <= 1.0) { mm[0].x = Min(mm[0].x, tv.x); mm[1].x = Max(mm[1].x, tv.x); } else if (tv.x < -1.0) { mm[0].x = -1.0; } else if (tv.x > 1.0) { mm[1].x = 1.0; } if (tv.y >= -1.0 && tv.y <= 1.0) { mm[0].y = Min(mm[0].y, tv.y); mm[1].y = Max(mm[1].y, tv.y); } else if (tv.y < -1.0) { mm[0].y = -1.0; } else if (tv.y > 1.0) { mm[1].y = 1.0; } if (tv.z >= -1.0 && tv.z <= 1.0) { mm[0].z = Min(mm[0].z, tv.z); mm[1].z = Max(mm[1].z, tv.z); } else if (tv.z < -1.0) { mm[0].z = -1.0; } else if (tv.z > 1.0) { mm[1].z = 1.0; } } k[0] = mm[0].x * ks; k[1] = mm[0].y * ks; k[2] = mm[0].z * ks; k[3] = mm[1].x * ks; k[4] = mm[1].y * ks; k[5] = mm[1].z * ks; } void sphereellipse_gen_key(int32 *k, const SELLIPSE *e) { double r[2], d; const int32 ks = MAXCVALUE; int i; Vector3D v[8]; Vector3D tv; Vector3D mm[2]; SEuler se; r[0] = sin(e->rad[0]); r[1] = sin(e->rad[1]); d = cos(e->rad[0]); v[0].x = d; v[0].y = -r[0]; v[0].z = -r[1]; v[1].x = d; v[1].y = +r[0]; v[1].z = -r[1]; v[2].x = d; v[2].y = -r[0]; v[2].z = +r[1]; v[3].x = d; v[3].y = +r[0]; v[3].z = +r[1]; v[4].x = 1.0; v[4].y = -r[0]; v[4].z = -r[1]; v[5].x = 1.0; v[5].y = +r[0]; v[5].z = -r[1]; v[6].x = 1.0; v[6].y = -r[0]; v[6].z = +r[1]; v[7].x = 1.0; v[7].y = +r[0]; v[7].z = +r[1]; sellipse_trans(&se, e); /* min */ mm[0].x = mm[0].y = mm[0].z = 1.0; /* max */ mm[1].x = mm[1].y = mm[1].z = -1.0; for (i = 0; i < 8; i++) { euler_vector_trans(&tv, &v[i], &se); if (tv.x >= -1.0 && tv.x <= 1.0) { mm[0].x = Min(mm[0].x, tv.x); mm[1].x = Max(mm[1].x, tv.x); } else if (tv.x < -1.0) { mm[0].x = -1.0; } else if (tv.x > 1.0) { mm[1].x = 1.0; } if (tv.y >= -1.0 && tv.y <= 1.0) { mm[0].y = Min(mm[0].y, tv.y); mm[1].y = Max(mm[1].y, tv.y); } else if (tv.y < -1.0) { mm[0].y = -1.0; } else if (tv.y > 1.0) { mm[1].y = 1.0; } if (tv.z >= -1.0 && tv.z <= 1.0) { mm[0].z = Min(mm[0].z, tv.z); mm[1].z = Max(mm[1].z, tv.z); } else if (tv.z < -1.0) { mm[0].z = -1.0; } else if (tv.z > 1.0) { mm[1].z = 1.0; } } k[0] = mm[0].x * ks; k[1] = mm[0].y * ks; k[2] = mm[0].z * ks; k[3] = mm[1].x * ks; k[4] = mm[1].y * ks; k[5] = mm[1].z * ks; } void sphereline_gen_key(int32 *k, const SLine *sl) { const int32 ks = MAXCVALUE; SPoint p[3]; sline_begin(&p[0], sl); sline_end(&p[1], sl); if (FPzero(sl->length)) { Vector3D vbeg, vend; spoint_vector3d(&vbeg, &p[0]); spoint_vector3d(&vend, &p[1]); k[0] = Min(vbeg.x, vend.x) * ks; k[1] = Min(vbeg.y, vend.y) * ks; k[2] = Min(vbeg.z, vend.z) * ks; k[3] = Max(vbeg.x, vend.x) * ks; k[4] = Max(vbeg.y, vend.y) * ks; k[5] = Max(vbeg.z, vend.z) * ks; } else { Vector3D v[4], vt, vr[2]; SEuler se; float8 l, ls, lc; int8 i; sphereline_to_euler(&se, sl); l = sl->length / 2.0; ls = sin(l); lc = cos(l); se.phi += l; v[0].x = lc; v[0].y = ((lc < 0) ? (-1.0) : (-ls)); v[1].x = 1.0; v[1].y = ((lc < 0) ? (-1.0) : (-ls)); v[2].x = lc; v[2].y = ((lc < 0) ? (+1.0) : (+ls)); v[3].x = 1.0; v[3].y = ((lc < 0) ? (+1.0) : (+ls)); v[0].z = v[1].z = v[2].z = v[3].z = 0.0; vr[0].x = vr[0].y = vr[0].z = 1.0; vr[1].x = vr[1].y = vr[1].z = -1.0; for (i = 0; i < 4; i++) { euler_vector_trans(&vt, &v[i], &se); if (vt.x < -1.0) { vt.x = -1.0; } if (vt.y < -1.0) { vt.y = -1.0; } if (vt.z < -1.0) { vt.z = -1.0; } if (vt.x > 1.0) { vt.x = 1.0; } if (vt.y > 1.0) { vt.y = 1.0; } if (vt.z > 1.0) { vt.z = 1.0; } vr[0].x = Min(vr[0].x, vt.x); vr[1].x = Max(vr[1].x, vt.x); vr[0].y = Min(vr[0].y, vt.y); vr[1].y = Max(vr[1].y, vt.y); vr[0].z = Min(vr[0].z, vt.z); vr[1].z = Max(vr[1].z, vt.z); } k[0] = vr[0].x * ks; k[1] = vr[0].y * ks; k[2] = vr[0].z * ks; k[3] = vr[1].x * ks; k[4] = vr[1].y * ks; k[5] = vr[1].z * ks; } } /* * Creates the key of a polygon. */ void spherepoly_gen_key(int32 *key, const SPOLY *sp) { int32 i; SLine l; SPoint p; int32 tk[6]; bool start = true; for (i = 0; i < sp->npts; i++) { sline_from_points(&l, &sp->p[i], &sp->p[(i + 1) % sp->npts]); sphereline_gen_key(&tk[0], &l); if (start) { start = false; memcpy((void *) key, (void *) &tk[0], KEYSIZE); } else { key[0] = Min(key[0], tk[0]); key[1] = Min(key[1], tk[1]); key[2] = Min(key[2], tk[2]); key[3] = Max(key[3], tk[3]); key[4] = Max(key[4], tk[4]); key[5] = Max(key[5], tk[5]); } p.lng = 0.0; p.lat = PIH; if (spoly_contains_point(sp, &p)) { key[5] = MAXCVALUE; } p.lat = -PIH; if (spoly_contains_point(sp, &p)) { key[2] = -MAXCVALUE; } p.lat = 0.0; if (spoly_contains_point(sp, &p)) { key[3] = MAXCVALUE; } p.lng = PI; if (spoly_contains_point(sp, &p)) { key[0] = -MAXCVALUE; } p.lng = PIH; if (spoly_contains_point(sp, &p)) { key[4] = MAXCVALUE; } p.lng = PI + PIH; if (spoly_contains_point(sp, &p)) { key[1] = -MAXCVALUE; } } } void spherepath_gen_key(int32 *key, const SPATH *sp) { int32 i; SLine l; int32 tk[6]; bool start = true; for (i=0; i < sp->npts - 1; i++) { sline_from_points(&l, &sp->p[i], &sp->p[i + 1]); sphereline_gen_key(&tk[0], &l); if (start) { start = false; memcpy((void *) key, (void *) &tk[0], KEYSIZE); } else { key[0] = Min(key[0], tk[0]); key[1] = Min(key[1], tk[1]); key[2] = Min(key[2], tk[2]); key[3] = Max(key[3], tk[3]); key[4] = Max(key[4], tk[4]); key[5] = Max(key[5], tk[5]); } } } void spherebox_gen_key(int32 *key, const SBOX *box) { SPoint p; float8 d; key[0] = key[1] = key[2] = MAXCVALUE; key[3] = key[4] = key[5] = -MAXCVALUE; /* add the 4 edges */ key_add_point(key, &box->sw); key_add_point(key, &box->ne); p.lng = box->sw.lng; p.lat = box->ne.lat; key_add_point(key, &p); p.lng = box->ne.lng; p.lat = box->sw.lat; key_add_point(key, &p); /* latitude closest to equator */ if (FPge(box->ne.lat, 0.0) && FPle(box->sw.lat, 0.0)) { p.lat = 0.0; } else if (fabs(box->ne.lat) > fabs(box->sw.lat)) { p.lat = box->sw.lat; } else { p.lat = box->ne.lat; } for (d = 0.0; d < (PID - 0.1); d += PIH) { p.lng = d; if (sbox_cont_point(box, &p)) { key_add_point(key, &p); } } } pgsphere-1.5.1/src/key.h000066400000000000000000000114301461140101500150530ustar00rootroot00000000000000#ifndef __PGS_KEY_H__ #define __PGS_KEY_H__ #include "types.h" /* Declarations of key build functions */ #define KEYSIZE 24 /* the key size for one entry */ #define BPCKSIZE (KEYSIZE/6) /* the key size for one entry per coordinate */ /* * The coordinate value has to be between -MAXCVALUE .. MAXCVALUE */ #define MAXCVALUE ( (1 << (8 * BPCKSIZE - 2)) - 1 ) /* Dummy definition to get LEAF_KEY_SIZE always right -- we rather do not dare * to mess around with offsetof() inside 'union {};' */ typedef struct { char vl_len_[4]; union { struct /* the compiler will probably insert 4 bytes * of padding here */ { float8 lat, lng; }; }; } GiSTSPointKey_Leaf; typedef struct { char vl_len_[4]; union { struct /* the compiler will probably insert 4 bytes * of padding here */ { float8 lat, lng; }; struct { int32 k[6]; }; }; } GiSTSPointKey; #define INTERNAL_KEY_SIZE sizeof(GiSTSPointKey) #define LEAF_KEY_SIZE sizeof(GiSTSPointKey_Leaf) #define IS_LEAF(key) (VARSIZE(key) == LEAF_KEY_SIZE) #define ALLOC_LEAF_KEY(key) do { \ key = (GiSTSPointKey *)palloc0(LEAF_KEY_SIZE); \ SET_VARSIZE(key, LEAF_KEY_SIZE); \ } while (0) ; #define ALLOC_INTERNAL_KEY(key) do { \ key = (GiSTSPointKey *)palloc0(INTERNAL_KEY_SIZE); \ SET_VARSIZE(key, INTERNAL_KEY_SIZE); \ } while (0) ; /* * Returns the union of two keys. Result is placed into 'kunion'. */ extern void spherekey_union_two(int32 *kunion, const int32 *key); /* * Returns the intersection of two keys. Returns NULL if there is * no intersection. Result is placed into 'kinter'. */ extern bool spherekey_inter_two(int32 *kinter, const int32 *key); /* * Generates the key of a spherical point and returns it. Result is placed * into 'k'. */ extern void spherepoint_gen_key(int32 *k, const SPoint *sp); /* * Generates the circle's key and returns it. Result is placed into 'k'. */ extern void spherecircle_gen_key(int32 *k, const SCIRCLE *c); /* * Generates the key of a spherical ellipse and returns it. Result is placed * into 'k'. */ extern void sphereellipse_gen_key(int32 *k, const SELLIPSE *e); /* * Generates the key of a spherical line and returns it. Result is placed * into 'k'. */ extern void sphereline_gen_key(int32 *k, const SLine *sl); /* * Generates the key of a polygon and returns it. Result is placed into 'k'. */ extern void spherepoly_gen_key(int32 *k, const SPOLY *sp); /* * Generates the key of a path and returns it. Result is placed into 'k'. */ extern void spherepath_gen_key(int32 *k, const SPATH *sp); /* * Generates the key of a box and returns it. Result is placed into 'k'. */ extern void spherebox_gen_key(int32 *key, const SBOX *box); /* * Returns true if the first key is less than the second key. */ extern Datum spherekey_lt(PG_FUNCTION_ARGS); /* * Returns true if the first key is less or equal than the second key. */ extern Datum spherekey_le(PG_FUNCTION_ARGS); /* * Returns true if two keys are equal. */ extern Datum spherekey_eq(PG_FUNCTION_ARGS); /* * Returns true if two keys are not equal. */ extern Datum spherekey_eq_neg(PG_FUNCTION_ARGS); /* * Returns true if the first key is greater or equal than the second key. */ extern Datum spherekey_ge(PG_FUNCTION_ARGS); /* * Returns true if the first key is greater than the second key. */ extern Datum spherekey_gt(PG_FUNCTION_ARGS); /* * Returns relationship between the two keys. * Calls skey_cmp(const int32 *, const int32 *) for two keys. */ extern Datum spherekey_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical points. * Calls skey_cmp(const int32 *, const int32 *) for two points. */ extern Datum spherepoint_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical circles. * Calls skey_cmp(const int32 *, const int32 *) for two circles. */ extern Datum spherecircle_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical ellipses. * Calls skey_cmp(const int32 *, const int32 *) for two ellipses. */ extern Datum sphereellipse_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical lines. * Calls skey_cmp(const int32 *, const int32 *) for two lines. */ extern Datum sphereline_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical paths. * Calls skey_cmp(const int32 *, const int32 *) for two paths. */ extern Datum spherepath_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical polygons. * Calls skey_cmp(const int32 *, const int32 *) for two polygons. */ extern Datum spherepoly_cmp(PG_FUNCTION_ARGS); /* * Returns relationship between the keys of two spherical boxes. * Calls skey_cmp(const int32 *, const int32 *) for two boxes. */ extern Datum spherebox_cmp(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/line.c000066400000000000000000000527221461140101500152160ustar00rootroot00000000000000#include "line.h" /* Line functions */ PG_FUNCTION_INFO_V1(sphereline_in); PG_FUNCTION_INFO_V1(sphereline_from_point); PG_FUNCTION_INFO_V1(sphereline_from_points); PG_FUNCTION_INFO_V1(sphereline_from_trans); PG_FUNCTION_INFO_V1(sphereline_meridian); PG_FUNCTION_INFO_V1(sphereline_swap_beg_end); PG_FUNCTION_INFO_V1(sphereline_turn); PG_FUNCTION_INFO_V1(sphereline_begin); PG_FUNCTION_INFO_V1(sphereline_end); PG_FUNCTION_INFO_V1(sphereline_length); PG_FUNCTION_INFO_V1(sphereline_cont_point); PG_FUNCTION_INFO_V1(sphereline_cont_point_neg); PG_FUNCTION_INFO_V1(sphereline_cont_point_com); PG_FUNCTION_INFO_V1(sphereline_cont_point_com_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_line); PG_FUNCTION_INFO_V1(spherecircle_cont_line_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_line_com); PG_FUNCTION_INFO_V1(spherecircle_cont_line_com_neg); PG_FUNCTION_INFO_V1(sphereline_overlap_circle); PG_FUNCTION_INFO_V1(sphereline_overlap_circle_neg); PG_FUNCTION_INFO_V1(sphereline_overlap_circle_com); PG_FUNCTION_INFO_V1(sphereline_overlap_circle_com_neg); PG_FUNCTION_INFO_V1(sphereline_equal); PG_FUNCTION_INFO_V1(sphereline_equal_neg); PG_FUNCTION_INFO_V1(sphereline_crosses); PG_FUNCTION_INFO_V1(sphereline_crosses_neg); PG_FUNCTION_INFO_V1(sphereline_overlap); PG_FUNCTION_INFO_V1(sphereline_overlap_neg); PG_FUNCTION_INFO_V1(spheretrans_from_line); PG_FUNCTION_INFO_V1(spheretrans_line); PG_FUNCTION_INFO_V1(spheretrans_line_inverse); PG_FUNCTION_INFO_V1(sphereline_point_distance); PG_FUNCTION_INFO_V1(sphereline_point_distance_com); /* * Swaps the beginning and ending of the line. */ static void sline_swap_beg_end(SLine *out, const SLine *in) { SLine l; SEuler se; l.length = in->length; l.phi = -in->length; l.theta = PI; l.psi = 0.0; seuler_set_zxz(&se); se.phi = in->phi; se.theta = in->theta; se.psi = in->psi; euler_sline_trans(out, &l, &se); } bool sline_eq(const SLine *l1, const SLine *l2) { if (FPne(l1->length, l2->length)) { return false; } else { SEuler e1, e2; seuler_set_zxz(&e1); seuler_set_zxz(&e2); e1.phi = l1->phi; e1.theta = l1->theta; e1.psi = l1->psi; e2.phi = (FPeq(l2->length, PID)) ? (l1->phi) : (l2->phi); e2.theta = l2->theta; e2.psi = l2->psi; return (strans_eq(&e1, &e2)); } return false; } bool sline_from_points(SLine *sl, const SPoint *pbeg, const SPoint *pend) { SEuler se; float8 l; l = spoint_dist(pbeg, pend); if (FPeq(l, PI)) { if (FPeq(pbeg->lng, pend->lng)) { sline_meridian(sl, pbeg->lng); return true; } return false; } if (spherevector_to_euler(&se, pbeg, pend)) { sl->phi = se.phi; sl->theta = se.theta; sl->psi = se.psi; sl->length = l; } else { sl->phi = PIH; sl->theta = pbeg->lat; sl->psi = pbeg->lng - PIH; sl->length = 0.0; } return (true); } void sline_meridian(SLine *sl, float8 lng) { sl->phi = -PIH; sl->theta = PIH; sl->psi = (lng < 0.0) ? lng + PID : lng; sl->length = PI; } void sline_begin(SPoint *p, const SLine *l) { const SPoint tmp = {0.0, 0.0}; SEuler se; sphereline_to_euler(&se, l); euler_spoint_trans(p, &tmp, &se); } void sline_end(SPoint *p, const SLine *l) { SPoint tmp = {0.0, 0.0}; SEuler se; tmp.lng = l->length; sphereline_to_euler(&se, l); euler_spoint_trans(p, &tmp, &se); } /* * Place begin of a line "l" as vector "v". */ static void sline_vector_begin(Vector3D *v, const SLine *l) { const Vector3D tmp = {1.0, 0.0, 0.0}; SEuler se; sphereline_to_euler(&se, l); euler_vector_trans(v, &tmp, &se); } /* * Place end of a line "l" as vector "v". */ static void sline_vector_end(Vector3D *v, const SLine *l) { Vector3D tmp = {0.0, 0.0, 0.0}; SEuler se; tmp.x = cos(l->length); tmp.y = sin(l->length); sphereline_to_euler(&se, l); euler_vector_trans(v, &tmp, &se); } void sline_min_max_lat(const SLine *sl, float8 *minlat, float8 *maxlat) { float8 inc = sl->theta - floor(sl->theta / PID) * PID; inc = (inc > PI) ? (PID - inc) : (inc); if (FPzero(inc) || FPeq(inc, PI)) { *minlat = *maxlat = 0.0; return; } else { SEuler se; SLine nl; SPoint tp; float8 lng; seuler_set_zxz(&se); se.phi = -sl->psi; se.theta = (inc > PIH) ? (PI - 2 * inc) : (0.0); se.psi = 0.0; euler_sline_trans(&nl, sl, &se); /* Now ascending node at (0,0), line ascending */ sline_begin(&tp, &nl); *minlat = *maxlat = tp.lat; sline_end(&tp, &nl); *minlat = Min(tp.lat, *minlat); *maxlat = Max(tp.lat, *maxlat); for (lng = PIH; lng < PID; lng += PI) { tp.lng = lng; tp.lat = (lng < PI) ? (inc) : (-inc); if (spoint_at_sline(&tp, &nl)) { *minlat = Min(tp.lat, *minlat); *maxlat = Max(tp.lat, *maxlat); } } } } int32 sphereline_latitude_points(const SLine *sl, float8 lat, SPoint *p1, SPoint *p2) { float8 inc = sl->theta - floor(sl->theta / PID) * PID; int32 ret = 0; if (FPgt(lat, PIH)) return 0; if (FPlt(lat, -PIH)) return 0; inc = (inc > PI) ? (PID - inc) : (inc); if (FPzero(inc) || FPeq(inc, PI)) { if (FPzero(lat)) return -1; else return 0; } else { SLine nl; float8 rot = (inc > PIH) ? (sl->psi - PIH) : (sl->psi + PIH); bool p1b, p2b; /* Transform maximum latitude of full line to longitude 0.0 */ memcpy((void *) &nl, (void *) sl, sizeof(SLine)); nl.psi = (inc > PIH) ? (PIH) : (-PIH); p1->lat = p2->lat = lat; p1->lng = p2->lng = 0.0; if (FPeq(inc, PIH)) { p1->lng = PIH; p2->lng = -PIH; ret = 2; } else { float8 ainc; ainc = fabs(inc - ((inc > PIH) ? (PI) : (0.0))); if (FPgt(lat, ainc)) return 0; else if (FPlt(lat, -ainc)) return 0; else if (FPeq(lat, ainc)) { p1->lng = 0.0; ret = 1; } else if (FPeq(lat, -ainc)) { p1->lng = PI; ret = 1; } else { p1->lng = acos(sin(lat) * cos(ainc) / (sin(ainc) * cos(lat))); p2->lng = PID - p1->lng; ret = 2; } } if (ret == 1) { p1b = spoint_at_sline(p1, &nl); if (!p1b) { ret = 0; } } else if (ret == 2) { p1b = spoint_at_sline(p1, &nl); p2b = spoint_at_sline(p2, &nl); if (p1b && p2b) { ret = 2; } else if (!p1b && p2b) { ret = 1; memcpy((void *) p1, (void *) p2, sizeof(SPoint)); } else if (p1b && !p2b) { ret = 1; } else { ret = 0; } } if (ret > 0) { p1->lng += rot; p2->lng += rot; spoint_check(p1); spoint_check(p2); } } return ret; } int8 sphereline_circle_pos(const SLine *sl, const SCIRCLE *sc) { float8 i, mi; const float8 step = (PI - 0.01); SPoint p[2] = {{0.0, 0.0}, {0.0, 0.0}}; SCIRCLE c; bool bbeg, bend; SEuler se; int contain; if (FPzero(sl->length)) { /* line is point */ sline_begin(&p[0], sl); if (spoint_in_circle(&p[0], sc)) { return PGS_CIRCLE_CONT_LINE; } else { return PGS_CIRCLE_LINE_AVOID; } } contain = 0; sphereline_to_euler_inv(&se, sl); euler_scircle_trans(&c, sc, &se); mi = sl->length / step; /* split line in segments and check for each of it */ for (i = 0.0; i < mi; i += 1.0) { p[0].lng = i * step; p[1].lng = (((i + 1.0) > mi) ? (sl->length) : ((i + 1.0) * step)); bbeg = spoint_in_circle(&p[0], &c); bend = spoint_in_circle(&p[1], &c); if (bbeg && bend) { contain++; } else if (bbeg || bend) { return PGS_CIRCLE_LINE_OVER; } else if (FPle(((c.center.lat < 0) ? (-c.center.lat) : (c.center.lat)), c.radius) && FPge(c.center.lng, p[0].lng) && FPle(c.center.lng, p[1].lng)) { return PGS_CIRCLE_LINE_OVER; } else if (contain > 0) { return PGS_CIRCLE_LINE_OVER; } } if (contain > 0 && contain == (floor(mi) + 1)) { return PGS_CIRCLE_CONT_LINE; } return PGS_CIRCLE_LINE_AVOID; } bool sline_circle_touch(const SLine *sl, const SCIRCLE *sc) { /* we assume here, line and circle overlap */ SEuler se; SCIRCLE tc; sphereline_to_euler_inv(&se, sl); euler_scircle_trans(&tc, sc, &se); if (FPge(tc.center.lng, 0.0) && FPle(tc.center.lng, sl->length)) { if (FPeq(fabs(tc.center.lat), sc->radius)) { return true; } return false; } else { SPoint p; p.lng = p.lat = 0.0; if (FPeq(spoint_dist(&p, &tc.center), sc->radius)) { return true; } p.lng = sl->length; if (FPeq(spoint_dist(&p, &tc.center), sc->radius)) { return true; } return false; } } int8 sline_sline_pos(const SLine *l1, const SLine *l2) { const SLine *il1, *il2; Vector3D v[2][2], vtmp; SEuler se; SLine sl1, sl2, lseg; SPoint p[4]; const float8 seg_length = (PI - 0.1); float8 seg_begin; if (sline_eq(l1, l2)) { return PGS_LINE_EQUAL; } sline_swap_beg_end(&sl1, l1); if (sline_eq(&sl1, l2)) { return PGS_LINE_CONT_LINE; } /* transform the larger line into equator ( begin at (0,0) ) */ if (FPge(l1->length, l2->length)) { il1 = l1; il2 = l2; } else { il1 = l2; il2 = l1; } if (FPzero(il1->length)) { /* both are points */ return PGS_LINE_AVOID; } sl1.phi = sl1.theta = sl1.psi = 0.0; p[0].lat = p[0].lng = p[1].lat = 0.0; sl1.length = p[1].lng = il1->length; v[0][0].x = 1.0; v[0][0].y = 0.0; v[0][0].z = 0.0; v[0][1].x = cos(il1->length); v[0][1].y = sin(il1->length); v[0][1].z = 0.0; sphereline_to_euler_inv(&se, il1); sline_vector_begin(&vtmp, il2); euler_vector_trans(&v[1][0], &vtmp, &se); sline_vector_end(&vtmp, il2); euler_vector_trans(&v[1][1], &vtmp, &se); vector3d_spoint(&p[2], &v[1][0]); vector3d_spoint(&p[3], &v[1][1]); /* check connected lines */ if (FPgt(il2->length, 0.0) && (vector3d_eq(&v[0][0], &v[1][0]) || vector3d_eq(&v[0][0], &v[1][1]) || vector3d_eq(&v[0][1], &v[1][0]) || vector3d_eq(&v[0][1], &v[1][1]))) { return PGS_LINE_CONNECT; } /* Check, sl2 is at equator */ if (FPzero(p[2].lat) && FPzero(p[3].lat)) { bool a1 = spoint_at_sline(&p[2], &sl1); bool a2 = spoint_at_sline(&p[3], &sl1); if (a1 && a2) { if (il1 == l2) { return PGS_LINE_OVER; } else { return PGS_LINE_CONT_LINE; } } else if (a1 || a2) { return PGS_LINE_OVER; } return PGS_LINE_AVOID; } /* Now sl2 is not at equator */ if (FPle(il2->length, seg_length)) { bool a1 = (FPge(p[2].lat, 0.0) && FPle(p[3].lat, 0.0)); /* sl2 crosses equator desc. */ bool a2 = (FPle(p[2].lat, 0.0) && FPge(p[3].lat, 0.0)); /* sl2 crosses equator asc. */ if (a1 || a2) { SPoint sp; euler_sline_trans(&sl2, il2, &se); sphereline_to_euler_inv(&se, &sl2); sp.lng = ((a1) ? (PI) : (0.0)) - se.phi; /* node */ sp.lat = 0; spoint_check(&sp); if (FPge(sp.lng, 0.0) && FPle(sp.lng, p[1].lng)) { return PGS_LINE_CROSS; } } return PGS_LINE_AVOID; } /* * We split the smaller line in segments with length less than 180 deg */ euler_sline_trans(&sl2, il2, &se); for (seg_begin = 0.0; seg_begin < il2->length; seg_begin += seg_length) { lseg.length = ((seg_begin + seg_length) > il2->length) ? (il2->length - seg_begin) : seg_length; lseg.phi = sl2.phi + seg_begin; lseg.theta = sl2.theta; lseg.psi = sl2.psi; if (sline_sline_pos(&sl1, &lseg) != PGS_LINE_AVOID) { return PGS_LINE_CROSS; } } return PGS_LINE_AVOID; } void sphereline_to_euler_inv(SEuler *se, const SLine *sl) { sphereline_to_euler(se, sl); spheretrans_inv(se); } void sphereline_to_euler(SEuler *se, const SLine *sl) { seuler_set_zxz(se); se->phi = sl->phi; se->theta = sl->theta; se->psi = sl->psi; } void euler_sline_trans(SLine *out, const SLine *in, const SEuler *se) { SEuler stmp[2]; sphereline_to_euler(&stmp[0], in); seuler_trans_zxz(&stmp[1], &stmp[0], se); out->phi = stmp[1].phi; out->theta = stmp[1].theta; out->psi = stmp[1].psi; out->length = in->length; } bool spoint_at_sline(const SPoint *p, const SLine *sl) { SEuler se; SPoint sp; sphereline_to_euler_inv(&se, sl); euler_spoint_trans(&sp, p, &se); if (FPzero(sp.lat)) { if (FPge(sp.lng, 0.0) && FPle(sp.lng, sl->length)) { return true; } else { return false; } } else { return false; } } void sline_center(SPoint *c, const SLine *sl) { SEuler se; SPoint p; p.lng = sl->length / 2.0; p.lat = 0.0; sphereline_to_euler(&se, sl); euler_spoint_trans(c, &p, &se); } float8 sline_point_dist(const SLine *sl, const SPoint *p) { Vector3D v_beg; Vector3D v_end; Vector3D v; Vector3D normal1; Vector3D normal2; Vector3D line; Vector3D first_p; float8 norma; SPoint fp; SPoint sp; float8 fpdist; float8 spdist; if (spoint_at_sline(p, sl)) { return 0.0; } sline_vector_begin(&v_beg, sl); sline_vector_end(&v_end, sl); spoint_vector3d(&v, p); /* normal1 to the plane passing through the line and the center of the sphere */ vector3d_cross(&normal1, &v_beg, &v_end); if (vector3d_eq(&normal1, &v)) { return PIH; } /* normal2 to the plane perpendicular to the given line. */ vector3d_cross(&normal2, &normal1, &v); vector3d_cross(&line, &normal2, &normal1); norma = sqrt(line.x * line.x + line.y * line.y + line.z * line.z); first_p.x = line.x / norma; first_p.y = line.y / norma; first_p.z = line.z / norma; vector3d_spoint(&fp, &first_p); if (spoint_at_sline(&fp, sl)) { return spoint_dist(&fp, p); } vector3d_spoint(&fp, &v_beg); vector3d_spoint(&sp, &v_end); fpdist = spoint_dist(p, &fp); spdist = spoint_dist(p, &sp); return Min(fpdist, spdist); } Datum sphereline_in(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) palloc(sizeof(SLine)); char *c = PG_GETARG_CSTRING(0); unsigned char etype[3]; float8 eang[3], length; SEuler se, stmp, so; int i; void sphere_yyparse(void); init_buffer(c); sphere_yyparse(); if (get_line(&eang[0], &eang[1], &eang[2], etype, &length)) { for (i = 0; i < 3; i++) { switch (i) { case 0: se.phi_a = etype[i]; break; case 1: se.theta_a = etype[i]; break; case 2: se.psi_a = etype[i]; break; } } se.phi = eang[0]; se.theta = eang[1]; se.psi = eang[2]; stmp.phi = stmp.theta = stmp.psi = 0.0; stmp.phi_a = stmp.theta_a = stmp.psi_a = EULER_AXIS_Z; seuler_trans_zxz(&so, &se, &stmp); sl->phi = so.phi; sl->theta = so.theta; sl->psi = so.psi; if (FPge(length, PID)) { length = PID; } sl->length = length; } else { reset_buffer(); pfree(sl); sl = NULL; elog(ERROR, "sphereline_in: parse error"); } reset_buffer(); PG_RETURN_POINTER(sl); } Datum sphereline_equal(PG_FUNCTION_ARGS) { SLine *l1 = (SLine *) PG_GETARG_POINTER(0); SLine *l2 = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sline_eq(l1, l2)); } Datum sphereline_equal_neg(PG_FUNCTION_ARGS) { SLine *l1 = (SLine *) PG_GETARG_POINTER(0); SLine *l2 = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!sline_eq(l1, l2)); } Datum sphereline_from_point(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) palloc(sizeof(SLine)); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); sline_from_points(sl, p, p); PG_RETURN_POINTER(sl); } Datum sphereline_from_points(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) palloc(sizeof(SLine)); SPoint *beg = (SPoint *) PG_GETARG_POINTER(0); SPoint *end = (SPoint *) PG_GETARG_POINTER(1); if (!sline_from_points(sl, beg, end)) { pfree(sl); sl = NULL; elog(ERROR, "sphereline_from_points: length of line must be not equal 180 degrees"); } PG_RETURN_POINTER(sl); } Datum sphereline_from_trans(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) palloc(sizeof(SLine)); SEuler *se = (SEuler *) PG_GETARG_POINTER(0); float8 l = PG_GETARG_FLOAT8(1); if (FPlt(l, 0.0)) { pfree(sl); elog(ERROR, "sphereline_from_trans: length of line must be >= 0"); PG_RETURN_NULL(); } else { SEuler tmp; if (FPgt(l, PID)) { l = PID; } strans_zxz(&tmp, se); sl->phi = tmp.phi; sl->theta = tmp.theta; sl->psi = tmp.psi; sl->length = l; } PG_RETURN_POINTER(sl); } Datum sphereline_meridian(PG_FUNCTION_ARGS) { SLine *out = (SLine *) palloc(sizeof(SLine)); float8 lng = PG_GETARG_FLOAT8(0); sline_meridian(out, lng); PG_RETURN_POINTER(out); } Datum sphereline_swap_beg_end(PG_FUNCTION_ARGS) { SLine *in = (SLine *) PG_GETARG_POINTER(0); SLine *out = (SLine *) palloc(sizeof(SLine)); sline_swap_beg_end(out, in); PG_RETURN_POINTER(out); } Datum sphereline_turn(PG_FUNCTION_ARGS) { SLine *in = (SLine *) PG_GETARG_POINTER(0); if (FPzero(in->length)) { PG_RETURN_NULL(); } else { SLine *out = (SLine *) palloc(sizeof(SLine)); SEuler se; SLine tmp; tmp.phi = 0.0; tmp.theta = PI; tmp.psi = 0.0; tmp.length = PID - in->length; sphereline_to_euler(&se, in); euler_sline_trans(out, &tmp, &se); PG_RETURN_POINTER(out); } PG_RETURN_NULL(); } Datum sphereline_begin(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) PG_GETARG_POINTER(0); SPoint *sp = (SPoint *) palloc(sizeof(SPoint)); sline_begin(sp, sl); PG_RETURN_POINTER(sp); } Datum sphereline_end(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) PG_GETARG_POINTER(0); SPoint *sp = (SPoint *) palloc(sizeof(SPoint)); sline_end(sp, sl); PG_RETURN_POINTER(sp); } Datum sphereline_length(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(sl->length); } Datum spherecircle_cont_line(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b == PGS_CIRCLE_CONT_LINE); } Datum spherecircle_cont_line_neg(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); SLine *l = (SLine *) PG_GETARG_POINTER(1); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b != PGS_CIRCLE_CONT_LINE); } Datum spherecircle_cont_line_com(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b == PGS_CIRCLE_CONT_LINE); } Datum spherecircle_cont_line_com_neg(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); SLine *l = (SLine *) PG_GETARG_POINTER(0); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b != PGS_CIRCLE_CONT_LINE); } Datum sphereline_overlap_circle(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b > PGS_CIRCLE_LINE_AVOID); } Datum sphereline_overlap_circle_neg(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b == PGS_CIRCLE_LINE_AVOID); } Datum sphereline_overlap_circle_com(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b > PGS_CIRCLE_LINE_AVOID); } Datum sphereline_overlap_circle_com_neg(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(1); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); int8 b = sphereline_circle_pos(l, c); PG_RETURN_BOOL(b == PGS_CIRCLE_LINE_AVOID); } Datum sphereline_crosses(PG_FUNCTION_ARGS) { SLine *l1 = (SLine *) PG_GETARG_POINTER(0); SLine *l2 = (SLine *) PG_GETARG_POINTER(1); int8 r = sline_sline_pos(l1, l2); PG_RETURN_BOOL(r == PGS_LINE_CROSS); } Datum sphereline_crosses_neg(PG_FUNCTION_ARGS) { SLine *l1 = (SLine *) PG_GETARG_POINTER(0); SLine *l2 = (SLine *) PG_GETARG_POINTER(1); int8 r = sline_sline_pos(l1, l2); PG_RETURN_BOOL(r != PGS_LINE_CROSS); } Datum sphereline_overlap(PG_FUNCTION_ARGS) { SLine *l1 = (SLine *) PG_GETARG_POINTER(0); SLine *l2 = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sline_sline_pos(l1, l2) > PGS_LINE_AVOID); } Datum sphereline_overlap_neg(PG_FUNCTION_ARGS) { SLine *l1 = (SLine *) PG_GETARG_POINTER(0); SLine *l2 = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(sline_sline_pos(l1, l2) == PGS_LINE_AVOID); } Datum sphereline_cont_point(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(spoint_at_sline(p, l)); } Datum sphereline_cont_point_neg(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!spoint_at_sline(p, l)); } Datum sphereline_cont_point_com(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(1); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(spoint_at_sline(p, l)); } Datum sphereline_cont_point_com_neg(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(1); SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!spoint_at_sline(p, l)); } Datum spheretrans_line(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) PG_GETARG_POINTER(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SLine *ret = (SLine *) palloc(sizeof(SLine)); euler_sline_trans(ret, sl, se); PG_RETURN_POINTER(ret); } Datum spheretrans_line_inverse(PG_FUNCTION_ARGS) { Datum sl = PG_GETARG_DATUM(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SEuler tmp; Datum ret; spheretrans_inverse(&tmp, se); ret = DirectFunctionCall2(spheretrans_line, sl, PointerGetDatum(&tmp)); PG_RETURN_DATUM(ret); } Datum spheretrans_from_line(PG_FUNCTION_ARGS) { SLine *l = (SLine *) PG_GETARG_POINTER(0); SEuler *e = (SEuler *) palloc(sizeof(SEuler)); sphereline_to_euler(e, l); PG_RETURN_POINTER(e); } Datum sphereline_point_distance(PG_FUNCTION_ARGS) { const SLine *s = (SLine *) PG_GETARG_POINTER(0); const SPoint *p = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_FLOAT8(sline_point_dist(s, p)); } Datum sphereline_point_distance_com(PG_FUNCTION_ARGS) { const SPoint *p = (SPoint *) PG_GETARG_POINTER(0); const SLine *s = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_FLOAT8(sline_point_dist(s, p)); } pgsphere-1.5.1/src/line.h000066400000000000000000000175641461140101500152300ustar00rootroot00000000000000#ifndef __PGS_LINE_H__ #define __PGS_LINE_H__ #include "circle.h" /* Spherical line declarations. */ /* * Spherical line data structures. */ typedef struct { float8 phi, /* the first rotation angle around z axis */ theta, /* the second rotation angle around x axis */ psi; /* the last rotation angle around z axis */ float8 length; /* the length of the line */ } SLine; /* PGS_RELATIONSHIPS Object relationships */ /* PGS_CIRCLE_LINE_REL Circle and line */ #define PGS_CIRCLE_LINE_AVOID 0 /* circle avoids line */ #define PGS_CIRCLE_CONT_LINE 1 /* circle contains line */ #define PGS_CIRCLE_LINE_OVER 2 /* circle overlaps line */ /* PGS_LINE_LINE_REL Line and line */ #define PGS_LINE_AVOID 1 /* line avoids other line */ #define PGS_LINE_EQUAL 2 /* lines are equal */ #define PGS_LINE_CONT_LINE 3 /* line contains line */ #define PGS_LINE_CROSS 4 /* lines cross each other */ #define PGS_LINE_CONNECT 5 /* line are "connected" */ #define PGS_LINE_OVER 6 /* lines overlap each other */ /* * Makes a line with the starting point 'pbeg' and the ending point 'pend'. Result * is placed into sl. * * Returns false if the distance between the 'pbeg' and the 'pend' is 180deg. */ extern bool sline_from_points(SLine *sl, const SPoint *pbeg, const SPoint *pend); /* * Returns a meridian line of a given longitude in radians. The result is placed * into 'sl'. */ extern void sline_meridian(SLine *sl, float8 lng); /* * Returns the starting point of a line 'l'. Result is placed into 'p'. */ extern void sline_begin(SPoint *p, const SLine *l); /* * Returns the ending point of a line 'l'. Result is placed into 'p'. */ extern void sline_end(SPoint *p, const SLine *l); /* * Puts the minimum and the maximum latitudes of a spherical line 's1' into 'minlat' * and 'maxlat'. */ extern void sline_min_max_lat(const SLine *sl, float8 *minlat, float8 *maxlat); /* * Calculates spherical points with a latitude 'lat' on a spherical line. * * Returns the number of found points or <0 if undefined. */ extern int32 sphereline_latitude_points(const SLine *sl, float8 lat, SPoint *p1, SPoint *p2); /* * Returns true if two lines are equal. */ extern bool sline_eq(const SLine *l1, const SLine *l2); /* * Returns the relationship between a line and a circle as PGS_CIRCLE_LINE_REL * int8 value. */ extern int8 sphereline_circle_pos(const SLine *sl, const SCIRCLE *sc); /* * Assuming that a line and a circle overlap, this function returns true * if the line and the circle are touching. Make sure that the line and the * circle overlap before calling this function! Otherwise, the result will be * undefined. * * See sphereline_circle_pos (const SLine *, const SCIRCLE *) */ extern bool sline_circle_touch(const SLine *sl, const SCIRCLE *sc); /* * Returns the relationship between two lines as PGS_LINE_LINE_REL int8 value. */ extern int8 sline_sline_pos(const SLine *l1, const SLine *l2); /* * Checks whether a point is on a line. */ extern bool spoint_at_sline(const SPoint *p, const SLine *sl); /* * Returns the Euler transformation of a line. * * See spheretrans_from_line(PG_FUNCTION_ARGS) */ extern void sphereline_to_euler(SEuler *se, const SLine *sl); /* * Returns the inverse Euler transformation of a line. * * See spheretrans_from_line(PG_FUNCTION_ARGS) */ extern void sphereline_to_euler_inv(SEuler *se, const SLine *sl); /* * Transforms a line using an Euler transformation. * * out - pointer to the resulting line * in - pointer to the original line * se - pointer to the Euler transformation * * See spheretrans_line (PG_FUNCTION_ARGS) */ extern void euler_sline_trans(SLine *out, const SLine *in, const SEuler *se); /* * Puts the center of a line 'sl' into point 'c'. */ extern void sline_center(SPoint *c, const SLine *sl); /* * Calculates the distance between a line 'sl' and a point 'p' */ float8 sline_point_dist(const SLine *sl, const SPoint *p); /* * The input function for spherical line. */ extern Datum sphereline_in(PG_FUNCTION_ARGS); /* * Create a line from a spherical point. */ extern Datum sphereline_from_point(PG_FUNCTION_ARGS); /* * This function creates a spherical line using a starting point * and an ending point. The distance between the points must not be * equal to 180deg. */ extern Datum sphereline_from_points(PG_FUNCTION_ARGS); /* * This function creates a spherical line using a given Euler transformation * and the length of a line. If the length is less than zero, an error occurs. * If the length is larger than 360deg, it is set to 360deg. */ extern Datum sphereline_from_trans(PG_FUNCTION_ARGS); /* * This function creates a meridian running from south to north. * The float8 param provides the longitude in radians. */ extern Datum sphereline_meridian(PG_FUNCTION_ARGS); /* * Swaps the starting point and the ending point of a line. */ extern Datum sphereline_swap_beg_end(PG_FUNCTION_ARGS); /* * Turns the line while preserving the starting & ending points. */ extern Datum sphereline_turn(PG_FUNCTION_ARGS); /* * Returns the beginning of a line. */ extern Datum sphereline_begin(PG_FUNCTION_ARGS); /* * Returns the ending of a line. */ extern Datum sphereline_end(PG_FUNCTION_ARGS); /* * Returns the length of a line in radians. */ extern Datum sphereline_length(PG_FUNCTION_ARGS); /* * Checks whether a line contains a point. */ extern Datum sphereline_cont_point(PG_FUNCTION_ARGS); /* * Checks whether a line doesn't contain a point. */ extern Datum sphereline_cont_point_neg(PG_FUNCTION_ARGS); /* * Checks whether a line contains a point. */ extern Datum sphereline_cont_point_com(PG_FUNCTION_ARGS); /* * Checks whether a line doesn't contain a point. */ extern Datum sphereline_cont_point_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a line. */ extern Datum spherecircle_cont_line(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a line. */ extern Datum spherecircle_cont_line_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a line. */ extern Datum spherecircle_cont_line_com(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a line. */ extern Datum spherecircle_cont_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and a line overlap. */ extern Datum sphereline_overlap_circle(PG_FUNCTION_ARGS); /* * Checks whether circle and a line don't overlap. */ extern Datum sphereline_overlap_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and a line overlap. */ extern Datum sphereline_overlap_circle_com(PG_FUNCTION_ARGS); /* * Checks whether circle and a line don't overlap. */ extern Datum sphereline_overlap_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether two lines are equal. */ extern Datum sphereline_equal(PG_FUNCTION_ARGS); /* * Checks whether two lines are not equal. */ extern Datum sphereline_equal_neg(PG_FUNCTION_ARGS); /* * Checks whether two lines cross each other. */ extern Datum sphereline_crosses(PG_FUNCTION_ARGS); /* * Checks whether two lines don't cross each other. */ extern Datum sphereline_crosses_neg(PG_FUNCTION_ARGS); /* * Checks whether two lines overlap. */ extern Datum sphereline_overlap(PG_FUNCTION_ARGS); /* * Checks whether two lines are overlap. */ extern Datum sphereline_overlap_neg(PG_FUNCTION_ARGS); /* * Returns an Euler transformation. An inverse transformation with it puts * the line into equator beginning at (0,0) and ending at (0,length). */ extern Datum spheretrans_from_line(PG_FUNCTION_ARGS); /* * Transforms a line with an Euler transformation. */ extern Datum spheretrans_line(PG_FUNCTION_ARGS); /* * Transforms a line with an inverse Euler transformation. */ extern Datum spheretrans_line_inverse(PG_FUNCTION_ARGS); /* * Returns the distance between a line and a point. */ extern Datum sphereline_point_distance(PG_FUNCTION_ARGS); /* * Returns the distance between a point and a line. */ extern Datum sphereline_point_distance_com(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/moc.c000066400000000000000000001023741461140101500150440ustar00rootroot00000000000000/* this goes in front to detect the chealpix API break */ #include "pgs_moc.h" #include #include #include "access/gin.h" #include "access/reloptions.h" #include "circle.h" #include "polygon.h" PG_FUNCTION_INFO_V1(smoc_in); PG_FUNCTION_INFO_V1(smoc_out); PG_FUNCTION_INFO_V1(moc_debug); PG_FUNCTION_INFO_V1(set_smoc_output_type); PG_FUNCTION_INFO_V1(smoc_info); PG_FUNCTION_INFO_V1(smoc_area); PG_FUNCTION_INFO_V1(smoc_order); PG_FUNCTION_INFO_V1(smoc_eq); PG_FUNCTION_INFO_V1(smoc_neq); PG_FUNCTION_INFO_V1(smoc_overlap); PG_FUNCTION_INFO_V1(smoc_overlap_neg); PG_FUNCTION_INFO_V1(smoc_subset_smoc); PG_FUNCTION_INFO_V1(smoc_subset_smoc_neg); PG_FUNCTION_INFO_V1(smoc_superset_smoc); PG_FUNCTION_INFO_V1(smoc_superset_smoc_neg); PG_FUNCTION_INFO_V1(healpix_subset_smoc); PG_FUNCTION_INFO_V1(healpix_not_subset_smoc); PG_FUNCTION_INFO_V1(smoc_superset_healpix); PG_FUNCTION_INFO_V1(smoc_not_superset_healpix); PG_FUNCTION_INFO_V1(spoint_subset_smoc); PG_FUNCTION_INFO_V1(spoint_not_subset_smoc); PG_FUNCTION_INFO_V1(smoc_superset_spoint); PG_FUNCTION_INFO_V1(smoc_not_superset_spoint); PG_FUNCTION_INFO_V1(smoc_union); PG_FUNCTION_INFO_V1(smoc_intersection); PG_FUNCTION_INFO_V1(smoc_degrade); PG_FUNCTION_INFO_V1(smoc_spoint); PG_FUNCTION_INFO_V1(smoc_disc); PG_FUNCTION_INFO_V1(smoc_scircle); PG_FUNCTION_INFO_V1(smoc_spoly); PG_FUNCTION_INFO_V1(smoc_gin_extract_value); PG_FUNCTION_INFO_V1(smoc_gin_extract_value_fine); PG_FUNCTION_INFO_V1(smoc_gin_extract_query); PG_FUNCTION_INFO_V1(smoc_gin_extract_query_fine); PG_FUNCTION_INFO_V1(smoc_gin_consistent); PG_FUNCTION_INFO_V1(smoc_gin_options); int32 smoc_output_type = 0; #define LAYDEB 0 #define DEBUG_(code) do { if (LAYDEB) { code; } } while (0); #define DEBUG_CLEAR DEBUG_(moc_debug_clear(moc_error_out)) #define DEBUG_OUT(str) DEBUG_(moc_debug_log(moc_error_out, str)) #define DEBUG_LN DEBUG_OUT("\n") #define DEBUG_PRINT(name, fmt) DEBUG_(moc_debug_log(moc_error_out, \ #name " = " fmt "; ", name)) #define DEBUG_INT(name) DEBUG_PRINT(name, "%d") #define DEBUG_64(name) DEBUG_PRINT(name, MOC_FORMAT_64) // #define DEBUG_(name) DEBUG_PRINT(name, "%") #define DEBUG_ENTRY(name) DEBUG_(hpint64 x; \ memmove(&x, name->start, HP64_SIZE); \ moc_debug_log(moc_error_out, "*" #name \ " = {" MOC_FORMAT_64 " -> %d}; ", \ x, name->offset)) #define DEBUG_INTERVAL(name) DEBUG_(moc_debug_log(moc_error_out, "*" #name \ " = [" MOC_FORMAT_64 ", \ " MOC_FORMAT_64 "); ", \ name->first, name->second)) int32 moc_mod_floor(int32 x, int32 mod) { return x - x % mod; } int32 moc_tree_entry_floor(int32 x) { return moc_mod_floor(x, MOC_TREE_ENTRY_SIZE); } int32 moc_interval_floor(int32 x) { return moc_mod_floor(x, MOC_INTERVAL_SIZE); } static void moc_error_out(const char *message, int type) { ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("MOC processing error: %s", message))); } static bool index_invalid(hpint64 npix, long index) { return index < 0 || index >= npix; } static int dbg_to_moc(int pos, void* moc_in_context, long order, hpint64 first, hpint64 last, pgs_error_handler error_out) { add_to_moc(moc_in_context, order, first, last, error_out); return 0; } // The release_moc_in_context() calls of smoc_in() should be eventually wrapped // into the finalisation function of a proper PostgreSQL memory context. // Datum smoc_in(PG_FUNCTION_ARGS) { char* input_text = PG_GETARG_CSTRING(0); char c; Smoc* moc; void* moc_in_context = create_moc_in_context(moc_error_out); int32 moc_size; long order = -1; hpint64 npix = 0; hpint64 nb; hpint64 nb2; int ind = 0; while (input_text[ind] != '\0') { nb = readNumber(input_text, &ind); c = readChar(input_text, &ind); if (c == '/') /* nb is a Healpix order */ { if (nb == -1) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("[c.%d] Incorrect MOC syntax: a Healpix level " "is expected before a / character.", ind - 1), errhint("Expected syntax: '{healpix_order}/" "{healpix_index}[,...] ...', where " "{healpix_order} is between 0 and 29. Example: " "'1/0 2/3,5-10'."))); } else if (order_invalid((int) nb)) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix order " MOC_FORMAT_64 ".", ind - 1, nb), errhint("A valid Healpix order must be an integer " "between 0 and 29."))); } order = nb; npix = c_npix(order); moc_in_context_set_order(moc_in_context, order); } else if (c == ',') /* nb is a Healpix index */ { if (index_invalid(npix, nb)) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix index " MOC_FORMAT_64 ".", ind - 1, nb), errhint("At order %ld, a Healpix index must be " "an integer between 0 and " MOC_FORMAT_64 ".", order, npix - 1))); } dbg_to_moc(1, moc_in_context, order, nb, nb + 1, moc_error_out); } else if (c == '-') /* next Healpix number must follow */ { nb2 = readNumber(input_text, &ind); if (nb2 == -1) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("[c.%d] Incorrect MOC syntax: a second Healpix " "index is expected after a '-' character.", (ind - 1)), errhint("Expected syntax: '{healpix_order}/" "{healpix_index}[,...] ...', where " "{healpix_order} is between 0 and 29. Example: " "'1/0 2/3,5-10'."))); } c = readChar(input_text, &ind); if (isdigit(c)) { ind--; } if (nb == -1) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Healpix order must not be negative.", ind - 1), errhint("Expected syntax: '{healpix_order}/" "{healpix_index}[,...] ...', where " "{healpix_order} is between 0 and 29. Example: " "'1/0 2/3,5-10'."))); } if (index_invalid(npix, nb)) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix index " MOC_FORMAT_64 ".", ind - 1, nb), errhint("At order %ld, a Healpix index must be " "an integer between 0 and " MOC_FORMAT_64 ".", order, npix - 1))); } if (index_invalid(npix, nb2)) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix index " MOC_FORMAT_64 ".", ind - 1, nb2), errhint("At order %ld, a Healpix index must be " "an integer between 0 and " MOC_FORMAT_64 ".", order, npix - 1))); } if (nb >= nb2) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix range " MOC_FORMAT_64 "-" MOC_FORMAT_64 ".", ind - 1 , nb, nb2), errhint("The first value of a range (here " MOC_FORMAT_64 ") must be" " less than the second one (here " MOC_FORMAT_64 ").", nb, nb2))); } dbg_to_moc(2, moc_in_context, order, nb, nb2 + 1, moc_error_out); } else if (isdigit(c)) /* nb is the last Healpix index of this level */ { if (index_invalid(npix, nb)) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix index " MOC_FORMAT_64 ".", ind - 1, nb), errhint("At order %ld, a Healpix index must be " "an integer between 0 and " MOC_FORMAT_64 ".", order, npix - 1))); } ind--; /* Nothing else to do in this function */ dbg_to_moc(3, moc_in_context, order, nb, nb + 1, moc_error_out); } else if (c == '\0') /* nb should be the last Healpix index */ { if (order == -1) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("Incorrect MOC syntax: empty string found."), errhint("The minimal expected syntax is: '{healpix_order}/', " "where {healpix_order} must be an integer between 0 and" " 29. This will create an empty MOC. Example: '1/'."))); } else if (nb != -1 && index_invalid(npix, nb)) { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), errmsg("[c.%d] Incorrect Healpix index " MOC_FORMAT_64 ".", ind - 1, nb), errhint("At order %ld, a Healpix index must be " "an integer between 0 and " MOC_FORMAT_64 ".", order, npix - 1))); } else { dbg_to_moc(4, moc_in_context, order, nb, nb + 1, moc_error_out); } } else { release_moc_in_context(moc_in_context, moc_error_out); ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("[c.%d] Incorrect MOC syntax: unsupported character " "'%c'.", ind - 1, c), errhint("Expected syntax: '{healpix_order}/" "{healpix_index}[,...] ...', where {healpix_order} " "is between 0 and 29. Example: '1/0 2/3,5-10'."))); } } moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); /* palloc() will leak the moc_in_context if it fails :-/ */ moc = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc, moc_size); create_moc_release_context(moc_in_context, moc, moc_error_out); PG_RETURN_POINTER(moc); } /** * [readNumber(char*, int*) --> long] * * Read the next character as a number. * * All whitespaces from the given position to the first digit are silently * skiped. * * If the first non-whitespace character is not a digit, this function returns * immediately -1. Otherwise, all successive digits are read and gather to build * the corresponding number. * * The given index is incremented each time a character (whatever it is) is * skiped. * * @param mocAscii The string in which the number must be read. * @param start Index from which the number must be read. * This value is incremented at each read character. * * @return The read number, * or -1 if no digit has been found. */ hpint64 readNumber(const char* mocAscii, int* start) { hpint64 nb = -1; // Skip all space characters: while(mocAscii[*start] != '\0' && isspace(mocAscii[*start])) (*start)++; /* If the current character is a digit, * read all other possible successive digits: */ if (mocAscii[*start] != '\0' && isdigit(mocAscii[*start])){ nb = 0; do{ nb = nb*10 + (long)(mocAscii[*start]-48); (*start)++; }while(isdigit(mocAscii[*start]) && mocAscii[*start] != '\0'); } // Return the read number: return nb; } /** * [readChar(char*, int*) --> char] * * Read the next non-whitespace character. * * All whitespaces from the given position are silently skipped. * * The given index is incremented each time a character (whatever it is) is * skipped. * * When the end of the given string is reached, this function stops immediately * and returns '\0'. The given index is then set to the corresponding position. * * @param mocAscii The string in which the next non-whitespace character must * be read. * @param start Index from which the character must be read. * This value is incremented at each read character. * * @return The read non-whitespace character, * or '\0' if the end has been reached. */ char readChar(const char* mocAscii, int* start) { // Skip all space characters: while(mocAscii[*start] != '\0' && isspace(mocAscii[*start])) (*start)++; // Return the read character: if (mocAscii[*start] == '\0') return '\0'; else return mocAscii[(*start)++]; } Datum set_smoc_output_type(PG_FUNCTION_ARGS) { int32 out_type = PG_GETARG_INT32(0); char *buffer = (char *) palloc(80); if (out_type < 0) out_type = 0; if (out_type > 1) out_type = 1; smoc_output_type = out_type; switch (smoc_output_type) { case 0: sprintf(buffer, "Set output type to MOC-ASCII (0)."); break; case 1: sprintf(buffer, "Set output type to MOC intervals (1)."); break; default: moc_error_out("set_smoc_output_type()", 0); } PG_RETURN_CSTRING(buffer); } Datum smoc_info(PG_FUNCTION_ARGS) { /* get just the MOC header: */ Smoc *moc = (Smoc *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, MOC_HEADER_VARSIZE); char *p = psprintf("version: %u, order: %u, depth: %u, first: " MOC_FORMAT_64U ", last: " MOC_FORMAT_64U ", area: " MOC_FORMAT_64U ", tree_begin: %d, data_begin: %d", moc->version, moc->order, moc-> depth, moc->first, moc->last, moc->area, moc->tree_begin, moc->data_begin); PG_RETURN_TEXT_P(cstring_to_text(p)); } Datum smoc_area(PG_FUNCTION_ARGS) { /* get just the MOC header: */ Smoc *moc = (Smoc *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, MOC_HEADER_VARSIZE); PG_RETURN_FLOAT8(moc->area * 4.0 * M_PI / MOC_AREA_ALL_SKY); } Datum smoc_order(PG_FUNCTION_ARGS) { /* get just the MOC header: */ Smoc *moc = (Smoc *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, MOC_HEADER_VARSIZE); PG_RETURN_INT32(moc->order); } Datum smoc_out(PG_FUNCTION_ARGS) { Smoc *moc = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); moc_out_data out_context = create_moc_out_context(moc, VARSIZE(moc) - VARHDRSZ, moc_error_out); /* palloc() will leak the out_context if it fails :-/ */ char *buf = (char *) palloc(out_context.out_size); print_moc_release_context(out_context, buf, moc_error_out); PG_RETURN_CSTRING(buf); } Datum moc_debug(PG_FUNCTION_ARGS) { const char *c_str; size_t x_size = get_moc_debug(&c_str, moc_error_out); const char *x = (const char*) palloc(x_size); memmove((void*) x, (void*) c_str, x_size); PG_RETURN_TEXT_P(cstring_to_text(x)); } static bool smoc_eq_impl(Datum a, Datum b) { Smoc* moc_a = (Smoc *)PG_DETOAST_DATUM_SLICE(a, 0, MOC_HEADER_PAGE); Smoc* moc_b = (Smoc *)PG_DETOAST_DATUM_SLICE(b, 0, MOC_HEADER_PAGE); int32 moc_a_end; int32 moc_b_end; char* moc_a_base; char* moc_b_base; /* quick exit if header values don't agree */ if (moc_a->order != moc_b->order || moc_a->first != moc_b->first || moc_a->last != moc_b->last || moc_a->area != moc_b->area) return false; if (moc_a->data_begin != moc_b->data_begin) /* this needs to be reconsidered if the MOC version is updated */ return false; /* get full moc */ moc_a = (Smoc *)PG_DETOAST_DATUM(a); moc_b = (Smoc *)PG_DETOAST_DATUM(b); moc_a_end = VARSIZE(moc_a) - VARHDRSZ; moc_b_end = VARSIZE(moc_b) - VARHDRSZ; moc_a_base = MOC_BASE(moc_a); moc_b_base = MOC_BASE(moc_b); if (moc_a_end != moc_b_end) /* this needs to be reconsidered if the MOC version is updated */ return false; for (int j = moc_a->data_begin; j < moc_a_end; j += MOC_INTERVAL_SIZE) // iterate over both in parallel { moc_interval *x; moc_interval *y; // page bumps int32 mod = (j + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < MOC_INTERVAL_SIZE) j += MOC_INTERVAL_SIZE - mod; x = MOC_INTERVAL(moc_a_base, j); y = MOC_INTERVAL(moc_b_base, j); if (x->first != y->first || x->second != y->second) return false; } return true; } Datum smoc_eq(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(smoc_eq_impl(a, b)); } Datum smoc_neq(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(! smoc_eq_impl(a, b)); } static bool smoc_overlap_impl(Datum a, Datum b) { Smoc* moc_a = (Smoc *)PG_DETOAST_DATUM_SLICE(a, 0, MOC_HEADER_PAGE); Smoc* moc_b = (Smoc *)PG_DETOAST_DATUM_SLICE(b, 0, MOC_HEADER_PAGE); int32 i = moc_a->data_begin; int32 j = moc_b->data_begin; int32 moc_a_end; int32 moc_b_end; char* moc_a_base; char* moc_b_base; // empty mocs do not overlap if (moc_a->area == 0 || moc_b->area == 0) return false; // quick exit if the mocs do not overlap at all if (moc_a->first >= moc_b->last || moc_a->last <= moc_b->first) return false; // all-sky mocs overlap everything if (moc_a->area == MOC_AREA_ALL_SKY || moc_b->area == MOC_AREA_ALL_SKY) return true; // get full moc moc_a = (Smoc *)PG_DETOAST_DATUM(a); moc_b = (Smoc *)PG_DETOAST_DATUM(b); moc_a_end = VARSIZE(moc_a) - VARHDRSZ; moc_b_end = VARSIZE(moc_b) - VARHDRSZ; moc_a_base = MOC_BASE(moc_a); moc_b_base = MOC_BASE(moc_b); while (i < moc_a_end && j < moc_b_end) // iterate over both in parallel { moc_interval *x; moc_interval *y; // page bumps int32 mod = (i + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < MOC_INTERVAL_SIZE) i += MOC_INTERVAL_SIZE - mod; x = MOC_INTERVAL(moc_a_base, i); mod = (j + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < MOC_INTERVAL_SIZE) j += MOC_INTERVAL_SIZE - mod; y = MOC_INTERVAL(moc_b_base, j); if (x->second <= y->first) // a entirely left of b, advance a { i += MOC_INTERVAL_SIZE; continue; } if (y->second <= x->first) // b entirely left of a, advance b { j += MOC_INTERVAL_SIZE; continue; } return true; // entries overlap } return false; } Datum smoc_overlap(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(smoc_overlap_impl(a, b)); } Datum smoc_overlap_neg(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(! smoc_overlap_impl(a, b)); } /* check if moc_a is a subset of moc_b */ static bool smoc_subset_impl(Datum a, Datum b) { Smoc* moc_a = (Smoc *)PG_DETOAST_DATUM_SLICE(a, 0, MOC_HEADER_PAGE); Smoc* moc_b = (Smoc *)PG_DETOAST_DATUM_SLICE(b, 0, MOC_HEADER_PAGE); int32 i = moc_a->data_begin; int32 j = moc_b->data_begin; int32 moc_a_end; int32 moc_b_end; char* moc_a_base; char* moc_b_base; // an empty moc is subset of all mocs if (moc_a->area == 0) return true; // b is the whole sky if (moc_b->area == MOC_AREA_ALL_SKY) return true; // a cannot be larger than b if (moc_a->area > moc_b->area) return false; // quick exit if the mocs do not overlap at all if (moc_a->first >= moc_b->last || moc_a->last <= moc_b->first) return false; // get full moc moc_a = (Smoc *)PG_DETOAST_DATUM(a); moc_b = (Smoc *)PG_DETOAST_DATUM(b); moc_a_end = VARSIZE(moc_a) - VARHDRSZ; moc_b_end = VARSIZE(moc_b) - VARHDRSZ; moc_a_base = MOC_BASE(moc_a); moc_b_base = MOC_BASE(moc_b); while (i < moc_a_end) // iterate over a { int32 mod; moc_interval *x; moc_interval *y; // end of b reached while there's still 'a' intervals if (j >= moc_b_end) return false; // page bumps mod = (i + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < MOC_INTERVAL_SIZE) i += MOC_INTERVAL_SIZE - mod; x = MOC_INTERVAL(moc_a_base, i); mod = (j + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < MOC_INTERVAL_SIZE) j += MOC_INTERVAL_SIZE - mod; y = MOC_INTERVAL(moc_b_base, j); // advance b until as long as we are before the 'a' interval if (y->second <= x->first) { j += MOC_INTERVAL_SIZE; continue; } // we can check for a match now if (x->first < y->first) // a starts left of b return false; if (x->second > y->second) // b ends right of a return false; // advance interval that has the lowest end if (x->second == y->second) { i += MOC_INTERVAL_SIZE; j += MOC_INTERVAL_SIZE; } else if (x->second <= y->second) i += MOC_INTERVAL_SIZE; else j += MOC_INTERVAL_SIZE; // TODO: we could walk the tree structure to find the next interesting interval } return true; } Datum smoc_subset_smoc(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(smoc_subset_impl(a, b)); } Datum smoc_subset_smoc_neg(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(! smoc_subset_impl(a, b)); } Datum smoc_superset_smoc(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(smoc_subset_impl(b, a)); } Datum smoc_superset_smoc_neg(PG_FUNCTION_ARGS) { Datum a = PG_GETARG_DATUM(0); Datum b = PG_GETARG_DATUM(1); PG_RETURN_BOOL(! smoc_subset_impl(b, a)); } static bool entry_equal(moc_tree_entry *a, hpint64 y) { hpint64 x; memmove(&x, a->start, HP64_SIZE); return x == y; } static void fit_level_end_to(int32 d_end, int32 *level_end, int32 level_begin, int32 mod) { if (*level_end > d_end) *level_end = level_begin + moc_mod_floor(d_end - level_begin, mod); } bool healpix_subset_smoc_impl(hpint64 x, Datum y) { int32 end = toast_raw_datum_size(y) - VARHDRSZ; Smoc *moc; char *moc_base; int32 tree_begin; int32 depth; int32 *level_ends; int32 k; int32 d_begin = 0; int32 d_end; int32 level_begin; int32 level_end; moc_tree_entry *first; moc_tree_entry *last; moc_tree_entry *w; moc_interval *first_i; moc_interval *last_i; moc_interval *v; int32 count; if (end == MIN_MOC_SIZE) /* should include empty root node... */ return false; /* get the first page -- it contains at least the full root node */ moc = (Smoc *) PG_DETOAST_DATUM_SLICE(y, 0, MOC_HEADER_PAGE); d_end = VARSIZE(moc) - VARHDRSZ; /* the end of the actually detoasted part */ if (moc->first == moc->last || x < moc->first || x >= moc->last) return false; moc_base = MOC_BASE(moc); tree_begin = moc->tree_begin; depth = moc->depth; level_ends = (int32 *)(moc_base + tree_begin); level_begin = tree_begin + 4 * depth; for (k = 0; k < depth; ++k) { level_end = level_ends[k]; fit_level_end_to(d_end, &level_end, level_begin, MOC_TREE_ENTRY_SIZE); first = MOC_ENTRY(moc_base, level_begin - d_begin); last = MOC_ENTRY(moc_base, level_end - d_begin); w = entry_lower_bound(first, last, x); if (w != last && entry_equal(w, x)) return true; --w; level_begin = w->offset; if (level_begin < d_end) continue; /* get the (potentially fractional) page the entry points to */ d_begin = level_begin; count = PG_TOAST_PAGE_FRAGMENT - d_begin % PG_TOAST_PAGE_FRAGMENT; moc_base = (char *) PG_DETOAST_DATUM_SLICE(y, d_begin, count); d_end = d_begin + VARSIZE(moc_base) - VARHDRSZ; moc_base += VARHDRSZ; } // search in interval page defined by (moc_base, level_begin, d_end) fit_level_end_to(d_end, &end, level_begin, MOC_INTERVAL_SIZE); first_i = MOC_INTERVAL(moc_base, level_begin - d_begin); last_i = MOC_INTERVAL(moc_base, end - d_begin); //debug: print out the whole of [*first_i, *last_i) -- also for nodes!!! v = interval_lower_bound(first_i, last_i, x); if (v != last_i && v->first == x) return true; --v; return v->first < x && x < v->second; } Datum healpix_subset_smoc_c(hpint64 x, Datum y) { PG_RETURN_BOOL(healpix_subset_smoc_impl(x, y)); } Datum healpix_not_subset_smoc_c(hpint64 x, Datum y) { PG_RETURN_BOOL(!healpix_subset_smoc_impl(x, y)); } bool spoint_subset_smoc_impl(SPoint *x, Datum y) { return healpix_subset_smoc_impl(healpix_nest_c(29, x), y); } Datum spoint_subset_smoc_c(SPoint *x, Datum y) { PG_RETURN_BOOL(spoint_subset_smoc_impl(x, y)); } Datum spoint_not_subset_smoc_c(SPoint *x, Datum y) { PG_RETURN_BOOL(!spoint_subset_smoc_impl(x, y)); } Datum healpix_subset_smoc(PG_FUNCTION_ARGS) { hpint64 x = PG_GETARG_INT64(0); Datum y = PG_GETARG_DATUM(1); return healpix_subset_smoc_c(x, y); } Datum healpix_not_subset_smoc(PG_FUNCTION_ARGS) { hpint64 x = PG_GETARG_INT64(0); Datum y = PG_GETARG_DATUM(1); return healpix_not_subset_smoc_c(x, y); } Datum smoc_superset_healpix(PG_FUNCTION_ARGS) { Datum x = PG_GETARG_DATUM(0); hpint64 y = PG_GETARG_INT64(1); return healpix_subset_smoc_c(y, x); } Datum smoc_not_superset_healpix(PG_FUNCTION_ARGS) { Datum x = PG_GETARG_DATUM(0); hpint64 y = PG_GETARG_INT64(1); return healpix_not_subset_smoc_c(y, x); } Datum spoint_subset_smoc(PG_FUNCTION_ARGS) { SPoint *x = (SPoint *) PG_GETARG_POINTER(0); Datum y = PG_GETARG_DATUM(1); return spoint_subset_smoc_c(x, y); } Datum spoint_not_subset_smoc(PG_FUNCTION_ARGS) { SPoint *x = (SPoint *) PG_GETARG_POINTER(0); Datum y = PG_GETARG_DATUM(1); return spoint_not_subset_smoc_c(x, y); } Datum smoc_superset_spoint(PG_FUNCTION_ARGS) { Datum x = PG_GETARG_DATUM(0); SPoint *y = (SPoint *) PG_GETARG_POINTER(1); return spoint_subset_smoc_c(y, x); } Datum smoc_not_superset_spoint(PG_FUNCTION_ARGS) { Datum x = PG_GETARG_DATUM(0); SPoint *y = (SPoint *) PG_GETARG_POINTER(1); return spoint_not_subset_smoc_c(y, x); } Datum smoc_union(PG_FUNCTION_ARGS) { Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); Smoc* moc_b = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1)); Smoc* moc_ret; void* moc_in_context = create_moc_in_context(moc_error_out); int32 moc_size; moc_union(moc_in_context, moc_a, VARSIZE(moc_a) - VARHDRSZ, moc_b, VARSIZE(moc_b) - VARHDRSZ, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); /* palloc() will leak the moc_in_context if it fails :-/ */ moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } Datum smoc_intersection(PG_FUNCTION_ARGS) { Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); Smoc* moc_b = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1)); Smoc* moc_ret; void* moc_in_context = create_moc_in_context(moc_error_out); int32 moc_size; moc_intersection(moc_in_context, moc_a, VARSIZE(moc_a) - VARHDRSZ, moc_b, VARSIZE(moc_b) - VARHDRSZ, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); /* palloc() will leak the moc_in_context if it fails :-/ */ moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } Datum smoc_degrade(PG_FUNCTION_ARGS) { int order = PG_GETARG_INT32(0); Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1)); Smoc* moc_ret; void* moc_in_context = create_moc_in_context(moc_error_out); int32 moc_size; check_order(order); moc_degrade(moc_in_context, order, moc_a, VARSIZE(moc_a) - VARHDRSZ, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); /* palloc() will leak the moc_in_context if it fails :-/ */ moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } Datum smoc_spoint(PG_FUNCTION_ARGS) { int order = PG_GETARG_INT32(0); SPoint* p = (SPoint*) PG_GETARG_POINTER(1); hpint64 pixel, first, last; void* moc_in_context; int32 moc_size; Smoc* moc_ret; check_order(order); pixel = healpix_nest_c(order, p); first = c_healpix_convert_nest(pixel, order, HEALPIX_MAX_ORDER); last = c_healpix_convert_nest(pixel + 1, order, HEALPIX_MAX_ORDER); moc_in_context = create_moc_in_context(moc_error_out); moc_healpix(moc_in_context, order, first, last, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } Datum smoc_disc(PG_FUNCTION_ARGS) { int order = PG_GETARG_INT32(0); double lng = PG_GETARG_FLOAT8(1); double lat = PG_GETARG_FLOAT8(2); double radius = PG_GETARG_FLOAT8(3); void* moc_in_context; int32 moc_size; Smoc* moc_ret; check_order(order); moc_in_context = create_moc_in_context(moc_error_out); moc_disc(moc_in_context, order, lng, lat, radius, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } Datum smoc_scircle(PG_FUNCTION_ARGS) { int order = PG_GETARG_INT32(0); SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(1); void* moc_in_context; int32 moc_size; Smoc* moc_ret; check_order(order); moc_in_context = create_moc_in_context(moc_error_out); moc_disc(moc_in_context, order, c->center.lat, c->center.lng, c->radius, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } Datum smoc_spoly(PG_FUNCTION_ARGS) { int order = PG_GETARG_INT32(0); SPOLY* polygon = (SPOLY *) PG_GETARG_SPOLY(1); void* moc_in_context; int32 moc_size; Smoc* moc_ret; check_order(order); moc_in_context = create_moc_in_context(moc_error_out); moc_polygon(moc_in_context, order, polygon->npts, (float8 *)polygon->p, moc_error_out); moc_size = VARHDRSZ + get_moc_size(moc_in_context, moc_error_out); moc_ret = (Smoc*) palloc0(moc_size); SET_VARSIZE(moc_ret, moc_size); create_moc_release_context(moc_in_context, moc_ret, moc_error_out); PG_RETURN_POINTER(moc_ret); } /* GIN index ***********************************/ static Datum smoc_gin_extract_internal(Smoc *moc_a, int32 *nkeys, int gin_order) { char* moc_a_base = MOC_BASE(moc_a); int32 moc_a_end = VARSIZE(moc_a) - VARHDRSZ; int32 nalloc = 4; Datum* keys = palloc(nalloc * sizeof(Datum)); *nkeys = 0; for (int32 a = moc_a->data_begin; a < moc_a_end; a = next_interval(a)) { moc_interval *x = MOC_INTERVAL(moc_a_base, a); int shift = 2 * (HEALPIX_MAX_ORDER - gin_order); // degrade to MOC_GIN_ORDER int32 first = (x->first >> shift); // set low bits to zero hpint64 low_bits_one = (1LL << shift) - 1; int32 second = ((x->second + low_bits_one) >> shift); // round low bits up Assert(shift > 32); // internal GIN datatype isn't 64 bits // split interval into individual pixels of order MOC_GIN_ORDER for (int32 p = first; p < second; p++) { if (*nkeys > 0 && keys[*nkeys - 1] == p) // has (larger) pixel already been added? continue; if (*nkeys >= nalloc) { nalloc *= 2; keys = repalloc(keys, nalloc * sizeof(Datum)); } keys[(*nkeys)++] = Int32GetDatum(p); } } PG_RETURN_POINTER(keys); } Datum smoc_gin_extract_value(PG_FUNCTION_ARGS) { Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); int32* nkeys = (int32 *) PG_GETARG_POINTER(1); int order = SMOC_GIN_GET_ORDER(); PG_RETURN_DATUM(smoc_gin_extract_internal(moc_a, nkeys, order)); } Datum smoc_gin_extract_value_fine(PG_FUNCTION_ARGS) { Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); int32* nkeys = (int32 *) PG_GETARG_POINTER(1); PG_RETURN_DATUM(smoc_gin_extract_internal(moc_a, nkeys, MOC_GIN_ORDER_FINE)); } Datum smoc_gin_extract_query(PG_FUNCTION_ARGS) { Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); int32* nkeys = (int32 *) PG_GETARG_POINTER(1); StrategyNumber st = PG_GETARG_UINT16(2); int32* searchmode = (int32 *) PG_GETARG_POINTER(6); int order = SMOC_GIN_GET_ORDER(); if (st == MOC_GIN_STRATEGY_SUBSET || (st == MOC_GIN_STRATEGY_EQUAL && moc_a->area == 0)) *searchmode = GIN_SEARCH_MODE_INCLUDE_EMPTY; else if (st == MOC_GIN_STRATEGY_UNEQUAL) *searchmode = GIN_SEARCH_MODE_ALL; PG_RETURN_DATUM(smoc_gin_extract_internal(moc_a, nkeys, order)); } Datum smoc_gin_extract_query_fine(PG_FUNCTION_ARGS) { Smoc* moc_a = (Smoc *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); int32* nkeys = (int32 *) PG_GETARG_POINTER(1); StrategyNumber st = PG_GETARG_UINT16(2); int32* searchmode = (int32 *) PG_GETARG_POINTER(6); if (st == MOC_GIN_STRATEGY_SUBSET || (st == MOC_GIN_STRATEGY_EQUAL && moc_a->area == 0)) *searchmode = GIN_SEARCH_MODE_INCLUDE_EMPTY; else if (st == MOC_GIN_STRATEGY_UNEQUAL) *searchmode = GIN_SEARCH_MODE_ALL; PG_RETURN_DATUM(smoc_gin_extract_internal(moc_a, nkeys, MOC_GIN_ORDER_FINE)); } Datum smoc_gin_consistent(PG_FUNCTION_ARGS) { bool* check = (bool *) PG_GETARG_POINTER(0); StrategyNumber st = PG_GETARG_UINT16(1); int32 nkeys = PG_GETARG_INT32(3); bool* recheck = (bool *) PG_GETARG_POINTER(5); switch (st) { case MOC_GIN_STRATEGY_INTERSECTS: /* return true if we have any overlap */ for (int i = 0; i < nkeys; i++) { if (check[i]) { *recheck = true; PG_RETURN_BOOL(true); } } PG_RETURN_BOOL(false); case MOC_GIN_STRATEGY_SUBSET: /* defer decision to recheck */ *recheck = true; PG_RETURN_BOOL(true); case MOC_GIN_STRATEGY_SUPERSET: case MOC_GIN_STRATEGY_EQUAL: /* return true when all pixels are contained in the indexed value */ for (int i = 0; i < nkeys; i++) { if (! check[i]) { PG_RETURN_BOOL(false); } } *recheck = true; PG_RETURN_BOOL(true); case MOC_GIN_STRATEGY_UNEQUAL: /* return true when there is a difference */ for (int i = 0; i < nkeys; i++) { if (! check[i]) { PG_RETURN_BOOL(true); } } /* we still need to recheck otherwise */ *recheck = true; PG_RETURN_BOOL(true); default: Assert(0); } /* not reached */ PG_RETURN_NULL(); } #if PG_VERSION_NUM >= 130000 Datum smoc_gin_options(PG_FUNCTION_ARGS) { local_relopts *relopts = (local_relopts *) PG_GETARG_POINTER(0); init_local_reloptions(relopts, sizeof(SMocGinOptions)); add_local_int_reloption(relopts, "order", "smoc order to store in index", MOC_GIN_ORDER_DEFAULT, 0, 12, /* maximum order fitting into 32bit */ offsetof(SMocGinOptions, order)); PG_RETURN_VOID(); } #endif pgsphere-1.5.1/src/output.c000066400000000000000000000541161461140101500156260ustar00rootroot00000000000000#include "types.h" #if PG_VERSION_NUM >= 120000 #include "utils/float.h" #include "common/shortest_dec.h" #endif #include #if !defined(PGSPHERE_VERSION) #error "PGSPHERE_VERSION macro is not set" #endif #define PGSPHERE_STRINGIFY_INTERNAL(x) #x #define PGSPHERE_STRINGIFY(x) PGSPHERE_STRINGIFY_INTERNAL(x) /* Output functions */ /* Output modes */ #define OUTPUT_RAD 1 /* output in radians */ #define OUTPUT_DEG 2 /* output in degrees */ #define OUTPUT_DMS 3 /* output in degrees, minutes, seconds */ #define OUTPUT_HMS 4 /* output in hour, minutes, seconds */ /*. * Holds the current output modus. * Default is radians. */ static unsigned char sphere_output = OUTPUT_RAD; /* * Defines the precision of floating point values in output. */ static int sphere_output_precision = INT_MAX; PG_FUNCTION_INFO_V1(set_sphere_output); PG_FUNCTION_INFO_V1(spherepoint_out); PG_FUNCTION_INFO_V1(spherecircle_out); PG_FUNCTION_INFO_V1(sphereline_out); PG_FUNCTION_INFO_V1(spheretrans_out); PG_FUNCTION_INFO_V1(spherepoly_out); PG_FUNCTION_INFO_V1(spherepath_out); PG_FUNCTION_INFO_V1(sphereellipse_out); PG_FUNCTION_INFO_V1(spherebox_out); PG_FUNCTION_INFO_V1(set_sphere_output_precision); PG_FUNCTION_INFO_V1(reset_sphere_output_precision); PG_FUNCTION_INFO_V1(pg_sphere_version); /* * Sets the output modus. */ Datum set_sphere_output(PG_FUNCTION_ARGS); /* * Sets the output precision. */ Datum set_sphere_output_precision(PG_FUNCTION_ARGS); /* * The output function of spherical point. */ Datum spherepoint_out(PG_FUNCTION_ARGS); /* * The output function of spherical circle. */ Datum spherecircle_out(PG_FUNCTION_ARGS); /* * The output function of spherical line. */ Datum sphereline_out(PG_FUNCTION_ARGS); /* * The output function of Euler transformation. */ Datum spheretrans_out(PG_FUNCTION_ARGS); /* * The output function of spherical polygon. */ Datum spherepoly_out(PG_FUNCTION_ARGS); /* * The output function of spherical path. */ Datum spherepath_out(PG_FUNCTION_ARGS); /* * The output function of spherical ellipse. */ Datum sphereellipse_out(PG_FUNCTION_ARGS); /* * The output function of spherical box. */ Datum spherebox_out(PG_FUNCTION_ARGS); /* * Returns pg_sphere version. */ Datum pg_sphere_version(PG_FUNCTION_ARGS); static void spheretrans_out_buffer(StringInfo si, const SEuler *se); /* * Converts radians to DEG ( degrees, minutes, seconds ) * * rad - input in radians * deg - pointer to degrees * min - pointer to minutes * sec - pointer to seconds */ static void rad_to_dms(double rad, unsigned int *deg, unsigned int *min, double *sec) { double rsign = rad < 0 ? -1 : 1; const double sec_dig = pow(10, FLT_DIG); rad *= (rsign * RADIANS); *deg = floor(rad); *min = floor(60 * (rad - *deg)); *sec = rad * 3600 - *min * 60 - *deg * 3600; *sec = rint((double) (*sec * sec_dig)) / sec_dig; if (*sec >= 60.0) { *sec -= 60.0; (*min)++; } if (*min >= 60) { *min -= 60; (*deg)++; } } static void pgs_strinfo_put_chr(StringInfo si, char c) { appendStringInfoChar(si, c); } static void pgs_strinfo_put_str(StringInfo si, char *s) { appendStringInfoString(si, s); } static void pgs_strinfo_put_d64(StringInfo si, double value) { int cw, ndig; char buf[128]; #if PG_VERSION_NUM >= 120000 if (extra_float_digits > 0) { cw = double_to_shortest_decimal_buf(value, buf); } else { ndig = DBL_DIG + extra_float_digits; if (ndig < 1) ndig = 1; cw = pg_strfromd(buf, 128, ndig, value); } #else ndig = DBL_DIG + extra_float_digits; if (ndig < 1) ndig = 1; cw = snprintf(buf, 128, "%.*g", ndig, value); #endif if (cw < 0) { fflush(stderr); abort(); } pgs_strinfo_put_str(si, buf); } static void pgs_strinfo_put_lng_dms(StringInfo si, double lng) { unsigned int lngdeg, lngmin; double lngsec; rad_to_dms(lng, &lngdeg, &lngmin, &lngsec); appendStringInfo(si, "%3ud %2um ", lngdeg, lngmin); pgs_strinfo_put_d64(si, lngsec); pgs_strinfo_put_chr(si, 's'); } static void pgs_strinfo_put_lng_hms(StringInfo si, double lng) { unsigned int lnghour, lngmin; double lngsec; rad_to_dms(lng / 15.0, &lnghour, &lngmin, &lngsec); appendStringInfo(si, "%3uh %2um ", lnghour, lngmin); pgs_strinfo_put_d64(si, lngsec); pgs_strinfo_put_chr(si, 's'); } static void pgs_strinfo_put_lat_dms(StringInfo si, double lat) { unsigned int latdeg, latmin; double latsec; const char latsign = lat >= 0 ? '+' : '-'; rad_to_dms(lat, &latdeg, &latmin, &latsec); appendStringInfo(si, "%c%2ud %2um ", latsign, latdeg, latmin); pgs_strinfo_put_d64(si, latsec); pgs_strinfo_put_chr(si, 's'); } static void pgs_strinfo_put_radius_dms(StringInfo si, double radius) { unsigned int rdeg, rmin; double rsec; rad_to_dms(radius, &rdeg, &rmin, &rsec); appendStringInfo(si, "%2ud %2um ", rdeg, rmin); pgs_strinfo_put_d64(si, rsec); pgs_strinfo_put_chr(si, 's'); } Datum set_sphere_output_precision(PG_FUNCTION_ARGS) { short int c = PG_GETARG_INT16(0); char *buf = (char *) palloc(20); if (c > DBL_DIG) c = DBL_DIG; if (c < 1) c = DBL_DIG; sphere_output_precision = c; sprintf(buf, "SET %d", c); PG_RETURN_CSTRING(buf); } Datum reset_sphere_output_precision(PG_FUNCTION_ARGS) { char *buf = (char *) palloc(20); sphere_output_precision = INT_MAX; sprintf(buf, "RESET"); PG_RETURN_CSTRING(buf); } Datum set_sphere_output(PG_FUNCTION_ARGS) { char *c = PG_GETARG_CSTRING(0); char *buf = (char *) palloc(20); if (strcmp(c, "RAD") == 0) { sphere_output = OUTPUT_RAD; } else if (strcmp(c, "DEG") == 0) { sphere_output = OUTPUT_DEG; } else if (strcmp(c, "DMS") == 0) { sphere_output = OUTPUT_DMS; } else if (strcmp(c, "HMS") == 0) { sphere_output = OUTPUT_HMS; } else { elog(ERROR, "Unknown format"); pfree(buf); PG_RETURN_NULL(); } sprintf(buf, "SET %s", c); PG_RETURN_CSTRING(buf); } static Datum spherepoint_out_compat(PG_FUNCTION_ARGS) { SPoint *sp = (SPoint *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(255); unsigned int latdeg, latmin, lngdeg, lngmin; double latsec, lngsec; latdeg = latmin = lngdeg = lngmin = 0; latsec = lngsec = 0.0; switch (sphere_output) { case OUTPUT_DEG: sprintf(buffer, "(%.*gd , %.*gd)", sphere_output_precision, RADIANS * sp->lng, sphere_output_precision, RADIANS * sp->lat); break; case OUTPUT_DMS: rad_to_dms(sp->lng, &lngdeg, &lngmin, &lngsec); rad_to_dms(sp->lat, &latdeg, &latmin, &latsec); sprintf(buffer, "(%3ud %2um %.*gs , %c%2ud %2um %.*gs)", lngdeg, lngmin, sphere_output_precision, lngsec, (sp->lat < 0) ? ('-') : ('+'), latdeg, latmin, sphere_output_precision, latsec); break; case OUTPUT_HMS: rad_to_dms(sp->lng / 15, &lngdeg, &lngmin, &lngsec); rad_to_dms(sp->lat, &latdeg, &latmin, &latsec); sprintf(buffer, "(%3uh %2um %.*gs , %c%2ud %2um %.*gs)", lngdeg, lngmin, sphere_output_precision, lngsec, (sp->lat < 0) ? ('-') : ('+'), latdeg, latmin, sphere_output_precision, latsec); break; default: sprintf(buffer, "(%.*g , %.*g)", sphere_output_precision, sp->lng, sphere_output_precision, sp->lat); break; } PG_RETURN_CSTRING(buffer); } static void spherepoint_out_deg(StringInfo si, const SPoint *sp) { pgs_strinfo_put_chr(si, '('); pgs_strinfo_put_d64(si, RADIANS * sp->lng); pgs_strinfo_put_str(si, "d, "); pgs_strinfo_put_d64(si, RADIANS * sp->lat); pgs_strinfo_put_str(si, "d)"); } static void spherepoint_out_rad(StringInfo si, const SPoint *sp) { pgs_strinfo_put_chr(si, '('); pgs_strinfo_put_d64(si, sp->lng); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_d64(si, sp->lat); pgs_strinfo_put_str(si, ")"); } static void spherepoint_out_dms(StringInfo si, const SPoint *sp) { pgs_strinfo_put_chr(si, '('); pgs_strinfo_put_lng_dms(si, sp->lng); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_lat_dms(si, sp->lat); pgs_strinfo_put_chr(si, ')'); } static void spherepoint_out_hms(StringInfo si, const SPoint *sp) { pgs_strinfo_put_chr(si, '('); pgs_strinfo_put_lng_hms(si, sp->lng); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_lat_dms(si, sp->lat); pgs_strinfo_put_chr(si, ')'); } static inline void spherepoint_out_buffer(StringInfo si, const SPoint *sp) { switch (sphere_output) { case OUTPUT_DEG: spherepoint_out_deg(si, sp); break; case OUTPUT_DMS: spherepoint_out_dms(si, sp); break; case OUTPUT_HMS: spherepoint_out_hms(si, sp); break; default: spherepoint_out_rad(si, sp); break; } } Datum spherepoint_out(PG_FUNCTION_ARGS) { StringInfoData si; SPoint *sp; if (sphere_output_precision != INT_MAX) return spherepoint_out_compat(fcinfo); sp = (SPoint *) PG_GETARG_POINTER(0); if (!sp) PG_RETURN_NULL(); initStringInfo(&si); spherepoint_out_buffer(&si, sp); PG_RETURN_CSTRING(si.data); } static Datum spherecircle_out_compat(PG_FUNCTION_ARGS) { SCIRCLE *c = (SCIRCLE *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(255); char *pointstr = DatumGetPointer( DirectFunctionCall1(spherepoint_out, PointerGetDatum(&c->center))); unsigned int rdeg, rmin; double rsec; rdeg = rmin = 0; rsec = 0.0; switch (sphere_output) { case OUTPUT_DEG: sprintf(buffer, "<%s , %.*gd>", pointstr, sphere_output_precision, RADIANS * c->radius); break; case OUTPUT_HMS: case OUTPUT_DMS: rad_to_dms(c->radius, &rdeg, &rmin, &rsec); sprintf(buffer, "<%s , %2ud %2um %.*gs>", pointstr, rdeg, rmin, sphere_output_precision, rsec); break; default: sprintf(buffer, "<%s , %.*g>", pointstr, sphere_output_precision, c->radius); break; } pfree(pointstr); PG_RETURN_CSTRING(buffer); } static void spherecircle_out_deg(StringInfo si, const SCIRCLE *sc) { pgs_strinfo_put_chr(si, '<'); spherepoint_out_deg(si, &sc->center); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_d64(si, RADIANS * sc->radius); pgs_strinfo_put_chr(si, '>'); } static void spherecircle_out_rad(StringInfo si, const SCIRCLE *sc) { pgs_strinfo_put_chr(si, '<'); spherepoint_out_rad(si, &sc->center); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_d64(si, sc->radius); pgs_strinfo_put_chr(si, '>'); } static void spherecircle_out_dms(StringInfo si, const SCIRCLE *sc) { pgs_strinfo_put_chr(si, '<'); spherepoint_out_dms(si, &sc->center); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_radius_dms(si, sc->radius); pgs_strinfo_put_chr(si, '>'); } static void spherecircle_out_hms(StringInfo si, const SCIRCLE *sc) { pgs_strinfo_put_chr(si, '<'); spherepoint_out_hms(si, &sc->center); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_radius_dms(si, sc->radius); pgs_strinfo_put_chr(si, '>'); } Datum spherecircle_out(PG_FUNCTION_ARGS) { StringInfoData si; SCIRCLE *sc; if (sphere_output_precision != INT_MAX) return spherecircle_out_compat(fcinfo); sc = (SCIRCLE *) PG_GETARG_POINTER(0); if (!sc) PG_RETURN_NULL(); initStringInfo(&si); switch (sphere_output) { case OUTPUT_DEG: spherecircle_out_deg(&si, sc); break; case OUTPUT_DMS: spherecircle_out_dms(&si, sc); break; case OUTPUT_HMS: spherecircle_out_hms(&si, sc); break; default: spherecircle_out_rad(&si, sc); break; } PG_RETURN_CSTRING(si.data); } static Datum sphereellipse_out_compat(PG_FUNCTION_ARGS) { SELLIPSE *e = (SELLIPSE *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(255); char *pointstr; unsigned int rdeg[3], rmin[3]; double rsec[3]; SPoint sp; sp.lng = e->psi; sp.lat = -e->theta; pointstr = DatumGetPointer(DirectFunctionCall1(spherepoint_out, PointerGetDatum(&sp))); switch (sphere_output) { case OUTPUT_DEG: sprintf(buffer, "<{ %.*gd , %.*gd }, %s , %.*gd>", sphere_output_precision, RADIANS * (e->rad[0]), sphere_output_precision, RADIANS * (e->rad[1]), pointstr, sphere_output_precision, RADIANS * (e->phi)); break; case OUTPUT_HMS: case OUTPUT_DMS: rad_to_dms(e->rad[0], &rdeg[0], &rmin[0], &rsec[0]); rad_to_dms(e->rad[1], &rdeg[1], &rmin[1], &rsec[1]); rad_to_dms(e->phi, &rdeg[2], &rmin[2], &rsec[2]); sprintf(buffer, "<{ %2ud %2um %.*gs , %2ud %2um %.*gs }, %s , %2ud %2um %.*gs>", rdeg[0], rmin[0], sphere_output_precision, rsec[0], rdeg[1], rmin[1], sphere_output_precision, rsec[1], pointstr, rdeg[2], rmin[2], sphere_output_precision, rsec[2]); break; default: sprintf( buffer, "<{ %.*g , %.*g }, %s , %.*g>", sphere_output_precision, e->rad[0], sphere_output_precision, e->rad[1], pointstr, sphere_output_precision, e->phi); break; } pfree(pointstr); PG_RETURN_CSTRING(buffer); } static void sphereellipse_out_deg(StringInfo si, SELLIPSE *e) { const SPoint sp = { e->psi, e->theta }; pgs_strinfo_put_str(si, "<{ "); pgs_strinfo_put_d64(si, RADIANS * e->rad[0]); pgs_strinfo_put_str(si, "d , "); pgs_strinfo_put_d64(si, RADIANS * e->rad[1]); pgs_strinfo_put_str(si, "d },"); spherepoint_out_buffer(si, &sp); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_d64(si, RADIANS * e->phi); pgs_strinfo_put_str(si, "d>"); } static void sphereellipse_out_rad(StringInfo si, SELLIPSE *e) { const SPoint sp = { e->psi, e->theta }; pgs_strinfo_put_str(si, "<{ "); pgs_strinfo_put_d64(si, e->rad[0]); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_d64(si, e->rad[1]); pgs_strinfo_put_str(si, " },"); spherepoint_out_buffer(si, &sp); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_d64(si, e->phi); pgs_strinfo_put_str(si, ">"); } static void sphereellipse_out_dms(StringInfo si, SELLIPSE *e) { const SPoint sp = { e->psi, e->theta }; pgs_strinfo_put_str(si, "<{ "); pgs_strinfo_put_lng_dms(si, e->rad[0]); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_lng_dms(si, e->rad[1]); pgs_strinfo_put_str(si, " },"); spherepoint_out_buffer(si, &sp); pgs_strinfo_put_str(si, " , "); pgs_strinfo_put_lng_dms(si, e->phi); pgs_strinfo_put_str(si, ">"); } Datum sphereellipse_out(PG_FUNCTION_ARGS) { StringInfoData si; SELLIPSE *e; if (sphere_output_precision != INT_MAX) return sphereellipse_out_compat(fcinfo); e = (SELLIPSE *) PG_GETARG_POINTER(0); if (!e) PG_RETURN_NULL(); initStringInfo(&si); switch (sphere_output) { case OUTPUT_DEG: sphereellipse_out_deg(&si, e); break; case OUTPUT_HMS: case OUTPUT_DMS: sphereellipse_out_dms(&si, e); break; default: sphereellipse_out_rad(&si, e); break; } PG_RETURN_CSTRING(si.data); } static Datum sphereline_out_compat(PG_FUNCTION_ARGS) { SLine *sl = (SLine *) PG_GETARG_POINTER(0); char *out = (char *) palloc(255); char *tstr = NULL; SEuler se; unsigned int rdeg, rmin; double rsec; rdeg = rmin = 0; rsec = 0.0; seuler_set_zxz(&se); se.phi = sl->phi; se.theta = sl->theta; se.psi = sl->psi; tstr = DatumGetPointer(DirectFunctionCall1(spheretrans_out, PointerGetDatum(&se))); switch (sphere_output) { case OUTPUT_DEG: sprintf(out, "( %s ), %.*gd", tstr, sphere_output_precision, RADIANS * sl->length ); break; case OUTPUT_HMS: case OUTPUT_DMS: rad_to_dms(sl->length, &rdeg, &rmin, &rsec); sprintf(out, "( %s ), %2ud %2um %.*gs", tstr, rdeg, rmin, sphere_output_precision, rsec); break; default: sprintf(out, "( %s ), %.*g", tstr, sphere_output_precision, sl->length ); break; } PG_RETURN_CSTRING(out); } Datum sphereline_out(PG_FUNCTION_ARGS) { StringInfoData si; SLine *sl; SEuler se; if (sphere_output_precision != INT_MAX) return sphereline_out_compat(fcinfo); sl = (SLine *) PG_GETARG_POINTER(0); if (!sl) PG_RETURN_NULL(); seuler_set_zxz(&se); se.phi = sl->phi; se.theta = sl->theta; se.psi = sl->psi; initStringInfo(&si); pgs_strinfo_put_str(&si, "( "); spheretrans_out_buffer(&si, &se); pgs_strinfo_put_str(&si, " ), "); switch (sphere_output) { case OUTPUT_DEG: pgs_strinfo_put_d64(&si, RADIANS * sl->length); break; case OUTPUT_HMS: case OUTPUT_DMS: pgs_strinfo_put_lng_dms(&si, sl->length); break; default: pgs_strinfo_put_d64(&si, sl->length); break; } PG_RETURN_CSTRING(si.data); } static Datum spheretrans_out_compat(PG_FUNCTION_ARGS) { SEuler *se = (SEuler *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(255); char buf[100]; char etype[4]; SPoint val[3]; unsigned char i, t = 0; unsigned int rdeg, rmin; double rsec; val[0].lat = val[1].lat = val[2].lat = 0.0; val[0].lng = se->phi; val[1].lng = se->theta; val[2].lng = se->psi; spoint_check(&val[0]); spoint_check(&val[1]); spoint_check(&val[2]); buffer[0] = '\0'; for (i = 0; i < 3; i++) { rdeg = rmin = 0; rsec = 0.0; switch (sphere_output) { case OUTPUT_DEG: sprintf(&buf[0], "%.*gd", sphere_output_precision, RADIANS * val[i].lng); break; case OUTPUT_HMS: case OUTPUT_DMS: rad_to_dms(val[i].lng, &rdeg, &rmin, &rsec); sprintf(&buf[0], "%2ud %2um %.*gs", rdeg, rmin, sphere_output_precision, rsec); break; default: sprintf(&buf[0], "%.*g", sphere_output_precision, val[i].lng); break; } strcat(&buf[0], ", "); strcat(buffer, &buf[0]); } for (i = 0; i < 3; i++) { switch (i) { case 0: t = se->phi_a; break; case 1: t = se->theta_a; break; case 2: t = se->psi_a; break; } switch (t) { case EULER_AXIS_X: etype[i] = 'X'; break; case EULER_AXIS_Y: etype[i] = 'Y'; break; case EULER_AXIS_Z: etype[i] = 'Z'; break; } } etype[3] = '\0'; strcat(buffer, etype); PG_RETURN_CSTRING(buffer); } static void spheretrans_out_deg(StringInfo si, SPoint sp[3]) { int i; for (i = 0; i < 3; ++i) { pgs_strinfo_put_d64(si, RADIANS * sp[i].lng); pgs_strinfo_put_str(si, ", "); } } static void spheretrans_out_rad(StringInfo si, SPoint sp[3]) { int i; for (i = 0; i < 3; ++i) { pgs_strinfo_put_d64(si, sp[i].lng); pgs_strinfo_put_str(si, ", "); } } static void spheretrans_out_dms(StringInfo si, SPoint sp[3]) { int i; for (i = 0; i < 3; ++i) { pgs_strinfo_put_lng_dms(si, sp[i].lng); pgs_strinfo_put_str(si, ", "); } } static void spheretrans_out_buffer(StringInfo si, const SEuler *se) { SPoint val[3]; unsigned char t[3]; int i; val[0].lat = val[1].lat = val[2].lat = 0.0; val[0].lng = se->phi; val[1].lng = se->theta; val[2].lng = se->psi; t[0] = se->phi_a; t[1] = se->theta_a; t[2] = se->psi_a; spoint_check(&val[0]); spoint_check(&val[1]); spoint_check(&val[2]); switch (sphere_output) { case OUTPUT_DEG: spheretrans_out_deg(si, val); break; case OUTPUT_HMS: case OUTPUT_DMS: spheretrans_out_dms(si, val); break; default: spheretrans_out_rad(si, val); break; } for (i = 0; i < 3; i++) { switch (t[i]) { case EULER_AXIS_X: pgs_strinfo_put_chr(si, 'X'); break; case EULER_AXIS_Y: pgs_strinfo_put_chr(si, 'Y'); break; case EULER_AXIS_Z: pgs_strinfo_put_chr(si, 'Z'); break; default: Assert(false); } } } Datum spheretrans_out(PG_FUNCTION_ARGS) { StringInfoData si; SEuler *se; if (sphere_output_precision != INT_MAX) return spheretrans_out_compat(fcinfo); se = (SEuler *) PG_GETARG_POINTER(0); if (!se) PG_RETURN_NULL(); initStringInfo(&si); spheretrans_out_buffer(&si, se); PG_RETURN_CSTRING(si.data); } static Datum spherepath_out_compat(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); int32 i; char *out = (char *) palloc(128 * path->npts); char *tmp; strcpy(out, "{"); for (i = 0; i < path->npts; i++) { if (i > 0) { strcat(out, ","); } tmp = DatumGetPointer(DirectFunctionCall1(spherepoint_out, PointerGetDatum(&path->p[i]))); strcat(out, tmp); pfree(tmp); } strcat(out, "}"); PG_RETURN_CSTRING(out); } Datum spherepath_out(PG_FUNCTION_ARGS) { StringInfoData si; SPATH *path; int32 i; if (sphere_output_precision != INT_MAX) return spherepath_out_compat(fcinfo); path = PG_GETARG_SPATH(0); if (!path) PG_RETURN_NULL(); initStringInfo(&si); pgs_strinfo_put_chr(&si, '{'); for (i = 0; i < path->npts; ++i) { if (i > 0) pgs_strinfo_put_chr(&si, ','); spherepoint_out_buffer(&si, &path->p[i]); } pgs_strinfo_put_chr(&si, '}'); PG_RETURN_CSTRING(si.data); } static Datum spherepoly_out_compat(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); int32 i; char *out = (char *) palloc(128 * poly->npts); char *tmp; strcpy(out, "{"); for (i = 0; i < poly->npts; i++) { if (i > 0) { strcat(out, ","); } tmp = DatumGetPointer(DirectFunctionCall1(spherepoint_out, PointerGetDatum(&poly->p[i]))); strcat(out, tmp); pfree(tmp); } strcat(out, "}"); PG_RETURN_CSTRING(out); } Datum spherepoly_out(PG_FUNCTION_ARGS) { StringInfoData si; SPOLY *poly; int32 i; if (sphere_output_precision != INT_MAX) return spherepoly_out_compat(fcinfo); poly = PG_GETARG_SPOLY(0); if (!poly) PG_RETURN_NULL(); initStringInfo(&si); pgs_strinfo_put_chr(&si, '{'); for (i = 0; i < poly->npts; ++i) { if (i > 0) pgs_strinfo_put_chr(&si, ','); spherepoint_out_buffer(&si, &poly->p[i]); } pgs_strinfo_put_chr(&si, '}'); PG_RETURN_CSTRING(si.data); } static Datum spherebox_out_compat(PG_FUNCTION_ARGS) { SBOX *box = (SBOX *) PG_GETARG_POINTER(0); char *buffer = (char *) palloc(255); char *str1 = DatumGetPointer( DirectFunctionCall1(spherepoint_out, PointerGetDatum(&box->sw))); char *str2 = DatumGetPointer( DirectFunctionCall1(spherepoint_out, PointerGetDatum(&box->ne))); sprintf(buffer, "(%s, %s)", str1, str2); pfree(str1); pfree(str2); PG_RETURN_CSTRING(buffer); } Datum spherebox_out(PG_FUNCTION_ARGS) { StringInfoData si; SBOX *box; if (sphere_output_precision != INT_MAX) return spherebox_out_compat(fcinfo); box = (SBOX *) PG_GETARG_POINTER(0); if (!box) PG_RETURN_NULL(); initStringInfo(&si); pgs_strinfo_put_chr(&si, '('); spherepoint_out_buffer(&si, &box->sw); pgs_strinfo_put_str(&si, ", "); spherepoint_out_buffer(&si, &box->ne); pgs_strinfo_put_chr(&si, ')'); PG_RETURN_CSTRING(si.data); } Datum pg_sphere_version(PG_FUNCTION_ARGS) { const char *s = PGSPHERE_STRINGIFY(PGSPHERE_VERSION); char *p = (char *)palloc(strlen(s) + 1); strcpy(p, s); PG_RETURN_CSTRING(p); } pgsphere-1.5.1/src/path.c000066400000000000000000000524601461140101500152220ustar00rootroot00000000000000#include "path.h" #include "point.h" #include /* * Path functions */ PG_FUNCTION_INFO_V1(spherepath_in); PG_FUNCTION_INFO_V1(spherepath_get_point); PG_FUNCTION_INFO_V1(spherepath_point); PG_FUNCTION_INFO_V1(spherepath_equal); PG_FUNCTION_INFO_V1(spherepath_equal_neg); PG_FUNCTION_INFO_V1(spherepath_length); PG_FUNCTION_INFO_V1(spherepath_npts); PG_FUNCTION_INFO_V1(spherepath_swap); PG_FUNCTION_INFO_V1(spherepath_cont_point); PG_FUNCTION_INFO_V1(spherepath_cont_point_neg); PG_FUNCTION_INFO_V1(spherepath_cont_point_com); PG_FUNCTION_INFO_V1(spherepath_cont_point_com_neg); PG_FUNCTION_INFO_V1(spherepath_overlap_line); PG_FUNCTION_INFO_V1(spherepath_overlap_line_neg); PG_FUNCTION_INFO_V1(spherepath_overlap_line_com); PG_FUNCTION_INFO_V1(spherepath_overlap_line_com_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_path); PG_FUNCTION_INFO_V1(spherecircle_cont_path_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_path_com); PG_FUNCTION_INFO_V1(spherecircle_cont_path_com_neg); PG_FUNCTION_INFO_V1(spherecircle_overlap_path); PG_FUNCTION_INFO_V1(spherecircle_overlap_path_neg); PG_FUNCTION_INFO_V1(spherecircle_overlap_path_com); PG_FUNCTION_INFO_V1(spherecircle_overlap_path_com_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_path); PG_FUNCTION_INFO_V1(spherepoly_cont_path_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_path_com); PG_FUNCTION_INFO_V1(spherepoly_cont_path_com_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_path); PG_FUNCTION_INFO_V1(spherepoly_overlap_path_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_path_com); PG_FUNCTION_INFO_V1(spherepoly_overlap_path_com_neg); PG_FUNCTION_INFO_V1(spherepath_overlap_path); PG_FUNCTION_INFO_V1(spherepath_overlap_path_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_path); PG_FUNCTION_INFO_V1(sphereellipse_cont_path_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_path_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_path_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_path); PG_FUNCTION_INFO_V1(sphereellipse_overlap_path_neg); PG_FUNCTION_INFO_V1(sphereellipse_overlap_path_com); PG_FUNCTION_INFO_V1(sphereellipse_overlap_path_com_neg); PG_FUNCTION_INFO_V1(spheretrans_path); PG_FUNCTION_INFO_V1(spheretrans_path_inverse); PG_FUNCTION_INFO_V1(spherepath_add_point); PG_FUNCTION_INFO_V1(spherepath_add_points_finalize); PG_FUNCTION_INFO_V1(spherepath_get_array); /* * Converts an array of spherical points to SPATH. * * arr - pointer to the array of spherical points * nelem - count of elements * * Returns pointer to created spherical polygon. */ static SPATH * spherepath_from_array(SPoint *arr, int32 nelem) { SPATH *path = NULL; if (nelem < 2) { elog(ERROR, "spherepath_from_array: more than one point needed"); return NULL; } else { int32 i; float8 scheck; int32 size; for (i = 0; i < nelem; i++) { spoint_check(&arr[i]); } /* check duplicate points */ i = 0; while (i < (nelem - 1)) { if (nelem < 2) break; if (spoint_eq(&arr[i], &arr[i + 1])) { if (i < (nelem - 2)) { memmove((void *) &arr[i + 1], (void *) &arr[i + 2], (nelem - i - 2) * sizeof(SPoint)); } nelem--; continue; } i++; } if (nelem < 2) { elog(ERROR, "spherepath_from_array: more than one point needed"); return NULL; } size = offsetof(SPATH, p[0]) +sizeof(path->p[0]) * nelem; path = (SPATH *) palloc(size); SET_VARSIZE(path, size); path->npts = nelem; for (i = 0; i < nelem; i++) { if (i > 0) { scheck = spoint_dist(&arr[i - 1], &arr[i]); if (FPeq(scheck, PI)) { elog(ERROR, "spherepath_from_array: a path segment length must be not equal 180 degrees."); return NULL; } } memcpy((void *) &path->p[i], (void *) &arr[i], sizeof(SPoint)); } } return (path); } /* * Performs an Euler transformation on a path. * * out - pointer to the result path * in - pointer to the input path * se - pointer to the Euler transformation * * Returns the pointer to the result path. */ static void euler_spath_trans(SPATH *out, const SPATH *in, const SEuler *se) { int32 i; SET_VARSIZE(out, VARSIZE(in)); out->npts = in->npts; for (i = 0; i < in->npts; i++) euler_spoint_trans(&out->p[i], &in->p[i], se); } /* * Returns the relationship between a path and a circle as * PGS_CIRCLE_PATH_REL int8 value. */ static int8 path_circle_pos(const SPATH *path, const SCIRCLE *circ) { int8 pos; int32 i; SLine sl; int32 n; const int8 sc_in = (1 << PGS_CIRCLE_CONT_LINE); const int8 sc_ov = (1 << PGS_CIRCLE_LINE_OVER); const int8 sc_os = (1 << PGS_CIRCLE_LINE_AVOID); n = path->npts - 1; pos = 0; if (FPzero(circ->radius)) { bool pcp = spath_cont_point(path, &circ->center); if (pcp) { return PGS_CIRCLE_PATH_OVER; } else { return PGS_CIRCLE_PATH_AVOID; } } for (i = 0; i < n; i++) { spath_segment(&sl, path, i); pos |= (1 << sphereline_circle_pos(&sl, circ)); if (pos & sc_ov) { return PGS_CIRCLE_PATH_OVER; } } if (pos == sc_in) { /* all lines inside circle */ /* circle contains path */ return PGS_CIRCLE_CONT_PATH; } else if (pos == sc_os) { /* all lines outside circle */ /* circle outside path */ return PGS_CIRCLE_PATH_AVOID; } /* circle and path overlap */ return PGS_CIRCLE_PATH_OVER; } /* * Checks whether a path and a line overlap. */ static bool path_line_overlap(const SPATH *path, const SLine *line) { int32 i; SLine sl; int32 n; n = path->npts - 1; for (i = 0; i < n; i++) { spath_segment(&sl, path, i); if (sline_sline_pos(&sl, line) != PGS_LINE_AVOID) { return true; } } return false; } /* * Returns the relationship between a path and a circle as * PGS_ELLIPSE_PATH_REL int8 value. * * path - pointer to the path * ell - pointer to the ellipse */ static int8 path_ellipse_pos(const SPATH *path, const SELLIPSE *ell) { int8 pos; int32 i; SLine sl; int32 n; const int8 sc_in = (1 << PGS_ELLIPSE_CONT_LINE); const int8 sc_ov = (1 << PGS_ELLIPSE_LINE_OVER); const int8 sc_os = (1 << PGS_ELLIPSE_LINE_AVOID); pos = 0; n = path->npts - 1; if (FPzero(ell->rad[0])) { bool pcp; SPoint cen; sellipse_center(&cen, ell); pcp = spath_cont_point(path, &cen); if (pcp) { return PGS_ELLIPSE_PATH_OVER; } else { return PGS_ELLIPSE_PATH_AVOID; } } if (FPzero(ell->rad[1])) { SLine l; sellipse_line(&l, ell); /* TODO implement ellipse contains path if ellipse is a line */ if (path_line_overlap(path, &l)) { return PGS_ELLIPSE_PATH_OVER; } else { return PGS_ELLIPSE_PATH_AVOID; } } for (i = 0; i < n; i++) { spath_segment(&sl, path, i); pos |= (1 << sellipse_line_pos(ell, &sl)); if (pos & sc_ov) { return PGS_ELLIPSE_PATH_OVER; } } if (pos == sc_in) { /* all lines inside ellipse */ /* ellipse contains path */ return PGS_ELLIPSE_CONT_PATH; } else if (pos == sc_os) { /* all lines outside ellipse */ /* ellipse outside path */ return PGS_ELLIPSE_PATH_AVOID; } /* ellipse and path overlap */ return PGS_ELLIPSE_PATH_OVER; } /* * Checks whether two paths overlap. */ static bool path_overlap(const SPATH *path1, const SPATH *path2) { int32 i; SLine sl; for (i = 0; i < path1->npts; i++) { spath_segment(&sl, path1, i); if (path_line_overlap(path2, &sl)) { /* overlap */ return true; } } return false; } /* * Returns the relationship between a path and a polygon as * PGS_POLY_PATH_REL int8 value. */ static int8 path_poly_pos(const SPATH *path, const SPOLY *poly) { int32 i; SLine sl; int8 pos, res; int32 n; const int8 sp_os = (1 << PGS_LINE_POLY_AVOID); const int8 sp_ct = (1 << PGS_POLY_CONT_LINE); const int8 sp_ov = (1 << PGS_LINE_POLY_OVER); n = path->npts - 1; pos = res = 0; for (i = 0; i < n; i++) { spath_segment(&sl, path, i); pos = (1 << poly_line_pos(poly, &sl)); if (pos == sp_ov) { return PGS_POLY_PATH_OVER; /* overlap */ } res |= pos; } if (res == sp_os) { return PGS_POLY_PATH_AVOID; } if (res == sp_ct) { return PGS_POLY_CONT_PATH; } return PGS_POLY_OVER; } /* * Returns the i-th point of a path. * * sp - pointer to the result point * path - pointer to the path * i - number of the point * * See spath_point(SPoint * , SPATH *, float8) */ static bool spath_get_point(SPoint *sp, const SPATH *path, int32 i) { if (i >= 0 && i < path->npts) { memcpy((void *) sp, (void *) &path->p[i], sizeof(SPoint)); return true; } return false; } /* * This function interpolates between points. Returns the f-th point * of a path. * * sp - pointer to the result point * path - pointer to the path * f - 'number' of the point * * See spherepath_point(PG_FUNCTION_ARGS) */ static bool spath_point(SPoint *sp, const SPATH *path, float8 f) { SLine sl; int32 i; i = (int32) floor(f); if (spath_segment(&sl, path, i)) { SEuler se; SPoint tp; sphereline_to_euler(&se, &sl); tp.lng = sl.length * (f - (float8) i); tp.lat = 0.0; euler_spoint_trans(sp, &tp, &se); return true; } else { return false; } } /* * Checks whether two paths are equal. */ bool spath_eq(const SPATH *p1, const SPATH *p2) { if (p1->npts == p2->npts) { int32 i; bool ret; ret = true; for (i = 0; i < p1->npts; i++) { if (!spoint_eq(&p1->p[i], &p2->p[i])) { ret = false; break; } } return ret; } return false; } bool spath_cont_point(const SPATH *path, const SPoint *sp) { int32 n; bool ret; SLine sl; int32 i; n = path->npts - 1; ret = false; for (i = 0; i < n; i++) { spath_segment(&sl, path, i); if (spoint_at_sline(sp, &sl)) { ret = true; break; } } return ret; } bool spath_segment(SLine *sl, const SPATH *path, int32 i) { if (i >= 0 && i < (path->npts - 1)) { sline_from_points(sl, &path->p[i], &path->p[i + 1]); return true; } return false; } Datum spherepath_in(PG_FUNCTION_ARGS) { SPATH *path; char *c = PG_GETARG_CSTRING(0); int32 i, nelem; void sphere_yyparse(void); init_buffer(c); sphere_yyparse(); nelem = get_path_count(); if (nelem > MAX_POINTS) { reset_buffer(); elog(ERROR, "spherepath_in: too much points"); PG_RETURN_NULL(); } else if (nelem > 1) { SPoint arr[MAX_POINTS]; for (i = 0; i < nelem; i++) { get_path_elem(i, &arr[i].lng, &arr[i].lat); } path = spherepath_from_array(&arr[0], nelem); } else { reset_buffer(); elog(ERROR, "spherepath_in: more than one point needed"); PG_RETURN_NULL(); } reset_buffer(); PG_RETURN_POINTER(path); } Datum spherepath_get_point(PG_FUNCTION_ARGS) { int32 i; SPATH *path = PG_GETARG_SPATH(0); SPoint *sp = (SPoint *) palloc(sizeof(SPoint)); i = PG_GETARG_INT32(1); if (spath_get_point(sp, path, i - 1)) { PG_RETURN_POINTER(sp); } pfree(sp); PG_RETURN_NULL(); } Datum spherepath_get_array(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); Datum *datum_arr = (Datum *) palloc(sizeof(Datum) * path->npts); ArrayType *res; SPoint *p = (SPoint *) palloc(sizeof(SPoint) * path->npts); for (size_t i = 0; i < path->npts; i++) { if (!spath_get_point(&p[i], path, i)) { pfree(p); pfree(datum_arr); PG_RETURN_NULL(); } datum_arr[i] = PointerGetDatum(&p[i]); } res = construct_array(datum_arr, path->npts, get_spoint_type_oid(), sizeof(SPoint), false, 'd'); PG_RETURN_ARRAYTYPE_P(res); } Datum spherepath_point(PG_FUNCTION_ARGS) { float8 i; SPATH *path = PG_GETARG_SPATH(0); SPoint *sp = (SPoint *) palloc(sizeof(SPoint)); i = PG_GETARG_FLOAT8(1); if (spath_point(sp, path, i - 1)) { PG_RETURN_POINTER(sp); } pfree(sp); PG_RETURN_NULL(); } Datum spherepath_equal(PG_FUNCTION_ARGS) { SPATH *p1 = PG_GETARG_SPATH(0); SPATH *p2 = PG_GETARG_SPATH(1); PG_RETURN_BOOL(spath_eq(p1, p2)); } Datum spherepath_equal_neg(PG_FUNCTION_ARGS) { SPATH *p1 = PG_GETARG_SPATH(0); SPATH *p2 = PG_GETARG_SPATH(1); PG_RETURN_BOOL(!spath_eq(p1, p2)); } Datum spherepath_length(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); int32 i; SLine l; float8 sum; int32 n; n = path->npts - 1; sum = 0.0; for (i = 0; i < n; i++) { spath_segment(&l, path, i); sum += l.length; } PG_RETURN_FLOAT8(sum); } Datum spherepath_npts(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_INT32(path->npts); } Datum spherepath_swap(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); int32 i; int32 n; SPATH *ret = (SPATH *) palloc(VARSIZE(path)); n = path->npts - 1; for (i = 0; i < n; i++) { memcpy((void *) &ret->p[i], (void *) &path->p[n - i], sizeof(SPoint)); } SET_VARSIZE(ret, VARSIZE(path)); ret->npts = path->npts; PG_RETURN_POINTER(ret); } Datum spherepath_cont_point(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); SPoint *sp = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(spath_cont_point(path, sp)); } Datum spherepath_cont_point_neg(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); SPoint *sp = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!spath_cont_point(path, sp)); } Datum spherepath_cont_point_com(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(1); SPoint *sp = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(spath_cont_point(path, sp)); } Datum spherepath_cont_point_com_neg(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(1); SPoint *sp = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!spath_cont_point(path, sp)); } Datum spherepath_overlap_line(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); SLine *line = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(path_line_overlap(path, line)); } Datum spherepath_overlap_line_neg(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(0); SLine *line = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!path_line_overlap(path, line)); } Datum spherepath_overlap_line_com(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(1); SLine *line = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(path_line_overlap(path, line)); } Datum spherepath_overlap_line_com_neg(PG_FUNCTION_ARGS) { SPATH *path = PG_GETARG_SPATH(1); SLine *line = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!path_line_overlap(path, line)); } Datum spherecircle_cont_path(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_circle_pos(path, circ) == PGS_CIRCLE_CONT_PATH); } Datum spherecircle_cont_path_neg(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_circle_pos(path, circ) != PGS_CIRCLE_CONT_PATH); } Datum spherecircle_cont_path_com(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_circle_pos(path, circ) == PGS_CIRCLE_CONT_PATH); } Datum spherecircle_cont_path_com_neg(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_circle_pos(path, circ) != PGS_CIRCLE_CONT_PATH); } Datum spherecircle_overlap_path(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_circle_pos(path, circ) > PGS_CIRCLE_PATH_AVOID); } Datum spherecircle_overlap_path_neg(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_circle_pos(path, circ) == PGS_CIRCLE_PATH_AVOID); } Datum spherecircle_overlap_path_com(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_circle_pos(path, circ) > PGS_CIRCLE_PATH_AVOID); } Datum spherecircle_overlap_path_com_neg(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_circle_pos(path, circ) == PGS_CIRCLE_PATH_AVOID); } Datum spherepoly_cont_path(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_poly_pos(path, poly) == PGS_POLY_CONT_PATH); } Datum spherepoly_cont_path_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_poly_pos(path, poly) != PGS_POLY_CONT_PATH); } Datum spherepoly_cont_path_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_poly_pos(path, poly) == PGS_POLY_CONT_PATH); } Datum spherepoly_cont_path_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_poly_pos(path, poly) != PGS_POLY_CONT_PATH); } Datum spherepoly_overlap_path(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_poly_pos(path, poly) != PGS_POLY_PATH_AVOID); } Datum spherepoly_overlap_path_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_poly_pos(path, poly) == PGS_POLY_PATH_AVOID); } Datum spherepoly_overlap_path_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_poly_pos(path, poly) != PGS_POLY_PATH_AVOID); } Datum spherepoly_overlap_path_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_poly_pos(path, poly) == PGS_POLY_PATH_AVOID); } Datum spherepath_overlap_path(PG_FUNCTION_ARGS) { SPATH *p1 = PG_GETARG_SPATH(0); SPATH *p2 = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_overlap(p1, p2)); } Datum spherepath_overlap_path_neg(PG_FUNCTION_ARGS) { SPATH *p1 = PG_GETARG_SPATH(0); SPATH *p2 = PG_GETARG_SPATH(1); PG_RETURN_BOOL(!path_overlap(p1, p2)); } Datum sphereellipse_cont_path(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_ellipse_pos(path, ell) == PGS_ELLIPSE_CONT_PATH); } Datum sphereellipse_cont_path_neg(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_ellipse_pos(path, ell) != PGS_ELLIPSE_CONT_PATH); } Datum sphereellipse_cont_path_com(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_ellipse_pos(path, ell) == PGS_ELLIPSE_CONT_PATH); } Datum sphereellipse_cont_path_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_ellipse_pos(path, ell) != PGS_ELLIPSE_CONT_PATH); } Datum sphereellipse_overlap_path(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_ellipse_pos(path, ell) != PGS_ELLIPSE_PATH_AVOID); } Datum sphereellipse_overlap_path_neg(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); SPATH *path = PG_GETARG_SPATH(1); PG_RETURN_BOOL(path_ellipse_pos(path, ell) == PGS_ELLIPSE_PATH_AVOID); } Datum sphereellipse_overlap_path_com(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_ellipse_pos(path, ell) != PGS_ELLIPSE_PATH_AVOID); } Datum sphereellipse_overlap_path_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); SPATH *path = PG_GETARG_SPATH(0); PG_RETURN_BOOL(path_ellipse_pos(path, ell) == PGS_ELLIPSE_PATH_AVOID); } Datum spheretrans_path(PG_FUNCTION_ARGS) { SPATH *sp = PG_GETARG_SPATH(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SPATH *out = (SPATH *) palloc(VARSIZE(sp)); euler_spath_trans(out, sp, se); PG_RETURN_POINTER(out); } Datum spheretrans_path_inverse(PG_FUNCTION_ARGS) { Datum sp = PG_GETARG_DATUM(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SEuler tmp; Datum ret; spheretrans_inverse(&tmp, se); ret = DirectFunctionCall2( spheretrans_path, sp, PointerGetDatum(&tmp)); PG_RETURN_DATUM(ret); } Datum spherepath_add_point(PG_FUNCTION_ARGS) { SPATH *path = (SPATH *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); int32 size = 0; SPATH *path_new = NULL; if (p == NULL) { PG_RETURN_POINTER(path); } if (path == NULL) { size = offsetof(SPATH, p[0]) + sizeof(SPoint); path = (SPATH *) palloc(size); memcpy((void *) &path->p[0], (void *) p, sizeof(SPoint)); SET_VARSIZE(path, size); path->npts = 1; PG_RETURN_POINTER(path); } path = PG_GETARG_SPATH(0); /* skip if equal */ if (spoint_eq(p, &path->p[path->npts - 1])) { PG_RETURN_POINTER(path); } /* Skip if distance is equal 180deg */ if (FPeq(spoint_dist(p, &path->p[path->npts - 1]), PI)) { elog(NOTICE, "spath(spoint): Skip point, distance of previous point is 180deg"); } size = offsetof(SPATH, p[0]) + sizeof(SPoint) * (path->npts + 1); path_new = palloc(size); memcpy((void *) path_new, (void *) path, VARSIZE(path)); path_new->npts++; SET_VARSIZE(path_new, size); memcpy((void *) &path_new->p[path->npts], (void *) p, sizeof(SPoint)); PG_RETURN_POINTER(path_new); } Datum spherepath_add_points_finalize(PG_FUNCTION_ARGS) { SPATH *path = (SPATH *) PG_GETARG_POINTER(0); if (path == NULL) { PG_RETURN_NULL(); } path = PG_GETARG_SPATH(0); if (path->npts < 2) { elog(NOTICE, "spath(spoint): At least 2 points required"); pfree(path); PG_RETURN_NULL(); } PG_RETURN_POINTER(path); } pgsphere-1.5.1/src/path.h000066400000000000000000000156251461140101500152310ustar00rootroot00000000000000#ifndef __PGS_PATH_H__ #define __PGS_PATH_H__ #include "polygon.h" /* Path declarations */ /* * The definition of spherical path using a list of * spherical points. */ typedef struct { char vl_len_[4]; /* total size in bytes */ int32 npts; /* count of points */ SPoint p[1]; /* variable length array of SPoints */ } SPATH; /* Path and circle */ #define PGS_CIRCLE_PATH_AVOID 0 /* circle avoids path */ #define PGS_CIRCLE_CONT_PATH 1 /* circle contains path */ #define PGS_CIRCLE_PATH_OVER 2 /* circle overlaps path */ /* Path and polygon */ #define PGS_POLY_PATH_AVOID 0 /* polygon avoids path */ #define PGS_POLY_CONT_PATH 1 /* polygon contains path */ #define PGS_POLY_PATH_OVER 2 /* polygon and path overlap */ /* Path and ellipse */ #define PGS_ELLIPSE_PATH_AVOID 0 /* ellipse avoids path */ #define PGS_ELLIPSE_CONT_PATH 1 /* ellipse contains path */ #define PGS_ELLIPSE_PATH_OVER 2 /* ellipse overlaps path */ #define PG_GETARG_SPATH(arg) \ ( (SPATH *) (PG_DETOAST_DATUM(PG_GETARG_DATUM(arg))) ) /* * Checks whether two paths are equal. */ extern bool spath_eq(const SPATH *p1, const SPATH *p2); /* * Checks whether a path contains a point. */ extern bool spath_cont_point(const SPATH *path, const SPoint *sp); /* * Returns the i-th line segment of a path. * * sl - pointer to line segment * path - pointer to path * i - number of * * Returns the pointer to the line segment or NULL if fails. */ extern bool spath_segment(SLine *sl, const SPATH *path, int32 i); /* * Input function of path. */ extern Datum spherepath_in(PG_FUNCTION_ARGS); /* * Returns the n-th point of a path. * * See spherepath_get_point(PG_FUNCTION_ARGS) */ extern Datum spherepath_get_point(PG_FUNCTION_ARGS); /* * Returns spath as array of points */ extern Datum spherepath_get_array(PG_FUNCTION_ARGS); /* * This function interpolates between points of path. Returns the * n-th point of a path where n is a float. * * See spherepath_point(PG_FUNCTION_ARGS) */ extern Datum spherepath_point(PG_FUNCTION_ARGS); /* * Checks whether two paths are equal. */ extern Datum spherepath_equal(PG_FUNCTION_ARGS); /* * Checks whether two paths aren't equal. */ extern Datum spherepath_equal_neg(PG_FUNCTION_ARGS); /* * Returns the length of a path. */ extern Datum spherepath_length(PG_FUNCTION_ARGS); /* * Returns the number of points in a path. */ extern Datum spherepath_npts(PG_FUNCTION_ARGS); /* * Changes the direction of a path. */ extern Datum spherepath_swap(PG_FUNCTION_ARGS); /* * Checks whether a path contains a point. */ extern Datum spherepath_cont_point(PG_FUNCTION_ARGS); /* * Checks whether a path doesn't contain a point. */ extern Datum spherepath_cont_point_neg(PG_FUNCTION_ARGS); /* * Checks whether a path contains a point. */ extern Datum spherepath_cont_point_com(PG_FUNCTION_ARGS); /* * Checks whether a path doesn't contain a point. */ extern Datum spherepath_cont_point_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a path and a line overlap. */ extern Datum spherepath_overlap_line(PG_FUNCTION_ARGS); /* * Checks whether a path and a line don't overlap. */ extern Datum spherepath_overlap_line_neg(PG_FUNCTION_ARGS); /* * Checks whether path and line overlap. */ extern Datum spherepath_overlap_line_com(PG_FUNCTION_ARGS); /* * Checks whether a path and a line don't overlap. */ extern Datum spherepath_overlap_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a path. */ extern Datum spherecircle_cont_path(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a path. */ extern Datum spherecircle_cont_path_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a path. */ extern Datum spherecircle_cont_path_com(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a path. */ extern Datum spherecircle_cont_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and a path overlap. */ extern Datum spherecircle_overlap_path(PG_FUNCTION_ARGS); /* * Checks whether a circle and a path don't overlap. */ extern Datum spherecircle_overlap_path_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle and a path overlap. */ extern Datum spherecircle_overlap_path_com(PG_FUNCTION_ARGS); /* * Checks whether a circle and a path don't overlap. */ extern Datum spherecircle_overlap_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a path. */ extern Datum spherepoly_cont_path(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a path. */ extern Datum spherepoly_cont_path_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains path. */ extern Datum spherepoly_cont_path_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a path. */ extern Datum spherepoly_cont_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a path overlap. */ extern Datum spherepoly_overlap_path(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a path don't overlap. */ extern Datum spherepoly_overlap_path_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a path overlap. */ extern Datum spherepoly_overlap_path_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a path don't overlap. */ extern Datum spherepoly_overlap_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether two paths overlap. */ extern Datum spherepath_overlap_path(PG_FUNCTION_ARGS); /* * Checks whether two paths don't overlap. */ extern Datum spherepath_overlap_path_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains path. */ extern Datum sphereellipse_cont_path(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a path. */ extern Datum sphereellipse_cont_path_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a path. */ extern Datum sphereellipse_cont_path_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a path. */ extern Datum sphereellipse_cont_path_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a path overlap. */ extern Datum sphereellipse_overlap_path(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a path don't overlap. */ extern Datum sphereellipse_overlap_path_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a path overlap. */ extern Datum sphereellipse_overlap_path_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse and a path don't overlap. */ extern Datum sphereellipse_overlap_path_com_neg(PG_FUNCTION_ARGS); /* * Performs an Euler transformation on a path. */ extern Datum spheretrans_path(PG_FUNCTION_ARGS); /* * Performs an inverse Euler transformation on a path. */ extern Datum spheretrans_path_inverse(PG_FUNCTION_ARGS); /* * State transition function for aggregate function spath(spoint). Never * call this function outside an aggregate function! * * Adds a point to a path. */ extern Datum spherepath_add_point(PG_FUNCTION_ARGS); /* * Finalize function for adding spoints to a path. */ extern Datum spherepath_add_points_finalize(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/pg_sphere.h000066400000000000000000000102321461140101500162360ustar00rootroot00000000000000#ifndef __PGS_PGSPHERE_H__ #define __PGS_PGSPHERE_H__ /* Base declarations and includes */ /* * pgSphere is an extra module for PostgreSQL which adds spherical data types. It provides: * * - input and output of data * - containing, overlapping, and other operators * - various input and converting functions and operators * - circumference and area of an object * - spherical transformation * - indexing of spherical data types * - several input and output formats * * Hence, you can do a fast search and analysis for objects with spherical * attributes as used in geographical, astronomical, or other applications * using PostgreSQL. For instance, you can manage data of geographical * objects around the world and astronomical data like star and other * catalogs conveniently using an SQL interface. * * The aim of pgSphere is to * provide uniform access to spherical data. Because PostgreSQL itself * supports a lot of software interfaces, you can now use the same database * with different utilities and applications. */ #include #include #include #include #include #include "postgres.h" #include "fmgr.h" #include "utils/array.h" #include "utils/elog.h" #include "utils/builtins.h" #include "catalog/pg_type.h" #include "access/skey.h" #include "access/gist.h" #include "access/itup.h" #include "pgs_util.h" /* On some 32 bit platforms, there is a gcc bug that makes floating point * calculations and comparisons unstable (see the link below). The problem * originates in FPU 80 bits registers where double values are not truncated * to 64 bit values. When gcc compiles some code with enabled optimizations, * the intermediate results may be kept in the FPU registers without truncation * to 64 bit values. Extra bits may produce unstable results when comparing * the numbers. * * The generic solution is to save the intermediate results in the memory where * the values are truncated to 64 bit values. It affects the performance but * makes the tests stable on all platforms. * * PGSPHERE_FLOAT_STORE macro enables storing of intermediate results for FPxx * operations in the memory. It is enabled by default for 32 bit platforms. * It can be explicitly enabled or disabled in CFLAGS. To enable it for all * code the gcc option -ffloat-store may be used as well. * * Link to gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 */ #if !defined(PGSPHERE_FLOAT_STORE) #if _WIN64 || (__GNUC__ && __x86_64__) #define PGSPHERE_FLOAT_STORE 0 #elif _WIN32 || __GNUC__ #define PGSPHERE_FLOAT_STORE 1 #else #define PGSPHERE_FLOAT_STORE 0 #endif #endif /* PGSPHERE_FLOAT_STORE */ #define EPSILON 1.0E-09 #define FPzero(A) (fabs(A) <= EPSILON) #if PGSPHERE_FLOAT_STORE static inline bool FPeq(double A, double B) { const volatile double AB = A - B; return A == B || fabs(AB) <= EPSILON; } static inline bool FPne(double A, double B) { const volatile double AB = A - B; return A != B && fabs(AB) > EPSILON; } static inline bool FPlt(double A, double B) { const volatile double AE = A + EPSILON; return AE < B; } static inline bool FPle(double A, double B) { const volatile double BE = B + EPSILON; return A <= BE; } static inline bool FPgt(double A, double B) { const volatile double BE = B + EPSILON; return A > BE; } static inline bool FPge(double A, double B) { const volatile double AE = A + EPSILON; return AE >= B; } #else static inline bool FPeq(double A, double B) { return A == B || fabs(A - B) <= EPSILON; } static inline bool FPne(double A, double B) { return A != B && fabs(A - B) > EPSILON; } static inline bool FPlt(double A, double B) { return A + EPSILON < B; } static inline bool FPle(double A, double B) { return A <= B + EPSILON; } static inline bool FPgt(double A, double B) { return A > B + EPSILON; } static inline bool FPge(double A, double B) { return A + EPSILON >= B; } #endif /* PGSPHERE_FLOAT_STORE */ /*--------------------------------------------------------------------- * Point - (x,y) *-------------------------------------------------------------------*/ typedef struct { float8 x, y; } Point; extern void sphere_yyparse(void); #endif pgsphere-1.5.1/src/pgs_chealpix.h000066400000000000000000000005551461140101500167370ustar00rootroot00000000000000#ifndef __PGS_CHEALPIX_H__ #define __PGS_CHEALPIX_H__ #include #include /* PostgreSQL type definitions */ /* * Actually, chealpix changed its API: thus, this file must be included first, * directly or indirectly. */ #define MOC_FORMAT_64 INT64_FORMAT #define MOC_FORMAT_64U UINT64_FORMAT typedef int64 hpint64; #endif pgsphere-1.5.1/src/pgs_healpix.h000066400000000000000000000017021461140101500165670ustar00rootroot00000000000000#ifndef __PGS_HEALPIX_H__ #define __PGS_HEALPIX_H__ /* this goes in front to detect the chealpix API break */ #include "pgs_chealpix.h" #include #include #include "point.h" /* SPoint */ int order_invalid(int); hpint64 c_npix(int); void check_order(int order); /* function prototypes for the Healpix support functions */ Datum pg_nest2ring(PG_FUNCTION_ARGS); Datum pg_ring2nest(PG_FUNCTION_ARGS); hpint64 c_healpix_convert_nest(hpint64 idx, int32 from_order, int32 to_order); Datum healpix_convert_nest(PG_FUNCTION_ARGS); Datum healpix_convert_ring(PG_FUNCTION_ARGS); Datum pg_nside2order(PG_FUNCTION_ARGS); Datum pg_order2nside(PG_FUNCTION_ARGS); Datum pg_nside2npix(PG_FUNCTION_ARGS); Datum pg_npix2nside(PG_FUNCTION_ARGS); Datum healpix_nest(PG_FUNCTION_ARGS); Datum healpix_ring(PG_FUNCTION_ARGS); Datum inv_healpix_nest(PG_FUNCTION_ARGS); Datum inv_healpix_ring(PG_FUNCTION_ARGS); hpint64 healpix_nest_c(int32, SPoint*); #endif pgsphere-1.5.1/src/pgs_moc.h000066400000000000000000000103231461140101500157120ustar00rootroot00000000000000#ifndef __PGS_MOC_H__ #define __PGS_MOC_H__ /* these go in front to detect the chealpix API break */ #include "pgs_healpix.h" #include "pgs_process_moc.h" #include #include #include #if PG_VERSION_NUM >= 130000 #include #else #include #endif #include "point.h" /* SPoint */ /* * MOC data type(s) * ... * * * * * * * * */ /* das hier ist Mist: typedef moc_interval moc_leaf_page[MOC_PAGE_SIZE]; */ /* move the below to ^^start of pgs_moc.h ;-) Layout of pages: tree pages: * a single int32 'level_end' value == (TOAST) offset value of end of the _next_ deeper level -> was: int32 root_size [[number of moc_tree_entry items in root page]] * array of moc_tree_entry -> this means that the offset of the first interval is actually always at the same place, it is the 'offset' value of the first moc_tree_entry of the "root page", this makes a special entry inside moc_header redundant. computationally, the offset of first interval is: ... it can bee easily computed if a page (tree or leaf) does not start on a PG_TOAST_PAGE_FRAGMENT boundary by taking the modulus of the start offset by exactly PG_TOAST_PAGE_FRAGMENT... */ /* function prototypes for the MOC support functions */ Datum smoc_in(PG_FUNCTION_ARGS); Datum smoc_out(PG_FUNCTION_ARGS); Datum moc_debug(PG_FUNCTION_ARGS); Datum set_smoc_output_type(PG_FUNCTION_ARGS); Datum smoc_info(PG_FUNCTION_ARGS); Datum smoc_area(PG_FUNCTION_ARGS); Datum smoc_order(PG_FUNCTION_ARGS); Datum smoc_eq(PG_FUNCTION_ARGS); Datum smoc_neq(PG_FUNCTION_ARGS); Datum smoc_overlap(PG_FUNCTION_ARGS); Datum smoc_overlap_neg(PG_FUNCTION_ARGS); Datum smoc_subset_smoc(PG_FUNCTION_ARGS); Datum smoc_subset_smoc_neg(PG_FUNCTION_ARGS); Datum smoc_superset_smoc(PG_FUNCTION_ARGS); Datum smoc_superset_smoc_neg(PG_FUNCTION_ARGS); Datum healpix_subset_smoc(PG_FUNCTION_ARGS); Datum healpix_not_subset_smoc(PG_FUNCTION_ARGS); Datum smoc_superset_healpix(PG_FUNCTION_ARGS); Datum smoc_not_superset_healpix(PG_FUNCTION_ARGS); Datum spoint_subset_smoc(PG_FUNCTION_ARGS); Datum spoint_not_subset_smoc(PG_FUNCTION_ARGS); Datum smoc_superset_spoint(PG_FUNCTION_ARGS); Datum smoc_not_superset_spoint(PG_FUNCTION_ARGS); bool healpix_subset_smoc_impl(hpint64, Datum); bool spoint_subset_smoc_impl(SPoint*, Datum); Datum healpix_subset_smoc_c(hpint64, Datum); Datum healpix_not_subset_smoc_c(hpint64, Datum); Datum spoint_subset_smoc_c(SPoint*, Datum); Datum spoint_not_subset_smoc_c(SPoint*, Datum); Datum smoc_union(PG_FUNCTION_ARGS); Datum smoc_intersection(PG_FUNCTION_ARGS); Datum smoc_degrade(PG_FUNCTION_ARGS); Datum smoc_spoint(PG_FUNCTION_ARGS); Datum smoc_disc(PG_FUNCTION_ARGS); Datum smoc_scircle(PG_FUNCTION_ARGS); Datum smoc_spoly(PG_FUNCTION_ARGS); Datum smoc_gin_extract_value(PG_FUNCTION_ARGS); Datum smoc_gin_extract_value_fine(PG_FUNCTION_ARGS); Datum smoc_gin_extract_query(PG_FUNCTION_ARGS); Datum smoc_gin_extract_query_fine(PG_FUNCTION_ARGS); Datum smoc_gin_consistent(PG_FUNCTION_ARGS); /* parsing subroutines */ hpint64 readNumber(const char*, int*); char readChar(const char*, int*); static inline int32 next_interval(int32 a) { int32 mod; a += MOC_INTERVAL_SIZE; // page bumps mod = (a + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < MOC_INTERVAL_SIZE) a += MOC_INTERVAL_SIZE - mod; return a; } #define MOC_AREA_ALL_SKY 3458764513820540928 #define MOC_GIN_ORDER_DEFAULT 5 /* order 5 has 12 * 4^5 = 12288 pixels */ #define MOC_GIN_ORDER_FINE 8 /* order 8 has 12 * 4^8 = 786432 pixels */ #define MOC_GIN_STRATEGY_INTERSECTS 1 #define MOC_GIN_STRATEGY_SUBSET 2 #define MOC_GIN_STRATEGY_SUPERSET 3 #define MOC_GIN_STRATEGY_EQUAL 4 #define MOC_GIN_STRATEGY_UNEQUAL 5 /* smoc_gin_ops opclass options */ #if PG_VERSION_NUM >= 130000 Datum smoc_gin_options(PG_FUNCTION_ARGS); typedef struct { int32 vl_len_; /* varlena header (do not touch directly!) */ int order; /* smoc order to store in index (default 5) */ } SMocGinOptions; #define SMOC_GIN_GET_ORDER() (PG_HAS_OPCLASS_OPTIONS() ? \ ((SMocGinOptions *) PG_GET_OPCLASS_OPTIONS())->order : \ MOC_GIN_ORDER_DEFAULT) #else #define SMOC_GIN_GET_ORDER() MOC_GIN_ORDER_DEFAULT #endif #endif pgsphere-1.5.1/src/pgs_process_moc.h000066400000000000000000000107671461140101500174640ustar00rootroot00000000000000#ifndef __PGS_PROCESS_MOC_H__ #define __PGS_PROCESS_MOC_H__ #ifdef __cplusplus extern "C" { #endif /* this goes in front to detect the chealpix API break */ #include "pgs_chealpix.h" #include /* PostgreSQL type definitions */ /* * PG_TOAST_PAGE_FRAGMENT should equal TOAST_MAX_CHUNK_SIZE, but we * do not want to implicitely include quite a few other Postgres headers * just for the small gain of getting its value right. * Usually, TOAST_MAX_CHUNK_SIZE equals 1996. * * #include * #include // for TOAST_MAX_CHUNK_SIZE */ extern int32 smoc_output_type; typedef void (*pgs_error_handler)(const char*, int); #define HP64_SIZE (sizeof(hpint64)) #define PG_TOAST_PAGE_FRAGMENT 1996 /* not divisible by HP64_SIZE == 8 */ /* moc_interval: an half-open interval [first, last) of Healpix elements */ typedef struct { hpint64 first; hpint64 second; } moc_interval; typedef struct { int32 offset; /* counts in units of char, from start of MOC */ char start[HP64_SIZE]; } moc_tree_entry; #define MOC_INDEX_ALIGN (sizeof(int32)) #define MOC_INTERVAL_SIZE (sizeof(moc_interval)) #define MOC_TREE_ENTRY_SIZE (sizeof(moc_tree_entry)) #define MOC_LEAF_PAGE_LEN (PG_TOAST_PAGE_FRAGMENT / MOC_INTERVAL_SIZE) #define MOC_TREE_PAGE_LEN (PG_TOAST_PAGE_FRAGMENT / MOC_TREE_ENTRY_SIZE) /* * this particular layout should prevent the compiler from introducing unwanted * padding */ typedef struct { char vl_len_[4]; /* size of PostgreSQL variable-length data */ uint16 version; /* version of the 'toasty' MOC data structure */ uint8 order; /* actual MOC order */ uint8 depth; /* depth of B+-tree */ hpint64 first; /* first Healpix index in set */ hpint64 last; /* 1 + (last Healpix index in set) */ hpint64 area; /* number of covered Healpix cells */ int32 tree_begin; /* start of B+ tree, past the options block */ int32 data_begin; /* start of Healpix intervals, bypassing the tree */ int32 data[1]; /* no need to optimise for empty MOCs */ } Smoc; #define MOC_HEADER_VARSIZE (offsetof(Smoc, data)) #define MOC_HEADER_SIZE (MOC_HEADER_VARSIZE - VARHDRSZ) #define MIN_MOC_SIZE (sizeof(Smoc) - VARHDRSZ) #define MOC_HEADER_PAGE ((PG_TOAST_PAGE_FRAGMENT) > (MOC_HEADER_VARSIZE) \ ? (PG_TOAST_PAGE_FRAGMENT) : (MOC_HEADER_VARSIZE)) #define MOC_BASE(moc) ((char*) &(moc->version)) #define MOC_ENTRY(moc_base, offset) ((moc_tree_entry *)(moc_base + offset)) #define MOC_INTERVAL(moc_base, offset) ((moc_interval *)(moc_base + offset)) #define MOC_MAX_OPTIONS_SIZE 0 /* no options yet */ #define HEALPIX_MAX_ORDER 29 int32 moc_mod_floor(int32, int32); int32 moc_tree_entry_floor(int32); int32 moc_interval_floor(int32); void* create_moc_in_context(pgs_error_handler); void release_moc_in_context(void*, pgs_error_handler); void add_to_moc(void*, long, hpint64, hpint64, pgs_error_handler); void moc_in_context_set_order(void* moc_in_context, int order); int get_moc_size(void*, pgs_error_handler); void create_moc_release_context(void*, Smoc*, pgs_error_handler); typedef struct { void* context; size_t out_size; } moc_out_data; moc_out_data create_moc_out_context(Smoc*, int32, pgs_error_handler); /* for the final smoc_out() using a proper Postgres memory context */ void release_moc_out_context(moc_out_data, pgs_error_handler); void print_moc_release_context(moc_out_data, char*, pgs_error_handler); size_t get_moc_debug(const char**, pgs_error_handler); void moc_debug_log(pgs_error_handler, const char *, ...) #ifdef __GNUC__ __attribute__((format(printf, 2, 3))) #endif ; void moc_debug_clear(pgs_error_handler); moc_tree_entry* entry_lower_bound(moc_tree_entry*, moc_tree_entry*, hpint64); moc_interval* interval_lower_bound(moc_interval*, moc_interval*, hpint64); void moc_union(void* moc_in_context, Smoc* moc_a, int32 moc_a_end, Smoc* moc_b, int32 moc_b_end, pgs_error_handler error_out); void moc_intersection(void* moc_in_context, Smoc* moc_a, int32 moc_a_end, Smoc* moc_b, int32 moc_b_end, pgs_error_handler error_out); void moc_degrade(void* moc_in_context, int order, Smoc* moc_a, int32 moc_a_end, pgs_error_handler error_out); void moc_healpix(void* moc_in_context, int order, hpint64 first, hpint64 last, pgs_error_handler error_out); void moc_disc(void* moc_in_context, int order, double theta, double phi, double radius, pgs_error_handler error_out); void moc_polygon(void* moc_in_context, int order, int32 npts, float8* polygon, pgs_error_handler error_out); #ifdef __cplusplus } #endif #endif pgsphere-1.5.1/src/pgs_util.h000066400000000000000000000020111461140101500161040ustar00rootroot00000000000000#ifndef __PGS_UTIL_H__ #define __PGS_UTIL_H__ #define PI 3.14159265358979323846 /* pi */ #define PIH 1.57079632679489661923 /* pi/2 */ #define PID 6.2831853071795864769 /* 2*pi */ #define RADIANS 57.295779513082320877 /* 180/pi */ #define PI_EPS 4.4408920985006261617e-16 /* 2 ** -51 */ #define Sqr(a) ( (a) * (a) ) /* square function as macro */ #ifdef EPSILON #undef EPSILON #endif #define EPSILON 1.0E-09 /* precision of floating point values */ /* spherical circle constants */ #define SPHERE_SURFACE (4 * PI) #define DEFAULT_SCIRCLE_SEL 1e-7 /* convert pg_sphere theta [pi/2 .. -pi/2] to healpix theta [0 .. pi] ([north .. south pole]) */ static inline double conv_theta(double x) { double y = PIH - x; if (fabs(x) < PI_EPS / 2) return PIH; if (fabs(y) < PI_EPS / 2) return 0; return y; } static inline double deg_to_rad(double in) { return in * PI / 180; } /* * Area of circle on sphere */ static inline double spherecircle_area_float(double radius) { return PID * (1 - cos(radius)); } #endif pgsphere-1.5.1/src/point.c000066400000000000000000000141751461140101500154200ustar00rootroot00000000000000#include "point.h" #include "pgs_util.h" #include /* This file contains definitions for spherical point functions. */ PG_FUNCTION_INFO_V1(spherepoint_in); PG_FUNCTION_INFO_V1(spherepoint_from_long_lat); PG_FUNCTION_INFO_V1(spherepoint_from_long_lat_deg); PG_FUNCTION_INFO_V1(spherepoint_distance); PG_FUNCTION_INFO_V1(spherepoint_dwithin); PG_FUNCTION_INFO_V1(spherepoint_long); PG_FUNCTION_INFO_V1(spherepoint_lat); PG_FUNCTION_INFO_V1(spherepoint_x); PG_FUNCTION_INFO_V1(spherepoint_y); PG_FUNCTION_INFO_V1(spherepoint_z); PG_FUNCTION_INFO_V1(spherepoint_xyz); PG_FUNCTION_INFO_V1(spherepoint_equal); PG_FUNCTION_INFO_V1(spherepoint_hash32); static Oid point_id = InvalidOid; Oid get_spoint_type_oid(void) { if (point_id == InvalidOid) { point_id = TypenameGetTypid("spoint"); } return point_id; } bool spoint_eq(const SPoint *p1, const SPoint *p2) { Vector3D a, b; spoint_vector3d(&a, p1); spoint_vector3d(&b, p2); return (vector3d_eq(&a, &b)); } void spoint_check(SPoint *spoint) { bool lat_is_neg = (spoint->lat < 0) ? true : false; if (spoint->lng < 0 || spoint->lng > PID) spoint->lng = spoint->lng - floor(spoint->lng / (PID)) * PID; if (spoint->lat < -PIH || spoint->lat > PIH) spoint->lat = spoint->lat - floor(spoint->lat / (PID)) * PID; if (spoint->lng < 0.0) { spoint->lng += (PID); } if (spoint->lat > PI) { spoint->lat -= (2 * PI); } if (spoint->lat > PIH) { spoint->lat = (PI - spoint->lat); spoint->lng += ((spoint->lng < PI) ? (PI) : (-PI)); } if (spoint->lat < -PIH) { spoint->lat = (-PI - spoint->lat); spoint->lng += ((spoint->lng < PI) ? (PI) : (-PI)); } if (FPeq(spoint->lat, PIH) && lat_is_neg) spoint->lat = -PIH; if (FPeq(spoint->lng, PID)) { spoint->lng = 0.0; } if (FPzero(spoint->lng)) { spoint->lng = 0.0; } if (FPzero(spoint->lat)) { spoint->lat = 0.0; } } void vector3d_spoint(SPoint *p, const Vector3D *v) { double rho = sqrt((v->x) * (v->x) + (v->y) * (v->y)); if (0.0 == rho) { if (FPzero(v->z)) { p->lat = 0.0; } else if (v->z > 0) { p->lat = PIH; } else if (v->z < 0) { p->lat = -PIH; } } else { p->lat = atan(v->z / rho); } p->lng = atan2(v->y, v->x); if (FPzero(p->lng)) { p->lng = 0.0; } else if (p->lng < 0.0) { p->lng += PID; } } void spoint_vector3d(Vector3D *v, const SPoint *p) { v->x = cos(p->lng) * cos(p->lat); v->y = sin(p->lng) * cos(p->lat); v->z = sin(p->lat); } Datum spherepoint_in(PG_FUNCTION_ARGS) { SPoint *sp = (SPoint *) palloc(sizeof(SPoint)); char *c = PG_GETARG_CSTRING(0); double lng, lat; void sphere_yyparse(void); init_buffer(c); sphere_yyparse(); if (get_point(&lng, &lat)) { sp->lng = lng; sp->lat = lat; spoint_check(sp); } else { reset_buffer(); pfree(sp); sp = NULL; elog(ERROR, "spherepoint_in: parse error"); } reset_buffer(); PG_RETURN_POINTER(sp); } void create_spherepoint_from_long_lat(SPoint *p, float8 lng, float8 lat) { p->lat = lat; p->lng = lng; spoint_check(p); } Datum spherepoint_from_long_lat(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) palloc(sizeof(SPoint)); const float8 lng = PG_GETARG_FLOAT8(0); const float8 lat = PG_GETARG_FLOAT8(1); create_spherepoint_from_long_lat(p, lng, lat); PG_RETURN_POINTER(p); } Datum spherepoint_from_long_lat_deg(PG_FUNCTION_ARGS) { Datum res; const float8 lng = deg_to_rad(PG_GETARG_FLOAT8(0)); const float8 lat = deg_to_rad(PG_GETARG_FLOAT8(1)); res = DirectFunctionCall2( spherepoint_from_long_lat, Float8GetDatum(lng), Float8GetDatum(lat) ); PG_RETURN_DATUM(res); } static double norm2(double a, double b) { return sqrt(a * a + b * b); } float8 spoint_dist(const SPoint *p1, const SPoint *p2) { float8 dl = p1->lng - p2->lng; /* use Vincenty's formula for the inverse geodesic problem on the sphere */ float8 f = atan2(norm2(cos(p2->lat) * sin(dl), cos(p1->lat) * sin(p2->lat) - sin(p1->lat) * cos(p2->lat) * cos(dl)), sin(p1->lat) * sin(p2->lat) + cos(p1->lat) * cos(p2->lat) * cos(dl)); if (FPzero(f)) { return 0.0; } else { return f; } } Datum spherepoint_distance(PG_FUNCTION_ARGS) { SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); SPoint *p2 = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_FLOAT8(spoint_dist(p1, p2)); } Datum spherepoint_dwithin(PG_FUNCTION_ARGS) { SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); SPoint *p2 = (SPoint *) PG_GETARG_POINTER(1); float8 within = PG_GETARG_FLOAT8(2); float8 dist = spoint_dist(p1, p2); PG_RETURN_BOOL(FPle(dist, within)); } Datum spherepoint_long(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(p->lng); } Datum spherepoint_lat(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(p->lat); } Datum spherepoint_x(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); Vector3D v; spoint_vector3d(&v, p); PG_RETURN_FLOAT8(v.x); } Datum spherepoint_y(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); Vector3D v; spoint_vector3d(&v, p); PG_RETURN_FLOAT8(v.y); } Datum spherepoint_z(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); Vector3D v; spoint_vector3d(&v, p); PG_RETURN_FLOAT8(v.z); } Datum spherepoint_xyz(PG_FUNCTION_ARGS) { SPoint *p = (SPoint *) PG_GETARG_POINTER(0); Datum dret[3]; ArrayType *result; Vector3D v; spoint_vector3d(&v, p); dret[0] = Float8GetDatumFast(v.x); dret[1] = Float8GetDatumFast(v.y); dret[2] = Float8GetDatumFast(v.z); #ifdef USE_FLOAT8_BYVAL result = construct_array(dret, 3, FLOAT8OID, sizeof(float8), true, 'd'); #else result = construct_array(dret, 3, FLOAT8OID, sizeof(float8), false, 'd'); #endif PG_RETURN_ARRAYTYPE_P(result); } Datum spherepoint_equal(PG_FUNCTION_ARGS) { SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); SPoint *p2 = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(spoint_eq(p1, p2)); } Datum spherepoint_hash32(PG_FUNCTION_ARGS) { SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0); Datum h1 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lat)); Datum h2 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lng)); PG_RETURN_INT32(DatumGetInt32(h1) ^ DatumGetInt32(h2)); } pgsphere-1.5.1/src/point.h000066400000000000000000000046311461140101500154210ustar00rootroot00000000000000#ifndef __PGS_POINT_H__ #define __PGS_POINT_H__ #include "vector3d.h" #include "sbuffer.h" /* This file contains declarations for spherical point and functions. */ /* * The data structure definition of a spherical point. */ typedef struct { float8 lng; /* longitude value in radians */ float8 lat; /* latitude value in radians */ } SPoint; extern Oid get_spoint_type_oid(void); /* * Calculate the distance between two spherical points in radians. */ extern float8 spoint_dist(const SPoint *p1, const SPoint *p2); /* * Check whether two points are equal. */ extern bool spoint_eq(const SPoint *p1, const SPoint *p2); /* * Check the longitude and latitude values of a spherical point. */ extern void spoint_check(SPoint *spoint); /* * Transforms a 3d vector into a spherical point. */ extern void vector3d_spoint(SPoint *p, const Vector3D *v); /* * Transforms a spherical point into a 3d vector. */ extern void spoint_vector3d(Vector3D *v, const SPoint *p); /* * Take the input and store it as a spherical point. */ extern Datum spherepoint_in(PG_FUNCTION_ARGS); /* * Create spherical point from lat, lng and store to first argument(pointer) */ extern void create_spherepoint_from_long_lat(SPoint *p, float8 lng, float8 lat); /* * Create a spherical point from longitude and latitude both in radians. */ extern Datum spherepoint_from_long_lat(PG_FUNCTION_ARGS); /* * Create a spherical point from longitude and latitude both in degrees. */ extern Datum spherepoint_from_long_lat_deg(PG_FUNCTION_ARGS); /* * Calculate the distance between two spherical points. */ extern Datum spherepoint_distance(PG_FUNCTION_ARGS); /* * Longitude of a spherical point. */ extern Datum spherepoint_long(PG_FUNCTION_ARGS); /* * Latitude of a spherical point. */ extern Datum spherepoint_lat(PG_FUNCTION_ARGS); /* * Cartesian x-value of a spherical point. */ extern Datum spherepoint_x(PG_FUNCTION_ARGS); /* * Cartesian y-value of a spherical point. */ extern Datum spherepoint_y(PG_FUNCTION_ARGS); /* * Cartesian z-value of a spherical point. */ extern Datum spherepoint_z(PG_FUNCTION_ARGS); /* * Cartesian values of a spherical point as an array. */ extern Datum spherepoint_xyz(PG_FUNCTION_ARGS); /* * Check whether two points are equal. */ extern Datum spherepoint_equal(PG_FUNCTION_ARGS); /* * Compute a 32-bit hash value of a point. */ extern Datum spherepoint_hash32(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/polygon.c000066400000000000000000001026421461140101500157530ustar00rootroot00000000000000#include "polygon.h" #include "point.h" /* Polygon functions */ PG_FUNCTION_INFO_V1(spherepoly_in); PG_FUNCTION_INFO_V1(spherepoly_deg); PG_FUNCTION_INFO_V1(spherepoly_rad); PG_FUNCTION_INFO_V1(spherepoly_equal); PG_FUNCTION_INFO_V1(spherepoly_equal_neg); PG_FUNCTION_INFO_V1(spherepoly_circ); PG_FUNCTION_INFO_V1(spherepoly_npts); PG_FUNCTION_INFO_V1(spherepoly_area); PG_FUNCTION_INFO_V1(spherepoly_get_point); PG_FUNCTION_INFO_V1(spherepoly_get_array); PG_FUNCTION_INFO_V1(spherepoly_cont_point); PG_FUNCTION_INFO_V1(spherepoly_cont_point_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_point_com); PG_FUNCTION_INFO_V1(spherepoly_cont_point_com_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_circle); PG_FUNCTION_INFO_V1(spherepoly_cont_circle_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_circle_com); PG_FUNCTION_INFO_V1(spherepoly_cont_circle_com_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_poly); PG_FUNCTION_INFO_V1(spherecircle_cont_poly_neg); PG_FUNCTION_INFO_V1(spherecircle_cont_poly_com); PG_FUNCTION_INFO_V1(spherecircle_cont_poly_com_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_circle); PG_FUNCTION_INFO_V1(spherepoly_overlap_circle_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_circle_com); PG_FUNCTION_INFO_V1(spherepoly_overlap_circle_com_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_line); PG_FUNCTION_INFO_V1(spherepoly_cont_line_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_line_com); PG_FUNCTION_INFO_V1(spherepoly_cont_line_com_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_line); PG_FUNCTION_INFO_V1(spherepoly_overlap_line_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_line_com); PG_FUNCTION_INFO_V1(spherepoly_overlap_line_com_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_poly); PG_FUNCTION_INFO_V1(spherepoly_cont_poly_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_poly_com); PG_FUNCTION_INFO_V1(spherepoly_cont_poly_com_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_poly); PG_FUNCTION_INFO_V1(spherepoly_overlap_poly_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_ellipse); PG_FUNCTION_INFO_V1(spherepoly_cont_ellipse_neg); PG_FUNCTION_INFO_V1(spherepoly_cont_ellipse_com); PG_FUNCTION_INFO_V1(spherepoly_cont_ellipse_com_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_poly); PG_FUNCTION_INFO_V1(sphereellipse_cont_poly_neg); PG_FUNCTION_INFO_V1(sphereellipse_cont_poly_com); PG_FUNCTION_INFO_V1(sphereellipse_cont_poly_com_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_ellipse); PG_FUNCTION_INFO_V1(spherepoly_overlap_ellipse_neg); PG_FUNCTION_INFO_V1(spherepoly_overlap_ellipse_com); PG_FUNCTION_INFO_V1(spherepoly_overlap_ellipse_com_neg); PG_FUNCTION_INFO_V1(spheretrans_poly); PG_FUNCTION_INFO_V1(spheretrans_poly_inverse); PG_FUNCTION_INFO_V1(spherepoly_add_point); PG_FUNCTION_INFO_V1(spherepoly_add_points_finalize); PG_FUNCTION_INFO_V1(spherepoly_is_convex); PG_FUNCTION_INFO_V1(spherepoly_from_point_array); /* * Writes "center" of a polygon into 'v'. * * v - pointer to the center of a polygon * poly - pointer to the polygon */ static void spherepoly_center(Vector3D *v, const SPOLY *poly) { int32 i; Vector3D v1, v2; v1.x = 2.0; v1.y = 2.0; v1.z = 2.0; v2.x = -2.0; v2.y = -2.0; v2.z = -2.0; for (i = 0; i < poly->npts; i++) { spoint_vector3d(v, &poly->p[i]); v1.x = Min(v->x, v1.x); v1.y = Min(v->y, v1.y); v1.z = Min(v->z, v1.z); v2.x = Max(v->x, v2.x); v2.y = Max(v->y, v2.y); v2.z = Max(v->z, v2.z); } v->x = (v1.x + v2.x) / 2.0; v->y = (v1.y + v2.y) / 2.0; v->z = (v1.z + v2.z) / 2.0; } /* * Checks if line segments cross. */ static bool spherepoly_check(const SPOLY *poly) { int32 i, k; SLine sli, slk; Vector3D v; SPoint p; SEuler se; int8 pos; spherepoly_center(&v, poly); /* If 0-vector */ if (FPzero(v.x) && FPzero(v.y) && FPzero(v.z)) { return false; } for (i = 0; i < poly->npts; i++) { spoly_segment(&sli, poly, i); for (k = (i + 1); k < poly->npts; k++) { spoly_segment(&slk, poly, k); pos = sline_sline_pos(&sli, &slk); if (!(pos == PGS_LINE_CONNECT || pos == PGS_LINE_AVOID)) { return false; } } } vector3d_spoint(&p, &v); se.phi_a = EULER_AXIS_Z; se.theta_a = EULER_AXIS_X; se.psi_a = EULER_AXIS_Z; se.phi = -PIH - p.lng; se.theta = p.lat - PIH; se.psi = 0.0; for (i = 0; i < poly->npts; i++) { euler_spoint_trans(&p, &poly->p[i], &se); /* less _and_ equal are important !! */ /* Do not change it! */ if (FPle(p.lat, 0.0)) { return false; } } return true; } /* * Converts an array of spherical points to SPOLY. * * arr - pointer to the array of spherical points * nelem - number of the elements * * Returns the pointer to the created spherical polygon. */ static SPOLY * spherepoly_from_array(SPoint *arr, int32 nelem) { SPOLY *poly = NULL; if (nelem < 3) { elog(ERROR, "spherepoly_from_array: more than two points needed"); return NULL; } else { int32 i; float8 scheck; int32 size; for (i = 0; i < nelem; i++) { spoint_check(&arr[i]); } /* check duplicate points */ i = 0; while (i < (nelem - 1)) { if (nelem < 3) break; if (spoint_eq(&arr[i], &arr[i + 1])) { if (i < (nelem - 2)) { memmove((void *) &arr[i + 1], (void *) &arr[i + 2], (nelem - i - 2) * sizeof(SPoint)); } nelem--; continue; } i++; } if (spoint_eq(&arr[0], &arr[nelem - 1])) { nelem--; } if (nelem < 3) { elog(ERROR, "spherepoly_from_array: more than two points needed"); return NULL; } size = offsetof(SPOLY, p[0]) +sizeof(SPoint) * nelem; poly = (SPOLY *) palloc(size); SET_VARSIZE(poly, size); poly->npts = nelem; for (i = 0; i < nelem; i++) { if (i == 0) { scheck = spoint_dist(&arr[nelem - 1], &arr[0]); } else { scheck = spoint_dist(&arr[i - 1], &arr[i]); } if (FPeq(scheck, PI)) { elog(ERROR, "spherepoly_from_array: a polygon segment length must be not equal 180 degrees."); return NULL; } memcpy((void *) &poly->p[i], (void *) &arr[i], sizeof(SPoint)); } } if (!spherepoly_check(poly)) { elog(ERROR, "spherepoly_from_array: a line segment overlaps or polygon too large"); pfree(poly); return NULL; } return poly; } /* * Performs a transform of a polygon using an Euler transformation. * * se - pointer to the Euler transformation * in - pointer to the polygon * out - pointer to the transformed polygon */ static void euler_spoly_trans(SPOLY *out, const SPOLY *in, const SEuler *se) { int32 i; SET_VARSIZE(out, VARSIZE(in)); out->npts = in->npts; for (i = 0; i < in->npts; i++) euler_spoint_trans(&out->p[i], &in->p[i], se); } /* * Returns the relationship between polygon and circle as * PGS_CIRCLE_POLY_REL int8 value. */ static int8 poly_circle_pos(const SPOLY *poly, const SCIRCLE *circ) { int8 pos = 0; int32 i; SLine sl; bool pcp; const int8 sc_in = (1 << PGS_CIRCLE_CONT_LINE); const int8 sc_ov = (1 << PGS_CIRCLE_LINE_OVER); const int8 sc_os = (1 << PGS_CIRCLE_LINE_AVOID); pcp = spoly_contains_point(poly, &circ->center); if (FPzero(circ->radius)) { if (pcp) { return PGS_POLY_CONT_CIRCLE; } else { return PGS_CIRCLE_POLY_AVOID; } } for (i = 0; i < poly->npts; i++) { spoly_segment(&sl, poly, i); pos |= (1 << sphereline_circle_pos(&sl, circ)); if (((pos & sc_in) && (pos & sc_os)) || (pos & sc_ov)) { return PGS_CIRCLE_POLY_OVER; /* overlaps */ } } if ((pos & sc_in) == pos) { /* all lines inside circle */ /* circle contains polygon */ return PGS_CIRCLE_CONT_POLY; } else if ((pos & sc_os) == pos) { /* all lines outside circle */ if (pcp) { /* polygon contains circle */ return PGS_POLY_CONT_CIRCLE; } else { /* circle outside polygon */ return PGS_CIRCLE_POLY_AVOID; } } /* circle and polygon overlap */ return PGS_CIRCLE_POLY_OVER; } /* * Returns the relationship between a polygon and an ellipse * as PGS_ELLIPSE_POLY_REL int8 value. */ static int8 poly_ellipse_pos(const SPOLY *poly, const SELLIPSE *ell) { int8 pos = 0; int32 i; SLine sl; bool pcp; SPoint cen; const int8 sc_in = (1 << PGS_ELLIPSE_CONT_LINE); const int8 sc_ov = (1 << PGS_ELLIPSE_LINE_OVER); const int8 sc_os = (1 << PGS_ELLIPSE_LINE_AVOID); sellipse_center(&cen, ell); pcp = spoly_contains_point(poly, &cen); if (FPzero(ell->rad[0])) { if (pcp) { return PGS_POLY_CONT_ELLIPSE; } else { return PGS_ELLIPSE_POLY_AVOID; } } if (FPzero(ell->rad[1])) { SLine l; int8 res; sellipse_line(&l, ell); res = poly_line_pos(poly, &l); if (res == PGS_LINE_POLY_AVOID) { return PGS_ELLIPSE_POLY_AVOID; } else if (res == PGS_POLY_CONT_LINE) { return PGS_POLY_CONT_ELLIPSE; } else { return PGS_ELLIPSE_POLY_OVER; } } for (i = 0; i < poly->npts; i++) { spoly_segment(&sl, poly, i); pos |= (1 << sellipse_line_pos(ell, &sl)); if (((pos & sc_in) && (pos & sc_os)) || (pos & sc_ov)) { return PGS_ELLIPSE_POLY_OVER; /* overlaps */ } } if ((pos & sc_in) == pos) { /* all lines inside ellipse */ /* ellipse contains polygon */ return PGS_ELLIPSE_CONT_POLY; } else if ((pos & sc_os) == pos) { /* all lines outside ellipse */ if (pcp) { /* polygon contains ellipse */ return PGS_POLY_CONT_ELLIPSE; } else { /* ellipse outside polygon */ return PGS_ELLIPSE_POLY_AVOID; } } /* ellipse and polygon overlap */ return PGS_ELLIPSE_POLY_OVER; } /* * Returns the relationship between two polygons as * PGS_POLY_REL int8 value. * * p1 - pointer to the first polygon * p2 - pointer to the second polygon * * If 'recheck' is true, swaps 'p1' and 'p2'. */ static int8 poly_poly_pos(const SPOLY *p1, const SPOLY *p2, bool recheck) { int32 i; SLine sl; int8 pos = 0, res = 0; const int8 sp_os = (1 << PGS_LINE_POLY_AVOID); const int8 sp_ct = (1 << PGS_POLY_CONT_LINE); const int8 sp_ov = (1 << PGS_LINE_POLY_OVER); for (i = 0; i < p2->npts; i++) { spoly_segment(&sl, p2, i); pos = (1 << poly_line_pos(p1, &sl)); if (pos == sp_ov) { return PGS_POLY_OVER; /* overlap */ } res |= pos; } if (res == sp_os) { if (!recheck) { pos = poly_poly_pos(p2, p1, true); } if (pos == PGS_POLY_CONT) { return PGS_POLY_OVER; } else { return PGS_POLY_AVOID; } } if (res == sp_ct) { return PGS_POLY_CONT; } return PGS_POLY_OVER; } /* * Checks whether two polygons are equal. * * If 'dir' is true, check with reverse polygon of 'p2'. */ bool spoly_eq(const SPOLY *p1, const SPOLY *p2, bool dir) { bool ret = false; if (p1->npts == p2->npts) { int32 i, k, cntr, shift; for (shift = 0; shift < p1->npts; shift++) { cntr = 0; for (i = 0; i < p1->npts; i++) { k = (dir) ? (p1->npts - i - 1) : (i); k += shift; k = (k < p1->npts) ? (k) : (k - p1->npts); if (spoint_eq(&p1->p[i], &p2->p[k])) { cntr++; } } if (cntr == p1->npts) { ret = true; break; } } /* Try other direction if not equal */ if (!dir && !ret) { ret = spoly_eq(p1, p2, true); } } return ret; } /* * Returns the i-th line segment of a polygon. * * sl - pointer to the line segment * poly - pointer to the polygon * i - number of the segment */ bool spoly_segment(SLine *sl, const SPOLY *poly, int32 i) { if (i >= 0 && i < poly->npts) { if (i == (poly->npts - 1)) sline_from_points(sl, &poly->p[i], &poly->p[0]); else sline_from_points(sl, &poly->p[i], &poly->p[i + 1]); return true; } else { return false; } } static bool spoly_get_point(SPoint *sp, const SPOLY *poly, int32 i) { if (i >= 0 && i < poly->npts) { memcpy((void *) sp, (void *) &poly->p[i], sizeof(SPoint)); return true; } return false; } Datum spherepoly_get_point(PG_FUNCTION_ARGS) { int32 i; SPOLY *poly = PG_GETARG_SPOLY(0); SPoint *sp = (SPoint *) palloc(sizeof(SPoint)); i = PG_GETARG_INT32(1); if (spoly_get_point(sp, poly, i - 1)) { PG_RETURN_POINTER(sp); } pfree(sp); PG_RETURN_NULL(); } Datum spherepoly_get_array(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); Datum *datum_arr = (Datum *) palloc(sizeof(Datum) * poly->npts); ArrayType *res; SPoint *p = (SPoint *) palloc(sizeof(SPoint) * poly->npts); for (int i = 0; i < poly->npts; i++) { if (!spoly_get_point(&p[i], poly, i)) { pfree(p); pfree(datum_arr); PG_RETURN_NULL(); } datum_arr[i] = PointerGetDatum(&p[i]); } res = construct_array(datum_arr, poly->npts, get_spoint_type_oid(), sizeof(SPoint), false, 'd'); PG_RETURN_ARRAYTYPE_P(res); } /* * Checks whether a polygon contains a point. * * pg - pointer to the polygon * sp - pointer to the point */ bool spoly_contains_point(const SPOLY *pg, const SPoint *sp) { int32 i; SLine sl; bool res = false; float8 scp; Vector3D vc, vp; /* First check if point is outside polygon (behind) */ spherepoly_center(&vc, pg); spoint_vector3d(&vp, sp); scp = vector3d_scalar(&vp, &vc); if (FPle(scp, 0.0)) { return false; } /* Check whether point is edge */ for (i = 0; i < pg->npts; i++) { if (spoint_eq(&pg->p[i], sp)) { return true; } } /* Check whether point is on a line segment */ for (i = 0; i < pg->npts; i++) { spoly_segment(&sl, pg, i); if (spoint_at_sline(sp, &sl)) { return true; } } do { SEuler se, te; SPoint p, lp[2]; bool a1, a2, eqa; int32 cntr = 0; SPOLY *tmp = (SPOLY *) palloc(VARSIZE(pg)); /* * Make a transformation, so the point is (0,0) */ se.phi_a = EULER_AXIS_Z; se.theta_a = EULER_AXIS_X; se.psi_a = EULER_AXIS_Z; se.phi = PIH - sp->lng; se.theta = -sp->lat; se.psi = -PIH; euler_spoly_trans(tmp, pg, &se); p.lng = 0.0; p.lat = 0.0; /* Check whether an edge is on equator. */ /* If yes, rotate randomized around 0,0 */ cntr = 0; do { eqa = false; for (i = 0; i < pg->npts; i++) { if (FPzero(tmp->p[i].lat)) { if (FPeq(cos(tmp->p[i].lng), -1.0)) { return false; } else { eqa = true; break; } } } if (eqa) { SPOLY *ttt = (SPOLY *) palloc(VARSIZE(pg)); srand(cntr); se.phi_a = se.theta_a = se.psi_a = EULER_AXIS_X; se.phi = ((double) rand() / RAND_MAX) * PID; se.theta = 0.0; se.psi = 0.0; euler_spoly_trans(ttt, tmp, &se); memcpy((void *) tmp, (void *) ttt, VARSIZE(pg)); pfree(ttt); } if (cntr > 10000) { elog(WARNING, "Bug found in spoly_contains_point"); elog(ERROR, "Please report it to pg_sphere team!"); return false; } cntr++; } while (eqa); /* Count line segment crossing "equator" */ cntr = 0; for (i = 0; i < pg->npts; i++) { /* create a single line from segment */ spoly_segment(&sl, tmp, i); sline_begin(&lp[0], &sl); sline_end(&lp[1], &sl); a1 = (FPgt(lp[0].lat, 0.0) && FPlt(lp[1].lat, 0.0)); a2 = (FPlt(lp[0].lat, 0.0) && FPgt(lp[1].lat, 0.0)); if (a1 || a2) { /* if crossing */ sphereline_to_euler_inv(&te, &sl); if (a2) { /* crossing ascending */ p.lng = PID - te.phi; } else { p.lng = PI - te.phi; } spoint_check(&p); if (p.lng < PI) { /* crossing between 0 and 180 deg */ cntr++; } } } pfree(tmp); if (cntr % 2) { res = true; } } while (0); return res; } /* * Returns the relationship between a polygon and a line as * PGS_LINE_POLY_REL int8 value. * * poly - pointer to the polygon * line - pointer to the line */ int8 poly_line_pos(const SPOLY *poly, const SLine *line) { int32 i; SLine sl; SPoint slbeg, slend; int8 p1, p2, pos, res; const int8 sl_os = (1 << PGS_LINE_AVOID); const int8 sl_cl = (1 << PGS_LINE_CONT_LINE); const int8 sl_cr = (1 << PGS_LINE_CROSS); const int8 sl_cn = (1 << PGS_LINE_CONNECT); const int8 sl_ov = (1 << PGS_LINE_OVER); const int8 sl_eq = (1 << PGS_LINE_EQUAL); pos = 0; res = 0; sline_begin(&slbeg, line); sline_end(&slend, line); p1 = spoly_contains_point(poly, &slbeg); p2 = spoly_contains_point(poly, &slend); for (i = 0; i < poly->npts; i++) { spoly_segment(&sl, poly, i); pos = (1 << sline_sline_pos(&sl, line)); if (pos == sl_eq) { pos = sl_cl; /* is contain */ } if (pos == sl_ov) { return PGS_LINE_POLY_OVER; /* overlap */ } /* Recheck line crossing */ if (pos == sl_cr) { bool bal, eal; bal = spoint_at_sline(&slbeg, &sl); eal = spoint_at_sline(&slend, &sl); if (!bal && !eal) { return PGS_LINE_POLY_OVER; /* overlap */ } if ((bal && p2) || (eal && p1)) { pos = sl_cl; /* is contain */ } else { return PGS_LINE_POLY_OVER; /* overlap */ } } res |= pos; } if ((res & sl_cl) && ((res - sl_cl - sl_os - sl_cn - 1) < 0)) { return PGS_POLY_CONT_LINE; } else if (p1 && p2 && ((res - sl_os - sl_cn - 1) < 0)) { return PGS_POLY_CONT_LINE; } else if (!p1 && !p2 && ((res - sl_os - 1) < 0)) { return PGS_LINE_POLY_AVOID; } return PGS_LINE_POLY_OVER; } Datum spherepoly_in(PG_FUNCTION_ARGS) { SPOLY *poly; char *c = PG_GETARG_CSTRING(0); int32 i, nelem; void sphere_yyparse(void); init_buffer(c); sphere_yyparse(); nelem = get_path_count(); if (nelem > MAX_POINTS) { reset_buffer(); elog(ERROR, "spherepoly_in: too much points"); PG_RETURN_NULL(); } if (nelem > 2) { SPoint arr[MAX_POINTS]; for (i = 0; i < nelem; i++) { get_path_elem(i, &arr[i].lng, &arr[i].lat); } poly = spherepoly_from_array(&arr[0], nelem); } else { reset_buffer(); elog(ERROR, "spherepoly_in: more than two points needed"); PG_RETURN_NULL(); } reset_buffer(); PG_RETURN_POINTER(poly); } Datum spherepoly_rad(PG_FUNCTION_ARGS) { int i, np; ArrayType *float_vector = PG_GETARG_ARRAYTYPE_P(0); float8 *array_data; SPoint *points; np = ArrayGetNItems(ARR_NDIM(float_vector), ARR_DIMS(float_vector)); if (ARR_HASNULL(float_vector)) { elog(ERROR, "spherepoly_rad: input array is invalid because it has null values" ); PG_RETURN_NULL(); } if (np < 6 || np % 2 != 0) { elog(ERROR, "spherepoly_rad: invalid number of arguments (must be even and >= 6)" ); PG_RETURN_NULL(); } np /= 2; points = (SPoint *) palloc(np * sizeof(SPoint)); if (points == NULL) { elog(ERROR, "spherepoly_rad: failed to allocate memory for points array" ); PG_RETURN_NULL(); } array_data = (float8 *) ARR_DATA_PTR(float_vector); for (i = 0; i < np; i++) { create_spherepoint_from_long_lat(&points[i], array_data[2 * i], array_data[2 * i + 1] ); } PG_RETURN_POINTER(spherepoly_from_array(points, np)); } Datum spherepoly_deg(PG_FUNCTION_ARGS) { int i, np; ArrayType *float_vector = PG_GETARG_ARRAYTYPE_P(0); float8 *array_data; SPoint *points; np = ArrayGetNItems(ARR_NDIM(float_vector), ARR_DIMS(float_vector)); if (ARR_HASNULL(float_vector)) { elog(ERROR, "spherepoly_deg: input array is invalid because it has null values" ); PG_RETURN_NULL(); } if (np < 6 || np % 2 != 0) { elog(ERROR, "spherepoly_deg: invalid number of arguments (must be even and >= 6)" ); PG_RETURN_NULL(); } np /= 2; points = (SPoint *) palloc(np * sizeof(SPoint)); if (points == NULL) { elog(ERROR, "spherepoly_deg: failed to allocate memory for points array" ); PG_RETURN_NULL(); } array_data = (float8 *) ARR_DATA_PTR(float_vector); for (i = 0; i < np; i++) { create_spherepoint_from_long_lat(&points[i], deg_to_rad(array_data[2 * i]), deg_to_rad(array_data[2 * i + 1]) ); } PG_RETURN_POINTER(spherepoly_from_array(points, np)); } Datum spherepoly_from_point_array(PG_FUNCTION_ARGS) { SPoint *points; ArrayType *inarr = PG_GETARG_ARRAYTYPE_P(0); const int np = ArrayGetNItems(ARR_NDIM(inarr), ARR_DIMS(inarr)); if (np < 3) { elog(ERROR, "spherepoly_from_point_array: " "invalid number of arguments (must be >= 3)"); PG_RETURN_NULL(); } if (ARR_HASNULL(inarr)) { elog(ERROR, "spherepoly_from_point_array: " "input array is invalid because it has null values"); PG_RETURN_NULL(); } points = (SPoint *) ARR_DATA_PTR(inarr); PG_RETURN_POINTER(spherepoly_from_array(points, np)); } Datum spherepoly_equal(PG_FUNCTION_ARGS) { SPOLY *p1 = PG_GETARG_SPOLY(0); SPOLY *p2 = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(spoly_eq(p1, p2, false)); } Datum spherepoly_equal_neg(PG_FUNCTION_ARGS) { SPOLY *p1 = PG_GETARG_SPOLY(0); SPOLY *p2 = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(!spoly_eq(p1, p2, false)); } Datum spherepoly_circ(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); int32 i; SLine l; float8 sum = 0.0; for (i = 0; i < poly->npts; i++) { spoly_segment(&l, poly, i); sum += l.length; } PG_RETURN_FLOAT8(sum); } Datum spherepoly_npts(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); PG_RETURN_INT32(poly->npts); } Datum spherepoly_area(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); int32 i; SPoint s[MAX_POINTS + 2]; SPoint stmp[2]; SEuler se; float8 sum = 0.0; memcpy((void *) &s[1], (void *) &poly->p[0], poly->npts * sizeof(SPoint)); memcpy((void *) &s[0], (void *) &s[poly->npts], sizeof(SPoint)); memcpy((void *) &s[poly->npts + 1], (void *) &s[1], sizeof(SPoint)); se.psi = 0; se.phi_a = EULER_AXIS_Z; se.theta_a = EULER_AXIS_X; se.psi_a = EULER_AXIS_Z; for (i = 1; i <= poly->npts; i++) { se.phi = -PIH - s[i].lng; se.theta = s[i].lat - PIH; euler_spoint_trans(&stmp[0], &s[i - 1], &se); euler_spoint_trans(&stmp[1], &s[i + 1], &se); stmp[1].lng -= stmp[0].lng; if (FPlt(stmp[1].lng, 0.0)) { stmp[1].lng += PID; } sum += stmp[1].lng; } sum -= (PI * (poly->npts - 2)); if (FPge(sum, PID)) { sum = 2 * PID - sum; } if (FPzero(sum)) { sum = 0.0; } PG_RETURN_FLOAT8(sum); } Datum spherepoly_cont_point(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SPoint *sp = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(spoly_contains_point(poly, sp)); } Datum spherepoly_cont_point_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SPoint *sp = (SPoint *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(!spoly_contains_point(poly, sp)); } Datum spherepoly_cont_point_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SPoint *sp = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(spoly_contains_point(poly, sp)); } Datum spherepoly_cont_point_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SPoint *sp = (SPoint *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(!spoly_contains_point(poly, sp)); } Datum spherepoly_cont_circle(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); SPOLY *poly = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(poly_circle_pos(poly, circ) == PGS_POLY_CONT_CIRCLE); } Datum spherepoly_cont_circle_neg(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); SPOLY *poly = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(poly_circle_pos(poly, circ) != PGS_POLY_CONT_CIRCLE); } Datum spherepoly_cont_circle_com(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); SPOLY *poly = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_circle_pos(poly, circ) == PGS_POLY_CONT_CIRCLE); } Datum spherepoly_cont_circle_com_neg(PG_FUNCTION_ARGS) { SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); SPOLY *poly = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_circle_pos(poly, circ) != PGS_POLY_CONT_CIRCLE); } Datum spherecircle_cont_poly(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_circle_pos(poly, circ) == PGS_CIRCLE_CONT_POLY); } Datum spherecircle_cont_poly_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_circle_pos(poly, circ) != PGS_CIRCLE_CONT_POLY); } Datum spherecircle_cont_poly_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_circle_pos(poly, circ) == PGS_CIRCLE_CONT_POLY); } Datum spherecircle_cont_poly_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_circle_pos(poly, circ) != PGS_CIRCLE_CONT_POLY); } Datum spherepoly_overlap_circle(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_circle_pos(poly, circ) > PGS_CIRCLE_POLY_AVOID); } Datum spherepoly_overlap_circle_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_circle_pos(poly, circ) == PGS_CIRCLE_POLY_AVOID); } Datum spherepoly_overlap_circle_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_circle_pos(poly, circ) > PGS_CIRCLE_POLY_AVOID); } Datum spherepoly_overlap_circle_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SCIRCLE *circ = (SCIRCLE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_circle_pos(poly, circ) == PGS_CIRCLE_POLY_AVOID); } Datum spherepoly_cont_line(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SLine *line = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_line_pos(poly, line) == PGS_POLY_CONT_LINE); } Datum spherepoly_cont_line_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SLine *line = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_line_pos(poly, line) != PGS_POLY_CONT_LINE); } Datum spherepoly_cont_line_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SLine *line = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_line_pos(poly, line) == PGS_POLY_CONT_LINE); } Datum spherepoly_cont_line_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SLine *line = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_line_pos(poly, line) != PGS_POLY_CONT_LINE); } Datum spherepoly_overlap_line(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SLine *line = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_line_pos(poly, line) > PGS_LINE_POLY_AVOID); } Datum spherepoly_overlap_line_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SLine *line = (SLine *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_line_pos(poly, line) == PGS_LINE_POLY_AVOID); } Datum spherepoly_overlap_line_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SLine *line = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_line_pos(poly, line) > PGS_LINE_POLY_AVOID); } Datum spherepoly_overlap_line_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SLine *line = (SLine *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_line_pos(poly, line) == PGS_LINE_POLY_AVOID); } Datum spherepoly_cont_poly(PG_FUNCTION_ARGS) { SPOLY *poly1 = PG_GETARG_SPOLY(0); SPOLY *poly2 = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_poly_pos(poly1, poly2, false) == PGS_POLY_CONT); } Datum spherepoly_cont_poly_neg(PG_FUNCTION_ARGS) { SPOLY *poly1 = PG_GETARG_SPOLY(0); SPOLY *poly2 = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_poly_pos(poly1, poly2, false) != PGS_POLY_CONT); } Datum spherepoly_cont_poly_com(PG_FUNCTION_ARGS) { SPOLY *poly1 = PG_GETARG_SPOLY(1); SPOLY *poly2 = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(poly_poly_pos(poly1, poly2, false) == PGS_POLY_CONT); } Datum spherepoly_cont_poly_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly1 = PG_GETARG_SPOLY(1); SPOLY *poly2 = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(poly_poly_pos(poly1, poly2, false) != PGS_POLY_CONT); } Datum spherepoly_overlap_poly(PG_FUNCTION_ARGS) { SPOLY *poly1 = PG_GETARG_SPOLY(0); SPOLY *poly2 = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_poly_pos(poly1, poly2, false) > PGS_POLY_AVOID); } Datum spherepoly_overlap_poly_neg(PG_FUNCTION_ARGS) { SPOLY *poly1 = PG_GETARG_SPOLY(0); SPOLY *poly2 = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_poly_pos(poly1, poly2, false) == PGS_POLY_AVOID); } Datum spherepoly_cont_ellipse(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); SPOLY *poly = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) == PGS_POLY_CONT_ELLIPSE); } Datum spherepoly_cont_ellipse_neg(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); SPOLY *poly = PG_GETARG_SPOLY(0); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) != PGS_POLY_CONT_ELLIPSE); } Datum spherepoly_cont_ellipse_com(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); SPOLY *poly = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) == PGS_POLY_CONT_ELLIPSE); } Datum spherepoly_cont_ellipse_com_neg(PG_FUNCTION_ARGS) { SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); SPOLY *poly = PG_GETARG_SPOLY(1); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) != PGS_POLY_CONT_ELLIPSE); } Datum sphereellipse_cont_poly(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) == PGS_ELLIPSE_CONT_POLY); } Datum sphereellipse_cont_poly_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) != PGS_ELLIPSE_CONT_POLY); } Datum sphereellipse_cont_poly_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) == PGS_ELLIPSE_CONT_POLY); } Datum sphereellipse_cont_poly_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) != PGS_ELLIPSE_CONT_POLY); } Datum spherepoly_overlap_ellipse(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) > PGS_ELLIPSE_POLY_AVOID); } Datum spherepoly_overlap_ellipse_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(0); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) == PGS_ELLIPSE_POLY_AVOID); } Datum spherepoly_overlap_ellipse_com(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) > PGS_ELLIPSE_POLY_AVOID); } Datum spherepoly_overlap_ellipse_com_neg(PG_FUNCTION_ARGS) { SPOLY *poly = PG_GETARG_SPOLY(1); SELLIPSE *ell = (SELLIPSE *) PG_GETARG_POINTER(0); PG_RETURN_BOOL(poly_ellipse_pos(poly, ell) == PGS_ELLIPSE_POLY_AVOID); } Datum spheretrans_poly(PG_FUNCTION_ARGS) { SPOLY *sp = PG_GETARG_SPOLY(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SPOLY *out = (SPOLY *) palloc(VARSIZE(sp)); euler_spoly_trans(out, sp, se); PG_RETURN_POINTER(out); } Datum spheretrans_poly_inverse(PG_FUNCTION_ARGS) { Datum sp = PG_GETARG_DATUM(0); SEuler *se = (SEuler *) PG_GETARG_POINTER(1); SEuler tmp; Datum ret; spheretrans_inverse(&tmp, se); ret = DirectFunctionCall2(spheretrans_poly, sp, PointerGetDatum(&tmp)); PG_RETURN_DATUM(ret); } Datum spherepoly_add_point(PG_FUNCTION_ARGS) { SPOLY *poly = (SPOLY *) PG_GETARG_POINTER(0); SPoint *p = (SPoint *) PG_GETARG_POINTER(1); int32 size = 0; SPOLY *poly_new = NULL; if (p == NULL) { PG_RETURN_POINTER(poly); } if (poly == NULL) { size = offsetof(SPOLY, p[0]) +sizeof(SPoint); poly = (SPOLY *) palloc(size); memcpy((void *) &poly->p[0], (void *) p, sizeof(SPoint)); SET_VARSIZE(poly, size); poly->npts = 1; PG_RETURN_POINTER(poly); } poly = PG_GETARG_SPOLY(0); /* skip if equal */ if (spoint_eq(p, &poly->p[poly->npts - 1])) { PG_RETURN_POINTER(poly); } /* Skip if distance is equal 180deg */ if (FPeq(spoint_dist(p, &poly->p[poly->npts - 1]), PI)) { elog(NOTICE, "spoly(spoint): Skip point, distance of previous point is 180deg"); } size = offsetof(SPOLY, p[0]) +sizeof(SPoint) * (poly->npts + 1); poly_new = palloc(size); memcpy((void *) poly_new, (void *) poly, VARSIZE(poly)); poly_new->npts++; SET_VARSIZE(poly_new, size); memcpy((void *) &poly_new->p[poly->npts], (void *) p, sizeof(SPoint)); PG_RETURN_POINTER(poly_new); } Datum spherepoly_add_points_finalize(PG_FUNCTION_ARGS) { SPOLY *poly = (SPOLY *) PG_GETARG_POINTER(0); if (poly == NULL) { PG_RETURN_NULL(); } poly = PG_GETARG_SPOLY(0); if (poly->npts < 3) { elog(NOTICE, "spoly(spoint): At least 3 points required"); pfree(poly); PG_RETURN_NULL(); } /* Skip if distance is equal to 180deg */ if (FPeq(spoint_dist(&poly->p[0], &poly->p[poly->npts - 1]), PI)) { elog(NOTICE, "spoly(spoint): Cannot close polygon. Distance between first and last point is 180deg"); pfree(poly); PG_RETURN_NULL(); } if (!spherepoly_check(poly)) { elog(NOTICE, "spoly(spoint): a line segment overlaps or polygon too large"); pfree(poly); PG_RETURN_NULL(); } PG_RETURN_POINTER(poly); } Datum spherepoly_is_convex(PG_FUNCTION_ARGS) { Vector3D u, v, vsu, wsv, crs; int32 i; float8 cur = 0.0, prev = 0.0; SPOLY *poly = (SPOLY *) PG_GETARG_POINTER(0); if (poly == NULL) { PG_RETURN_BOOL(false); } poly = PG_GETARG_SPOLY(0); if (poly->npts == 3) { PG_RETURN_BOOL(true); } for (i = 0; i < poly->npts; i++) { const int j = (i - 1 + poly->npts) % poly->npts; const int k = (i + 1) % poly->npts; spoint_vector3d(&u, &poly->p[i]); spoint_vector3d(&v, &poly->p[j]); spoint_vector3d(&vsu, &poly->p[j]); spoint_vector3d(&wsv, &poly->p[k]); vector3d_addwithscalar(&vsu, -1, &u); vector3d_addwithscalar(&wsv, -1, &v); vector3d_cross(&crs, &vsu, &wsv); cur = vector3d_scalar(&crs, &v); if (cur * prev < 0) { PG_RETURN_BOOL(false); } prev = cur; } PG_RETURN_BOOL(true); } pgsphere-1.5.1/src/polygon.h000066400000000000000000000221361461140101500157570ustar00rootroot00000000000000#ifndef __PGS_POLYGON_H__ #define __PGS_POLYGON_H__ #include "ellipse.h" /* Polygon declarations */ /* * The definition of spherical polygon using a list of * spherical points. */ typedef struct { char vl_len_[4]; /* total size in bytes */ int32 npts; /* count of points */ SPoint p[1]; /* variable length array of SPoints */ } SPOLY; #define MAX_POINTS 1024 /* Polygon and ellipse */ #define PGS_ELLIPSE_POLY_AVOID 0 /* ellipse avoids polygon */ #define PGS_POLY_CONT_ELLIPSE 1 /* polygon contains ellipse */ #define PGS_ELLIPSE_CONT_POLY 2 /* ellipse contains polygon */ #define PGS_ELLIPSE_POLY_OVER 3 /* ellipse overlaps polygon */ /* Polygon and circle */ #define PGS_CIRCLE_POLY_AVOID 0 /* circle avoids polygon */ #define PGS_POLY_CONT_CIRCLE 1 /* polygon contains circle */ #define PGS_CIRCLE_CONT_POLY 2 /* circle contains polygon */ #define PGS_CIRCLE_POLY_OVER 3 /* circle overlap polygon */ /* Polygon and line */ #define PGS_LINE_POLY_AVOID 0 /* line avoids polygon */ #define PGS_POLY_CONT_LINE 1 /* polygon contains line */ #define PGS_LINE_POLY_OVER 2 /* line overlap polygon */ /* Polygon and polygon */ #define PGS_POLY_AVOID 0 /* polygon avoids other polygon */ #define PGS_POLY_CONT 1 /* polygon contains other polygon */ #define PGS_POLY_OVER 2 /* polygons overlap */ #define PG_GETARG_SPOLY( arg ) \ ( (SPOLY *) (PG_DETOAST_DATUM(PG_GETARG_DATUM(arg))) ) /* * Checks whether two polygons are equal. * * p1 - pointer to the first polygon * p2 - pointer to the second polygon * * If 'dir' is true, check with reverse polygon of 'p2'. */ extern bool spoly_eq(const SPOLY *p1, const SPOLY *p2, bool dir); /* * Returns the i-th line segment of a polygon. * * sl - pointer to the line segment * poly - pointer to the polygon * i - number of the segment */ extern bool spoly_segment(SLine *sl, const SPOLY *poly, int32 i); /* * Checks whether a polygon contains a point. * * pg - pointer to the polygon * sp - pointer to the point */ extern bool spoly_contains_point(const SPOLY *pg, const SPoint *sp); /* * Returns the n-th point of a spoly. */ extern Datum spherepoly_get_point(PG_FUNCTION_ARGS); /* * Returns the relationship between a polygon and a line as * PGS_LINE_POLY_REL int8 value. * * poly - pointer to the polygon * line - pointer to the line */ extern int8 poly_line_pos(const SPOLY *poly, const SLine *line); /* * Creates a spherical polygon (spoly) from an array of pair-consecutive * numbers (lng, lat), in radians. */ extern Datum spherepoly_rad(PG_FUNCTION_ARGS); /* * Creates a spherical polygon (spoly) from an array of pair-consecutive * numbers (lng, lat), in degrees. */ extern Datum spherepoly_deg(PG_FUNCTION_ARGS); /* * Creates a spherical polygon (spoly) from an array of spoint elements. */ extern Datum spherepoly_from_point_array(PG_FUNCTION_ARGS); /* * Input of a spherical polygon. */ extern Datum spherepoly_in(PG_FUNCTION_ARGS); /* * Checks whether two polygons are equal. */ extern Datum spherepoly_equal(PG_FUNCTION_ARGS); /* * Checks whether two polygons are not equal. */ extern Datum spherepoly_equal_neg(PG_FUNCTION_ARGS); /* * Circumstance of a polygon. Returns circumference in radians * (float8 datum). */ extern Datum spherepoly_circ(PG_FUNCTION_ARGS); /* * Count points (edges) of a polygon. */ extern Datum spherepoly_npts(PG_FUNCTION_ARGS); /* * Returns area of a polygon. */ extern Datum spherepoly_area(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a point. */ extern Datum spherepoly_cont_point(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a point. */ extern Datum spherepoly_cont_point_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a point. */ extern Datum spherepoly_cont_point_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a point. */ extern Datum spherepoly_cont_point_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a circle. */ extern Datum spherepoly_cont_circle(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a circle. */ extern Datum spherepoly_cont_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a circle. */ extern Datum spherepoly_cont_circle_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a circle. */ extern Datum spherepoly_cont_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a polygon. */ extern Datum spherecircle_cont_poly(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a polygon. */ extern Datum spherecircle_cont_poly_neg(PG_FUNCTION_ARGS); /* * Checks whether a circle contains a polygon. */ extern Datum spherecircle_cont_poly_com(PG_FUNCTION_ARGS); /* * Checks whether a circle doesn't contain a polygon. */ extern Datum spherecircle_cont_poly_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a circle overlap. */ extern Datum spherepoly_overlap_circle(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a circle don't overlap. */ extern Datum spherepoly_overlap_circle_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a circle overlap. */ extern Datum spherepoly_overlap_circle_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a circle don't overlap. */ extern Datum spherepoly_overlap_circle_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a line. */ extern Datum spherepoly_cont_line(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a line. */ extern Datum spherepoly_cont_line_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains a line. */ extern Datum spherepoly_cont_line_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain a line. */ extern Datum spherepoly_cont_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a line overlap. */ extern Datum spherepoly_overlap_line(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a line don't overlap. */ extern Datum spherepoly_overlap_line_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a line overlap. */ extern Datum spherepoly_overlap_line_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon and a line don't overlap. */ extern Datum spherepoly_overlap_line_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains other polygon. */ extern Datum spherepoly_cont_poly(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain other polygon. */ extern Datum spherepoly_cont_poly_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains other polygon. */ extern Datum spherepoly_cont_poly_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain other polygon. */ extern Datum spherepoly_cont_poly_com_neg(PG_FUNCTION_ARGS); /* * Checks whether two polygons overlap. */ extern Datum spherepoly_overlap_poly(PG_FUNCTION_ARGS); /* * Checks whether two polygons don't overlap. */ extern Datum spherepoly_overlap_poly_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains an ellipse. */ extern Datum spherepoly_cont_ellipse(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain an ellipse. */ extern Datum spherepoly_cont_ellipse_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon contains an ellipse. */ extern Datum spherepoly_cont_ellipse_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon doesn't contain an ellipse. */ extern Datum spherepoly_cont_ellipse_com_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a polygon. */ extern Datum sphereellipse_cont_poly(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a polygon. */ extern Datum sphereellipse_cont_poly_neg(PG_FUNCTION_ARGS); /* * Checks whether an ellipse contains a polygon. */ extern Datum sphereellipse_cont_poly_com(PG_FUNCTION_ARGS); /* * Checks whether an ellipse doesn't contain a polygon. */ extern Datum sphereellipse_cont_poly_com_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and an ellipse overlap. */ extern Datum spherepoly_overlap_ellipse(PG_FUNCTION_ARGS); /* * Checks whether a polygon and an ellipse don't overlap. */ extern Datum spherepoly_overlap_ellipse_neg(PG_FUNCTION_ARGS); /* * Checks whether a polygon and an ellipse overlap. */ extern Datum spherepoly_overlap_ellipse_com(PG_FUNCTION_ARGS); /* * Checks whether a polygon and an ellipse don't overlap. */ extern Datum spherepoly_overlap_ellipse_com_neg(PG_FUNCTION_ARGS); /* * Performs inverse transform on a polygon using an Euler transformation. */ extern Datum spheretrans_poly(PG_FUNCTION_ARGS); /* * Performs inverse transform on a polygon using an Euler transformation. */ extern Datum spheretrans_poly_inverse(PG_FUNCTION_ARGS); /* * State transition function for the aggregate function spoly(spoint). Never * call this function outside an aggregate function! Adds a point to a polygon. */ extern Datum spherepoly_add_point(PG_FUNCTION_ARGS); /* * Finalize function for adding spoints to a polygon. */ extern Datum spherepoly_add_points_finalize(PG_FUNCTION_ARGS); /* * Returns spoly as array of points */ extern Datum spherepoly_get_array(PG_FUNCTION_ARGS); /* * Checks whether a polygon is convex */ extern Datum spherepoly_is_convex(PG_FUNCTION_ARGS); #endif pgsphere-1.5.1/src/process_moc.cpp000066400000000000000000000635611461140101500171460ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* __cxa_current_exception_type */ #include #include "pgs_process_moc.h" #include "pgs_util.h" #define LAYDEB 0 #define DEBUG_(code) do { if (LAYDEB) { code; } } while (0); #define DEBUG_LOG(msg) DEBUG_(log_string() += msg) #define DEBUG_LF DEBUG_LOG("\n") #define DEBUG_SHOW(name) (to_string(#name " = ") + to_string(name) + "; ") #define DEBUG_DX(name) DEBUG_LOG(DEBUG_SHOW(name)) #define DEBUG_MA(name) m.addln(to_string("_" #name " = ") + to_string(name)); // PGS_TRY / PGS_CATCH: use an additional 'do {} while (0);' to allow for // 'break;' as an alternative to 'return;' #define PGS_TRY try { do { #define PGS_CATCH } while (0); } \ catch (std::exception & e) \ { \ delete p; \ error_out(e.what(), 0); \ } \ catch (PlanckError & e) \ { \ delete p; \ error_out(e.what(), 0); \ } \ catch (...) \ { \ delete p; \ error_out(__cxxabiv1::__cxa_current_exception_type()->name(), 0); \ } using std::size_t; static std::string & log_string() { static std::string s; return s; } size_t get_moc_debug(const char** c_str, pgs_error_handler error_out) { int* p = 0; size_t size; PGS_TRY *c_str = log_string().c_str(); size = 1 + log_string().size(); PGS_CATCH return size; } void moc_debug_log(pgs_error_handler error_out, const char *fm, ...) { int* p = 0; char buffer[2048]; PGS_TRY va_list arguments; va_start(arguments, fm); vsprintf(buffer, fm, arguments); va_end(arguments); log_string().append(buffer); PGS_CATCH } void moc_debug_clear(pgs_error_handler error_out) { int* p = 0; PGS_TRY log_string().clear(); PGS_CATCH } // Throwing expections from destructors is not strictly forbidden, it is just // discouraged in the strongest possible way. template void release_context(void* context, pgs_error_handler error_out) { C* p = static_cast(context); try { delete p; } catch (std::exception & e) { error_out(e.what(), 0); } catch (...) { error_out("unknown exception", 0); } } char* data_as_char(Smoc* moc, size_t offset = 0) { return offset + reinterpret_cast(&((moc->data)[0])); } static char* detoasted_offset(Smoc* moc, size_t offset = 0) { return offset + reinterpret_cast(moc) + offsetof(Smoc, version); } template static X* data_as(Y* y) { return reinterpret_cast(y); } static size_t align_round(size_t offset, size_t alignment) { return (1 + offset / alignment) * alignment; } static void healpix_convert(hpint64 & idx, int32 from_order) { idx <<= (29 - from_order) * 2; } moc_interval make_interval(hpint64 first, hpint64 last) { moc_interval x; x.first = first; x.second = last; return x; } template moc_tree_entry make_node(int32 offset, const X & start) { moc_tree_entry x; x.offset = offset; std::memmove(x.start, &start, HP64_SIZE); return x; } bool operator<(const moc_interval & x, const moc_interval & y) { return x.first < y.first; } typedef std::map moc_map; typedef moc_map::iterator map_iterator; typedef moc_map::const_iterator map_const_iter; typedef moc_map::const_reverse_iterator map_rev_iter; typedef moc_map::value_type moc_map_entry; template std::ostream & interval_out(std::ostream & os, const X & x) { os << "[" << x.first << ", " << x.second << ")"; return os; } std::ostream & operator<<(std::ostream & os, const moc_interval & x) { return interval_out(os, x); } std::ostream & operator<<(std::ostream & os, const moc_map_entry & x) { return interval_out(os, x); } std::ostream & operator<<(std::ostream & os, const moc_tree_entry & x) { hpint64 start; std::memmove(&start, x.start, HP64_SIZE); os << "{" << start << " -> " << x.offset << "}"; return os; } template std::string to_string(const X & x) { std::ostringstream oss; oss << x; return oss.str(); } struct moc_output { std::string s; }; struct moc_tree_layout { size_t entries; // # of all entries of a particular level size_t level_end; // index of next entity below this level moc_tree_layout(): entries(0), level_end(0) {} moc_tree_layout(size_t len): entries(len), level_end(0) {} void layout_level(size_t & moc_size, size_t entry_size) { // maximal # of entries in a page size_t page_len = PG_TOAST_PAGE_FRAGMENT / entry_size; // # of remaining bytes of the current page size_t page_rest = PG_TOAST_PAGE_FRAGMENT - moc_size % PG_TOAST_PAGE_FRAGMENT; // # of remaining entries within the current page size_t rest_entries = page_rest / entry_size; size_t rest_level = 4022250974; // # of entries beyond the current page size_t this_page = 3992890810; // # of bytes used of the current page if (entries >= rest_entries) { rest_level = entries - rest_entries; this_page = page_rest; } else // there is only a single page fragment at this level { rest_level = 0; this_page = entries * entry_size; } // # of full pages the current level needs size_t full_pages = rest_level / page_len; // # of bytes that the last page, certainly fractionally, is used for size_t last_page = (rest_level % page_len) * entry_size; size_t this_page_entries = entries * entry_size; if (full_pages || last_page) this_page_entries = this_page; size_t full_pages_space = PG_TOAST_PAGE_FRAGMENT * full_pages; // special case: end of entries at end of page if (last_page == 0) { full_pages_space = full_pages ? page_len * entry_size : 0; if (full_pages > 1) full_pages_space += PG_TOAST_PAGE_FRAGMENT * (full_pages - 1); } moc_size += this_page_entries + full_pages_space + last_page; level_end = moc_size; } }; typedef std::vector layout_vec; struct moc_input { moc_map input_map; size_t options_bytes; size_t options_size; layout_vec layout; int order = 0; std::string s; moc_input() : options_bytes(0), options_size(0) { layout.reserve(5); } void dump() { std::ostringstream oss; oss << (input_map.size() ? "{" : "{ "); for (map_iterator i = input_map.begin(); i != input_map.end(); ++i) oss << *i << " "; s.append(oss.str()); *s.rbegin() = '}'; } void lndump(const std::string & msg) { s.append("\n"); s.append(msg + ":\n"); dump(); } void addln(const std::string & msg) { s.append("\n"); s.append(msg); } std::string to_string(map_iterator i) { if (i == input_map.end()) return "[END]"; return std::string(i == input_map.begin() ? "[BEGIN]" : "") + ::to_string(*i); } }; template class rpage_iter { private: char* base; int32 offset; static const size_t page_decrement = value_size + page_size - (page_size / value_size) * value_size; public: rpage_iter(): base(0), offset(0) {} rpage_iter(int32 index): base(0), offset(index) {} rpage_iter(char* b, int32 index): base(b), offset(index) { operator++(); // a simplification that fails for the general case } void set(const V & v) { std::memmove(base + offset, &v, value_size); } V operator *() const { V v; std::memmove(&v, base + offset, value_size); return v; } bool operator !=(const rpage_iter & x) { return base != x.base || offset != x.offset; } bool page_ready() const { // this may, correctly, result in a fractional page with just a single // entry: return offset % page_size == 0; } rpage_iter & operator++() { offset -= page_ready() ? page_decrement : value_size; return *this; } int index() const { return offset; } friend std::ostream & operator<<(std::ostream & os, const rpage_iter & x) { os << "/" << static_cast(x.base) << "@: +" << x.offset << "/"; return os; } }; typedef rpage_iter rintv_iter; typedef rpage_iter rnode_iter; void* create_moc_in_context(pgs_error_handler error_out) { moc_input* p = 0; PGS_TRY p = new moc_input; PGS_CATCH return static_cast(p); }; void release_moc_in_context(void* moc_in_context, pgs_error_handler error_out) { release_context(moc_in_context, error_out); } void add_to_map(moc_map & input_map, hpint64 first, hpint64 last) { map_iterator lower = input_map.lower_bound(first); // first element not less than 'first' map_iterator upper = input_map.upper_bound(last); // first element greater than 'last' if (lower != input_map.begin()) { map_iterator before = lower; --before; // element actually less than 'first' if (before->second >= first) { if (before->second >= last) return; // [first, last) \subset [before] lower = before; first = lower->first; } } if (upper != input_map.begin()) { map_iterator after = upper; --after; if (after->second > last) last = after->second; } // Skip erase if it would do nothing in order to be able to use // an input hint for set::insert(). // This path would be superflous with C++11's erase(), as that returns // the correct hint for the insert() of the general case down below. // The input hint lower == upper always refers the interval completely // past the one to insert, or to input_map.end() moc_map_entry input(first, last); if (lower == upper) { input_map.insert(lower, input); return; } if (lower->first == first) { lower->second = last; input_map.erase(++lower, upper); return; } input_map.erase(lower, upper); input_map.insert(input); }; void add_to_moc(void* moc_in_context, long order, hpint64 first, hpint64 last, pgs_error_handler error_out) { moc_input* p = static_cast(moc_in_context); PGS_TRY moc_input & m = *p; healpix_convert(first, order); // convert to order 29 healpix_convert(last, order); add_to_map(m.input_map, first, last); PGS_CATCH }; void moc_in_context_set_order(void* moc_in_context, int order) { moc_input* p = static_cast(moc_in_context); moc_input & m = *p; if (order > m.order) m.order = order; } // get_moc_size() prepares creation of MOC static // calculate the number of entries of the next-higher level void next_level(size_t & len, size_t entry_size) { // can't split a single entry into two pages: // if (len <= 1) // { // len = 1; // return; // } // maximal # of entries in a page of the current level size_t page_len = PG_TOAST_PAGE_FRAGMENT / entry_size; // # of full pages the current level needs size_t full_pages = len / page_len; // is there an additional fractional page? bool frac_page = len % page_len; len = full_pages + 1 + frac_page; } int get_moc_size(void* moc_in_context, pgs_error_handler error_out) { moc_input* p = static_cast(moc_in_context); size_t moc_size = MOC_HEADER_SIZE; PGS_TRY moc_input & m = *p; m.options_size = 0; // align_round(m.options_bytes, MOC_INDEX_ALIGN); moc_size += m.options_size; if (m.options_size > MOC_MAX_OPTIONS_SIZE) throw std::logic_error("options larger than MOC_MAX_OPTIONS_SIZE"); // Before doing the layout, calculate the maximal size that the B+-tree // needs: // first, calculate the maximal size the interval pages take size_t len = m.input_map.size(); // take upper bound of depth into account for space of level ends int32 moc_root_page_calc = moc_tree_entry_floor(std::ceil( moc_mod_floor(PG_TOAST_PAGE_FRAGMENT - moc_size, 4) - 3 * MOC_TREE_ENTRY_SIZE - 4 * (1 + std::log(1 + (1 + len / moc_interval_floor(PG_TOAST_PAGE_FRAGMENT) * PG_TOAST_PAGE_FRAGMENT)) / std::log(MOC_TREE_PAGE_LEN - 2)))); size_t moc_root_page_rest = moc_root_page_calc; if (moc_root_page_calc < 0 || moc_root_page_rest < 2 * MOC_TREE_ENTRY_SIZE) throw std::logic_error("PG_TOAST_PAGE_FRAGMENT too small for MOCs"); m.layout.push_back(len); next_level(len, MOC_INTERVAL_SIZE); // add the maximal sizes of each tree level int check; const int b_tree_inf = 100; for (check = 0; check < b_tree_inf; ++check) { m.layout.push_back(len); if (len * MOC_TREE_ENTRY_SIZE <= moc_root_page_rest) break; next_level(len, MOC_TREE_ENTRY_SIZE); } if (check == b_tree_inf) throw std::logic_error("infinite loop for MOC B-tree depth"); // layout: start with the section of the ends of each B+-tree level size_t depth = m.layout.size() - 1; moc_size += depth * MOC_INDEX_ALIGN; // layout: B+-tree layout, starting at root node for (unsigned k = depth; k >= 1; --k) { m.layout[k].layout_level(moc_size, MOC_TREE_ENTRY_SIZE); } if (m.layout[depth].level_end > static_cast( moc_tree_entry_floor(PG_TOAST_PAGE_FRAGMENT))) throw std::logic_error("MOC root node spilled into second page"); // layout: intervals moc_size = align_round(moc_size, HP64_SIZE); // fix up alignment m.layout[0].layout_level(moc_size, MOC_INTERVAL_SIZE); moc_size = std::max(MIN_MOC_SIZE, moc_size); PGS_CATCH return moc_size; }; // create_moc_release_context() // moc_in_context: -- must be have been prepared by get_moc_size() // moc: -- must be allocated with a size returned by get_moc_size() // void create_moc_release_context(void* moc_in_context, Smoc* moc, pgs_error_handler error_out) { const moc_input* p = static_cast(moc_in_context); PGS_TRY const moc_input & m = *p; moc->version = 0; // moc->version |= 1; // flag indicating options hpint64 area = 0; // this guards against char* moc_data = detoasted_offset(moc, 0); // All levels will be filled out from end to beginning such that // the above level-end values stay correct. // process the interval pages hpint64 order_log = 0; rintv_iter i(moc_data, m.layout[0].level_end); rnode_iter n(moc_data, m.layout[1].level_end); // default for "empty" root node, points past the intervals: rintv_iter last_i(m.layout[0].level_end); hpint64 first = 0; hpint64 last = 0; // intervals and next-level node: rnode_iter last_rend; rnode_iter rend; for (map_rev_iter r = m.input_map.rbegin(); r != m.input_map.rend(); ++r) { first = r->first; last = r->second; order_log |= first; order_log |= last; area += last - first; if (i.page_ready()) { // need to re-factor this into its own function: n.set(make_node(i.index(), first)); last_rend = n; rend = ++n; } i.set(make_interval(first, last)); last_i = i; ++i; } // put start of Healpix intervals into the header moc->data_begin = last_i.index(); // If the Smoc should be the empty set, still generate an "empty" // root node with a single moc_tree_entry: // its offset member will point just at the end of the Smoc, // with its start member duly set to zero here. if (!last_i.page_ready() || m.input_map.empty()) { n.set(make_node(last_i.index(), first)); last_rend = n; rend = ++n; } // process the tree pages of higher-order nodes: size_t depth = m.layout.size() - 1; for (size_t k = 1; k < depth; ++k) { rnode_iter z(moc_data, m.layout[k].level_end); rnode_iter b(moc_data, m.layout[k + 1].level_end); rnode_iter last_z; rnode_iter z_end = rend; for ( ; z != z_end; ++z) { if (z.page_ready()) { b.set(make_node(z.index(), (*z).start)); last_rend = b; rend = ++b; } last_z = z; } if (!last_z.page_ready()) { b.set(make_node(last_z.index(), (*last_z).start)); last_rend = b; rend = ++b; } } // The level-end section must be put relative to the actual beginning // of the root node to prevent confusing redunancies. int32 tree_begin = last_rend.index() - depth * MOC_INDEX_ALIGN; // fill out level-end section int32* level_ends = data_as(detoasted_offset(moc, tree_begin)); moc->depth = depth; for (int k = depth; k >= 1; --k) { *(level_ends + depth - k) = m.layout[k].level_end; } // There may be some space between the end of the options and // moc->tree_begin, but simple relocation of the tree is not an option // because of padding at the end of the pages. moc->tree_begin = tree_begin; // start of level-end section moc->area = area; /* // simple linear search shift loop to calculate the moc order int order; for (order = 29; order > 0; --order, order_log >>= 2) if (order_log & 3) break; moc->order = order; */ moc->order = m.order; // moc order provided by caller moc->first = 0; // first Healpix index in set moc->last = 0; // 1 + (last Healpix index in set) if (m.input_map.size()) { moc->first = m.input_map.begin()->first; moc->last = m.input_map.rbegin()->second; } PGS_CATCH release_moc_in_context(moc_in_context, error_out); }; static moc_interval* interval_ptr(Smoc* moc, int32 offset) { return data_as(detoasted_offset(moc, offset)); } typedef std::vector output_map; void order_break(output_map & outputs, const moc_interval & x, int max_order) { int order; hpint64 mask = 0; mask = ~mask ^ 3; hpint64 first = x.first >> 2 * (29 - max_order); hpint64 second = x.second >> 2 * (29 - max_order); for (order = max_order; order > 0; --order, first >>= 2, second >>= 2) { if (second == first) return; moc_map & output = outputs[order]; if (second - first < 4) { add_to_map(output, first, second); return; } // the follwing is sort of inefficient in case the two fragments are // adjacent, but who cares... if (first & 3) { add_to_map(output, first, (first + 4) & mask); first += 4; } if (second & 3) { add_to_map(output, second & mask, second); } } if (first != second) add_to_map(outputs[0], first, second); } void ascii_out(std::string & m_s, char* s, Smoc* moc, int32 begin, int32 end, int32 entry_size) { // moc output fiddling: int order = moc->order; m_s.reserve(end); // rough guess if (moc->first == moc->last) { sprintf(s, "%d/", order); m_s.append(s); return; } output_map outputs(1 + order); for (int32 j = begin; j < end; j += entry_size) { // page bumps int32 mod = (j + entry_size) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < entry_size) j += entry_size - mod; order_break(outputs, *interval_ptr(moc, j), order); } for (int k = 0; k <= order; ++k) { const moc_map & output = outputs[k]; if (output.size() || k == order) // always output "order/" to track input order { sprintf(s, "%d/", k); m_s.append(s); } for (map_const_iter i = output.begin(); i != output.end(); ++i) { hpint64 first = i->first; hpint64 last = i->second - 1; if (first == last) sprintf(s, "" MOC_FORMAT_64U " ", first); else sprintf(s, "" MOC_FORMAT_64U "-" MOC_FORMAT_64U " ", first, last); m_s.append(s); } if (output.size()) *m_s.rbegin() = ' '; } if (outputs[order].size()) m_s.resize(m_s.size() - 1); // strip trailing space } moc_out_data create_moc_out_context(Smoc* moc, int32 end, pgs_error_handler error_out) { moc_output* p = 0; size_t out_size = 0; PGS_TRY p = new moc_output; moc_output & m = *p; char s[60]; int32 begin = moc->data_begin; int32 entry_size = MOC_INTERVAL_SIZE; switch (smoc_output_type) { case 0: // output type MOC-ASCII ascii_out(m.s, s, moc, begin, end, entry_size); break; case 1: // output type MOC intervals m.s.reserve(end); // rough guess m.s.append(begin != end ? "{" : "{ "); for (int32 j = begin; j < end; j += entry_size) { // page bumps int32 mod = (j + entry_size) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < entry_size) j += entry_size - mod; moc_interval & x = *interval_ptr(moc, j); sprintf(s, "[" MOC_FORMAT_64U ", " MOC_FORMAT_64U ") ", x.first, x.second); m.s.append(s); } *m.s.rbegin() = '}'; break; default: error_out("create_moc_out_context()", 0); } out_size = m.s.length() + 1; PGS_CATCH moc_out_data ret; ret.context = static_cast(p); ret.out_size = out_size; return ret; } void release_moc_out_context(moc_out_data out_context, pgs_error_handler error_out) { release_context(out_context.context, error_out); } void print_moc_release_context(moc_out_data out_context, char* buffer, pgs_error_handler error_out) { moc_output* p = static_cast(out_context.context); PGS_TRY moc_output & m = *p; std::memmove(buffer, m.s.c_str(), out_context.out_size); PGS_CATCH release_moc_out_context(out_context, error_out); } static bool entry_cmp(const moc_tree_entry & a, hpint64 y) { hpint64 x; std::memmove(&x, a.start, HP64_SIZE); return x < y; } static bool interval_cmp(const moc_interval & x, hpint64 y) { return x.first < y; } moc_tree_entry* entry_lower_bound(moc_tree_entry* first, moc_tree_entry* last, hpint64 value) { return std::lower_bound(first, last, value, entry_cmp); } moc_interval* interval_lower_bound(moc_interval* first, moc_interval* last, hpint64 value) { return std::lower_bound(first, last, value, interval_cmp); } void moc_union(void* moc_in_context, Smoc* moc_a, int32 moc_a_end, Smoc* moc_b, int32 moc_b_end, pgs_error_handler error_out) { int32 begin = moc_a->data_begin; //int32 end = VARSIZE(moc_a) - VARHDRSZ; int32 entry_size = MOC_INTERVAL_SIZE; moc_input* p = static_cast(moc_in_context); PGS_TRY moc_input & m = *p; for (int32 j = begin; j < moc_a_end; j += entry_size) { // page bumps int32 mod = (j + entry_size) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < entry_size) j += entry_size - mod; moc_interval & x = *interval_ptr(moc_a, j); add_to_map(m.input_map, x.first, x.second); } begin = moc_b->data_begin; //end = VARSIZE(moc_b) - VARHDRSZ; for (int32 j = begin; j < moc_b_end; j += entry_size) { // page bumps int32 mod = (j + entry_size) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < entry_size) j += entry_size - mod; moc_interval & x = *interval_ptr(moc_b, j); add_to_map(m.input_map, x.first, x.second); } m.order = std::max(moc_a->order, moc_b->order); PGS_CATCH }; void moc_intersection(void* moc_in_context, Smoc* moc_a, int32 moc_a_end, Smoc* moc_b, int32 moc_b_end, pgs_error_handler error_out) { int32 a = moc_a->data_begin; int32 b = moc_b->data_begin; int32 entry_size = MOC_INTERVAL_SIZE; moc_input* p = static_cast(moc_in_context); PGS_TRY moc_input & m = *p; for (; a < moc_a_end && b < moc_b_end; ) // iterate over both in parallel { // page bumps int32 mod = (a + entry_size) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < entry_size) a += entry_size - mod; moc_interval & x = *interval_ptr(moc_a, a); mod = (b + entry_size) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < entry_size) b += entry_size - mod; moc_interval & y = *interval_ptr(moc_b, b); if (x.second <= y.first) // a entirely left of b, advance a { a += entry_size; continue; } if (y.second <= x.first) // b entirely left of a, advance b { b += entry_size; continue; } // add intersection of the two intervals we are at now add_to_map(m.input_map, std::max(x.first, y.first), std::min(x.second, y.second)); if (x.second <= y.second) // advance interval that has the lowest end (there might be more overlaps) a += entry_size; else b += entry_size; } m.order = std::max(moc_a->order, moc_b->order); PGS_CATCH } void moc_degrade(void* moc_in_context, int order, Smoc* moc_a, int32 moc_a_end, pgs_error_handler error_out) { moc_input* p = static_cast(moc_in_context); PGS_TRY moc_input & m = *p; for (int32 a = moc_a->data_begin; a < moc_a_end; a += MOC_INTERVAL_SIZE) { // page bumps int32 mod = (a + MOC_INTERVAL_SIZE) % PG_TOAST_PAGE_FRAGMENT; if (mod > 0 && mod < (int32) MOC_INTERVAL_SIZE) a += MOC_INTERVAL_SIZE - mod; moc_interval & x = *interval_ptr(moc_a, a); int shift = 2 * (HEALPIX_MAX_ORDER - order); hpint64 first = (x.first >> shift) << shift; // set low bits to zero hpint64 low_bits_one = (1LL << shift) - 1; hpint64 second = ((x.second + low_bits_one) >> shift) << shift; // round low bits up add_to_map(m.input_map, first, second); } m.order = order; PGS_CATCH } void moc_healpix(void* moc_in_context, int order, hpint64 first, hpint64 last, pgs_error_handler error_out) { moc_input* p = static_cast(moc_in_context); moc_input & m = *p; PGS_TRY moc_map_entry input(first, last); m.input_map.insert(m.input_map.end(), input); m.order = order; PGS_CATCH } void moc_disc(void* moc_in_context, int order, double theta, double phi, double radius, pgs_error_handler error_out) { moc_input* p = static_cast(moc_in_context); moc_input & m = *p; PGS_TRY rangeset pixset; Healpix_Base2 hp(order, NEST); pointing center(conv_theta(theta), phi); hp.query_disc_inclusive(center, radius, pixset); for (tsize j = 0; j < pixset.nranges(); j++) { hpint64 first = pixset.ivbegin(j); hpint64 last = pixset.ivend(j); healpix_convert(first, order); // convert to order 29 healpix_convert(last, order); moc_map_entry input(first, last); m.input_map.insert(m.input_map.end(), input); } m.order = order; PGS_CATCH } void moc_polygon(void* moc_in_context, int order, int32 npts, float8 *polygon, pgs_error_handler error_out) { moc_input* p = static_cast(moc_in_context); moc_input & m = *p; PGS_TRY rangeset pixset; Healpix_Base2 hp(order, NEST); /* convert spoly's spoint array to a pointing array */ std::vector vertex; for (int i = 0; i < 2 * npts; i += 2) { pointing v(conv_theta(polygon[i+1]), polygon[i]); vertex.push_back(v); } hp.query_polygon_inclusive(vertex, pixset); for (tsize j = 0; j < pixset.nranges(); j++) { hpint64 first = pixset.ivbegin(j); hpint64 last = pixset.ivend(j); healpix_convert(first, order); // convert to order 29 healpix_convert(last, order); moc_map_entry input(first, last); m.input_map.insert(m.input_map.end(), input); } m.order = order; PGS_CATCH } pgsphere-1.5.1/src/sbuffer.c000066400000000000000000000133331461140101500157160ustar00rootroot00000000000000#include "pg_sphere.h" #include "sbuffer.h" /* Functions to buffer the parser input. */ /* Maximum count of buffered angles. */ #define MAX_BUF_ANGLE 20 /* The type of parsed spherical object. */ unsigned char spheretype; /* The angle buffer. */ float8 bufangle[MAX_BUF_ANGLE]; /* A simple spherical point. */ typedef struct { double lng; /* longitude */ double lat; /* latitude */ } bpoint; /* Spherical point buffer. */ struct { int m; /* count of buffered points */ bpoint *p; /* pointer to array of points */ } bufpoints; /* ID of line's length angle. */ int bufline; /* * First element is the ID of spherical point ( center ). * Second element is the ID of radius angle. */ int bufcircle[2]; /* Buffer of ellipse. */ int bufellipse[5]; /* Buffer of IDs of Euler transformation values. */ int bufeuler[3]; /* Structure to buffer the axes of Euler transformation. */ struct { unsigned char phi, /* first axis */ theta, /* second axis */ psi; /* third axis */ } bufeulertype; /* Current angle ID. */ int bufapos; /* Current point ID. */ int bufspos; /* Pointer to input buffer. */ char *parse_buffer; void set_spheretype(unsigned char st) { spheretype = st; } void init_buffer(char *buffer) { spheretype = STYPE_UNKNOWN; parse_buffer = buffer; bufapos = 0; bufspos = 0; bufeulertype.phi = bufeulertype.psi = EULER_AXIS_Z; bufeulertype.theta = EULER_AXIS_X; bufpoints.m = 2; bufpoints.p = (bpoint *) palloc(bufpoints.m * sizeof(bpoint)); } void reset_buffer(void) { sphere_flush_scanner_buffer(); pfree(bufpoints.p); bufpoints.p = NULL; bufpoints.m = 0; init_buffer(NULL); } int set_angle_sign(int apos, int s) { if (bufangle[apos] > 0 && s < 0) { bufangle[apos] *= -1; } if (bufangle[apos] < 0 && s > 0) { bufangle[apos] *= -1; } return apos; } int set_angle(unsigned char is_deg, float8 a) { if (is_deg) { a /= RADIANS; } bufangle[bufapos] = a; bufapos++; return (bufapos - 1); } int set_point(int lngpos, int latpos) { if (bufspos >= bufpoints.m) { bpoint *p = bufpoints.p; int i = (bufpoints.m * 2); bufpoints.p = (bpoint *) palloc(i * sizeof(bpoint)); memcpy((void *) bufpoints.p, (void *) p, bufpoints.m * sizeof(bpoint)); bufpoints.m = i; pfree(p); } bufpoints.p[bufspos].lng = bufangle[lngpos]; bufpoints.p[bufspos].lat = bufangle[latpos]; bufspos++; lngpos = 0; latpos = 0; if ((bufapos + 3) > MAX_BUF_ANGLE) { bufapos = 0; } return (bufspos - 1); } void set_circle(int spos, int rpos) { bufcircle[0] = spos; bufcircle[1] = rpos; } void set_ellipse(int r1, int r2, int sp, int inc) { bufellipse[0] = r1; bufellipse[1] = r2; bufellipse[2] = sp; bufellipse[3] = inc; } void set_line(int length) { bufline = length; } void set_euler(int phi, int theta, int psi, char *etype) { int i; unsigned char t = 0; bufeuler[0] = phi; bufeuler[1] = theta; bufeuler[2] = psi; for (i = 0; i < 3; i++) { switch (etype[i]) { case 'x': case 'X': t = EULER_AXIS_X; break; case 'y': case 'Y': t = EULER_AXIS_Y; break; case 'z': case 'Z': t = EULER_AXIS_Z; break; } switch (i) { case 0: bufeulertype.phi = t; break; case 1: bufeulertype.theta = t; break; case 2: bufeulertype.psi = t; break; } } } int get_point(double *lng, double *lat) { if (spheretype == STYPE_POINT) { *lng = bufpoints.p[0].lng; *lat = bufpoints.p[0].lat; return 1; } else { return 0; } } int get_line(double *phi, double *theta, double *psi, unsigned char *etype, double *length) { int i; if (spheretype != STYPE_LINE) { return 0; } *phi = bufangle[bufeuler[0]]; *theta = bufangle[bufeuler[1]]; *psi = bufangle[bufeuler[2]]; for (i = 0; i < 3; i++) { switch (i) { case 0: etype[i] = bufeulertype.phi; break; case 1: etype[i] = bufeulertype.theta; break; case 2: etype[i] = bufeulertype.psi; break; } } *length = bufangle[bufline]; return 1; } int get_euler(double *phi, double *theta, double *psi, unsigned char *etype) { int i; if (spheretype != STYPE_EULER) { return 0; } *phi = bufangle[bufeuler[0]]; *theta = bufangle[bufeuler[1]]; *psi = bufangle[bufeuler[2]]; for (i = 0; i < 3; i++) { switch (i) { case 0: etype[i] = bufeulertype.phi; break; case 1: etype[i] = bufeulertype.theta; break; case 2: etype[i] = bufeulertype.psi; break; } } return 1; } int get_circle(double *lng, double *lat, double *radius) { if (spheretype == STYPE_CIRCLE) { *lng = bufpoints.p[bufcircle[0]].lng; *lat = bufpoints.p[bufcircle[0]].lat; *radius = bufangle[bufcircle[1]]; return 1; } else { return 0; } } int get_ellipse(double *lng, double *lat, double *r1, double *r2, double *inc) { if (spheretype == STYPE_ELLIPSE) { *lng = bufpoints.p[bufellipse[2]].lng; *lat = bufpoints.p[bufellipse[2]].lat; *r1 = bufangle[bufellipse[0]]; *r2 = bufangle[bufellipse[1]]; *inc = bufangle[bufellipse[3]]; return 1; } else { return 0; } } int get_path_count(void) { return (bufspos); } int get_path_elem(int spos, double *lng, double *lat) { if (spheretype == STYPE_PATH) { *lng = bufpoints.p[spos].lng; *lat = bufpoints.p[spos].lat; return 1; } else { return 0; } } int get_box(double *lng1, double *lat1, double *lng2, double *lat2) { if (spheretype == STYPE_BOX) { *lng1 = bufpoints.p[0].lng; *lat1 = bufpoints.p[0].lat; *lng2 = bufpoints.p[1].lng; *lat2 = bufpoints.p[1].lat; return 1; } return 0; } int get_buffer(char *buf, int offset) { int slen = strlen(parse_buffer); if (!parse_buffer || !(slen > 0)) { return 0; } if (slen >= offset) { slen = offset; } memcpy((void *) buf, (void *) parse_buffer, slen); parse_buffer += slen; return slen; } pgsphere-1.5.1/src/sbuffer.h000066400000000000000000000124461461140101500157270ustar00rootroot00000000000000#ifndef __PGS_SBUFFER_H__ #define __PGS_SBUFFER_H__ /* Parser buffer declarations */ #define STYPE_UNKNOWN 0 /* unknown type */ #define STYPE_POINT 1 /* input is spherical type */ #define STYPE_CIRCLE 2 /* input is spherical circle */ #define STYPE_LINE 3 /* input is spherical line */ #define STYPE_EULER 4 /* input is Euler transformation */ #define STYPE_PATH 5 /* input is spherical path or polygon */ #define STYPE_ELLIPSE 6 /* input is spherical ellipse */ #define STYPE_BOX 7 /* input is spherical box */ /* PGS_EULER_AXIS Euler axis */ #define EULER_AXIS_X 1 /* x - axis for Euler transformation */ #define EULER_AXIS_Y 2 /* y - axis for Euler transformation */ #define EULER_AXIS_Z 3 /* z - axis for Euler transformation */ extern int sphere_yylex(); extern void sphere_yyerror(const char *str); extern void sphere_flush_scanner_buffer(void); /* Sets the data type */ extern void set_spheretype(unsigned char st); /* Initialize the input buffer */ extern void init_buffer(char *buffer); /* Resets the input buffer */ extern void reset_buffer(void); /* * Read the "offset" number of bytes from "buf" buffer. * Returns the number of read bytes. */ extern int get_buffer(char *buf, int offset); /* * Input of an angle. When is_deg > 0 then "a" is in degrees, * otherwise it's in radians. Returns the unique ID (position) of the angle. */ extern int set_angle(unsigned char is_deg, double a); /* * Set the sign of an angle. "apos" is the angle. "s" is a sign of the angle * ( < 0 .. - , > 0 .. + ). Returns the unique ID (position) of the angle. */ extern int set_angle_sign(int apos, int s); /* * Creates a spherical point. "lngpos" is the ID of a longitude angle, "latpos" * is the ID of a latitude angle. Returns the unique ID (position) of the spherical * point. */ extern int set_point(int lngpos, int latpos); /* * Creates a spherical circle. "spos" is the ID of a spherical point, "rpos" * is the ID of a radius angle. */ extern void set_circle(int spos, int rpos); /* * Sets the length of a spherical line. "length" is the ID of a length angle. */ extern void set_line(int length); /* * Creates an Euler transformation. "phi" is the ID of a first angle, * "theta" is the ID of a second angle, "psi" is the ID of a third angle, * "etype" is the three letter code of Euler transformation axes. */ extern void set_euler(int phi, int theta, int psi, char *etype); /* * Creates a spherical ellipse. "r1" is the ID of a first radius angle, * "r2" is the ID of a second radius angle, "sp" is the ID of a spherical * point ( center ), "inc" is the ID of an inclination angle. */ extern void set_ellipse(int r1, int r2, int sp, int inc); /* * Returns the point parameters. "lng" is the pointer to a longitude * value, "lat" is the pointer to a latitude value. Returns 0 if user * input is a spherical point. */ extern int get_point(double *lng, double *lat); /* * Returns the circle parameters. "lng" is pointer to a longitude * value of its center, "lat" is pointer to the latitude value of the center, * "radius" is the pointer to the radius value. Returns 0 if user input * is a spherical circle. */ extern int get_circle(double *lng, double *lat, double *radius); /* * Returns the ellipse parameters. "lng" is the pointer to a longitude value * of its center, "lat" is the pointer to a latitude value of the center, "r1" * is the pointer to a first radius value, "r2" is the pointer to a second * radius value, "inc" is the pointer to an inclination angle. Returns 0 if user * input is a spherical ellipse. */ extern int get_ellipse(double *lng, double *lat, double *r1, double *r2, double *inc); /* * Returns the line parameters. "phi" is the pointer to the first angle * of Euler transformation, "theta" is the pointer to the second angle of Euler * transformation, "psi" is the pointer to the third angle of Euler transformation, * "etype" is the pointer to the axes value of Euler transformation, "length" is * the pointer to the length value. Returns 0 if user input is a spherical line. */ extern int get_line(double *phi, double *theta, double *psi, unsigned char *etype, double *length); /* * Returns the Euler transformation parameters. "phi" is the pointer to the * first angle of Euler transformation, "theta" is the pointer to the second * angle of Euler transformation, "psi" is the pointer to the third angle of Euler * transformation, "etype" is the pointer to the axes value of Euler transformation. * Returns 0 if user input is an Euler transformation. */ extern int get_euler(double *phi, double *theta, double *psi, unsigned char *etype); /* * Returns the number of path elements. */ extern int get_path_count(void); /* * Returns the elements of a path. "spos" is the number of element, "lng" is * the ID of longitude angle, "lat" is the ID of a latitude angle. Returns 0 * if user input is a path or a polygon and "spos" is valid. */ extern int get_path_elem(int spos, double *lng, double *lat); /* * Returns the elements of a box. "lng1" is the ID of the first longitude * angle, "lat1" is the ID of the first latitude angle, "lng2" is the ID of * the second longitude angle, "lat2" is the ID of the second latitude angle. * Returns 0 if user input is a box. */ extern int get_box(double *lng1, double *lat1, double *lng2, double *lat2); #endif pgsphere-1.5.1/src/sparse.c000066400000000000000000001541131461140101500155610ustar00rootroot00000000000000/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.4.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Substitute the variable and function names. */ #define yyparse sphere_yyparse #define yylex sphere_yylex #define yyerror sphere_yyerror #define yydebug sphere_yydebug #define yynerrs sphere_yynerrs #define yylval sphere_yylval #define yychar sphere_yychar /* First part of user prologue. */ #line 1 "sparse.y" #include #include #include "postgres.h" #include "utils/elog.h" #include "sbuffer.h" #define YYMALLOC palloc #define YYFREE pfree void sphere_yyerror(const char *str) { reset_buffer(); elog(ERROR, "parsing: %s", str); } static double human2dec(double d, double m, double s) { if (m < 0 || m >= 60 || s < 0 || s >= 60) { char err[255]; sprintf(err, "minutes or seconds invalid (min:%f sec:%f)", m, s); sphere_yyerror(err); return 0; } else { if (d < 0) return (-s / 3600.0 - m / 60.0) + d; else return (s / 3600.0 + m / 60.0) + d; } } #line 114 "sparse.c" # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Use api.header.include to #include this header instead of duplicating it here. */ #ifndef YY_SPHERE_YY_SPARSE_H_INCLUDED # define YY_SPHERE_YY_SPARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int sphere_yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { HOUR = 258, DEG = 259, MIN = 260, SEC = 261, COMMA = 262, OPENCIRC = 263, CLOSECIRC = 264, OPENPOINT = 265, CLOSEPOINT = 266, OPENARR = 267, CLOSEARR = 268, SIGN = 269, INT = 270, FLOAT = 271, EULERAXIS = 272 }; #endif /* Tokens. */ #define HOUR 258 #define DEG 259 #define MIN 260 #define SEC 261 #define COMMA 262 #define OPENCIRC 263 #define CLOSECIRC 264 #define OPENPOINT 265 #define CLOSEPOINT 266 #define OPENARR 267 #define CLOSEARR 268 #define SIGN 269 #define INT 270 #define FLOAT 271 #define EULERAXIS 272 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 41 "sparse.y" int i; double d; char c[3]; #line 197 "sparse.c" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE sphere_yylval; int sphere_yyparse (void); #endif /* !YY_SPHERE_YY_SPARSE_H_INCLUDED */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 31 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 128 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 18 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 16 /* YYNRULES -- Number of rules. */ #define YYNRULES 46 /* YYNSTATES -- Number of states. */ #define YYNSTATES 109 #define YYUNDEFTOK 2 #define YYMAXUTOK 272 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 64, 64, 66, 70, 71, 72, 73, 74, 75, 76, 81, 82, 87, 88, 89, 90, 91, 92, 93, 94, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 114, 115, 120, 121, 127, 135, 143, 147, 155, 163, 164, 168, 173, 181, 182 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "HOUR", "DEG", "MIN", "SEC", "COMMA", "OPENCIRC", "CLOSECIRC", "OPENPOINT", "CLOSEPOINT", "OPENARR", "CLOSEARR", "SIGN", "INT", "FLOAT", "EULERAXIS", "$accept", "commands", "command", "number", "angle_lat_us", "angle_long_us", "angle_long", "angle_lat", "spherepoint", "spherecircle", "eulertrans", "sphereline", "spherepointlist", "spherepath", "sphereellipse", "spherebox", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272 }; # endif #define YYPACT_NINF -18 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-18))) #define YYTABLE_NINF -29 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int8 yypact[] = { 58, 9, 33, -4, -2, 27, 11, 26, -18, -18, -18, 31, 35, -18, -18, -18, -18, -18, -18, 19, 38, 43, 52, 54, 34, 60, -4, -18, 41, 48, -18, -18, 19, -4, 62, 91, 92, -18, 68, 38, 63, -4, 93, -18, 3, 94, -18, -18, 96, 97, -18, 98, -18, 69, 65, -18, 38, 89, 71, 86, 99, 100, -18, 95, 101, -2, -18, -18, 76, 76, -18, 19, 38, 103, 104, -18, 102, -18, -18, 2, 106, -18, -18, -18, -18, 105, 108, 109, 76, -18, 110, 113, 114, 115, -18, -18, 107, 117, -4, 13, 118, -18, -18, 119, 87, 69, 120, 111, -18 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 0, 0, 0, 12, 11, 0, 3, 21, 32, 0, 4, 5, 7, 6, 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 23, 22, 1, 0, 0, 0, 12, 11, 13, 0, 0, 0, 0, 0, 41, 0, 12, 11, 29, 12, 11, 24, 0, 46, 0, 15, 14, 0, 0, 0, 12, 11, 13, 34, 0, 0, 0, 42, 43, 0, 26, 25, 0, 0, 12, 11, 16, 0, 37, 35, 15, 14, 36, 45, 40, 12, 30, 27, 38, 18, 17, 0, 12, 11, 16, 31, 28, 0, 19, 0, 18, 17, 39, 20, 0, 19, 0, 20, 0, 44 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -18, -18, -18, -17, -12, 0, 5, 16, -1, -18, 126, -18, -18, -18, -18, -18 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 7, 8, 9, 62, 10, 51, 63, 12, 13, 14, 15, 26, 16, 17, 18 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 21, 23, 25, 37, 27, 11, 19, 22, 38, -23, 66, 47, 50, 5, 6, 30, 67, 91, 92, 19, -26, 20, 37, 61, 34, 44, 31, 57, 84, 46, 28, 29, 52, 4, 5, 6, 37, 75, 32, 37, 64, 61, 33, 19, 76, 42, 78, 4, 5, 6, 39, 85, 86, 35, 36, 37, 45, 46, 27, 40, 78, 41, 93, 48, 49, 83, 1, 43, 2, 53, 3, 97, 4, 5, 6, 56, 87, 58, 59, 60, 73, 74, 104, 72, 35, 36, 59, 60, 37, 28, 79, 84, 46, 106, -27, 54, 55, 103, 77, 68, 65, 69, 70, 80, 0, 71, 81, -21, 88, 89, 0, 94, 82, -22, 95, 90, 96, 98, 99, 100, 108, 107, -24, 102, 101, -25, 105, -28, 24 }; static const yytype_int8 yycheck[] = { 1, 2, 3, 20, 4, 0, 10, 2, 20, 7, 7, 28, 29, 15, 16, 4, 13, 15, 16, 10, 7, 12, 39, 40, 19, 26, 0, 39, 15, 16, 3, 4, 33, 14, 15, 16, 53, 54, 7, 56, 41, 58, 7, 10, 56, 11, 58, 14, 15, 16, 7, 68, 69, 15, 16, 72, 15, 16, 58, 7, 72, 7, 79, 15, 16, 65, 8, 7, 10, 7, 12, 88, 14, 15, 16, 7, 71, 14, 15, 16, 15, 16, 99, 14, 15, 16, 15, 16, 105, 3, 4, 15, 16, 6, 7, 4, 4, 98, 9, 5, 7, 5, 5, 4, -1, 7, 11, 7, 5, 5, -1, 6, 11, 7, 6, 13, 7, 7, 5, 5, 9, 105, 7, 6, 17, 7, 7, 7, 2 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 8, 10, 12, 14, 15, 16, 19, 20, 21, 23, 24, 26, 27, 28, 29, 31, 32, 33, 10, 12, 26, 24, 26, 28, 26, 30, 23, 3, 4, 4, 0, 7, 7, 24, 15, 16, 21, 22, 7, 7, 7, 11, 7, 26, 15, 16, 21, 15, 16, 21, 24, 26, 7, 4, 4, 7, 22, 14, 15, 16, 21, 22, 25, 26, 7, 7, 13, 5, 5, 5, 7, 14, 15, 16, 21, 22, 9, 22, 4, 4, 11, 11, 23, 15, 21, 21, 24, 5, 5, 13, 15, 16, 21, 6, 6, 7, 21, 7, 5, 5, 17, 6, 26, 21, 7, 6, 25, 9 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 18, 19, 19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 25, 25, 26, 27, 28, 28, 29, 30, 30, 31, 32, 33, 33 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 1, 2, 2, 3, 4, 4, 5, 6, 3, 5, 6, 1, 2, 1, 2, 5, 5, 5, 7, 5, 2, 3, 4, 11, 5, 3 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyo, yytype, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; else goto append; append: default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: #line 70 "sparse.y" { set_spheretype( STYPE_POINT ); } #line 1355 "sparse.c" break; case 5: #line 71 "sparse.y" { set_spheretype( STYPE_CIRCLE ); } #line 1361 "sparse.c" break; case 6: #line 72 "sparse.y" { set_spheretype( STYPE_LINE ); } #line 1367 "sparse.c" break; case 7: #line 73 "sparse.y" { set_spheretype( STYPE_EULER ); } #line 1373 "sparse.c" break; case 8: #line 74 "sparse.y" { set_spheretype( STYPE_PATH ); } #line 1379 "sparse.c" break; case 9: #line 75 "sparse.y" { set_spheretype( STYPE_ELLIPSE ); } #line 1385 "sparse.c" break; case 10: #line 76 "sparse.y" { set_spheretype( STYPE_BOX ); } #line 1391 "sparse.c" break; case 11: #line 81 "sparse.y" { (yyval.d) = (yyvsp[0].d); } #line 1397 "sparse.c" break; case 12: #line 82 "sparse.y" { (yyval.d) = (yyvsp[0].i); } #line 1403 "sparse.c" break; case 13: #line 87 "sparse.y" { (yyval.i) = set_angle(0, (yyvsp[0].d) ); } #line 1409 "sparse.c" break; case 14: #line 88 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].d), 0, 0) ); } #line 1415 "sparse.c" break; case 15: #line 89 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].i), 0, 0) ); } #line 1421 "sparse.c" break; case 16: #line 90 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-2].i), (yyvsp[0].d), 0) ); } #line 1427 "sparse.c" break; case 17: #line 91 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].d), 0) ); } #line 1433 "sparse.c" break; case 18: #line 92 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].i), 0) ); } #line 1439 "sparse.c" break; case 19: #line 93 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d)) ); } #line 1445 "sparse.c" break; case 20: #line 94 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d)) ); } #line 1451 "sparse.c" break; case 21: #line 99 "sparse.y" { (yyval.i) = set_angle(0, (yyvsp[0].d)); } #line 1457 "sparse.c" break; case 22: #line 100 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].d), 0, 0)); } #line 1463 "sparse.c" break; case 23: #line 101 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-1].i), 0, 0)); } #line 1469 "sparse.c" break; case 24: #line 102 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-2].i), (yyvsp[0].d), 0)); } #line 1475 "sparse.c" break; case 25: #line 103 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].d), 0)); } #line 1481 "sparse.c" break; case 26: #line 104 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-3].i), (yyvsp[-1].i), 0)); } #line 1487 "sparse.c" break; case 27: #line 105 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d))); } #line 1493 "sparse.c" break; case 28: #line 106 "sparse.y" { (yyval.i) = set_angle(1, human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d))); } #line 1499 "sparse.c" break; case 29: #line 107 "sparse.y" { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-2].i), (yyvsp[0].d), 0)); } #line 1505 "sparse.c" break; case 30: #line 108 "sparse.y" { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].d))); } #line 1511 "sparse.c" break; case 31: #line 109 "sparse.y" { (yyval.i) = set_angle(1, 15 * human2dec((yyvsp[-5].i), (yyvsp[-3].i), (yyvsp[-1].d))); } #line 1517 "sparse.c" break; case 32: #line 114 "sparse.y" { (yyval.i) = set_angle_sign((yyvsp[0].i), 1); } #line 1523 "sparse.c" break; case 33: #line 115 "sparse.y" { (yyval.i) = set_angle_sign((yyvsp[0].i), (yyvsp[-1].i)); } #line 1529 "sparse.c" break; case 34: #line 120 "sparse.y" { (yyval.i) = set_angle_sign((yyvsp[0].i), 1); } #line 1535 "sparse.c" break; case 35: #line 121 "sparse.y" { (yyval.i) = set_angle_sign((yyvsp[0].i), (yyvsp[-1].i)); } #line 1541 "sparse.c" break; case 36: #line 128 "sparse.y" { (yyval.i) = set_point((yyvsp[-3].i), (yyvsp[-1].i)); } #line 1549 "sparse.c" break; case 37: #line 136 "sparse.y" { set_circle((yyvsp[-3].i), (yyvsp[-1].i)); } #line 1557 "sparse.c" break; case 38: #line 144 "sparse.y" { set_euler((yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].i), "ZXZ"); } #line 1565 "sparse.c" break; case 39: #line 148 "sparse.y" { set_euler((yyvsp[-6].i), (yyvsp[-4].i), (yyvsp[-2].i), (yyvsp[0].c)); } #line 1573 "sparse.c" break; case 40: #line 156 "sparse.y" { set_line ((yyvsp[0].i)); } #line 1581 "sparse.c" break; case 43: #line 168 "sparse.y" { } #line 1587 "sparse.c" break; case 44: #line 174 "sparse.y" { set_ellipse((yyvsp[-8].i), (yyvsp[-6].i), (yyvsp[-3].i), (yyvsp[-1].i)); } #line 1595 "sparse.c" break; case 45: #line 181 "sparse.y" { } #line 1601 "sparse.c" break; case 46: #line 182 "sparse.y" { } #line 1607 "sparse.c" break; #line 1611 "sparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif /*-----------------------------------------------------. | yyreturn -- parsing is finished, return the result. | `-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } pgsphere-1.5.1/src/sparse.h000066400000000000000000000055121461140101500155640ustar00rootroot00000000000000/* A Bison parser, made by GNU Bison 3.4.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ #ifndef YY_SPHERE_YY_SPARSE_H_INCLUDED # define YY_SPHERE_YY_SPARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int sphere_yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { HOUR = 258, DEG = 259, MIN = 260, SEC = 261, COMMA = 262, OPENCIRC = 263, CLOSECIRC = 264, OPENPOINT = 265, CLOSEPOINT = 266, OPENARR = 267, CLOSEARR = 268, SIGN = 269, INT = 270, FLOAT = 271, EULERAXIS = 272 }; #endif /* Tokens. */ #define HOUR 258 #define DEG 259 #define MIN 260 #define SEC 261 #define COMMA 262 #define OPENCIRC 263 #define CLOSECIRC 264 #define OPENPOINT 265 #define CLOSEPOINT 266 #define OPENARR 267 #define CLOSEARR 268 #define SIGN 269 #define INT 270 #define FLOAT 271 #define EULERAXIS 272 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 41 "sparse.y" int i; double d; char c[3]; #line 97 "sparse.h" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE sphere_yylval; int sphere_yyparse (void); #endif /* !YY_SPHERE_YY_SPARSE_H_INCLUDED */ pgsphere-1.5.1/src/sparse.y000066400000000000000000000101501461140101500155770ustar00rootroot00000000000000%{ #include #include #include "postgres.h" #include "utils/elog.h" #include "sbuffer.h" #define YYMALLOC palloc #define YYFREE pfree void sphere_yyerror(const char *str) { reset_buffer(); elog(ERROR, "parsing: %s", str); } static double human2dec(double d, double m, double s) { if (m < 0 || m >= 60 || s < 0 || s >= 60) { char err[255]; sprintf(err, "minutes or seconds invalid (min:%f sec:%f)", m, s); sphere_yyerror(err); return 0; } else { if (d < 0) return (-s / 3600.0 - m / 60.0) + d; else return (s / 3600.0 + m / 60.0) + d; } } %} %token HOUR DEG MIN SEC COMMA %token OPENCIRC CLOSECIRC OPENPOINT CLOSEPOINT %token OPENARR CLOSEARR %union { int i; double d; char c[3]; } %token SIGN %token INT %token FLOAT %token EULERAXIS %left COMMA %type number %type angle_lat %type angle_lat_us %type angle_long %type angle_long_us %type spherepoint %type spherepointlist %type spherepath %% commands: /* empty */ | command ; command: spherepoint { set_spheretype( STYPE_POINT ); } | spherecircle { set_spheretype( STYPE_CIRCLE ); } | sphereline { set_spheretype( STYPE_LINE ); } | eulertrans { set_spheretype( STYPE_EULER ); } | spherepath { set_spheretype( STYPE_PATH ); } | sphereellipse { set_spheretype( STYPE_ELLIPSE ); } | spherebox { set_spheretype( STYPE_BOX ); } ; /* unsigned number */ number : FLOAT { $$ = $1; } | INT { $$ = $1; } ; /* unsigned longitude */ angle_lat_us : number { $$ = set_angle(0, $1 ); } | FLOAT DEG { $$ = set_angle(1, human2dec($1, 0, 0) ); } | INT DEG { $$ = set_angle(1, human2dec($1, 0, 0) ); } | INT DEG number { $$ = set_angle(1, human2dec($1, $3, 0) ); } | INT DEG FLOAT MIN { $$ = set_angle(1, human2dec($1, $3, 0) ); } | INT DEG INT MIN { $$ = set_angle(1, human2dec($1, $3, 0) ); } | INT DEG INT MIN number { $$ = set_angle(1, human2dec($1, $3, $5) ); } | INT DEG INT MIN number SEC { $$ = set_angle(1, human2dec($1, $3, $5) ); } ; /* unsigned latitude */ angle_long_us : number { $$ = set_angle(0, $1); } | FLOAT DEG { $$ = set_angle(1, human2dec($1, 0, 0)); } | INT DEG { $$ = set_angle(1, human2dec($1, 0, 0)); } | INT DEG number { $$ = set_angle(1, human2dec($1, $3, 0)); } | INT DEG FLOAT MIN { $$ = set_angle(1, human2dec($1, $3, 0)); } | INT DEG INT MIN { $$ = set_angle(1, human2dec($1, $3, 0)); } | INT DEG INT MIN number { $$ = set_angle(1, human2dec($1, $3, $5)); } | INT DEG INT MIN number SEC { $$ = set_angle(1, human2dec($1, $3, $5)); } | INT HOUR number { $$ = set_angle(1, 15 * human2dec($1, $3, 0)); } | INT HOUR INT MIN number { $$ = set_angle(1, 15 * human2dec($1, $3, $5)); } | INT HOUR INT MIN number SEC { $$ = set_angle(1, 15 * human2dec($1, $3, $5)); } ; /* longitude */ angle_long : angle_long_us { $$ = set_angle_sign($1, 1); } | SIGN angle_long_us { $$ = set_angle_sign($2, $1); } ; /* latitude */ angle_lat : angle_lat_us { $$ = set_angle_sign($1, 1); } | SIGN angle_lat_us { $$ = set_angle_sign($2, $1); } ; /* spherical point */ spherepoint: OPENPOINT angle_long COMMA angle_lat CLOSEPOINT { $$ = set_point($2, $4); } ; /* spherical circle */ spherecircle: OPENCIRC spherepoint COMMA angle_lat_us CLOSECIRC { set_circle($2, $4); } ; /* Euler transformation */ eulertrans : angle_long COMMA angle_long COMMA angle_long { set_euler($1, $3, $5, "ZXZ"); } | angle_long COMMA angle_long COMMA angle_long COMMA EULERAXIS { set_euler($1, $3, $5, $7); } ; /* spherical line */ sphereline : OPENPOINT eulertrans CLOSEPOINT COMMA angle_long_us { set_line ($5); } ; /* Path and polygons */ spherepointlist : spherepoint COMMA | spherepointlist spherepoint COMMA ; spherepath : OPENARR spherepointlist spherepoint CLOSEARR { } ; /* ellipses */ sphereellipse: OPENCIRC OPENARR angle_lat_us COMMA angle_lat_us CLOSEARR COMMA spherepoint COMMA angle_lat CLOSECIRC { set_ellipse($3, $5, $8, $10); } ; /* boxes */ spherebox: OPENPOINT spherepoint COMMA spherepoint CLOSEPOINT { } | spherepoint COMMA spherepoint { } ; pgsphere-1.5.1/src/sscan.c000066400000000000000000001442111461140101500153710ustar00rootroot00000000000000#line 2 "sscan.c" #line 4 "sscan.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer sphere_create_buffer #define yy_delete_buffer sphere_delete_buffer #define yy_scan_buffer sphere_scan_buffer #define yy_scan_string sphere_scan_string #define yy_scan_bytes sphere_scan_bytes #define yy_init_buffer sphere_init_buffer #define yy_flush_buffer sphere_flush_buffer #define yy_load_buffer_state sphere_load_buffer_state #define yy_switch_to_buffer sphere_switch_to_buffer #define yypush_buffer_state spherepush_buffer_state #define yypop_buffer_state spherepop_buffer_state #define yyensure_buffer_stack sphereensure_buffer_stack #define yy_flex_debug sphere_flex_debug #define yyin spherein #define yyleng sphereleng #define yylex spherelex #define yylineno spherelineno #define yyout sphereout #define yyrestart sphererestart #define yytext spheretext #define yywrap spherewrap #define yyalloc spherealloc #define yyrealloc sphererealloc #define yyfree spherefree #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif #ifdef yy_create_buffer #define sphere_create_buffer_ALREADY_DEFINED #else #define yy_create_buffer sphere_create_buffer #endif #ifdef yy_delete_buffer #define sphere_delete_buffer_ALREADY_DEFINED #else #define yy_delete_buffer sphere_delete_buffer #endif #ifdef yy_scan_buffer #define sphere_scan_buffer_ALREADY_DEFINED #else #define yy_scan_buffer sphere_scan_buffer #endif #ifdef yy_scan_string #define sphere_scan_string_ALREADY_DEFINED #else #define yy_scan_string sphere_scan_string #endif #ifdef yy_scan_bytes #define sphere_scan_bytes_ALREADY_DEFINED #else #define yy_scan_bytes sphere_scan_bytes #endif #ifdef yy_init_buffer #define sphere_init_buffer_ALREADY_DEFINED #else #define yy_init_buffer sphere_init_buffer #endif #ifdef yy_flush_buffer #define sphere_flush_buffer_ALREADY_DEFINED #else #define yy_flush_buffer sphere_flush_buffer #endif #ifdef yy_load_buffer_state #define sphere_load_buffer_state_ALREADY_DEFINED #else #define yy_load_buffer_state sphere_load_buffer_state #endif #ifdef yy_switch_to_buffer #define sphere_switch_to_buffer_ALREADY_DEFINED #else #define yy_switch_to_buffer sphere_switch_to_buffer #endif #ifdef yypush_buffer_state #define spherepush_buffer_state_ALREADY_DEFINED #else #define yypush_buffer_state spherepush_buffer_state #endif #ifdef yypop_buffer_state #define spherepop_buffer_state_ALREADY_DEFINED #else #define yypop_buffer_state spherepop_buffer_state #endif #ifdef yyensure_buffer_stack #define sphereensure_buffer_stack_ALREADY_DEFINED #else #define yyensure_buffer_stack sphereensure_buffer_stack #endif #ifdef yylex #define spherelex_ALREADY_DEFINED #else #define yylex spherelex #endif #ifdef yyrestart #define sphererestart_ALREADY_DEFINED #else #define yyrestart sphererestart #endif #ifdef yylex_init #define spherelex_init_ALREADY_DEFINED #else #define yylex_init spherelex_init #endif #ifdef yylex_init_extra #define spherelex_init_extra_ALREADY_DEFINED #else #define yylex_init_extra spherelex_init_extra #endif #ifdef yylex_destroy #define spherelex_destroy_ALREADY_DEFINED #else #define yylex_destroy spherelex_destroy #endif #ifdef yyget_debug #define sphereget_debug_ALREADY_DEFINED #else #define yyget_debug sphereget_debug #endif #ifdef yyset_debug #define sphereset_debug_ALREADY_DEFINED #else #define yyset_debug sphereset_debug #endif #ifdef yyget_extra #define sphereget_extra_ALREADY_DEFINED #else #define yyget_extra sphereget_extra #endif #ifdef yyset_extra #define sphereset_extra_ALREADY_DEFINED #else #define yyset_extra sphereset_extra #endif #ifdef yyget_in #define sphereget_in_ALREADY_DEFINED #else #define yyget_in sphereget_in #endif #ifdef yyset_in #define sphereset_in_ALREADY_DEFINED #else #define yyset_in sphereset_in #endif #ifdef yyget_out #define sphereget_out_ALREADY_DEFINED #else #define yyget_out sphereget_out #endif #ifdef yyset_out #define sphereset_out_ALREADY_DEFINED #else #define yyset_out sphereset_out #endif #ifdef yyget_leng #define sphereget_leng_ALREADY_DEFINED #else #define yyget_leng sphereget_leng #endif #ifdef yyget_text #define sphereget_text_ALREADY_DEFINED #else #define yyget_text sphereget_text #endif #ifdef yyget_lineno #define sphereget_lineno_ALREADY_DEFINED #else #define yyget_lineno sphereget_lineno #endif #ifdef yyset_lineno #define sphereset_lineno_ALREADY_DEFINED #else #define yyset_lineno sphereset_lineno #endif #ifdef yywrap #define spherewrap_ALREADY_DEFINED #else #define yywrap spherewrap #endif #ifdef yyalloc #define spherealloc_ALREADY_DEFINED #else #define yyalloc spherealloc #endif #ifdef yyrealloc #define sphererealloc_ALREADY_DEFINED #else #define yyrealloc sphererealloc #endif #ifdef yyfree #define spherefree_ALREADY_DEFINED #else #define yyfree spherefree #endif #ifdef yytext #define spheretext_ALREADY_DEFINED #else #define yytext spheretext #endif #ifdef yyleng #define sphereleng_ALREADY_DEFINED #else #define yyleng sphereleng #endif #ifdef yyin #define spherein_ALREADY_DEFINED #else #define yyin spherein #endif #ifdef yyout #define sphereout_ALREADY_DEFINED #else #define yyout sphereout #endif #ifdef yy_flex_debug #define sphere_flex_debug_ALREADY_DEFINED #else #define yy_flex_debug sphere_flex_debug #endif #ifdef yylineno #define spherelineno_ALREADY_DEFINED #else #define yylineno spherelineno #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define spherewrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 20 #define YY_END_OF_BUFFER 21 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_accept[34] = { 0, 0, 0, 21, 19, 18, 18, 9, 7, 14, 15, 1, 11, 19, 2, 12, 13, 19, 6, 5, 8, 10, 16, 17, 18, 3, 0, 2, 0, 0, 0, 4, 3, 0 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 5, 6, 7, 1, 8, 9, 8, 10, 1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 12, 1, 13, 1, 1, 1, 1, 1, 1, 14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 15, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 14, 1, 1, 17, 1, 1, 1, 1, 18, 1, 1, 1, 1, 1, 19, 1, 1, 1, 1, 15, 15, 15, 20, 1, 21, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static const YY_CHAR yy_meta[22] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static const flex_int16_t yy_base[34] = { 0, 0, 0, 43, 44, 20, 22, 44, 44, 44, 44, 44, 44, 31, 16, 44, 44, 26, 44, 44, 44, 44, 44, 44, 26, 20, 29, 22, 31, 23, 26, 44, 24, 44 } ; static const flex_int16_t yy_def[34] = { 0, 33, 1, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 0 } ; static const flex_int16_t yy_nxt[66] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 4, 17, 18, 19, 20, 21, 22, 23, 24, 24, 24, 24, 26, 27, 24, 24, 28, 25, 26, 27, 28, 32, 28, 32, 31, 30, 25, 29, 25, 33, 3, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 } ; static const flex_int16_t yy_chk[66] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 6, 6, 14, 14, 24, 24, 14, 25, 27, 27, 25, 32, 27, 30, 29, 28, 26, 17, 13, 3, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "sscan.l" #line 2 "sscan.l" #include #include "string.h" #include "sparse.h" #include "sbuffer.h" #define YY_DECL int sphere_yylex(void) YY_DECL; #define yylval sphere_yylval #undef YY_INPUT #define YY_NO_INPUT #define YY_INPUT(buf, result, max_size) \ { \ result = get_buffer(buf, max_size); \ result = (result > 0) ? (result) : (YY_NULL); \ } void sphere_flush_scanner_buffer(void) { YY_FLUSH_BUFFER; } #line 749 "sscan.c" #line 750 "sscan.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 35 "sscan.l" #line 967 "sscan.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 34 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 33 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 36 "sscan.l" sphere_yylval.i = (strcmp("-", yytext)) ? (1) : (-1); return SIGN; YY_BREAK case 2: YY_RULE_SETUP #line 37 "sscan.l" sphere_yylval.i = atoi(yytext); return INT; YY_BREAK case 3: YY_RULE_SETUP #line 38 "sscan.l" sphere_yylval.d = atof(yytext); return FLOAT; YY_BREAK case 4: YY_RULE_SETUP #line 39 "sscan.l" memcpy(&sphere_yylval.c[0], yytext, 3); return EULERAXIS; YY_BREAK case 5: YY_RULE_SETUP #line 40 "sscan.l" return HOUR; YY_BREAK case 6: YY_RULE_SETUP #line 41 "sscan.l" return DEG; YY_BREAK case 7: YY_RULE_SETUP #line 42 "sscan.l" return MIN; YY_BREAK case 8: YY_RULE_SETUP #line 43 "sscan.l" return MIN; YY_BREAK case 9: YY_RULE_SETUP #line 44 "sscan.l" return SEC; YY_BREAK case 10: YY_RULE_SETUP #line 45 "sscan.l" return SEC; YY_BREAK case 11: YY_RULE_SETUP #line 46 "sscan.l" return COMMA; YY_BREAK case 12: YY_RULE_SETUP #line 47 "sscan.l" return OPENCIRC; YY_BREAK case 13: YY_RULE_SETUP #line 48 "sscan.l" return CLOSECIRC; YY_BREAK case 14: YY_RULE_SETUP #line 49 "sscan.l" return OPENPOINT; YY_BREAK case 15: YY_RULE_SETUP #line 50 "sscan.l" return CLOSEPOINT; YY_BREAK case 16: YY_RULE_SETUP #line 51 "sscan.l" return OPENARR; YY_BREAK case 17: YY_RULE_SETUP #line 52 "sscan.l" return CLOSEARR; YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP #line 53 "sscan.l" /* discard spaces */ YY_BREAK case 19: YY_RULE_SETUP #line 54 "sscan.l" /* alert parser of the garbage */ YY_BREAK case 20: YY_RULE_SETUP #line 55 "sscan.l" ECHO; YY_BREAK #line 1121 "sscan.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 34 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 34 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 33); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 55 "sscan.l" pgsphere-1.5.1/src/sscan.l000066400000000000000000000022111461140101500153730ustar00rootroot00000000000000%{ #include #include "string.h" #include "sparse.h" #include "sbuffer.h" #define YY_DECL int sphere_yylex(void) YY_DECL; #define yylval sphere_yylval #undef YY_INPUT #define YY_NO_INPUT #define YY_INPUT(buf, result, max_size) \ { \ result = get_buffer(buf, max_size); \ result = (result > 0) ? (result) : (YY_NULL); \ } void sphere_flush_scanner_buffer(void) { YY_FLUSH_BUFFER; } %} %option 8bit %option never-interactive %option nounput %option noyywrap int [0-9]+ sign [+-] real ({int})?\.({int}) float ({int}|{real})([eE]{sign}{int})? %% {sign} sphere_yylval.i = (strcmp("-", yytext)) ? (1) : (-1); return SIGN; {int} sphere_yylval.i = atoi(yytext); return INT; {float} sphere_yylval.d = atof(yytext); return FLOAT; [x-zX-Z]{3} memcpy(&sphere_yylval.c[0], yytext, 3); return EULERAXIS; h return HOUR; d return DEG; ' return MIN; m return MIN; \" return SEC; s return SEC; , return COMMA; \< return OPENCIRC; \> return CLOSECIRC; \( return OPENPOINT; \) return CLOSEPOINT; \{ return OPENARR; \} return CLOSEARR; [ \n\t]+ /* discard spaces */ . /* alert parser of the garbage */ %% pgsphere-1.5.1/src/types.h000066400000000000000000000011011461140101500154210ustar00rootroot00000000000000#ifndef __PGS_TYPES_H__ #define __PGS_TYPES_H__ /* Include this file if you want to have access to all data types. */ /* * box was the last added data type */ #include "box.h" /* PGS_DATA_TYPES Data type IDs */ #define PGS_TYPE_SPoint 1 /* Spherical point */ #define PGS_TYPE_SCIRCLE 2 /* Spherical circle */ #define PGS_TYPE_SELLIPSE 3 /* Spherical ellipse */ #define PGS_TYPE_SLine 4 /* Spherical line */ #define PGS_TYPE_SPATH 5 /* Spherical path */ #define PGS_TYPE_SPOLY 6 /* Spherical polygon */ #define PGS_TYPE_SBOX 7 /* Spherical box */ #endif pgsphere-1.5.1/src/vector3d.c000066400000000000000000000015431461140101500160130ustar00rootroot00000000000000#include "vector3d.h" /* Vector functions */ bool vector3d_eq(const Vector3D *v1, const Vector3D *v2) { return (FPeq(v1->x, v2->x) && FPeq(v1->y, v2->y) && FPeq(v1->z, v2->z)); } void vector3d_cross(Vector3D *out, const Vector3D *v1, const Vector3D *v2) { out->x = v1->y * v2->z - v1->z * v2->y; out->y = v1->z * v2->x - v1->x * v2->z; out->z = v1->x * v2->y - v1->y * v2->x; } void vector3d_addwithscalar(Vector3D *result, double scalar, const Vector3D *delta) { result->x = result->x + delta->x * scalar; result->y = result->y + delta->y * scalar; result->z = result->z + delta->z * scalar; } float8 vector3d_scalar(Vector3D *v1, Vector3D *v2) { float8 out = 0; out += v1->x * v2->x; out += v1->y * v2->y; out += v1->z * v2->z; return (out); } float8 vector3d_length(const Vector3D *v) { return sqrt(Sqr(v->x) + Sqr(v->y) + Sqr(v->z)); } pgsphere-1.5.1/src/vector3d.h000066400000000000000000000017431461140101500160220ustar00rootroot00000000000000#ifndef __PGS_VECTOR3D_H__ #define __PGS_VECTOR3D_H__ #include "pg_sphere.h" /* Vector declarations */ /* * The definition of a three dimensional vector data structure. */ typedef struct { float8 x; /* x (-1.0 .. 1.0) */ float8 y; /* y (-1.0 .. 1.0) */ float8 z; /* z (-1.0 .. 1.0) */ } Vector3D; /* * Calculate the cross product of two vectors. Puts * cross product of v1 and v2 into out and returns it. */ extern void vector3d_cross(Vector3D *out, const Vector3D *v1, const Vector3D *v2); /* * Checks equality of two vectors. */ extern bool vector3d_eq(const Vector3D *a, const Vector3D *b); /* * Calculate the scalar product of two vectors. */ extern float8 vector3d_scalar(Vector3D *v1, Vector3D *v2); /* * Calculate the length of a vector. */ extern float8 vector3d_length(const Vector3D *v); /* * Calculate result + scalar*delta */ extern void vector3d_addwithscalar(Vector3D *result, double scalar, const Vector3D *delta); #endif pgsphere-1.5.1/testsuite/000077500000000000000000000000001461140101500153555ustar00rootroot00000000000000pgsphere-1.5.1/testsuite/circle_test.expected000066400000000000000000000440051461140101500214030ustar00rootroot00000000000000-- Input/Output --- SELECT set_sphere_output( RAD ); set_sphere_output ------------------- SET RAD (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1.0d > scircle ----------------------------------------------------------------- <(0.272707695624114 , 0.0181805130416076) , 0.0174532925199433> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1d 30m > scircle ----------------------------------------------------------------- <(0.272707695624114 , 0.0181805130416076) , 0.0261799387799149> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 0.1 > scircle -------------------------------------------------- <(0.272707695624114 , 0.0181805130416076) , 0.1> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 90d > scircle -------------------------------------------------------------- <(0.272707695624114 , 0.0181805130416076) , 1.5707963267949> (1 row) SELECT set_sphere_output( DEG ); set_sphere_output ------------------- SET DEG (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1.0d > scircle -------------------------------------- <(15.625d , 1.04166666666667d) , 1d> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1d 30m > scircle ---------------------------------------- <(15.625d , 1.04166666666667d) , 1.5d> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 0.1 > scircle ----------------------------------------------------- <(15.625d , 1.04166666666667d) , 5.72957795130823d> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 90d > scircle --------------------------------------- <(15.625d , 1.04166666666667d) , 90d> (1 row) SELECT set_sphere_output( DMS ); set_sphere_output ------------------- SET DMS (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1.0d > scircle ---------------------------------------------- <( 15d 37m 30s , + 1d 2m 30s) , 1d 0m 0s> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1d 30m > scircle ---------------------------------------------- <( 15d 37m 30s , + 1d 2m 30s) , 1d 30m 0s> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 0.1 > scircle ------------------------------------------------------ <( 15d 37m 30s , + 1d 2m 30s) , 5d 43m 46.480625s> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 90d > scircle ---------------------------------------------- <( 15d 37m 30s , + 1d 2m 30s) , 90d 0m 0s> (1 row) SELECT set_sphere_output( HMS ); set_sphere_output ------------------- SET HMS (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1.0d > scircle ---------------------------------------------- <( 1h 2m 30s , + 1d 2m 30s) , 1d 0m 0s> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 1d 30m > scircle ---------------------------------------------- <( 1h 2m 30s , + 1d 2m 30s) , 1d 30m 0s> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 0.1 > scircle ------------------------------------------------------ <( 1h 2m 30s , + 1d 2m 30s) , 5d 43m 46.480625s> (1 row) SELECT < (1h 2m 30s , +1d 2m 30s), 90d > scircle ---------------------------------------------- <( 1h 2m 30s , + 1d 2m 30s) , 90d 0m 0s> (1 row) SELECT set_sphere_output( DMS ); set_sphere_output ------------------- SET DMS (1 row) -- Functions -- float8 dist(scircle,scircle) SELECT 180.0*dist('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle,'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); ?column? ---------- 19.8 (1 row) SELECT 180.0*dist('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 13 (1 row) SELECT 180.0*dist('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 20 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ------------------- 0.499999999999953 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 0 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 87 (1 row) SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 178 (1 row) -- spoint spoint(scircle) SELECT spoint('< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle); spoint ------------------------------- ( 15d 37m 30s , + 1d 2m 30s) (1 row) SELECT spoint('< (1h 2m 30s , +90d 0m 0s), 1.0d >'::scircle); spoint ------------------------------ ( 15d 37m 30s , +90d 0m 0s) (1 row) -- scircle scircle(spoint) SELECT scircle('(0d,0d)'::spoint); scircle -------------------------------------------- <( 0d 0m 0s , + 0d 0m 0s) , 0d 0m 0s> (1 row) SELECT scircle('(0d,90d)'::spoint); scircle -------------------------------------------- <( 0d 0m 0s , +90d 0m 0s) , 0d 0m 0s> (1 row) SELECT scircle('(0d,-90d)'::spoint); scircle -------------------------------------------- <( 0d 0m 0s , -90d 0m 0s) , 0d 0m 0s> (1 row) -- Operators -- = operator -- should be "true" SELECT < (1h 0m 0s,+1d), 1.5d > (1h 0m 0s,+1d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+1d), 1.5d > (25h 0m 0s,+1d), 1d 30m >'::scircle ; ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+95d), 1.5d > (13h 0m 0s,+85d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT < (1h 0m 0s,-95d), 1.5d > (13h 0m 0s,-85d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+90d), 1.5d > (2h 0m 0s,+90d), 1.5d >'::scircle ; ?column? ---------- t (1 row) SELECT < (1h 0m 0s,-90d), 1.5d > (2h 0m 0s,-90d), 1.5d >'::scircle ; ?column? ---------- t (1 row) -- should be "false" SELECT < (1h 0m 0s,+1d), 1.5d > (1h 0m 0s,-1d), 1.5d >'::scircle ; ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+1d), 1.5d > (1h 0m 0s,+1d), 2.5d >'::scircle ; ?column? ---------- f (1 row) -- <> operator -- should be "false" SELECT < (1h 0m 0s,+1d), 1.5d > <> < (1h 0m 0s,+1d), 1.5d > ; ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+1d), 1.5d > <> < (25h 0m 0s,+1d), 1d 30m > ; ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+95d), 1.5d > <> < (13h 0m 0s,+85d), 1.5d > ; ?column? ---------- f (1 row) SELECT < (1h 0m 0s,-95d), 1.5d > <> < (13h 0m 0s,-85d), 1.5d > ; ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+90d), 1.5d > <> < (2h 0m 0s,+90d), 1.5d > ; ?column? ---------- f (1 row) SELECT < (1h 0m 0s,-90d), 1.5d > <> < (2h 0m 0s,-90d), 1.5d > ; ?column? ---------- f (1 row) -- should be "true" SELECT < (1h 0m 0s,+1d), 1.5d > <> < (1h 0m 0s,-1d), 1.5d > ; ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+1d), 1.5d > <> < (1h 0m 0s,+1d), 2.5d > ; ?column? ---------- t (1 row) -- && operator -- should be "true" SELECT < (1h 0m 0s,+1d), 1.5d > && < (1h 0m 0s,+1d), 1.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+1d), 1.5d > && < (1h 0m 0s,+1d), 0.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+1d), 1.5d > && < (1h 0m 0s,-1d), 1.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,0d), 15d > && < (0h 0m 0s,0d), 15d > ?column? ---------- t (1 row) SELECT < (2h 0m 0s,0d), 15d > && < (0h 0m 0.1s,0d), 15d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,0d), 15d > && < (23h 0m 0.1s,0d), 15d > ?column? ---------- t (1 row) -- should be "false" SELECT < (1h 0m 0s,+1d), 0.5d > && < (1h 0m 0s,-1d), 0.5d > ?column? ---------- f (1 row) SELECT < (1d 0m 0s,+1d), 1.0d > && < (0d 0m 0s,0d), 0.1d > ?column? ---------- f (1 row) -- @@ operator SELECT @@ < (1h 2m 3s , +1d 2m 3s), 1.0d > ?column? ------------------------------ ( 15d 30m 45s , + 1d 2m 3s) (1 row) SELECT @@ < (1h 2m 3s , +90d 0m 0s), 1.0d > ?column? ------------------------------ ( 15d 30m 45s , +90d 0m 0s) (1 row) -- <-> operator SELECT 180.0*('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle<->'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); ?column? ---------- 19.8 (1 row) SELECT 180.0*('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 13 (1 row) SELECT 180.0*('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 20 (1 row) SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); ?column? ------------------- 0.499999999999953 (1 row) SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 0 (1 row) SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); ?column? ---------- 87 (1 row) SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); ?column? ---------- 178 (1 row) -- scircle @ scircle operator -- should be "true" SELECT < (1h 0m 0s,+1d), 0.5d > @ < (1h 0m 0s,+1d), 1.5d > ?column? ---------- t (1 row) SELECT < (2d 0m 0s,+1d), 0.5d > @ < (1d 0m 0s,0d), 3.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+89d), 0.5d > @ < (1h 0m 0s,+90d), 1.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,-89d), 0.5d > @ < (1h 0m 0s,-90d), 1.5d > ?column? ---------- t (1 row) -- should be "false" SELECT < (1h 0m 0s,+1d), 0.5d > @ < (2h 0m 0s,+1d), 1.5d > ?column? ---------- f (1 row) SELECT < (2d 0m 0s,+1d), 1.5d > @ < (0d 0m 0s, 0d), 3.5d > ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+89d), 0.5d > @ < (1h 0m 0s,+90d), 1.0d > ?column? ---------- f (1 row) SELECT < (1h 0m 0s,-89d), 0.5d > @ < (1h 0m 0s,-90d), 1.0d > ?column? ---------- f (1 row) -- scircle ~ scircle operator -- should be "true" SELECT < (1h 0m 0s,+1d), 1.5d > ~ < (1h 0m 0s,+1d), 0.5d > ?column? ---------- t (1 row) SELECT < (1d 0m 0s,0d), 3.5d > ~ < (2d 0m 0s,+1d), 0.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+90d), 1.5d > ~ < (1h 0m 0s,+89d), 0.5d > ?column? ---------- t (1 row) SELECT < (1h 0m 0s,-90d), 1.5d > ~ < (1h 0m 0s,-89d), 0.5d > ?column? ---------- t (1 row) -- should be "false" SELECT < (2h 0m 0s,+1d), 1.5d > ~ < (1h 0m 0s,+1d), 0.5d > ?column? ---------- f (1 row) SELECT < (0d 0m 0s, 0d), 3.5d > ~ < (2d 0m 0s,+1d), 1.5d > ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+90d), 1.0d > ~ < (1h 0m 0s,+89d), 0.5d > ?column? ---------- f (1 row) SELECT < (1h 0m 0s,-90d), 1.0d > ~ < (1h 0m 0s,-89d), 0.5d > ?column? ---------- f (1 row) -- spoint @ scircle operator -- should be "true" SELECT (1h 0m 0s,+1d) @ < (1h 0m 0s,+1d), 1.5d > ?column? ---------- t (1 row) SELECT (2d 0m 0s,+1d) @ < (1d 0m 0s, 0d), 3.5d > ?column? ---------- t (1 row) SELECT (1h 0m 0s,+89d) @ < (1h 0m 0s,+90d), 1.5d > ?column? ---------- t (1 row) SELECT (1h 0m 0s,-89d) @ < (1h 0m 0s,-90d), 1.5d > ?column? ---------- t (1 row) SELECT (1h 0m 0s,+89d) @ < (1h 0m 0s,+90d), 1.0d > ?column? ---------- t (1 row) SELECT (1h 0m 0s,-89d) @ < (1h 0m 0s,-90d), 1.0d > ?column? ---------- t (1 row) -- should be "false" SELECT (1h 0m 0s,+1d ) @ < (2h 0m 0s,-1d), 1.5d > ?column? ---------- f (1 row) SELECT (3d 30m 0s,+1d ) @ < (0d 0m 0s, 0d), 3.5d > ?column? ---------- f (1 row) SELECT (1h 0m 0s,+88.99d) @ < (1h 0m 0s,+90d), 1.0d > ?column? ---------- f (1 row) SELECT (1h 0m 0s,-88.99d) @ < (1h 0m 0s,-90d), 1.0d > ?column? ---------- f (1 row) -- spoint ~ scircle operator -- should be "true" SELECT < (1h 0m 0s,+1d), 1.5d > ~ (1h 0m 0s,+1d) ?column? ---------- t (1 row) SELECT < (1d 0m 0s, 0d), 3.5d > ~ (2d 0m 0s,+1d) ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+90d), 1.5d > ~ (1h 0m 0s,+89d) ?column? ---------- t (1 row) SELECT < (1h 0m 0s,-90d), 1.5d > ~ (1h 0m 0s,-89d) ?column? ---------- t (1 row) SELECT < (1h 0m 0s,+90d), 1.0d > ~ (1h 0m 0s,+89d) ?column? ---------- t (1 row) SELECT < (1h 0m 0s,-90d), 1.0d > ~ (1h 0m 0s,-89d) ?column? ---------- t (1 row) -- should be "false" SELECT < (2h 0m 0s,-1d), 1.5d > ~ (1h 0m 0s,+1d ) ?column? ---------- f (1 row) SELECT < (0d 0m 0s, 0d), 3.5d > ~ (3d 30m 0s,+1d ) ?column? ---------- f (1 row) SELECT < (1h 0m 0s,+90d), 1.0d > ~ (1h 0m 0s,+88.99d) ?column? ---------- f (1 row) SELECT < (1h 0m 0s,-90d), 1.0d > ~ (1h 0m 0s,-88.99d) ?column? ---------- f (1 row) -- indexed operations..... -- spoint_data and scircle_data tables have to be created and indexed using -- ./gen_point.pl 1 | psql pgsphere_test -- and -- ./gen_circle.pl 1 0.1 | psql pgsphere_test -- scripts SET enable_indexscan=off; SET select count(sp) from spoint_data where sp @ <(0d,90d),1.0d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,90d),1.0d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,90d),1.1d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,90d),1.1d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,-90d),1.0d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,-90d),1.0d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,-90d),1.1d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,-90d),1.1d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,0d),2.1d> count ------- 13 (1 row) select count(sp) from spoint_data where <(0d,0d),2.1d> ~ sp; count ------- 13 (1 row) select count(sc) from scircle_data where sc && <(0d,90d),1.0d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,90d),1.0d> ; count ------- 1 (1 row) select count(sc) from scircle_data where <(0d,90d),1.0d> ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && <(0d,90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where <(0d,90d),1.1d> ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && <(0d,-90d),1.0d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,-90d),1.0d> ; count ------- 1 (1 row) select count(sc) from scircle_data where <(0d,-90d),1.0d> ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && <(0d,-90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,-90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where <(0d,-90d),1.1d> ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && <(0d,0d),2.1d> count ------- 13 (1 row) select count(sc) from scircle_data where sc @ <(0d,0d),2.1d> count ------- 13 (1 row) select count(sc) from scircle_data where <(0d,0d),2.1d> ~ sc; count ------- 13 (1 row) SET enable_indexscan=on; SET select count(sp) from spoint_data where sp @ <(0d,90d),1.0d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,90d),1.0d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,90d),1.1d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,90d),1.1d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,-90d),1.0d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,-90d),1.0d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,-90d),1.1d> count ------- 361 (1 row) select count(sp) from spoint_data where <(0d,-90d),1.1d> ~ sp; count ------- 361 (1 row) select count(sp) from spoint_data where sp @ <(0d,0d),2.1d> count ------- 13 (1 row) select count(sp) from spoint_data where <(0d,0d),2.1d> ~ sp; count ------- 13 (1 row) select count(sc) from scircle_data where sc && <(0d,90d),1.0d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,90d),1.0d> ; count ------- 1 (1 row) select count(sc) from scircle_data where <(0d,90d),1.0d> ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && <(0d,90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where <(0d,90d),1.1d> ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && <(0d,-90d),1.0d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,-90d),1.0d> ; count ------- 1 (1 row) select count(sc) from scircle_data where <(0d,-90d),1.0d> ~ sc; count ------- 1 (1 row) select count(sc) from scircle_data where sc && <(0d,-90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where sc @ <(0d,-90d),1.1d> ; count ------- 361 (1 row) select count(sc) from scircle_data where <(0d,-90d),1.1d> ~ sc; count ------- 361 (1 row) select count(sc) from scircle_data where sc && <(0d,0d),2.1d> count ------- 13 (1 row) select count(sc) from scircle_data where sc @ <(0d,0d),2.1d> count ------- 13 (1 row) select count(sc) from scircle_data where <(0d,0d),2.1d> ~ sc; count ------- 13 (1 row) pgsphere-1.5.1/testsuite/circle_test.sql000066400000000000000000000623561461140101500204120ustar00rootroot00000000000000\echo -- Input/Output --- -- Input/Output --- \echo SELECT set_sphere_output( 'RAD' ); SELECT set_sphere_output( 'RAD' ); \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; \echo SELECT set_sphere_output( 'DEG' ); SELECT set_sphere_output( 'DEG' ); \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; \echo SELECT set_sphere_output( 'DMS' ); SELECT set_sphere_output( 'DMS' ); \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; \echo SELECT set_sphere_output( 'HMS' ); SELECT set_sphere_output( 'HMS' ); \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 1d 30m >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 0.1 >'::scircle; \echo SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; SELECT '< (1h 2m 30s , +1d 2m 30s), 90d >'::scircle; \echo SELECT set_sphere_output( 'DMS' ); SELECT set_sphere_output( 'DMS' ); \echo \echo -- Functions -- Functions \echo \echo -- float8 dist(scircle,scircle) -- float8 dist(scircle,scircle) \echo SELECT 180.0*dist('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle,'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle,'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); \echo SELECT 180.0*dist('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); \echo SELECT 180.0*dist('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*dist('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); \echo SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); \echo SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); \echo SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle,'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); \echo SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*dist('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle,'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); \echo \echo -- spoint spoint(scircle) -- spoint spoint(scircle) \echo SELECT spoint('< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle); SELECT spoint('< (1h 2m 30s , +1d 2m 30s), 1.0d >'::scircle); \echo SELECT spoint('< (1h 2m 30s , +90d 0m 0s), 1.0d >'::scircle); SELECT spoint('< (1h 2m 30s , +90d 0m 0s), 1.0d >'::scircle); \echo \echo -- scircle scircle(spoint) -- scircle scircle(spoint) \echo SELECT scircle('(0d,0d)'::spoint); SELECT scircle('(0d,0d)'::spoint); \echo SELECT scircle('(0d,90d)'::spoint); SELECT scircle('(0d,90d)'::spoint); \echo SELECT scircle('(0d,-90d)'::spoint); SELECT scircle('(0d,-90d)'::spoint); \echo \echo -- Operators -- Operators \echo -- = operator -- = operator \echo -- should be "true" -- should be "true" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (25h 0m 0s,+1d), 1d 30m >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (25h 0m 0s,+1d), 1d 30m >'::scircle ; \echo SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle='< (13h 0m 0s,+85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle='< (13h 0m 0s,+85d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle='< (13h 0m 0s,-85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle='< (13h 0m 0s,-85d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle='< (2h 0m 0s,+90d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle='< (2h 0m 0s,+90d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle='< (2h 0m 0s,-90d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle='< (2h 0m 0s,-90d), 1.5d >'::scircle ; \echo -- should be "false" -- should be "false" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,-1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,-1d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 2.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle='< (1h 0m 0s,+1d), 2.5d >'::scircle ; \echo \echo -- <> operator -- <> operator \echo -- should be "false" -- should be "false" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (25h 0m 0s,+1d), 1d 30m >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (25h 0m 0s,+1d), 1d 30m >'::scircle ; \echo SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle <> '< (13h 0m 0s,+85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+95d), 1.5d >'::scircle <> '< (13h 0m 0s,+85d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle <> '< (13h 0m 0s,-85d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-95d), 1.5d >'::scircle <> '< (13h 0m 0s,-85d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle <> '< (2h 0m 0s,+90d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle <> '< (2h 0m 0s,+90d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle <> '< (2h 0m 0s,-90d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle <> '< (2h 0m 0s,-90d), 1.5d >'::scircle ; \echo -- should be "true" -- should be "true" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,-1d), 1.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,-1d), 1.5d >'::scircle ; \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 2.5d >'::scircle ; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle <> '< (1h 0m 0s,+1d), 2.5d >'::scircle ; \echo \echo -- && operator -- && operator \echo -- should be "true" -- should be "true" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 1.5d >'::scircle; \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,+1d), 0.5d >'::scircle; \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,-1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle && '< (1h 0m 0s,-1d), 1.5d >'::scircle; \echo SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0s,0d), 15d >'::scircle; SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0s,0d), 15d >'::scircle; \echo SELECT '< (2h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0.1s,0d), 15d >'::scircle; SELECT '< (2h 0m 0s,0d), 15d >'::scircle && '< (0h 0m 0.1s,0d), 15d >'::scircle; \echo SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (23h 0m 0.1s,0d), 15d >'::scircle; SELECT '< (1h 0m 0s,0d), 15d >'::scircle && '< (23h 0m 0.1s,0d), 15d >'::scircle; \echo -- should be "false" -- should be "false" \echo SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle && '< (1h 0m 0s,-1d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle && '< (1h 0m 0s,-1d), 0.5d >'::scircle; \echo SELECT '< (1d 0m 0s,+1d), 1.0d >'::scircle && '< (0d 0m 0s,0d), 0.1d >'::scircle; SELECT '< (1d 0m 0s,+1d), 1.0d >'::scircle && '< (0d 0m 0s,0d), 0.1d >'::scircle; \echo \echo -- @@ operator -- @@ operator \echo SELECT @@ '< (1h 2m 3s , +1d 2m 3s), 1.0d >'::scircle; SELECT @@ '< (1h 2m 3s , +1d 2m 3s), 1.0d >'::scircle; \echo SELECT @@ '< (1h 2m 3s , +90d 0m 0s), 1.0d >'::scircle; SELECT @@ '< (1h 2m 3s , +90d 0m 0s), 1.0d >'::scircle; \echo \echo -- <-> operator -- <-> operator \echo SELECT 180.0*('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle<->'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); SELECT 180.0*('<( 0h 2m 30s , 10d 0m 0s), 0.1d>'::scircle<->'<( 0h 2m 30s , -10d 0m 0s),0.1d>'::scircle)/pi(); \echo SELECT 180.0*('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*('<( 0h 0m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); \echo SELECT 180.0*('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*('<( 23h 30m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 1h 0m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); \echo SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.0d>'::scircle)/pi(); \echo SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 0d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); \echo SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.5d>'::scircle<->'<( 0h 50m 00s , 0d 0m 0s),1.5d>'::scircle)/pi(); \echo SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); SELECT 180.0*('<( 0h 40m 00s , 90d 0m 0s), 1.0d>'::scircle<->'<( 0h 50m 00s , -90d 0m 0s),1.0d>'::scircle)/pi(); \echo \echo -- scircle @ scircle operator -- scircle @ scircle operator \echo -- should be "true" -- should be "true" \echo SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; \echo SELECT '< (2d 0m 0s,+1d), 0.5d >'::scircle @ '< (1d 0m 0s,0d), 3.5d >'::scircle; SELECT '< (2d 0m 0s,+1d), 0.5d >'::scircle @ '< (1d 0m 0s,0d), 3.5d >'::scircle; \echo SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; \echo SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; \echo -- should be "false" -- should be "false" \echo SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (2h 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 0.5d >'::scircle @ '< (2h 0m 0s,+1d), 1.5d >'::scircle; \echo SELECT '< (2d 0m 0s,+1d), 1.5d >'::scircle @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; SELECT '< (2d 0m 0s,+1d), 1.5d >'::scircle @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; \echo SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; SELECT '< (1h 0m 0s,+89d), 0.5d >'::scircle @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; \echo SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; SELECT '< (1h 0m 0s,-89d), 0.5d >'::scircle @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; \echo \echo -- scircle ~ scircle operator -- scircle ~ scircle operator \echo -- should be "true" -- should be "true" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; \echo SELECT '< (1d 0m 0s,0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (1d 0m 0s,0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 0.5d >'::scircle; \echo SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; \echo SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; \echo -- should be "false" -- should be "false" \echo SELECT '< (2h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; SELECT '< (2h 0m 0s,+1d), 1.5d >'::scircle ~ '< (1h 0m 0s,+1d), 0.5d >'::scircle; \echo SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 1.5d >'::scircle; SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '< (2d 0m 0s,+1d), 1.5d >'::scircle; \echo SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '< (1h 0m 0s,+89d), 0.5d >'::scircle; \echo SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '< (1h 0m 0s,-89d), 0.5d >'::scircle; \echo \echo -- spoint @ scircle operator -- spoint @ scircle operator \echo -- should be "true" -- should be "true" \echo SELECT '(1h 0m 0s,+1d) '::spoint @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; SELECT '(1h 0m 0s,+1d) '::spoint @ '< (1h 0m 0s,+1d), 1.5d >'::scircle; \echo SELECT '(2d 0m 0s,+1d) '::spoint @ '< (1d 0m 0s, 0d), 3.5d >'::scircle; SELECT '(2d 0m 0s,+1d) '::spoint @ '< (1d 0m 0s, 0d), 3.5d >'::scircle; \echo SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.5d >'::scircle; \echo SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.5d >'::scircle; \echo SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; SELECT '(1h 0m 0s,+89d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; \echo SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; SELECT '(1h 0m 0s,-89d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; \echo -- should be "false" -- should be "false" \echo SELECT '(1h 0m 0s,+1d )'::spoint @ '< (2h 0m 0s,-1d), 1.5d >'::scircle; SELECT '(1h 0m 0s,+1d )'::spoint @ '< (2h 0m 0s,-1d), 1.5d >'::scircle; \echo SELECT '(3d 30m 0s,+1d )'::spoint @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; SELECT '(3d 30m 0s,+1d )'::spoint @ '< (0d 0m 0s, 0d), 3.5d >'::scircle; \echo SELECT '(1h 0m 0s,+88.99d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; SELECT '(1h 0m 0s,+88.99d)'::spoint @ '< (1h 0m 0s,+90d), 1.0d >'::scircle; \echo SELECT '(1h 0m 0s,-88.99d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; SELECT '(1h 0m 0s,-88.99d)'::spoint @ '< (1h 0m 0s,-90d), 1.0d >'::scircle; \echo \echo -- spoint ~ scircle operator -- spoint ~ scircle operator \echo -- should be "true" -- should be "true" \echo SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d) '::spoint; SELECT '< (1h 0m 0s,+1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d) '::spoint; \echo SELECT '< (1d 0m 0s, 0d), 3.5d >'::scircle ~ '(2d 0m 0s,+1d) '::spoint; SELECT '< (1d 0m 0s, 0d), 3.5d >'::scircle ~ '(2d 0m 0s,+1d) '::spoint; \echo SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; SELECT '< (1h 0m 0s,+90d), 1.5d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; \echo SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; SELECT '< (1h 0m 0s,-90d), 1.5d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; \echo SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+89d)'::spoint; \echo SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-89d)'::spoint; \echo -- should be "false" -- should be "false" \echo SELECT '< (2h 0m 0s,-1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d )'::spoint; SELECT '< (2h 0m 0s,-1d), 1.5d >'::scircle ~ '(1h 0m 0s,+1d )'::spoint; \echo SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '(3d 30m 0s,+1d )'::spoint; SELECT '< (0d 0m 0s, 0d), 3.5d >'::scircle ~ '(3d 30m 0s,+1d )'::spoint; \echo SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+88.99d)'::spoint; SELECT '< (1h 0m 0s,+90d), 1.0d >'::scircle ~ '(1h 0m 0s,+88.99d)'::spoint; \echo SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-88.99d)'::spoint; SELECT '< (1h 0m 0s,-90d), 1.0d >'::scircle ~ '(1h 0m 0s,-88.99d)'::spoint; \echo \echo -- indexed operations..... -- indexed operations..... \echo -- spoint_data and scircle_data tables have to be created and indexed using -- spoint_data and scircle_data tables have to be created and indexed using \echo -- ./gen_point.pl 1 | psql pgsphere_test -- ./gen_point.pl 1 | psql pgsphere_test \echo -- and -- and \echo -- ./gen_circle.pl 1 0.1 | psql pgsphere_test -- ./gen_circle.pl 1 0.1 | psql pgsphere_test \echo -- scripts -- scripts \echo \echo SET enable_indexscan=off; SET enable_indexscan=off; \echo select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; \echo \echo select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; \echo select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; \echo select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; \echo select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; \echo select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; \echo select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; \echo select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; \echo \echo SET enable_indexscan=on; SET enable_indexscan=on; \echo select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,90d),1.0d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,90d),1.0d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,90d),1.1d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,90d),1.1d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.0d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,-90d),1.0d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,-90d),1.1d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,-90d),1.1d>'::scircle ~ sp; \echo select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; select count(sp) from spoint_data where sp @ '<(0d,0d),2.1d>'::scircle; \echo select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; select count(sp) from spoint_data where '<(0d,0d),2.1d>'::scircle ~ sp; \echo \echo select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; select count(sc) from scircle_data where sc && '<(0d,90d),1.0d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.0d>'; \echo select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; select count(sc) from scircle_data where '<(0d,90d),1.0d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; select count(sc) from scircle_data where sc && '<(0d,90d),1.1d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,90d),1.1d>'; \echo select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; select count(sc) from scircle_data where '<(0d,90d),1.1d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where sc && '<(0d,-90d),1.0d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.0d>'; \echo select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; select count(sc) from scircle_data where '<(0d,-90d),1.0d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where sc && '<(0d,-90d),1.1d>'; \echo select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; select count(sc) from scircle_data where sc @ '<(0d,-90d),1.1d>'; \echo select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; select count(sc) from scircle_data where '<(0d,-90d),1.1d>' ~ sc; \echo select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where sc && '<(0d,0d),2.1d>'::scircle; \echo select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; select count(sc) from scircle_data where sc @ '<(0d,0d),2.1d>'::scircle; \echo select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; select count(sc) from scircle_data where '<(0d,0d),2.1d>'::scircle ~ sc; \echo pgsphere-1.5.1/testsuite/gen_box.pl000077500000000000000000000014101461140101500173320ustar00rootroot00000000000000#!/usr/bin/perl my $diff=$ARGV[0]; if ($#ARGV < 0) { print "gen_box.pl: Generic pg_sphere \"sbox\" data generator\n"; print "usage:\n\tgen_box.pl | psql pgsphere_db\n\n"; print "Program generates not overlapping spherical boxes.\n"; print "Each box has a size of degrees in longitude and\n"; print "latitude\n"; exit(0); } print < | psql pgsphere_db\n\n"; print "Program generates spherical circles located in the\n"; print "intersections of parallels and meridians and SQL script\n"; print "to load them into existing database. Distance\n"; print "between meridians is chosen equal to \"step\" in degrees\n"; print "radii of circles are set equal to \"radius\" in degrees\n"; print "The modulus of 360 and step should be equal to zero.\n"; print "The radius should be between 0 and 90\n\n"; print "Example: \"gen_circle.pl 1 0.1\" generates dataset containing\n"; print "64442 spherical circles with integer spherical coordinate\n"; print "values when written in degrees and radii of 6 arcmins.\n\n"; print "Program automatically creates \"scircle_data\" table\n"; print "but does not DROP an table with this name.\n\n"; print "Program attempts to create index \"sc_idx\" on this table\n"; exit(0); } my $pi=3.1415926535897932; my $degra=$pi/180.0; if ($dist <= 0) {$dist = 1;} if ((180 % $dist)!=0) { print STDERR "incorrect step, using 1 degree instead.\n"; $dist = 1; } if (($radius > 90)||($radius<0)) { print STDERR "incorrect radius, using 6 arcmins instead.\n"; $radius = 0.1; } print <\n"; for (my $i=-90+$dist;$i<=90-$dist;$i+=$dist) { for (my $j=0; $j<360; $j+=$dist) { print "<(${j}d, ${i}d), ${radius}d>\n"; } } print "<(0, 90d), ${radius}d>\n"; print "\\.\n\n"; print "CREATE INDEX sc_idx ON scircle_data USING gist (sc);\n"; pgsphere-1.5.1/testsuite/gen_point.pl000077500000000000000000000026011461140101500176760ustar00rootroot00000000000000#!/usr/bin/perl my $dist=$ARGV[0]; if ($#ARGV == -1) { print "gen_point.pl: Generic pg_sphere \"spoint\" data generator\n"; print "usage:\n\tgen_point.pl | psql pgsphere_db\n\n"; print "Program generates spherical points located in the\n"; print "intersections of parallels and meridians and SQL script\n"; print "to load them into existing database. Distance\n"; print "between meridians is chosen equal to \"step\" in degrees\n"; print "The modulus of 360 and step should be equal to zero.\n\n"; print "Example: \"gen_point.pl 1\" generates dataset containing 64442\n"; print "spherical points with integer spherical coordinate values\n"; print "when written in degrees.\n\n"; print "Program automatically creates \"spoint_data\" table\n"; print "but does not DROP an existing table with this name.\n\n"; print "Program attempts to create index \"sp_idx\" on this table\n"; exit(0); } my $pi=3.1415926535897932; my $degra=$pi/180.0; if ((180 % $dist)!=0) { print STDERR "incorrect step, using 1 degree instead.\n"; $dist = 1; } print < | psql pgsphere_db\n\n"; print "Program generates spherical N-side polygons located near the\n"; print "intersections of parallels and meridians and SQL script\n"; print "to load them into existing database. N have to be >=3. Distance\n"; print "between meridians is chosen equal to \"step\" in degrees\n"; print "The modulus of 360 and step should be equal to zero.\n\n"; print "Example: \"gen_poly.pl 1 0.1 3\" generates dataset containing 64442\n"; print "spherical triangles with integer spherical coordinate values\n"; print "when written in degrees.\n\n"; print "Program automatically creates \"spoly_data\" table\n"; print "but does not DROP an existing table with this name.\n\n"; print "Program attempts to create index \"spl_idx\" on this table\n"; exit(0); } my $pi=3.1415926535897932; my $degra=$pi/180.0; if ((180 % $dist)!=0) { print STDERR "incorrect step, using 1 degree instead.\n"; $dist = 1; } if ($r < 0) { print STDERR "incorrect size, using 0.1 degree instead.\n"; $r = 0.1; } if ($N < 3) { print STDERR "incorrect N, using 3 degree instead.\n"; $N = 3; } my @x; my @y; for ($i=0.0;$i<$N;$i+=1.0) { push @x,$r*sin(2.0*$pi*$i/$N); push @y,$r*cos(2.0*$pi*$i/$N); } print <[$nn],$i+$y->[$nn]); $spoly.="," unless ($nn>=($N-1)); } $spoly.="}"; return $spoly; } pgsphere-1.5.1/testsuite/point_test.expected000066400000000000000000000314131461140101500212720ustar00rootroot00000000000000-- I/O test -- -- Output --- SELECT set_sphere_output( DEG ); set_sphere_output ------------------- SET DEG (1 row) SELECT ( 1h 2m 30s , +1d 2m 30s) spoint ------------------------------- (15.625d , 1.04166666666667d) (1 row) SELECT ( 0h 2m 30s , +0d 2m 30s) spoint -------------------------------- (0.625d , 0.0416666666666667d) (1 row) SELECT ( 1h 2m 30s , -1d 2m 30s) spoint -------------------------------- (15.625d , -1.04166666666666d) (1 row) SELECT ( 0h 2m 30s , -0d 2m 30s) spoint --------------------------------- (0.625d , -0.0416666666666726d) (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) spoint ---------------- (0.625d , 90d) (1 row) SELECT ( 0h 2m 30s ,-90d 0m 0s) spoint ----------------- (0.625d , -90d) (1 row) SELECT set_sphere_output( DMS ); set_sphere_output ------------------- SET DMS (1 row) SELECT ( 1h 2m 30s , +1d 2m 30s) spoint ------------------------------- ( 15d 37m 30s , + 1d 2m 30s) (1 row) SELECT ( 0h 2m 30s , +0d 2m 30s) spoint ------------------------------- ( 0d 37m 30s , + 0d 2m 30s) (1 row) SELECT ( 1h 2m 30s , -1d 2m 30s) spoint ------------------------------- ( 15d 37m 30s , - 1d 2m 30s) (1 row) SELECT ( 0h 2m 30s , -0d 2m 30s) spoint ------------------------------- ( 0d 37m 30s , - 0d 2m 30s) (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) spoint ------------------------------ ( 0d 37m 30s , +90d 0m 0s) (1 row) SELECT ( 0h 2m 30s ,-90d 0m 0s) spoint ------------------------------ ( 0d 37m 30s , -90d 0m 0s) (1 row) SELECT set_sphere_output( HMS ); set_sphere_output ------------------- SET HMS (1 row) SELECT ( 1h 2m 30s , +1d 2m 30s) spoint ------------------------------- ( 1h 2m 30s , + 1d 2m 30s) (1 row) SELECT ( 0h 2m 30s , +0d 2m 30s) spoint ------------------------------- ( 0h 2m 30s , + 0d 2m 30s) (1 row) SELECT ( 1h 2m 30s , -1d 2m 30s) spoint ------------------------------- ( 1h 2m 30s , - 1d 2m 30s) (1 row) SELECT ( 0h 2m 30s , -0d 2m 30s) spoint ------------------------------- ( 0h 2m 30s , - 0d 2m 30s) (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) spoint ------------------------------ ( 0h 2m 30s , +90d 0m 0s) (1 row) SELECT ( 0h 2m 30s ,-90d 0m 0s) spoint ------------------------------ ( 0h 2m 30s , -90d 0m 0s) (1 row) SELECT set_sphere_output( RAD ); set_sphere_output ------------------- SET RAD (1 row) SELECT ( 1h 2m 30s , +1d 2m 30s) spoint ------------------------------------------ (0.272707695624114 , 0.0181805130416076) (1 row) SELECT ( 0h 2m 30s , +0d 2m 30s) spoint --------------------------------------------- (0.0109083078249646 , 0.000727220521664304) (1 row) SELECT ( 1h 2m 30s , -1d 2m 30s) spoint ------------------------------------------- (0.272707695624114 , -0.0181805130416075) (1 row) SELECT ( 0h 2m 30s , -0d 2m 30s) spoint ---------------------------------------------- (0.0109083078249646 , -0.000727220521664407) (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) spoint ---------------------------------------- (0.0109083078249646 , 1.5707963267949) (1 row) SELECT ( 0h 2m 30s ,-90d 0m 0s) spoint ----------------------------------------- (0.0109083078249646 , -1.5707963267949) (1 row) -- "incorrect dec. values" SELECT set_sphere_output( DEG ); set_sphere_output ------------------- SET DEG (1 row) SELECT ( 0h 2m 30s , 95d 0m 0s) spoint ------------------ (180.625d , 85d) (1 row) SELECT ( 24h 2m 30s , 5d 0m 0s) spoint --------------------------- (0.624999999999987d , 5d) (1 row) SELECT ( -0h 2m 30s , -5d 0m 0s) spoint --------------------------------- (359.375d , -4.99999999999999d) (1 row) SELECT ( 0h 2m 30s , -95d 0m 0s) spoint ------------------- (180.625d , -85d) (1 row) -- Input -- SELECT ( 0h 2m 30s , -0d 2m 30s) spoint --------------------------------- (0.625d , -0.0416666666666726d) (1 row) SELECT ( 0d 37m 30s , -0d 2m 30s) spoint --------------------------------- (0.625d , -0.0416666666666726d) (1 row) SELECT ( 0.625d , -0.04166666666666667d) spoint --------------------------------- (0.625d , -0.0416666666666726d) (1 row) SELECT (0.0109083078249646 , -0.000727220521664407) spoint --------------------------------------------- (0.625000000000002d , -0.0416666666666726d) (1 row) -- functions for point -------------- -- spoint(float8, float8) SELECT spoint(0.0109083078249646 , -0.000727220521664407); spoint --------------------------------------------- (0.625000000000002d , -0.0416666666666726d) (1 row) SELECT set_sphere_output( RAD ); set_sphere_output ------------------- SET RAD (1 row) SELECT spoint(7.28318530717958623 , 0.00); spoint --------- (1 , 0) (1 row) SELECT spoint(0.0 , 2.141592653589793116); spoint ------------------------ (3.14159265358979 , 1) (1 row) -- dist(spoint,spoint) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 0m 30s , 0d 0m 0s)'::spoint); dist --------------------- 0.00872664625996925 (1 row) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , 10d 0m 0s)'::spoint); dist ------------------- 0.174532925199433 (1 row) SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); dist ------------------- 0.174532925199433 (1 row) SELECT dist('( 0h 2m 30s , 95d 0m 0s)'::spoint,'( 12h 2m 30s , 85d 0m 0s)'::spoint); dist ------ 0 (1 row) SELECT dist('( 24h 2m 30s , 10d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); dist ------------------- 0.349065850398866 (1 row) SELECT dist('( 0h 2m 30s , 90d 0m 0s)'::spoint,'( 12h 2m 30s , 90d 0m 0s)'::spoint); dist ------ 0 (1 row) SELECT dist('( 0h 2m 30s , -90d 0m 0s)'::spoint,'( 12h 2m 30s , -90d 0m 0s)'::spoint); dist ------ 0 (1 row) -- long(spoint) SELECT long('( 0h 2m 30s , 0d 0m 0s)'::spoint); long -------------------- 0.0109083078249646 (1 row) SELECT long('( 0h 2m 30s ,95d 0m 0s)'::spoint); long ------------------ 3.15250096141476 (1 row) SELECT long('( 0h 2m 30s ,85d 0m 0s)'::spoint); long -------------------- 0.0109083078249646 (1 row) SELECT long('( 0h 2m 30s ,-95d 0m 0s)'::spoint); long ------------------ 3.15250096141476 (1 row) SELECT long('( 0h 2m 30s ,-85d 0m 0s)'::spoint); long -------------------- 0.0109083078249646 (1 row) SELECT long('( 0h 2m 30s ,90d 0m 0s)'::spoint); long -------------------- 0.0109083078249646 (1 row) SELECT long('( 0h 2m 30s ,-90d 0m 0s)'::spoint); long -------------------- 0.0109083078249646 (1 row) SELECT long('(24h 2m 30s , 0d 0m 0s)'::spoint); long -------------------- 0.0109083078249643 (1 row) SELECT long('(24h 2m 30s ,95d 0m 0s)'::spoint); long ------------------ 3.15250096141476 (1 row) SELECT long('(24h 2m 30s ,85d 0m 0s)'::spoint); long -------------------- 0.0109083078249643 (1 row) SELECT long('(24h 2m 30s ,-95d 0m 0s)'::spoint); long ------------------ 3.15250096141476 (1 row) SELECT long('(24h 2m 30s ,-85d 0m 0s)'::spoint); long -------------------- 0.0109083078249643 (1 row) SELECT long('(24h 2m 30s ,90d 0m 0s)'::spoint); long -------------------- 0.0109083078249643 (1 row) SELECT long('(24h 2m 30s ,-90d 0m 0s)'::spoint); long -------------------- 0.0109083078249643 (1 row) -- lat(spoint) SELECT lat('( 0h 2m 30s , 0d 0m 0s)'::spoint); lat ----- 0 (1 row) SELECT lat('( 0h 2m 30s ,95d 0m 0s)'::spoint); lat ------------------ 1.48352986419518 (1 row) SELECT lat('( 0h 2m 30s ,85d 0m 0s)'::spoint); lat ------------------ 1.48352986419518 (1 row) SELECT lat('( 0h 2m 30s ,-95d 0m 0s)'::spoint); lat ------------------- -1.48352986419518 (1 row) SELECT lat('( 0h 2m 30s ,-85d 0m 0s)'::spoint); lat ------------------- -1.48352986419518 (1 row) SELECT lat('( 0h 2m 30s ,90d 0m 0s)'::spoint); lat ----------------- 1.5707963267949 (1 row) SELECT lat('( 0h 2m 30s ,-90d 0m 0s)'::spoint); lat ------------------ -1.5707963267949 (1 row) SELECT lat('(24h 2m 30s , 0d 0m 0s)'::spoint); lat ----- 0 (1 row) SELECT lat('(24h 2m 30s ,95d 0m 0s)'::spoint); lat ------------------ 1.48352986419518 (1 row) SELECT lat('(24h 2m 30s ,85d 0m 0s)'::spoint); lat ------------------ 1.48352986419518 (1 row) SELECT lat('(24h 2m 30s ,-95d 0m 0s)'::spoint); lat ------------------- -1.48352986419518 (1 row) SELECT lat('(24h 2m 30s ,-85d 0m 0s)'::spoint); lat ------------------- -1.48352986419518 (1 row) SELECT lat('(24h 2m 30s ,90d 0m 0s)'::spoint); lat ----------------- 1.5707963267949 (1 row) SELECT lat('(24h 2m 30s ,-90d 0m 0s)'::spoint); lat ------------------ -1.5707963267949 (1 row) -- operators for points ------------- -- = operator ----------------------- SELECT ( 0h 2m 30s , 90d 0m 0s) 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 12h 2m 30s , 90d 0m 0s) 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) 24h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 0h 2m 30s , -90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 12h 2m 30s , -90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 0h 2m 30s , -90d 0m 0s) 24h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 0h 2m 30s , 95d 0m 0s) 12h 2m 30s , 85d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 24h 2m 30s , 10d 0m 0s) 0h 2m 30s , 10d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 12h 2m 30s , 90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 0h 2m 30s , 0d 0m 0s) 12h 2m 30s , 45d 0m 0s)'::spoint; ?column? ---------- f (1 row) -- <> operator ----------------------- SELECT ( 0h 2m 30s , 90d 0m 0s) 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 12h 2m 30s , 90d 0m 0s) 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) 24h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 0h 2m 30s , -90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 12h 2m 30s , -90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 0h 2m 30s , -90d 0m 0s) 24h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 0h 2m 30s , 95d 0m 0s) 12h 2m 30s , 85d 0m 0s)'::spoint; ?column? ---------- f (1 row) SELECT ( 24h 2m 30s , 10d 0m 0s) 0h 2m 30s , 10d 0m 0s)'::spoint; ?column? ---------- f (1 row) -- SELECT ( 0h 2m 30s , 90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 12h 2m 30s , 90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- t (1 row) SELECT ( 0h 2m 30s , 0d 0m 0s) 12h 2m 30s , 45d 0m 0s)'::spoint; ?column? ---------- t (1 row) -- <-> operator --------------------- SELECT ( 0h 2m 30s , 0d 0m 0s) 0h 0m 30s , 0d 0m 0s)'::spoint; ?column? --------------------- 0.00872664625996925 (1 row) SELECT ( 0h 2m 30s , 0d 0m 0s) 0h 2m 30s , 10d 0m 0s)'::spoint; ?column? ------------------- 0.174532925199433 (1 row) SELECT ( 0h 2m 30s , 0d 0m 0s) 0h 2m 30s , -10d 0m 0s)'::spoint; ?column? ------------------- 0.174532925199433 (1 row) SELECT ( 0h 2m 30s , 95d 0m 0s) 12h 2m 30s , 85d 0m 0s)'::spoint; ?column? ---------- 0 (1 row) SELECT ( 24h 2m 30s , 10d 0m 0s) 0h 2m 30s , -10d 0m 0s)'::spoint; ?column? ------------------- 0.349065850398866 (1 row) SELECT ( 0h 2m 30s , 90d 0m 0s) 12h 2m 30s , 90d 0m 0s)'::spoint; ?column? ---------- 0 (1 row) SELECT ( 0h 2m 30s , -90d 0m 0s) 12h 2m 30s , -90d 0m 0s)'::spoint; ?column? ---------- 0 (1 row) pgsphere-1.5.1/testsuite/point_test.sql000066400000000000000000000326311461140101500202730ustar00rootroot00000000000000\echo -- I/O test -- -- I/O test -- \echo \echo -- Output --- -- Output --- \echo SELECT set_sphere_output( 'DEG' ); SELECT set_sphere_output( 'DEG' ); \echo SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; \echo SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; \echo SELECT set_sphere_output( 'DMS' ); SELECT set_sphere_output( 'DMS' ); \echo SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; \echo SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; \echo SELECT set_sphere_output( 'HMS' ); SELECT set_sphere_output( 'HMS' ); \echo SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; \echo SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; \echo SELECT set_sphere_output( 'RAD' ); SELECT set_sphere_output( 'RAD' ); \echo SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , +1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , +0d 2m 30s)'::spoint; \echo SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; SELECT '( 1h 2m 30s , -1d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s ,-90d 0m 0s)'::spoint; \echo \echo -- "incorrect dec. values" -- "incorrect dec. values" \echo SELECT set_sphere_output( 'DEG' ); SELECT set_sphere_output( 'DEG' ); \echo SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint; \echo SELECT '( 24h 2m 30s , 5d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 5d 0m 0s)'::spoint; \echo SELECT '( -0h 2m 30s , -5d 0m 0s)'::spoint; SELECT '( -0h 2m 30s , -5d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , -95d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -95d 0m 0s)'::spoint; \echo \echo -- Input -- -- Input -- \echo SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; SELECT '( 0h 2m 30s , -0d 2m 30s)'::spoint; \echo SELECT '( 0d 37m 30s , -0d 2m 30s)'::spoint; SELECT '( 0d 37m 30s , -0d 2m 30s)'::spoint; \echo SELECT '( 0.625d , -0.04166666666666667d)'::spoint; SELECT '( 0.625d , -0.04166666666666667d)'::spoint; \echo SELECT '(0.0109083078249646 , -0.000727220521664407)'::spoint; SELECT '(0.0109083078249646 , -0.000727220521664407)'::spoint; \echo \echo \echo -- functions for point -------------- -- functions for point -------------- \echo -- spoint(float8, float8) -- spoint(float8, float8) \echo SELECT spoint(0.0109083078249646 , -0.000727220521664407); SELECT spoint(0.0109083078249646 , -0.000727220521664407); \echo SELECT set_sphere_output( 'RAD' ); SELECT set_sphere_output( 'RAD' ); \echo SELECT spoint(7.28318530717958623 , 0.00); SELECT spoint(7.28318530717958623 , 0.00); \echo SELECT spoint(0.0 , 2.141592653589793116); SELECT spoint(0.0 , 2.141592653589793116); \echo \echo -- dist(spoint,spoint) -- dist(spoint,spoint) \echo SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 0m 30s , 0d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 0m 30s , 0d 0m 0s)'::spoint); \echo SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , 10d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , 10d 0m 0s)'::spoint); \echo SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 0d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); \echo SELECT dist('( 0h 2m 30s , 95d 0m 0s)'::spoint,'( 12h 2m 30s , 85d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 95d 0m 0s)'::spoint,'( 12h 2m 30s , 85d 0m 0s)'::spoint); \echo SELECT dist('( 24h 2m 30s , 10d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); SELECT dist('( 24h 2m 30s , 10d 0m 0s)'::spoint,'( 0h 2m 30s , -10d 0m 0s)'::spoint); \echo SELECT dist('( 0h 2m 30s , 90d 0m 0s)'::spoint,'( 12h 2m 30s , 90d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , 90d 0m 0s)'::spoint,'( 12h 2m 30s , 90d 0m 0s)'::spoint); \echo SELECT dist('( 0h 2m 30s , -90d 0m 0s)'::spoint,'( 12h 2m 30s , -90d 0m 0s)'::spoint); SELECT dist('( 0h 2m 30s , -90d 0m 0s)'::spoint,'( 12h 2m 30s , -90d 0m 0s)'::spoint); \echo \echo -- long(spoint) -- long(spoint) \echo SELECT long('( 0h 2m 30s , 0d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s , 0d 0m 0s)'::spoint); \echo SELECT long('( 0h 2m 30s ,95d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,95d 0m 0s)'::spoint); \echo SELECT long('( 0h 2m 30s ,85d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,85d 0m 0s)'::spoint); \echo SELECT long('( 0h 2m 30s ,-95d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,-95d 0m 0s)'::spoint); \echo SELECT long('( 0h 2m 30s ,-85d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,-85d 0m 0s)'::spoint); \echo SELECT long('( 0h 2m 30s ,90d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,90d 0m 0s)'::spoint); \echo SELECT long('( 0h 2m 30s ,-90d 0m 0s)'::spoint); SELECT long('( 0h 2m 30s ,-90d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s , 0d 0m 0s)'::spoint); SELECT long('(24h 2m 30s , 0d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s ,95d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,95d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s ,85d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,85d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s ,-95d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,-95d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s ,-85d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,-85d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s ,90d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,90d 0m 0s)'::spoint); \echo SELECT long('(24h 2m 30s ,-90d 0m 0s)'::spoint); SELECT long('(24h 2m 30s ,-90d 0m 0s)'::spoint); \echo \echo -- lat(spoint) -- lat(spoint) \echo SELECT lat('( 0h 2m 30s , 0d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s , 0d 0m 0s)'::spoint); \echo SELECT lat('( 0h 2m 30s ,95d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,95d 0m 0s)'::spoint); \echo SELECT lat('( 0h 2m 30s ,85d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,85d 0m 0s)'::spoint); \echo SELECT lat('( 0h 2m 30s ,-95d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,-95d 0m 0s)'::spoint); \echo SELECT lat('( 0h 2m 30s ,-85d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,-85d 0m 0s)'::spoint); \echo SELECT lat('( 0h 2m 30s ,90d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,90d 0m 0s)'::spoint); \echo SELECT lat('( 0h 2m 30s ,-90d 0m 0s)'::spoint); SELECT lat('( 0h 2m 30s ,-90d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s , 0d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s , 0d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s ,95d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,95d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s ,85d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,85d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s ,-95d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,-95d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s ,-85d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,-85d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s ,90d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,90d 0m 0s)'::spoint); \echo SELECT lat('(24h 2m 30s ,-90d 0m 0s)'::spoint); SELECT lat('(24h 2m 30s ,-90d 0m 0s)'::spoint); \echo \echo -- operators for points ------------- -- operators for points ------------- \echo -- = operator ----------------------- -- = operator ----------------------- \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 24h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 24h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 24h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint='( 24h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint='( 12h 2m 30s , 85d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint='( 12h 2m 30s , 85d 0m 0s)'::spoint; \echo SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint='( 0h 2m 30s , 10d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint='( 0h 2m 30s , 10d 0m 0s)'::spoint; \echo \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint='( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint='( 12h 2m 30s , 45d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint='( 12h 2m 30s , 45d 0m 0s)'::spoint; \echo \echo -- <> operator ----------------------- -- <> operator ----------------------- \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 24h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 24h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , -90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 24h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<>'( 24h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<>'( 12h 2m 30s , 85d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<>'( 12h 2m 30s , 85d 0m 0s)'::spoint; \echo SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<>'( 0h 2m 30s , 10d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<>'( 0h 2m 30s , 10d 0m 0s)'::spoint; \echo -- -- \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 12h 2m 30s , 90d 0m 0s)'::spoint<>'( 12h 2m 30s , -90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<>'( 12h 2m 30s , 45d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<>'( 12h 2m 30s , 45d 0m 0s)'::spoint; \echo \echo -- <-> operator --------------------- -- <-> operator --------------------- \echo SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 0m 30s , 0d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 0m 30s , 0d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , 10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , 10d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 0d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<->'( 12h 2m 30s , 85d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 95d 0m 0s)'::spoint<->'( 12h 2m 30s , 85d 0m 0s)'::spoint; \echo SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; SELECT '( 24h 2m 30s , 10d 0m 0s)'::spoint<->'( 0h 2m 30s , -10d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<->'( 12h 2m 30s , 90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , 90d 0m 0s)'::spoint<->'( 12h 2m 30s , 90d 0m 0s)'::spoint; \echo SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<->'( 12h 2m 30s , -90d 0m 0s)'::spoint; SELECT '( 0h 2m 30s , -90d 0m 0s)'::spoint<->'( 12h 2m 30s , -90d 0m 0s)'::spoint; pgsphere-1.5.1/testsuite/poly_test.expected000066400000000000000000000500451461140101500211260ustar00rootroot00000000000000SELECT set_sphere_output('DEG'); set_sphere_output ------------------- SET DEG (1 row) SELECT spoly {(10d,0d),(10d,1d),(15d,0d)} ; spoly ------------------------------------ {(10d , 0d),(10d , 1d),(15d , 0d)} (1 row) SELECT spoly {(359d,0d),(359d,1d),(4d,0d)} ; spoly ------------------------------------- {(359d , 0d),(359d , 1d),(4d , 0d)} (1 row) SELECT spoly {(10d,0d),(10d,1d),(15d,0d)} ; spoly ------------------------------------ {(10d , 0d),(10d , 1d),(15d , 0d)} (1 row) -- incorrect input ----- SELECT spoly {(10d,0d),(10d,1d)} ; --- self-crossing input ----- SELECT spoly {(0d,0d),(10d,10d),(0d,10d),(10d,0d)} ; --- functions SELECT npoints( spoly {(10d,0d),(10d,1d),(15d,0d)} ); npoints --------- 3 (1 row) SELECT npoints( spoly {(10d,0d),(10d,1d),(15d,0d),(5d,-5d)} ); npoints --------- 4 (1 row) --SELECT npoints( spoly {(0d,0d),(0d,90d),(15d,90d),(15d,0d)} ); SELECT area(spoly {(0d,0d),(0d,90d),(1,0d)} ); area ------ 1 (1 row) SELECT area(spoly {(0d,0d),(0d,90d),(90d,0d)} )/(4.0*pi()); ?column? ---------- 0.125 (1 row) --- operations --- = operator --- should be true SELECT spoly {(1d,0d),(1d,1d),(2d,1d)} = spoly {(1d,1d),(2d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(1d,0d),(1d,1d),(2d,1d)} = spoly {(2d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} = spoly {(1d,0d),(0d,0d),(0d,1d),(1d,1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} = spoly {(0d,0d),(1d,0d),(1d,1d),(0d,1d)} ; ?column? ---------- f (1 row) --- should be false SELECT spoly {(1d,0d),(1d,1d),(2d,1d)} = spoly {(1d,1d),(3d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} = spoly {(1d,0d),(0d,0d),(0d,1d),(2d,2d)} ; ?column? ---------- f (1 row) --- <> operator --- should be false SELECT spoly {(1d,0d),(1d,1d),(2d,1d)} <> spoly {(1d,1d),(2d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT spoly {(1d,0d),(1d,1d),(2d,1d)} <> spoly {(2d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} <> spoly {(1d,0d),(0d,0d),(0d,1d),(1d,1d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} <> spoly {(0d,0d),(1d,0d),(1d,1d),(0d,1d)} ; ?column? ---------- t (1 row) --- should be true SELECT spoly {(1d,0d),(1d,1d),(2d,1d)} <> spoly {(1d,1d),(3d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} <> spoly {(1d,0d),(0d,0d),(0d,1d),(2d,2d)} ; ?column? ---------- t (1 row) --- spoint @ spoly --- should be true SELECT (0.5d,0.5d) @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT (0d,0.5d) @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT (0d,0d) @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT (0.5d,0.5d) @ spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT (0d,89.9d) @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT (0d,90d) @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT (0d,-89.9d) @ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) SELECT (0d,-90d) @ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) --- should be false SELECT (0.1d,0.5d) @ spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT (45d,-89d) @ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- f (1 row) SELECT (0d,1d) @ spoly {(0d,0d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) --- spoly ~ spoint --- should be true SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ (0.5d,0.5d) ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ (0d,0.5d) ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ (0d,0d) ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ~ (0.5d,0.5d) ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ (0d,89.9d) ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ (0d,90d) ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ~ (0d,-89.9d) ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ~ (0d,-90d) ?column? ---------- t (1 row) --- should be false SELECT spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ~ (0.1d,0.5d) ?column? ---------- f (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ~ (45d,-89d) ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(1d,1d),(1d,0d)} ~ (0d,1d) ?column? ---------- f (1 row) --- scircle @ spoly --- should be true SELECT <(0.5d,0.5d),0.1d> @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT <(0d,89.9d),0.1d> @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT <(0d,90d),0.1d> @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT <(0d,-89.9d),0.1d> @ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) SELECT <(0d,-90d),0.1d> @ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) --- should be false SELECT <(0.1d,0.5d),0.1d> @ spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(45d,-89d),0.1d> @ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- f (1 row) SELECT <(0d,1d),0.1d> @ spoly {(0d,0d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(0d,0.5d),0.1d> @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(0d,0d),0.1d> @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(0.5d,0.5d),0.1d> @ spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) --- spoly ~ scircle --- should be true SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0.5d,0.5d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ <(0d,89.9d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ <(0d,90d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ~ <(0d,-89.9d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ~ <(0d,-90d),0.1d> ?column? ---------- t (1 row) --- should be false SELECT spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0.1d,0.5d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ~ <(45d,-89d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(1d,1d),(1d,0d)} ~ <(0d,1d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0d,0.5d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0d,0d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0.1d,0.5d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0.1d,0.1d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ~ <(0.6d,0.5d),0.1d> ?column? ---------- f (1 row) --- spoly @ scircle --- should be true SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} @ <(0d,0d),2.0d> ?column? ---------- t (1 row) SELECT spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} @ <(0d,0d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} @ <(0d,90d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} @ <(180d,-90d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,0d)} @ <(0d,0d),1.0d> ?column? ---------- t (1 row) --- should be false SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} @ <(0d,0d),1.0d> ?column? ---------- f (1 row) SELECT spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} @ <(0d,0d),0.99d> ?column? ---------- f (1 row) SELECT spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} @ <(60d,0d),0.99d> ?column? ---------- f (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,88d)} @ <(0d,90d),1.0d> ?column? ---------- f (1 row) SELECT spoly {(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)} @ <(180d,-90d),1.0d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(2d,0d)} @ <(0d,0d),1.0d> ?column? ---------- f (1 row) --- scircle ~ spoly --- should be true SELECT <(0d,0d),2.0d> ~ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT <(0d,0d),1.0d> ~ spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} ; ?column? ---------- t (1 row) SELECT <(0d,90d),1.0d> ~ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT <(180d,-90d),1.0d> ~ spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) SELECT <(0d,0d),1.0d> ~ spoly {(0d,0d),(0d,1d),(1d,0d)} ; ?column? ---------- t (1 row) --- should be false SELECT <(0d,0d),1.0d> ~ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(0d,0d),0.99d> ~ spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} ; ?column? ---------- f (1 row) SELECT <(60d,0d),0.99d> ~ spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} ; ?column? ---------- f (1 row) SELECT <(0d,90d),1.0d> ~ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,88d)} ; ?column? ---------- f (1 row) SELECT <(180d,-90d),1.0d> ~ spoly {(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)} ; ?column? ---------- f (1 row) SELECT <(0d,0d),1.0d> ~ spoly {(0d,0d),(0d,1d),(2d,0d)} ; ?column? ---------- f (1 row) --- scircle && spoly --- should be true SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} && <(0.5d,0.5d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && <(0d,89.9d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && <(0d,90d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} && <(0d,-89.9d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} && <(0d,-90d),0.1d> ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} && <(0d,0d),2.0d> ?column? ---------- t (1 row) SELECT spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} && <(0d,0d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && <(0d,90d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} && <(180d,-90d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,0d)} && <(0d,0d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && <(0d,2d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && <(2d,0d),1.0d> ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} && <(0.5d,0.5d),0.1d> ?column? ---------- t (1 row) --- should be false SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} && <(1.5d,0.5d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && <(0d,88.0d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} && <(0.3d,0.5d),0.1d> ?column? ---------- f (1 row) SELECT spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} && <(0d,-87d),0.1d> ?column? ---------- f (1 row) --- spoly && scircle --- should be true SELECT <(0.5d,0.5d),0.1d> && spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT <(0d,89.9d),0.1d> && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT <(0d,90d),0.1d> && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT <(0d,-89.9d),0.1d> && spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) SELECT <(0d,-90d),0.1d> && spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) SELECT <(0d,0d),2.0d> && spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT <(0d,0d),1.0d> && spoly {(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)} ; ?column? ---------- t (1 row) SELECT <(0d,90d),1.0d> && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT <(180d,-90d),1.0d> && spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- t (1 row) SELECT <(0d,0d),1.0d> && spoly {(0d,0d),(0d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT <(0d,2d),1.0d> && spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT <(2d,0d),1.0d> && spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT <(0.5d,0.5d),0.1d> && spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) --- should be false SELECT <(1.5d,0.5d),0.1d> && spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(0d,88.0d),0.1d> && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- f (1 row) SELECT <(0.3d,0.5d),0.1d> && spoly {(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT <(0d,-87d),0.1d> && spoly {(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)} ; ?column? ---------- f (1 row) --- spoly @ spoly --- should be true SELECT spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} @ spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)} @ spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} @ spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,0d)} @ spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,0d)} @ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT spoly {(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)} @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) --- should be false --SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} @ spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; SELECT spoly {(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)} @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} @ spoly {(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,88d),(90d,88d),(180d,88d),(270d,88d)} @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)} @ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- f (1 row) --- spoly ~ spoly --- should be true SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ~ spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ~ spoly {(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ~ spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ~ spoly {(0d,0d),(0d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ~ spoly {(0d,0d),(0d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ spoly {(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)} ; ?column? ---------- t (1 row) --- should be false SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ spoly {(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)} ; ?column? ---------- f (1 row) SELECT spoly {(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)} ~ spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ spoly {(0d,88d),(90d,88d),(180d,88d),(270d,88d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ~ spoly {(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)} ; ?column? ---------- f (1 row) --- spoly && spoly --- should be true SELECT spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} && spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)} && spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} && spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,0d)} && spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,0d)} && spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT spoly {(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)} && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(0d,0d),(0d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} && spoly {(0d,0d),(0d,1d),(1d,0d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && spoly {(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)} ; ?column? ---------- t (1 row) SELECT spoly {(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)} && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,0d),(0d,1d),(1d,1d),(1d,0d)} && spoly {(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)} ; ?column? ---------- t (1 row) SELECT spoly {(0d,88d),(90d,88d),(180d,88d),(270d,88d)} && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- t (1 row) --- should be false SELECT spoly {(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)} && spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} ; ?column? ---------- f (1 row) SELECT spoly {(0d,89d),(90d,89d),(180d,89d),(270d,89d)} && spoly {(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)} ; ?column? ---------- f (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(3d,-1d),(3d,1d),(5d,1d),(5d,-1d)} ; ?column? ---------- f (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(-1d,3d),(-1d,5d),(1d,5d),(1d,3d)} ; ?column? ---------- f (1 row) SELECT spoly {(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)} && spoly {(179d,-1d),(179d,1d),(181d,1d),(181d,-1d)} ; ?column? ---------- f (1 row) pgsphere-1.5.1/testsuite/poly_test.sql000066400000000000000000001025311461140101500201220ustar00rootroot00000000000000\echo SELECT set_sphere_output('DEG'); SELECT set_sphere_output('DEG'); \echo \echo SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; \echo SELECT spoly '{(359d,0d),(359d,1d),(4d,0d)}'; SELECT spoly '{(359d,0d),(359d,1d),(4d,0d)}'; \echo SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; SELECT spoly '{(10d,0d),(10d,1d),(15d,0d)}'; \echo \echo -- incorrect input ----- -- incorrect input ----- \echo SELECT spoly '{(10d,0d),(10d,1d)}'; SELECT spoly '{(10d,0d),(10d,1d)}'; \echo \echo --- self-crossing input ----- --- self-crossing input ----- \echo SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}'; SELECT spoly '{(0d,0d),(10d,10d),(0d,10d),(10d,0d)}'; \echo \echo --- functions --- functions \echo SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d)}'); SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d)}'); \echo SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d),(5d,-5d)}'); SELECT npoints( spoly '{(10d,0d),(10d,1d),(15d,0d),(5d,-5d)}'); \echo --SELECT npoints( spoly '{(0d,0d),(0d,90d),(15d,90d),(15d,0d)}'); --SELECT npoints( spoly '{(0d,0d),(0d,90d),(15d,90d),(15d,0d)}'); \echo \echo SELECT area(spoly '{(0d,0d),(0d,90d),(1,0d)}'); SELECT area(spoly '{(0d,0d),(0d,90d),(1,0d)}'); \echo SELECT area(spoly '{(0d,0d),(0d,90d),(90d,0d)}')/(4.0*pi()); SELECT area(spoly '{(0d,0d),(0d,90d),(90d,0d)}')/(4.0*pi()); \echo \echo --- operations --- operations \echo --- = operator --- = operator \echo --- should be true --- should be true \echo SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(2d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(2d,1d),(1d,0d)}'; \echo SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(2d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(2d,1d),(1d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; \echo --- should be false --- should be false \echo SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(3d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' = spoly '{(1d,1d),(3d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' = spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; \echo \echo --- <> operator --- <> operator \echo --- should be false --- should be false \echo SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(2d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(2d,1d),(1d,0d)}'; \echo SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(2d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(2d,1d),(1d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(1d,1d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(0d,0d),(1d,0d),(1d,1d),(0d,1d)}'; \echo --- should be true --- should be true \echo SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(3d,1d),(1d,0d)}'; SELECT spoly '{(1d,0d),(1d,1d),(2d,1d)}' <> spoly '{(1d,1d),(3d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' <> spoly '{(1d,0d),(0d,0d),(0d,1d),(2d,2d)}'; \echo \echo --- spoint @ spoly --- spoint @ spoly \echo --- should be true --- should be true \echo SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '(0d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0d,0.5d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '(0d,0d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0d,0d)'::spoint @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0.5d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '(0d,89.9d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '(0d,89.9d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '(0d,90d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '(0d,90d)'::spoint @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '(0d,-89.9d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '(0d,-89.9d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '(0d,-90d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '(0d,-90d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo \echo --- should be false --- should be false \echo SELECT '(0.1d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '(0.1d,0.5d)'::spoint @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '(45d,-89d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '(45d,-89d)'::spoint @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '(0d,1d)'::spoint @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; SELECT '(0d,1d)'::spoint @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; \echo \echo --- spoly ~ spoint --- spoly ~ spoint \echo --- should be true --- should be true \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0.5d)'::spoint; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0.5d)'::spoint; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0d)'::spoint; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0d,0d)'::spoint; \echo SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.5d,0.5d)'::spoint; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,89.9d)'::spoint; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,89.9d)'::spoint; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,90d)'::spoint; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '(0d,90d)'::spoint; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-89.9d)'::spoint; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-89.9d)'::spoint; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-90d)'::spoint; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(0d,-90d)'::spoint; \echo \echo --- should be false --- should be false \echo SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.1d,0.5d)'::spoint; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '(0.1d,0.5d)'::spoint; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(45d,-89d)'::spoint; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '(45d,-89d)'::spoint; \echo SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '(0d,1d)'::spoint; SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '(0d,1d)'::spoint; \echo \echo --- scircle @ spoly --- scircle @ spoly \echo --- should be true --- should be true \echo SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,89.9d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,89.9d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(0d,90d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,90d),0.1d>'::scircle @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(0d,-89.9d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-89.9d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '<(0d,-90d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-90d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo \echo --- should be false --- should be false \echo SELECT '<(0.1d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.1d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(45d,-89d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(45d,-89d),0.1d>'::scircle @ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '<(0d,1d),0.1d>'::scircle @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; SELECT '<(0d,1d),0.1d>'::scircle @ spoly '{(0d,0d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,0d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),0.1d>'::scircle @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.5d,0.5d),0.1d>'::scircle @ spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; \echo \echo --- spoly ~ scircle --- spoly ~ scircle \echo --- should be true --- should be true \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.5d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,89.9d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,89.9d),0.1d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,90d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ '<(0d,90d),0.1d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-89.9d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-89.9d),0.1d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-90d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(0d,-90d),0.1d>'::scircle; \echo \echo --- should be false --- should be false \echo SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(45d,-89d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' ~ '<(45d,-89d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '<(0d,1d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(1d,1d),(1d,0d)}' ~ '<(0d,1d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0d,0d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.1d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.1d,0.1d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.6d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' ~ '<(0.6d,0.5d),0.1d>'::scircle; \echo \echo --- spoly @ scircle --- spoly @ scircle \echo --- should be true --- should be true \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),2.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),2.0d>'::scircle; \echo SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),1.0d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ '<(0d,90d),1.0d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ '<(0d,90d),1.0d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' @ '<(180d,-90d),1.0d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' @ '<(180d,-90d),1.0d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; \echo \echo --- should be false --- should be false \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ '<(0d,0d),1.0d>'::scircle; \echo SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),0.99d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(0d,0d),0.99d>'::scircle; \echo SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(60d,0d),0.99d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' @ '<(60d,0d),0.99d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}' @ '<(0d,90d),1.0d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}' @ '<(0d,90d),1.0d>'::scircle; \echo SELECT spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}' @ '<(180d,-90d),1.0d>'::scircle; SELECT spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}' @ '<(180d,-90d),1.0d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(2d,0d)}' @ '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(2d,0d)}' @ '<(0d,0d),1.0d>'::scircle; \echo \echo --- scircle ~ spoly --- scircle ~ spoly \echo --- should be true --- should be true \echo SELECT '<(0d,0d),2.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),2.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; \echo SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; \echo \echo --- should be false --- should be false \echo SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(0d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; \echo SELECT '<(60d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(60d,0d),0.99d>'::scircle ~ spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; \echo SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}'; SELECT '<(0d,90d),1.0d>'::scircle ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,88d)}'; \echo SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}'; SELECT '<(180d,-90d),1.0d>'::scircle ~ spoly '{(0d,-87d),(90d,-87d),(180d,-87d),(270d,-87d)}'; \echo SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(2d,0d)}'; SELECT '<(0d,0d),1.0d>'::scircle ~ spoly '{(0d,0d),(0d,1d),(2d,0d)}'; \echo \echo --- scircle && spoly --- scircle && spoly \echo --- should be true --- should be true \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,89.9d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,89.9d),0.1d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),0.1d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-89.9d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-89.9d),0.1d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-90d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-90d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0d,0d),2.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0d,0d),2.0d>'::scircle; \echo SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' && '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}' && '<(0d,0d),1.0d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),1.0d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,90d),1.0d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(180d,-90d),1.0d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(180d,-90d),1.0d>'::scircle; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && '<(0d,0d),1.0d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && '<(0d,0d),1.0d>'::scircle; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(0d,2d),1.0d>'::scircle; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(0d,2d),1.0d>'::scircle; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(2d,0d),1.0d>'::scircle; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && '<(2d,0d),1.0d>'::scircle; \echo SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.5d,0.5d),0.1d>'::scircle; \echo \echo --- should be false --- should be false \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(1.5d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && '<(1.5d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,88.0d),0.1d>'::scircle; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && '<(0d,88.0d),0.1d>'::scircle; \echo SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.3d,0.5d),0.1d>'::scircle; SELECT spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}' && '<(0.3d,0.5d),0.1d>'::scircle; \echo SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-87d),0.1d>'::scircle; SELECT spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}' && '<(0d,-87d),0.1d>'::scircle; \echo \echo --- spoly && scircle --- spoly && scircle \echo --- should be true --- should be true \echo SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,89.9d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,89.9d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(0d,90d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,90d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(0d,-89.9d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-89.9d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '<(0d,-90d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-90d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '<(0d,0d),2.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0d,0d),2.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(-1d,0d),(0d,1d),(1d,0d),(0d,-1d)}'; \echo SELECT '<(0d,90d),1.0d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,90d),1.0d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(180d,-90d),1.0d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(180d,-90d),1.0d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT '<(0d,0d),1.0d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; \echo SELECT '<(0d,2d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT '<(0d,2d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT '<(2d,0d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT '<(2d,0d),1.0d>'::scircle && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; \echo \echo --- should be false --- should be false \echo SELECT '<(1.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(1.5d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,88.0d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT '<(0d,88.0d),0.1d>'::scircle && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT '<(0.3d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT '<(0.3d,0.5d),0.1d>'::scircle && spoly '{(0d,0d),(0.5d,0.5d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT '<(0d,-87d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; SELECT '<(0d,-87d),0.1d>'::scircle && spoly '{(0d,-89d),(90d,-89d),(180d,-89d),(270d,-89d)}'; \echo \echo --- spoly @ spoly --- spoly @ spoly \echo --- should be true --- should be true \echo SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' @ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo \echo --- should be false --- should be false \echo --SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; --SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' @ spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; \echo SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo \echo SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' @ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo \echo \echo --- spoly ~ spoly --- spoly ~ spoly \echo --- should be true --- should be true \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; \echo \echo --- should be false --- should be false \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}'; \echo SELECT spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}' ~ spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}'; \echo \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' ~ spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; \echo \echo \echo --- spoly && spoly --- spoly && spoly \echo --- should be true --- should be true \echo SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-0.5d,-0.5d),(-0.5d,0.5d),(0.5d,0.5d),(0.5d,-0.5d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,0.5d),(0.5d,0.5d),(0.5d,0d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0d,0d),(0d,1d),(1d,0d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(45d,89.3d),(135d,89.3d),(225d,89.3d),(315d,89.3d)}'; \echo \echo SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(45d,89.2d),(135d,89.2d),(225d,89.2d),(315d,89.2d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; SELECT spoly '{(0d,0d),(0d,1d),(1d,1d),(1d,0d)}' && spoly '{(0.5d,0.5d),(0.5d,1.5d),(1.5d,1.5d),(1.5d,0.5d)}'; \echo SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,88d),(90d,88d),(180d,88d),(270d,88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo \echo --- should be false --- should be false \echo SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; SELECT spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}' && spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}'; \echo SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; SELECT spoly '{(0d,89d),(90d,89d),(180d,89d),(270d,89d)}' && spoly '{(0d,-88d),(90d,-88d),(180d,-88d),(270d,-88d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(3d,-1d),(3d,1d),(5d,1d),(5d,-1d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(3d,-1d),(3d,1d),(5d,1d),(5d,-1d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-1d,3d),(-1d,5d),(1d,5d),(1d,3d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(-1d,3d),(-1d,5d),(1d,5d),(1d,3d)}'; \echo SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(179d,-1d),(179d,1d),(181d,1d),(181d,-1d)}'; SELECT spoly '{(-1d,-1d),(-1d,1d),(1d,1d),(1d,-1d)}' && spoly '{(179d,-1d),(179d,1d),(181d,1d),(181d,-1d)}'; \echo pgsphere-1.5.1/upgrade_scripts/000077500000000000000000000000001461140101500165225ustar00rootroot00000000000000pgsphere-1.5.1/upgrade_scripts/contains-ops-fixes-1.sql.in000066400000000000000000000023001461140101500235320ustar00rootroot00000000000000-- catch up with the operator definitions that were fixed by commit bcdef9dcd2a8406d384f0d2cedd3aa349fd63cf3 DROP OPERATOR !~ (sline, spoint) CASCADE; DROP OPERATOR !@ (spoint, sline) CASCADE; DROP OPERATOR !~ (spoly, spoint) CASCADE; CREATE OPERATOR !~ ( LEFTARG = sline, RIGHTARG = spoint, PROCEDURE = sline_contains_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (sline, spoint) IS 'true if spherical line (LHS) does not contain spherical point (RHS)'; CREATE OPERATOR !@ ( LEFTARG = spoint, RIGHTARG = sline, PROCEDURE = sline_contains_point_com_neg, COMMUTATOR = '!~', NEGATOR = '@', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@ (spoint, sline) IS 'true if spherical point (LHS) is not contained by spherical line (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = spoint, PROCEDURE = spoly_contains_point_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, spoint) IS 'true if spherical polygon (LHS) does not contain spherical point (RHS)'; pgsphere-1.5.1/upgrade_scripts/contains-ops-fixes-2.sql.in000066400000000000000000000016561461140101500235500ustar00rootroot00000000000000-- fix typo in commutator of OPERATOR !@>(spoly, sellipse) (a.k.a. !~) introduced in commits 2798ed96f9282ddeee21d5ddd3e256bbb9b4f36f and 244c1549c492426b62bc926c9ac2ad21f3ccd0c1 DROP OPERATOR !@> (spoly, sellipse) CASCADE; DROP OPERATOR !~ (spoly, sellipse) CASCADE; CREATE OPERATOR !@> ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_contains_ellipse_neg, COMMUTATOR = '!<@', NEGATOR = '@>', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !@> (spoly, sellipse) IS 'true if spherical polygon (LHS) does not contain spherical ellipse (RHS)'; CREATE OPERATOR !~ ( LEFTARG = spoly, RIGHTARG = sellipse, PROCEDURE = spoly_contains_ellipse_neg, COMMUTATOR = '!@', NEGATOR = '~', RESTRICT = contsel, JOIN = contjoinsel ); COMMENT ON OPERATOR !~ (spoly, sellipse) IS 'true if spherical polygon (LHS) does not contain spherical ellipse (RHS)'; pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.0--1.0_gavo.sql.in000066400000000000000000000002071461140101500235610ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.0_gavo'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.0--1.1.5_from_2015-08-31.sql.in000066400000000000000000000002241461140101500250500ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5_from_2015-08-31'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.0--1.1.5_from_2016-02-07.sql.in000066400000000000000000000002241461140101500250460ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5_from_2016-02-07'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.0_gavo--1.1.5beta0gavo.sql.in000066400000000000000000000002151461140101500255150ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5beta0gavo'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.1.5--1.1.5.1.sql.in000066400000000000000000000002061461140101500232130ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5.1'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.1.5_from_2015-08-31--1.1.5.sql.in000066400000000000000000000002041461140101500252120ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.1.5_from_2016-02-07--1.1.5.sql.in000066400000000000000000000002041461140101500252100ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.1.5beta0gavo--1.1.5beta2gavo.sql.in000066400000000000000000000002151461140101500264400ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5beta2gavo'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.1.5beta2gavo--1.1.5beta4gavo.sql.in000066400000000000000000000002151461140101500264440ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.1.5beta4gavo'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.1.5beta4gavo--1.2.0.sql.in000066400000000000000000000002041461140101500246430ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.2.0'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.2.0--1.2.1.sql.in000066400000000000000000000002041461140101500230430ustar00rootroot00000000000000-- complain if this upgrade script is run via psql \echo Use "ALTER EXTENSION pg_sphere UPDATE TO '1.2.1'" to load this file. \quit pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.2.1--1.2.2-healpix.sql.in000066400000000000000000000031771461140101500245110ustar00rootroot00000000000000-- healpix ALTER FUNCTION nest2ring(integer, bigint) PARALLEL SAFE; ALTER FUNCTION ring2nest(integer, bigint) PARALLEL SAFE; ALTER FUNCTION healpix_convert_nest(integer, integer, bigint) PARALLEL SAFE; ALTER FUNCTION healpix_convert_ring(integer, integer, bigint) PARALLEL SAFE; ALTER FUNCTION nside2order(bigint) PARALLEL SAFE; ALTER FUNCTION order2nside(integer) PARALLEL SAFE; ALTER FUNCTION nside2npix(bigint) PARALLEL SAFE; ALTER FUNCTION npix2nside(bigint) PARALLEL SAFE; ALTER FUNCTION healpix_nest(integer, spoint) PARALLEL SAFE; ALTER FUNCTION healpix_ring(integer, spoint) PARALLEL SAFE; ALTER FUNCTION centre_of_healpix_nest(integer, bigint) PARALLEL SAFE; ALTER FUNCTION centre_of_healpix_ring(integer, bigint) PARALLEL SAFE; ALTER FUNCTION center_of_healpix_nest(integer, bigint) PARALLEL SAFE; ALTER FUNCTION center_of_healpix_ring(integer, bigint) PARALLEL SAFE; -- moc_type ALTER FUNCTION smoc_in(cstring) PARALLEL SAFE; ALTER FUNCTION smoc_out(smoc) PARALLEL SAFE; ALTER FUNCTION moc_debug() PARALLEL SAFE; ALTER FUNCTION set_smoc_output_type(integer) PARALLEL SAFE; ALTER FUNCTION max_order(smoc) PARALLEL SAFE; ALTER FUNCTION healpix_subset_smoc(bigint, smoc) PARALLEL SAFE; ALTER FUNCTION healpix_not_subset_smoc(bigint, smoc) PARALLEL SAFE; ALTER FUNCTION smoc_superset_healpix(smoc, bigint) PARALLEL SAFE; ALTER FUNCTION smoc_not_superset_healpix(smoc, bigint) PARALLEL SAFE; ALTER FUNCTION spoint_subset_smoc(spoint, smoc) PARALLEL SAFE; ALTER FUNCTION spoint_not_subset_smoc(spoint, smoc) PARALLEL SAFE; ALTER FUNCTION smoc_superset_spoint(smoc, spoint) PARALLEL SAFE; ALTER FUNCTION smoc_not_superset_spoint(smoc, spoint) PARALLEL SAFE; pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.2.1--1.2.2.sql.in000066400000000000000000000452641461140101500230640ustar00rootroot00000000000000-- gnomo ALTER FUNCTION gnomonic_proj(spoint, spoint) PARALLEL SAFE; ALTER FUNCTION gnomonic_inv(point, spoint) PARALLEL SAFE; -- sbox ALTER FUNCTION sbox(spoint, spoint) PARALLEL SAFE; ALTER FUNCTION sw(sbox) PARALLEL SAFE; ALTER FUNCTION se(sbox) PARALLEL SAFE; ALTER FUNCTION nw(sbox) PARALLEL SAFE; ALTER FUNCTION ne(sbox) PARALLEL SAFE; ALTER FUNCTION area(sbox) PARALLEL SAFE; ALTER FUNCTION circum(sbox) PARALLEL SAFE; ALTER FUNCTION sbox_equal(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_equal_neg(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_box(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_box_com(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_box_neg(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_box_com_neg(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_box(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_box_neg(sbox, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_cont_point_com(spoint, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_cont_point_com_neg(spoint, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_cont_point(sbox, spoint) PARALLEL SAFE; ALTER FUNCTION sbox_cont_point_neg(sbox, spoint) PARALLEL SAFE; ALTER FUNCTION sbox_contains_circle(sbox, scircle) PARALLEL SAFE; ALTER FUNCTION sbox_contains_circle_com(scircle, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_circle_neg(sbox, scircle) PARALLEL SAFE; ALTER FUNCTION sbox_contains_circle_com_neg(scircle, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_circle(sbox, scircle) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_circle_com(scircle, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_circle_neg(sbox, scircle) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_circle_com_neg(scircle, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_line(sbox, sline) PARALLEL SAFE; ALTER FUNCTION sbox_contains_line_com(sline, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_line_neg(sbox, sline) PARALLEL SAFE; ALTER FUNCTION sbox_contains_line_com_neg(sline, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_line(sbox, sline) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_line_com(sline, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_line_neg(sbox, sline) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_line_com_neg(sline, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_ellipse(sbox, sellipse) PARALLEL SAFE; ALTER FUNCTION sbox_contains_ellipse_com(sellipse, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_ellipse_neg(sbox, sellipse) PARALLEL SAFE; ALTER FUNCTION sbox_contains_ellipse_com_neg(sellipse, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_ellipse(sbox, sellipse) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_ellipse_com(sellipse, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_ellipse_neg(sbox, sellipse) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_ellipse_com_neg(sellipse, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_poly(sbox, spoly) PARALLEL SAFE; ALTER FUNCTION sbox_contains_poly_com(spoly, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_poly_neg(sbox, spoly) PARALLEL SAFE; ALTER FUNCTION sbox_contains_poly_com_neg(spoly, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_poly(sbox, spoly) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_poly_com(spoly, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_poly_neg(sbox, spoly) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_poly_com_neg(spoly, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_path(sbox, spath) PARALLEL SAFE; ALTER FUNCTION sbox_contains_path_com(spath, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_contains_path_neg(sbox, spath) PARALLEL SAFE; ALTER FUNCTION sbox_contains_path_com_neg(spath, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_path(sbox, spath) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_path_com(spath, sbox) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_path_neg(sbox, spath) PARALLEL SAFE; ALTER FUNCTION sbox_overlap_path_com_neg(spath, sbox) PARALLEL SAFE; ALTER FUNCTION scircle_contains_box(scircle, sbox) PARALLEL SAFE; ALTER FUNCTION scircle_contains_box_com(sbox, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_box_neg(scircle, sbox) PARALLEL SAFE; ALTER FUNCTION scircle_contains_box_com_neg(sbox, scircle) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_box(sellipse, sbox) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_box_com(sbox, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_box_neg(sellipse, sbox) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_box_com_neg(sbox, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_contains_box(spoly, sbox) PARALLEL SAFE; ALTER FUNCTION spoly_contains_box_com(sbox, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_box_neg(spoly, sbox) PARALLEL SAFE; ALTER FUNCTION spoly_contains_box_com_neg(sbox, spoly) PARALLEL SAFE; -- scircle ALTER FUNCTION area(scircle) PARALLEL SAFE; ALTER FUNCTION radius(scircle) PARALLEL SAFE; ALTER FUNCTION scircle(spoint, float8) PARALLEL SAFE; ALTER FUNCTION scircle(spoint) PARALLEL SAFE; ALTER FUNCTION scircle_equal(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_equal_neg(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_overlap(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_overlap_neg(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION center(scircle) PARALLEL SAFE; ALTER FUNCTION circum(scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contained_by_circle(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contained_by_circle_neg(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_circle(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_circle_neg(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION spoint_contained_by_circle(spoint, scircle) PARALLEL SAFE; ALTER FUNCTION spoint_contained_by_circle_neg(spoint, scircle) PARALLEL SAFE; ALTER FUNCTION spoint_contained_by_circle_com(scircle, spoint) PARALLEL SAFE; ALTER FUNCTION spoint_contained_by_circle_com_neg(scircle, spoint) PARALLEL SAFE; ALTER FUNCTION dist(scircle, scircle) PARALLEL SAFE; ALTER FUNCTION dist(scircle, spoint) PARALLEL SAFE; ALTER FUNCTION dist(spoint, scircle) PARALLEL SAFE; ALTER FUNCTION strans_circle(scircle, strans) PARALLEL SAFE; ALTER FUNCTION strans_circle_inverse(scircle, strans) PARALLEL SAFE; -- sellipse ALTER FUNCTION sellipse(spoint, float8, float8, float8) PARALLEL SAFE; ALTER FUNCTION inc(sellipse) PARALLEL SAFE; ALTER FUNCTION lrad(sellipse) PARALLEL SAFE; ALTER FUNCTION srad(sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse(spoint) PARALLEL SAFE; ALTER FUNCTION scircle(sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse(scircle) PARALLEL SAFE; ALTER FUNCTION strans(sellipse) PARALLEL SAFE; ALTER FUNCTION center(sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_equal(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_equal_neg(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_ellipse(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_ellipse_com(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_ellipse_neg(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_ellipse_com_neg(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_ellipse(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_ellipse_neg(sellipse, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_point(sellipse, spoint) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_point_com(spoint, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_point_neg(sellipse, spoint) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_point_com_neg(spoint, sellipse) PARALLEL SAFE; ALTER FUNCTION strans_ellipse(sellipse, strans) PARALLEL SAFE; ALTER FUNCTION strans_ellipse_inverse(sellipse, strans) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_circle(sellipse, scircle) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_circle_com(scircle, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_circle_neg(sellipse, scircle) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_circle_com_neg(scircle, sellipse) PARALLEL SAFE; ALTER FUNCTION scircle_contains_ellipse(scircle, sellipse) PARALLEL SAFE; ALTER FUNCTION scircle_contains_ellipse_com(sellipse, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_ellipse_neg(scircle, sellipse) PARALLEL SAFE; ALTER FUNCTION scircle_contains_ellipse_com_neg(sellipse, scircle) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_circle(sellipse, scircle) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_circle_com(scircle, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_circle_neg(sellipse, scircle) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_circle_com_neg(scircle, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_line(sellipse, sline) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_line_com(sline, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_line_neg(sellipse, sline) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_line_com_neg(sline, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_line(sellipse, sline) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_line_com(sline, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_line_neg(sellipse, sline) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_line_com_neg(sline, sellipse) PARALLEL SAFE; -- euler ALTER FUNCTION strans_zxz(strans) PARALLEL SAFE; ALTER FUNCTION strans(FLOAT8, FLOAT8, FLOAT8) PARALLEL SAFE; ALTER FUNCTION strans(FLOAT8, FLOAT8, FLOAT8, CSTRING) PARALLEL SAFE; ALTER FUNCTION phi(strans) PARALLEL SAFE; ALTER FUNCTION theta(strans) PARALLEL SAFE; ALTER FUNCTION psi(strans) PARALLEL SAFE; ALTER FUNCTION axes(strans) PARALLEL SAFE; ALTER FUNCTION strans_equal(strans, strans) PARALLEL SAFE; ALTER FUNCTION strans_not_equal(strans, strans) PARALLEL SAFE; ALTER FUNCTION strans(strans) PARALLEL SAFE; ALTER FUNCTION strans_invert(strans) PARALLEL SAFE; ALTER FUNCTION strans_point(spoint, strans) PARALLEL SAFE; ALTER FUNCTION strans_point_inverse(spoint, strans) PARALLEL SAFE; ALTER FUNCTION strans_trans(strans, strans) PARALLEL SAFE; ALTER FUNCTION strans_trans_inv(strans, strans) PARALLEL SAFE; -- gist ALTER FUNCTION pointkey_volume(pointkey) PARALLEL SAFE; ALTER FUNCTION pointkey_area(pointkey) PARALLEL SAFE; ALTER FUNCTION pointkey_perimeter(pointkey) PARALLEL SAFE; -- sline ALTER FUNCTION sline(spoint, spoint) PARALLEL SAFE; ALTER FUNCTION sline(strans, float8) PARALLEL SAFE; ALTER FUNCTION meridian(float8) PARALLEL SAFE; ALTER FUNCTION sl_beg(sline) PARALLEL SAFE; ALTER FUNCTION sl_end(sline) PARALLEL SAFE; ALTER FUNCTION strans(sline) PARALLEL SAFE; ALTER FUNCTION sline(spoint) PARALLEL SAFE; ALTER FUNCTION sline_equal(sline, sline) PARALLEL SAFE; ALTER FUNCTION sline_equal_neg(sline, sline) PARALLEL SAFE; ALTER FUNCTION length(sline) PARALLEL SAFE; ALTER FUNCTION swap(sline) PARALLEL SAFE; ALTER FUNCTION turn(sline) PARALLEL SAFE; ALTER FUNCTION sline_crosses(sline, sline) PARALLEL SAFE; ALTER FUNCTION sline_crosses_neg(sline, sline) PARALLEL SAFE; ALTER FUNCTION sline_overlap(sline, sline) PARALLEL SAFE; ALTER FUNCTION sline_overlap_neg(sline, sline) PARALLEL SAFE; ALTER FUNCTION sline_contains_point(sline, spoint) PARALLEL SAFE; ALTER FUNCTION sline_contains_point_com(spoint, sline) PARALLEL SAFE; ALTER FUNCTION sline_contains_point_neg(sline, spoint) PARALLEL SAFE; ALTER FUNCTION sline_contains_point_com_neg(spoint, sline) PARALLEL SAFE; ALTER FUNCTION strans_line(sline, strans) PARALLEL SAFE; ALTER FUNCTION strans_line_inverse(sline, strans) PARALLEL SAFE; ALTER FUNCTION sline_overlap_circle(sline, scircle) PARALLEL SAFE; ALTER FUNCTION sline_overlap_circle_com(scircle, sline) PARALLEL SAFE; ALTER FUNCTION sline_overlap_circle_neg(sline, scircle) PARALLEL SAFE; ALTER FUNCTION sline_overlap_circle_com_neg(scircle, sline) PARALLEL SAFE; ALTER FUNCTION scircle_contains_line(scircle, sline) PARALLEL SAFE; ALTER FUNCTION scircle_contains_line_com(sline, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_line_neg(scircle, sline) PARALLEL SAFE; ALTER FUNCTION scircle_contains_line_com_neg(sline, scircle) PARALLEL SAFE; -- spath ALTER FUNCTION npoints(spath) PARALLEL SAFE; ALTER FUNCTION spoint(spath, int4) PARALLEL SAFE; ALTER FUNCTION spoint(spath, float8) PARALLEL SAFE; ALTER FUNCTION spath_equal(spath, spath) PARALLEL SAFE; ALTER FUNCTION spath_equal_neg(spath, spath) PARALLEL SAFE; ALTER FUNCTION length(spath) PARALLEL SAFE; ALTER FUNCTION swap(spath) PARALLEL SAFE; ALTER FUNCTION spath_overlap_path(spath, spath) PARALLEL SAFE; ALTER FUNCTION spath_overlap_path_neg(spath, spath) PARALLEL SAFE; ALTER FUNCTION spath_contains_point(spath, spoint) PARALLEL SAFE; ALTER FUNCTION spath_contains_point_com(spoint, spath) PARALLEL SAFE; ALTER FUNCTION spath_contains_point_neg(spath, spoint) PARALLEL SAFE; ALTER FUNCTION spath_contains_point_com_neg(spoint, spath) PARALLEL SAFE; ALTER FUNCTION strans_path(spath, strans) PARALLEL SAFE; ALTER FUNCTION strans_path_inverse(spath, strans) PARALLEL SAFE; ALTER FUNCTION scircle_contains_path(scircle, spath) PARALLEL SAFE; ALTER FUNCTION scircle_contains_path_com(spath, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_path_neg(scircle, spath) PARALLEL SAFE; ALTER FUNCTION scircle_contains_path_com_neg(spath, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_overlap_path(scircle, spath) PARALLEL SAFE; ALTER FUNCTION scircle_overlap_path_com(spath, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_overlap_path_neg(scircle, spath) PARALLEL SAFE; ALTER FUNCTION scircle_overlap_path_com_neg(spath, scircle) PARALLEL SAFE; ALTER FUNCTION spath_overlap_line(spath, sline) PARALLEL SAFE; ALTER FUNCTION spath_overlap_line_com(sline, spath) PARALLEL SAFE; ALTER FUNCTION spath_overlap_line_neg(spath, sline) PARALLEL SAFE; ALTER FUNCTION spath_overlap_line_com_neg(sline, spath) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_path(sellipse, spath) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_path_com(spath, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_path_neg(sellipse, spath) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_path_com_neg(spath, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_path(sellipse, spath) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_path_com(spath, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_path_neg(sellipse, spath) PARALLEL SAFE; ALTER FUNCTION sellipse_overlap_path_com_neg(spath, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_contains_path(spoly, spath) PARALLEL SAFE; ALTER FUNCTION spoly_contains_path_com(spath, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_path_neg(spoly, spath) PARALLEL SAFE; ALTER FUNCTION spoly_contains_path_com_neg(spath, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_path(spoly, spath) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_path_com(spath, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_path_neg(spoly, spath) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_path_com_neg(spath, spoly) PARALLEL SAFE; ALTER FUNCTION spath_add_point_aggr(spath, spoint) PARALLEL SAFE; ALTER FUNCTION spath_add_points_fin_aggr(spath) PARALLEL SAFE; -- spoint ALTER FUNCTION spoint(FLOAT8, FLOAT8) PARALLEL SAFE; ALTER FUNCTION long(spoint) PARALLEL SAFE; ALTER FUNCTION lat(spoint) PARALLEL SAFE; ALTER FUNCTION x(spoint) PARALLEL SAFE; ALTER FUNCTION y(spoint) PARALLEL SAFE; ALTER FUNCTION xyz(spoint) PARALLEL SAFE; ALTER FUNCTION z(spoint) PARALLEL SAFE; ALTER FUNCTION spoint_equal(spoint, spoint) PARALLEL SAFE; ALTER FUNCTION spoint_equal_neg(spoint, spoint) PARALLEL SAFE; ALTER FUNCTION dist(spoint, spoint) PARALLEL SAFE; -- spoly ALTER FUNCTION npoints(spoly) PARALLEL SAFE; ALTER FUNCTION area(spoly) PARALLEL SAFE; ALTER FUNCTION spoly_equal(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_not_equal(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION circum(spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_polygon(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_polygon_com(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_polygon_neg(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_polygon_com_neg(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_polygon(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_polygon_neg(spoly, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_point(spoly, spoint) PARALLEL SAFE; ALTER FUNCTION spoly_contains_point_com(spoint, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_point_neg(spoly, spoint) PARALLEL SAFE; ALTER FUNCTION spoly_contains_point_com_neg(spoint, spoly) PARALLEL SAFE; ALTER FUNCTION strans_poly(spoly, strans) PARALLEL SAFE; ALTER FUNCTION strans_poly_inverse(spoly, strans) PARALLEL SAFE; ALTER FUNCTION spoly_contains_circle(spoly, scircle) PARALLEL SAFE; ALTER FUNCTION spoly_contains_circle_com(scircle, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_circle_neg(spoly, scircle) PARALLEL SAFE; ALTER FUNCTION spoly_contains_circle_com_neg(scircle, spoly) PARALLEL SAFE; ALTER FUNCTION scircle_contains_polygon(scircle, spoly) PARALLEL SAFE; ALTER FUNCTION scircle_contains_polygon_com(spoly, scircle) PARALLEL SAFE; ALTER FUNCTION scircle_contains_polygon_neg(scircle, spoly) PARALLEL SAFE; ALTER FUNCTION scircle_contains_polygon_com_neg(spoly, scircle) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_circle(spoly, scircle) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_circle_com(scircle, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_circle_neg(spoly, scircle) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_circle_com_neg(scircle, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_line(spoly, sline) PARALLEL SAFE; ALTER FUNCTION spoly_contains_line_com(sline, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_line_neg(spoly, sline) PARALLEL SAFE; ALTER FUNCTION spoly_contains_line_com_neg(sline, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_line(spoly, sline) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_line_com(sline, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_line_neg(spoly, sline) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_line_com_neg(sline, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_ellipse(spoly, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_contains_ellipse_com(sellipse, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_contains_ellipse_neg(spoly, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_contains_ellipse_com_neg(sellipse, spoly) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_polygon(sellipse, spoly) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_polygon_com(spoly, sellipse) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_polygon_neg(sellipse, spoly) PARALLEL SAFE; ALTER FUNCTION sellipse_contains_polygon_com_neg(spoly, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_ellipse(spoly, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_ellipse_com(sellipse, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_ellipse_neg(spoly, sellipse) PARALLEL SAFE; ALTER FUNCTION spoly_overlap_ellipse_com_neg(sellipse, spoly) PARALLEL SAFE; ALTER FUNCTION spoly_add_point_aggr(spoly, spoint) PARALLEL SAFE; ALTER FUNCTION spoly_add_points_fin_aggr(spoly) PARALLEL SAFE; -- gist_spoint3 ALTER FUNCTION g_spoint3_penalty(internal, internal, internal) PARALLEL SAFE; ALTER FUNCTION g_spoint3_fetch(internal) PARALLEL SAFE; pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.2.2--1.2.3.sql.in000066400000000000000000000000441461140101500230510ustar00rootroot00000000000000-- Nothing to upgrade in the schema pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.2.3--1.3.0.sql.in000066400000000000000000000055551461140101500230640ustar00rootroot00000000000000CREATE FUNCTION scircle_deg(spoint, float8) RETURNS scircle AS 'MODULE_PATHNAME' , 'spherecircle_by_center_deg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION scircle_deg(spoint, float8) IS 'spherical circle with spherical point as center and float8 as radius in degrees'; CREATE FUNCTION spoint_deg(FLOAT8, FLOAT8) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepoint_from_long_lat_deg' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint_deg(FLOAT8, FLOAT8) IS 'returns a spherical point from longitude (arg1, in degrees), latitude (arg2, in degrees)'; CREATE FUNCTION spoly_deg(float8[]) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_deg' LANGUAGE 'c' IMMUTABLE STRICT; COMMENT ON FUNCTION spoly_deg(float8[]) IS ' Create spoly from array of points. Two consecutive numbers among those present refer to the same occurrence and cover its latitude and longitude, respectively.'; CREATE FUNCTION spath_as_array(spath) RETURNS spoint[] AS 'MODULE_PATHNAME', 'spherepath_get_array' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spath_as_array(spath) IS 'returns spath as array of points'; CREATE FUNCTION spoint(spoly, int4) RETURNS spoint AS 'MODULE_PATHNAME', 'spherepoly_get_point' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoint(spoly, int4) IS 'returns n-th point of spherical polygon'; CREATE FUNCTION spoly_as_array(spoly) RETURNS spoint[] AS 'MODULE_PATHNAME', 'spherepoly_get_array' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly_as_array(spoly) IS 'returns spoly as array of points'; CREATE FUNCTION dist(sline, spoint) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'sphereline_point_distance' LANGUAGE 'c' IMMUTABLE STRICT; COMMENT ON FUNCTION dist(sline, spoint) IS 'returns the distance between spherical line and spherical point'; CREATE OPERATOR <-> ( LEFTARG = sline, RIGHTARG = spoint, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (sline, spoint) IS 'returns the distance between spherical line and spherical point'; CREATE FUNCTION dist(spoint, sline) RETURNS FLOAT8 AS 'MODULE_PATHNAME', 'sphereline_point_distance_com' LANGUAGE 'c' IMMUTABLE STRICT; COMMENT ON FUNCTION dist(spoint, sline) IS 'returns the distance between spherical line and spherical point'; CREATE OPERATOR <-> ( LEFTARG = spoint, RIGHTARG = sline, COMMUTATOR = '<->', PROCEDURE = dist ); COMMENT ON OPERATOR <-> (spoint, sline) IS 'returns the distance between spherical line and spherical point'; CREATE FUNCTION spoly_is_convex(spoly) RETURNS BOOL AS 'MODULE_PATHNAME', 'spherepoly_is_convex' LANGUAGE 'c' IMMUTABLE PARALLEL SAFE; COMMENT ON FUNCTION spoly_is_convex(spoly) IS 'true if spherical polygon is convex'; pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.3.0--1.3.1.sql.in000066400000000000000000000000441461140101500230470ustar00rootroot00000000000000-- Nothing to upgrade in the schema pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.3.1--1.4.0.sql.in000066400000000000000000000024501461140101500230530ustar00rootroot00000000000000-- add "fetch" support function to enable index-only scans for spoint3 -- g_spoint3_fetch was already part of the spoint3 opclass in older versions -- around 1.0, but later made optional (see bdc37d1) DO $$ BEGIN ALTER OPERATOR FAMILY spoint3 USING gist ADD FUNCTION 9 (spoint, spoint) g_spoint3_fetch (internal); EXCEPTION WHEN duplicate_object THEN NULL; WHEN OTHERS THEN RAISE; END; $$; -- remove legacy spellings of operators DROP OPERATOR IF EXISTS @(bigint, smoc); DROP OPERATOR IF EXISTS @(spoint, smoc); -- add spoly function that takes an array of float8 values in radians CREATE FUNCTION spoly(float8[]) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_rad' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly(float8[]) IS 'creates spoly from array of numbers in radians'; CREATE FUNCTION spoly(spoint[]) RETURNS spoly AS 'MODULE_PATHNAME', 'spherepoly_from_point_array' LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE; COMMENT ON FUNCTION spoly(spoint[]) IS 'creates spoly from an array of points'; -- add PARALLEL SAFE to spoly_deg(float8[]) ALTER FUNCTION spoly_deg(float8[]) IMMUTABLE STRICT PARALLEL SAFE; -- update comment on spoly_deg function COMMENT ON FUNCTION spoly_deg(float8[]) IS 'creates spoly from array of numbers in degrees'; pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.4.2--1.5.0.sql.in000066400000000000000000000011041461140101500230510ustar00rootroot00000000000000-- Upgrade: 1.4.2 -> 1.5.0 CREATE OR REPLACE FUNCTION g_spoint_distance(internal, spoint, smallint, oid, internal) RETURNS internal AS 'MODULE_PATHNAME', 'g_spoint_distance' LANGUAGE 'c'; DO $$ BEGIN ALTER OPERATOR FAMILY spoint USING gist ADD FUNCTION 8 (spoint, spoint) g_spoint_distance (internal, spoint, smallint, oid, internal); EXCEPTION WHEN duplicate_object THEN NULL; WHEN OTHERS THEN RAISE; END; $$; CREATE FUNCTION reset_sphere_output_precision() RETURNS CSTRING AS 'MODULE_PATHNAME', 'reset_sphere_output_precision' LANGUAGE 'c'; pgsphere-1.5.1/upgrade_scripts/pg_sphere--1.5.0--1.5.1.sql.in000066400000000000000000000003501461140101500230530ustar00rootroot00000000000000-- Upgrade: 1.5.0 -> 1.5.1 DO $$ BEGIN ALTER OPERATOR FAMILY spoint USING gist ADD OPERATOR 17 <-> (spoint, spoint) FOR ORDER BY float_ops; EXCEPTION WHEN duplicate_object THEN NULL; WHEN OTHERS THEN RAISE; END; $$; pgsphere-1.5.1/upgrade_scripts/pgs_gist_contains_ops.sql.in000066400000000000000000000045601461140101500242530ustar00rootroot00000000000000ALTER OPERATOR FAMILY spoint USING gist ADD OPERATOR 37 <@ (spoint, scircle), OPERATOR 38 <@ (spoint, sline), OPERATOR 39 <@ (spoint, spath), OPERATOR 40 <@ (spoint, spoly), OPERATOR 41 <@ (spoint, sellipse), OPERATOR 42 <@ (spoint, sbox); ALTER OPERATOR FAMILY scircle USING gist ADD OPERATOR 37 <@ (scircle, scircle), OPERATOR 38 <@ (scircle, spoly), OPERATOR 39 <@ (scircle, sellipse), OPERATOR 40 <@ (scircle, sbox), OPERATOR 43 @> (scircle, spoint), OPERATOR 44 @> (scircle, scircle), OPERATOR 45 @> (scircle, sline), OPERATOR 46 @> (scircle, spath), OPERATOR 47 @> (scircle, spoly), OPERATOR 48 @> (scircle, sellipse), OPERATOR 49 @> (scircle, sbox); ALTER OPERATOR FAMILY sline USING gist ADD OPERATOR 37 <@ (sline, scircle), OPERATOR 38 <@ (sline, spoly), OPERATOR 39 <@ (sline, sellipse), OPERATOR 40 <@ (sline, sbox), OPERATOR 43 @> (sline, spoint); ALTER OPERATOR FAMILY sellipse USING gist ADD OPERATOR 37 <@ (sellipse, scircle), OPERATOR 38 <@ (sellipse, spoly), OPERATOR 39 <@ (sellipse, sellipse), OPERATOR 40 <@ (sellipse, sbox), OPERATOR 43 @> (sellipse, spoint), OPERATOR 44 @> (sellipse, scircle), OPERATOR 45 @> (sellipse, sline), OPERATOR 46 @> (sellipse, spath), OPERATOR 47 @> (sellipse, spoly), OPERATOR 48 @> (sellipse, sellipse), OPERATOR 49 @> (sellipse, sbox); ALTER OPERATOR FAMILY spoly USING gist ADD OPERATOR 37 <@ (spoly, scircle), OPERATOR 38 <@ (spoly, spoly), OPERATOR 39 <@ (spoly, sellipse), OPERATOR 40 <@ (spoly, sbox), OPERATOR 43 @> (spoly, spoint), OPERATOR 44 @> (spoly, scircle), OPERATOR 45 @> (spoly, sline), OPERATOR 46 @> (spoly, spath), OPERATOR 47 @> (spoly, spoly), OPERATOR 48 @> (spoly, sellipse), OPERATOR 49 @> (spoly, sbox); ALTER OPERATOR FAMILY spath USING gist ADD OPERATOR 37 <@ (spath, scircle), OPERATOR 38 <@ (spath, spoly), OPERATOR 39 <@ (spath, sellipse), OPERATOR 40 <@ (spath, sbox), OPERATOR 43 @> (spath, spoint); ALTER OPERATOR FAMILY sbox USING gist ADD OPERATOR 37 <@ (sbox, scircle), OPERATOR 38 <@ (sbox, spoly), OPERATOR 39 <@ (sbox, sellipse), OPERATOR 40 <@ (sbox, sbox), OPERATOR 43 @> (sbox, spoint), OPERATOR 44 @> (sbox, scircle), OPERATOR 45 @> (sbox, sline), OPERATOR 46 @> (sbox, spath), OPERATOR 47 @> (sbox, spoly), OPERATOR 48 @> (sbox, sellipse), OPERATOR 49 @> (sbox, sbox); pgsphere-1.5.1/upgrade_scripts/pgs_gist_drop_spoint2.sql.in000066400000000000000000000013071461140101500241720ustar00rootroot00000000000000DROP OPERATOR CLASS IF EXISTS spoint2 USING gist CASCADE; DROP FUNCTION IF EXISTS g_spoint2_union(bytea, internal) CASCADE; DROP FUNCTION IF EXISTS g_spoint2_penalty (internal, internal, internal) CASCADE; DROP FUNCTION IF EXISTS g_spoint2_picksplit(internal, internal) CASCADE; DROP FUNCTION IF EXISTS g_spoint2_same (bytea, bytea, internal) CASCADE; DROP FUNCTION IF EXISTS g_spoint2_compress(internal) CASCADE; DROP FUNCTION IF EXISTS g_spoint2_consistent(internal, internal, int4, oid, internal) CASCADE; DROP FUNCTION IF EXISTS g_spoint2_distance(internal, internal, int4, oid) CASCADE; DROP FUNCTION IF EXISTS crossmatch(text, text, float8); DROP FUNCTION IF EXISTS crossmatch(text, text, float8, sbox);