filegdb 0.0.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -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
|
@@ -112,24 +112,33 @@ public:
|
|
112
112
|
fgdbError GetSpatialReferenceText(std::wstring& spatialReference) const;
|
113
113
|
fgdbError SetSpatialReferenceText(const std::wstring& spatialReference);
|
114
114
|
|
115
|
-
fgdbError GetSpatialReferenceID(int&
|
116
|
-
fgdbError SetSpatialReferenceID(int
|
115
|
+
fgdbError GetSpatialReferenceID(int& srid);
|
116
|
+
fgdbError SetSpatialReferenceID(int srid);
|
117
117
|
|
118
|
-
fgdbError
|
119
|
-
fgdbError
|
118
|
+
fgdbError GetXYFalseOrigin(double& falseX, double& falseY);
|
119
|
+
fgdbError SetXYFalseOrigin(double falseX, double falseY);
|
120
120
|
|
121
|
-
fgdbError
|
122
|
-
fgdbError
|
123
|
-
|
124
|
-
fgdbError GetMFalseOriginAndUnits(double& falseM, double& mUnits);
|
125
|
-
fgdbError SetMFalseOriginAndUnits(double falseM, double mUnits);
|
121
|
+
fgdbError GetXYResolution(double& xyResolution);
|
122
|
+
fgdbError SetXYResolution(double xyResolution);
|
126
123
|
|
127
124
|
fgdbError GetXYTolerance(double& xyTolerance);
|
128
125
|
fgdbError SetXYTolerance(double xyTolerance);
|
129
126
|
|
127
|
+
fgdbError GetZFalseOrigin(double& falseZ);
|
128
|
+
fgdbError SetZFalseOrigin(double falseZ);
|
129
|
+
|
130
|
+
fgdbError GetZResolution(double& zResolution);
|
131
|
+
fgdbError SetZResolution(double zResolution);
|
132
|
+
|
130
133
|
fgdbError GetZTolerance(double& zTolerance);
|
131
134
|
fgdbError SetZTolerance(double zTolerance);
|
132
135
|
|
136
|
+
fgdbError GetMFalseOrigin(double& falseM);
|
137
|
+
fgdbError SetMFalseOrigin(double falseM);
|
138
|
+
|
139
|
+
fgdbError GetMResolution(double& mResolution);
|
140
|
+
fgdbError SetMResolution(double mResolution);
|
141
|
+
|
133
142
|
fgdbError GetMTolerance(double& mTolerance);
|
134
143
|
fgdbError SetMTolerance(double mTolerance);
|
135
144
|
|
@@ -142,13 +151,13 @@ private:
|
|
142
151
|
int m_wkid;
|
143
152
|
double m_falseX;
|
144
153
|
double m_falseY;
|
145
|
-
double
|
146
|
-
double m_falseZ;
|
147
|
-
double m_ZUnits;
|
148
|
-
double m_falseM;
|
149
|
-
double m_MUnits;
|
154
|
+
double m_XYResolution;
|
150
155
|
double m_XYTolerance;
|
156
|
+
double m_falseZ;
|
157
|
+
double m_ZResolution;
|
151
158
|
double m_ZTolerance;
|
159
|
+
double m_falseM;
|
160
|
+
double m_MResolution;
|
152
161
|
double m_MTolerance;
|
153
162
|
};
|
154
163
|
|
@@ -14,16 +14,19 @@
|
|
14
14
|
# Supported build configurations:
|
15
15
|
# Linux 32-bit, 64-bit
|
16
16
|
# Mac 64-bit
|
17
|
+
#
|
18
|
+
# Set CXX=g++ or CXX=clang++ based on your FileGDB API platform package.
|
19
|
+
|
17
20
|
|
18
21
|
ifndef CFG
|
19
22
|
CFG=Release
|
20
23
|
endif
|
21
24
|
|
22
|
-
|
25
|
+
CXXDEF=-DUNICODE -D_UNICODE -DUNIX -D_REENTRANT -DFILEGDB_API \
|
23
26
|
-D__USE_FILE_OFFSET64 -DUNIX_FILEGDB_API -D_FILE_OFFSET_BITS=64\
|
24
27
|
-D_LARGEFILE64_SOURCE
|
25
28
|
|
26
|
-
|
29
|
+
CXXFLAGS=-fPIC
|
27
30
|
|
28
31
|
ifndef OS
|
29
32
|
OS := $(shell uname)
|
@@ -39,52 +42,62 @@ ifndef ARCH
|
|
39
42
|
endif
|
40
43
|
|
41
44
|
ifdef API_BUILD
|
42
|
-
|
45
|
+
CXXFLAGS+=-fvisibility=hidden -fpermissive
|
43
46
|
|
44
47
|
ifndef RedHat5
|
45
48
|
RedHat5 := $(shell grep -s -c 'release 5' /etc/redhat-release)
|
46
49
|
endif
|
47
50
|
|
48
51
|
ifeq "$(RedHat5)" "1"
|
49
|
-
|
52
|
+
CXXFLAGS+=-Wno-attributes
|
50
53
|
endif
|
51
54
|
endif
|
52
55
|
|
53
56
|
ifeq "$(CFG)" "Release"
|
54
|
-
|
55
|
-
CFLAGS+=-O3
|
56
|
-
endif
|
57
|
+
CXXFLAGS+=-O3
|
57
58
|
endif
|
58
59
|
|
59
60
|
ifeq "$(CFG)" "Debug"
|
60
|
-
|
61
|
+
CXXFLAGS+=-g
|
61
62
|
endif
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
ifeq "$(ARCH)" "32"
|
65
|
+
CXXFLAGS+=-m32
|
66
|
+
LDFLAGS=-m32
|
67
|
+
3PLIBDIR=.
|
68
|
+
endif
|
69
|
+
ifeq "$(ARCH)" "64"
|
70
|
+
CXXFLAGS+=-m64
|
71
|
+
LDFLAGS=-m64
|
72
|
+
ifeq "$(OS)" "Darwin"
|
73
|
+
3PLIBDIR=mac/x64
|
74
|
+
CXXFLAGS+=-arch x86_64
|
75
|
+
LDFLAGS+=-arch x86_64
|
76
|
+
else
|
77
|
+
3PLIBDIR=x64
|
68
78
|
endif
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
79
|
+
endif
|
80
|
+
|
81
|
+
ifndef CXX
|
82
|
+
CXX=g++
|
83
|
+
endif
|
84
|
+
|
85
|
+
ifeq "$(OS)" "Darwin"
|
86
|
+
os_ver_minor := $(shell sw_vers -productVersion | cut -f2 -d.)
|
87
|
+
ifeq ($(shell test $(os_ver_minor) -gt 8; echo $$?), 0)
|
88
|
+
ifeq "$(CXX)" "g++"
|
89
|
+
CXXFLAGS+=-stdlib=libstdc++
|
90
|
+
LDFLAGS+=-stdlib=libstdc++
|
78
91
|
endif
|
79
92
|
endif
|
80
93
|
endif
|
81
94
|
|
82
|
-
|
83
|
-
|
95
|
+
ifeq "$(CXX)" "clang++"
|
96
|
+
CXXFLAGS+=-stdlib=libc++
|
97
|
+
LDFLAGS+=-stdlib=libc++
|
84
98
|
endif
|
85
99
|
|
86
|
-
|
87
|
-
CXOTHER=-I.
|
100
|
+
CXXOTHER=-I.
|
88
101
|
|
89
102
|
SLIBEXT=so
|
90
103
|
ifeq "$(OS)" "Darwin"
|
@@ -93,6 +106,3 @@ endif
|
|
93
106
|
|
94
107
|
AR=ar
|
95
108
|
ARFLAGS=-rcs
|
96
|
-
|
97
|
-
CXX=$(CX)
|
98
|
-
CXOTHER=-I.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/filegdb/geodatabase.cpp
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
#include "geodatabase.hpp"
|
3
2
|
#include "table.hpp"
|
4
3
|
|
@@ -95,7 +94,7 @@ VALUE geodatabase::close(VALUE self) {
|
|
95
94
|
return Qnil;
|
96
95
|
}
|
97
96
|
|
98
|
-
db->_value =
|
97
|
+
db->_value = Qnil;
|
99
98
|
|
100
99
|
return Qnil;
|
101
100
|
}
|
@@ -228,7 +227,7 @@ VALUE geodatabase::get_child_datasets(VALUE self, VALUE parent_path, VALUE datas
|
|
228
227
|
VALUE result = rb_ary_new();
|
229
228
|
|
230
229
|
for (std::vector<wstring>::iterator it = children.begin(); it != children.end(); ++it) {
|
231
|
-
VALUE name = rb_str_new2(
|
230
|
+
VALUE name = rb_str_new2(to_string(*it).c_str());
|
232
231
|
rb_ary_push(result, name);
|
233
232
|
}
|
234
233
|
|
@@ -312,7 +311,7 @@ VALUE geodatabase::get_child_dataset_definitions(VALUE self, VALUE parentPath, V
|
|
312
311
|
|
313
312
|
VALUE result = rb_ary_new();
|
314
313
|
|
315
|
-
for (
|
314
|
+
for (std::vector<string>::iterator it = definitions.begin(); it != definitions.end(); ++it) {
|
316
315
|
rb_ary_push(result, rb_str_new2((*it).c_str()));
|
317
316
|
}
|
318
317
|
|
@@ -340,7 +339,7 @@ VALUE geodatabase::get_related_dataset_definitions(VALUE self, VALUE path, VALUE
|
|
340
339
|
|
341
340
|
VALUE result = rb_ary_new();
|
342
341
|
|
343
|
-
for (
|
342
|
+
for (std::vector<string>::iterator it = definitions.begin(); it != definitions.end(); ++it) {
|
344
343
|
rb_ary_push(result, rb_str_new2((*it).c_str()));
|
345
344
|
}
|
346
345
|
|
@@ -361,8 +360,8 @@ VALUE geodatabase::get_dataset_types(VALUE self) {
|
|
361
360
|
|
362
361
|
VALUE result = rb_ary_new();
|
363
362
|
|
364
|
-
for (
|
365
|
-
rb_ary_push(result, rb_str_new2(
|
363
|
+
for (std::vector<wstring>::iterator it = datasetTypes.begin(); it != datasetTypes.end(); ++it) {
|
364
|
+
rb_ary_push(result, rb_str_new2(to_string(*it).c_str()));
|
366
365
|
}
|
367
366
|
|
368
367
|
return result;
|
@@ -382,8 +381,8 @@ VALUE geodatabase::get_dataset_relationship_types(VALUE self) {
|
|
382
381
|
|
383
382
|
VALUE result = rb_ary_new();
|
384
383
|
|
385
|
-
for (
|
386
|
-
rb_ary_push(result, rb_str_new2(
|
384
|
+
for (std::vector<wstring>::iterator it = datasetTypes.begin(); it != datasetTypes.end(); ++it) {
|
385
|
+
rb_ary_push(result, rb_str_new2(to_string(*it).c_str()));
|
387
386
|
}
|
388
387
|
|
389
388
|
return result;
|
@@ -410,8 +409,8 @@ VALUE geodatabase::get_related_datasets(VALUE self, VALUE path, VALUE relType, V
|
|
410
409
|
|
411
410
|
VALUE result = rb_ary_new();
|
412
411
|
|
413
|
-
for (
|
414
|
-
rb_ary_push(result, rb_str_new2(
|
412
|
+
for (std::vector<wstring>::iterator it = datasets.begin(); it != datasets.end(); ++it) {
|
413
|
+
rb_ary_push(result, rb_str_new2(to_string(*it).c_str()));
|
415
414
|
}
|
416
415
|
|
417
416
|
return result;
|
@@ -493,7 +492,7 @@ VALUE geodatabase::get_query_name(VALUE self, VALUE path) {
|
|
493
492
|
return Qnil;
|
494
493
|
}
|
495
494
|
|
496
|
-
return rb_str_new2(
|
495
|
+
return rb_str_new2(to_string(result).c_str());
|
497
496
|
}
|
498
497
|
|
499
498
|
void geodatabase::define(VALUE module)
|
data/ext/filegdb/point.cpp
CHANGED
data/ext/filegdb/row.cpp
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
#include "row.hpp"
|
3
2
|
#include "shape_buffer.hpp"
|
4
3
|
|
@@ -53,7 +52,7 @@ VALUE row::get_string(VALUE self, VALUE column) {
|
|
53
52
|
return Qnil;
|
54
53
|
}
|
55
54
|
|
56
|
-
return rb_str_new2(
|
55
|
+
return rb_str_new2(to_string(wvalue).c_str());
|
57
56
|
}
|
58
57
|
|
59
58
|
VALUE row::set_geometry(VALUE self, VALUE geometry) {
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
#include "spatial_reference.hpp"
|
3
2
|
|
4
3
|
namespace filegdb {
|
@@ -28,7 +27,7 @@ VALUE spatial_reference::get_spatial_reference_text(VALUE self) {
|
|
28
27
|
return Qnil;
|
29
28
|
}
|
30
29
|
|
31
|
-
return rb_str_new2(
|
30
|
+
return rb_str_new2(to_string(text).c_str());
|
32
31
|
}
|
33
32
|
|
34
33
|
VALUE spatial_reference::set_spatial_reference_text(VALUE self, VALUE srs) {
|
data/ext/filegdb/table.cpp
CHANGED
data/ext/filegdb/util.cpp
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
#include "filegdb.hpp"
|
2
|
+
#include <cstdlib>
|
2
3
|
|
3
|
-
std::wstring to_wstring(const char *input) {
|
4
|
+
const std::wstring to_wstring(const char *input) {
|
4
5
|
std::string converted(input);
|
5
6
|
return std::wstring(converted.begin(), converted.end());
|
6
7
|
}
|
7
8
|
|
8
|
-
const
|
9
|
-
|
9
|
+
const std::string to_string(std::wstring str) {
|
10
|
+
static char result[16384] = { 0 };
|
11
|
+
|
12
|
+
std::wcstombs(result, str.c_str(), sizeof(result));
|
13
|
+
|
14
|
+
return std::string(result);
|
10
15
|
}
|
11
16
|
|
12
|
-
const
|
17
|
+
const std::string fgdb_error_string(fgdbError hr) {
|
13
18
|
wstring errorText;
|
14
19
|
ErrorInfo::GetErrorDescription(hr, errorText);
|
15
|
-
return
|
20
|
+
return to_string(errorText);
|
16
21
|
}
|
data/filegdb.gemspec
CHANGED
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
|
|
5
5
|
gem.authors = ["Zac McCormick"]
|
6
6
|
gem.email = ["zac.mccormick@gmail.com"]
|
7
7
|
gem.description = %q{ESRI FileGDB bindings for ruby}
|
8
|
-
gem.summary = %q{ESRI FileGDB bindings for ruby. Currently contains native extensions for FileGDB API 1.
|
8
|
+
gem.summary = %q{ESRI FileGDB bindings for ruby. Currently contains native extensions for FileGDB API 1.4}
|
9
9
|
gem.homepage = "https://github.com/spatialnetworks/filegdb-ruby"
|
10
10
|
gem.licenses = ['BSD']
|
11
11
|
|
data/lib/filegdb/version.rb
CHANGED
data/spec/geodatabase_spec.rb
CHANGED
@@ -36,7 +36,7 @@ describe "FileGDB" do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'gets the dataset definition' do
|
39
|
-
@db.get_dataset_definition('\\TestTable', 'Table').length.should eq(
|
39
|
+
@db.get_dataset_definition('\\TestTable', 'Table').length.should eq(7022)
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'gets the dataset documentation' do
|
@@ -61,7 +61,7 @@ describe "FileGDB" do
|
|
61
61
|
|
62
62
|
it 'renames a table' do
|
63
63
|
lambda { @db.rename('\\TestTable', 'Table', 'TestTableNew') }.should_not raise_error
|
64
|
-
@db.get_dataset_definition('\\TestTableNew', 'Table').length.should eq(
|
64
|
+
@db.get_dataset_definition('\\TestTableNew', 'Table').length.should eq(5559)
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'moves a table' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filegdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zac McCormick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -149,11 +149,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.5.0
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: ESRI FileGDB bindings for ruby. Currently contains native extensions for
|
156
|
-
FileGDB API 1.
|
156
|
+
FileGDB API 1.4
|
157
157
|
test_files:
|
158
158
|
- spec/data/domain_definition.xml
|
159
159
|
- spec/data/domain_definition_altered.xml
|