本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.getGeometrySRS方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.getGeometrySRS方法的具体用法?Java ValueMetaInterface.getGeometrySRS怎么用?Java ValueMetaInterface.getGeometrySRS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.row.ValueMetaInterface
的用法示例。
在下文中一共展示了ValueMetaInterface.getGeometrySRS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changeSRID
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
* The SRID must be set in every Geometry-object.
*
* @param inputRow The row with the data.
* @return The modified Geometry-objects with the new SRID.
*/
private synchronized void changeSRID(Object[] inputRow) {
for (int i=0; i < inputRow.length; i++) {
Object field = inputRow[i];
if (field != null) {
// Set the new SRID in the Geometry-object
ValueMetaInterface vm = getInputRowMeta().getValueMeta(i);
if (vm.getName().equals(meta.getFieldName()) && vm.isGeometry()) {
SRS newSRS = meta.getSelectedSRS();
String log_old_srid = vm.getGeometrySRS().is_custom ? "CUSTOM:" + vm.getGeometrySRS().srid : vm.getGeometrySRS().srid;
// FIXME: is this right? review this!
// vm.setGeometrySRS(newSRS); // Meta-SRID
((Geometry) field).setSRID(newSRS.getSRID()); // Geometry-SRID
// logging...
log.logDetailed("GeoKettle", "Changed SRID in geometry from " + log_old_srid + " to " + meta.getSelectedSRS().srid);
}
}
i++;
}
}
示例2: getSourceSRS
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
* Get the source-SRS from the metadata.
*
* @param inputRowMeta The {@link RowMetaInterface} that may contain a SRS.
* @return The {@link SRS} from the {@link RowMetaInterface} if there is
* one. If there is no, return the {@link SRS} from this
* {@link SRSTransformationMeta} and if there is no, return a
* {@link SRS}.UNKNOWN.
*/
public SRS getSourceSRS(RowMetaInterface inputRowMeta) {
// Return the SRS from the RowMetaInterface, if possible.
// TODO: GeoKettle: check this
if (/*!sourceSRS.equals(SRS.UNKNOWN) && */!Const.isEmpty(fieldName) && sourceGUIStatus == STATUS_AUTO) {
int idx = inputRowMeta.indexOfValue(fieldName);
if (idx >= 0) {
ValueMetaInterface v = inputRowMeta.getValueMeta(idx);
if (!v.getGeometrySRS().equals(SRS.UNKNOWN)) {
return v.getGeometrySRS();
}
}
}
return (sourceSRS != null) ? sourceSRS : SRS.UNKNOWN;
}
示例3: autodetectSourceSRS
import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
* Automatically detects the SRS from the metadata changed by a previous step.
*
* @return The {@link SRS} from a previous step.
*/
private SRS autodetectSourceSRS() {
SRS resultMeta = SRS.UNKNOWN;
try {
RowMetaInterface inputfields = transMeta.getPrevStepFields(stepname);
// Find the ValueMeta of the field
int idx = inputfields.indexOfValue(fieldname);
if (idx >= 0) {
// This is the value we need to get the SRS from
ValueMetaInterface vmi = inputfields.getValueMeta(idx);
resultMeta = vmi.getGeometrySRS();
}
} catch (KettleException ke) { }
return resultMeta;
}