rgeo 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/geos_c_impl/extconf.rb +12 -7
- data/lib/rgeo/version.rb +1 -1
- metadata +1 -26
- data/ext/geos_c_impl/Makefile_2.2.3 +0 -260
- data/ext/geos_c_impl/coordinates.c +0 -65
- data/ext/geos_c_impl/coordinates.h +0 -2
- data/ext/geos_c_impl/factory.c +0 -995
- data/ext/geos_c_impl/factory.h +0 -238
- data/ext/geos_c_impl/geometry.c +0 -1028
- data/ext/geos_c_impl/geometry.h +0 -23
- data/ext/geos_c_impl/geometry_collection.c +0 -757
- data/ext/geos_c_impl/geometry_collection.h +0 -46
- data/ext/geos_c_impl/geos_c_impl_2.2.3.bundle +0 -0
- data/ext/geos_c_impl/line_string.c +0 -675
- data/ext/geos_c_impl/line_string.h +0 -32
- data/ext/geos_c_impl/main.c +0 -40
- data/ext/geos_c_impl/mkmf.log +0 -123
- data/ext/geos_c_impl/point.c +0 -236
- data/ext/geos_c_impl/point.h +0 -30
- data/ext/geos_c_impl/polygon.c +0 -359
- data/ext/geos_c_impl/polygon.h +0 -43
- data/ext/geos_c_impl/preface.h +0 -38
- data/ext/proj4_c_impl/Makefile_2.2.3 +0 -260
- data/ext/proj4_c_impl/main.c +0 -315
- data/ext/proj4_c_impl/mkmf.log +0 -47
- data/ext/proj4_c_impl/proj4_c_impl_2.2.3.bundle +0 -0
- data/lib/rgeo/coord_sys/proj4_c_impl.bundle +0 -0
- data/lib/rgeo/geos/geos_c_impl.bundle +0 -0
data/ext/geos_c_impl/polygon.c
DELETED
@@ -1,359 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Polygon methods for GEOS wrapper
|
3
|
-
*/
|
4
|
-
|
5
|
-
|
6
|
-
#include "preface.h"
|
7
|
-
|
8
|
-
#ifdef RGEO_GEOS_SUPPORTED
|
9
|
-
|
10
|
-
#include <ruby.h>
|
11
|
-
#include <geos_c.h>
|
12
|
-
|
13
|
-
#include "factory.h"
|
14
|
-
#include "geometry.h"
|
15
|
-
#include "line_string.h"
|
16
|
-
#include "polygon.h"
|
17
|
-
|
18
|
-
#include "coordinates.h"
|
19
|
-
|
20
|
-
RGEO_BEGIN_C
|
21
|
-
|
22
|
-
|
23
|
-
static VALUE method_polygon_eql(VALUE self, VALUE rhs)
|
24
|
-
{
|
25
|
-
VALUE result;
|
26
|
-
RGeo_GeometryData* self_data;
|
27
|
-
|
28
|
-
result = rgeo_geos_klasses_and_factories_eql(self, rhs);
|
29
|
-
if (RTEST(result)) {
|
30
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
31
|
-
result = rgeo_geos_polygons_eql(self_data->geos_context, self_data->geom, RGEO_GEOMETRY_DATA_PTR(rhs)->geom, RGEO_FACTORY_DATA_PTR(self_data->factory)->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M);
|
32
|
-
}
|
33
|
-
return result;
|
34
|
-
}
|
35
|
-
|
36
|
-
|
37
|
-
static VALUE method_polygon_hash(VALUE self)
|
38
|
-
{
|
39
|
-
st_index_t hash;
|
40
|
-
RGeo_GeometryData* self_data;
|
41
|
-
VALUE factory;
|
42
|
-
|
43
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
44
|
-
factory = self_data->factory;
|
45
|
-
hash = rb_hash_start(0);
|
46
|
-
hash = rgeo_geos_objbase_hash(factory,
|
47
|
-
RGEO_FACTORY_DATA_PTR(factory)->globals->feature_polygon, hash);
|
48
|
-
hash = rgeo_geos_polygon_hash(self_data->geos_context, self_data->geom, hash);
|
49
|
-
return LONG2FIX(rb_hash_end(hash));
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
static VALUE method_polygon_geometry_type(VALUE self)
|
54
|
-
{
|
55
|
-
VALUE result;
|
56
|
-
RGeo_GeometryData* self_data;
|
57
|
-
|
58
|
-
result = Qnil;
|
59
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
60
|
-
if (self_data->geom) {
|
61
|
-
result = RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->feature_polygon;
|
62
|
-
}
|
63
|
-
return result;
|
64
|
-
}
|
65
|
-
|
66
|
-
|
67
|
-
static VALUE method_polygon_area(VALUE self)
|
68
|
-
{
|
69
|
-
VALUE result;
|
70
|
-
RGeo_GeometryData* self_data;
|
71
|
-
const GEOSGeometry* self_geom;
|
72
|
-
double area;
|
73
|
-
|
74
|
-
result = Qnil;
|
75
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
76
|
-
self_geom = self_data->geom;
|
77
|
-
if (self_geom) {
|
78
|
-
if (GEOSArea_r(self_data->geos_context, self_geom, &area)) {
|
79
|
-
result = rb_float_new(area);
|
80
|
-
}
|
81
|
-
}
|
82
|
-
return result;
|
83
|
-
}
|
84
|
-
|
85
|
-
|
86
|
-
static VALUE method_polygon_centroid(VALUE self)
|
87
|
-
{
|
88
|
-
VALUE result;
|
89
|
-
RGeo_GeometryData* self_data;
|
90
|
-
const GEOSGeometry* self_geom;
|
91
|
-
|
92
|
-
result = Qnil;
|
93
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
94
|
-
self_geom = self_data->geom;
|
95
|
-
if (self_geom) {
|
96
|
-
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSGetCentroid_r(self_data->geos_context, self_geom), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_point);
|
97
|
-
}
|
98
|
-
return result;
|
99
|
-
}
|
100
|
-
|
101
|
-
|
102
|
-
static VALUE method_polygon_point_on_surface(VALUE self)
|
103
|
-
{
|
104
|
-
VALUE result;
|
105
|
-
RGeo_GeometryData* self_data;
|
106
|
-
const GEOSGeometry* self_geom;
|
107
|
-
|
108
|
-
result = Qnil;
|
109
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
110
|
-
self_geom = self_data->geom;
|
111
|
-
if (self_geom) {
|
112
|
-
result = rgeo_wrap_geos_geometry(self_data->factory, GEOSPointOnSurface_r(self_data->geos_context, self_geom), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_point);
|
113
|
-
}
|
114
|
-
return result;
|
115
|
-
}
|
116
|
-
|
117
|
-
|
118
|
-
static VALUE method_polygon_coordinates(VALUE self)
|
119
|
-
{
|
120
|
-
VALUE result = Qnil;
|
121
|
-
RGeo_GeometryData* self_data;
|
122
|
-
const GEOSGeometry* self_geom;
|
123
|
-
GEOSContextHandle_t self_context;
|
124
|
-
|
125
|
-
GEOSGeometry* ring;
|
126
|
-
GEOSCoordSequence* coord_sequence;
|
127
|
-
unsigned int interior_ring_count;
|
128
|
-
int zCoordinate;
|
129
|
-
|
130
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
131
|
-
self_geom = self_data->geom;
|
132
|
-
|
133
|
-
if (self_geom) {
|
134
|
-
zCoordinate = RGEO_FACTORY_DATA_PTR(self_data->factory)->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M;
|
135
|
-
self_context = self_data->geos_context;
|
136
|
-
result = extract_points_from_polygon(self_context, self_geom, zCoordinate);
|
137
|
-
}
|
138
|
-
return result;
|
139
|
-
}
|
140
|
-
|
141
|
-
static VALUE method_polygon_exterior_ring(VALUE self)
|
142
|
-
{
|
143
|
-
VALUE result;
|
144
|
-
RGeo_GeometryData* self_data;
|
145
|
-
const GEOSGeometry* self_geom;
|
146
|
-
|
147
|
-
result = Qnil;
|
148
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
149
|
-
self_geom = self_data->geom;
|
150
|
-
if (self_geom) {
|
151
|
-
result = rgeo_wrap_geos_geometry_clone(self_data->factory, GEOSGetExteriorRing_r(self_data->geos_context, self_geom), RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring);
|
152
|
-
}
|
153
|
-
return result;
|
154
|
-
}
|
155
|
-
|
156
|
-
|
157
|
-
static VALUE method_polygon_num_interior_rings(VALUE self)
|
158
|
-
{
|
159
|
-
VALUE result;
|
160
|
-
RGeo_GeometryData* self_data;
|
161
|
-
const GEOSGeometry* self_geom;
|
162
|
-
int num;
|
163
|
-
|
164
|
-
result = Qnil;
|
165
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
166
|
-
self_geom = self_data->geom;
|
167
|
-
if (self_geom) {
|
168
|
-
num = GEOSGetNumInteriorRings_r(self_data->geos_context, self_geom);
|
169
|
-
if (num >= 0) {
|
170
|
-
result = INT2NUM(num);
|
171
|
-
}
|
172
|
-
}
|
173
|
-
return result;
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
|
-
static VALUE method_polygon_interior_ring_n(VALUE self, VALUE n)
|
178
|
-
{
|
179
|
-
VALUE result;
|
180
|
-
RGeo_GeometryData* self_data;
|
181
|
-
const GEOSGeometry* self_geom;
|
182
|
-
int i;
|
183
|
-
GEOSContextHandle_t self_context;
|
184
|
-
int num;
|
185
|
-
|
186
|
-
result = Qnil;
|
187
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
188
|
-
self_geom = self_data->geom;
|
189
|
-
if (self_geom) {
|
190
|
-
i = NUM2INT(n);
|
191
|
-
if (i >= 0) {
|
192
|
-
self_context = self_data->geos_context;
|
193
|
-
num = GEOSGetNumInteriorRings_r(self_context, self_geom);
|
194
|
-
if (i < num) {
|
195
|
-
result = rgeo_wrap_geos_geometry_clone(self_data->factory,
|
196
|
-
GEOSGetInteriorRingN_r(self_context, self_geom, i),
|
197
|
-
RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring);
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}
|
201
|
-
return result;
|
202
|
-
}
|
203
|
-
|
204
|
-
|
205
|
-
static VALUE method_polygon_interior_rings(VALUE self)
|
206
|
-
{
|
207
|
-
VALUE result;
|
208
|
-
RGeo_GeometryData* self_data;
|
209
|
-
const GEOSGeometry* self_geom;
|
210
|
-
GEOSContextHandle_t self_context;
|
211
|
-
int count;
|
212
|
-
VALUE factory;
|
213
|
-
VALUE linear_ring_class;
|
214
|
-
int i;
|
215
|
-
|
216
|
-
result = Qnil;
|
217
|
-
self_data = RGEO_GEOMETRY_DATA_PTR(self);
|
218
|
-
self_geom = self_data->geom;
|
219
|
-
if (self_geom) {
|
220
|
-
self_context = self_data->geos_context;
|
221
|
-
count = GEOSGetNumInteriorRings_r(self_context, self_geom);
|
222
|
-
if (count >= 0) {
|
223
|
-
result = rb_ary_new2(count);
|
224
|
-
factory = self_data->factory;
|
225
|
-
linear_ring_class = RGEO_FACTORY_DATA_PTR(self_data->factory)->globals->geos_linear_ring;
|
226
|
-
for (i=0; i<count; ++i) {
|
227
|
-
rb_ary_store(result, i, rgeo_wrap_geos_geometry_clone(factory, GEOSGetInteriorRingN_r(self_context, self_geom, i), linear_ring_class));
|
228
|
-
}
|
229
|
-
}
|
230
|
-
}
|
231
|
-
return result;
|
232
|
-
}
|
233
|
-
|
234
|
-
|
235
|
-
static VALUE cmethod_create(VALUE module, VALUE factory, VALUE exterior, VALUE interior_array)
|
236
|
-
{
|
237
|
-
RGeo_FactoryData* factory_data;
|
238
|
-
VALUE linear_ring_type;
|
239
|
-
GEOSGeometry* exterior_geom;
|
240
|
-
GEOSContextHandle_t context;
|
241
|
-
unsigned int len;
|
242
|
-
GEOSGeometry** interior_geoms;
|
243
|
-
unsigned int actual_len;
|
244
|
-
unsigned int i;
|
245
|
-
GEOSGeometry* interior_geom;
|
246
|
-
GEOSGeometry* polygon;
|
247
|
-
|
248
|
-
Check_Type(interior_array, T_ARRAY);
|
249
|
-
factory_data = RGEO_FACTORY_DATA_PTR(factory);
|
250
|
-
linear_ring_type = factory_data->globals->feature_linear_ring;
|
251
|
-
exterior_geom = rgeo_convert_to_detached_geos_geometry(exterior, factory, linear_ring_type, NULL);
|
252
|
-
if (exterior_geom) {
|
253
|
-
context = factory_data->geos_context;
|
254
|
-
len = (unsigned int)RARRAY_LEN(interior_array);
|
255
|
-
interior_geoms = ALLOC_N(GEOSGeometry*, len == 0 ? 1 : len);
|
256
|
-
if (interior_geoms) {
|
257
|
-
actual_len = 0;
|
258
|
-
for (i=0; i<len; ++i) {
|
259
|
-
interior_geom = rgeo_convert_to_detached_geos_geometry(rb_ary_entry(interior_array, i), factory, linear_ring_type, NULL);
|
260
|
-
if (interior_geom) {
|
261
|
-
interior_geoms[actual_len++] = interior_geom;
|
262
|
-
}
|
263
|
-
}
|
264
|
-
if (len == actual_len) {
|
265
|
-
polygon = GEOSGeom_createPolygon_r(context, exterior_geom, interior_geoms, actual_len);
|
266
|
-
if (polygon) {
|
267
|
-
free(interior_geoms);
|
268
|
-
return rgeo_wrap_geos_geometry(factory, polygon, factory_data->globals->geos_polygon);
|
269
|
-
}
|
270
|
-
}
|
271
|
-
for (i=0; i<actual_len; ++i) {
|
272
|
-
GEOSGeom_destroy_r(context, interior_geoms[i]);
|
273
|
-
}
|
274
|
-
free(interior_geoms);
|
275
|
-
}
|
276
|
-
GEOSGeom_destroy_r(context, exterior_geom);
|
277
|
-
}
|
278
|
-
return Qnil;
|
279
|
-
}
|
280
|
-
|
281
|
-
|
282
|
-
void rgeo_init_geos_polygon(RGeo_Globals* globals)
|
283
|
-
{
|
284
|
-
VALUE geos_polygon_methods;
|
285
|
-
|
286
|
-
// Class methods for CAPIPolygonImpl
|
287
|
-
rb_define_module_function(globals->geos_polygon, "create", cmethod_create, 3);
|
288
|
-
|
289
|
-
// CAPIPolygonMethods module
|
290
|
-
geos_polygon_methods = rb_define_module_under(globals->geos_module, "CAPIPolygonMethods");
|
291
|
-
rb_define_method(geos_polygon_methods, "rep_equals?", method_polygon_eql, 1);
|
292
|
-
rb_define_method(geos_polygon_methods, "eql?", method_polygon_eql, 1);
|
293
|
-
rb_define_method(geos_polygon_methods, "hash", method_polygon_hash, 0);
|
294
|
-
rb_define_method(geos_polygon_methods, "geometry_type", method_polygon_geometry_type, 0);
|
295
|
-
rb_define_method(geos_polygon_methods, "area", method_polygon_area, 0);
|
296
|
-
rb_define_method(geos_polygon_methods, "centroid", method_polygon_centroid, 0);
|
297
|
-
rb_define_method(geos_polygon_methods, "point_on_surface", method_polygon_point_on_surface, 0);
|
298
|
-
rb_define_method(geos_polygon_methods, "exterior_ring", method_polygon_exterior_ring, 0);
|
299
|
-
rb_define_method(geos_polygon_methods, "num_interior_rings", method_polygon_num_interior_rings, 0);
|
300
|
-
rb_define_method(geos_polygon_methods, "interior_ring_n", method_polygon_interior_ring_n, 1);
|
301
|
-
rb_define_method(geos_polygon_methods, "interior_rings", method_polygon_interior_rings, 0);
|
302
|
-
rb_define_method(geos_polygon_methods, "coordinates", method_polygon_coordinates, 0);
|
303
|
-
}
|
304
|
-
|
305
|
-
|
306
|
-
VALUE rgeo_geos_polygons_eql(GEOSContextHandle_t context, const GEOSGeometry* geom1, const GEOSGeometry* geom2, char check_z)
|
307
|
-
{
|
308
|
-
VALUE result;
|
309
|
-
int len1;
|
310
|
-
int len2;
|
311
|
-
int i;
|
312
|
-
|
313
|
-
result = Qnil;
|
314
|
-
if (geom1 && geom2) {
|
315
|
-
result = rgeo_geos_coordseqs_eql(context, GEOSGetExteriorRing_r(context, geom1), GEOSGetExteriorRing_r(context, geom2), check_z);
|
316
|
-
if (RTEST(result)) {
|
317
|
-
len1 = GEOSGetNumInteriorRings_r(context, geom1);
|
318
|
-
len2 = GEOSGetNumInteriorRings_r(context, geom2);
|
319
|
-
if (len1 >= 0 && len2 >= 0) {
|
320
|
-
if (len1 == len2) {
|
321
|
-
for (i=0; i<len1; ++i) {
|
322
|
-
result = rgeo_geos_coordseqs_eql(context, GEOSGetInteriorRingN_r(context, geom1, i), GEOSGetInteriorRingN_r(context, geom2, i), check_z);
|
323
|
-
if (!RTEST(result)) {
|
324
|
-
break;
|
325
|
-
}
|
326
|
-
}
|
327
|
-
}
|
328
|
-
else {
|
329
|
-
result = Qfalse;
|
330
|
-
}
|
331
|
-
}
|
332
|
-
else {
|
333
|
-
result = Qnil;
|
334
|
-
}
|
335
|
-
}
|
336
|
-
}
|
337
|
-
return result;
|
338
|
-
}
|
339
|
-
|
340
|
-
|
341
|
-
st_index_t rgeo_geos_polygon_hash(GEOSContextHandle_t context, const GEOSGeometry* geom, st_index_t hash)
|
342
|
-
{
|
343
|
-
unsigned int len;
|
344
|
-
unsigned int i;
|
345
|
-
|
346
|
-
if (geom) {
|
347
|
-
hash = rgeo_geos_coordseq_hash(context, GEOSGetExteriorRing_r(context, geom), hash);
|
348
|
-
len = GEOSGetNumInteriorRings_r(context, geom);
|
349
|
-
for (i=0; i<len; ++i) {
|
350
|
-
hash = rgeo_geos_coordseq_hash(context, GEOSGetInteriorRingN_r(context, geom, i), hash);
|
351
|
-
}
|
352
|
-
}
|
353
|
-
return hash;
|
354
|
-
}
|
355
|
-
|
356
|
-
|
357
|
-
RGEO_END_C
|
358
|
-
|
359
|
-
#endif
|
data/ext/geos_c_impl/polygon.h
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Polygon methods for GEOS wrapper
|
3
|
-
*/
|
4
|
-
|
5
|
-
|
6
|
-
#ifndef RGEO_GEOS_POLYGON_INCLUDED
|
7
|
-
#define RGEO_GEOS_POLYGON_INCLUDED
|
8
|
-
|
9
|
-
#include <ruby.h>
|
10
|
-
#include <geos_c.h>
|
11
|
-
|
12
|
-
#include "factory.h"
|
13
|
-
|
14
|
-
RGEO_BEGIN_C
|
15
|
-
|
16
|
-
|
17
|
-
/*
|
18
|
-
Initializes the polygon module. This should be called after
|
19
|
-
the geometry module is initialized.
|
20
|
-
*/
|
21
|
-
void rgeo_init_geos_polygon(RGeo_Globals* globals);
|
22
|
-
|
23
|
-
/*
|
24
|
-
Comopares the values of two GEOS polygons. The two given geometries MUST
|
25
|
-
be polygon types.
|
26
|
-
Returns Qtrue if the polygons are equal, Qfalse if they are inequal, or
|
27
|
-
Qnil if an error occurs.
|
28
|
-
*/
|
29
|
-
VALUE rgeo_geos_polygons_eql(GEOSContextHandle_t context, const GEOSGeometry* geom1, const GEOSGeometry* geom2, char check_z);
|
30
|
-
|
31
|
-
/*
|
32
|
-
A tool for building up hash values.
|
33
|
-
You must pass in the context, a geos geometry, and a seed hash.
|
34
|
-
Returns an updated hash.
|
35
|
-
This call is useful in sequence, and should be bracketed by calls to
|
36
|
-
rb_hash_start and rb_hash_end.
|
37
|
-
*/
|
38
|
-
st_index_t rgeo_geos_polygon_hash(GEOSContextHandle_t context, const GEOSGeometry* geom, st_index_t hash);
|
39
|
-
|
40
|
-
|
41
|
-
RGEO_END_C
|
42
|
-
|
43
|
-
#endif
|
data/ext/geos_c_impl/preface.h
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
Preface header for GEOS wrapper
|
3
|
-
*/
|
4
|
-
|
5
|
-
|
6
|
-
#ifdef HAVE_GEOS_C_H
|
7
|
-
#ifdef HAVE_GEOSSETSRID_R
|
8
|
-
#define RGEO_GEOS_SUPPORTED
|
9
|
-
#endif
|
10
|
-
#endif
|
11
|
-
|
12
|
-
#ifdef HAVE_GEOSPREPAREDCONTAINS_R
|
13
|
-
#define RGEO_GEOS_SUPPORTS_PREPARED1
|
14
|
-
#endif
|
15
|
-
#ifdef HAVE_GEOSPREPAREDDISJOINT_R
|
16
|
-
#define RGEO_GEOS_SUPPORTS_PREPARED2
|
17
|
-
#endif
|
18
|
-
#ifdef HAVE_GEOSWKTWWRITER_SETOUTPUTDIMENSION_R
|
19
|
-
#define RGEO_GEOS_SUPPORTS_SETOUTPUTDIMENSION
|
20
|
-
#endif
|
21
|
-
#ifdef HAVE_RB_MEMHASH
|
22
|
-
#define RGEO_SUPPORTS_NEW_HASHING
|
23
|
-
#endif
|
24
|
-
|
25
|
-
#ifndef RGEO_SUPPORTS_NEW_HASHING
|
26
|
-
#define st_index_t int
|
27
|
-
#define rb_memhash(x,y) rgeo_internal_memhash(x,y)
|
28
|
-
#define rb_hash_start(x) ((st_index_t)(x ^ 0xdeadbeef))
|
29
|
-
#define rb_hash_end(x) ((st_index_t)(x ^ 0xbeefdead))
|
30
|
-
#endif
|
31
|
-
|
32
|
-
#ifdef __cplusplus
|
33
|
-
#define RGEO_BEGIN_C extern "C" {
|
34
|
-
#define RGEO_END_C }
|
35
|
-
#else
|
36
|
-
#define RGEO_BEGIN_C
|
37
|
-
#define RGEO_END_C
|
38
|
-
#endif
|
@@ -1,260 +0,0 @@
|
|
1
|
-
|
2
|
-
SHELL = /bin/sh
|
3
|
-
|
4
|
-
# V=0 quiet, V=1 verbose. other values don't work.
|
5
|
-
V = 0
|
6
|
-
Q1 = $(V:1=)
|
7
|
-
Q = $(Q1:0=@)
|
8
|
-
ECHO1 = $(V:1=@:)
|
9
|
-
ECHO = $(ECHO1:0=@echo)
|
10
|
-
NULLCMD = :
|
11
|
-
|
12
|
-
#### Start of system configuration section. ####
|
13
|
-
|
14
|
-
srcdir = .
|
15
|
-
topdir = /Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0
|
16
|
-
hdrdir = $(topdir)
|
17
|
-
arch_hdrdir = /Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/x86_64-darwin14
|
18
|
-
PATH_SEPARATOR = :
|
19
|
-
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
20
|
-
prefix = $(DESTDIR)/Users/tee/.rubies/ruby-2.2.3
|
21
|
-
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
22
|
-
rubyarchprefix = $(rubylibprefix)/$(arch)
|
23
|
-
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
24
|
-
exec_prefix = $(prefix)
|
25
|
-
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
26
|
-
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
27
|
-
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
28
|
-
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
29
|
-
sitehdrdir = $(rubyhdrdir)/site_ruby
|
30
|
-
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
31
|
-
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
32
|
-
vendorlibdir = $(vendordir)/$(ruby_version)
|
33
|
-
vendordir = $(rubylibprefix)/vendor_ruby
|
34
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
35
|
-
sitelibdir = $(sitedir)/$(ruby_version)
|
36
|
-
sitedir = $(rubylibprefix)/site_ruby
|
37
|
-
rubyarchdir = $(rubylibdir)/$(arch)
|
38
|
-
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
39
|
-
sitearchincludedir = $(includedir)/$(sitearch)
|
40
|
-
archincludedir = $(includedir)/$(arch)
|
41
|
-
sitearchlibdir = $(libdir)/$(sitearch)
|
42
|
-
archlibdir = $(libdir)/$(arch)
|
43
|
-
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
44
|
-
mandir = $(datarootdir)/man
|
45
|
-
localedir = $(datarootdir)/locale
|
46
|
-
libdir = $(exec_prefix)/lib
|
47
|
-
psdir = $(docdir)
|
48
|
-
pdfdir = $(docdir)
|
49
|
-
dvidir = $(docdir)
|
50
|
-
htmldir = $(docdir)
|
51
|
-
infodir = $(datarootdir)/info
|
52
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
53
|
-
oldincludedir = $(DESTDIR)/usr/include
|
54
|
-
includedir = $(prefix)/include
|
55
|
-
localstatedir = $(prefix)/var
|
56
|
-
sharedstatedir = $(prefix)/com
|
57
|
-
sysconfdir = $(prefix)/etc
|
58
|
-
datadir = $(datarootdir)
|
59
|
-
datarootdir = $(prefix)/share
|
60
|
-
libexecdir = $(exec_prefix)/libexec
|
61
|
-
sbindir = $(exec_prefix)/sbin
|
62
|
-
bindir = $(exec_prefix)/bin
|
63
|
-
archdir = $(rubyarchdir)
|
64
|
-
|
65
|
-
|
66
|
-
CC = clang
|
67
|
-
CXX = clang++
|
68
|
-
LIBRUBY = $(LIBRUBY_A)
|
69
|
-
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
70
|
-
LIBRUBYARG_SHARED =
|
71
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
|
72
|
-
empty =
|
73
|
-
OUTFLAG = -o $(empty)
|
74
|
-
COUTFLAG = -o $(empty)
|
75
|
-
|
76
|
-
RUBY_EXTCONF_H =
|
77
|
-
cflags = $(optflags) $(debugflags) $(warnflags)
|
78
|
-
optflags = -O3 -fno-fast-math
|
79
|
-
debugflags = -ggdb3
|
80
|
-
warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens
|
81
|
-
CCDLFLAGS = -fno-common
|
82
|
-
CFLAGS = $(CCDLFLAGS) -O3 -Wno-error=shorten-64-to-32 -pipe $(ARCH_FLAG)
|
83
|
-
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
84
|
-
DEFS =
|
85
|
-
CPPFLAGS = -DHAVE_PROJ_API_H -DHAVE_PJ_INIT_PLUS -I/usr/local/include -I/Library/Frameworks/PROJ.framework/unix/include -I/usr/include -I/Users/tee/.rubies/ruby-2.2.3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
|
86
|
-
CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
|
87
|
-
ldflags = -L. -L/Users/tee/.rubies/ruby-2.2.3/lib -fstack-protector -L/usr/local/lib
|
88
|
-
dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
|
89
|
-
ARCH_FLAG =
|
90
|
-
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
91
|
-
LDSHARED = $(CC) -dynamic -bundle
|
92
|
-
LDSHAREDXX = $(CXX) -dynamic -bundle
|
93
|
-
AR = ar
|
94
|
-
EXEEXT =
|
95
|
-
|
96
|
-
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
97
|
-
RUBY_SO_NAME = ruby
|
98
|
-
RUBYW_INSTALL_NAME =
|
99
|
-
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
100
|
-
RUBYW_BASE_NAME = rubyw
|
101
|
-
RUBY_BASE_NAME = ruby
|
102
|
-
|
103
|
-
arch = x86_64-darwin14
|
104
|
-
sitearch = $(arch)
|
105
|
-
ruby_version = 2.2.0
|
106
|
-
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
107
|
-
RUBY = $(ruby)
|
108
|
-
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
|
109
|
-
|
110
|
-
RM = rm -f
|
111
|
-
RM_RF = $(RUBY) -run -e rm -- -rf
|
112
|
-
RMDIRS = rmdir -p
|
113
|
-
MAKEDIRS = mkdir -p
|
114
|
-
INSTALL = /usr/bin/install -c
|
115
|
-
INSTALL_PROG = $(INSTALL) -m 0755
|
116
|
-
INSTALL_DATA = $(INSTALL) -m 644
|
117
|
-
COPY = cp
|
118
|
-
TOUCH = exit >
|
119
|
-
|
120
|
-
#### End of system configuration section. ####
|
121
|
-
|
122
|
-
preload =
|
123
|
-
|
124
|
-
libpath = /Users/tee/.rubies/ruby-2.2.3/lib /usr/local/lib /Library/Frameworks/PROJ.framework/unix/lib /usr/lib . $(libdir)
|
125
|
-
LIBPATH = -L/Users/tee/.rubies/ruby-2.2.3/lib -L/usr/local/lib -L/Library/Frameworks/PROJ.framework/unix/lib -L/usr/lib -L. -L$(libdir)
|
126
|
-
DEFFILE =
|
127
|
-
|
128
|
-
CLEANFILES = mkmf.log
|
129
|
-
DISTCLEANFILES =
|
130
|
-
DISTCLEANDIRS =
|
131
|
-
|
132
|
-
extout =
|
133
|
-
extout_prefix =
|
134
|
-
target_prefix = /rgeo/coord_sys
|
135
|
-
LOCAL_LIBS =
|
136
|
-
LIBS = -lproj -lpthread -lgmp -ldl -lobjc
|
137
|
-
ORIG_SRCS = main.c
|
138
|
-
SRCS = $(ORIG_SRCS)
|
139
|
-
OBJS = main.o
|
140
|
-
HDRS =
|
141
|
-
TARGET = proj4_c_impl
|
142
|
-
TARGET_NAME = proj4_c_impl
|
143
|
-
TARGET_ENTRY = Init_$(TARGET_NAME)
|
144
|
-
DLLIB = $(TARGET).bundle
|
145
|
-
EXTSTATIC =
|
146
|
-
STATIC_LIB =
|
147
|
-
|
148
|
-
TIMESTAMP_DIR = .
|
149
|
-
BINDIR = $(bindir)
|
150
|
-
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
151
|
-
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
152
|
-
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
153
|
-
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
154
|
-
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
155
|
-
|
156
|
-
TARGET_SO = $(DLLIB)
|
157
|
-
CLEANLIBS = $(TARGET).bundle
|
158
|
-
CLEANOBJS = *.o *.bak
|
159
|
-
|
160
|
-
all: $(DLLIB)
|
161
|
-
static: $(STATIC_LIB)
|
162
|
-
.PHONY: all install static install-so install-rb
|
163
|
-
.PHONY: clean clean-so clean-static clean-rb
|
164
|
-
|
165
|
-
clean-static::
|
166
|
-
clean-rb-default::
|
167
|
-
clean-rb::
|
168
|
-
clean-so::
|
169
|
-
clean: clean-so clean-static clean-rb-default clean-rb
|
170
|
-
-$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
171
|
-
|
172
|
-
distclean-rb-default::
|
173
|
-
distclean-rb::
|
174
|
-
distclean-so::
|
175
|
-
distclean-static::
|
176
|
-
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
177
|
-
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
178
|
-
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
179
|
-
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
180
|
-
|
181
|
-
realclean: distclean
|
182
|
-
install: install-so install-rb
|
183
|
-
|
184
|
-
install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.-.rgeo.-.coord_sys.time
|
185
|
-
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
186
|
-
clean-static::
|
187
|
-
-$(Q)$(RM) $(STATIC_LIB)
|
188
|
-
install-rb: pre-install-rb install-rb-default
|
189
|
-
install-rb-default: pre-install-rb-default
|
190
|
-
pre-install-rb: Makefile
|
191
|
-
pre-install-rb-default: Makefile
|
192
|
-
pre-install-rb-default:
|
193
|
-
@$(NULLCMD)
|
194
|
-
$(TIMESTAMP_DIR)/.RUBYARCHDIR.-.rgeo.-.coord_sys.time:
|
195
|
-
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
196
|
-
$(Q) $(TOUCH) $@
|
197
|
-
|
198
|
-
site-install: site-install-so site-install-rb
|
199
|
-
site-install-so: install-so
|
200
|
-
site-install-rb: install-rb
|
201
|
-
|
202
|
-
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
203
|
-
|
204
|
-
.cc.o:
|
205
|
-
$(ECHO) compiling $(<)
|
206
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
207
|
-
|
208
|
-
.cc.S:
|
209
|
-
$(ECHO) translating $(<)
|
210
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
211
|
-
|
212
|
-
.mm.o:
|
213
|
-
$(ECHO) compiling $(<)
|
214
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
215
|
-
|
216
|
-
.mm.S:
|
217
|
-
$(ECHO) translating $(<)
|
218
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
219
|
-
|
220
|
-
.cxx.o:
|
221
|
-
$(ECHO) compiling $(<)
|
222
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
223
|
-
|
224
|
-
.cxx.S:
|
225
|
-
$(ECHO) translating $(<)
|
226
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
227
|
-
|
228
|
-
.cpp.o:
|
229
|
-
$(ECHO) compiling $(<)
|
230
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
231
|
-
|
232
|
-
.cpp.S:
|
233
|
-
$(ECHO) translating $(<)
|
234
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
|
235
|
-
|
236
|
-
.c.o:
|
237
|
-
$(ECHO) compiling $(<)
|
238
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
239
|
-
|
240
|
-
.c.S:
|
241
|
-
$(ECHO) translating $(<)
|
242
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
243
|
-
|
244
|
-
.m.o:
|
245
|
-
$(ECHO) compiling $(<)
|
246
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
247
|
-
|
248
|
-
.m.S:
|
249
|
-
$(ECHO) translating $(<)
|
250
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
|
251
|
-
|
252
|
-
$(DLLIB): $(OBJS) Makefile
|
253
|
-
$(ECHO) linking shared-object rgeo/coord_sys/$(DLLIB)
|
254
|
-
-$(Q)$(RM) $(@)
|
255
|
-
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
256
|
-
$(Q) $(POSTLINK)
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
$(OBJS): $(HDRS) $(ruby_headers)
|