13 |
13 |
|
14 |
14 |
import org.apache.commons.dbcp.BasicDataSource;
|
15 |
15 |
import org.apache.commons.lang3.StringUtils;
|
|
16 |
import org.cresques.cts.IProjection;
|
|
17 |
import org.gvsig.fmap.crs.CRSFactory;
|
16 |
18 |
import org.gvsig.fmap.dal.DataTypes;
|
17 |
19 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
18 |
20 |
import org.gvsig.fmap.dal.SQLBuilder;
|
... | ... | |
31 |
33 |
import org.gvsig.fmap.dal.store.jdbc2.OperationsFactory;
|
32 |
34 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCHelperBase;
|
33 |
35 |
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSQLBuilderBase;
|
34 |
|
import org.gvsig.fmap.dal.store.jdbc2.spi.JDBCSRSsBase;
|
|
36 |
import org.gvsig.fmap.dal.store.jdbc2.spi.SRSSolverBase;
|
35 |
37 |
import org.gvsig.fmap.geom.Geometry;
|
36 |
38 |
import org.gvsig.fmap.geom.aggregate.MultiLine;
|
37 |
39 |
import org.gvsig.fmap.geom.aggregate.MultiPoint;
|
... | ... | |
146 |
148 |
|
147 |
149 |
public OracleHelper(JDBCConnectionParameters connectionParameters) {
|
148 |
150 |
super(connectionParameters);
|
149 |
|
this.srss = new JDBCSRSsBase(this);
|
|
151 |
this.srssolver = new SRSSolverBase(this);
|
150 |
152 |
}
|
151 |
153 |
|
152 |
154 |
@Override
|
... | ... | |
360 |
362 |
}
|
361 |
363 |
}
|
362 |
364 |
|
363 |
|
|
|
365 |
@Override
|
|
366 |
public IProjection getProjectionFromDatabaseCode(String databaseCode) {
|
|
367 |
/**
|
|
368 |
* FIXME: We can query the following table to search the proper definition:
|
|
369 |
* SELECT * FROM SDO_COORD_REF_SYS ;
|
|
370 |
*/
|
|
371 |
if( StringUtils.trimToEmpty(databaseCode).equals("0") ) {
|
|
372 |
return null;
|
|
373 |
}
|
|
374 |
String abbrev = null;
|
|
375 |
try {
|
|
376 |
abbrev = this.srssolver.getApplicationAbbrev(this.getConnection(), databaseCode);
|
|
377 |
} catch (AccessResourceException e) {
|
|
378 |
// TODO Auto-generated catch block
|
|
379 |
e.printStackTrace();
|
|
380 |
}
|
|
381 |
if( StringUtils.isEmpty(abbrev) ) {
|
|
382 |
return null;
|
|
383 |
}
|
|
384 |
IProjection proj = CRSFactory.getCRS(abbrev);
|
|
385 |
return proj;
|
|
386 |
}
|
364 |
387 |
|
365 |
388 |
}
|