rgeo 2.3.1 → 3.0.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +6 -0
- data/README.md +11 -10
- data/ext/geos_c_impl/analysis.c +8 -6
- data/ext/geos_c_impl/analysis.h +1 -3
- data/ext/geos_c_impl/errors.c +10 -8
- data/ext/geos_c_impl/errors.h +7 -3
- data/ext/geos_c_impl/extconf.rb +3 -0
- data/ext/geos_c_impl/factory.c +273 -202
- data/ext/geos_c_impl/factory.h +51 -63
- data/ext/geos_c_impl/geometry.c +124 -22
- data/ext/geos_c_impl/geometry.h +8 -3
- data/ext/geos_c_impl/geometry_collection.c +81 -185
- data/ext/geos_c_impl/geometry_collection.h +1 -14
- data/ext/geos_c_impl/globals.c +91 -0
- data/ext/geos_c_impl/globals.h +45 -0
- data/ext/geos_c_impl/line_string.c +28 -29
- data/ext/geos_c_impl/line_string.h +1 -3
- data/ext/geos_c_impl/main.c +10 -9
- data/ext/geos_c_impl/point.c +9 -8
- data/ext/geos_c_impl/point.h +1 -3
- data/ext/geos_c_impl/polygon.c +43 -72
- data/ext/geos_c_impl/polygon.h +1 -3
- data/ext/geos_c_impl/preface.h +12 -0
- data/ext/geos_c_impl/ruby_more.c +65 -0
- data/ext/geos_c_impl/ruby_more.h +16 -0
- data/lib/rgeo/cartesian/calculations.rb +54 -17
- data/lib/rgeo/cartesian/factory.rb +6 -14
- data/lib/rgeo/cartesian/feature_classes.rb +68 -46
- data/lib/rgeo/cartesian/feature_methods.rb +67 -20
- data/lib/rgeo/cartesian/interface.rb +0 -36
- data/lib/rgeo/cartesian/planar_graph.rb +379 -0
- data/lib/rgeo/cartesian/sweepline_intersector.rb +149 -0
- data/lib/rgeo/cartesian/valid_op.rb +71 -0
- data/lib/rgeo/cartesian.rb +3 -0
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +6 -6
- data/lib/rgeo/coord_sys.rb +0 -11
- data/lib/rgeo/error.rb +15 -0
- data/lib/rgeo/feature/factory_generator.rb +0 -3
- data/lib/rgeo/feature/geometry.rb +107 -28
- data/lib/rgeo/feature/geometry_collection.rb +13 -5
- data/lib/rgeo/feature/line_string.rb +3 -3
- data/lib/rgeo/feature/multi_surface.rb +3 -3
- data/lib/rgeo/feature/point.rb +4 -4
- data/lib/rgeo/feature/surface.rb +3 -3
- data/lib/rgeo/geographic/factory.rb +6 -7
- data/lib/rgeo/geographic/interface.rb +6 -49
- data/lib/rgeo/geographic/proj4_projector.rb +0 -2
- data/lib/rgeo/geographic/projected_feature_classes.rb +21 -9
- data/lib/rgeo/geographic/projected_feature_methods.rb +67 -28
- data/lib/rgeo/geographic/simple_mercator_projector.rb +0 -2
- data/lib/rgeo/geographic/spherical_feature_classes.rb +29 -9
- data/lib/rgeo/geographic/spherical_feature_methods.rb +79 -2
- data/lib/rgeo/geos/capi_factory.rb +21 -38
- data/lib/rgeo/geos/capi_feature_classes.rb +54 -11
- data/lib/rgeo/geos/ffi_factory.rb +6 -35
- data/lib/rgeo/geos/ffi_feature_classes.rb +34 -10
- data/lib/rgeo/geos/ffi_feature_methods.rb +39 -5
- data/lib/rgeo/geos/interface.rb +0 -24
- data/lib/rgeo/geos/zm_factory.rb +0 -19
- data/lib/rgeo/geos/zm_feature_methods.rb +16 -0
- data/lib/rgeo/geos.rb +6 -3
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +4 -4
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +1 -1
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +15 -19
- data/lib/rgeo/impl_helper/basic_point_methods.rb +1 -1
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +1 -1
- data/lib/rgeo/impl_helper/valid_op.rb +354 -0
- data/lib/rgeo/impl_helper/validity_check.rb +139 -0
- data/lib/rgeo/impl_helper.rb +1 -0
- data/lib/rgeo/version.rb +1 -1
- metadata +45 -9
- data/lib/rgeo/coord_sys/srs_database/entry.rb +0 -107
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +0 -64
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +0 -65
@@ -69,41 +69,78 @@ module RGeo
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def intersects_segment?(seg)
|
72
|
+
!segment_intersection(seg).nil?
|
73
|
+
end
|
74
|
+
|
75
|
+
# If this and the other segment intersect, this method will return the coordinate
|
76
|
+
# at which they intersect, otherwise nil.
|
77
|
+
# In the case of a partial overlap (parallel segments), this will return
|
78
|
+
# a single point on the overlapping portion.
|
79
|
+
#
|
80
|
+
# @param seg [Segment]
|
81
|
+
#
|
82
|
+
# @return [RGeo::Feature::Point, nil]
|
83
|
+
def segment_intersection(seg)
|
72
84
|
s2 = seg.s
|
73
85
|
# Handle degenerate cases
|
74
86
|
if seg.degenerate?
|
75
|
-
if @lensq == 0
|
76
|
-
return @s
|
87
|
+
if @lensq == 0 && @s == s2
|
88
|
+
return @s
|
77
89
|
else
|
78
|
-
return contains_point?(s2)
|
90
|
+
return contains_point?(s2) ? s2 : nil
|
79
91
|
end
|
80
92
|
elsif @lensq == 0
|
81
|
-
return seg.contains_point?(@s)
|
93
|
+
return seg.contains_point?(@s) ? @s : nil
|
82
94
|
end
|
95
|
+
|
83
96
|
# Both segments have nonzero length.
|
84
97
|
sx2 = s2.x
|
85
98
|
sy2 = s2.y
|
86
99
|
dx2 = seg.dx
|
87
100
|
dy2 = seg.dy
|
88
101
|
denom = @dx * dy2 - @dy * dx2
|
102
|
+
|
89
103
|
if denom == 0
|
90
104
|
# Segments are parallel. Make sure they are collinear.
|
91
|
-
return
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
105
|
+
return nil unless side(s2) == 0
|
106
|
+
|
107
|
+
# return the first point it finds that intersects another line.
|
108
|
+
# In many cases, the intersection is actually another line
|
109
|
+
# segment, but for now, we will just return a single point.
|
110
|
+
return s2 if contains_point?(s2)
|
111
|
+
return seg.e if contains_point?(seg.e)
|
112
|
+
return @s if seg.contains_point?(@s)
|
113
|
+
return @e if seg.contains_point?(@e)
|
114
|
+
nil
|
100
115
|
else
|
101
116
|
# Segments are not parallel. Check the intersection of their
|
102
117
|
# containing lines.
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
118
|
+
num1 = dx2 * (@sy - sy2) - (dy2 * (@sx - sx2))
|
119
|
+
num2 = @dx * (@sy - sy2) - (@dy * (@sx - sx2))
|
120
|
+
cross1 = num1 / denom
|
121
|
+
cross2 = num2 / denom
|
122
|
+
|
123
|
+
return nil if cross1 < 0.0 || cross1 > 1.0
|
124
|
+
if cross2 >= 0.0 && cross2 <= 1.0
|
125
|
+
x = @sx + (cross1 * @dx)
|
126
|
+
y = @sy + (cross1 * @dy)
|
127
|
+
|
128
|
+
# Check if this segment contains the point.
|
129
|
+
# Sometimes round-off errors occur and intersections
|
130
|
+
# are recorded as off the line segments.
|
131
|
+
#
|
132
|
+
# If this is the case, return the closest point from
|
133
|
+
# either segment.
|
134
|
+
int_pt = @s.factory.point(x, y)
|
135
|
+
if contains_point?(int_pt)
|
136
|
+
int_pt
|
137
|
+
else
|
138
|
+
# find closest of @s, @e, seg.s, seg.e
|
139
|
+
[@e, seg.s, seg.e].reduce(@s) do |closest, pt|
|
140
|
+
int_pt.distance(pt) < int_pt.distance(closest) ? pt : closest
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
107
144
|
end
|
108
145
|
end
|
109
146
|
|
@@ -22,6 +22,11 @@ module RGeo
|
|
22
22
|
def initialize(opts = {})
|
23
23
|
@has_z = opts[:has_z_coordinate] ? true : false
|
24
24
|
@has_m = opts[:has_m_coordinate] ? true : false
|
25
|
+
@coordinate_dimension = 2
|
26
|
+
@coordinate_dimension += 1 if @has_z
|
27
|
+
@coordinate_dimension += 1 if @has_m
|
28
|
+
@spatial_dimension = @has_z ? 3 : 2
|
29
|
+
|
25
30
|
@proj4 = opts[:proj4]
|
26
31
|
if @proj4 && CoordSys.check!(:proj4)
|
27
32
|
if @proj4.is_a?(String) || @proj4.is_a?(Hash)
|
@@ -33,16 +38,8 @@ module RGeo
|
|
33
38
|
if @coord_sys.is_a?(String)
|
34
39
|
@coord_sys = CoordSys::CS.create_from_wkt(@coord_sys)
|
35
40
|
end
|
36
|
-
if (!@proj4 || !@coord_sys) && srid && (db = opts[:srs_database])
|
37
|
-
entry = db.get(srid.to_i)
|
38
|
-
if entry
|
39
|
-
@proj4 ||= entry.proj4
|
40
|
-
@coord_sys ||= entry.coord_sys
|
41
|
-
end
|
42
|
-
end
|
43
41
|
srid ||= @coord_sys.authority_code if @coord_sys
|
44
42
|
@srid = srid.to_i
|
45
|
-
@lenient_assertions = opts[:uses_lenient_assertions] ? true : false
|
46
43
|
@buffer_resolution = opts[:buffer_resolution].to_i
|
47
44
|
@buffer_resolution = 1 if @buffer_resolution < 1
|
48
45
|
|
@@ -75,6 +72,7 @@ module RGeo
|
|
75
72
|
@wkb_parser = WKRep::WKBParser.new(self)
|
76
73
|
end
|
77
74
|
end
|
75
|
+
attr_reader :coordinate_dimension, :spatial_dimension
|
78
76
|
|
79
77
|
# Equivalence test.
|
80
78
|
|
@@ -103,7 +101,6 @@ module RGeo
|
|
103
101
|
"wkbg" => @wkb_generator.properties,
|
104
102
|
"wktp" => @wkt_parser.properties,
|
105
103
|
"wkbp" => @wkb_parser.properties,
|
106
|
-
"lena" => @lenient_assertions,
|
107
104
|
"bufr" => @buffer_resolution
|
108
105
|
}
|
109
106
|
hash_["proj4"] = @proj4.marshal_dump if @proj4
|
@@ -131,7 +128,6 @@ module RGeo
|
|
131
128
|
wkb_generator: symbolize_hash(data["wkbg"]),
|
132
129
|
wkt_parser: symbolize_hash(data["wktp"]),
|
133
130
|
wkb_parser: symbolize_hash(data["wkbp"]),
|
134
|
-
uses_lenient_assertions: data["lena"],
|
135
131
|
buffer_resolution: data["bufr"],
|
136
132
|
proj4: proj4,
|
137
133
|
coord_sys: coord_sys
|
@@ -144,7 +140,6 @@ module RGeo
|
|
144
140
|
coder["has_z_coordinate"] = @has_z
|
145
141
|
coder["has_m_coordinate"] = @has_m
|
146
142
|
coder["srid"] = @srid
|
147
|
-
coder["lenient_assertions"] = @lenient_assertions
|
148
143
|
coder["buffer_resolution"] = @buffer_resolution
|
149
144
|
coder["wkt_generator"] = @wkt_generator.properties
|
150
145
|
coder["wkb_generator"] = @wkb_generator.properties
|
@@ -180,7 +175,6 @@ module RGeo
|
|
180
175
|
wkb_generator: symbolize_hash(coder["wkb_generator"]),
|
181
176
|
wkt_parser: symbolize_hash(coder["wkt_parser"]),
|
182
177
|
wkb_parser: symbolize_hash(coder["wkb_parser"]),
|
183
|
-
uses_lenient_assertions: coder["lenient_assertions"],
|
184
178
|
buffer_resolution: coder["buffer_resolution"],
|
185
179
|
proj4: proj4,
|
186
180
|
coord_sys: coord_sys
|
@@ -199,8 +193,6 @@ module RGeo
|
|
199
193
|
@has_z
|
200
194
|
when :has_m_coordinate
|
201
195
|
@has_m
|
202
|
-
when :uses_lenient_assertions
|
203
|
-
@lenient_assertions
|
204
196
|
when :buffer_resolution
|
205
197
|
@buffer_resolution
|
206
198
|
when :is_cartesian
|
@@ -6,79 +6,101 @@
|
|
6
6
|
#
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
9
|
+
require_relative "../impl_helper/validity_check"
|
10
|
+
|
9
11
|
module RGeo
|
10
12
|
module Cartesian
|
11
13
|
class PointImpl # :nodoc:
|
12
|
-
include
|
13
|
-
include
|
14
|
-
include
|
15
|
-
include
|
16
|
-
include
|
14
|
+
include Feature::Point
|
15
|
+
include ImplHelper::ValidityCheck
|
16
|
+
include ImplHelper::BasicGeometryMethods
|
17
|
+
include ImplHelper::BasicPointMethods
|
18
|
+
include ImplHelper::ValidOp
|
19
|
+
include GeometryMethods
|
20
|
+
include PointMethods
|
17
21
|
end
|
18
22
|
|
19
23
|
class LineStringImpl # :nodoc:
|
20
|
-
include
|
21
|
-
include
|
22
|
-
include
|
23
|
-
include
|
24
|
-
include
|
24
|
+
include Feature::LineString
|
25
|
+
include ImplHelper::ValidityCheck
|
26
|
+
include ImplHelper::BasicGeometryMethods
|
27
|
+
include ImplHelper::BasicLineStringMethods
|
28
|
+
include ImplHelper::ValidOp
|
29
|
+
include GeometryMethods
|
30
|
+
include LineStringMethods
|
25
31
|
end
|
26
32
|
|
27
33
|
class LineImpl # :nodoc:
|
28
|
-
include
|
29
|
-
include
|
30
|
-
include
|
31
|
-
include
|
32
|
-
include
|
33
|
-
include
|
34
|
+
include Feature::Line
|
35
|
+
include ImplHelper::ValidityCheck
|
36
|
+
include ImplHelper::BasicGeometryMethods
|
37
|
+
include ImplHelper::BasicLineStringMethods
|
38
|
+
include ImplHelper::BasicLineMethods
|
39
|
+
include ImplHelper::ValidOp
|
40
|
+
include GeometryMethods
|
41
|
+
include LineStringMethods
|
34
42
|
end
|
35
43
|
|
36
44
|
class LinearRingImpl # :nodoc:
|
37
|
-
include
|
38
|
-
include
|
39
|
-
include
|
40
|
-
include
|
41
|
-
include
|
42
|
-
include
|
45
|
+
include Feature::LinearRing
|
46
|
+
include ImplHelper::ValidityCheck
|
47
|
+
include ImplHelper::BasicGeometryMethods
|
48
|
+
include ImplHelper::BasicLineStringMethods
|
49
|
+
include ImplHelper::BasicLinearRingMethods
|
50
|
+
include ImplHelper::ValidOp
|
51
|
+
include GeometryMethods
|
52
|
+
include LineStringMethods
|
43
53
|
end
|
44
54
|
|
45
55
|
class PolygonImpl # :nodoc:
|
46
|
-
include
|
47
|
-
include
|
48
|
-
include
|
49
|
-
include
|
56
|
+
include Feature::Polygon
|
57
|
+
include ImplHelper::ValidityCheck
|
58
|
+
include ImplHelper::BasicGeometryMethods
|
59
|
+
include ImplHelper::BasicPolygonMethods
|
60
|
+
include ValidOp
|
61
|
+
include GeometryMethods
|
50
62
|
end
|
51
63
|
|
52
64
|
class GeometryCollectionImpl # :nodoc:
|
53
|
-
include
|
54
|
-
include
|
55
|
-
include
|
56
|
-
include
|
65
|
+
include Feature::GeometryCollection
|
66
|
+
include ImplHelper::ValidityCheck
|
67
|
+
include ImplHelper::BasicGeometryMethods
|
68
|
+
include ImplHelper::BasicGeometryCollectionMethods
|
69
|
+
include ImplHelper::ValidOp
|
70
|
+
include GeometryMethods
|
57
71
|
end
|
58
72
|
|
59
73
|
class MultiPointImpl # :nodoc:
|
60
|
-
include
|
61
|
-
include
|
62
|
-
include
|
63
|
-
include
|
64
|
-
include
|
74
|
+
include Feature::MultiPoint
|
75
|
+
include ImplHelper::ValidityCheck
|
76
|
+
include ImplHelper::BasicGeometryMethods
|
77
|
+
include ImplHelper::BasicGeometryCollectionMethods
|
78
|
+
include ImplHelper::BasicMultiPointMethods
|
79
|
+
include ImplHelper::ValidOp
|
80
|
+
include GeometryMethods
|
65
81
|
end
|
66
82
|
|
67
83
|
class MultiLineStringImpl # :nodoc:
|
68
|
-
include
|
69
|
-
include
|
70
|
-
include
|
71
|
-
include
|
72
|
-
include
|
73
|
-
include
|
84
|
+
include Feature::MultiLineString
|
85
|
+
include ImplHelper::ValidityCheck
|
86
|
+
include ImplHelper::BasicGeometryMethods
|
87
|
+
include ImplHelper::BasicGeometryCollectionMethods
|
88
|
+
include ImplHelper::BasicMultiLineStringMethods
|
89
|
+
include ImplHelper::ValidOp
|
90
|
+
include GeometryMethods
|
91
|
+
include MultiLineStringMethods
|
74
92
|
end
|
75
93
|
|
76
94
|
class MultiPolygonImpl # :nodoc:
|
77
|
-
include
|
78
|
-
include
|
79
|
-
include
|
80
|
-
include
|
81
|
-
include
|
95
|
+
include Feature::MultiPolygon
|
96
|
+
include ImplHelper::ValidityCheck
|
97
|
+
include ImplHelper::BasicGeometryMethods
|
98
|
+
include ImplHelper::BasicGeometryCollectionMethods
|
99
|
+
include ImplHelper::BasicMultiPolygonMethods
|
100
|
+
include ImplHelper::ValidOp
|
101
|
+
include GeometryMethods
|
82
102
|
end
|
103
|
+
|
104
|
+
ImplHelper::ValidityCheck.override_classes
|
83
105
|
end
|
84
106
|
end
|
@@ -16,6 +16,28 @@ module RGeo
|
|
16
16
|
def envelope
|
17
17
|
BoundingBox.new(factory).add(self).to_geometry
|
18
18
|
end
|
19
|
+
|
20
|
+
def coordinate_dimension
|
21
|
+
factory.coordinate_dimension
|
22
|
+
end
|
23
|
+
|
24
|
+
def spatial_dimension
|
25
|
+
factory.spatial_dimension
|
26
|
+
end
|
27
|
+
|
28
|
+
def is_3d?
|
29
|
+
factory.property(:has_z_coordinate)
|
30
|
+
end
|
31
|
+
|
32
|
+
def measured?
|
33
|
+
factory.property(:has_m_coordinate)
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def graph
|
39
|
+
@graph ||= GeometryGraph.new(self)
|
40
|
+
end
|
19
41
|
end
|
20
42
|
|
21
43
|
module PointMethods # :nodoc:
|
@@ -50,26 +72,14 @@ module RGeo
|
|
50
72
|
end
|
51
73
|
|
52
74
|
def simple?
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
pindex = index - 1
|
62
|
-
pindex = nil if pindex < 0
|
63
|
-
return false if pindex && seg.contains_point?(segments[pindex].s)
|
64
|
-
next unless nindex
|
65
|
-
oindex = nindex + 1
|
66
|
-
while oindex < len
|
67
|
-
oseg = segments[oindex]
|
68
|
-
return false if !(index == 0 && oindex == len - 1 && seg.s == oseg.e) && seg.intersects_segment?(oseg)
|
69
|
-
oindex += 1
|
70
|
-
end
|
71
|
-
end
|
72
|
-
true
|
75
|
+
# Use a SweeplineIntersector to determine if there are any self-intersections
|
76
|
+
# in the ring. The GeometryGraph of the ring could be used by comparing the
|
77
|
+
# edges to number of segments (graph.incident_edges.length == segments.length),
|
78
|
+
# but this adds computational and memory overhead if graph isn't already memoized.
|
79
|
+
# Since graph is not used elsewhere in LineStringMethods, we will just use the
|
80
|
+
# SweeplineIntersector for now.
|
81
|
+
li = SweeplineIntersector.new(segments)
|
82
|
+
li.proper_intersections.empty?
|
73
83
|
end
|
74
84
|
|
75
85
|
def is_simple?
|
@@ -80,6 +90,43 @@ module RGeo
|
|
80
90
|
def length
|
81
91
|
segments.inject(0.0) { |sum, seg| sum + seg.length }
|
82
92
|
end
|
93
|
+
|
94
|
+
def crosses?(rhs)
|
95
|
+
case rhs
|
96
|
+
when Feature::LineString
|
97
|
+
crosses_line_string?(rhs)
|
98
|
+
else
|
99
|
+
super
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
private
|
104
|
+
|
105
|
+
# Determines if a cross occurs with another linestring.
|
106
|
+
# Process is to get the number of proper intersections in each geom
|
107
|
+
# then overlay and get the number of proper intersections from that.
|
108
|
+
# If the overlaid number is higher than the sum of individual self-ints
|
109
|
+
# then there is an intersection. Finally, we need to check the intersection
|
110
|
+
# to see that it is not a boundary point of either segment.
|
111
|
+
#
|
112
|
+
# @param rhs [Feature::LineString]
|
113
|
+
#
|
114
|
+
# @return [Boolean]
|
115
|
+
def crosses_line_string?(rhs)
|
116
|
+
self_ints = SweeplineIntersector.new(segments).proper_intersections
|
117
|
+
self_ints += SweeplineIntersector.new(rhs.segments).proper_intersections
|
118
|
+
overlay_ints = SweeplineIntersector.new(segments + rhs.segments).proper_intersections
|
119
|
+
|
120
|
+
(overlay_ints - self_ints).each do |int|
|
121
|
+
s1s = int.s1.s
|
122
|
+
s1e = int.s1.e
|
123
|
+
s2s = int.s2.s
|
124
|
+
s2e = int.s2.e
|
125
|
+
return true unless [s1s, s1e, s2s, s2e].include?(int.point)
|
126
|
+
end
|
127
|
+
|
128
|
+
false
|
129
|
+
end
|
83
130
|
end
|
84
131
|
|
85
132
|
module MultiLineStringMethods # :nodoc:
|
@@ -69,21 +69,10 @@ module RGeo
|
|
69
69
|
# The coordinate system in OGC form, either as a subclass of
|
70
70
|
# CoordSys::CS::CoordinateSystem, or as a string in WKT format.
|
71
71
|
# Optional.
|
72
|
-
# [<tt>:srs_database</tt>]
|
73
|
-
# Optional. If provided, the value should be an implementation of
|
74
|
-
# CoordSys::SRSDatabase::Interface. If both this and an SRID are
|
75
|
-
# provided, they are used to look up the proj4 and coord_sys
|
76
|
-
# objects from a spatial reference system database.
|
77
72
|
# [<tt>:has_z_coordinate</tt>]
|
78
73
|
# Support a Z coordinate. Default is false.
|
79
74
|
# [<tt>:has_m_coordinate</tt>]
|
80
75
|
# Support an M coordinate. Default is false.
|
81
|
-
# [<tt>:uses_lenient_assertions</tt>]
|
82
|
-
# If set to true, assertion checking is disabled. This includes
|
83
|
-
# simplicity checking on LinearRing, and validity checks on
|
84
|
-
# Polygon and MultiPolygon. This may speed up creation of certain
|
85
|
-
# objects, at the expense of not doing the proper checking for
|
86
|
-
# OGC compliance. Default is false.
|
87
76
|
# [<tt>:wkt_parser</tt>]
|
88
77
|
# Configure the parser for WKT. The value is a hash of
|
89
78
|
# configuration parameters for WKRep::WKTParser.new. Default is
|
@@ -107,31 +96,6 @@ module RGeo
|
|
107
96
|
def simple_factory(opts = {})
|
108
97
|
Cartesian::Factory.new(opts)
|
109
98
|
end
|
110
|
-
|
111
|
-
# Returns a Feature::FactoryGenerator that creates preferred
|
112
|
-
# factories. The given options are used as the default options.
|
113
|
-
#
|
114
|
-
# A common case for this is to provide the <tt>:srs_database</tt>
|
115
|
-
# as a default. Then, the factory generator need only be passed
|
116
|
-
# an SRID and it will automatically fetch the appropriate Proj4
|
117
|
-
# and CoordSys objects.
|
118
|
-
|
119
|
-
def preferred_factory_generator(defaults = {})
|
120
|
-
proc { |c| preferred_factory(defaults.merge(c)) }
|
121
|
-
end
|
122
|
-
alias factory_generator preferred_factory_generator
|
123
|
-
|
124
|
-
# Returns a Feature::FactoryGenerator that creates simple factories.
|
125
|
-
# The given options are used as the default options.
|
126
|
-
#
|
127
|
-
# A common case for this is to provide the <tt>:srs_database</tt>
|
128
|
-
# as a default. Then, the factory generator need only be passed
|
129
|
-
# an SRID and it will automatically fetch the appropriate Proj4
|
130
|
-
# and CoordSys objects.
|
131
|
-
|
132
|
-
def simple_factory_generator(defaults = {})
|
133
|
-
proc { |c| simple_factory(defaults.merge(c)) }
|
134
|
-
end
|
135
99
|
end
|
136
100
|
end
|
137
101
|
end
|