NAME=postgis
SO_MAJOR_VERSION=0
SO_MINOR_VERSION=8
+SO_MICRO_VERSION=2
ifeq (${USE_VERSION}, 71)
MODULE_FILENAME = $(LPATH)/$(shlib)
MODULE_INSTALLDIR = $(libdir)
# Postgis version
#---------------------------------------------------------------
+POSTGIS_LIB_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_MICRO_VERSION)
POSTGIS_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
#---------------------------------------------------------------
override CFLAGS += -g -fexceptions
override CFLAGS += -I$(srcdir) -DFRONTEND -DSYSCONFDIR='"$(sysconfdir)"'
override CFLAGS += -DUSE_VERSION=$(USE_VERSION)
+override CFLAGS += -DPOSTGIS_LIB_VERSION='"$(POSTGIS_LIB_VERSION)"'
ifeq ($(USE_GEOS),1)
override CFLAGS += -I$(GEOS_DIR)/include -DUSE_GEOS
*
**********************************************************************
* $Log$
+ * Revision 1.47 2004/07/22 16:20:09 strk
+ * Added postgis_lib_version() and postgis_geos_version()
+ *
* Revision 1.46 2004/06/09 09:06:55 strk
* Added Romi's Win32 patches.
*
Datum line_interpolate_point(PG_FUNCTION_ARGS);
Datum fluffType(PG_FUNCTION_ARGS);
+Datum postgis_lib_version(PG_FUNCTION_ARGS);
+Datum postgis_geos_version(PG_FUNCTION_ARGS);
/*--------------------------------------------------------------------
* Useful floating point utilities and constants.
-----------------------------------------------------------------------
-- POSTGIS_VERSION()
-----------------------------------------------------------------------
+CREATEFUNCTION postgis_lib_version() RETURNS cstring
+ AS '@MODULE_FILENAME@'
+ LANGUAGE 'C';
+
+CREATEFUNCTION postgis_geos_version() RETURNS cstring
+ AS '@MODULE_FILENAME@'
+ LANGUAGE 'C';
+
CREATEFUNCTION postgis_version() RETURNS text
AS 'SELECT \'@POSTGIS_VERSION@\'::text AS version'
LANGUAGE 'sql';
*
**********************************************************************
* $Log$
+ * Revision 1.37 2004/07/22 16:20:10 strk
+ * Added postgis_lib_version() and postgis_geos_version()
+ *
* Revision 1.36 2004/06/03 16:44:56 strk
* Added expand_geometry - expand(geometry, int8)
*
PG_FREE_IF_COPY(geom1,0);
PG_RETURN_POINTER(g);
}
+
+PG_FUNCTION_INFO_V1(postgis_lib_version);
+Datum postgis_lib_version(PG_FUNCTION_ARGS)
+{
+ char *result = pstrdup(POSTGIS_LIB_VERSION);
+ PG_RETURN_CSTRING(result);
+}
*
**********************************************************************
* $Log$
+ * Revision 1.33 2004/07/22 16:20:10 strk
+ * Added postgis_lib_version() and postgis_geos_version()
+ *
* Revision 1.32 2004/07/01 17:02:05 strk
* Updated to support latest GEOS (actually removed all geos-version related
* switches).
extern char GEOSisEmpty(Geometry *g1);
extern char *GEOSGeometryType(Geometry *g1);
extern int GEOSGeometryTypeId(Geometry *g1);
+extern char *GEOSversion();
extern void GEOSdeleteChar(char *a);
PG_RETURN_POINTER(result);
}
+PG_FUNCTION_INFO_V1(postgis_geos_version);
+Datum postgis_geos_version(PG_FUNCTION_ARGS)
+{
+ char *ver = GEOSversion();
+ char *result = pstrdup(ver);
+ free(ver);
+ PG_RETURN_CSTRING(result);
+}
+
//----------------------------------------------------------------------------
// NULL implementation here
// ---------------------------------------------------------------------------
PG_RETURN_NULL();
}
-PG_FUNCTION_INFO_V1(GEOSversion);
-Datum GEOSversion(PG_FUNCTION_ARGS)
+PG_FUNCTION_INFO_V1(postgis_geos_version);
+Datum postgis_geos_version(PG_FUNCTION_ARGS)
{
- elog(ERROR,"GEOSversion:: operation not implemented - compile PostGIS with GEOS support");
+ //elog(ERROR,"GEOSversion:: operation not implemented - compile PostGIS with GEOS support");
PG_RETURN_NULL();
}
/*
* $Log$
+* Revision 1.26 2004/07/22 16:20:10 strk
+* Added postgis_lib_version() and postgis_geos_version()
+*
* Revision 1.25 2004/07/17 09:52:48 strk
* GEOS multi-version support switches implemented with GEOS_LAST_INTERFACE
*
using namespace geos;
-
-
//WARNING THIS *MUST* BE SET CORRECTLY.
int MAXIMUM_ALIGNOF = -999999; // to be set during initialization - this will be either 4 (intel) or 8 (sparc)
extern "C" char GEOSrelateWithin(Geometry *g1, Geometry*g2);
extern "C" char GEOSrelateContains(Geometry *g1, Geometry*g2);
extern "C" char GEOSrelateOverlaps(Geometry *g1, Geometry*g2);
-
+extern "C" char *GEOSversion();
extern "C" Geometry *PostGIS2GEOS_point(POINT3D *point,int SRID, bool is3d);
extern "C" Geometry *PostGIS2GEOS_linestring(const LINE3D *line,int SRID, bool is3d);
}
}
+char *
+GEOSversion()
+{
+#if GEOS_LAST_INTERFACE < 2
+ /*
+ * GEOS upgrade needs postgis re-build, so this static
+ * assignment is not going to be a problem
+ */
+ char *res = strdup("GEOS 1.0.0 ported from JTS-1.3");
+#else
+ string version = geos::version();
+ char *res = strdup(version.c_str());
+#endif
+ return res;
+}
*
**********************************************************************
* $Log$
+ * Revision 1.17 2004/07/22 16:20:10 strk
+ * Added postgis_lib_version() and postgis_geos_version()
+ *
* Revision 1.16 2004/04/28 22:26:02 pramsey
* Fixed spelling mistake in header text.
*
}
-#else
+#else // ! defined USE_PROJ
// return the original geometry
PG_FUNCTION_INFO_V1(transform_geom);