ArcSDE C-API 开发:读取属性数据
来源:互联网 发布:怎么设置淘宝店铺基础 编辑:程序博客网 时间:2024/05/14 03:47
很难得看到的Arcsde C API的sample,连官方网站上都是提供的java的,特此收录,转自http://www.gispower.org/article/arcgis/ao/2007/1113/0711132158575H3JBA9K9D4202D084ED.htm
SE_CONNECTION Connection;
SE_STREAM Stream;
SE_SQL_CONSTRUCT *sqlc
SE_ERROR Connect_error;
LONG rc, population;
SHORT num_cols;
LFLOAT area;
CHAR *server, *instance, *database, *user, *passwd;
CHAR **attrs, *name;
/* Connect to ArcSDE */
rc = SE_connection_create
(server, instance, database, user, passwd, &Connect_error, &Connection);
/* See Error handling section for check_error function code. */
check_error(Connection, NULL, rc, "SE_connection_create");
/* Create a stream for the query */
rc = SE_stream_create (Connection, &Stream);
check_error(Connection, NULL, rc, "SE_stream_create");
/* Allocate an SE_SQL_CONSTRUCT */
rc = SE_sql_construct_alloc (1, &sqlc);
check_error(Connection, NULL, rc, "SE_sql_construct_alloc");
/* Fill in the details of the SQL query */
sqlc->where = malloc(20);
sqlc->num_tables = 1;
strcpy (sqlc->tables[0], "cities");
strcpy (sqlc->where, "population < 10000");
/* Define the number and names of the table columns to be returned */
num_cols = 3;
attrs = (CHAR **) malloc (num_cols * sizeof(CHAR *));
attrs[0] = "city_name";
attrs[1] = "area";
attrs[2] = "population";
/* Define the stream query */
rc = SE_stream_query (Stream, num_cols, attrs, sqlc);
check_error(NULL, Stream, rc, "SE_stream_query");
rc = SE_stream_execute (Stream);
/* Iterate over the results */
while (rc == SE_SUCCESS)
{
rc = SE_stream_fetch (Stream);
if (rc == SE_SUCCESS)
{
rc = SE_stream_get_string (Stream,1,name);
check_error(NULL, Stream, rc, "SE_stream_get_string");
rc = SE_stream_get_double (Stream,2,&area);
check_error(NULL, Stream, rc, "SE_stream_get_double");
rc = SE_stream_get_integer (Stream,3,&population);
check_error(NULL, Stream, rc, "SE_stream_get_integer");
/* Now do something with the name, area and population */
}
}
/* Release the stream when it is no longer needed */
rc = SE_stream_free (Stream);
free (attrs);
free (sqlc->where);
undefined undefined undefined undefinedSE_sql_construct_free (sqlc);
/* Disconnect from ArcSDE */
undefined undefined undefined undefinedSE_connection_free (Connection);
- ArcSDE C-API 开发:读取属性数据
- ArcSDE C-API 开发:读取属性数据
- ArcSDE C API
- ArcSDE c api 在C#中开发记录
- ArcSDE C SDK开发详解
- ArcSDE C APi的C#调用
- ArcSDE Java API 翻译
- ArcSDE Java API
- ArcSDE Java API
- 【.Net码农】【淘宝API】淘宝API开发系列--读取实体类的属性的备注作为表头的应用
- GeoServer访问ArcSDE数据
- ArcSDE数据迁移
- 读取数据的一些属性
- arcengine 读取属性表数据
- open taobao API 读取商品属性
- C#:读取数据DataReader
- Arcsde API about Error handling
- 利用ArcSDE C API向SQL SERVER空间数据库中添加实体图形
- 闲话GeoCommons、OpenStreetMap及其他
- Android View 的刷新机制
- unity3d 动画
- 插入排序
- 文件名函数
- ArcSDE C-API 开发:读取属性数据
- BPL VS DLL
- eclipse调试错误No source available for "_dl_debug_state() 解决方案
- ArcSDE C API
- HTML5安全:CORS(跨域资源共享)简介
- 中国剩余定理(韩信点兵)
- 浅谈seoer如何做网站内部优化
- 前端Js组件库OperaMasks-UI使用经验介绍
- UNDO表空间失败的处理方法