Changeset 77:3a650ebf4868


Ignore:
Timestamp:
03/22/12 16:26:36 (6 years ago)
Author:
George Garbis <ggarbis@…>
Branch:
default
Message:

add cast in buildInsertGeometryValue for MonetDB

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java

    r26 r77  
    134134                StringBuilder sb = new StringBuilder(); 
    135135                sb.append("INSERT INTO ").append(getInsertTable().getName()); 
    136                 //sb.append(" (id, value, interval_start, interval_end, strdfgeo) VALUES (?, ?,?,?,?)"); 
    137                  
    138                 //Normal One sb.append(" (id, interval_start, interval_end, strdfgeo) VALUES (?,?,?,?)"); 
    139                 //sb.append(" (id, interval_start, interval_end, strdfgeo) VALUES (?,?,?,ST_GeomFromWKB(?,4326))"); 
    140                 //sb.append(" (id, strdfgeo) VALUES (?,ST_GeomFromWKB(?,32630))"); 
    141                 Integer srid=  StrabonPolyhedron.defaultSRID; 
    142                 sb.append(" (id, strdfgeo,srid) VALUES (?,ST_Transform(ST_GeomFromWKB(?,?),").append(srid).append("),?)");  
     136//              Integer srid=  StrabonPolyhedron.defaultSRID; 
     137//              sb.append(" (id, strdfgeo,srid) VALUES (?,ST_Transform(ST_GeomFromWKB(?,?),").append(srid).append("),?)"); 
     138                sb.append(((GeneralDBSqlTable)temporary).buildInsertGeometryValue()); 
    143139                INSERT = sb.toString(); 
    144140                sb.delete(0, sb.length()); 
  • monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java

    r25 r77  
    88import java.sql.SQLException; 
    99 
     10import org.openrdf.query.algebra.evaluation.function.spatial.StrabonPolyhedron; 
    1011import org.openrdf.sail.generaldb.GeneralDBSqlTable; 
    1112 
     
    4748         
    4849        @Override 
    49         public String buildInsertGeometryValue() { // FIXME for srid 
    50                 return " (id, strdfgeo) VALUES (CAST(? AS INTEGER),GeomFromWKB(?))"; 
     50        public String buildInsertGeometryValue() { 
     51                Integer srid=  StrabonPolyhedron.defaultSRID; 
     52                return " (id, strdfgeo,srid) VALUES (CAST(? AS INTEGER), Transform(GeomFromWKB(CAST(? AS BLOB),CAST(? AS INTEGER)),"+srid+"), CAST(? AS INTEGER))";  
    5153        } 
    5254         
  • postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java

    r25 r77  
    88import java.sql.SQLException; 
    99 
     10import org.openrdf.query.algebra.evaluation.function.spatial.StrabonPolyhedron; 
    1011import org.openrdf.sail.generaldb.GeneralDBSqlTable; 
    1112 
     
    4647        @Override 
    4748        public String buildInsertGeometryValue() { 
    48                 return " (id, strdfgeo,srid) VALUES (?,ST_Transform(ST_GeomFromWKB(?,?),4326),?)"; 
     49                Integer srid=  StrabonPolyhedron.defaultSRID; 
     50                return " (id, strdfgeo,srid) VALUES (?,ST_Transform(ST_GeomFromWKB(?,?),"+srid+"),?)"; 
    4951        } 
    5052         
Note: See TracChangeset for help on using the changeset viewer.