[GRASS-SVN] r55308 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 10 14:17:22 PDT 2013
Author: martinl
Date: 2013-03-10 14:17:22 -0700 (Sun, 10 Mar 2013)
New Revision: 55308
Modified:
grass/trunk/lib/vector/Vlib/write_pg.c
Log:
vlib(pg): fix inserting face when srid is specified
Modified: grass/trunk/lib/vector/Vlib/write_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/write_pg.c 2013-03-10 21:09:37 UTC (rev 55307)
+++ grass/trunk/lib/vector/Vlib/write_pg.c 2013-03-10 21:17:22 UTC (rev 55308)
@@ -1395,10 +1395,10 @@
/* insert face if not exists */
G_asprintf(&stmt, "INSERT INTO \"%s\".face (face_id, mbr) VALUES "
- "(%d, 'POLYGON((%.12f %.12f, %.12f %.12f, %.12f %.12f, %.12f %.12f, "
- "%.12f %.12f))'::GEOMETRY)", pg_info->toposchema_name, area,
+ "(%d, ST_GeomFromText('POLYGON((%.12f %.12f, %.12f %.12f, %.12f %.12f, %.12f %.12f, "
+ "%.12f %.12f))', %d))", pg_info->toposchema_name, area,
box.W, box.S, box.W, box.N, box.E, box.N,
- box.E, box.S, box.W, box.S);
+ box.E, box.S, box.W, box.S, pg_info->srid);
G_debug(3, "new face id=%d", area);
if (Vect__execute_pg(pg_info->conn, stmt) == -1) {
Vect__execute_pg(pg_info->conn, "ROLLBACK");
More information about the grass-commit
mailing list