Revision 14012 branches/v10/extensions/extOracleSpatial/src/es/prodevelop/cit/gvsig/fmap/drivers/jdbc/oracle/OracleSpatialDriver.java

View differences:

OracleSpatialDriver.java
99 99

  
100 100
import oracle.jdbc.OracleConnection;
101 101

  
102
import oracle.spatial.geometry.JGeometry;
102
// import oracle.spatial.geometry.JGeometry;
103 103

  
104 104
import oracle.sql.ARRAY;
105 105
import oracle.sql.Datum;
......
1336 1336
        return _igeom;
1337 1337
    }
1338 1338

  
1339
    /*
1339 1340
    private IGeometry getFMapGeometry(JGeometry jg, boolean force_not_collection) {
1340 1341
        int jgtype = jg.getType();
1341 1342
        int dim = jg.getDimensions();
......
1375 1376

  
1376 1377
        return ig;
1377 1378
    }
1379
    */
1378 1380

  
1379 1381
    private IGeometry getFMapGeometryCollection(Datum[] the_data, int dim) {
1380 1382
        // int __srid) {
......
1541 1543
        return resp;
1542 1544
    }
1543 1545

  
1546
    /*
1544 1547
    private IGeometry getFMapGeometryMultipolygon(JGeometry jg, int dim) {
1545 1548
        IGeometry ig = null;
1546 1549

  
......
1562 1565

  
1563 1566
        return ig;
1564 1567
    }
1568
    */
1565 1569

  
1566 1570
    private IGeometry getFMapGeometryMultipolygon(Datum[] the_data, int dim) {
1567 1571
        IGeometry ig = null;
......
1594 1598
        return ig;
1595 1599
    }
1596 1600

  
1601
    /*
1597 1602
    private IGeometry getCircleFromJGeometry(JGeometry jg) {
1598 1603
        double[] threep = jg.getOrdinatesArray();
1599 1604
        Point2D[] three = new Point2D.Double[3];
......
1610 1615

  
1611 1616
        return circ;
1612 1617
    }
1618
    */
1613 1619

  
1614 1620
    private IGeometry getCircleFromStruct(Datum[] the_data) {
1615 1621
        double[] threep = null;
......
1639 1645
        return circ;
1640 1646
    }
1641 1647

  
1648
    /*
1642 1649
    private IGeometry getFMapGeometryMultiLineString(JGeometry jg, int dim) {
1643 1650
        Shape shape = jg.createShape();
1644 1651
        GeneralPathX gpx = new GeneralPathX(shape);
......
1654 1661

  
1655 1662
        return ig;
1656 1663
    }
1664
    */
1657 1665

  
1658 1666
    private IGeometry getFMapGeometryMultiLineString(Datum[] the_data, int dim) {
1659 1667
        GeneralPathX gpx = OracleSpatialUtils.structToGPX(the_data);
......
1673 1681
        return ig;
1674 1682
    }
1675 1683

  
1684
    /*
1676 1685
    private IGeometry getFMapGeometryPoint(JGeometry jg_point, int dim) {
1677 1686
        if (jg_point.getOrdinatesArray() == null) { // sdo_point
1678 1687

  
......
1714 1723

  
1715 1724
        return ig;
1716 1725
    }
1726
    */
1717 1727

  
1718 1728
    private IGeometry getFMapGeometryPoint(Datum[] the_data, int dim) {
1719 1729
        double[] ords = OracleSpatialUtils.getOrds(the_data);
......
1759 1769
        return ig;
1760 1770
    }
1761 1771

  
1772
    /*
1762 1773
    private IGeometry getFMapGeometrySdoPoint(JGeometry jgp, int d) {
1763 1774
        double[] p = jgp.getPoint();
1764 1775
        IGeometry ig = null;
......
1772 1783

  
1773 1784
        return ig;
1774 1785
    }
1786
    */
1775 1787

  
1776 1788
    private IGeometry getFMapGeometrySdoPoint(Datum[] the_data, int d) {
1777 1789
        double x = 0;
......
1804 1816
        return ig;
1805 1817
    }
1806 1818

  
1819
    /*
1807 1820
    private boolean isActuallyACollection(JGeometry jg) {
1808 1821
        int[] info = jg.getElemInfo();
1809 1822

  
......
1831 1844

  
1832 1845
        return false;
1833 1846
    }
1847
    */
1834 1848

  
1835 1849
    private boolean isActuallyACollection(Datum[] the_data) {
1836 1850
        int[] info = null;
......
1879 1893
        return false;
1880 1894
    }
1881 1895

  
1896
    /*
1882 1897
    private IGeometry getFMapGeometryCollection(JGeometry jg, int dim, int _srid) {
1883 1898
        int main_type = jg.getType();
1884 1899

  
......
1920 1935

  
1921 1936
        return new FGeometryCollection(geoms);
1922 1937
    }
1938
    */
1923 1939

  
1924 1940
    private Datum[] updateIndexes(Datum[] info) {
1925 1941
        int size = info.length / 3;
......
2182 2198
        return resp.toArray();
2183 2199
    }
2184 2200

  
2201
    /*
2185 2202
    private IGeometry getJGeometryPoint2D(JGeometry _jgeom) {
2186 2203
        Point2D p = _jgeom.getJavaPoint();
2187 2204
        IGeometry ig = ShapeFactory.createPoint2D(p.getX(), p.getY());
......
2229 2246

  
2230 2247
        return ig;
2231 2248
    }
2249
    */
2232 2250

  
2233
//    private IGeometry getGeotoolsIGeometry(oracle.sql.STRUCT _struct) {
2234
//        Geometry geo_jts = null;
2235
//
2236
//        try {
2237
//            geo_jts = geotools_conv.asGeometry(_struct);
2238
//        }
2239
//        catch (SQLException e) {
2240
//            System.err.println("While using geotools converter: " +
2241
//                e.getMessage());
2242
//        }
2243
//
2244
//        IGeometry ig = FConverter.jts_to_igeometry(geo_jts);
2245
//
2246
//        return ig;
2247
//    }
2248

  
2249 2251
    private int oracleTypeToFShapeTypeExceptPointTypes(int type) {
2250 2252
        /*
2251 2253
         * Tipos en Oracle Spatial usando JGeometry
......
2273 2275
         * Z=512
2274 2276
         */
2275 2277
        switch (type) {
2276
        case JGeometry.GTYPE_POLYGON:
2277
        case JGeometry.GTYPE_MULTIPOLYGON:
2278
        case JGeometry_GTYPE_POLYGON:
2279
        case JGeometry_GTYPE_MULTIPOLYGON:
2278 2280
            return FShape.POLYGON;
2279 2281

  
2280
        case JGeometry.GTYPE_CURVE:
2281
        case JGeometry.GTYPE_MULTICURVE:
2282
        case JGeometry_GTYPE_CURVE:
2283
        case JGeometry_GTYPE_MULTICURVE:
2282 2284
            return FShape.LINE;
2283 2285
        }
2284 2286

  
......
2380 2382
        return FConverter.java2d_to_jts(fwagp);
2381 2383
    }
2382 2384

  
2385
    /*
2383 2386
    public static Rectangle2D getBoundingBox(JGeometry _jg) {
2384 2387
        Shape shape = _jg.createShape();
2385 2388

  
2386 2389
        return shape.getBounds2D();
2387 2390
    }
2391
    */
2388 2392

  
2389 2393
    private void printStruct(STRUCT st) {
2390 2394
        System.out.println("----------------------------------------------");
......
4387 4391
    public String getUserName() {
4388 4392
    	return userName;
4389 4393
    }
4394

  
4395
    public static final int JGeometry_GTYPE_COLLECTION = 4;
4396
    public static final int JGeometry_GTYPE_CURVE = 2;
4397
    public static final int JGeometry_GTYPE_MULTICURVE = 6;
4398
    public static final int JGeometry_GTYPE_MULTIPOINT = 5;
4399
    public static final int JGeometry_GTYPE_MULTIPOLYGON = 7;
4400
    public static final int JGeometry_GTYPE_POINT = 1;
4401
    public static final int JGeometry_GTYPE_POLYGON = 3;
4402

  
4390 4403
}

Also available in: Unified diff