filegdb 0.0.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +2 -2
- data/ext/filegdb/base.hpp +3 -4
- data/ext/filegdb/double_primitive.cpp +0 -1
- data/ext/filegdb/extconf.rb +0 -44
- data/ext/filegdb/field_info.cpp +1 -2
- data/ext/filegdb/filegdb.hpp +4 -4
- data/ext/filegdb/filegdb/include/FileGDBAPI.h +4 -1
- data/ext/filegdb/filegdb/include/FileGDBCore.h +4 -1
- data/ext/filegdb/filegdb/include/Geodatabase.h +319 -291
- data/ext/filegdb/filegdb/include/GeodatabaseManagement.h +1 -1
- data/ext/filegdb/filegdb/include/Raster.h +1 -1
- data/ext/filegdb/filegdb/include/Row.h +175 -5
- data/ext/filegdb/filegdb/include/Table.h +300 -296
- data/ext/filegdb/filegdb/include/Util.h +24 -15
- data/ext/filegdb/filegdb/include/make.include +39 -29
- data/ext/filegdb/filegdb/lib/libFileGDBAPI.dylib +0 -0
- data/ext/filegdb/filegdb/lib/libFileGDBAPI.so +0 -0
- data/ext/filegdb/filegdb/lib/libfgdbunixrtl.dylib +0 -0
- data/ext/filegdb/filegdb/lib/libfgdbunixrtl.so +0 -0
- data/ext/filegdb/geodatabase.cpp +11 -12
- data/ext/filegdb/integer_primitive.cpp +0 -1
- data/ext/filegdb/multi_part_shape_buffer.cpp +0 -1
- data/ext/filegdb/multi_point_shape_buffer.cpp +0 -1
- data/ext/filegdb/point.cpp +0 -1
- data/ext/filegdb/point_shape_buffer.cpp +0 -1
- data/ext/filegdb/row.cpp +1 -2
- data/ext/filegdb/shape_buffer.cpp +0 -1
- data/ext/filegdb/spatial_reference.cpp +1 -2
- data/ext/filegdb/table.cpp +0 -1
- data/ext/filegdb/util.cpp +10 -5
- data/filegdb.gemspec +1 -1
- data/lib/filegdb/version.rb +1 -1
- data/spec/geodatabase_spec.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02900384944dc52c6eac6c964279fdc292ce47da
|
4
|
+
data.tar.gz: bfae68079510cbc348d2087cb9d8b174185aaa19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7249fd30bedc183107b41907dd10c2f29f6e356824a9b59f6121a425bc074437ac6a5bc126b63126475a715a61f0e04563c31ccc2f898eff372d76ad5c0e66f6
|
7
|
+
data.tar.gz: be9bd3cfd11365d8dfceaef94332fddfb9e451b7a9a122ab5be48a2cf3c126786edf01d70da1fcc30ad323f3dfb0faffc82030f969884bbcfd81c16845f8e094
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# filegdb-ruby [![Build Status](https://secure.travis-ci.org/
|
1
|
+
# filegdb-ruby [![Build Status](https://secure.travis-ci.org/fulcrumapp/filegdb-ruby.png)](http://travis-ci.org/fulcrumapp/filegdb-ruby)
|
2
2
|
|
3
|
-
Native bindings for the ESRI libFileGDBAPI library.
|
3
|
+
Native bindings for the ESRI libFileGDBAPI library 1.4.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/ext/filegdb/base.hpp
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
#ifndef
|
2
|
-
#define
|
1
|
+
#ifndef __FILEGDB_BASE_HPP__
|
2
|
+
#define __FILEGDB_BASE_HPP__
|
3
3
|
|
4
4
|
#include <vector>
|
5
5
|
#include <algorithm>
|
@@ -114,8 +114,7 @@ namespace filegdb {
|
|
114
114
|
}
|
115
115
|
}
|
116
116
|
|
117
|
-
VALUE initialize_not_allowed()
|
118
|
-
{
|
117
|
+
VALUE initialize_not_allowed() {
|
119
118
|
rb_raise(rb_eRuntimeError, "You cannot use #new on this class.");
|
120
119
|
return Qnil;
|
121
120
|
}
|
data/ext/filegdb/extconf.rb
CHANGED
@@ -10,48 +10,4 @@ $libs = append_library $libs, 'FileGDBAPI'
|
|
10
10
|
|
11
11
|
$LDFLAGS << " -Wl,-rpath,#{File.join(filegdb_path, 'lib')}"
|
12
12
|
|
13
|
-
if RUBY_PLATFORM =~ /darwin/
|
14
|
-
# libFileGDBAPI requires GCC compilation because its C++ symbols are incompatible with LLVM/clang
|
15
|
-
#
|
16
|
-
# To install GCC on OSX:
|
17
|
-
#
|
18
|
-
# $ brew install gcc
|
19
|
-
#
|
20
|
-
|
21
|
-
msg = <<-GCC
|
22
|
-
|
23
|
-
|
24
|
-
\e[31m
|
25
|
-
===========================================================================================================================
|
26
|
-
===========================================================================================================================
|
27
|
-
|
28
|
-
The filegdb gem requires GCC on OSX because the C++ symbols in libFileGDBAPI.dylib are incompatible with LLVM/clang
|
29
|
-
|
30
|
-
To install GCC on OSX:
|
31
|
-
|
32
|
-
$ brew install gcc
|
33
|
-
|
34
|
-
Note: Installing GCC through homebrew is safe and will not interfere with your Xcode installation.
|
35
|
-
|
36
|
-
Report installation bugs here: https://github.com/spatialnetworks/filegdb-ruby
|
37
|
-
|
38
|
-
===========================================================================================================================
|
39
|
-
===========================================================================================================================
|
40
|
-
\e[0m
|
41
|
-
|
42
|
-
GCC
|
43
|
-
|
44
|
-
if `which gcc-4.9`.strip.length == 0
|
45
|
-
puts msg
|
46
|
-
exit
|
47
|
-
end
|
48
|
-
|
49
|
-
require 'rbconfig'
|
50
|
-
RbConfig::MAKEFILE_CONFIG['CC'] = 'gcc-4.9'
|
51
|
-
RbConfig::MAKEFILE_CONFIG['CXX'] = 'gcc-4.9'
|
52
|
-
|
53
|
-
# remove -Wshorten-64-to-32 since it's incompatible with GCC
|
54
|
-
$warnflags = $warnflags.gsub(/-Wshorten-64-to-32/, '')
|
55
|
-
end
|
56
|
-
|
57
13
|
create_makefile 'filegdb/filegdb'
|
data/ext/filegdb/field_info.cpp
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
#include "field_info.hpp"
|
3
2
|
|
4
3
|
namespace filegdb {
|
@@ -45,7 +44,7 @@ VALUE field_info::get_field_name(VALUE self, VALUE fieldIndex) {
|
|
45
44
|
return Qnil;
|
46
45
|
}
|
47
46
|
|
48
|
-
return rb_str_new2(
|
47
|
+
return rb_str_new2(to_string(fieldName).c_str());
|
49
48
|
}
|
50
49
|
|
51
50
|
VALUE field_info::get_field_type(VALUE self, VALUE fieldIndex) {
|
data/ext/filegdb/filegdb.hpp
CHANGED
@@ -12,7 +12,7 @@ using namespace FileGDBAPI;
|
|
12
12
|
typedef VALUE (*RB_INSTANCE_METHOD)(...);
|
13
13
|
|
14
14
|
#define FGDB_IS_FAILURE(hr) ((hr) != S_OK)
|
15
|
-
#define FGDB_RAISE_ERROR(hr) rb_raise(rb_eRuntimeError, "%s", fgdb_error_string(hr))
|
15
|
+
#define FGDB_RAISE_ERROR(hr) rb_raise(rb_eRuntimeError, "%s", fgdb_error_string(hr).c_str())
|
16
16
|
#define FGDB_FATAL(msg) rb_raise(rb_eRuntimeError, "%s", msg)
|
17
17
|
#define FGDB_FATAL_ARGUMENT(msg) rb_raise(rb_eArgError, "%s", msg)
|
18
18
|
#define FGDB_METHOD(method) ((RB_INSTANCE_METHOD)&method)
|
@@ -35,9 +35,9 @@ typedef VALUE (*RB_INSTANCE_METHOD)(...);
|
|
35
35
|
return Qnil; \
|
36
36
|
}
|
37
37
|
|
38
|
-
std::wstring to_wstring(const char *input);
|
39
|
-
const
|
40
|
-
const
|
38
|
+
const std::wstring to_wstring(const char *input);
|
39
|
+
const std::string to_string(std::wstring str);
|
40
|
+
const std::string fgdb_error_string(fgdbError hr);
|
41
41
|
|
42
42
|
extern VALUE fgdb_klass;
|
43
43
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
//
|
4
4
|
|
5
5
|
/*
|
6
|
-
COPYRIGHT �
|
6
|
+
COPYRIGHT � 2015 ESRI
|
7
7
|
TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
|
8
8
|
Unpublished material - all rights reserved under the
|
9
9
|
Copyright Laws of the United States and applicable international
|
@@ -19,6 +19,9 @@
|
|
19
19
|
email: contracts@esri.com
|
20
20
|
*/
|
21
21
|
|
22
|
+
/// Convenience lynchpin include containing all of the file geodatabase API includes.
|
23
|
+
/// @file FileGDBAPI.h
|
24
|
+
|
22
25
|
#pragma once
|
23
26
|
|
24
27
|
#include "FileGDBCore.h"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
//
|
4
4
|
|
5
5
|
/*
|
6
|
-
COPYRIGHT �
|
6
|
+
COPYRIGHT � 2015 ESRI
|
7
7
|
TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
|
8
8
|
Unpublished material - all rights reserved under the
|
9
9
|
Copyright Laws of the United States and applicable international
|
@@ -19,6 +19,9 @@
|
|
19
19
|
email: contracts@esri.com
|
20
20
|
*/
|
21
21
|
|
22
|
+
// Core defines and enumerations.
|
23
|
+
/// @file FileGDBCore.h
|
24
|
+
|
22
25
|
#pragma once
|
23
26
|
|
24
27
|
typedef unsigned char byte;
|
@@ -1,291 +1,319 @@
|
|
1
|
-
//
|
2
|
-
// Geodatabase.h
|
3
|
-
//
|
4
|
-
|
5
|
-
/*
|
6
|
-
COPYRIGHT �
|
7
|
-
TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
|
8
|
-
Unpublished material - all rights reserved under the
|
9
|
-
Copyright Laws of the United States and applicable international
|
10
|
-
laws, treaties, and conventions.
|
11
|
-
|
12
|
-
For additional information, contact:
|
13
|
-
Environmental Systems Research Institute, Inc.
|
14
|
-
Attn: Contracts and Legal Services Department
|
15
|
-
380 New York Street
|
16
|
-
Redlands, California, 92373
|
17
|
-
USA
|
18
|
-
|
19
|
-
email: contracts@esri.com
|
20
|
-
*/
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
#
|
29
|
-
#
|
30
|
-
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#else
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
|
42
|
-
#
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
class
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
/// Gets a list of
|
67
|
-
/// @param[out]
|
68
|
-
/// @return Error code indicating whether the method finished successfully.
|
69
|
-
fgdbError
|
70
|
-
|
71
|
-
/// Gets
|
72
|
-
///
|
73
|
-
/// @
|
74
|
-
|
75
|
-
|
76
|
-
///
|
77
|
-
///
|
78
|
-
|
79
|
-
|
80
|
-
///
|
81
|
-
///
|
82
|
-
/// @
|
83
|
-
|
84
|
-
|
85
|
-
///
|
86
|
-
///
|
87
|
-
/// @
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
/// @
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
/// @
|
97
|
-
|
98
|
-
///
|
99
|
-
///
|
100
|
-
|
101
|
-
|
102
|
-
///
|
103
|
-
///
|
104
|
-
/// @
|
105
|
-
|
106
|
-
|
107
|
-
///
|
108
|
-
///
|
109
|
-
|
110
|
-
|
111
|
-
///
|
112
|
-
///
|
113
|
-
/// @
|
114
|
-
|
115
|
-
|
116
|
-
///
|
117
|
-
///
|
118
|
-
/// @
|
119
|
-
|
120
|
-
|
121
|
-
///
|
122
|
-
///
|
123
|
-
/// @
|
124
|
-
|
125
|
-
|
126
|
-
///
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
/// @
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
///
|
136
|
-
|
137
|
-
///
|
138
|
-
///
|
139
|
-
///
|
140
|
-
|
141
|
-
|
142
|
-
///
|
143
|
-
///
|
144
|
-
///
|
145
|
-
|
146
|
-
|
147
|
-
///
|
148
|
-
/// If the
|
149
|
-
///
|
150
|
-
///
|
151
|
-
///
|
152
|
-
|
153
|
-
|
154
|
-
///
|
155
|
-
///
|
156
|
-
///
|
157
|
-
///
|
158
|
-
///
|
159
|
-
|
160
|
-
|
161
|
-
///
|
162
|
-
///
|
163
|
-
///
|
164
|
-
///
|
165
|
-
/// @param[in]
|
166
|
-
///
|
167
|
-
/// the feature
|
168
|
-
///
|
169
|
-
/// @
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
/// @param[in]
|
174
|
-
///
|
175
|
-
|
176
|
-
|
177
|
-
///
|
178
|
-
///
|
179
|
-
///
|
180
|
-
/// @param[
|
181
|
-
/// @return Error code indicating whether the method finished successfully.
|
182
|
-
fgdbError
|
183
|
-
|
184
|
-
///
|
185
|
-
///
|
186
|
-
///
|
187
|
-
///
|
188
|
-
|
189
|
-
|
190
|
-
///
|
191
|
-
///
|
192
|
-
///
|
193
|
-
|
194
|
-
|
195
|
-
///
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
///
|
203
|
-
/// @param[
|
204
|
-
/// @return Error code indicating whether the method finished successfully.
|
205
|
-
fgdbError
|
206
|
-
|
207
|
-
///
|
208
|
-
///
|
209
|
-
///
|
210
|
-
///
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
///
|
216
|
-
///
|
217
|
-
/// @param[in]
|
218
|
-
/// @return Error code indicating whether the method finished successfully.
|
219
|
-
fgdbError
|
220
|
-
|
221
|
-
///
|
222
|
-
///
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
///
|
230
|
-
/// @
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
///
|
235
|
-
|
236
|
-
///
|
237
|
-
///
|
238
|
-
/// @param[
|
239
|
-
/// @return Error code indicating whether the method finished successfully.
|
240
|
-
fgdbError
|
241
|
-
|
242
|
-
///
|
243
|
-
/// If the
|
244
|
-
/// @param[in]
|
245
|
-
/// @
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
/// @
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
/// The
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
1
|
+
//
|
2
|
+
// Geodatabase.h
|
3
|
+
//
|
4
|
+
|
5
|
+
/*
|
6
|
+
COPYRIGHT � 2015 ESRI
|
7
|
+
TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
|
8
|
+
Unpublished material - all rights reserved under the
|
9
|
+
Copyright Laws of the United States and applicable international
|
10
|
+
laws, treaties, and conventions.
|
11
|
+
|
12
|
+
For additional information, contact:
|
13
|
+
Environmental Systems Research Institute, Inc.
|
14
|
+
Attn: Contracts and Legal Services Department
|
15
|
+
380 New York Street
|
16
|
+
Redlands, California, 92373
|
17
|
+
USA
|
18
|
+
|
19
|
+
email: contracts@esri.com
|
20
|
+
*/
|
21
|
+
|
22
|
+
/// A set of functions for opening, querying, creating, listing and deleting file geodatabase data.
|
23
|
+
/// @file Geodatabase.h
|
24
|
+
|
25
|
+
#pragma once
|
26
|
+
|
27
|
+
#include <string>
|
28
|
+
#include <vector>
|
29
|
+
#include <map>
|
30
|
+
|
31
|
+
#ifndef EXPORT_FILEGDB_API
|
32
|
+
# if defined linux || defined __APPLE__
|
33
|
+
# define EXT_FILEGDB_API
|
34
|
+
# else
|
35
|
+
# define EXT_FILEGDB_API _declspec(dllimport)
|
36
|
+
# endif
|
37
|
+
#else
|
38
|
+
# if defined linux || defined __APPLE__
|
39
|
+
# define EXT_FILEGDB_API __attribute__((visibility("default")))
|
40
|
+
# else
|
41
|
+
# define EXT_FILEGDB_API _declspec(dllexport)
|
42
|
+
# endif
|
43
|
+
#endif
|
44
|
+
|
45
|
+
#include "FileGDBCore.h"
|
46
|
+
|
47
|
+
class Catalog;
|
48
|
+
class CatalogRef;
|
49
|
+
|
50
|
+
namespace FileGDBAPI
|
51
|
+
{
|
52
|
+
|
53
|
+
class EnumRows;
|
54
|
+
class Row;
|
55
|
+
class Table;
|
56
|
+
class FieldDef;
|
57
|
+
class SpatialReference;
|
58
|
+
|
59
|
+
/// A class representing a File Geodatabase.
|
60
|
+
class EXT_FILEGDB_API Geodatabase
|
61
|
+
{
|
62
|
+
public:
|
63
|
+
|
64
|
+
/// @name Schema browsing
|
65
|
+
//@{
|
66
|
+
/// Gets a list of the dataset types in the geodatabase.
|
67
|
+
/// @param[out] datasetTypes The dataset types in the geodatabase.
|
68
|
+
/// @return Error code indicating whether the method finished successfully.
|
69
|
+
fgdbError GetDatasetTypes(std::vector<std::wstring>& datasetTypes) const;
|
70
|
+
|
71
|
+
/// Gets a list of relationship types in the geodatabase.
|
72
|
+
/// @param[out] relationshipTypes The relationship types in the geodatabase.
|
73
|
+
/// @return Error code indicating whether the method finished successfully.
|
74
|
+
fgdbError GetDatasetRelationshipTypes(std::vector<std::wstring>& relationshipTypes) const;
|
75
|
+
|
76
|
+
/// Gets the child datasets for a particular dataset, if any.
|
77
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
78
|
+
/// @param[in] parentPath The dataset to find the children of, e.g. "\usa".
|
79
|
+
/// @param[in] datasetType The child dataset type as a wstring, e.g. "Feature Class". Passing in
|
80
|
+
/// an empty string will return all child datasets. <a href="ItemTypes.txt">DatasetType</a>
|
81
|
+
/// @param[out] childDatasets The children of the parent dataset, if any.
|
82
|
+
/// @return Error code indicating whether the method finished successfully.
|
83
|
+
fgdbError GetChildDatasets(const std::wstring& parentPath, const std::wstring& datasetType, std::vector<std::wstring>& childDatasets) const;
|
84
|
+
|
85
|
+
/// Gets the related datasets for a particular dataset, if any.
|
86
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
87
|
+
/// @param[in] path The path of the dataset to find related datasets for, e.g. "\usa\streets_topology".
|
88
|
+
/// @param[in] relType The relationship type to filter return values with, e.g. "DatasetInFeatureDataset". Passing in
|
89
|
+
/// an empty string will return all related datasets. <a href="RelationshipTypes.txt">RelationshipType</a>
|
90
|
+
/// @param[in] datasetType The type of the dataset to find related datasets for. <a href="ItemTypes.txt">DatasetType</a>
|
91
|
+
/// @param[out] relatedDatasets The origin dataset's related datasets, if any.
|
92
|
+
/// @result Error code indicating whether the method finished successfully.
|
93
|
+
fgdbError GetRelatedDatasets(const std::wstring& path, const std::wstring& relType, const std::wstring& datasetType, std::vector<std::wstring>& relatedDatasets) const;
|
94
|
+
//@}
|
95
|
+
|
96
|
+
/// @name Schema definition
|
97
|
+
//@{
|
98
|
+
/// Gets the definition of a dataset as an XML document.
|
99
|
+
/// If the dataset does not exist, this will fail with an error code of -2147220655 (The table was not found).
|
100
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
101
|
+
/// @param[in] path The requested dataset's path. e.g. "\usa\city_anno"
|
102
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
103
|
+
/// @param[out] datasetDef The dataset's definition as an XML document.
|
104
|
+
/// @return Error code indicating whether the method finished successfully.
|
105
|
+
fgdbError GetDatasetDefinition(const std::wstring& path, const std::wstring& datasetType, std::string& datasetDef) const;
|
106
|
+
|
107
|
+
/// Gets the definitions of child datasets as a collection of XML documents.
|
108
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
109
|
+
/// @param[in] parentPath The parent dataset's path, e.g. "\usa".
|
110
|
+
/// @param[in] datasetType The parent dataset's type as a string, e.g. "Feature Dataset". Passing in
|
111
|
+
/// an empty string will return all child datasets. <a href="ItemTypes.txt">DatasetType</a>
|
112
|
+
/// @param[out] childDatasetDefs A collection of child dataset definitions, if any.
|
113
|
+
/// @return Error code indicating whether the method finished successfully.
|
114
|
+
fgdbError GetChildDatasetDefinitions(const std::wstring& parentPath, const std::wstring& datasetType, std::vector<std::string>& childDatasetDefs) const;
|
115
|
+
|
116
|
+
/// Gets the definitions of related datasets as a collection of XML documents.
|
117
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
118
|
+
/// @param[in] path The origin dataset's path, e.g. "\usa\streets_topology"
|
119
|
+
/// @param[in] relType The relationship type to filter return values with, e.g. "DatasetInFeatureDataset". <a href="RelationshipTypes.txt">RelationshipType</a>
|
120
|
+
/// @param[in] datasetType The origin dataset's type as a string, e.g. "Relationship Class". Passing in
|
121
|
+
/// an empty string will return all related datasets. <a href="ItemTypes.txt">DatasetType</a>
|
122
|
+
/// @param[out] relatedDatasetDefs A collection of related dataset definitions, if any.
|
123
|
+
/// @return Error code indicating whether the method finished successfully.
|
124
|
+
fgdbError GetRelatedDatasetDefinitions(const std::wstring& path, const std::wstring& relType, const std::wstring& datasetType, std::vector<std::string>& relatedDatasetDefs) const;
|
125
|
+
|
126
|
+
/// Gets the metadata of a dataset as XML.
|
127
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
128
|
+
/// @param[in] path The requested dataset's path. e.g. "\address_list"
|
129
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
130
|
+
/// @param[out] documentation The dataset's metadata as XML.
|
131
|
+
/// @return Error code indicating whether the method finished successfully.
|
132
|
+
fgdbError GetDatasetDocumentation(const std::wstring& path, const std::wstring& datasetType, std::string& documentation) const;
|
133
|
+
//@}
|
134
|
+
|
135
|
+
/// @name Datasets
|
136
|
+
//@{
|
137
|
+
/// Creates a new feature dataset.
|
138
|
+
/// If the feature dataset already exists, a -2147220733 (The dataset already exists) error will be returned.<br/>
|
139
|
+
/// If the feature dataset name is missing from the XML, a -2147220645 (INVALID_NAME) error will be returned.<br/>
|
140
|
+
/// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
141
|
+
/// <a href="FeatureDataset.xml">XML</a>
|
142
|
+
///
|
143
|
+
/// @param[in] featureDatasetDef The XML definition of the feature dataset to be created.
|
144
|
+
/// @return Error code indicating whether the method finished successfully.
|
145
|
+
fgdbError CreateFeatureDataset(const std::string& featureDatasetDef);
|
146
|
+
|
147
|
+
/// Creates a new feature dataset.
|
148
|
+
/// If the feature dataset already exists, a -2147220733 (The dataset already exists) error will be returned.<br/>
|
149
|
+
/// @param[in] path The name of the feature dataset to be created.
|
150
|
+
/// @param[in] spatialReference The spatial reference of the feature dataset to be created.
|
151
|
+
/// @return Error code indicating whether the method finished successfully.
|
152
|
+
fgdbError CreateFeatureDataset(const std::wstring& path, const SpatialReference& spatialReference);
|
153
|
+
|
154
|
+
/// Creates a new table. This can either be a table or a feature class. If a geometry is to support Zs or Ms (measures), HasZ
|
155
|
+
/// and or HasM must be set to true in the GeometryDef in the XML. The ZOrigin, MOrigin, ZScale and MScale
|
156
|
+
/// must also be set in the SpatialReferences in the XML. These do not default.
|
157
|
+
/// See the samples\XMLsamples\FC_GCS_LineMin.xml for an example. Domain definitions in the table XML definition
|
158
|
+
/// will be ignored. Use Table.AlterField to assign a domain.
|
159
|
+
/// If the table already exists, a -2147220653 (The table already exists) error will be returned.<br/>
|
160
|
+
/// If the table name is missing from the XML, a -2147220654 (The table name is invalid) error will be returned.<br/>
|
161
|
+
/// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
162
|
+
/// <a href="Table.xml">XML-Table</a><a href="FC_GCS_Line.xml">XML-Feature Class</a>
|
163
|
+
/// <a href="FC_GCS_LineMin.xml">XML-Feature Class with the minimum spatial reference definition</a>
|
164
|
+
/// <a href="FeatureClassInAFeatureDataset.xml">XML-Feature Class to be created in a feature dataset</a>
|
165
|
+
/// @param[in] tableDef The XML definition of the table to be created.
|
166
|
+
/// @param[in] parent The location where the table will be created. Pass an empty string if you want to
|
167
|
+
/// create a table or feature class at the root. If you want to create a feature class in an existing feature
|
168
|
+
/// dataset use the path "\USA".
|
169
|
+
/// @param[out] table A Table instance for the newly created table.
|
170
|
+
/// @return Error code indicating whether the method finished successfully.
|
171
|
+
fgdbError CreateTable(const std::string& tableDef, const std::wstring& parent, Table& table);
|
172
|
+
|
173
|
+
/// @param[in] path The path of the table to create. If creating a table or feature class at
|
174
|
+
/// the root make sure to include "\". If creating a feature class in a feature dataset include
|
175
|
+
/// the feature dataset name in the path "\USA\counties".
|
176
|
+
/// @param[in] fieldDefs The field definitions of the table to be created.
|
177
|
+
/// @param[in] configurationKeyword The configuration keyword of the table to be created.
|
178
|
+
/// If a empty string or unknown keyword is entered, the DEFAULTS keyword is used.
|
179
|
+
/// <a href="Keywords.html">Configuration Keywords</a>
|
180
|
+
/// @param[out] table A Table instance for the newly created table.
|
181
|
+
/// @return Error code indicating whether the method finished successfully.
|
182
|
+
fgdbError CreateTable(const std::wstring& path, const std::vector<FieldDef>& fieldDefs, const std::wstring& configurationKeyword, Table& table);
|
183
|
+
|
184
|
+
/// Opens a table. This can also be used to open attributed and M:N relationship class tables.
|
185
|
+
/// If the table does not exist, a -2147220655 (The table was not found) error will be returned.
|
186
|
+
/// Attempting to open a compressed file is not supported and a -2147220109 (FileGDB compression is
|
187
|
+
/// not installed.) error will be returned.
|
188
|
+
/// @param[in] path The path of the table to open. Opening a table or feature class at
|
189
|
+
/// the root make sure to include "\". If opening a feature class in a feature dataset include
|
190
|
+
/// the feature dataset name in the path "\USA\counties".
|
191
|
+
/// @param[out] table An Table instance for the opened table.
|
192
|
+
/// @return Error code indicating whether the method finished successfully.
|
193
|
+
fgdbError OpenTable(const std::wstring& path, Table& table);
|
194
|
+
|
195
|
+
/// Closes a table that has been previously created or opened.
|
196
|
+
/// @param[in] table The table to close.
|
197
|
+
/// @return Error code indicating whether the method finished successfully.
|
198
|
+
fgdbError CloseTable(Table& table);
|
199
|
+
|
200
|
+
/// Renames a dataset.
|
201
|
+
/// @param[in] path The path of the dataset, e.g. "\Landbase\Parcels".
|
202
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
203
|
+
/// @param[in] newName The name to apply to the dataset, e.g. "Parcels2".
|
204
|
+
/// @return Error code indicating whether the method finished successfully.
|
205
|
+
fgdbError Rename(const std::wstring& path, const std::wstring& datasetType, const std::wstring& newName);
|
206
|
+
|
207
|
+
/// Moves a dataset from one container to another.
|
208
|
+
/// @param[in] path The path of the dataset to move, e.g. "\Landbase\Parcels".
|
209
|
+
/// @param[in] newParentPath The path of the container the dataset will be moved to, e.g. "\LandUse".
|
210
|
+
/// @return Error code indicating whether the method finished successfully.
|
211
|
+
fgdbError Move(const std::wstring& path, const std::wstring& newParentPath);
|
212
|
+
|
213
|
+
/// Deletes a dataset.
|
214
|
+
/// If a the dataset does not exist, this will fail with an error code of -2147219118 (A requested row object could not be located).<br/>
|
215
|
+
/// If you do not have delete access to the dataset, this will fail with an error code of E_FAIL.<br/>
|
216
|
+
/// @param[in] path The path of the dataset to delete, e.g. "\Owners".
|
217
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
218
|
+
/// @return Error code indicating whether the method finished successfully.
|
219
|
+
fgdbError Delete(const std::wstring& path, const std::wstring& datasetType);
|
220
|
+
|
221
|
+
/// Compacts the geodatabase.
|
222
|
+
/// @return Error code indicating whether the method finished successfully.
|
223
|
+
fgdbError CompactDatabase();
|
224
|
+
//@}
|
225
|
+
|
226
|
+
/// @name Domains
|
227
|
+
//@{
|
228
|
+
|
229
|
+
/// Gets the names of all domains, if any.
|
230
|
+
/// @param[out] domainNames The domains.
|
231
|
+
/// @return Error code indicating whether the method finished successfully.
|
232
|
+
fgdbError GetDomains(std::vector<std::wstring>& domainNames) const;
|
233
|
+
|
234
|
+
/// Creates a domain.
|
235
|
+
/// If the XML is not UTF-8, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
236
|
+
/// If the domain name already exists, a -2147209212 (Domain name already in use) error will be returned.<br/>
|
237
|
+
/// <a href="CodedValueDomain.xml">XML - Coded Value Domain</a> <a href="RangeDomain.xml">XML - Range Domain</a>
|
238
|
+
/// @param[in] domainDef The XML definition of the domain to be created.
|
239
|
+
/// @return Error code indicating whether the method finished successfully.
|
240
|
+
fgdbError CreateDomain(const std::string& domainDef);
|
241
|
+
|
242
|
+
/// Modifies the properties of an existing domain.
|
243
|
+
/// If the XML is not UTF-8, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
244
|
+
/// @param[in] domainDef The modified XML definition of the domain.
|
245
|
+
/// @return Error code indicating whether the method finished successfully.
|
246
|
+
fgdbError AlterDomain(const std::string& domainDef);
|
247
|
+
|
248
|
+
/// Deletes the specified domain.
|
249
|
+
///If the domain does not exist, this will fail with an error code of -2147209215 (The domain was not found).<br/>
|
250
|
+
/// @param[in] domainName The name of the domain to delete.
|
251
|
+
/// @return Error code indicating whether the method finished successfully.
|
252
|
+
fgdbError DeleteDomain(const std::wstring& domainName);
|
253
|
+
|
254
|
+
/// Gets the definition of the specified domain.
|
255
|
+
/// @param[in] domainName The name of the domain.
|
256
|
+
/// @param[out] domainDef The XML definition of the domain.
|
257
|
+
/// @return Error code indicating whether the method finished successfully.
|
258
|
+
fgdbError GetDomainDefinition(const std::wstring& domainName, std::string& domainDef) const;
|
259
|
+
//@}
|
260
|
+
|
261
|
+
/// @name SQL
|
262
|
+
//@{
|
263
|
+
/// Gets the query name (the name to use in SQL statements) of a table based on its path.
|
264
|
+
/// @param[in] path The path of the dataset that will be queried.
|
265
|
+
/// @param[out] queryName The name that should be used for the table in SQL statements.
|
266
|
+
/// @return Error code indicating whether the method finished successfully.
|
267
|
+
fgdbError GetQueryName(const std::wstring& path, std::wstring& queryName) const;
|
268
|
+
|
269
|
+
/// Executes a SQL statement on the geodatabase. This may or may not return a result set.
|
270
|
+
/// A DELETE without a WHERE clause will result in a truncate.
|
271
|
+
/// If the SQL statement is invalid, an -2147220985 (An invalid SQL statement was used) error will be returned.<br/>
|
272
|
+
/// @param[in] sqlStmt The SQL statement to be executed.
|
273
|
+
/// @param[in] recycling Indicates whether the row enumerator should recycle memory.
|
274
|
+
/// @param[out] rows An enumerator of rows or a null value.
|
275
|
+
/// @return Error code indicating whether the method finished successfully.
|
276
|
+
fgdbError ExecuteSQL(const std::wstring& sqlStmt, bool recycling, EnumRows& rows) const;
|
277
|
+
//@}
|
278
|
+
|
279
|
+
/// @name Constructors and Destructors
|
280
|
+
//@{
|
281
|
+
/// The class constructor.
|
282
|
+
Geodatabase();
|
283
|
+
|
284
|
+
/// The class destructor.
|
285
|
+
~Geodatabase();
|
286
|
+
//@}
|
287
|
+
|
288
|
+
private:
|
289
|
+
|
290
|
+
/// @cond PRIVATE
|
291
|
+
fgdbError CreateGeodatabase(const std::wstring& path);
|
292
|
+
fgdbError OpenGeodatabase(const std::wstring& path);
|
293
|
+
fgdbError CloseGeodatabase();
|
294
|
+
fgdbError DeleteGeodatabase();
|
295
|
+
|
296
|
+
bool IsSetup() const;
|
297
|
+
|
298
|
+
Catalog* m_pCatalog;
|
299
|
+
|
300
|
+
#pragma warning(push)
|
301
|
+
#pragma warning(disable : 4251)
|
302
|
+
|
303
|
+
std::map<Table*, Table*> m_tableROT;
|
304
|
+
|
305
|
+
#pragma warning(pop)
|
306
|
+
|
307
|
+
friend EXT_FILEGDB_API fgdbError CreateGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
|
308
|
+
friend EXT_FILEGDB_API fgdbError OpenGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
|
309
|
+
friend EXT_FILEGDB_API fgdbError CloseGeodatabase(Geodatabase& geodatabase);
|
310
|
+
friend EXT_FILEGDB_API fgdbError DeleteGeodatabase(const std::wstring& path);
|
311
|
+
|
312
|
+
friend class Table;
|
313
|
+
|
314
|
+
Geodatabase(const Geodatabase&) { }
|
315
|
+
Geodatabase& operator=(const Geodatabase&) { return *this; }
|
316
|
+
/// @endcond
|
317
|
+
};
|
318
|
+
|
319
|
+
}; // namespace FileGDBAPI
|