filegdb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +18 -0
- data/.travis.yml +4 -0
- data/Gemfile +3 -0
- data/LICENSE +28 -0
- data/Makefile +12 -0
- data/README.md +27 -0
- data/Rakefile +24 -0
- data/ext/filegdb/base.hpp +126 -0
- data/ext/filegdb/extconf.rb +13 -0
- data/ext/filegdb/filegdb.cpp +27 -0
- data/ext/filegdb/filegdb.hpp +44 -0
- data/ext/filegdb/filegdb/include/FileGDBAPI.h +30 -0
- data/ext/filegdb/filegdb/include/FileGDBCore.h +226 -0
- data/ext/filegdb/filegdb/include/Geodatabase.h +291 -0
- data/ext/filegdb/filegdb/include/GeodatabaseManagement.h +79 -0
- data/ext/filegdb/filegdb/include/Raster.h +101 -0
- data/ext/filegdb/filegdb/include/Row.h +336 -0
- data/ext/filegdb/filegdb/include/Table.h +296 -0
- data/ext/filegdb/filegdb/include/Util.h +936 -0
- data/ext/filegdb/filegdb/include/make.include +98 -0
- 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 +529 -0
- data/ext/filegdb/geodatabase.hpp +53 -0
- data/ext/filegdb/multi_point_shape_buffer.cpp +254 -0
- data/ext/filegdb/multi_point_shape_buffer.hpp +35 -0
- data/ext/filegdb/point.cpp +44 -0
- data/ext/filegdb/point.hpp +31 -0
- data/ext/filegdb/point_shape_buffer.cpp +162 -0
- data/ext/filegdb/point_shape_buffer.hpp +32 -0
- data/ext/filegdb/row.cpp +222 -0
- data/ext/filegdb/row.hpp +37 -0
- data/ext/filegdb/shape_buffer.cpp +19 -0
- data/ext/filegdb/shape_buffer.hpp +20 -0
- data/ext/filegdb/shape_buffer_base.hpp +33 -0
- data/ext/filegdb/table.cpp +65 -0
- data/ext/filegdb/table.hpp +29 -0
- data/ext/filegdb/util.cpp +16 -0
- data/filegdb.gemspec +23 -0
- data/lib/filegdb.rb +2 -0
- data/lib/filegdb/version.rb +3 -0
- data/spec/data/domain_definition.xml +22 -0
- data/spec/data/domain_definition_altered.xml +26 -0
- data/spec/data/feature_dataset_definition.xml +25 -0
- data/spec/data/table_definition.xml +177 -0
- data/spec/filegdb_spec.rb +36 -0
- data/spec/geodatabase_spec.rb +107 -0
- data/spec/multi_point_shape_buffer_spec.rb +58 -0
- data/spec/point_shape_buffer_spec.rb +39 -0
- data/spec/row_spec.rb +76 -0
- data/spec/spec_helper.rb +41 -0
- metadata +153 -0
@@ -0,0 +1,291 @@
|
|
1
|
+
//
|
2
|
+
// Geodatabase.h
|
3
|
+
//
|
4
|
+
|
5
|
+
/*
|
6
|
+
COPYRIGHT � 2012 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
|
+
#pragma once
|
23
|
+
|
24
|
+
#include <string>
|
25
|
+
#include <vector>
|
26
|
+
#include <map>
|
27
|
+
|
28
|
+
#ifndef EXPORT_FILEGDB_API
|
29
|
+
# if defined linux || defined __APPLE__
|
30
|
+
# define EXT_FILEGDB_API
|
31
|
+
# else
|
32
|
+
# define EXT_FILEGDB_API _declspec(dllimport)
|
33
|
+
# endif
|
34
|
+
#else
|
35
|
+
# if defined linux || defined __APPLE__
|
36
|
+
# define EXT_FILEGDB_API __attribute__((visibility("default")))
|
37
|
+
# else
|
38
|
+
# define EXT_FILEGDB_API _declspec(dllexport)
|
39
|
+
# endif
|
40
|
+
#endif
|
41
|
+
|
42
|
+
#include "FileGDBCore.h"
|
43
|
+
|
44
|
+
class Catalog;
|
45
|
+
class CatalogRef;
|
46
|
+
|
47
|
+
namespace FileGDBAPI
|
48
|
+
{
|
49
|
+
|
50
|
+
class EnumRows;
|
51
|
+
class Row;
|
52
|
+
class Table;
|
53
|
+
|
54
|
+
/// A class representing a File Geodatabase.
|
55
|
+
class EXT_FILEGDB_API Geodatabase
|
56
|
+
{
|
57
|
+
public:
|
58
|
+
|
59
|
+
/// @name Schema browsing
|
60
|
+
//@{
|
61
|
+
/// Gets a list of the dataset types in the geodatabase.
|
62
|
+
/// @param[out] datasetTypes The dataset types in the geodatabase.
|
63
|
+
/// @return Error code indicating whether the method finished successfully.
|
64
|
+
fgdbError GetDatasetTypes(std::vector<std::wstring>& datasetTypes) const;
|
65
|
+
|
66
|
+
/// Gets a list of relationship types in the geodatabase.
|
67
|
+
/// @param[out] relationshipTypes The relationship types in the geodatabase.
|
68
|
+
/// @return Error code indicating whether the method finished successfully.
|
69
|
+
fgdbError GetDatasetRelationshipTypes(std::vector<std::wstring>& relationshipTypes) const;
|
70
|
+
|
71
|
+
/// Gets the child datasets for a particular dataset, if any.
|
72
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
73
|
+
/// @param[in] parentPath The dataset to find the children of, e.g. "\usa".
|
74
|
+
/// @param[in] datasetType The child dataset type as a wstring, e.g. "Feature Class". Passing in
|
75
|
+
/// an empty string will return all child datasets. <a href="ItemTypes.txt">DatasetType</a>
|
76
|
+
/// @param[out] childDatasets The children of the parent dataset, if any.
|
77
|
+
/// @return Error code indicating whether the method finished successfully.
|
78
|
+
fgdbError GetChildDatasets(const std::wstring& parentPath, const std::wstring& datasetType, std::vector<std::wstring>& childDatasets) const;
|
79
|
+
|
80
|
+
/// Gets the related datasets for a particular dataset, if any.
|
81
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
82
|
+
/// @param[in] path The path of the dataset to find related datasets for, e.g. "\usa\streets_topology".
|
83
|
+
/// @param[in] relType The relationship type to filter return values with, e.g. "DatasetInFeatureDataset". Passing in
|
84
|
+
/// an empty string will return all related datasets. <a href="RelationshipTypes.txt">RelationshipType</a>
|
85
|
+
/// @param[in] datasetType The type of the dataset to find related datasets for. <a href="ItemTypes.txt">DatasetType</a>
|
86
|
+
/// @param[out] relatedDatasets The origin dataset's related datasets, if any.
|
87
|
+
/// @result Error code indicating whether the method finished successfully.
|
88
|
+
fgdbError GetRelatedDatasets(const std::wstring& path, const std::wstring& relType, const std::wstring& datasetType, std::vector<std::wstring>& relatedDatasets) const;
|
89
|
+
//@}
|
90
|
+
|
91
|
+
/// @name Schema definition
|
92
|
+
//@{
|
93
|
+
/// Gets the definition of a dataset as an XML document.
|
94
|
+
/// If the dataset does not exist, this will fail with an error code of -2147220655 (The table was not found).
|
95
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
96
|
+
/// @param[in] path The requested dataset's path. e.g. "\usa\city_anno"
|
97
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
98
|
+
/// @param[out] datasetDef The dataset's definition as an XML document.
|
99
|
+
/// @return Error code indicating whether the method finished successfully.
|
100
|
+
fgdbError GetDatasetDefinition(const std::wstring& path, const std::wstring& datasetType, std::string& datasetDef) const;
|
101
|
+
|
102
|
+
/// Gets the definitions of child datasets as a collection of XML documents.
|
103
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
104
|
+
/// @param[in] parentPath The parent dataset's path, e.g. "\usa".
|
105
|
+
/// @param[in] datasetType The parent dataset's type as a string, e.g. "Feature Dataset". Passing in
|
106
|
+
/// an empty string will return all child datasets. <a href="ItemTypes.txt">DatasetType</a>
|
107
|
+
/// @param[out] childDatasetDefs A collection of child dataset definitions, if any.
|
108
|
+
/// @return Error code indicating whether the method finished successfully.
|
109
|
+
fgdbError GetChildDatasetDefinitions(const std::wstring& parentPath, const std::wstring& datasetType, std::vector<std::string>& childDatasetDefs) const;
|
110
|
+
|
111
|
+
/// Gets the definitions of related datasets as a collection of XML documents.
|
112
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
113
|
+
/// @param[in] path The origin dataset's path, e.g. "\usa\streets_topology"
|
114
|
+
/// @param[in] relType The relationship type to filter return values with, e.g. "DatasetInFeatureDataset". <a href="RelationshipTypes.txt">RelationshipType</a>
|
115
|
+
/// @param[in] datasetType The origin dataset's type as a string, e.g. "Relationship Class". Passing in
|
116
|
+
/// an empty string will return all related datasets. <a href="ItemTypes.txt">DatasetType</a>
|
117
|
+
/// @param[out] relatedDatasetDefs A collection of related dataset definitions, if any.
|
118
|
+
/// @return Error code indicating whether the method finished successfully.
|
119
|
+
fgdbError GetRelatedDatasetDefinitions(const std::wstring& path, const std::wstring& relType, const std::wstring& datasetType, std::vector<std::string>& relatedDatasetDefs) const;
|
120
|
+
|
121
|
+
/// Gets the metadata of a dataset as XML.
|
122
|
+
/// If a non-existent path is provided, a -2147211775 (The item was not found) error will be returned.
|
123
|
+
/// @param[in] path The requested dataset's path. e.g. "\address_list"
|
124
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
125
|
+
/// @param[out] documentation The dataset's metadata as XML.
|
126
|
+
/// @return Error code indicating whether the method finished successfully.
|
127
|
+
fgdbError GetDatasetDocumentation(const std::wstring& path, const std::wstring& datasetType, std::string& documentation) const;
|
128
|
+
//@}
|
129
|
+
|
130
|
+
/// @name Datasets
|
131
|
+
//@{
|
132
|
+
/// Creates a new feature dataset.
|
133
|
+
/// If the feature dataset already exists, a -2147220733 (The dataset already exists) error will be returned.<br/>
|
134
|
+
/// If the feature dataset name is missing from the XML, a -2147220645 (INVALID_NAME) error will be returned.<br/>
|
135
|
+
/// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
136
|
+
/// <a href="FeatureDataset.xml">XML</a>
|
137
|
+
/// <br><br>
|
138
|
+
/// @param[in] featureDatasetDef The XML definition of the feature dataset to be created.
|
139
|
+
/// @return Error code indicating whether the method finished successfully.
|
140
|
+
fgdbError CreateFeatureDataset(const std::string& featureDatasetDef);
|
141
|
+
|
142
|
+
/// 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
|
143
|
+
/// and or HasM must be set to true in the GeometryDef in the XML. The ZOrigin, MOrigin, ZScale and MScale
|
144
|
+
/// must also be set in the SpatialReferences in the XML. These do not default.
|
145
|
+
/// See the samlples\XMLsamples\FC_GCS_LineMin.xml for an example. Domain definitions in the table XML definition
|
146
|
+
/// will be ignored. Use Table.AlterField to assign a domain. <br/>
|
147
|
+
/// If the table already exists, a -2147220653 (The table already exists) error will be returned.<br/>
|
148
|
+
/// If the table name is missing from the XML, a -2147220654 (The table name is invalid) error will be returned.<br/>
|
149
|
+
/// If the XML is not UTF-8 encoded, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
150
|
+
/// <br><a href="Table.xml">XML-Table</a><br><a href="FC_GCS_Line.xml">XML-Feature Class</a>
|
151
|
+
/// <br><a href="FC_GCS_LineMin.xml">XML-Feature Class with the minimum spatial reference definition</a>
|
152
|
+
/// <br><a href="FeatureClassInAFeatureDataset.xml">XML-Feature Class to be created in a feature dataset</a>
|
153
|
+
/// @param[in] tableDef The XML definition of the table to be created.
|
154
|
+
/// @param[in] parent The location where the table will be created. Pass an empty string if you want to
|
155
|
+
/// create a table or feature class at the root. If you want to create a feature class in an existing feature
|
156
|
+
/// dataset use the path "\USA".
|
157
|
+
/// @param[out] table An Table instance for the newly created table.
|
158
|
+
/// @return Error code indicating whether the method finished successfully.
|
159
|
+
fgdbError CreateTable(const std::string& tableDef, const std::wstring& parent, Table& table);
|
160
|
+
|
161
|
+
/// Opens a table. This can also be used to open attributed and M:N relationship class tables.
|
162
|
+
/// If the table does not exist, a -2147220655 (The table was not found) error will be returned.
|
163
|
+
/// Attempting to open a compressed file is not supported and a -2147220109 (FileGDB compression is
|
164
|
+
/// not installed.) error will be returned.
|
165
|
+
/// @param[in] path The path of the table to open. Opening a table or feature class at
|
166
|
+
/// the root make sure to include "\". If opening a feature class in a feature dataset include
|
167
|
+
/// the feature dataset name in the path "\USA\counties".
|
168
|
+
/// @param[out] table An Table instance for the opened table.
|
169
|
+
/// @return Error code indicating whether the method finished successfully.
|
170
|
+
fgdbError OpenTable(const std::wstring& path, Table& table);
|
171
|
+
|
172
|
+
/// Closes a table that has been previously created or opened.
|
173
|
+
/// @param[in] table The table to close.
|
174
|
+
/// @return Error code indicating whether the method finished successfully.
|
175
|
+
fgdbError CloseTable(Table& table);
|
176
|
+
|
177
|
+
/// Renames a dataset.
|
178
|
+
/// @param[in] path The path of the dataset, e.g. "\Landbase\Parcels".
|
179
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
180
|
+
/// @param[in] newName The name to apply to the dataset, e.g. "Parcels2".
|
181
|
+
/// @return Error code indicating whether the method finished successfully.
|
182
|
+
fgdbError Rename(const std::wstring& path, const std::wstring& datasetType, const std::wstring& newName);
|
183
|
+
|
184
|
+
/// Moves a dataset from one container to another.
|
185
|
+
/// @param[in] path The path of the dataset to move, e.g. "\Landbase\Parcels".
|
186
|
+
/// @param[in] newParentPath The path of the container the dataset will be moved to, e.g. "\LandUse".
|
187
|
+
/// @return Error code indicating whether the method finished successfully.
|
188
|
+
fgdbError Move(const std::wstring& path, const std::wstring& newParentPath);
|
189
|
+
|
190
|
+
/// Deletes a dataset.
|
191
|
+
/// 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/>
|
192
|
+
/// If you do not have delete access to the dataset, this will fail with an error code of E_FAIL.<br/>
|
193
|
+
/// @param[in] path The path of the dataset to delete, e.g. "\Owners".
|
194
|
+
/// @param[in] datasetType The requested dataset's type as a string, e.g. "Table". <a href="ItemTypes.txt">DatasetType</a>
|
195
|
+
/// @return Error code indicating whether the method finished successfully.
|
196
|
+
fgdbError Delete(const std::wstring& path, const std::wstring& datasetType);
|
197
|
+
//@}
|
198
|
+
|
199
|
+
/// @name Domains
|
200
|
+
//@{
|
201
|
+
|
202
|
+
/// Gets the names of all domains, if any.
|
203
|
+
/// @param[out] domainNames The domains.
|
204
|
+
/// @return Error code indicating whether the method finished successfully.
|
205
|
+
fgdbError GetDomains(std::vector<std::wstring>& domainNames) const;
|
206
|
+
|
207
|
+
/// Creates a domain.
|
208
|
+
/// If the XML is not UTF-8, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
209
|
+
/// If the domain name already exists, a -2147209212 (Domain name already in use) error will be returned.<br/>
|
210
|
+
/// <a href="CodedValueDomain.xml">XML - Coded Value Domain</a> <a href="RangeDomain.xml">XML - Range Domain</a>
|
211
|
+
/// @param[in] domainDef The XML definition of the domain to be created.
|
212
|
+
/// @return Error code indicating whether the method finished successfully.
|
213
|
+
fgdbError CreateDomain(const std::string& domainDef);
|
214
|
+
|
215
|
+
/// Modifies the properties of an existing domain.
|
216
|
+
/// If the XML is not UTF-8, create will fail with an error code of -2147024809 (Invalid function arguments).<br/>
|
217
|
+
/// @param[in] domainDef The modified XML definition of the domain.
|
218
|
+
/// @return Error code indicating whether the method finished successfully.
|
219
|
+
fgdbError AlterDomain(const std::string& domainDef);
|
220
|
+
|
221
|
+
/// Deletes the specified domain.
|
222
|
+
///If the domain does not exist, this will fail with an error code of -2147209215 (The domain was not found).<br/>
|
223
|
+
/// @param[in] domainName The name of the domain to delete.
|
224
|
+
/// @return Error code indicating whether the method finished successfully.
|
225
|
+
fgdbError DeleteDomain(const std::wstring& domainName);
|
226
|
+
|
227
|
+
/// Gets the definition of the specified domain.
|
228
|
+
/// @param[in] domainName The name of the domain.
|
229
|
+
/// @param[out] domainDef The XML definition of the domain.
|
230
|
+
/// @return Error code indicating whether the method finished successfully.
|
231
|
+
fgdbError GetDomainDefinition(const std::wstring& domainName, std::string& domainDef) const;
|
232
|
+
//@}
|
233
|
+
|
234
|
+
/// @name SQL
|
235
|
+
//@{
|
236
|
+
/// Gets the query name (the name to use in SQL statements) of a table based on its path.
|
237
|
+
/// @param[in] path The path of the dataset that will be queried.
|
238
|
+
/// @param[out] queryName The name that should be used for the table in SQL statements.
|
239
|
+
/// @return Error code indicating whether the method finished successfully.
|
240
|
+
fgdbError GetQueryName(const std::wstring& path, std::wstring& queryName) const;
|
241
|
+
|
242
|
+
/// Executes a SQL statement on the geodatabase. This may or may not return a result set.
|
243
|
+
/// If the SQL statement is invalid, an -2147220985 (An invalid SQL statement was used) error will be returned.<br/>
|
244
|
+
/// @param[in] sqlStmt The SQL statement to be executed.
|
245
|
+
/// @param[in] recycling Indicates whether the row enumerator should recycle memory.
|
246
|
+
/// @param[out] rows An enumerator of rows or a null value.
|
247
|
+
/// @return Error code indicating whether the method finished successfully.
|
248
|
+
fgdbError ExecuteSQL(const std::wstring& sqlStmt, bool recycling, EnumRows& rows) const;
|
249
|
+
//@}
|
250
|
+
|
251
|
+
/// @name Constructors and Destructors
|
252
|
+
//@{
|
253
|
+
/// The class constructor.
|
254
|
+
Geodatabase();
|
255
|
+
|
256
|
+
/// The class destructor.
|
257
|
+
~Geodatabase();
|
258
|
+
//@}
|
259
|
+
|
260
|
+
private:
|
261
|
+
|
262
|
+
/// @cond PRIVATE
|
263
|
+
fgdbError CreateGeodatabase(const std::wstring& path);
|
264
|
+
fgdbError OpenGeodatabase(const std::wstring& path);
|
265
|
+
fgdbError CloseGeodatabase();
|
266
|
+
fgdbError DeleteGeodatabase();
|
267
|
+
|
268
|
+
bool IsSetup() const;
|
269
|
+
|
270
|
+
Catalog* m_pCatalog;
|
271
|
+
|
272
|
+
#pragma warning(push)
|
273
|
+
#pragma warning(disable : 4251)
|
274
|
+
|
275
|
+
std::map<Table*, Table*> m_tableROT;
|
276
|
+
|
277
|
+
#pragma warning(pop)
|
278
|
+
|
279
|
+
friend EXT_FILEGDB_API fgdbError CreateGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
|
280
|
+
friend EXT_FILEGDB_API fgdbError OpenGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
|
281
|
+
friend EXT_FILEGDB_API fgdbError CloseGeodatabase(Geodatabase& geodatabase);
|
282
|
+
friend EXT_FILEGDB_API fgdbError DeleteGeodatabase(const std::wstring& path);
|
283
|
+
|
284
|
+
friend class Table;
|
285
|
+
|
286
|
+
Geodatabase(const Geodatabase&) { }
|
287
|
+
Geodatabase& operator=(const Geodatabase&) { return *this; }
|
288
|
+
/// @endcond
|
289
|
+
};
|
290
|
+
|
291
|
+
}; // namespace FileGDBAPI
|
@@ -0,0 +1,79 @@
|
|
1
|
+
//
|
2
|
+
// GeodatabaseManagement.h
|
3
|
+
//
|
4
|
+
|
5
|
+
/*
|
6
|
+
COPYRIGHT � 2012 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 accessing, creating and deleting file geodatabases.
|
23
|
+
/// @file GeodatabaseManagement.h
|
24
|
+
|
25
|
+
#pragma once
|
26
|
+
|
27
|
+
#include <string>
|
28
|
+
|
29
|
+
#ifndef EXPORT_FILEGDB_API
|
30
|
+
# if defined linux || defined __APPLE__
|
31
|
+
# define EXT_FILEGDB_API
|
32
|
+
# else
|
33
|
+
# define EXT_FILEGDB_API _declspec(dllimport)
|
34
|
+
# endif
|
35
|
+
#else
|
36
|
+
# if defined linux || defined __APPLE__
|
37
|
+
# define EXT_FILEGDB_API __attribute__((visibility("default")))
|
38
|
+
# else
|
39
|
+
# define EXT_FILEGDB_API _declspec(dllexport)
|
40
|
+
# endif
|
41
|
+
#endif
|
42
|
+
|
43
|
+
#include "FileGDBCore.h"
|
44
|
+
|
45
|
+
namespace FileGDBAPI
|
46
|
+
{
|
47
|
+
|
48
|
+
class Geodatabase;
|
49
|
+
|
50
|
+
/// Creates a new 10.x file geodatabase in the specified location.
|
51
|
+
/// If the file geodatabase already exists a -2147220653 (The table already exists) error will be returned.
|
52
|
+
/// If the path is seriously in error, say pointing to the wrong drive, a -2147467259 (E_FAIL) error is returned.
|
53
|
+
/// @param[in] path The location where the geodatabase should be created.
|
54
|
+
/// @param[out] geodatabase A reference to the newly-created geodatabase.
|
55
|
+
/// @return Error code indicating whether the method finished successfully.
|
56
|
+
EXT_FILEGDB_API fgdbError CreateGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
|
57
|
+
|
58
|
+
/// Opens an existing 10.x file geodatabase.
|
59
|
+
/// If the path is incorrect a -2147024894 (The system cannot find the file specified) error will be returned. If the
|
60
|
+
/// release is pre-10.x a -2147220965 (This release of the GeoDatabase is either invalid or out of date) error will be returned.
|
61
|
+
/// @param[in] path The path of the geodatabase.
|
62
|
+
/// @param[out] geodatabase A reference to the opened geodatabase.
|
63
|
+
/// @return Error code indicating whether the method finished successfully.
|
64
|
+
EXT_FILEGDB_API fgdbError OpenGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
|
65
|
+
|
66
|
+
/// Closes an open file geodatabase.
|
67
|
+
/// @param[in] geodatabase A reference to the geodatabase.
|
68
|
+
/// @return Error code indicating whether the method finished successfully.
|
69
|
+
EXT_FILEGDB_API fgdbError CloseGeodatabase(Geodatabase& geodatabase);
|
70
|
+
|
71
|
+
/// Deletes a file geodatabase.
|
72
|
+
/// If the path is incorrect a -2147024894 (The system cannot find the file specified) error will be returned.
|
73
|
+
/// If another process has a lock on the geodatabase, a -2147220947 (Cannot acquire a lock) error will be returned.
|
74
|
+
/// If access is denied an E_FAIL is returned.
|
75
|
+
/// @param[in] path The path of the geodatabase.
|
76
|
+
/// @return Error code indicating whether the method finished successfully.
|
77
|
+
EXT_FILEGDB_API fgdbError DeleteGeodatabase(const std::wstring& path);
|
78
|
+
|
79
|
+
}; // namespace FileGDBAPI
|
@@ -0,0 +1,101 @@
|
|
1
|
+
//
|
2
|
+
// Raster.h
|
3
|
+
//
|
4
|
+
|
5
|
+
/*
|
6
|
+
COPYRIGHT � 2012 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
|
+
#pragma once
|
23
|
+
|
24
|
+
#include <string>
|
25
|
+
|
26
|
+
#ifndef EXPORT_FILEGDB_API
|
27
|
+
# if defined linux || defined __APPLE__
|
28
|
+
# define EXT_FILEGDB_API
|
29
|
+
# else
|
30
|
+
# define EXT_FILEGDB_API _declspec(dllimport)
|
31
|
+
# endif
|
32
|
+
#else
|
33
|
+
# if defined linux || defined __APPLE__
|
34
|
+
# define EXT_FILEGDB_API __attribute__((visibility("default")))
|
35
|
+
# else
|
36
|
+
# define EXT_FILEGDB_API _declspec(dllexport)
|
37
|
+
# endif
|
38
|
+
#endif
|
39
|
+
|
40
|
+
#include "FileGDBCore.h"
|
41
|
+
|
42
|
+
namespace FileGDBAPI
|
43
|
+
{
|
44
|
+
|
45
|
+
class ByteArray;
|
46
|
+
class Row;
|
47
|
+
|
48
|
+
/// Provides read and write access to raster data.
|
49
|
+
class EXT_FILEGDB_API Raster
|
50
|
+
{
|
51
|
+
public:
|
52
|
+
|
53
|
+
/// @name Data access
|
54
|
+
//@{
|
55
|
+
/// TODO: Write description.
|
56
|
+
/// @param[out] format TODO
|
57
|
+
/// @returns Error code integer indicating whether the method finished successfully.
|
58
|
+
//fgdbError GetFormat(std::wstring& format);
|
59
|
+
|
60
|
+
/// TODO: Write description.
|
61
|
+
/// @param[in] format TODO
|
62
|
+
/// @returns Error code integer indicating whether the method finished successfully.
|
63
|
+
//fgdbError SetFormat(const std::wstring& format);
|
64
|
+
|
65
|
+
/// TODO: Write description.
|
66
|
+
/// @param[out] bytes TODO
|
67
|
+
/// @returns Error code integer indicating whether the method finished successfully.
|
68
|
+
//fgdbError GetBytes(ByteArray& bytes);
|
69
|
+
|
70
|
+
/// TODO: Write description.
|
71
|
+
/// @param[in] bytes TODO
|
72
|
+
/// @returns Error code integer indicating whether the method finished successfully.
|
73
|
+
//fgdbError SetBytes(const ByteArray& bytes);
|
74
|
+
|
75
|
+
/// TODO: Write description.
|
76
|
+
/// @param[out] attributes TODO
|
77
|
+
/// @returns Error code integer indicating whether the method finished successfully.
|
78
|
+
//fgdbError GetAttributes(Row attributes);
|
79
|
+
|
80
|
+
/// TODO: Write description.
|
81
|
+
/// @param[in] attributes TODO
|
82
|
+
/// @returns Error code integer indicating whether the method finished successfully.
|
83
|
+
//fgdbError SetAttributes(Row attributes);
|
84
|
+
//@}
|
85
|
+
|
86
|
+
/// @name Constructors and Destructors
|
87
|
+
//@{
|
88
|
+
/// The class constructor.
|
89
|
+
Raster();
|
90
|
+
|
91
|
+
/// The class destructor.
|
92
|
+
~Raster();
|
93
|
+
//@}
|
94
|
+
|
95
|
+
private:
|
96
|
+
|
97
|
+
Raster(const Raster&) { }
|
98
|
+
Raster& operator=(const Raster&) { return *this; }
|
99
|
+
};
|
100
|
+
|
101
|
+
}; // namespace FileGDBAPI
|