[Liblas-commits] hg: use Ivan's WriteClob function to write and bind the WKT colu...

liblas-commits at liblas.org liblas-commits at liblas.org
Sun Apr 10 22:10:22 EDT 2011


details:   http://hg.liblas.orghg/rev/b702e41a99b0
changeset: 2923:b702e41a99b0
user:      Howard Butler <hobu.inc at gmail.com>
date:      Sun Apr 10 21:10:11 2011 -0500
description:
use Ivan's WriteClob function to write and bind the WKT column into the SDO_GEOMETRY constructor

diffstat:

 apps/las2oci.cpp |  16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diffs (37 lines):

diff -r c3e0e7a56106 -r b702e41a99b0 apps/las2oci.cpp
--- a/apps/las2oci.cpp	Sun Apr 10 14:42:59 2011 -0500
+++ b/apps/las2oci.cpp	Sun Apr 10 21:10:11 2011 -0500
@@ -419,11 +419,11 @@
     if (!header_blob_column_u.empty()){
         columns << "," << header_blob_column_u;
         values <<", :" << nPos;
+        nPos++;
     }
 
     if (!boundary_column_u.empty()){
         columns << "," << boundary_column_u;
-        nPos++;
         values <<", SDO_GEOMETRY(:"<<nPos;
         nPos++;
         values <<", :"<<nPos<<")";
@@ -538,17 +538,9 @@
     char* wkt = (char*) malloc(boundary_wkt.size() * sizeof(char));
     strncpy(wkt, boundary_wkt.c_str(), boundary_wkt.size());    
     if (!boundary_column_u.empty()){
-        OCILobLocator** locator =(OCILobLocator**) VSIMalloc( sizeof(OCILobLocator*) * 1 );
-        statement->DefineClob( locator, 1 ); 
-    
-        
-        statement->BindClob(wkt,(long)boundary_wkt.size());
-
-        // statement->Bind((char*)&(wkt[0]),(long)wkt.size());
-
-        // long* srid_d = 0;
-        // srid_d = (long*) malloc (1 * sizeof(long));
-        // srid_d[0] = srid;
+        OCILobLocator* locator ; 
+        statement->WriteCLob( &locator, wkt ); 
+        statement->Bind(&locator);
         statement->Bind(&srid);        
     }
 


More information about the Liblas-commits mailing list