diff --git a/.travis.yml b/.travis.yml index 4df87d5..0d199cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ dist: focal before_install: # extra apt.pg.o.sh options added in version 204, travis currently has 199 (2019-11-27) - sudo apt-get -qq update - - sudo apt-get -y install postgresql-common libhealpix-cxx-dev docbook-dsssl docbook-xml openjade + - sudo apt-get -y install postgresql-common libhealpix-cxx-dev docbook-xml docbook-xsl libxml2-utils xsltproc fop install: - sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -p -v $PG_SUPPORTED_VERSIONS -i @@ -40,4 +40,3 @@ script: - pg_virtualenv make USE_HEALPIX=0 crushtest - if test -s regression.diffs; then cat regression.diffs; exit 1; fi - make -C doc - - sudo make -C doc install diff --git a/Makefile b/Makefile index c8287ae..5dbdac2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ -PGSPHERE_VERSION = 1.3.1 -EXTENSION = pg_sphere + +include Makefile.common.mk + RELEASE_SQL = $(EXTENSION)--$(PGSPHERE_VERSION).sql USE_PGXS = 1 USE_HEALPIX =? 1 diff --git a/Makefile.common.mk b/Makefile.common.mk new file mode 100644 index 0000000..f3893a9 --- /dev/null +++ b/Makefile.common.mk @@ -0,0 +1,8 @@ +#---------------------------------------------------------------------------- +# +# pgSphere common definitions +# +#---------------------------------------------------------------------------- + +EXTENSION := pg_sphere +PGSPHERE_VERSION := 1.3.1 diff --git a/doc/Makefile b/doc/Makefile index a607103..11894ff 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,90 +1,103 @@ #---------------------------------------------------------------------------- # -# pgSphere documentation makefile +# pgSphere documentation generation # #---------------------------------------------------------------------------- -USE_PGXS = 1 -ifdef USE_PGXS -PG_CONFIG = pg_config -PGXS := $(shell $(PG_CONFIG) --pgxs) -include $(PGXS) -else -subdir = contrib/pg_sphere/doc -top_builddir = ../../.. -include $(top_builddir)/src/Makefile.global -include $(top_srcdir)/contrib/contrib-global.mk +ifndef PGSPHERE_VERSION +include ../Makefile.common.mk +ifndef PGSPHERE_VERSION +$(error PGSPHERE_VERSION is not set) +endif endif -.SECONDARY: -.NOTPARALLEL: +ifndef FOP +FOP = fop +endif -ifndef COLLATEINDEX -COLLATEINDEX = $(DOCBOOKSTYLE)/bin/collateindex.pl +ifdef XMLLINT +XMLLINT := $(XMLLINT) --nonet +else +XMLLINT = xmllint --nonet endif -ifndef JADE -JADE = openjade +ifdef XSLTPROC +XSLTPROC := $(XSLTPROC) --nonet +else +XSLTPROC = xsltproc --nonet endif -SGMLINCLUDE = -D $(srcdir) -ALLSGML := $(wildcard $(srcdir)/*.sgm) +override XSLTPROCFLAGS += \ + --path stylesheets --path img --path . \ + --stringparam pg_sphere.version '$(PGSPHERE_VERSION)' \ + --stringparam pg.version '$(PGSPHERE_VERSION)' -ifdef DOCBOOKSTYLE -CATALOG = -c $(DOCBOOKSTYLE)/catalog -endif +XMLINCLUDE = --path . +ALLSGML := $(wildcard *.sgm) +ALLIMAGES := $(wildcard img/*.jpg) -COLLATEINDEX := $(PERL) $(COLLATEINDEX) -f -g +all: html pdf +.PHONY: all html pdf clean -all : html +# This line fixes the error like: +# No rule to make target 'pg_sphere.control' +.PHONY: pg_sphere.control -.PHONY: html pdf ps +version.xml: + @echo $(PGSPHERE_VERSION) > version.xml -XMLDCL = declaration/xml.dcl +pg_sphere-full.xml: version.xml +pg_sphere-full.xml: pg_sphere.xml $(ALLSGML) + $(XMLLINT) $(XMLINCLUDE) --output $@ --noent --valid $< -html : pg_sphere.xml $(ALLSGML) pg_sphere.dsl - @rm -f *.html - @rm -rf html - mkdir html - mkdir html/img - cp img/*.jpg img/*.png html/img - cp pg_sphere.css html - $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -b UTF-8 -d pg_sphere.dsl -i html -t sgml $(XMLDCL) $< - mv *.html html +#------------------------------------------------------------------------------ +# HTML +#------------------------------------------------------------------------------ -pg_sphere.tex : pg_sphere.xml $(ALLSGML) pg_sphere.dsl - $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d pg_sphere.dsl -i print -t tex -o $@ $(XMLDCL) $< +XSLTPROC_HTML_MULTIPAGE_FLAGS := --stringparam img.src.path '' +XSLTPROC_HTML_SINGLEPAGE_FLAGS := --stringparam img.src.path '' -pdf : jadetex.cfg pg_sphere.pdf +html: html-singlepage html-multipage -pg_sphere.pdf: pg_sphere.tex - @rm -f $*.aux $*.log $*.out - pdfjadetex $< - pdfjadetex $< - pdfjadetex $< +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 -ps : pg_sphere.ps +html-singlepage: pg_sphere-$(PGSPHERE_VERSION).html -pg_sphere.ps: pg_sphere.pdf - pdftops $< $@ +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,$^) -pg_sphere.dsl : pg_sphere.dsl-dist - cp $< $@ +#------------------------------------------------------------------------------ +# PDF +#------------------------------------------------------------------------------ -jadetex.cfg : jadetex.cfg-dist - cp $< $@ +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 $@ -## -## Clean -## +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 -clean distclean maintainer-clean: -# HTML - rm -rf html pg_sphere.dsl -# print - rm -f *.rtf *.tex *.dvi *.aux *.log *.ps *.pdf *.out *.fot jadetex.cfg -# img - make clean -C img +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 diff --git a/doc/appendixes.sgm b/doc/appendixes.sgm index 46b87cc..5bd221e 100644 --- a/doc/appendixes.sgm +++ b/doc/appendixes.sgm @@ -19,7 +19,7 @@ - This version is compatible to PostgreSQL 8.4 + This version is compatible to PostgreSQL 8.4 @@ -66,5 +66,5 @@ - + diff --git a/doc/constructors.sgm b/doc/constructors.sgm index 5fefff7..e14dd3f 100644 --- a/doc/constructors.sgm +++ b/doc/constructors.sgm @@ -1,7 +1,6 @@ - - - Constructors - + + Constructors + Constructors within pgSphere are functions needed to create spherical data types from other data @@ -14,7 +13,7 @@ mentioned here. - + Point @@ -44,9 +43,9 @@ - + - + Euler transformation @@ -90,9 +89,9 @@ - + - + Circle @@ -110,7 +109,7 @@ 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°. + to be larger than or equal to zero but less or equal to 90°. Otherwise, this function returns an error. @@ -134,18 +133,18 @@ - + - + Line The input of spherical lines using Euler transformation and - length is quite circumstantial (see ). + 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 @@ -155,13 +154,13 @@ If the distance between begin and - end is 180° (&pgr;), this function - returns an error because the location of the line is undefined. + 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 @@ -212,9 +211,9 @@ - + - + Ellipse @@ -238,7 +237,7 @@ 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. + incl is the inclination angle in radians. For more informations about ellipses, see . @@ -263,9 +262,9 @@ - + - + Polygon @@ -318,9 +317,9 @@ - + - + Path @@ -371,9 +370,9 @@ - + - + Coordinates range @@ -403,9 +402,9 @@ SELECT sbox ( spoint '(0d,0d),(10d,10d)' );]]> - + - + <type>smoc</type> @@ -449,6 +448,6 @@ creates an smoc of the given order covering the spoly - + - + diff --git a/doc/examples.sgm b/doc/examples.sgm index 0886691..1590b43 100644 --- a/doc/examples.sgm +++ b/doc/examples.sgm @@ -1,37 +1,18 @@ - - - Usage examples - - - - General - - - tbw - - - - - - Geographical - - - tbw - - - - + + 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, - + @@ -39,7 +20,7 @@ - &OHgr; + &pg_OHgr; longitude of the ascending node @@ -51,7 +32,7 @@ - &ohgr; + &pg_ohgr; argument of pericenter @@ -79,22 +60,22 @@ object from an old into a new coordinate system using: - object - strans '&ohgr;, i, &OHgr;' + object - strans '&pg_ohgr;, i, &pg_OHgr;' or - object - strans (&ohgr;, i, &OHgr;) + 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 '&ohgr;, i, &OHgr;' + object + strans '&pg_ohgr;, i, &pg_OHgr;' or - object + strans (&ohgr;, i, &OHgr;) + 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 - &OHgr;=30°, i=60° and &ohgr;=90°. We get the + &pg_OHgr;=30°, i=60° and &pg_ohgr;=90°. We get the spherical position of perihelion and aphelion with: @@ -117,6 +98,7 @@ - - - + + + + diff --git a/doc/functions.sgm b/doc/functions.sgm index d5bb457..6093c33 100644 --- a/doc/functions.sgm +++ b/doc/functions.sgm @@ -1,13 +1,13 @@ - - - Functions - + + Functions + The functions described below are implemented without having an operator. If you are missing some functions, see and use the operators. - + + Area function @@ -18,7 +18,7 @@ is convex), sbox, and smoc. - Area of a spherical circle as a multiple of &pgr; + Area of a spherical circle as a multiple of &pg_pgr; SELECT area( scircle '<(0d,90d),60d>' ) / pi() AS area;]]> @@ -32,14 +32,14 @@ - + - + <type>spoint</type> functions - + Longitude and latitude @@ -76,9 +76,9 @@ - + - + Cartesian coordinates @@ -140,16 +140,16 @@ - + - - - + + + <type>strans</type> functions - + Converting to ZXZ @@ -169,9 +169,9 @@ SELECT strans_zxz ( strans '20d, -270d, 70.5d, XZY' );]]> - + - + Angles and axes @@ -249,12 +249,12 @@ - + - + - + scircle functions @@ -275,9 +275,9 @@ - + - + <type>sellipse</type> functions @@ -338,10 +338,10 @@ - To get the ellipse center, you can use the + To get the ellipse center, you can use the operator @@ () instead of using the function - center(sellipse). + center(sellipse). Get the minor radius of an ellipse @@ -355,14 +355,14 @@ - - - + + + <type>sline</type> functions - + Begin and end @@ -386,9 +386,9 @@ SELECT sl_beg( sline '(10d, 90d, 270d, ZXZ ), 20d';]]> - + - + Create a meridian @@ -423,14 +423,14 @@ - - - - + + + + <type>spath</type> functions - + Count of points @@ -455,10 +455,10 @@ - - - - + + + + Positions at a path @@ -532,19 +532,19 @@ - - - - + + + + <type>spoly</type> functions - + Count of edges - Similar to an spath (), + Similar to an spath (), you can get the count of edges of a spherical polygon using the function: @@ -565,8 +565,8 @@ - - + + Positions at a polygon @@ -617,9 +617,9 @@ - + - + Spoly is convex @@ -643,11 +643,11 @@ - + - + - + <type>sbox</type> functions @@ -683,9 +683,9 @@ SELECT sw ( sbox '( (0d,0d), (90d,0d) )' ) ;]]> - + - + <type>smoc</type> functions @@ -778,14 +778,14 @@ - + - + Epoch propagation - + 6-Parameter Epoch Propagation @@ -804,15 +804,15 @@ applies proper motion to positions) - Following both pg_sphere and, where missing, astronomical + 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 + 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, + 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 @@ -839,7 +839,7 @@ Propagating Barnard's star into the past - - + + Epoch Propagation of Positions Only @@ -890,7 +890,7 @@ FROM ( - As with epoch_prop itself, missing values (except for pos and + 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). @@ -898,14 +898,15 @@ FROM ( Barnard's star, position and proper motion - - - + + + + diff --git a/doc/indices.sgm b/doc/indices.sgm index 11940c2..0ef179f 100644 --- a/doc/indices.sgm +++ b/doc/indices.sgm @@ -1,8 +1,7 @@ - - - Create an index - - + + Indexes + + Spherical index @@ -27,7 +26,7 @@ linkend="op.over">&&, #, =, and !=. + linkend="op.equal">!=. You can create a GiST index with the following spherical data types: @@ -84,7 +83,7 @@ - BRIN index can be created through the following syntax: + BRIN index can be created through the following syntax: @@ -102,9 +101,9 @@ - + - + <type>smoc</type> index @@ -143,6 +142,6 @@ - + - + diff --git a/doc/install.sgm b/doc/install.sgm index 39ebaf9..f1c4b54 100644 --- a/doc/install.sgm +++ b/doc/install.sgm @@ -1,19 +1,18 @@ - - - Installation - - + + Installation + + Download - - pgSphere is not part of the PostgreSQL software. + + pgSphere is not part of the PostgreSQL software. You can download it from the pgSphere homepage - https://github.com/akorotkov/pgsphere + https://github.com/postgrespro/pgsphere - + - + Installation @@ -27,9 +26,9 @@ There are two ways to compile pgSphere. The first is to copy the sources into the contribution directory of - PostgreSQL's source tree + PostgreSQL's source tree (POSTGRESQL_SRC/src/contrib). - Then, change into POSTGRESQL_SRC/src/contrib. + Then, change into POSTGRESQL_SRC/src/contrib. If the sources are not yet installed and the directory pg_sphere does not exist, take the gzipped pgSphere sources ( e. g., @@ -82,43 +81,43 @@ make installcheck]]> - The check status will be displayed. Please note, the check gives different results with + The check status will be displayed. Please note, the check gives different results with different PostgreSQL-versions. Currently, the check should run without errors with PostgreSQL-version 8.4. Otherwise check the file regression.diff. - - - - + + + + Creating a database with <application>pgSphere</application> We assume you have already created a database datab, where datab - is the name of any database. + is the name of any database. Presupposing the name of your PostgreSQL's superuser is postgres, type: - psql -U postgres -c 'CREATE EXTENSION pg_sphere;' datab]]> + psql -U postgres -c 'CREATE EXTENSION pg_sphere' datab]]> Depending on your system, it may be necessary to give more - psql options like port or host name. + psql options like port or host name. Please have a look at the PostgreSQL documentation for more details. - To get the version of installed pgSphere software, simply + To get the version of installed pgSphere software, simply call: SELECT pg_sphere_version();]]> - - - + + + diff --git a/doc/jadetex.cfg-dist b/doc/jadetex.cfg-dist deleted file mode 100644 index d7917b9..0000000 --- a/doc/jadetex.cfg-dist +++ /dev/null @@ -1,14 +0,0 @@ -\hypersetup{ - pdftitle={pgSphere}, - pdfsubject={user guide}, - pdfauthor={pgSphere developer team}, - pdfkeywords={spherical PostgreSQL SQL}, - bookmarksopen=true, - bookmarksopenlevel=2, - colorlinks=true, - linkcolor=blue, - pdfpagemode=UseOutlines, - pdfstartview=FitH -} -\usepackage{url} -\tolerance=2000 diff --git a/doc/operators.sgm b/doc/operators.sgm index 73ebb83..c2d8902 100644 --- a/doc/operators.sgm +++ b/doc/operators.sgm @@ -1,8 +1,7 @@ - - - Operators - - + + Operators + + Casting @@ -120,9 +119,9 @@ - - - + + + Equality @@ -144,9 +143,9 @@ - - - + + + Contain and overlap @@ -156,7 +155,7 @@ a contained by object b? or Does object a overlap object - b? + b? pgSphere supports such queries using binary operators returning true or false: @@ -298,9 +297,9 @@ - + - + Crossing of lines @@ -320,9 +319,9 @@ - - - + + + Distance @@ -358,9 +357,9 @@ - - - + + + Length and circumference @@ -395,9 +394,9 @@ - + - + Center @@ -415,9 +414,9 @@ SELECT @@ scircle '<(0d,20d),30d>';]]> - + - + Change the direction @@ -433,15 +432,15 @@ 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 + 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. @@ -450,7 +449,7 @@ The operator ! returns NULL, if the length of sline argument is 0, because the path of returned sline - is undefined. + is undefined. Return length and check if north pole on <type>sline</type>s @@ -490,9 +489,9 @@ - + - + Transformation @@ -561,9 +560,9 @@ - + - + <type>smoc</type> operators @@ -590,6 +589,6 @@ - + - + diff --git a/doc/pg_sphere.css b/doc/pg_sphere.css deleted file mode 100644 index 2b7c85d..0000000 --- a/doc/pg_sphere.css +++ /dev/null @@ -1,182 +0,0 @@ -/* similar to PostgreSQL.org Documentation Style */ - -body { - margin: 1em; - padding: 1em; - font-size: 85%; - font-family: verdana, sans-serif; - color: #000; - background-color: #fff; -} - -h1 { - font-size: 1.4em; - font-weight: bold; - margin-top: 0em; - margin-bottom: 0em; -} - -h2 { - font-size: 1.2em; - margin: 1.2em 0em 1.2em 0em; - font-weight: bold; -} - -h3 { - font-size: 1.0em; - margin: 1.2em 0em 1.2em 0em; - font-weight: bold; -} - -h4 { - font-size: 0.95em; - margin: 1.2em 0em 1.2em 0em; - font-weight: normal; -} - -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; -} - -img { - border: 0; -} - -ol, ul, li { - font-size: 1.0em; - line-height: 1.2em; - margin-top: 0.2em; - margin-bottom: 0.1em; -} - -p { - font-size: 1.0em; - line-height: 1.2em; - margin: 1.2em 0em 1.2em 0em; -} - -li > p { - margin-top: 0.2em; -} - -pre { - font-family: monospace; - font-size: 1.2em; - margin: 0em; -} - -strong, b { - font-weight: bold; -} - -h1 { - font-weight: bold; - color: #EC5800; - font-size: 1.4em; -} - -h2 { - font-weight: bold; - color: #666; - font-size: 1.2em; -} - -h3 { - font-weight: bold; - color: #666; - font-size: 1.1em; -} - -h4 { - color: #666; -} - -/* Text Styles */ - -.txtCurrentLocation { - font-weight: bold; -} - -p, ol, ul, li { - line-height: 1.5em; -} - -table.CALSTABLE { - width: 50%; -} - -table.CALSTABLE td { - vertical-align : top; -} - -/* Link Styles */ - -a:link { color:#0066A2; text-decoration: underline; } -a:visited { color:#004E66; text-decoration: underline; } -a:active { color:#0066A2; text-decoration: underline; } -a:hover { color:#000000; text-decoration: underline; } - - -pre.programlisting, -blockquote.note, -blockquote.tip -{ - -moz-border-radius: 8px 8px 8px 8px; - -moz-box-shadow: 3px 3px 5px #DFDFDF; - color: black; - margin: 1ex 0ex 1ex 1ex; - padding: 1ex; - border-style: solid; - border-width: 1px; -} - - -/* Programlisting */ -pre.programlisting { - background-color: #F7F7F7; - border-color: #CFCFCF; - font-family: monospace; - text-align: left; -} - -div.note { - margin-top: 4ex; -} - -blockquote.note, -blockquote.tip -{ - padding-top: 0ex; - background-color: #FDFDEE; - border-color: #DBDBCC; -} - - -.literal, -.parameter, -.funcsynopsis, -.function -{ - font-size: 130%; -} - -div.table table tr td { - padding: 0.5ex; -} - -div.example p b { - font-size : 70%; - font-style: italic; -} - -div.NAVFOOTER { - margin-top: 5ex; -} \ No newline at end of file diff --git a/doc/pg_sphere.dsl-dist b/doc/pg_sphere.dsl-dist deleted file mode 100644 index a658c78..0000000 --- a/doc/pg_sphere.dsl-dist +++ /dev/null @@ -1,330 +0,0 @@ - - - - - -]]> - - -]]> - -]> - - - - - - -;; PAPER - - - - -string (time) #t))) - '("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=utf-8")) - ) -) - -(define %stylesheet% "pg_sphere.css") - -(define %generate-article-titlepage% - ;; produce a title page for articles - #t) - -(define (chunk-skip-first-element-list) - ;; forces the Table of Contents on separate page - '()) - -(define (list-element-list) - ;; fixes bug in Table of Contents generation - '()) - -(define %root-filename% - ;; The filename of the root HTML document (e.g, "index"). - "index") - -(define ($shade-verbatim-attr$) - ;; REFENTRY shade-verbatim-attr - ;; PURP Attributes used to create a shaded verbatim environment. - ;; DESC - ;; See '%shade-verbatim%' - ;; /DESC - ;; AUTHOR N/A - ;; /REFENTRY - (list - (list "BORDER" "0") - (list "BGCOLOR" "#F7F7F7") - (list "WIDTH" ($table-width$)))) - -;; ...but we need to do some extra work to make the above apply to PRE -;; as well. (mostly pasted from dbverb.dsl) -(define ($verbatim-display$ indent line-numbers?) - (let ((content (make element gi: "PRE" - attributes: (list - (list "CLASS" (gi))) - (if (or indent line-numbers?) - ($verbatim-line-by-line$ indent line-numbers?) - (process-children))))) - (if %shade-verbatim% - (make element gi: "TABLE" - attributes: ($shade-verbatim-attr$) - (make element gi: "TR" - (make element gi: "TD" - content))) - (make sequence - (para-check) - content - (para-check 'restart))))) - -(define %shade-verbatim% - ;; verbatim sections will be shaded if t(rue) - #f) - -(define %use-id-as-filename% - ;; Use ID attributes as name for component HTML files? - #t) - -(define %graphic-extensions% - ;; graphic extensions allowed - '("jpg" "jpeg" "png")) - -(define %graphic-default-extension% - "jpg") - -(define %section-autolabel% - ;; For enumerated sections (1.1, 1.1.1, 1.2, etc.) - #t) - -(define (toc-depth nd) - ;; more depth (3 levels) to toc; instead of flat hierarchy - 2) - -(element emphasis - ;; make role=strong equate to bold for emphasis tag - (if (equal? (attribute-string "role") "strong") - (make element gi: "STRONG" (process-children)) - (make element gi: "EM" (process-children)))) - -(define (article-titlepage-recto-elements) - ;; elements on an article's titlepage - (list (normalize "title") - (normalize "subtitle") - (normalize "authorgroup") - (normalize "author") - (normalize "othercredit") - (normalize "releaseinfo") - (normalize "copyright") - (normalize "pubdate") - (normalize "revhistory") - (normalize "abstract") - (normalize "legalnotice"))) - -(define (article-title nd) - (let* ((artchild (children nd)) - (artheader (select-elements artchild (normalize "artheader"))) - (artinfo (select-elements artchild (normalize "articleinfo"))) - (ahdr (if (node-list-empty? artheader) - artinfo - artheader)) - (ahtitles (select-elements (children ahdr) - (normalize "title"))) - (artitles (select-elements artchild (normalize "title"))) - (titles (if (node-list-empty? artitles) - ahtitles - artitles))) - (if (node-list-empty? titles) - "" - (node-list-first titles)))) - -(mode subtitle-mode - ;; do not print subtitle on subsequent pages - (element subtitle (empty-sosofo))) - -;; notes. -(element note - (make sequence - (para-check) - ($admonition$) - (para-check 'restart))) - -]]> - - - - - - - diff --git a/doc/pg_sphere.xml b/doc/pg_sphere.xml index 950a530..1ca32a7 100644 --- a/doc/pg_sphere.xml +++ b/doc/pg_sphere.xml @@ -1,7 +1,7 @@ - @@ -25,50 +25,29 @@ +&ohgr;"> +&OHgr;"> +&pgr;"> + + ]> + + + + pgSphere &pg_sphere_version; + pgSphere Development Team + pgSphere + &pg_sphere_version; + -
- - - pgSphere 1.3.0 - - - pgSphere development team - - - - - - - - - - - pgSphere provides spherical data - types, functions, and operators for - PostgreSQL. - - - The project is hosted at - https://github.com/postgrespro/pgsphere - - - - This document - describes installation and usage of this module. - - - - &capWhatis; - &capInstall; - &capTypes; - &capConstr; - &capOperators; - &capFunctions; - &capIndices; - &capExamples; - &capFaq; - &capAppendixes; + &capWhatis; + &capInstall; + &capTypes; + &capConstr; + &capOperators; + &capFunctions; + &capIndices; + &capExamples; -
+
diff --git a/doc/stylesheets/stylesheet-common.xsl b/doc/stylesheets/stylesheet-common.xsl new file mode 100644 index 0000000..c739f03 --- /dev/null +++ b/doc/stylesheets/stylesheet-common.xsl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + 1 + 0 + + + + +yes +2 + + + + + + + + + +1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ? + + ? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/stylesheets/stylesheet-fo.xsl b/doc/stylesheets/stylesheet-fo.xsl new file mode 100644 index 0000000..19f368f --- /dev/null +++ b/doc/stylesheets/stylesheet-fo.xsl @@ -0,0 +1,147 @@ + + + + + + + + +3 + + + +1.5em + + + wrap + + + + solid + 1pt + black + 12pt + 12pt + 6pt + 6pt + + + + center + + + + + left + + + + + 1em + 0.8em + 1.2em + + + + + + + + + + + + , + + + + + + + + ISBN + + + + + + + + + + + + + + + + -3.5em + + + + + + + + + + -3.5em + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/stylesheets/stylesheet-html-common.xsl b/doc/stylesheets/stylesheet-html-common.xsl new file mode 100644 index 0000000..a368e0e --- /dev/null +++ b/doc/stylesheets/stylesheet-html-common.xsl @@ -0,0 +1,439 @@ + + +%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 + + / + + + [@ + + = ' + + '] + + + + + + + + +
diff --git a/doc/stylesheets/stylesheet-html-nochunk.xsl b/doc/stylesheets/stylesheet-html-nochunk.xsl new file mode 100644 index 0000000..5a0bb4e --- /dev/null +++ b/doc/stylesheets/stylesheet-html-nochunk.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/stylesheets/stylesheet-man.xsl b/doc/stylesheets/stylesheet-man.xsl new file mode 100644 index 0000000..fcb485c --- /dev/null +++ b/doc/stylesheets/stylesheet-man.xsl @@ -0,0 +1,226 @@ + + + + + + + + + +0 +0 +0 + + + +32 +40 + + + + + + + + + + + + + + < + + > + + + + + + ^ + + + + + + + + + + + + + + + + ( + + + + + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + Note: + + + + + + + + + + + + + + + + + + + + + + + + + Note: + (soelim stub) + + + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/stylesheets/stylesheet-speedup-common.xsl b/doc/stylesheets/stylesheet-speedup-common.xsl new file mode 100644 index 0000000..e3fb582 --- /dev/null +++ b/doc/stylesheets/stylesheet-speedup-common.xsl @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +en + + diff --git a/doc/stylesheets/stylesheet-speedup-xhtml.xsl b/doc/stylesheets/stylesheet-speedup-xhtml.xsl new file mode 100644 index 0000000..da0f2b5 --- /dev/null +++ b/doc/stylesheets/stylesheet-speedup-xhtml.xsl @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: If you change $chunk.section.depth, then you must update the performance-optimized chunk-all-sections-template. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/stylesheets/stylesheet-text.xsl b/doc/stylesheets/stylesheet-text.xsl new file mode 100644 index 0000000..529cc9e --- /dev/null +++ b/doc/stylesheets/stylesheet-text.xsl @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + +
  • + + + + +
  • +
    + + + + + * + + * + + + + + + + + + + + + + + +
    + + + + + + +

    + + + : + +

    +
    + + +
    +
    + + + + +
    + +
    + + +
    + +
    + + +
    + +
    + +
    diff --git a/doc/stylesheets/stylesheet.css b/doc/stylesheets/stylesheet.css new file mode 100644 index 0000000..86a8edb --- /dev/null +++ b/doc/stylesheets/stylesheet.css @@ -0,0 +1,182 @@ +/* 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; +} diff --git a/doc/stylesheets/stylesheet.css.xml b/doc/stylesheets/stylesheet.css.xml new file mode 100644 index 0000000..a21fcca --- /dev/null +++ b/doc/stylesheets/stylesheet.css.xml @@ -0,0 +1,8 @@ + + +]> + diff --git a/doc/stylesheets/stylesheet.xsl b/doc/stylesheets/stylesheet.xsl new file mode 100644 index 0000000..6b39d91 --- /dev/null +++ b/doc/stylesheets/stylesheet.xsl @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/types.sgm b/doc/types.sgm index 557c144..acb3c54 100644 --- a/doc/types.sgm +++ b/doc/types.sgm @@ -1,8 +1,7 @@ - - - Data types - - + + Data Types + + Overview @@ -100,9 +99,9 @@ - - - + + + Point @@ -118,28 +117,28 @@ - sites on earth + sites on earth - star positions on the sky sphere + star positions on the sky sphere - spherical positions on planets + 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&pgr;. Latitude is a floating point - value, too, but between -&pgr;/2 and - &pgr;/2. It is possible to give a + 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 @@ -189,10 +188,10 @@ longitude and latitude. The value pairs are always enclosed within braces. Spaces are optional. - - - + + + Euler transformation @@ -210,12 +209,12 @@ - spherical object transformations + spherical object transformations - spherical coordinates transformations + spherical coordinates transformations @@ -226,7 +225,7 @@ where axes is an optional 3 letter code with letters : X, Y, or - Z. Default is ZXZ. + Z. Default is ZXZ. angleN is any valid angle with the input format RAD, DEG, or DMS. @@ -263,9 +262,9 @@ SELECT strans '2d 20m, 10d, 0';]]> - - - + + + Circle @@ -289,12 +288,12 @@ - round cluster or nebula on sky sphere + round cluster or nebula on sky sphere - a position with an undirected position error + a position with an undirected position error @@ -318,9 +317,9 @@ SELECT scircle '< (0d, 90d), 5d >';]]> - + - + Line @@ -336,12 +335,12 @@ - direct connection of two points + direct connection of two points - meteors on the sky sphere + meteors on the sky sphere @@ -395,9 +394,9 @@ i syntax is a somewhat complex. SELECT sline '( -90d, -20d, 200d, XYZ ), 30d ';]]> - - - + + + Ellipses @@ -432,7 +431,7 @@ i syntax is a somewhat complex. - to describe a position error + to describe a position error @@ -442,12 +441,12 @@ i syntax is a somewhat complex. - a major radius rad_1 + a major radius rad_1 - a minor radius rad_2 + a minor radius rad_2 @@ -505,9 +504,9 @@ i syntax is a somewhat complex. SELECT sellipse '< { 10d, 5d } , ( 20d, 0d ), 90d >';]]> - + - + Path @@ -523,7 +522,7 @@ i syntax is a somewhat complex. - rivers on earth + rivers on earth @@ -548,7 +547,7 @@ i syntax is a somewhat complex. - At least 2 positions are required. + At least 2 positions are required. @@ -565,9 +564,9 @@ i syntax is a somewhat complex. SELECT spath '{ (10d,0d),(45d,15d),(80d,30d) } ';]]> - + - + Polygon @@ -582,7 +581,7 @@ i syntax is a somewhat complex. 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 + Polygons within pgSphere have the same input syntax as paths: {pos1,pos2,pos3[,pos4[,... ]]} @@ -598,7 +597,7 @@ i syntax is a somewhat complex. - The line segments can not be crossed. + The line segments can not be crossed. @@ -621,9 +620,9 @@ i syntax is a somewhat complex. SELECT spoly '{ (270d,-10d), (270d,30d), (290d,10d) } ';]]> - + - + Coordinates range @@ -689,9 +688,9 @@ i syntax is a somewhat complex. SELECT sbox '( (350d,-10d), (10d,+10d) )';]]> - + - + <type>smoc</type>: HEALPix Multi-Order Coverage map @@ -750,5 +749,6 @@ i syntax is a somewhat complex. 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';]]> - - + + + diff --git a/doc/whatis.sgm b/doc/whatis.sgm index 6af690b..eb12bf1 100644 --- a/doc/whatis.sgm +++ b/doc/whatis.sgm @@ -1,4 +1,7 @@ - + + Overview + + What is pgSphere? @@ -15,7 +18,7 @@ - containing, overlapping, and other operators + containing, overlapping, and other operators @@ -30,17 +33,17 @@ - spherical transformation + spherical transformation - indexing of spherical data types + indexing of spherical data types - several input and output formats + several input and output formats @@ -48,17 +51,19 @@ Hence, you can do a fast search and analysis for objects with spherical attributes as used in geographical, astronomical, or - other applications using PostgreSQL. + 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 + 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. - + + +