shapelib 0.7.0 → 0.8.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 +7 -0
- data/LICENSE +36 -0
- data/LICENSE-CC-BY-SA-3.0 +375 -0
- data/LICENSE-LGPL +481 -0
- data/LICENSE-MIT +21 -0
- data/README.md +75 -24
- data/Rakefile +142 -32
- data/doc/Interface.html +53 -32
- data/doc/Interface.rd +51 -30
- data/ext/shapelib_ext/extconf.rb +5 -1
- data/ext/shapelib_ext/main.c +37 -0
- data/ext/shapelib_ext/sfcode.h +67 -39
- data/ext/shapelib_ext/sflist.h +18 -18
- data/ext/shapelib_ext/shpplus.c +245 -57
- data/ext/shapelib_ext/shpplus.h +1 -0
- data/ext/shapelib_ext/spcode.h +245 -126
- data/ext/shapelib_ext/splist.h +23 -41
- data/ext/shapelib_ext/spwkt.h +29 -24
- data/ext/shapelib_ext/valconv.h +33 -21
- data/lib/shapelib/shape.rb +8 -1
- data/lib/shapelib/version.rb +4 -2
- data/lib/shapelib.rb +2 -1
- data/shapelib.gemspec +58 -0
- data/test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.dbf +0 -0
- data/test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.prj +1 -0
- data/test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.shp +0 -0
- data/test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.shp.xml +3 -0
- data/test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.shx +0 -0
- data/test/test_zillow_data.rb +2233 -0
- metadata +70 -65
- data/test/libtest.rb +0 -80
- data/test/zsample1.rb +0 -168
- data/test/ztest1.rb +0 -253
data/ext/shapelib_ext/splist.h
CHANGED
|
@@ -21,51 +21,33 @@ static VALUE sp_to_h(VALUE obj)
|
|
|
21
21
|
return h;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
static VALUE sp_inspect(VALUE obj)
|
|
25
|
-
{
|
|
26
|
-
VALUE tos;
|
|
27
|
-
static ID inspect = 0;
|
|
28
|
-
static ID id_plus, id_class, id_to_s;
|
|
29
|
-
static VALUE classnm;
|
|
30
|
-
if (inspect == 0) {
|
|
31
|
-
inspect = rb_intern("inspect");
|
|
32
|
-
id_plus = rb_intern("+");
|
|
33
|
-
id_class = rb_intern("class");
|
|
34
|
-
id_to_s = rb_intern("to_s");
|
|
35
|
-
}
|
|
36
|
-
classnm = rb_funcall(rb_funcall(obj, id_class, 0), id_to_s, 0);
|
|
37
|
-
tos = rb_funcall(sp_to_h(obj), inspect, 0);
|
|
38
|
-
return rb_funcall(classnm, id_plus, 1, tos);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
24
|
static method_table_entry sp_methods[] = {
|
|
42
|
-
{ "[]", sp_field_get, 1 },
|
|
43
|
-
{ "[]=", sp_field_set, 2 },
|
|
44
|
-
{ "
|
|
45
|
-
{ "
|
|
46
|
-
{ "
|
|
47
|
-
{ "
|
|
48
|
-
{ "
|
|
49
|
-
{ "
|
|
50
|
-
{ "
|
|
51
|
-
{ "
|
|
52
|
-
{ "
|
|
53
|
-
{ "
|
|
54
|
-
{ "
|
|
55
|
-
{ "
|
|
56
|
-
{ "
|
|
57
|
-
{ "
|
|
58
|
-
{ "
|
|
59
|
-
{ "
|
|
60
|
-
{ "zvals", sp_zvals, 0 },
|
|
25
|
+
{ "[]", RUBY_METHOD_FUNC(sp_field_get), 1 },
|
|
26
|
+
{ "[]=", RUBY_METHOD_FUNC(sp_field_set), 2 },
|
|
27
|
+
{ "maxbound", RUBY_METHOD_FUNC(sp_maxbound), 0 },
|
|
28
|
+
{ "minbound", RUBY_METHOD_FUNC(sp_minbound), 0 },
|
|
29
|
+
{ "mvals", RUBY_METHOD_FUNC(sp_mvals), 0 },
|
|
30
|
+
{ "n_parts", RUBY_METHOD_FUNC(sp_n_parts), 0 },
|
|
31
|
+
{ "n_vertices", RUBY_METHOD_FUNC(sp_n_vertices), 0 },
|
|
32
|
+
{ "part_start", RUBY_METHOD_FUNC(sp_part_start), 0 },
|
|
33
|
+
{ "part_type", RUBY_METHOD_FUNC(sp_part_type), 0 },
|
|
34
|
+
{ "shape_type", RUBY_METHOD_FUNC(sp_shape_type), 0 },
|
|
35
|
+
{ "shape_id", RUBY_METHOD_FUNC(sp_shape_id), 0 },
|
|
36
|
+
{ "to_h", RUBY_METHOD_FUNC(sp_to_h), 0 },
|
|
37
|
+
{ "to_s", RUBY_METHOD_FUNC(sp_wkt), 0 },
|
|
38
|
+
{ "rewind_polygon", RUBY_METHOD_FUNC(sp_rewind), 0 },
|
|
39
|
+
{ "wkt", RUBY_METHOD_FUNC(sp_wkt), 0 },
|
|
40
|
+
{ "xvals", RUBY_METHOD_FUNC(sp_xvals), 0 },
|
|
41
|
+
{ "yvals", RUBY_METHOD_FUNC(sp_yvals), 0 },
|
|
42
|
+
{ "zvals", RUBY_METHOD_FUNC(sp_zvals), 0 },
|
|
61
43
|
{ NULL, NULL, 0 }
|
|
62
44
|
};
|
|
63
45
|
|
|
64
46
|
static method_table_entry pt_methods[] = {
|
|
65
|
-
{ "m", pt_m, 0 },
|
|
66
|
-
{ "wkt", pt_wkt, 0 },
|
|
67
|
-
{ "x", pt_x, 0 },
|
|
68
|
-
{ "y", pt_y, 0 },
|
|
69
|
-
{ "z", pt_z, 0 },
|
|
47
|
+
{ "m", RUBY_METHOD_FUNC(pt_m), 0 },
|
|
48
|
+
{ "wkt", RUBY_METHOD_FUNC(pt_wkt), 0 },
|
|
49
|
+
{ "x", RUBY_METHOD_FUNC(pt_x), 0 },
|
|
50
|
+
{ "y", RUBY_METHOD_FUNC(pt_y), 0 },
|
|
51
|
+
{ "z", RUBY_METHOD_FUNC(pt_z), 0 },
|
|
70
52
|
{ NULL, NULL, 0 }
|
|
71
53
|
};
|
data/ext/shapelib_ext/spwkt.h
CHANGED
|
@@ -27,10 +27,11 @@ static VALUE pt_wkt(VALUE obj)
|
|
|
27
27
|
shape_t *self;
|
|
28
28
|
size_t buflen;
|
|
29
29
|
char *buf, *cur, *stop;
|
|
30
|
-
VALUE wkt;
|
|
31
|
-
|
|
30
|
+
VALUE wkt, storage = 0;
|
|
31
|
+
TypedData_Get_Struct(obj, shape_t, &shape_data_type, self);
|
|
32
|
+
CheckPointVertices(self->obj);
|
|
32
33
|
buflen = wkt_dlen * 2 + 9;
|
|
33
|
-
cur = buf =
|
|
34
|
+
cur = buf = ALLOCV_N(char, storage, buflen + 1);
|
|
34
35
|
stop = buf + buflen;
|
|
35
36
|
strcpy(cur, "POINT(");
|
|
36
37
|
cur = DblFmtCat(cur, self->obj->padfX[0], stop);
|
|
@@ -38,20 +39,20 @@ static VALUE pt_wkt(VALUE obj)
|
|
|
38
39
|
cur = DblFmtCat(cur, self->obj->padfY[0], stop);
|
|
39
40
|
cur = StringCat(cur, ")", stop);
|
|
40
41
|
wkt = rb_str_new(buf, strlen(buf));
|
|
41
|
-
|
|
42
|
+
ALLOCV_END(storage);
|
|
42
43
|
return wkt;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
static VALUE mp_wkt(VALUE obj)
|
|
46
47
|
{
|
|
47
48
|
shape_t *self;
|
|
48
|
-
VALUE wkt;
|
|
49
|
+
VALUE wkt, storage = 0;
|
|
49
50
|
size_t buflen;
|
|
50
51
|
char *buf, *cur, *stop;
|
|
51
52
|
int iv;
|
|
52
|
-
|
|
53
|
-
buflen = (2 * wkt_dlen + 3) * self->obj->nVertices +
|
|
54
|
-
cur = buf =
|
|
53
|
+
TypedData_Get_Struct(obj, shape_t, &shape_data_type, self);
|
|
54
|
+
buflen = (2 * (size_t)wkt_dlen + 3) * self->obj->nVertices + 12;
|
|
55
|
+
cur = buf = ALLOCV_N(char, storage, buflen + 1);
|
|
55
56
|
stop = buf + buflen;
|
|
56
57
|
strcpy(buf, "MULTIPOINT(");
|
|
57
58
|
for (iv = 0; iv < self->obj->nVertices; iv++) {
|
|
@@ -63,18 +64,19 @@ static VALUE mp_wkt(VALUE obj)
|
|
|
63
64
|
}
|
|
64
65
|
StringCat(cur, ")", stop);
|
|
65
66
|
wkt = rb_str_new(buf, strlen(buf));
|
|
66
|
-
|
|
67
|
+
ALLOCV_END(storage);
|
|
67
68
|
return wkt;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
static VALUE WKTSinglePolygon(SHPObject *obj)
|
|
71
72
|
{
|
|
72
73
|
size_t buflen;
|
|
73
|
-
VALUE wkt;
|
|
74
|
+
VALUE wkt, storage = 0;
|
|
74
75
|
char *buf, *cur, *stop;
|
|
75
76
|
int ipart, endvert, ivert;
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
CheckPartStarts(obj);
|
|
78
|
+
buflen = (2 * (size_t)wkt_dlen + 3) * obj->nVertices + (size_t)obj->nParts * 4 + 9;
|
|
79
|
+
cur = buf = ALLOCV_N(char, storage, buflen + 1);
|
|
78
80
|
stop = cur + buflen;
|
|
79
81
|
strcpy(buf, "POLYGON(");
|
|
80
82
|
for (ipart = 0; ipart < obj->nParts; ipart++) {
|
|
@@ -97,14 +99,14 @@ static VALUE WKTSinglePolygon(SHPObject *obj)
|
|
|
97
99
|
}
|
|
98
100
|
cur = StringCat(cur, ")", stop);
|
|
99
101
|
wkt = rb_str_new(buf, strlen(buf));
|
|
100
|
-
|
|
102
|
+
ALLOCV_END(storage);
|
|
101
103
|
return wkt;
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
static VALUE pl_wkt(VALUE obj)
|
|
105
107
|
{
|
|
106
108
|
shape_t *self;
|
|
107
|
-
|
|
109
|
+
TypedData_Get_Struct(obj, shape_t, &shape_data_type, self);
|
|
108
110
|
/* === BUG ===
|
|
109
111
|
* following code doesn't consider the possibilities:
|
|
110
112
|
* - there may be multiple outer loop in a Polygon Shape.
|
|
@@ -120,11 +122,13 @@ static VALUE pl_wkt(VALUE obj)
|
|
|
120
122
|
static VALUE WKTSingleArc(SHPObject *obj)
|
|
121
123
|
{
|
|
122
124
|
size_t buflen;
|
|
123
|
-
VALUE wkt;
|
|
125
|
+
VALUE wkt, storage = 0;
|
|
124
126
|
char *buf, *cur, *stop;
|
|
125
127
|
int ivert;
|
|
128
|
+
if (obj->nVertices < 1)
|
|
129
|
+
rb_raise(rb_eArgError, "cannot format an empty line");
|
|
126
130
|
buflen = (2 * wkt_dlen + 3) * obj->nVertices + 10;
|
|
127
|
-
cur = buf =
|
|
131
|
+
cur = buf = ALLOCV_N(char, storage, buflen + 1);
|
|
128
132
|
stop = cur + buflen;
|
|
129
133
|
strcpy(buf, "LINESTRING(");
|
|
130
134
|
for (ivert = 0; ivert < obj->nVertices; ivert++) {
|
|
@@ -136,18 +140,19 @@ static VALUE WKTSingleArc(SHPObject *obj)
|
|
|
136
140
|
}
|
|
137
141
|
cur = StringCat(cur, ")", stop);
|
|
138
142
|
wkt = rb_str_new(buf, strlen(buf));
|
|
139
|
-
|
|
143
|
+
ALLOCV_END(storage);
|
|
140
144
|
return wkt;
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
static VALUE WKTMultiArc(SHPObject *obj)
|
|
144
148
|
{
|
|
145
149
|
size_t buflen;
|
|
146
|
-
VALUE wkt;
|
|
150
|
+
VALUE wkt, storage = 0;
|
|
147
151
|
char *buf, *cur, *stop;
|
|
148
152
|
int ipart, endvert, ivert;
|
|
149
|
-
|
|
150
|
-
|
|
153
|
+
CheckPartStarts(obj);
|
|
154
|
+
buflen = (2 * (size_t)wkt_dlen + 3) * obj->nVertices + (size_t)obj->nParts * 4 + 16;
|
|
155
|
+
cur = buf = ALLOCV_N(char, storage, buflen + 1);
|
|
151
156
|
stop = cur + buflen;
|
|
152
157
|
strcpy(buf, "MULTILINESTRING(");
|
|
153
158
|
for (ipart = 0; ipart < obj->nParts; ipart++) {
|
|
@@ -170,14 +175,14 @@ static VALUE WKTMultiArc(SHPObject *obj)
|
|
|
170
175
|
}
|
|
171
176
|
cur = StringCat(cur, ")", stop);
|
|
172
177
|
wkt = rb_str_new(buf, strlen(buf));
|
|
173
|
-
|
|
178
|
+
ALLOCV_END(storage);
|
|
174
179
|
return wkt;
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
static VALUE arc_wkt(VALUE obj)
|
|
178
183
|
{
|
|
179
184
|
shape_t *self;
|
|
180
|
-
|
|
185
|
+
TypedData_Get_Struct(obj, shape_t, &shape_data_type, self);
|
|
181
186
|
if (self->obj->nParts > 1) {
|
|
182
187
|
return WKTMultiArc(self->obj);
|
|
183
188
|
} else {
|
|
@@ -188,7 +193,7 @@ static VALUE arc_wkt(VALUE obj)
|
|
|
188
193
|
static VALUE sp_wkt(VALUE obj)
|
|
189
194
|
{
|
|
190
195
|
shape_t *self;
|
|
191
|
-
|
|
196
|
+
TypedData_Get_Struct(obj, shape_t, &shape_data_type, self);
|
|
192
197
|
switch (self->obj->nSHPType) {
|
|
193
198
|
case SHPT_POINT:
|
|
194
199
|
case SHPT_POINTM:
|
|
@@ -214,6 +219,6 @@ static VALUE sp_wkt(VALUE obj)
|
|
|
214
219
|
return pl_wkt(obj);
|
|
215
220
|
break;
|
|
216
221
|
}
|
|
217
|
-
|
|
222
|
+
rb_raise(rb_eArgError, "unsupported WKT shape type %d", self->obj->nSHPType);
|
|
218
223
|
return Qnil;
|
|
219
224
|
}
|
data/ext/shapelib_ext/valconv.h
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* valconv.h */
|
|
2
2
|
|
|
3
|
-
#define
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
#define
|
|
3
|
+
#define SHP_NODATA_LIM -1.0e38
|
|
4
|
+
#define SHP_NODATA -2.0e38
|
|
5
|
+
/* Preserve null measures written by earlier versions of this gem. */
|
|
6
|
+
#define SHP_NODATA_LEGACY -2.0e-38
|
|
7
7
|
#define SHP_NUM2DBL(value) (NIL_P(value) ? SHP_NODATA : NUM2DBL(value))
|
|
8
|
-
#define SHP_FLOAT_NEW(f) (((f) < SHP_NODATA_LIM) ? Qnil : rb_float_new((f)))
|
|
8
|
+
#define SHP_FLOAT_NEW(f) (((f) < SHP_NODATA_LIM || (f) == SHP_NODATA_LEGACY) ? Qnil : rb_float_new((f)))
|
|
9
9
|
#define CSTR2SYM(s) (ID2SYM(rb_intern((s))))
|
|
10
10
|
static int NUM2INT_nil(VALUE v) { return NIL_P(v) ? -1 : NUM2INT(v); }
|
|
11
11
|
|
|
@@ -14,6 +14,9 @@ static const_table_entry sl_consts[] = {
|
|
|
14
14
|
{ "Integer", INT2FIX((int)FTInteger) },
|
|
15
15
|
{ "Float", INT2FIX((int)FTDouble) },
|
|
16
16
|
{ "Logical", INT2FIX((int)FTLogical) },
|
|
17
|
+
#ifdef HAVE_CONST_FTDATE
|
|
18
|
+
{ "Date", INT2FIX((int)FTDate) },
|
|
19
|
+
#endif
|
|
17
20
|
{ NULL, Qnil }
|
|
18
21
|
};
|
|
19
22
|
|
|
@@ -50,6 +53,9 @@ static ID *FieldTypeNameTable(void)
|
|
|
50
53
|
ids[FTInteger] = rb_intern("Integer");
|
|
51
54
|
ids[FTDouble] = rb_intern("Float");
|
|
52
55
|
ids[FTLogical] = rb_intern("Logical");
|
|
56
|
+
#ifdef HAVE_CONST_FTDATE
|
|
57
|
+
ids[FTDate] = rb_intern("Date");
|
|
58
|
+
#endif
|
|
53
59
|
ids[FTInvalid] = rb_intern("Invalid");
|
|
54
60
|
return ids;
|
|
55
61
|
}
|
|
@@ -84,13 +90,18 @@ static int Ruby2PartType(VALUE ptype)
|
|
|
84
90
|
if (ids[i] == given)
|
|
85
91
|
return i;
|
|
86
92
|
}
|
|
87
|
-
|
|
93
|
+
rb_raise(rb_eArgError, "invalid part type name");
|
|
88
94
|
break;
|
|
89
95
|
case T_FIXNUM:
|
|
90
|
-
|
|
96
|
+
i = FIX2INT(ptype);
|
|
97
|
+
break;
|
|
91
98
|
default:
|
|
92
|
-
|
|
99
|
+
i = NUM2INT(ptype);
|
|
100
|
+
break;
|
|
93
101
|
}
|
|
102
|
+
if (i < 0 || i > 5)
|
|
103
|
+
rb_raise(rb_eArgError, "invalid part_type %d", i);
|
|
104
|
+
return i;
|
|
94
105
|
}
|
|
95
106
|
|
|
96
107
|
static VALUE PartType2Ruby(int part_type)
|
|
@@ -113,6 +124,9 @@ static DBFFieldType Ruby2FieldType(VALUE obj)
|
|
|
113
124
|
case FTInteger:
|
|
114
125
|
case FTDouble:
|
|
115
126
|
case FTLogical:
|
|
127
|
+
#ifdef HAVE_CONST_FTDATE
|
|
128
|
+
case FTDate:
|
|
129
|
+
#endif
|
|
116
130
|
case FTInvalid:
|
|
117
131
|
return ft;
|
|
118
132
|
default:
|
|
@@ -135,7 +149,7 @@ static VALUE FieldType2Ruby(DBFFieldType ftype)
|
|
|
135
149
|
{
|
|
136
150
|
int ft;
|
|
137
151
|
ft = ftype;
|
|
138
|
-
if (ft < 0 || ft >= FTInvalid)
|
|
152
|
+
if (ft < 0 || ft >= FTInvalid || FieldTypeNameTable()[ft] == 0)
|
|
139
153
|
return INT2FIX(ft);
|
|
140
154
|
return ID2SYM(FieldTypeNameTable()[ft]);
|
|
141
155
|
}
|
|
@@ -252,8 +266,12 @@ static int ShapeSym_to_Int(VALUE stype)
|
|
|
252
266
|
static int Ruby2ShapeType(VALUE stype)
|
|
253
267
|
{
|
|
254
268
|
switch (TYPE(stype)) {
|
|
255
|
-
case T_FIXNUM:
|
|
256
|
-
|
|
269
|
+
case T_FIXNUM: {
|
|
270
|
+
int type = FIX2INT(stype);
|
|
271
|
+
if (type >= SHPT_NULL && type <= SHPT_MULTIPATCH && ShapeTypeNameTable()[type] != 0)
|
|
272
|
+
return type;
|
|
273
|
+
rb_raise(rb_eArgError, "invalid shape_type %d", type);
|
|
274
|
+
}
|
|
257
275
|
case T_CLASS:
|
|
258
276
|
return ShapeClass_to_Int(stype);
|
|
259
277
|
case T_STRING:
|
|
@@ -296,18 +314,12 @@ static VALUE IntUnpack(int *up, unsigned num)
|
|
|
296
314
|
static VALUE unpackfmt = 0;
|
|
297
315
|
VALUE buf;
|
|
298
316
|
if (unpackfmt == 0) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
317
|
+
unpackid = rb_intern("unpack");
|
|
318
|
+
/* Register first: registration can trigger GC. */
|
|
319
|
+
rb_global_variable(&unpackfmt);
|
|
320
|
+
unpackfmt = rb_str_new2("i*");
|
|
302
321
|
}
|
|
303
322
|
buf = rb_str_new((char *)up, sizeof(int) * num);
|
|
304
323
|
return rb_funcall(buf, unpackid, 1, unpackfmt);
|
|
305
324
|
}
|
|
306
325
|
|
|
307
|
-
static VALUE SecureObject(VALUE obj, const char *name) {
|
|
308
|
-
if (OBJ_TAINTED(obj) && rb_safe_level() >= 1) {
|
|
309
|
-
rb_raise(rb_eSecurityError, "tainted %s", name);
|
|
310
|
-
}
|
|
311
|
-
return obj;
|
|
312
|
-
}
|
|
313
|
-
|
data/lib/shapelib/shape.rb
CHANGED
|
@@ -7,7 +7,14 @@ module Shapelib
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def latlngs
|
|
10
|
-
@latlngs
|
|
10
|
+
return @latlngs if @latlngs
|
|
11
|
+
coordinates = yvals.zip(xvals)
|
|
12
|
+
@latlngs = coordinates unless frozen?
|
|
13
|
+
coordinates
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def inspect
|
|
17
|
+
self.class.to_s + self.to_h.inspect
|
|
11
18
|
end
|
|
12
19
|
end
|
|
13
20
|
end
|
data/lib/shapelib/version.rb
CHANGED
data/lib/shapelib.rb
CHANGED
data/shapelib.gemspec
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/shapelib/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |s|
|
|
6
|
+
s.name = 'shapelib'
|
|
7
|
+
s.version = Shapelib::VERSION
|
|
8
|
+
s.required_ruby_version = '>= 2.6'
|
|
9
|
+
s.licenses = ['MIT', 'LGPL-2.0-only', 'CC-BY-SA-3.0']
|
|
10
|
+
|
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
|
12
|
+
s.require_paths = ['lib']
|
|
13
|
+
s.authors = ['prasinos@users.sourceforge.net', 'Mike Mangino', 'Mike Perham', 'Nick Estes']
|
|
14
|
+
s.description = 'Simple wrapper around the shapelib library'
|
|
15
|
+
s.email = 'nick@nickstoys.com'
|
|
16
|
+
s.extensions = ['ext/shapelib_ext/extconf.rb']
|
|
17
|
+
s.extra_rdoc_files = [
|
|
18
|
+
'README.md'
|
|
19
|
+
]
|
|
20
|
+
s.files = [
|
|
21
|
+
'LICENSE',
|
|
22
|
+
'LICENSE-MIT',
|
|
23
|
+
'LICENSE-LGPL',
|
|
24
|
+
'LICENSE-CC-BY-SA-3.0',
|
|
25
|
+
'README.md',
|
|
26
|
+
'Rakefile',
|
|
27
|
+
'doc/Interface.html',
|
|
28
|
+
'doc/Interface.rd',
|
|
29
|
+
'doc/style.css',
|
|
30
|
+
'ext/shapelib_ext/depend',
|
|
31
|
+
'ext/shapelib_ext/extconf.rb',
|
|
32
|
+
'ext/shapelib_ext/main.c',
|
|
33
|
+
'ext/shapelib_ext/sfcode.h',
|
|
34
|
+
'ext/shapelib_ext/sflist.h',
|
|
35
|
+
'ext/shapelib_ext/shpplus.c',
|
|
36
|
+
'ext/shapelib_ext/shpplus.h',
|
|
37
|
+
'ext/shapelib_ext/spcode.h',
|
|
38
|
+
'ext/shapelib_ext/splist.h',
|
|
39
|
+
'ext/shapelib_ext/spwkt.h',
|
|
40
|
+
'ext/shapelib_ext/valconv.h',
|
|
41
|
+
'lib/shapelib.rb',
|
|
42
|
+
'lib/shapelib/shape.rb',
|
|
43
|
+
'lib/shapelib/version.rb',
|
|
44
|
+
'shapelib.gemspec',
|
|
45
|
+
'test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.dbf',
|
|
46
|
+
'test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.prj',
|
|
47
|
+
'test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.shp',
|
|
48
|
+
'test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.shp.xml',
|
|
49
|
+
'test/data/ZillowNeighborhoods-CA/ZillowNeighborhoods-CA.shx',
|
|
50
|
+
'test/test_zillow_data.rb'
|
|
51
|
+
]
|
|
52
|
+
s.homepage = 'https://github.com/gravatite/shapelib'
|
|
53
|
+
s.summary = 'Simple wrapper around the shapelib library'
|
|
54
|
+
|
|
55
|
+
s.add_development_dependency 'rake', '>= 13.0'
|
|
56
|
+
s.add_development_dependency 'test-unit', '>= 3.0'
|
|
57
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
|
58
|
+
end
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!--<!DOCTYPE metadata SYSTEM "http://www.esri.com/metadata/esriprof80.dtd">-->
|
|
3
|
+
<metadata xml:lang="en"><Esri><MetaID>{63D678E6-82E9-4F47-A156-84E301C42FEF}</MetaID><CreaDate>20071221</CreaDate><CreaTime>17373300</CreaTime><SyncOnce>FALSE</SyncOnce><SyncDate>20071221</SyncDate><SyncTime>17373300</SyncTime><ModDate>20071221</ModDate><ModTime>17373300</ModTime></Esri><idinfo><native Sync="TRUE">Microsoft Windows XP Version 5.1 (Build 2600) Service Pack 2; ESRI ArcCatalog 9.2.0.1324</native><descript><langdata Sync="TRUE">en</langdata><abstract>Neighborhood boundaries for large cities in California. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License. You are free to Share - to copy, distribute and transmit the work. You are free to adapt the work. You must attribute the work in the manner specified by the author or licensor. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. http://creativecommons.org/licenses/by-sa/3.0</abstract><purpose>Displaying neighborhoods. Organizing and aggregating geographic and point level data based on neighborhoods.</purpose></descript><citation><citeinfo><origin>Zillow.com compiled this data with the help of municipalities throughout the US.</origin><pubdate>20071001</pubdate><title Sync="FALSE">Neighborhood Boundaries in California</title><geoform Sync="TRUE">vector digital data</geoform><onlink Sync="FALSE">http://www.zillow.com/</onlink></citeinfo></citation><timeperd><current>Current as of 2007</current><timeinfo><sngdate><caldate>2007</caldate></sngdate></timeinfo></timeperd><status><progress>More neighborhoods will continue to be added to this data set.</progress><update>Roughly once per quarter.</update></status><spdom><bounding><westbc Sync="TRUE">-122.514493</westbc><eastbc Sync="TRUE">-116.908818</eastbc><northbc Sync="TRUE">38.685285</northbc><southbc Sync="TRUE">32.534855</southbc></bounding><lboundng><leftbc Sync="TRUE">-122.514493</leftbc><rightbc Sync="TRUE">-116.908818</rightbc><bottombc Sync="TRUE">32.534855</bottombc><topbc Sync="TRUE">38.685285</topbc></lboundng></spdom><keywords><theme><themekt>None</themekt><themekey>shape</themekey><themekey>neighborhood</themekey><themekey>polygon</themekey><themekey>boundaries</themekey></theme><place><placekt>None</placekt><placekey>United States</placekey><placekey>California</placekey><placekey>Neighborhoods</placekey></place></keywords><accconst><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/" rel="dc:type">work</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 License</a>. http://creativecommons.org/licenses/by-sa/3.0</accconst><useconst><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This <span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/" rel="dc:type">work</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 License</a>. http://creativecommons.org/licenses/by-sa/3.0</useconst><natvform Sync="TRUE">Shapefile</natvform></idinfo><dataIdInfo><envirDesc Sync="TRUE">Microsoft Windows XP Version 5.1 (Build 2600) Service Pack 2; ESRI ArcCatalog 9.2.0.1324</envirDesc><dataLang><languageCode Sync="TRUE" value="en"></languageCode></dataLang><idCitation><resTitle Sync="TRUE">ZillowNeighborhoods-CA</resTitle><presForm><PresFormCd Sync="TRUE" value="005"></PresFormCd></presForm></idCitation><spatRpType><SpatRepTypCd Sync="TRUE" value="001"></SpatRepTypCd></spatRpType><dataExt><geoEle><GeoBndBox esriExtentType="native"><westBL Sync="TRUE">-122.514493</westBL><eastBL Sync="TRUE">-116.908818</eastBL><northBL Sync="TRUE">38.685285</northBL><southBL Sync="TRUE">32.534855</southBL><exTypeCode Sync="TRUE">1</exTypeCode></GeoBndBox></geoEle></dataExt><geoBox esriExtentType="decdegrees"><westBL Sync="TRUE">-122.514493</westBL><eastBL Sync="TRUE">-116.908818</eastBL><northBL Sync="TRUE">38.685285</northBL><southBL Sync="TRUE">32.534855</southBL><exTypeCode Sync="TRUE">1</exTypeCode></geoBox></dataIdInfo><metainfo><langmeta Sync="TRUE">en</langmeta><metstdn Sync="TRUE">FGDC Content Standards for Digital Geospatial Metadata</metstdn><metstdv Sync="TRUE">FGDC-STD-001-1998</metstdv><mettc Sync="TRUE">local time</mettc><metextns><onlink Sync="TRUE">http://www.esri.com/metadata/esriprof80.html</onlink><metprof Sync="TRUE">ESRI Metadata Profile</metprof></metextns><metc><cntinfo><cntorgp><cntper>Tommy Unger</cntper><cntorg>Zillow.com</cntorg></cntorgp><cntaddr><addrtype>999 Third AVE, Suite 4600</addrtype><city>Seattle</city><state>WA</state><postal>98104</postal></cntaddr><cntvoice>206-470-7000</cntvoice></cntinfo></metc><metd Sync="TRUE">20071221</metd></metainfo><mdLang><languageCode Sync="TRUE" value="en"></languageCode></mdLang><mdStanName Sync="TRUE">ISO 19115 Geographic Information - Metadata</mdStanName><mdStanVer Sync="TRUE">DIS_ESRI1.0</mdStanVer><mdChar><CharSetCd Sync="TRUE" value="004"></CharSetCd></mdChar><mdHrLv><ScopeCd Sync="TRUE" value="005"></ScopeCd></mdHrLv><mdHrLvName Sync="TRUE">dataset</mdHrLvName><distinfo><resdesc Sync="TRUE">Downloadable Data</resdesc><stdorder><digform><digtinfo><transize Sync="TRUE">1.537</transize><dssize Sync="TRUE">1.537</dssize></digtinfo></digform></stdorder></distinfo><distInfo><distributor><distorTran><transSize Sync="TRUE">1.537</transSize></distorTran><distorFormat><formatName Sync="TRUE">Shapefile</formatName></distorFormat></distributor></distInfo><spdoinfo><direct Sync="TRUE">Vector</direct><ptvctinf><esriterm Name="ZillowNeighborhoods-CA"><efeatyp Sync="TRUE">Simple</efeatyp><efeageom Sync="TRUE">Polygon</efeageom><esritopo Sync="TRUE">FALSE</esritopo><efeacnt Sync="TRUE">948</efeacnt><spindex Sync="TRUE">FALSE</spindex><linrefer Sync="TRUE">FALSE</linrefer></esriterm><sdtsterm Name="ZillowNeighborhoods-CA"><sdtstype Sync="TRUE">G-polygon</sdtstype><ptvctcnt Sync="TRUE">948</ptvctcnt></sdtsterm></ptvctinf></spdoinfo><spref><horizsys><cordsysn><geogcsn Sync="TRUE">GCS_North_American_1983</geogcsn></cordsysn><geograph><geogunit Sync="TRUE">Decimal degrees</geogunit><latres Sync="TRUE">0.000000</latres><longres Sync="TRUE">0.000000</longres></geograph><geodetic><horizdn Sync="TRUE">North American Datum of 1983</horizdn><ellips Sync="TRUE">Geodetic Reference System 80</ellips><semiaxis Sync="TRUE">6378137.000000</semiaxis><denflat Sync="TRUE">298.257222</denflat></geodetic></horizsys></spref><refSysInfo><RefSystem><refSysID><identCode Sync="TRUE">GCS_North_American_1983</identCode></refSysID></RefSystem></refSysInfo><spatRepInfo><VectSpatRep><topLvl><TopoLevCd Sync="TRUE" value="001"></TopoLevCd></topLvl><geometObjs Name="ZillowNeighborhoods-CA"><geoObjTyp><GeoObjTypCd Sync="TRUE" value="001"></GeoObjTypCd></geoObjTyp><geoObjCnt Sync="TRUE">948</geoObjCnt></geometObjs></VectSpatRep></spatRepInfo><eainfo><detailed Name="ZillowNeighborhoods-CA"><enttyp><enttypl Sync="TRUE">ZillowNeighborhoods-CA</enttypl><enttypt Sync="TRUE">Feature Class</enttypt><enttypc Sync="TRUE">948</enttypc></enttyp><attr><attrlabl Sync="TRUE">FID</attrlabl><attalias Sync="TRUE">FID</attalias><attrtype Sync="TRUE">OID</attrtype><attwidth Sync="TRUE">4</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Internal feature number.</attrdef><attrdefs Sync="TRUE">ESRI</attrdefs><attrdomv><udom Sync="TRUE">Sequential unique whole numbers that are automatically generated.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">Shape</attrlabl><attalias Sync="TRUE">Shape</attalias><attrtype Sync="TRUE">Geometry</attrtype><attwidth Sync="TRUE">0</attwidth><atprecis Sync="TRUE">0</atprecis><attscale Sync="TRUE">0</attscale><attrdef Sync="TRUE">Feature geometry.</attrdef><attrdefs Sync="TRUE">ESRI</attrdefs><attrdomv><udom Sync="TRUE">Coordinates defining the features.</udom></attrdomv></attr><attr><attrlabl Sync="TRUE">STATE</attrlabl><attalias Sync="TRUE">STATE</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">2</attwidth></attr><attr><attrlabl Sync="TRUE">COUNTY</attrlabl><attalias Sync="TRUE">COUNTY</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">43</attwidth></attr><attr><attrlabl Sync="TRUE">CITY</attrlabl><attalias Sync="TRUE">CITY</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">64</attwidth></attr><attr><attrlabl Sync="TRUE">NAME</attrlabl><attalias Sync="TRUE">NAME</attalias><attrtype Sync="TRUE">String</attrtype><attwidth Sync="TRUE">64</attwidth></attr><attr><attrlabl Sync="TRUE">REGIONID</attrlabl><attalias Sync="TRUE">REGIONID</attalias><attrtype Sync="TRUE">Number</attrtype><attwidth Sync="TRUE">32</attwidth><atnumdec Sync="TRUE">10</atnumdec></attr></detailed></eainfo><mdDateSt Sync="TRUE">20071221</mdDateSt></metadata>
|
|
Binary file
|