当前位置: 首页>>代码示例>>Java>>正文


Java ValueMetaInterface.getGeometrySRS方法代码示例

本文整理汇总了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++;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:29,代码来源:SetSRS.java

示例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;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:25,代码来源:SRSTransformationMeta.java

示例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;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:SRSTransformationDialog.java


注:本文中的org.pentaho.di.core.row.ValueMetaInterface.getGeometrySRS方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。