rgeo-activerecord 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +10 -0
- data/README.md +6 -6
- data/lib/rgeo-activerecord.rb +2 -0
- data/lib/rgeo/active_record.rb +2 -0
- data/lib/rgeo/active_record/arel_spatial_queries.rb +2 -0
- data/lib/rgeo/active_record/common_adapter_elements.rb +2 -0
- data/lib/rgeo/active_record/geometry_mixin.rb +67 -8
- data/lib/rgeo/active_record/spatial_expressions.rb +2 -0
- data/lib/rgeo/active_record/spatial_factory_store.rb +2 -0
- data/lib/rgeo/active_record/version.rb +3 -1
- metadata +38 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10cec86fb0fe82c2495de189762e89b07e8cb7128d778ba41c882d7d7954dece
|
4
|
+
data.tar.gz: 8c2f7e726217eb8d4261b2b25427b789701d10552a23b0bd00d7cb5fb3ec0c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d49c78a9f23c7d30625bb9114c7a25e7248aa9376f4f309097556fcc8f29f35466b00f9f132b9868b5f7c3c99779e7292151ae984fdecf71e940b8d137734160
|
7
|
+
data.tar.gz: 02f84c73e57d1e179b5f7aed60e0f18e6ccb743ad123e5f929c1d312d9ad00bf4e65c1aed2535cd0530b30cf914290d27d318e1174ba329d5c5905ec2cf89848
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -28,13 +28,13 @@ Gemfile:
|
|
28
28
|
```ruby
|
29
29
|
gem 'rgeo-activerecord'
|
30
30
|
```
|
31
|
+
Version `6.1` supports ActiveRecord 5.0, 5.1, and 5.2 with `rgeo` 1.0+.
|
31
32
|
|
32
|
-
`
|
33
|
+
Version `6.0` supports ActiveRecord 5.0, 5.1, and 5.2 with `rgeo` 1.x.
|
33
34
|
|
34
|
-
|
35
|
-
* rgeo 0.3.20 or later.
|
35
|
+
Version `5.0` supports ActiveRecord 5.0 and 5.1, with `rgeo` 0.6.
|
36
36
|
|
37
|
-
|
37
|
+
Version `4.0` supports ActiveRecord 4.2.
|
38
38
|
|
39
39
|
Version `1.1.0` supports ActiveRecord 4.0 and 4.1
|
40
40
|
|
@@ -60,7 +60,7 @@ The supported keys when registering a spatial type are listed here with their de
|
|
60
60
|
and other allowed values:
|
61
61
|
|
62
62
|
```
|
63
|
-
geo_type: "geometry", # point, polygon, line_string, geometry_collection,
|
63
|
+
geo_type: "geometry", # point, polygon, line_string, geometry_collection,
|
64
64
|
# multi_line_string, multi_point, multi_polygon
|
65
65
|
has_m: false, # true
|
66
66
|
has_z: false, # true
|
@@ -68,7 +68,7 @@ sql_type: "geometry", # geography
|
|
68
68
|
srid: 0, # (any valid SRID)
|
69
69
|
```
|
70
70
|
|
71
|
-
The default factories are `RGeo::Geographic.spherical_factory` for
|
71
|
+
The default factories are `RGeo::Geographic.spherical_factory` for
|
72
72
|
geographic types, and `RGeo::Cartesian.preferred_factory` for geometric types.
|
73
73
|
|
74
74
|
Here is an example setup:
|
data/lib/rgeo-activerecord.rb
CHANGED
data/lib/rgeo/active_record.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RGeo
|
2
4
|
module ActiveRecord
|
3
5
|
# This module is mixed into all geometry objects. It provides an
|
@@ -29,11 +31,7 @@ module RGeo
|
|
29
31
|
require "rgeo/geo_json"
|
30
32
|
value = proc { |geom| GeoJSON.encode(geom) }
|
31
33
|
end
|
32
|
-
|
33
|
-
@json_generator = value
|
34
|
-
else
|
35
|
-
@json_generator = DEFAULT_JSON_GENERATOR
|
36
|
-
end
|
34
|
+
@json_generator = value.is_a?(Proc) ? value : DEFAULT_JSON_GENERATOR
|
37
35
|
end
|
38
36
|
|
39
37
|
# Given a feature, returns an object that can be serialized as JSON
|
@@ -51,8 +49,69 @@ module RGeo
|
|
51
49
|
GeometryMixin.generate_json(self)
|
52
50
|
end
|
53
51
|
end
|
52
|
+
|
53
|
+
# include this module in every RGeo feature type
|
54
|
+
[
|
55
|
+
Geographic::ProjectedGeometryCollectionImpl,
|
56
|
+
Geographic::ProjectedLinearRingImpl,
|
57
|
+
Geographic::ProjectedLineImpl,
|
58
|
+
Geographic::ProjectedLineStringImpl,
|
59
|
+
Geographic::ProjectedMultiLineStringImpl,
|
60
|
+
Geographic::ProjectedMultiPointImpl,
|
61
|
+
Geographic::ProjectedMultiPolygonImpl,
|
62
|
+
Geographic::ProjectedPointImpl,
|
63
|
+
Geographic::ProjectedPolygonImpl,
|
64
|
+
|
65
|
+
Geographic::SphericalGeometryCollectionImpl,
|
66
|
+
Geographic::SphericalLinearRingImpl,
|
67
|
+
Geographic::SphericalLineImpl,
|
68
|
+
Geographic::SphericalLineStringImpl,
|
69
|
+
Geographic::SphericalMultiLineStringImpl,
|
70
|
+
Geographic::SphericalMultiPointImpl,
|
71
|
+
Geographic::SphericalMultiPolygonImpl,
|
72
|
+
Geographic::SphericalPointImpl,
|
73
|
+
Geographic::SphericalPolygonImpl,
|
74
|
+
|
75
|
+
Geos::ZMGeometryCollectionImpl,
|
76
|
+
Geos::ZMGeometryImpl,
|
77
|
+
Geos::ZMLinearRingImpl,
|
78
|
+
Geos::ZMLineImpl,
|
79
|
+
Geos::ZMLineStringImpl,
|
80
|
+
Geos::ZMMultiLineStringImpl,
|
81
|
+
Geos::ZMMultiPointImpl,
|
82
|
+
Geos::ZMMultiPolygonImpl,
|
83
|
+
Geos::ZMPointImpl,
|
84
|
+
Geos::ZMPolygonImpl,
|
85
|
+
].each { |klass| klass.include(GeometryMixin) }
|
86
|
+
|
87
|
+
if RGeo::Geos.capi_supported?
|
88
|
+
[
|
89
|
+
Geos::CAPIGeometryCollectionImpl,
|
90
|
+
Geos::CAPIGeometryImpl,
|
91
|
+
Geos::CAPILinearRingImpl,
|
92
|
+
Geos::CAPILineImpl,
|
93
|
+
Geos::CAPILineStringImpl,
|
94
|
+
Geos::CAPIMultiLineStringImpl,
|
95
|
+
Geos::CAPIMultiPointImpl,
|
96
|
+
Geos::CAPIMultiPolygonImpl,
|
97
|
+
Geos::CAPIPointImpl,
|
98
|
+
Geos::CAPIPolygonImpl,
|
99
|
+
].each { |klass| klass.include(GeometryMixin) }
|
100
|
+
end
|
101
|
+
|
102
|
+
if RGeo::Geos.ffi_supported?
|
103
|
+
[
|
104
|
+
Geos::FFIGeometryCollectionImpl,
|
105
|
+
Geos::FFIGeometryImpl,
|
106
|
+
Geos::FFILinearRingImpl,
|
107
|
+
Geos::FFILineImpl,
|
108
|
+
Geos::FFILineStringImpl,
|
109
|
+
Geos::FFIMultiLineStringImpl,
|
110
|
+
Geos::FFIMultiPointImpl,
|
111
|
+
Geos::FFIMultiPolygonImpl,
|
112
|
+
Geos::FFIPointImpl,
|
113
|
+
Geos::FFIPolygonImpl,
|
114
|
+
].each { |klass| klass.include(GeometryMixin) }
|
115
|
+
end
|
54
116
|
end
|
55
117
|
end
|
56
|
-
|
57
|
-
RGeo::Feature::MixinCollection::GLOBAL.for_type(RGeo::Feature::Geometry)
|
58
|
-
.add(RGeo::ActiveRecord::GeometryMixin)
|
metadata
CHANGED
@@ -1,71 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgeo-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma, Tee Parham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rgeo
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: appraisal
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
37
44
|
requirements:
|
38
45
|
- - "~>"
|
39
46
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
47
|
+
version: '2.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
56
|
+
name: ffi-geos
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
61
|
+
version: '1.2'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
68
|
+
version: '1.2'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
70
|
+
name: minitest
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
75
|
+
version: '5.8'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
82
|
+
version: '5.8'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: mocha
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,33 +95,33 @@ dependencies:
|
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '1.1'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: rake
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
103
|
+
version: '12.0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
110
|
+
version: '12.0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rgeo-geojson
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- - "
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
117
|
+
version: 1.0.0
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- - "
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
124
|
+
version: 1.0.0
|
111
125
|
description: RGeo is a geospatial data library for Ruby. RGeo::ActiveRecord is an
|
112
126
|
optional RGeo module providing some spatial extensions to ActiveRecord, as well
|
113
127
|
as common tools used by RGeo-based spatial adapters.
|
@@ -138,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
152
|
requirements:
|
139
153
|
- - ">="
|
140
154
|
- !ruby/object:Gem::Version
|
141
|
-
version: 2.
|
155
|
+
version: 2.3.0
|
142
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
157
|
requirements:
|
144
158
|
- - ">="
|
@@ -146,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
160
|
version: '0'
|
147
161
|
requirements: []
|
148
162
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.7.
|
163
|
+
rubygems_version: 2.7.8
|
150
164
|
signing_key:
|
151
165
|
specification_version: 4
|
152
166
|
summary: An RGeo module providing spatial extensions to ActiveRecord.
|