Revision 46493 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.spi/src/main/java/org/gvsig/fmap/dal/feature/spi/SQLBuilderBase.java

View differences:

SQLBuilderBase.java
50 50
import org.gvsig.fmap.dal.SQLBuilder.UpdateTableStatisticsBuilder;
51 51
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
52 52
import org.gvsig.fmap.geom.Geometry;
53
import org.gvsig.fmap.geom.GeometryUtils;
54
import org.gvsig.fmap.geom.primitive.Envelope;
53 55
import org.gvsig.tools.dataTypes.DataType;
56
import org.gvsig.tools.dynobject.Tags;
54 57
import org.slf4j.Logger;
55 58
import org.slf4j.LoggerFactory;
56 59

  
......
97 100
        private int geom_type;
98 101
        private int geom_subtype;
99 102
        private Object geom_srsdbcode;
103
        private Envelope tablebbox;
100 104
        private boolean _isIndexed;
101 105
        private DataStoreParameters parameters = null;
102 106

  
......
113 117
            this.geom_type = Geometry.TYPES.GEOMETRY;
114 118
            this.geom_subtype = Geometry.SUBTYPES.GEOM2D;
115 119
            this.geom_srsdbcode = null;
120
            this.tablebbox = null;
116 121
            this._isIndexed = false;
117 122
        }
118 123

  
......
129 134
            this.geom_type = Geometry.TYPES.GEOMETRY;
130 135
            this.geom_subtype = Geometry.SUBTYPES.GEOM2D;
131 136
            this.geom_srsdbcode = null;
137
            this.tablebbox = null;
132 138
            this._isIndexed = isIndexed;
133 139
        }
134 140

  
......
145 151
            this.geom_type = geom_type;
146 152
            this.geom_subtype = geom_subtype;
147 153
            this.geom_srsdbcode = srs_id(proj);
154
            this.tablebbox = null;
148 155
            this._isIndexed = isIndexed;
149 156
        }
150 157

  
......
161 168
            this.geom_type = geom_type;
162 169
            this.geom_subtype = geom_subtype;
163 170
            this.geom_srsdbcode = srsdbcode;
171
            this.tablebbox = null;
164 172
            this._isIndexed = isIndexed;
165 173
        }
166 174

  
......
177 185
            if (fad.getType() == org.gvsig.fmap.geom.DataTypes.GEOMETRY) {
178 186
                this.geom_type = fad.getGeomType().getType();
179 187
                this.geom_subtype = fad.getGeomType().getSubType();
180
                this.geom_srsdbcode = fad.getSRS();
188
                this.geom_srsdbcode =  srs_id(fad.getSRS());
189
                this.tablebbox = null;
190
                Tags tags = fad.getTags();
191
                String s = tags.getString("tablebbox", null);
192
                if( StringUtils.isNotBlank(s) ) {
193
                    try {
194
                        Geometry g = GeometryUtils.createFrom(s);
195
                        if( g!=null ) {
196
                            this.tablebbox = g.getEnvelope();
197
                        }
198
                    } catch(Exception ex) {
199
                        LOGGER.warn("Can't parse tablebbox for column '"+s+"'.",ex);
200
                    }
201
                }
181 202
            }
182 203
        }
183 204
    
......
320 341
        public DataStoreParameters getStoreParameters() {
321 342
            return this.parameters;
322 343
        }
344
        
345
        public Envelope getTableBBox() {
346
            return this.tablebbox;
347
        }
348
        
349
        public void setTableBBox(Envelope bbox) {
350
            this.tablebbox = bbox;
351
        }
323 352
    }
324 353

  
325 354
    public class ColumnBase extends AbstractValue implements Column {

Also available in: Unified diff