Changeset: 129f2ff547bf for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=129f2ff547bf Modified Files: geom/monetdb5/geom_upgrade.c sql/backends/monet5/sql_upgrades.c Branch: default Log Message:
Removed upgrade from Jun2016 branch; tidied up geom upgrade. diffs (truncated from 8991 to 300 lines): diff --git a/geom/monetdb5/geom_upgrade.c b/geom/monetdb5/geom_upgrade.c --- a/geom/monetdb5/geom_upgrade.c +++ b/geom/monetdb5/geom_upgrade.c @@ -182,4146 +182,4279 @@ geom_sql_upgrade(int olddb) /* drop old functions */ if (olddb) { - pos += snprintf(buf + pos, bufsize - pos, "drop function \"mbr\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"mbroverlaps\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"geomfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"pointfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"linefromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"polyfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"mpointfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"mlinefromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"mpolyfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"geomcollectionfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"polygonfromtext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"astext\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"x\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"y\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"point\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"dimension\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"geometrytypeid\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"srid\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"envelope\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"isempty\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"issimple\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"boundary\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"equals\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"disjoint\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"Intersect\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"touches\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"crosses\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"within\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop all function \"contains\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"overlaps\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"relate\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"area\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"length\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"distance\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"buffer\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"convexhull\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"intersection\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"Union\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"difference\";"); - pos += snprintf(buf + pos, bufsize - pos, "drop function \"symdifference\";"); + pos += snprintf(buf + pos, bufsize - pos, + "drop function \"mbr\";\n" + "drop function \"mbroverlaps\";\n" + "drop function \"geomfromtext\";\n" + "drop function \"pointfromtext\";\n" + "drop function \"linefromtext\";\n" + "drop function \"polyfromtext\";\n" + "drop function \"mpointfromtext\";\n" + "drop function \"mlinefromtext\";\n" + "drop function \"mpolyfromtext\";\n" + "drop function \"geomcollectionfromtext\";\n" + "drop function \"polygonfromtext\";\n" + "drop function \"astext\";\n" + "drop function \"x\";\n" + "drop function \"y\";\n" + "drop function \"point\";\n" + "drop function \"dimension\";\n" + "drop function \"geometrytypeid\";\n" + "drop function \"srid\";\n" + "drop function \"envelope\";\n" + "drop function \"isempty\";\n" + "drop function \"issimple\";\n" + "drop function \"boundary\";\n" + "drop function \"equals\";\n" + "drop function \"disjoint\";\n" + "drop function \"Intersect\";\n" + "drop function \"touches\";\n" + "drop function \"crosses\";\n" + "drop function \"within\";\n" + "drop all function \"contains\";\n" + "drop function \"overlaps\";\n" + "drop function \"relate\";\n" + "drop function \"area\";\n" + "drop function \"length\";\n" + "drop function \"distance\";\n" + "drop function \"buffer\";\n" + "drop function \"convexhull\";\n" + "drop function \"intersection\";\n" + "drop function \"Union\";\n" + "drop function \"difference\";\n" + "drop function \"symdifference\";\n"); /* drop old types (but keep the geometry type) **/ - /** pos += snprintf(buf + pos, bufsize - pos, "DROP TYPE Geometry;"); **/ - pos += snprintf(buf + pos, bufsize - pos, "drop type \"point\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"curve\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"linestring\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"surface\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"polygon\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"multipoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"multicurve\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"multilinestring\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"multisurface\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"multipolygon\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "drop type \"geomcollection\";\n"); + /** pos += snprintf(buf + pos, bufsize - pos, "DROP TYPE Geometry;\n"); **/ + pos += snprintf(buf + pos, bufsize - pos, + "drop type \"point\";\n" + "drop type \"curve\";\n" + "drop type \"linestring\";\n" + "drop type \"surface\";\n" + "drop type \"polygon\";\n" + "drop type \"multipoint\";\n" + "drop type \"multicurve\";\n" + "drop type \"multilinestring\";\n" + "drop type \"multisurface\";\n" + "drop type \"multipolygon\";\n" + "drop type \"geomcollection\";\n"); } /* create the new geometry types */ - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION Has_Z(info integer) RETURNS integer EXTERNAL NAME geom.\"hasZ\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION Has_M(info integer) RETURNS integer EXTERNAL NAME geom.\"hasM\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION get_type(info integer, format integer) RETURNS string EXTERNAL NAME geom.\"getType\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE TABLE spatial_ref_sys (srid INTEGER NOT NULL PRIMARY KEY, auth_name VARCHAR (256), auth_srid INTEGER, srtext VARCHAR (2048), proj4text VARCHAR (2048));\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE VIEW geometry_columns AS\n"); - pos += snprintf(buf + pos, bufsize - pos, " SELECT e.value AS f_table_catalog, s.name AS f_table_schema, y.f_table_name, y.f_geometry_column, y.coord_dimension, y.srid, y.type\n"); - pos += snprintf(buf + pos, bufsize - pos, " FROM schemas s, environment e, (\n"); - pos += snprintf(buf + pos, bufsize - pos, " SELECT t.schema_id,\n"); - pos += snprintf(buf + pos, bufsize - pos, " t.name AS f_table_name,\n"); - pos += snprintf(buf + pos, bufsize - pos, " x.name AS f_geometry_column,\n"); - pos += snprintf(buf + pos, bufsize - pos, " has_z(info)+has_m(info)+2 AS coord_dimension,\n"); - pos += snprintf(buf + pos, bufsize - pos, " srid, get_type(info, 0) AS type\n"); - pos += snprintf(buf + pos, bufsize - pos, " FROM tables t, (\n"); - pos += snprintf(buf + pos, bufsize - pos, " SELECT name, table_id, type_digits AS info, type_scale AS srid\n"); - pos += snprintf(buf + pos, bufsize - pos, " FROM columns\n"); - pos += snprintf(buf + pos, bufsize - pos, " WHERE type IN ( SELECT DISTINCT sqlname FROM types WHERE systemname='wkb')\n"); - pos += snprintf(buf + pos, bufsize - pos, " ) AS x\n"); - pos += snprintf(buf + pos, bufsize - pos, " WHERE t.id=x.table_id\n"); - pos += snprintf(buf + pos, bufsize - pos, " ) y\n"); - pos += snprintf(buf + pos, bufsize - pos, " WHERE y.schema_id=s.id AND e.name='gdk_dbname';\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION mbr(geom Geometry) RETURNS mbr external name geom.\"mbr\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Overlaps(box1 mbr, box2 mbr) RETURNS boolean EXTERNAL NAME geom.\"mbrOverlaps\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Contains(box1 mbr, box2 mbr) RETURNS boolean EXTERNAL NAME geom.\"mbrContains\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Equals(box1 mbr, box2 mbr) RETURNS boolean EXTERNAL NAME geom.\"mbrEqual\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Distance(box1 mbr, box2 mbr) RETURNS double EXTERNAL NAME geom.\"mbrDistance\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_WKTToSQL(wkt string) RETURNS Geometry external name geom.\"GeomFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_WKBToSQL(geom string) RETURNS Geometry EXTERNAL NAME geom.\"FromBinary\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_AsText(geom Geometry) RETURNS string EXTERNAL NAME geom.\"AsText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_AsBinary(geom Geometry) RETURNS string EXTERNAL NAME geom.\"AsBinary\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Dimension(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"Dimension\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeometryType(geom Geometry) RETURNS string EXTERNAL NAME geom.\"GeometryType2\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_SRID(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"getSRID\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_SetSRID(geom Geometry, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"setSRID\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_IsEmpty(geom Geometry) RETURNS boolean EXTERNAL NAME geom.\"IsEmpty\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_IsSimple(geom Geometry) RETURNS boolean EXTERNAL NAME geom.\"IsSimple\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Boundary(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Boundary\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Envelope(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Envelope\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Equals(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Equals\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Disjoint(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Disjoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Intersects(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Intersects\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Touches(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Touches\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Crosses(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Crosses\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Within(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Within\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Contains(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Contains\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Overlaps(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Overlaps\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Relate(geom1 Geometry, geom2 Geometry, intersection_matrix_pattern string) RETURNS boolean EXTERNAL NAME geom.\"Relate\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Distance(geom1 Geometry, geom2 Geometry) RETURNS double EXTERNAL NAME geom.\"Distance\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Intersection(geom1 Geometry, geom2 Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Intersection\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Difference(geom1 Geometry, geom2 Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Difference\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Union(geom1 Geometry, geom2 Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Union\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE AGGREGATE ST_Union(geom Geometry) RETURNS Geometry external name geom.\"Union\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_SymDifference(geom1 Geometry, geom2 Geometry) RETURNS Geometry EXTERNAL NAME geom.\"SymDifference\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Buffer(geom Geometry, radius double) RETURNS Geometry EXTERNAL NAME geom.\"Buffer\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_ConvexHull(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"ConvexHull\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_X(geom Geometry) RETURNS double EXTERNAL NAME geom.\"X\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Y(geom Geometry) RETURNS double EXTERNAL NAME geom.\"Y\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Z(geom Geometry) RETURNS double EXTERNAL NAME geom.\"Z\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_StartPoint(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"StartPoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_EndPoint(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"EndPoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_IsRing(geom Geometry) RETURNS boolean EXTERNAL NAME geom.\"IsRing\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Length(geom Geometry) RETURNS double EXTERNAL NAME geom.\"Length\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_IsClosed(geom Geometry) RETURNS boolean EXTERNAL NAME geom.\"IsClosed\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NumPoints(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"NumPoints\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PointN(geom Geometry, positionNum integer) RETURNS Geometry EXTERNAL NAME geom.\"PointN\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Centroid(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Centroid\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PointOnSurface(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"PointOnSurface\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Area(geom Geometry) RETURNS double EXTERNAL NAME geom.\"Area\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_ExteriorRing(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"ExteriorRing\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_SetExteriorRing(geom Geometry) RETURNS Geometry external name geom.\"MakePolygon\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NumInteriorRing(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"NumInteriorRings\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_InteriorRingN(geom Geometry, positionNum integer) RETURNS Geometry EXTERNAL NAME geom.\"InteriorRingN\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_InteriorRings(geom Geometry) RETURNS GeometryA EXTERNAL NAME geom.\"InteriorRings\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NumGeometries(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"NumGeometries\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeometryN(geom Geometry, positionNum integer) RETURNS Geometry EXTERNAL NAME geom.\"GeometryN\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NumPatches(geom Geometry) RETURNS integer \n"); - pos += snprintf(buf + pos, bufsize - pos, "BEGIN \n"); - pos += snprintf(buf + pos, bufsize - pos, " RETURN SELECT ST_NumGeometries(geom);\n"); - pos += snprintf(buf + pos, bufsize - pos, "END;\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PatchN(geom Geometry, patchNum integer) RETURNS Geometry \n"); - pos += snprintf(buf + pos, bufsize - pos, "BEGIN\n"); - pos += snprintf(buf + pos, bufsize - pos, " RETURN SELECT ST_GeometryN(geom, patchNum);\n"); - pos += snprintf(buf + pos, bufsize - pos, "END; \n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeomFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"GeomFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PointFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"PointFromText\"; \n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_LineFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"LineFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PolygonFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"PolygonFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MPointFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"MPointFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MLineFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"MLineFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MPolyFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"MPolyFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeomCollFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"GeomCollFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_BdPolyFromText(wkt string, srid integer) RETURNS Geometry external name geom.\"BdPolyFromText\"; \n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_BdMPolyFromText(wkt string, srid integer) RETURNS Geometry external name geom.\"BdMPolyFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeometryFromText(wkt string, srid integer) RETURNS Geometry EXTERNAL NAME geom.\"GeomFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeomFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"GeomFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeometryFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"GeomFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PointFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"PointFromText\"; \n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_LineFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"LineFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_PolygonFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"PolygonFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MPointFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"MPointFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MLineFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"MLineFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MPolyFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"MPolyFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_GeomCollFromText(wkt string) RETURNS Geometry EXTERNAL NAME geom.\"GeomCollFromText\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakePoint(x double, y double) RETURNS Geometry EXTERNAL NAME geom.\"MakePoint\"; \n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Point(x double, y double) RETURNS Geometry EXTERNAL NAME geom.\"MakePoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakePoint(x double, y double, z double) RETURNS Geometry EXTERNAL NAME geom.\"MakePoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakePoint(x double, y double, z double, m double) RETURNS Geometry EXTERNAL NAME geom.\"MakePoint\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakePointM(x double, y double, m double) RETURNS Geometry EXTERNAL NAME geom.\"MakePointM\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE AGGREGATE ST_MakeLine(geom Geometry) RETURNS Geometry external name geom.\"MakeLine\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakeLine(geom1 Geometry, geom2 Geometry) RETURNS Geometry external name geom.\"MakeLine\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakeEnvelope(xmin double, ymin double, xmax double, ymax double, srid integer) RETURNS Geometry external name geom.\"MakeEnvelope\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakeEnvelope(xmin double, ymin double, xmax double, ymax double) RETURNS Geometry external name geom.\"MakeEnvelope\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakePolygon(geom Geometry) RETURNS Geometry external name geom.\"MakePolygon\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Polygon(geom Geometry, srid integer) RETURNS Geometry external name geom.\"MakePolygon\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_MakeBox2D(lowLeftPointGeom Geometry, upRightPointGeom Geometry) RETURNS mbr external name geom.\"MakeBox2D\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION GeometryType(geom Geometry) RETURNS string EXTERNAL NAME geom.\"GeometryType1\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_CoordDim(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"CoordDim\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_IsValid(geom Geometry) RETURNS boolean EXTERNAL NAME geom.\"IsValid\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_IsValidReason(geom Geometry) RETURNS string EXTERNAL NAME geom.\"IsValidReason\"; \n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NPoints(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"NPoints\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NRings(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"NRings\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_NumInteriorRings(geom Geometry) RETURNS integer EXTERNAL NAME geom.\"NumInteriorRings\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_XMax(geom Geometry) RETURNS double EXTERNAL NAME geom.\"XMaxFromWKB\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_XMax(box mbr) RETURNS double EXTERNAL NAME geom.\"XMaxFromMBR\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_XMin(geom Geometry) RETURNS double EXTERNAL NAME geom.\"XMinFromWKB\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_XMin(box mbr) RETURNS double EXTERNAL NAME geom.\"XMinFromMBR\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_YMax(geom Geometry) RETURNS double EXTERNAL NAME geom.\"YMaxFromWKB\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_YMax(box mbr) RETURNS double EXTERNAL NAME geom.\"YMaxFromMBR\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_YMin(geom Geometry) RETURNS double EXTERNAL NAME geom.\"YMinFromWKB\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_YMin(box mbr) RETURNS double EXTERNAL NAME geom.\"YMinFromMBR\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Force2D(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Force2D\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Force3D(geom Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Force3D\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Segmentize(geom Geometry, sz double) RETURNS Geometry EXTERNAL NAME geom.\"Segmentize\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION getProj4(srid_in integer) RETURNS string \n"); - pos += snprintf(buf + pos, bufsize - pos, "BEGIN\n"); - pos += snprintf(buf + pos, bufsize - pos, " RETURN SELECT proj4text FROM spatial_ref_sys WHERE srid=srid_in; \n"); - pos += snprintf(buf + pos, bufsize - pos, "END;\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION InternalTransform(geom Geometry, srid_src integer, srid_dest integer, proj4_src string, proj4_dest string) RETURNS Geometry EXTERNAL NAME geom.\"Transform\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Transform(geom Geometry, srid integer) RETURNS Geometry \n"); - pos += snprintf(buf + pos, bufsize - pos, "BEGIN\n"); - pos += snprintf(buf + pos, bufsize - pos, " DECLARE srid_src integer;\n"); - pos += snprintf(buf + pos, bufsize - pos, " DECLARE proj4_src string;\n"); - pos += snprintf(buf + pos, bufsize - pos, " DECLARE proj4_dest string;\n"); - pos += snprintf(buf + pos, bufsize - pos, " SELECT st_srid(geom) INTO srid_src;\n"); - pos += snprintf(buf + pos, bufsize - pos, " SELECT getProj4(srid_src) INTO proj4_src;\n"); - pos += snprintf(buf + pos, bufsize - pos, " SELECT getProj4(srid) INTO proj4_dest;\n"); - pos += snprintf(buf + pos, bufsize - pos, " IF proj4_src IS NULL THEN\n"); - pos += snprintf(buf + pos, bufsize - pos, " RETURN SELECT InternalTransform(geom, srid_src, srid, 'null', proj4_dest); \n"); - pos += snprintf(buf + pos, bufsize - pos, " ELSE\n"); - pos += snprintf(buf + pos, bufsize - pos, " IF proj4_dest IS NULL THEN\n"); - pos += snprintf(buf + pos, bufsize - pos, " RETURN SELECT InternalTransform(geom, srid_src, srid, proj4_src, 'null'); \n"); - pos += snprintf(buf + pos, bufsize - pos, " ELSE\n"); - pos += snprintf(buf + pos, bufsize - pos, " RETURN SELECT InternalTransform(geom, srid_src, srid, proj4_src, proj4_dest);\n"); - pos += snprintf(buf + pos, bufsize - pos, " END IF;\n"); - pos += snprintf(buf + pos, bufsize - pos, " END IF;\n"); - pos += snprintf(buf + pos, bufsize - pos, "END;\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Translate(geom Geometry, dx double, dy double) RETURNS Geometry EXTERNAL NAME geom.\"Translate\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Translate(geom Geometry, dx double, dy double, dz double) RETURNS Geometry EXTERNAL NAME geom.\"Translate\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_AsEWKT(geom Geometry) RETURNS string EXTERNAL NAME geom.\"AsEWKT\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Covers(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"Covers\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_CoveredBy(geom1 Geometry, geom2 Geometry) RETURNS boolean EXTERNAL NAME geom.\"CoveredBy\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_DWithin(geom1 Geometry, geom2 Geometry, dst double) RETURNS boolean EXTERNAL NAME geom.\"DWithin\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Length2D(geom Geometry) RETURNS double EXTERNAL NAME geom.\"Length\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Collect(geom1 Geometry, geom2 Geometry) RETURNS Geometry EXTERNAL NAME geom.\"Union\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE AGGREGATE ST_Collect(geom Geometry) RETURNS Geometry external name geom.\"Union\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_DelaunayTriangles(geom Geometry, tolerance double, flags integer) RETURNS Geometry EXTERNAL NAME geom.\"DelaunayTriangles\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_Dump(geom Geometry) RETURNS TABLE(id string, polygonWKB Geometry) EXTERNAL NAME geom.\"Dump\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION ST_DumpPoints(geom Geometry) RETURNS TABLE(path string, pointG Geometry) EXTERNAL NAME geom.\"DumpPoints\";\n"); - pos += snprintf(buf + pos, bufsize - pos, "CREATE FUNCTION Contains(a Geometry, x double, y double) RETURNS BOOLEAN external name geom.\"Contains\";\n"); - /* populate the spatial_ref_sys table */ - pos += snprintf(buf + pos, bufsize - pos, "COPY 3911 RECORDS INTO spatial_ref_sys FROM STDIN USING DELIMITERS '|','\\n','\\'';\n"); - pos += snprintf(buf + pos, bufsize - pos, "3819|'EPSG'|3819|'GEOGCS[\"HD1909\",DATUM[\"Hungarian_Datum_1909\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408],AUTHORITY[\"EPSG\",\"1024\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3819\"]]'|'+proj=longlat +ellps=bessel +towgs84=595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408 +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "3821|'EPSG'|3821|'GEOGCS[\"TWD67\",DATUM[\"Taiwan_Datum_1967\",SPHEROID[\"GRS 1967 Modified\",6378160,298.25,AUTHORITY[\"EPSG\",\"7050\"]],AUTHORITY[\"EPSG\",\"1025\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3821\"]]'|'+proj=longlat +ellps=aust_SA +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "3824|'EPSG'|3824|'GEOGCS[\"TWD97\",DATUM[\"Taiwan_Datum_1997\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1026\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3824\"]]'|'+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "3889|'EPSG'|3889|'GEOGCS[\"IGRS\",DATUM[\"Iraqi_Geospatial_Reference_System\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"1029\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3889\"]]'|'+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "3906|'EPSG'|3906|'GEOGCS[\"MGI 1901\",DATUM[\"MGI_1901\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],TOWGS84[682,-203,480,0,0,0,0],AUTHORITY[\"EPSG\",\"1031\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"3906\"]]'|'+proj=longlat +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4001|'EPSG'|4001|'GEOGCS[\"Unknown datum based upon the Airy 1830 ellipsoid\",DATUM[\"Not_specified_based_on_Airy_1830_ellipsoid\",SPHEROID[\"Airy 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],AUTHORITY[\"EPSG\",\"6001\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4001\"]]'|'+proj=longlat +ellps=airy +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4002|'EPSG'|4002|'GEOGCS[\"Unknown datum based upon the Airy Modified 1849 ellipsoid\",DATUM[\"Not_specified_based_on_Airy_Modified_1849_ellipsoid\",SPHEROID[\"Airy Modified 1849\",6377340.189,299.3249646,AUTHORITY[\"EPSG\",\"7002\"]],AUTHORITY[\"EPSG\",\"6002\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4002\"]]'|'+proj=longlat +ellps=mod_airy +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4003|'EPSG'|4003|'GEOGCS[\"Unknown datum based upon the Australian National Spheroid\",DATUM[\"Not_specified_based_on_Australian_National_Spheroid\",SPHEROID[\"Australian National Spheroid\",6378160,298.25,AUTHORITY[\"EPSG\",\"7003\"]],AUTHORITY[\"EPSG\",\"6003\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4003\"]]'|'+proj=longlat +ellps=aust_SA +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4004|'EPSG'|4004|'GEOGCS[\"Unknown datum based upon the Bessel 1841 ellipsoid\",DATUM[\"Not_specified_based_on_Bessel_1841_ellipsoid\",SPHEROID[\"Bessel 1841\",6377397.155,299.1528128,AUTHORITY[\"EPSG\",\"7004\"]],AUTHORITY[\"EPSG\",\"6004\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4004\"]]'|'+proj=longlat +ellps=bessel +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4005|'EPSG'|4005|'GEOGCS[\"Unknown datum based upon the Bessel Modified ellipsoid\",DATUM[\"Not_specified_based_on_Bessel_Modified_ellipsoid\",SPHEROID[\"Bessel Modified\",6377492.018,299.1528128,AUTHORITY[\"EPSG\",\"7005\"]],AUTHORITY[\"EPSG\",\"6005\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4005\"]]'|'+proj=longlat +a=6377492.018 +b=6356173.508712696 +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4006|'EPSG'|4006|'GEOGCS[\"Unknown datum based upon the Bessel Namibia ellipsoid\",DATUM[\"Not_specified_based_on_Bessel_Namibia_ellipsoid\",SPHEROID[\"Bessel Namibia (GLM)\",6377483.865280419,299.1528128,AUTHORITY[\"EPSG\",\"7046\"]],AUTHORITY[\"EPSG\",\"6006\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4006\"]]'|'+proj=longlat +ellps=bess_nam +no_defs'\n"); - pos += snprintf(buf + pos, bufsize - pos, "4007|'EPSG'|4007|'GEOGCS[\"Unknown datum based upon the Clarke 1858 ellipsoid\",DATUM[\"Not_specified_based_on_Clarke_1858_ellipsoid\",SPHEROID[\"Clarke 1858\",6378293.645208759,294.2606763692569,AUTHORITY[\"EPSG\",\"7007\"]],AUTHORITY[\"EPSG\",\"6007\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4007\"]]'|'+proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs'\n"); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list