[postgis] New stuff in the CVS version

Dave Blasby dblasby at refractions.net
Tue Jun 26 11:44:49 PDT 2001


I've been very busy improving PostGIS.  Currently its only available in
the CVS version (see #4 below).  We'll make a release once its been
tested more completely and the documentation has caught up to it.

1. Having one huge .c file was a pain, so we now have 4 .c files

        + postgis_debug.c -- debuging function (not really useful except
to
developers)
        + postgis_fn.c    -- generic function (like length() )
        + postgis_ops.c   -- operators and indexing functions
        + postgis_inout.c -- type support fns and data conversion fns

2. I've added a bunch more function.  You'll recognize them from the
OGIS Simple Feature Specification for SQL.  Does anyone want to add more
functions or change the behaviour of these?

        dimension(GEOMETRY) -- returns 2 if its a 2d geometry, 3 if its
3d
        geometrytype(GEOMETRY) -- returns the type of
dimension(GEOMETRY) (ie
"LINESTRING")
        envelope(GEOMETRY)   -- returns a POLYGON(..), representing the
bounding box of GEOMETRY

        X(GEOMETRY) -- find the first POINT(..) in GEOMETRY, returns its
X
value.  Return NULL if there is no POINT(..) in GEOMETRY
        Y(GEOMETRY) -- find the first POINT(..) in GEOMETRY, returns its
Y
value.  Return NULL if there is no POINT(..) in GEOMETRY
        Z(GEOMETRY) -- find the first POINT(..) in GEOMETRY, returns its
Z
value.  Return NULL if there is no POINT(..) in GEOMETRY


        numpoints(GEOMETRY) -- find the first linestring in GEOMETRY,
return
the number of points in it.  Return NULL if there is no LINESTRING(..)
in GEOMETRY
        pointn(GEOMETRY,INTEGER) -- find the first linestring in
GEOMETRY,
return the point at index INTEGER (0 is 1st point).  Return NULL if
there is no LINESTRING(..) in GEOMETRY or INTEGER is out of bounds.

        exteriorRing(GEOMETRY) -- find the first polygon in GEOMETRY,
return
its exterior ring (as a linestring).  Return NULL if there is no
POLYGON(..) in GEOMETRY. 
        NumInteriorRings(GEOMETRY) -- find the first polygon in
GEOMETRY,
return the number of interior rings.  Return NULL if there is no
POLYGON(..) in GEOMETRY.
        InteriorRingN(GEOMETRY,INTEGER) --  find the first polygon in
GEOMETRY,
return the interior ring at index INTEGER (as a linestring).  Return
NULL if there is no POLYGON(..) in GEOMETRY or INTEGER is out of bounds.

        numgeometries(GEOMETRY) -- if GEOMETRY is a GEOMETRYCOLLECTION,
return
the number of geometries in it, otherwise return NULL.
        geometryN(GEOMETRY, INTEGER) -- if GEOMETRY is a
GEOMETRYCOLLECTION,
return the sub-geometry at index INTEGER (0=first geometry), otherwise
return NULL.   NOTE: MULTIPOINT, MULTILINESTRING,MULTIPOLYGON are
converted to sets of POINT,LINESTRING, and POLYGON so the index may
change.  For example, for 'GEOMETRYCOLLECTION(MULTIPOINT(1 1, 2 2))'
index 0 is POINT(1 1) and index 1 is POINT(2 2).


3. Other functions
        I added some programmer contructors for making GEOMETRY types,
POINTs, LINESTRINGs, and POLYGONs.


4. Paul has a CVS server running, so you can also get the most
up-to-date version.  For details, see the main page
(http://postgis.refractions.net).  I believe its updated every hour.

5. I'll probably be removing Rtree support soon, since the RTree index
cannot handle GEOMETRY with size >8kb, and it takes forever to build. 
Use the GiST index instead.

dave

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list