ArcObject Java API 开发概述
2010-06-02 16:49
363 查看
[b]1.跨平台[/b]
保持平台的兼容性,数据和路径的名称要以小写字母表示,路径要使用相对路径。
[b]2.Interfaces[/b]
ArcObject中接口的命名统一以I开头,接口的代理类命名在接口名称后加上proxy,如下命名:
ArcObject提供了三种类:abstract classes, classes, and coclasses,abstract classes不可实例化,coclasses也称Comclasses,可以直接实例化,classes不可以直接实例化。
classes 类可以作为coclasses属性被创建,如下示例代码:
保持平台的兼容性,数据和路径的名称要以小写字母表示,路径要使用相对路径。
[b]2.Interfaces[/b]
ArcObject中接口的命名统一以I开头,接口的代理类命名在接口名称后加上proxy,如下命名:
interface IArea: IUnknown public interface IArea{}
public class IAreaProxy implements IArea{}
ArcGIS API 提供了两种访问对象的方式:
/* Point实现了IPoint这个接口,采用向上转型的方式生成对象 */
IPoint iPoint = new com.esri.arcgis.geometry.Point();
/* 直接实例化 */
Point cPoint = new Point();
注意:不能通过缺省的代理类来访问对象,如下面方式:
IPointProxy proxyPoint = new IPointProxy();//错
[b]3.Classes[/b]
ArcObject提供了三种类:abstract classes, classes, and coclasses,abstract classes不可实例化,coclasses也称Comclasses,可以直接实例化,classes不可以直接实例化。
classes 类可以作为coclasses属性被创建,如下示例代码:
IWorkspaceFactory wf = new ShapefileWorkspaceFactory();
IFeatureWorkspace fw = new IFeatureWorkspaceProxy(wf.openFromFile("\path\to\data", 0) );
/* Create a feature class from FeatureWorkspace. */
IFeatureClass fc = fw.openFeatureClass("featureclass name");
[b][b]4.Methods that take out parameters[/b][/b]
关于转型的问题,ArcGIS API不允许向子类数组中传递超类类型,即使该数组已经被转换为超类类型。
下面是正确的出传递方法: IGeometry[] geoArray = { new Polyline() }; tin.interpolateShape(breakline, geoArray, null); /* Cast the first array element as a Polyline. This is * the equivalent of calling QueryInterface on IGeometry. */ IPolyline firstPolyLine = new IPolylineProxy(geoArray[0]);
相关文章推荐
- Java开发人员必知必会的20种常用类库和API
- 用Java Timer API进行时间调度开发的相关注意点
- Java中国象棋博弈程序探秘[1]——博弈程序开发概述
- JPush极光推送 Java调用服务器端API开发
- 第一章 Java Web开发概述
- JPush极光推送 Java调用服务器端API开发
- 编程语言 | Java - 01.Java语言概述与开发环境
- java概述与开发环境
- Java学习笔记_3_Java语言概述及开发环境配置
- 【Android 应用开发】Android 网络编程 API笔记 - java.net 包相关 接口 api
- 使用Java蓝牙无线通讯技术API概述之一
- 入门篇 1. Java Web 开发概述
- java微信开发API解析(四)-自定义菜单以及个性化菜单实现
- [置顶] Java开发人员必知必会的20种常用类库和API
- java微信开发API解析(六)-综合运用(消息处理、自定义菜单响应处理、用户自动分组处理;包含源码)
- HBase JAVA API 开发
- JAVA开发之 11-JAVA语言基础(注释概述及其分类)
- 【Android 应用开发】Android 网络编程 API笔记 - java.net 包 权限 地址 套接字 相关类 简单介绍
- iOS海哥开发笔记 (海哥原创,iOS 之API概述)
- SonarQube插件开发自定义规则(2)常用api-扫描java文本内容