本文整理汇总了Java中com.esri.arcgis.geodatabase.IFeatureClass类的典型用法代码示例。如果您正苦于以下问题:Java IFeatureClass类的具体用法?Java IFeatureClass怎么用?Java IFeatureClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFeatureClass类属于com.esri.arcgis.geodatabase包,在下文中一共展示了IFeatureClass类的37个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: queryFeatureIDsForSpatialFilter
点赞 3
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
*
* @param spatialFilter
* @return
* @throws Exception
*/
protected Collection<String> queryFeatureIDsForSpatialFilter(String spatialFilter) throws IOException
{
IGeometry geometry;
try {
geometry = ServerUtilities.getGeometryFromJSON(new JSONObject(spatialFilter));
} catch (Exception e) {
throw new IOException(e);
}
IFeatureClass features = workspaceWrapper.getWorkspace().openFeatureClass(Table.FEATUREOFINTEREST);
ISpatialFilter spatialQuery = new SpatialFilter();
spatialQuery.setGeometryByRef(geometry);
spatialQuery.setGeometryField(features.getShapeFieldName());
spatialQuery.setSpatialRel(esriSpatialRelEnum.esriSpatialRelIntersects);
spatialQuery.setSubFields(SubField.FEATUREOFINTEREST_ID);
IFeatureCursor featureCursor = features.search(spatialQuery, true);
IFeature feature = featureCursor.nextFeature();
List<String> featureList = new ArrayList<String>();
while (feature != null) {
featureList.add((String)feature.getValue(0));
feature = featureCursor.nextFeature();
}
return featureList;
}
开发者ID:52North,
项目名称:ArcGIS-Server-SOS-Extension,
代码行数:32,
代码来源:AccessGDBImpl.java
示例2: getFeatureClasses
点赞 3
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public IFeatureClass[] getFeatureClasses() {
try {
String folder = GV.getDefaultTempFileDirectoryPath();
String fName = "feat2fc";
int fCount = featureClass.featureCount(null);
IFeatureCursor cursor = null;
IFeatureBuffer buffer = null;
IFeature feat = null;
IFeatureClass[] fclses = new IFeatureClass[fCount];
for (int i = 0; i < fCount; i++) {
feat = featureClass.getFeature(i);
fclses[i] = this.getFC(folder, fName, this.featureClass);
cursor = fclses[i].IFeatureClass_insert(true);
buffer = fclses[i].createFeatureBuffer();
insertFeature(feat, cursor, buffer);
cursor.flush();
}
return fclses;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:25,
代码来源:Feat2FC.java
示例3: getGroupLayer
点赞 3
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* 获取定级范围的“层组”
*
* @return
* @throws Exception
* @throws IOException
*/
public GroupLayer getGroupLayer() throws Exception, IOException {
// 获取当前定级范围featureClass
IFeatureClass ifc = getFeatureClass();
GroupLayer ret = new GroupLayer();
ret.setExpanded(false);
// 设置层组的名称
ret.setName("定级范围");
FeatureLayer fl = new FeatureLayer();
fl.setName(getName());
fl.setFeatureClassByRef(ifc);
ret.add(fl);
return ret;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:24,
代码来源:RangeCMap.java
示例4: getGroupLayer
点赞 3
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* 获取阻隔的“层组”
*
* @return
* @throws Exception
* @throws IOException
*/
public GroupLayer getGroupLayer() throws Exception, IOException {
// 获取当前阻隔featureClass
IFeatureClass ifc = getFeatureClass();
GroupLayer ret = new GroupLayer();
ret.setExpanded(false);
// 设置层组的名称
ret.setName("阻隔");
FeatureLayer fl = new FeatureLayer();
fl.setName(getName());
fl.setFeatureClassByRef(ifc);
ret.add(fl);
return ret;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:24,
代码来源:ObstructCMap.java
示例5: getGroupLayer
点赞 3
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public GroupLayer getGroupLayer() throws Exception, IOException {
// 获取当前工作底图的所有featureClass
IFeatureClass[] ifc = getFeatureClass();
GroupLayer ret = new GroupLayer();
ret.setExpanded(false);
// 设置层组的名称
ret.setName(getName());
FeatureLayer fl;
for (int i = 0; i < ifc.length; i++) {
fl = new FeatureLayer();
fl.setFeatureClassByRef(ifc[i]);
fl.setName("工作底图("+i+")");
ret.add(fl);
}
return ret;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:19,
代码来源:BGCMap.java
示例6: getCheckFieldIdx
点赞 3
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public int getCheckFieldIdx(IFeatureClass fc) throws AutomationException, IOException
{
int vIdx = fc.getFields().findField(checkFieldStr);
if (vIdx == -1) {
Field field = new Field();
IFieldEdit edit = new IFieldEditProxy(field);
edit.setAliasName(checkFieldStr);
edit.setName(checkFieldStr);
edit.setType(esriFieldType.esriFieldTypeDouble);
fc.addField(field);
vIdx = fc.findField(checkFieldStr);
}
return vIdx;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:17,
代码来源:FillSampleRank.java
示例7: doExport
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private void doExport(
final IGPValue hadoopPropValue,
final IGPValue featureClassValue,
final IGPValue outputValue,
final IGPMessages messages) throws Exception
{
final IFeatureClass[] featureClasses = new IFeatureClass[]{new IFeatureClassProxy()};
gpUtilities.decodeFeatureLayer(featureClassValue, featureClasses, null);
final FeatureClass featureClass = new FeatureClass(featureClasses[0]);
try
{
final Configuration configuration = createConfiguration(hadoopPropValue.getAsText());
final String namespace = configuration.get("schema.namespace", "com.esri");
final Path path = new Path(outputValue.getAsText());
final FileSystem fileSystem = path.getFileSystem(configuration);
try
{
final FSDataOutputStream fsDataOutputStream = fileSystem.create(path, true);
try
{
doSchema(fsDataOutputStream, namespace, featureClass, messages);
}
finally
{
fsDataOutputStream.close();
}
}
finally
{
fileSystem.close();
}
}
finally
{
Cleaner.release(featureClass);
}
}
开发者ID:mraad,
项目名称:AvroToolbox,
代码行数:38,
代码来源:SchemaTool.java
示例8: doExport
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private int doExport(
final IArray parameters,
final IGPMessages messages
) throws Exception
{
final IGPValue hadoopConfValue = gpUtilities.unpackGPValue(parameters.getElement(0));
final IGPValue featureClassValue = gpUtilities.unpackGPValue(parameters.getElement(2));
int count = 0;
final IFeatureClass[] featureClasses = new IFeatureClass[]{new IFeatureClassProxy()};
gpUtilities.decodeFeatureLayer(featureClassValue, featureClasses, null);
final FeatureClass featureClass = new FeatureClass(featureClasses[0]);
try
{
final Configuration configuration = HBaseConfiguration.create(createConfiguration(hadoopConfValue.getAsText()));
createIfDoesNotExist(configuration, featureClass.getName());
final HTableInterface table = new HTable(configuration, featureClass.getName());
try
{
table.setAutoFlush(configuration.getBoolean("exportToHBaseTool.autoFlush", false));
messages.addMessage("autoFlush is " + (table.isAutoFlush() ? "true" : "false"));
table.setWriteBufferSize(configuration.getInt("exportToHBaseTool.writeBufferSize", 2 * 1024 * 1024));
messages.addMessage(String.format("writeBufferSize = %d", table.getWriteBufferSize()));
count = doExport(configuration, messages, featureClass, table);
if (!table.isAutoFlush())
{
table.flushCommits();
}
}
finally
{
table.close();
}
}
finally
{
Cleaner.release(featureClass);
}
return count;
}
开发者ID:mraad,
项目名称:HBaseToolbox,
代码行数:41,
代码来源:ExportToHBaseTool.java
示例9: canRender
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* @see IFeatureRenderer#canRender
*/
public boolean canRender(IFeatureClass iFeatureClass, IDisplay iDisplay)
throws IOException, AutomationException {
if (iFeatureClass.getShapeType() == esriGeometryType.esriGeometryNull)
return true;
else
return false;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:11,
代码来源:RendererDialog.java
示例10: ObstructCombine
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public ObstructCombine(FeatureClassDescriptor fcDescriptor,IFeatureClass featureClass){
try {
this.fcd = fcDescriptor;
this.fc = featureClass;
this.sset = fcDescriptor.getSelectionSet();
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:10,
代码来源:ObstructCombine.java
示例11: getFeatureClass
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private IFeatureClass getFeatureClass(){
try {
ShapefileWorkspaceFactory factory = new ShapefileWorkspaceFactory();
IFeatureWorkspace space = new IFeatureWorkspaceProxy(factory
.openFromFile("E:\\ATest", 0));
IFeatureClass featureClass = space.openFeatureClass("����վ��.shp");
return featureClass;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return null;
}
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:14,
代码来源:ObstructCombine.java
示例12: getFC
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private IFeatureClass getFC(String folderName, String shapeName,
IFeatureClass fcls) {
try {
String strFolder = folderName;
String strName = shapeName;
String strShapeFieldName = "Shape";
strName = getNewShapefileName(strFolder, strName);
// Open the folder to contain the shapefile as a workspace
System.out.println("Open " + strFolder + " to contain the "
+ strName + " as a workspace");
IFeatureWorkspace pFWS = null;
IWorkspaceFactory pWorkspaceFactory = null;
pWorkspaceFactory = new ShapefileWorkspaceFactory();
pFWS = new IFeatureWorkspaceProxy(pWorkspaceFactory.openFromFile(
strFolder, 0));
// Create the shapefile (some parameters apply to geodatabase
// options and can be defaulted as Nothing)
System.out.println("Create " + strName);
IFeatureClass pFeatClass = null;
pFeatClass = pFWS.createFeatureClass(strName, fcls.getFields(),
null, null, esriFeatureType.esriFTSimple,
strShapeFieldName, "");
return pFeatClass;
} catch (java.lang.Exception e) {
e.printStackTrace();
System.out.println("Exception :" + e.getMessage());
return null;
}
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:32,
代码来源:Feat2FC.java
示例13: getAsPloygonFeatureClass
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
*
* @return
*/
public IFeatureClass getAsPloygonFeatureClass() {
if (polygonFeatureClass != null)
return polygonFeatureClass;
AssemblyFC afc=new AssemblyFC(Thread.currentThread(),false);
afc.start();
Thread.currentThread().suspend();
/*
while(true)
{
if(afc.ok)
{
//System.out.println("OK lA~");
break;
}else
{
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}*/
return polygonFeatureClass;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:36,
代码来源:CellValueCMap.java
示例14: getRasterAnalysisEnvironment
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public IRasterAnalysisEnvironment getRasterAnalysisEnvironment()
throws Exception, IOException {
// rasterAnalysisEnvironment=new
RasterAnalysis ra = new RasterAnalysis();
ra.setAsNewDefaultEnvironment();
// Cell Size
ra.setCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue, new Double(
getCellSize()));
// output File Path:
IWorkspaceFactory wkspfactory = new RasterWorkspaceFactory();
IWorkspace wksp = new IWorkspaceProxy(wkspfactory.openFromFile(
getTempDirectory(), 0));
ra.setOutWorkspaceByRef(wksp);
// Use current ClassifyRange to set Extent & Out Spatial Reference
IFeatureClass tempFc = getClassifyRange().getFeatureClass();
IGeoDataset geoDataset = new IGeoDatasetProxy(tempFc);
ra.setOutSpatialReferenceByRef(geoDataset.getSpatialReference());
// set Analysis Mask
ra.setMaskByRef(geoDataset);
IEnvelope envProvider = geoDataset.getExtent();
/*
System.out.println("Feature_Extent_Name:" + tempFc.toString());
System.out.println("SR_Name:"
+ geoDataset.getSpatialReference().getName());
System.out.println("XMax:" + envProvider.getXMax());
System.out.println("XMin:" + envProvider.getXMin());
System.out.println("YMax:" + envProvider.getYMax());
System.out.println("XMin:" + envProvider.getYMin());*/
Object snapProvider = null;
ra
.setExtent(
com.esri.arcgis.geoanalyst.esriRasterEnvSettingEnum.esriRasterEnvValue,
envProvider, snapProvider);
// ra.setExtent(com.esri.arcgis.geoanalyst.esriRasterEnvSettingEnum.esriRasterEnvValue,tempFc.getExtension(),null);
return ra;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:39,
代码来源:ClassifyProject.java
示例15: initialGeoDataset
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* ��ָ��(fullShpPath)��featureClass����Geodataset����ʽ����
* @param fullShpPath
* @return
* @throws UnknownHostException
* @throws Exception
*/
private IGeoDataset initialGeoDataset(String fullShpPath)
throws UnknownHostException, Exception {
// Get the directory from the inShapefilePath
String pathToWorkspace;
pathToWorkspace = GT.getFilePath(fullShpPath);
// Get the shapefile name from the inShapefilePath
String shapefileName;
shapefileName = GT.getFileNameWithoutExtension(fullShpPath);
// Open the shapefile's workspace
IWorkspaceFactory shapeWorkspaceFactory = new ShapefileWorkspaceFactory();
IWorkspace shapeWorkspace;
shapeWorkspace = shapeWorkspaceFactory.openFromFile(pathToWorkspace, 0);
// Failure here causes a run-time exception, but if IFeatureWorkspace
// isn't
// supported by a Shapefile Workspace, there are lots more bad problems
// happening than this one.
IFeatureWorkspace featureWorkspace = new IFeatureWorkspaceProxy(
shapeWorkspace);
IFeatureClass featureClass;
featureClass = featureWorkspace.openFeatureClass(shapefileName);
// Get the interface required for the operation. Again, this cast should
// never fail.
IGeoDataset geoDataset = new IGeoDatasetProxy(featureClass);
return geoDataset;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:44,
代码来源:ShpDistanceOp.java
示例16: OpenFeatureClass
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* 打开ESRI.SHAPEFILE文件
*
* @param stringWorkspace
* @param stringFeatureClass
* @return
* @throws UnknownHostException
* @throws IOException
*/
public static IFeatureClass OpenFeatureClass(String workspacePath,
String featureClassName) throws UnknownHostException, IOException {
ShapefileWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactory();
IFeatureWorkspace featureWorkspace = new IFeatureWorkspaceProxy(
workspaceFactory.openFromFile(workspacePath, 0));
IFeatureClass featureClass = featureWorkspace
.openFeatureClass(featureClassName);
return featureClass;
/*
* Create the workspace name object IWorkspaceName workspaceName =
* new WorkspaceName(); workspaceName.setPathName(stringWorkspace);
* workspaceName
* .setWorkspaceFactoryProgID("esriDataSourcesFile.ShapefileWorkspaceFactory");
* // Create the feature class name object IDatasetName datasetName =
* new FeatureClassName(); datasetName.setName(stringFeatureClass);
* datasetName.setWorkspaceNameByRef(workspaceName);
* // Open the feature class IName name = (IName) datasetName;
* // Return FeaureClass return new IFeatureClassProxy(name.open());
*/
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:36,
代码来源:Utility.java
示例17: FeatureClass2Shapefile
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public static void FeatureClass2Shapefile(String path,IFeatureClass inFeatureClass) throws UnknownHostException, IOException
{
String wkspPath = GT.getFilePath(path);
String outName = GT.getFileName(path);
IWorkspaceName shapeWorkName = new WorkspaceName();
shapeWorkName.setWorkspaceFactoryProgID("esriDataSourcesFile.ShapefileWorkspaceFactory");
shapeWorkName.setPathName(wkspPath);
IFeatureClassName shapeFeatClassName = new FeatureClassName();
IDatasetName dataSetName = new IDatasetNameProxy(shapeFeatClassName);
dataSetName.setName(outName);
dataSetName.setWorkspaceNameByRef(shapeWorkName);
IFeatureDataConverter featDataConv = new FeatureDataConverter();
IFeatureClass f=inFeatureClass;
IDataset dataset = new IDatasetProxy(f);
IFeatureClassName covFeatClassName;
IName name;
name = dataset.getFullName();
covFeatClassName = new IFeatureClassNameProxy(name);
featDataConv.convertFeatureClass(
covFeatClassName,
null,
null,
shapeFeatClassName,
null,
null,
null,
1000,
0
);
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:36,
代码来源:Utility.java
示例18: FeatureClass2MIF
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public static void FeatureClass2MIF(String path,IFeatureClass inFeatureClass) throws UnknownHostException, IOException
{
String temp=path;
if(temp.toLowerCase().endsWith(".mif"))
{
temp=temp.substring(0,temp.length()-4)+"2MIF"+".shp";
}
//先将定级单元格分值图保存成ShapeFile文件
//saveAsShapeFile(temp);
FeatureClass2Shapefile(temp,inFeatureClass);
//使用工具org2org将shp转成Mif
Runtime r=Runtime.getRuntime();
Process p=null;
String[] cmd=new String[5];
//convert tools filepath
cmd[0]=ConvertEnvironment.getX2x_FilePath();
cmd[1]="-f";
cmd[2]="MapInfo File";
//dstination datasource
if(!path.toLowerCase().endsWith(".mif"))path+=".mif";
cmd[3]=path;
//source datacource
cmd[4]=temp;
//Excute command
p=r.exec(cmd);
System.out.println(p.getInputStream().toString());
System.out.println(p.getErrorStream().toString());
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:32,
代码来源:Utility.java
示例19: FeatureClass2TAB
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public static void FeatureClass2TAB(String path,IFeatureClass inFeatureClass) throws UnknownHostException, IOException
{
String temp=path;
if(temp.toLowerCase().endsWith(".tab"))
{
temp=temp.substring(0,temp.length()-4)+"2TAB"+".shp";
}
//先将定级单元格分值图保存成ShapeFile文件
FeatureClass2Shapefile(temp,inFeatureClass);
//使用工具org2org将shp转成Mif
Runtime r=Runtime.getRuntime();
Process p=null;
String[] cmd=new String[5];
//convert tools filepath
cmd[0]=ConvertEnvironment.getX2x_FilePath();
cmd[1]="-f";
cmd[2]="MapInfo File";
//dstination datasource
if(!path.toLowerCase().endsWith(".tab"))path+=".tab";
cmd[3]=path;
//source datacource
cmd[4]=temp;
//Excute command
p=r.exec(cmd);
System.out.println(p.getInputStream());
System.out.println(p.getErrorStream());
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:33,
代码来源:Utility.java
示例20: initialFieldList
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
protected void initialFieldList(IFeatureClass inFC) throws AutomationException, IOException {
fieldList.removeAll();
IFields fields=inFC.getFields();
for(int i=0;i<fields.getFieldCount();i++)
{
fieldList.add(fields.getField(i).getName());
}
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:11,
代码来源:SamplePointPage.java
示例21: EstModify
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* @classfor
* @param fcls FeatureClass that will be modified
* @param revise Rules for modification
* @param fieldW Name of the field that will be modified
*/
public EstModify(IFeatureClass fcls, Revise revise,String fieldW) {
featureClass=fcls;
this.revise=revise;
revise.tidy();
this.fieldRead=revise.getReviseFieldName();
// this.fieldRead=fieldW;
fieldWrite=fieldW;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:15,
代码来源:EstModify.java
示例22: EstimateRule
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
*
* @param inSimplePoint
* @param inCellValue
* @param inClassifyRevise
*/
public EstimateRule(IFeatureClass inSimplePoint, IFeatureClass inCellValue,
Revise inClassifyRevise) {
simplePoint = inSimplePoint;
cellValue = inCellValue;
classifyRevise = inClassifyRevise;
initialData();
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:14,
代码来源:EstimateRule.java
示例23: doExport
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private int doExport(
final IGPValue hadoopPropValue,
final IGPValue featureClassValue,
final IGPValue schemaValue,
final IGPValue outputValue) throws Exception
{
int count = 0;
final IFeatureClass[] featureClasses = new IFeatureClass[]{new IFeatureClassProxy()};
gpUtilities.decodeFeatureLayer(featureClassValue, featureClasses, null);
final FeatureClass featureClass = new FeatureClass(featureClasses[0]);
try
{
final int wkid = getWkid(featureClass);
final Configuration configuration = createConfiguration(hadoopPropValue.getAsText());
final Schema schema = parseSchema(schemaValue.getAsText(), configuration);
final Path path = new Path(outputValue.getAsText());
path.getFileSystem(configuration).delete(path, true);
final AvroParquetWriter<GenericRecord> writer = new AvroParquetWriter<GenericRecord>(path, schema);
try
{
final IFeatureCursor cursor = featureClass.search(null, false);
try
{
final IFields fields = cursor.getFields();
IFeature feature = cursor.nextFeature();
try
{
while (feature != null)
{
final IGeometry shape = feature.getShape();
if (shape instanceof Point)
{
writer.write(buildRecord(schema, wkid, fields, feature, (Point) shape));
count++;
}
else if (shape instanceof Polyline)
{
writer.write(buildRecord(schema, wkid, fields, feature, (Polyline) shape));
count++;
}
else if (shape instanceof Polygon)
{
writer.write(buildRecord(schema, wkid, fields, feature, (Polygon) shape));
count++;
}
feature = cursor.nextFeature();
}
}
finally
{
Cleaner.release(fields);
}
}
finally
{
Cleaner.release(cursor);
}
}
finally
{
writer.close();
}
}
finally
{
Cleaner.release(featureClass);
}
return count;
}
开发者ID:mraad,
项目名称:AvroToolbox,
代码行数:73,
代码来源:ExportToAvroParquetTool.java
示例24: doExport
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private Void doExport(
final IArray parameters,
final IGPMessages messages
) throws Exception
{
final IGPValue hadoopConfValue = gpUtilities.unpackGPValue(parameters.getElement(0));
final IGPValue featureClassValue = gpUtilities.unpackGPValue(parameters.getElement(2));
final IFeatureClass[] featureClasses = new IFeatureClass[]{new IFeatureClassProxy()};
gpUtilities.decodeFeatureLayer(featureClassValue, featureClasses, null);
final FeatureClass featureClass = new FeatureClass(featureClasses[0]);
try
{
final Configuration configuration = HBaseConfiguration.create(createConfiguration(hadoopConfValue.getAsText()));
final HBaseAdmin admin = new HBaseAdmin(configuration);
try
{
if (admin.tableExists(featureClass.getName()))
{
admin.disableTable(featureClass.getName());
admin.deleteTable(featureClass.getName());
}
messages.addMessage("Creating HTable '" + featureClass.getName() + "'");
final int maxVersions = configuration.getInt("createHTableTool.maxVersions", 1);
final HTableDescriptor tableDescriptor = new HTableDescriptor(featureClass.getName());
final HColumnDescriptor geomDescriptor = new HColumnDescriptor(Const.GEOM);
geomDescriptor.setMaxVersions(maxVersions);
tableDescriptor.addFamily(geomDescriptor);
final HColumnDescriptor attrDescriptor = new HColumnDescriptor(Const.ATTR);
attrDescriptor.setMaxVersions(maxVersions);
tableDescriptor.addFamily(attrDescriptor);
admin.createTable(tableDescriptor);
}
finally
{
admin.close();
}
}
finally
{
Cleaner.release(featureClass);
}
return null;
}
开发者ID:mraad,
项目名称:HBaseToolbox,
代码行数:50,
代码来源:CreateHTableTool.java
示例25: prepareFilter
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
/**
* @see IFeatureRenderer#prepareFilter
*/
public void prepareFilter(IFeatureClass iFeatureClass,
IQueryFilter iQueryFilter) throws IOException, AutomationException {
// nothing implemented
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:8,
代码来源:RendererDialog.java
示例26: getFCD
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private FeatureClassDescriptor getFCD(String folderName,String shapeName,IFields fields,IQueryFilter filter,String fieldName){
try{
String strFolder = folderName;
String strName = shapeName;
String strShapeFieldName= "Shape";
strName=getNewShapefileName(strFolder,strName);
//Open the folder to contain the shapefile as a workspace
System.out.println("Open " + strFolder +" to contain the "+strName+" as a workspace");
IFeatureWorkspace pFWS = null;
IWorkspaceFactory pWorkspaceFactory = null;
pWorkspaceFactory = new ShapefileWorkspaceFactory();
pFWS = new IFeatureWorkspaceProxy(pWorkspaceFactory.openFromFile(strFolder, 0));
editor=new IWorkspaceEditProxy(pFWS);
editor.startEditing(false);
editor.startEditOperation();
//Create the shapefile (some parameters apply to geodatabase options and can be defaulted as Nothing)
System.out.println("Create " + strName);
IFeatureClass pFeatClass = null;
pFeatClass = pFWS.createFeatureClass(strName, fields, null, null,esriFeatureType.esriFTSimple, strShapeFieldName, "");
IFeatureCursor cursor=pFeatClass.IFeatureClass_insert(true);
int count=fcd.getFeatureClass().featureCount(null);
IFeatureBuffer buffer=pFeatClass.createFeatureBuffer();
IFeature feat=null;
for(int i=0;i<count;i++){
feat=fcd.getFeatureClass().getFeature(i);
insertFeature(feat.getShapeCopy(),feat,cursor,buffer);
}
cursor.flush();
FeatureClassDescriptor des=new FeatureClassDescriptor();
ISelectionSet set=pFeatClass.select(filter,esriSelectionType.esriSelectionTypeSnapshot,esriSelectionOption.esriSelectionOptionNormal,new IWorkspaceProxy(pFWS));
des.createFromSelectionSet(set,filter,fieldName);
return des;
}catch (java.lang.Exception e){
e.printStackTrace();
System.out.println("Exception :"+ e.getMessage());
return null;
}
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:42,
代码来源:ObstructCombine.java
示例27: Feat2FC
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public Feat2FC(IFeatureClass fcls) {
this.featureClass = fcls;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:4,
代码来源:Feat2FC.java
示例28: RangeCMap
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public RangeCMap(IFeatureClass inFeatureClass) throws UnknownHostException,
IOException {
fc = inFeatureClass;
setName("定级范围");
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:7,
代码来源:RangeCMap.java
示例29: getFeatureClass
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public IFeatureClass getFeatureClass() throws AutomationException,
IOException {
if (featureClass == null)
return getAsFeatureLayer(raster).getFeatureClass();
return featureClass;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:7,
代码来源:RankCMap.java
示例30: setFeatureClass
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public void setFeatureClass(IFeatureClass featureClass) {
this.featureClass = featureClass;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:4,
代码来源:RankCMap.java
示例31: ObstructCMap
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public ObstructCMap(IFeatureClass inFeatureClass) throws UnknownHostException,
IOException {
fc = inFeatureClass;
setName("阻隔");
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:7,
代码来源:ObstructCMap.java
示例32: calcuObstruct
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
private IGeoDataset calcuObstruct(IFeatureClass obstruct,
ShpDistanceOp sdo, IMapAlgebraOp mapAlgebraOp, Merge merge)
throws Exception {
IQueryFilter qf = new QueryFilter();
//qf.setWhereClause(FFTConstant.FUNCTION_RANGE_FIELD + " <> 0");
ISelectionSet selectionSet;
FeatureClassDescriptor fcd = new FeatureClassDescriptor();
// simplePointfcd.create(inFeature,qf,null);
int count = obstruct.featureCount(null);
if (count == 0)
return null;
ArrayList al = new ArrayList();
double range = 0;
double score = 0;
IGeoDataset temp;
String cmdStr = "";
for (int i = 0; i < count; i++) {
range = Double.parseDouble(obstruct.getFeature(i).getValue(
obstruct.findField(FFTConstant.FUNCTION_RANGE_FIELD))
.toString());
score = Double.parseDouble(obstruct.getFeature(i).getValue(
obstruct.findField(FFTConstant.FUNCTION_SCORE_FIELD))
.toString());
if (range == 0 || score == 0) {
continue;
}
qf.setWhereClause("FID = " + i);
//System.out.println("FID = " + i);
selectionSet = obstruct.select(qf,
esriSelectionType.esriSelectionTypeIDSet,
esriSelectionOption.esriSelectionOptionNormal, null);
System.out.println("selectionSet.getCount():"+selectionSet.getCount());
fcd.createFromSelectionSet(selectionSet, null,
"FID");
IGeoDataset gd=new IGeoDatasetProxy(fcd.getFeatureClass());
temp = sdo.doStraightLine(gd, range);
mapAlgebraOp.bindRaster(temp, "temp1");
// 构造计算公式
if (getFormula() == FFTConstant.FORMULA_LINEAR_ATTENUATION) {
// 直线衰减计算公式
cmdStr = score + " * ( 1 - [temp1] / " + range + " )";
} else if (getFormula() == FFTConstant.FORMULA_EXPONENTIAL_ATTENUATION) {
// 指数衰减计算公式
cmdStr = "Pow(" + score + " , 1 - [temp1] / " + range + " )";
}
al.add(mapAlgebraOp.execute(cmdStr));
}
IGeoDataset data[] = new IGeoDataset[al.size()];
for (int i = 0; i < data.length; i++) {
data[i] = (IGeoDataset) al.get(i);
}
merge.specifyDataLayers(data);
return merge.mergeDataLayers();
//return merge.mergeUseBigValue();
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:65,
代码来源:Facet.java
示例33: run
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
monitor.beginTask("开始进行地价评估!", 10);
final IFeatureClass cellValue= dataSpecifyPage.getCellValueMap().getAsPloygonFeatureClass();
// final IRaster
// cellValueRaster=dataSpecifyPage.getCellValueMap().getAsRaster();
final IFeatureClass simplePoint = samplePointPage
.getSimplePointFeatureClass();
final String dataName=samplePointPage.getDataName();
final Revise classifyRevise = dataSpecifyPage.getClassifyRevise();
classifyRevise.multiple(GV.multiple);
final PublicProperty pp = publicPropertyPage.getPublicProperty();
final Revise revises[] = revisePage.getRevises();
final boolean avgFlag = calculatePage.getAvgButton().getSelection();
final boolean expFlag = calculatePage.getExpButton().getSelection();
final boolean saveFlag = calculatePage.getIsSaveButton().getSelection();
final String savePath = calculatePage.getResultText().getText();
final int SDMultiple = eliminatePage.getSDNum();
final String[] checkFields=eliminatePage.getCheckFields();
new Thread(new Runnable() {
public void run() {
try {
EstimateRule er=new EstimateRule(simplePoint,cellValue,classifyRevise);
//检验、剔除
er.eliminate(checkFields,SDMultiple);
//修正
er.revise(revises);
//计算V值
er.calculateV(dataName);
String temp = "";
if (expFlag) {
temp+=er.estimate_ExpModel();
}
if (avgFlag) {
temp += er.estimate_AvgModel();
}
if (saveFlag) {
GT.write2Txt(savePath, temp);
}
EstimateWizard.flag = false;
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
while (flag) {
Thread.sleep(20000);
monitor.worked(1);
}
flag = true;
monitor.done();
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:70,
代码来源:EstimateWizard.java
示例34: getSimplePointFeatureClass
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public IFeatureClass getSimplePointFeatureClass() {
return simplePointFeatureClass;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:4,
代码来源:SamplePointPage.java
示例35: BusinessWin
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public BusinessWin(IFeatureClass fcls, PublicProperty pp) {
this.featureClass=fcls;
this.publicProperty=pp;
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:5,
代码来源:BusinessWin.java
示例36: BusinessArithmaticMean
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public BusinessArithmaticMean(IFeatureClass features, Revise revise) {
this.featureClass = features;
this.revise = revise;
// this.fldLevel=revise.getReviseFieldName();
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:6,
代码来源:BusinessArithmaticMean.java
示例37: ZDCQCalculator
点赞 2
import com.esri.arcgis.geodatabase.IFeatureClass; //导入依赖的package包/类
public ZDCQCalculator(IFeatureClass inSimplePoint) {
super(inSimplePoint);
}
开发者ID:vonpower,
项目名称:VonRep,
代码行数:4,
代码来源:ZDCQCalculator.java