Skip to content

Commit 99ad98c

Browse files
committed
Initial.
0 parents  commit 99ad98c

Some content is hidden

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

108 files changed

+52149
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.o
2+
*.so
3+
*.sql
4+
results
5+
regression.out
6+
regression.diffs

COPYRIGHT.pg_sphere

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2003-2010, pgSphere development team
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
* Neither the name of the pgSphere development team nor the names of its
13+
contributors may be used to endorse or promote products derived from
14+
this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+
POSSIBILITY OF SUCH DAMAGE.
27+

Makefile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
MODULE_big = pg_sphere
2+
OBJS = sscan.o sparse.o sbuffer.o vector3d.o point.o \
3+
euler.o circle.o line.o ellipse.o polygon.o \
4+
path.o box.o output.o gq_cache.o gist.o key.o \
5+
crossmatch.o
6+
7+
DATA_built = pg_sphere.sql
8+
DOCS = README.pg_sphere COPYRIGHT.pg_sphere
9+
REGRESS = init tables points euler circle line ellipse poly path box index
10+
EXTRA_CLEAN = pg_sphere.sql pg_sphere.sql.in $(PGS_SQL)
11+
12+
CRUSH_TESTS = init_extended circle_extended
13+
14+
# order of sql files is important
15+
PGS_SQL = pgs_types.sql pgs_point.sql pgs_euler.sql pgs_circle.sql \
16+
pgs_line.sql pgs_ellipse.sql pgs_polygon.sql pgs_path.sql \
17+
pgs_box.sql pgs_gist.sql pgs_crossmatch.sql
18+
19+
ifdef USE_PGXS
20+
ifndef PG_CONFIG
21+
PG_CONFIG := pg_config
22+
endif
23+
PGXS := $(shell $(PG_CONFIG) --pgxs)
24+
include $(PGXS)
25+
else
26+
subdir = contrib/pg_sphere
27+
top_builddir = ../..
28+
PG_CONFIG := $(top_builddir)/src/bin/pg_config/pg_config
29+
include $(top_builddir)/src/Makefile.global
30+
include $(top_srcdir)/contrib/contrib-global.mk
31+
endif
32+
33+
PGVERSION += $(shell $(PG_CONFIG) --version | sed 's,^PostgreSQL[[:space:]][[:space:]]*,,' | awk '{ split($$1,a,"."); printf( "v%02d%02d%02d" ,a[1], a[2], a[3]); }' )
34+
35+
crushtest: REGRESS += $(CRUSH_TESTS)
36+
crushtest: installcheck
37+
38+
pg_sphere.sql.in : $(addsuffix .in, $(PGS_SQL))
39+
echo 'BEGIN;' > $@
40+
for i in $+ ; do $(AWK) -v pg_version=$(PGVERSION) -f sql.awk < $$i >> $@ ; done
41+
echo 'COMMIT;' >> $@
42+
43+
sscan.o : sparse.c
44+
45+
sparse.c: sparse.y
46+
ifdef YACC
47+
$(YACC) -d $(YFLAGS) -p sphere_yy -o sparse.c $<
48+
else
49+
@$(missing) bison $< $@
50+
endif
51+
52+
sscan.c : sscan.l
53+
ifdef FLEX
54+
$(FLEX) $(FLEXFLAGS) -Psphere -o$@ $<
55+
else
56+
@$(missing) flex $< $@
57+
endif
58+
59+
dist : clean sparse.c sscan.c
60+
find . -name '*~' -type f -exec rm {} \;
61+
cd .. && tar --exclude CVS -czf pg_sphere.tar.gz pg_sphere && cd -
62+

README.pg_sphere

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
This is R-Tree implementation using GiST for spherical objects
2+
like spherical points and spherical circles with
3+
useful functions and operators.
4+
5+
6+
NOTICE:
7+
This version will works only with postgresql version 8.0 and above.
8+
9+
INSTALLATION:
10+
11+
gmake
12+
gmake install
13+
-- load functions
14+
psql <database> < pg_sphere.sql
15+
16+
REGRESSION TEST:
17+
18+
gmake installcheck
19+
20+
LONG REGRESSION TEST:
21+
22+
gmake crushtest
23+
24+
For more informations have a look at http://pgsphere.projects.postgresql.org/
25+
26+
Have a lot of fun!
27+

0 commit comments

Comments
 (0)