rgeo 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +29 -0
- data/ext/geos_c_impl/Makefile_2.2.3 +260 -0
- data/ext/geos_c_impl/coordinates.c +65 -0
- data/ext/geos_c_impl/coordinates.h +2 -0
- data/ext/geos_c_impl/extconf.rb +19 -43
- data/ext/geos_c_impl/geometry.c +24 -0
- data/ext/geos_c_impl/geometry_collection.c +99 -1
- data/ext/geos_c_impl/geos_c_impl_2.2.3.bundle +0 -0
- data/ext/geos_c_impl/line_string.c +38 -0
- data/ext/geos_c_impl/mkmf.log +123 -0
- data/ext/geos_c_impl/point.c +27 -0
- data/ext/geos_c_impl/polygon.c +26 -0
- data/ext/proj4_c_impl/Makefile_2.2.3 +260 -0
- data/ext/proj4_c_impl/extconf.rb +32 -32
- data/ext/proj4_c_impl/mkmf.log +47 -0
- data/ext/proj4_c_impl/proj4_c_impl_2.2.3.bundle +0 -0
- data/lib/rgeo.rb +10 -11
- data/lib/rgeo/cartesian.rb +7 -12
- data/lib/rgeo/cartesian/analysis.rb +13 -26
- data/lib/rgeo/cartesian/bounding_box.rb +45 -114
- data/lib/rgeo/cartesian/calculations.rb +3 -21
- data/lib/rgeo/cartesian/factory.rb +101 -122
- data/lib/rgeo/cartesian/feature_classes.rb +9 -59
- data/lib/rgeo/cartesian/feature_methods.rb +15 -45
- data/lib/rgeo/cartesian/interface.rb +6 -17
- data/lib/rgeo/coord_sys.rb +9 -15
- data/lib/rgeo/coord_sys/cs/entities.rb +84 -330
- data/lib/rgeo/coord_sys/cs/factories.rb +2 -32
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +52 -80
- data/lib/rgeo/coord_sys/proj4.rb +28 -67
- data/lib/rgeo/coord_sys/proj4_c_impl.bundle +0 -0
- data/lib/rgeo/coord_sys/srs_database/interface.rb +4 -24
- data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +20 -38
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +6 -22
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +6 -21
- data/lib/rgeo/error.rb +0 -6
- data/lib/rgeo/feature.rb +18 -23
- data/lib/rgeo/feature/curve.rb +0 -14
- data/lib/rgeo/feature/factory.rb +13 -38
- data/lib/rgeo/feature/factory_generator.rb +4 -16
- data/lib/rgeo/feature/geometry.rb +18 -60
- data/lib/rgeo/feature/geometry_collection.rb +3 -17
- data/lib/rgeo/feature/line.rb +0 -10
- data/lib/rgeo/feature/line_string.rb +1 -13
- data/lib/rgeo/feature/linear_ring.rb +0 -9
- data/lib/rgeo/feature/mixins.rb +11 -36
- data/lib/rgeo/feature/multi_curve.rb +0 -11
- data/lib/rgeo/feature/multi_line_string.rb +0 -9
- data/lib/rgeo/feature/multi_point.rb +0 -9
- data/lib/rgeo/feature/multi_polygon.rb +0 -9
- data/lib/rgeo/feature/multi_surface.rb +0 -12
- data/lib/rgeo/feature/point.rb +0 -13
- data/lib/rgeo/feature/polygon.rb +1 -14
- data/lib/rgeo/feature/surface.rb +0 -12
- data/lib/rgeo/feature/types.rb +19 -61
- data/lib/rgeo/geographic.rb +10 -15
- data/lib/rgeo/geographic/factory.rb +126 -147
- data/lib/rgeo/geographic/interface.rb +67 -81
- data/lib/rgeo/geographic/proj4_projector.rb +13 -37
- data/lib/rgeo/geographic/projected_feature_classes.rb +7 -66
- data/lib/rgeo/geographic/projected_feature_methods.rb +15 -80
- data/lib/rgeo/geographic/projected_window.rb +15 -67
- data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -56
- data/lib/rgeo/geographic/spherical_feature_classes.rb +9 -68
- data/lib/rgeo/geographic/spherical_feature_methods.rb +18 -51
- data/lib/rgeo/geographic/spherical_math.rb +26 -51
- data/lib/rgeo/geos.rb +23 -20
- data/lib/rgeo/geos/capi_factory.rb +125 -131
- data/lib/rgeo/geos/capi_feature_classes.rb +21 -88
- data/lib/rgeo/geos/ffi_factory.rb +90 -143
- data/lib/rgeo/geos/ffi_feature_classes.rb +8 -63
- data/lib/rgeo/geos/ffi_feature_methods.rb +46 -162
- data/lib/rgeo/geos/geos_c_impl.bundle +0 -0
- data/lib/rgeo/geos/interface.rb +4 -23
- data/lib/rgeo/geos/utils.rb +4 -19
- data/lib/rgeo/geos/zm_factory.rb +82 -131
- data/lib/rgeo/geos/zm_feature_classes.rb +8 -63
- data/lib/rgeo/geos/zm_feature_methods.rb +34 -107
- data/lib/rgeo/impl_helper.rb +8 -13
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +27 -71
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +10 -28
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +21 -57
- data/lib/rgeo/impl_helper/basic_point_methods.rb +12 -30
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +9 -28
- data/lib/rgeo/impl_helper/math.rb +4 -10
- data/lib/rgeo/impl_helper/utils.rb +2 -10
- data/lib/rgeo/version.rb +1 -1
- data/lib/rgeo/wkrep.rb +4 -9
- data/lib/rgeo/wkrep/wkb_generator.rb +22 -46
- data/lib/rgeo/wkrep/wkb_parser.rb +25 -52
- data/lib/rgeo/wkrep/wkt_generator.rb +39 -69
- data/lib/rgeo/wkrep/wkt_parser.rb +52 -89
- data/lib/rgeo/yaml.rb +1 -7
- data/test/common/factory_tests.rb +4 -19
- data/test/common/geometry_collection_tests.rb +6 -39
- data/test/common/line_string_tests.rb +10 -39
- data/test/common/multi_line_string_tests.rb +10 -30
- data/test/common/multi_point_tests.rb +15 -34
- data/test/common/multi_polygon_tests.rb +26 -28
- data/test/common/point_tests.rb +37 -59
- data/test/common/polygon_tests.rb +16 -25
- data/test/coord_sys/tc_ogc_cs.rb +151 -186
- data/test/coord_sys/tc_proj4.rb +35 -60
- data/test/coord_sys/tc_proj4_srs_data.rb +15 -24
- data/test/coord_sys/tc_sr_org.rb +11 -19
- data/test/coord_sys/tc_url_reader.rb +13 -23
- data/test/geos_capi/tc_factory.rb +7 -16
- data/test/geos_capi/tc_geometry_collection.rb +6 -14
- data/test/geos_capi/tc_line_string.rb +7 -15
- data/test/geos_capi/tc_misc.rb +26 -41
- data/test/geos_capi/tc_multi_line_string.rb +6 -14
- data/test/geos_capi/tc_multi_point.rb +7 -15
- data/test/geos_capi/tc_multi_polygon.rb +8 -18
- data/test/geos_capi/tc_parsing_unparsing.rb +11 -21
- data/test/geos_capi/tc_point.rb +12 -26
- data/test/geos_capi/tc_polygon.rb +52 -17
- data/test/geos_capi/tc_zmfactory.rb +7 -18
- data/test/geos_ffi/tc_factory.rb +7 -16
- data/test/geos_ffi/tc_geometry_collection.rb +7 -15
- data/test/geos_ffi/tc_line_string.rb +7 -15
- data/test/geos_ffi/tc_misc.rb +8 -18
- data/test/geos_ffi/tc_multi_line_string.rb +7 -15
- data/test/geos_ffi/tc_multi_point.rb +8 -16
- data/test/geos_ffi/tc_multi_polygon.rb +9 -18
- data/test/geos_ffi/tc_parsing_unparsing.rb +14 -24
- data/test/geos_ffi/tc_point.rb +13 -28
- data/test/geos_ffi/tc_polygon.rb +7 -17
- data/test/geos_ffi/tc_zmfactory.rb +8 -19
- data/test/projected_geographic/tc_factory.rb +7 -15
- data/test/projected_geographic/tc_geometry_collection.rb +7 -15
- data/test/projected_geographic/tc_line_string.rb +7 -15
- data/test/projected_geographic/tc_multi_line_string.rb +7 -16
- data/test/projected_geographic/tc_multi_point.rb +8 -17
- data/test/projected_geographic/tc_multi_polygon.rb +8 -16
- data/test/projected_geographic/tc_point.rb +11 -23
- data/test/projected_geographic/tc_polygon.rb +7 -15
- data/test/simple_cartesian/tc_calculations.rb +6 -22
- data/test/simple_cartesian/tc_factory.rb +7 -16
- data/test/simple_cartesian/tc_geometry_collection.rb +6 -15
- data/test/simple_cartesian/tc_line_string.rb +6 -15
- data/test/simple_cartesian/tc_multi_line_string.rb +6 -15
- data/test/simple_cartesian/tc_multi_point.rb +7 -16
- data/test/simple_cartesian/tc_multi_polygon.rb +7 -16
- data/test/simple_cartesian/tc_point.rb +10 -21
- data/test/simple_cartesian/tc_polygon.rb +6 -15
- data/test/simple_mercator/tc_factory.rb +6 -14
- data/test/simple_mercator/tc_geometry_collection.rb +6 -14
- data/test/simple_mercator/tc_line_string.rb +6 -14
- data/test/simple_mercator/tc_multi_line_string.rb +6 -15
- data/test/simple_mercator/tc_multi_point.rb +7 -16
- data/test/simple_mercator/tc_multi_polygon.rb +7 -15
- data/test/simple_mercator/tc_point.rb +11 -24
- data/test/simple_mercator/tc_polygon.rb +6 -14
- data/test/simple_mercator/tc_window.rb +10 -34
- data/test/spherical_geographic/tc_calculations.rb +5 -32
- data/test/spherical_geographic/tc_factory.rb +6 -15
- data/test/spherical_geographic/tc_geometry_collection.rb +6 -15
- data/test/spherical_geographic/tc_line_string.rb +6 -15
- data/test/spherical_geographic/tc_multi_line_string.rb +6 -15
- data/test/spherical_geographic/tc_multi_point.rb +7 -16
- data/test/spherical_geographic/tc_multi_polygon.rb +7 -16
- data/test/spherical_geographic/tc_point.rb +10 -22
- data/test/spherical_geographic/tc_polygon.rb +6 -15
- data/test/tc_cartesian_analysis.rb +4 -16
- data/test/tc_cartesian_bbox.rb +7 -21
- data/test/tc_mixins.rb +8 -25
- data/test/tc_oneoff.rb +5 -13
- data/test/tc_types.rb +7 -16
- data/test/wkrep/tc_wkb_generator.rb +63 -97
- data/test/wkrep/tc_wkb_parser.rb +63 -100
- data/test/wkrep/tc_wkt_generator.rb +54 -92
- data/test/wkrep/tc_wkt_parser.rb +84 -133
- metadata +39 -9
- data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +0 -166
- data/test/coord_sys/tc_active_record_table.rb +0 -79
@@ -4,30 +4,22 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/multi_polygon_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/multi_polygon_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module ProjectedGeographic
|
16
|
-
|
17
|
-
class TestMultiPolygon < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestMultiPolygon < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def create_factories
|
21
|
-
@factory = ::RGeo::Geographic.projected_factory(:
|
22
|
-
@lenient_factory = ::RGeo::Geographic.projected_factory(:
|
17
|
+
@factory = ::RGeo::Geographic.projected_factory(projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857)
|
18
|
+
@lenient_factory = ::RGeo::Geographic.projected_factory(projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857, lenient_multi_polygon_assertions: true)
|
23
19
|
end
|
24
20
|
|
25
|
-
|
26
21
|
include ::RGeo::Tests::Common::MultiPolygonTests
|
27
|
-
|
28
|
-
|
29
22
|
end
|
30
|
-
|
31
23
|
end
|
32
24
|
end
|
33
25
|
end if ::RGeo::CoordSys::Proj4.supported?
|
@@ -4,60 +4,48 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/point_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/point_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module ProjectedGeographic
|
16
|
-
|
17
|
-
class TestPoint < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestPoint < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
|
-
@factory = ::RGeo::Geographic.projected_factory(:
|
22
|
-
@zfactory = ::RGeo::Geographic.projected_factory(:
|
23
|
-
@mfactory = ::RGeo::Geographic.projected_factory(:
|
24
|
-
@zmfactory = ::RGeo::Geographic.projected_factory(:
|
17
|
+
@factory = ::RGeo::Geographic.projected_factory(buffer_resolution: 8, projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857)
|
18
|
+
@zfactory = ::RGeo::Geographic.projected_factory(has_z_coordinate: true, projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857)
|
19
|
+
@mfactory = ::RGeo::Geographic.projected_factory(has_m_coordinate: true, projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857)
|
20
|
+
@zmfactory = ::RGeo::Geographic.projected_factory(has_z_coordinate: true, has_m_coordinate: true, projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857)
|
25
21
|
end
|
26
22
|
|
27
|
-
|
28
23
|
include ::RGeo::Tests::Common::PointTests
|
29
24
|
|
30
|
-
|
31
25
|
def test_has_projection
|
32
26
|
point_ = @factory.point(21, -22)
|
33
27
|
assert(point_.respond_to?(:projection))
|
34
28
|
end
|
35
29
|
|
36
|
-
|
37
30
|
def test_latlon
|
38
31
|
point_ = @factory.point(21, -22)
|
39
32
|
assert_equal(21, point_.longitude)
|
40
33
|
assert_equal(-22, point_.latitude)
|
41
34
|
end
|
42
35
|
|
43
|
-
|
44
36
|
def test_srid
|
45
37
|
point_ = @factory.point(11, 12)
|
46
38
|
assert_equal(4326, point_.srid)
|
47
39
|
end
|
48
40
|
|
49
|
-
|
50
41
|
def test_distance
|
51
42
|
point1_ = @factory.point(11, 12)
|
52
43
|
point2_ = @factory.point(11, 12)
|
53
44
|
point3_ = @factory.point(13, 12)
|
54
45
|
assert_in_delta(0, point1_.distance(point2_), 0.0001)
|
55
|
-
assert_in_delta(
|
46
|
+
assert_in_delta(222_638, point1_.distance(point3_), 1)
|
56
47
|
end
|
57
|
-
|
58
|
-
|
59
48
|
end
|
60
|
-
|
61
49
|
end
|
62
50
|
end
|
63
51
|
end if ::RGeo::CoordSys::Proj4.supported?
|
@@ -4,29 +4,21 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/polygon_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/polygon_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module ProjectedGeographic
|
16
|
-
|
17
|
-
class TestPolygon < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestPolygon < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
|
-
@factory = ::RGeo::Geographic.projected_factory(:
|
17
|
+
@factory = ::RGeo::Geographic.projected_factory(projection_proj4: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs", projection_srid: 3857)
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
20
|
include ::RGeo::Tests::Common::PolygonTests
|
26
|
-
|
27
|
-
|
28
21
|
end
|
29
|
-
|
30
22
|
end
|
31
23
|
end
|
32
24
|
end if ::RGeo::CoordSys::Proj4.supported?
|
@@ -4,17 +4,13 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
10
9
|
|
11
10
|
module RGeo
|
12
|
-
module Tests
|
13
|
-
module Cartesian
|
14
|
-
|
15
|
-
class TestCalculations < ::Test::Unit::TestCase # :nodoc:
|
16
|
-
|
17
|
-
|
11
|
+
module Tests # :nodoc:
|
12
|
+
module Cartesian # :nodoc:
|
13
|
+
class TestCalculations < ::Test::Unit::TestCase # :nodoc:
|
18
14
|
def setup
|
19
15
|
@factory = ::RGeo::Cartesian.simple_factory
|
20
16
|
@point1 = @factory.point(3, 4)
|
@@ -36,7 +32,6 @@ module RGeo
|
|
36
32
|
@degenerate_seg = ::RGeo::Cartesian::Segment.new(@point5, @point5)
|
37
33
|
end
|
38
34
|
|
39
|
-
|
40
35
|
def assert_close_enough(v1_, v2_)
|
41
36
|
diff_ = (v1_ - v2_).abs
|
42
37
|
# denom_ = (v1_ + v2_).abs
|
@@ -44,7 +39,6 @@ module RGeo
|
|
44
39
|
assert(diff_ < 0.00000001, "#{v1_} is not close to #{v2_}")
|
45
40
|
end
|
46
41
|
|
47
|
-
|
48
42
|
def test_segment_degenerate
|
49
43
|
assert(@degenerate_seg.degenerate?)
|
50
44
|
assert_equal(0, @degenerate_seg.dx)
|
@@ -53,7 +47,6 @@ module RGeo
|
|
53
47
|
assert_equal(@point5, @degenerate_seg.e)
|
54
48
|
end
|
55
49
|
|
56
|
-
|
57
50
|
def test_segment_basic
|
58
51
|
assert(!@short_rising_seg.degenerate?)
|
59
52
|
assert_equal(2, @short_rising_seg.dx)
|
@@ -62,20 +55,17 @@ module RGeo
|
|
62
55
|
assert_equal(@point2, @short_rising_seg.e)
|
63
56
|
end
|
64
57
|
|
65
|
-
|
66
58
|
def test_segment_side_basic
|
67
59
|
assert_equal(0.0, @short_rising_seg.side(@point5))
|
68
60
|
assert(@short_rising_seg.side(@point4) > 0.0)
|
69
61
|
assert(@short_rising_seg.side(@point6) < 0.0)
|
70
62
|
end
|
71
63
|
|
72
|
-
|
73
64
|
def test_segment_tproj_basic
|
74
65
|
assert_equal(-2, @short_rising_seg.tproj(@point5))
|
75
|
-
assert_close_enough(2.0/3.0, @long_rising_seg.tproj(@point1))
|
66
|
+
assert_close_enough(2.0 / 3.0, @long_rising_seg.tproj(@point1))
|
76
67
|
end
|
77
68
|
|
78
|
-
|
79
69
|
def test_segment_contains_point
|
80
70
|
assert(@long_rising_seg.contains_point?(@point1))
|
81
71
|
assert(@long_rising_seg.contains_point?(@point2))
|
@@ -83,7 +73,6 @@ module RGeo
|
|
83
73
|
assert(!@short_rising_seg.contains_point?(@point5))
|
84
74
|
end
|
85
75
|
|
86
|
-
|
87
76
|
def test_segment_intersects_parallel
|
88
77
|
assert(@long_rising_seg.intersects_segment?(@long_rising_seg))
|
89
78
|
assert(!@long_rising_seg.intersects_segment?(@parallel_rising_seg))
|
@@ -93,7 +82,6 @@ module RGeo
|
|
93
82
|
assert(@long_rising_seg.intersects_segment?(@touching_collinear_rising_seg))
|
94
83
|
end
|
95
84
|
|
96
|
-
|
97
85
|
def test_segment_intersects_basic
|
98
86
|
assert(@long_rising_seg.intersects_segment?(@steep_rising_seg))
|
99
87
|
assert(@steep_rising_seg.intersects_segment?(@long_rising_seg))
|
@@ -101,15 +89,11 @@ module RGeo
|
|
101
89
|
assert(!@steep_rising_seg.intersects_segment?(@short_rising_seg))
|
102
90
|
end
|
103
91
|
|
104
|
-
|
105
92
|
def test_segment_intersects_endpoints
|
106
93
|
assert(@horiz_seg.intersects_segment?(@vert_seg))
|
107
94
|
assert(@vert_seg.intersects_segment?(@horiz_seg))
|
108
95
|
end
|
109
|
-
|
110
|
-
|
111
96
|
end
|
112
|
-
|
113
97
|
end
|
114
98
|
end
|
115
99
|
end
|
@@ -4,33 +4,24 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/factory_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/factory_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module SimpleCartesian
|
16
|
-
|
17
|
-
class TestFactory < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module SimpleCartesian # :nodoc:
|
15
|
+
class TestFactory < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
|
-
@factory = ::RGeo::Cartesian.simple_factory(:
|
17
|
+
@factory = ::RGeo::Cartesian.simple_factory(srid: 1000)
|
22
18
|
@srid = 1000
|
23
19
|
end
|
24
20
|
|
25
|
-
|
26
21
|
include ::RGeo::Tests::Common::FactoryTests
|
27
22
|
|
28
|
-
|
29
23
|
undef_method :test_srid_preserved_through_geom_operations
|
30
|
-
|
31
|
-
|
32
24
|
end
|
33
|
-
|
34
25
|
end
|
35
26
|
end
|
36
27
|
end
|
@@ -4,36 +4,27 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/geometry_collection_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/geometry_collection_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module SimpleCartesian
|
16
|
-
|
17
|
-
class TestGeometryCollection < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module SimpleCartesian # :nodoc:
|
15
|
+
class TestGeometryCollection < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def create_factory
|
21
17
|
@factory = ::RGeo::Cartesian.simple_factory
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
20
|
include ::RGeo::Tests::Common::GeometryCollectionTests
|
26
21
|
|
27
|
-
|
28
22
|
undef_method :test_fully_equal
|
29
23
|
undef_method :test_geometrically_equal
|
30
24
|
undef_method :test_empty_equal
|
31
25
|
undef_method :test_not_equal
|
32
26
|
undef_method :test_empty_collection_boundary
|
33
|
-
|
34
|
-
|
35
27
|
end
|
36
|
-
|
37
28
|
end
|
38
29
|
end
|
39
30
|
end
|
@@ -4,37 +4,28 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/line_string_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/line_string_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module SimpleCartesian
|
16
|
-
|
17
|
-
class TestLineString < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module SimpleCartesian # :nodoc:
|
15
|
+
class TestLineString < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
17
|
@factory = ::RGeo::Cartesian.simple_factory
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
20
|
include ::RGeo::Tests::Common::LineStringTests
|
26
21
|
|
27
|
-
|
28
22
|
undef_method :test_fully_equal
|
29
23
|
undef_method :test_geometrically_equal_but_different_type
|
30
24
|
undef_method :test_geometrically_equal_but_different_type2
|
31
25
|
undef_method :test_geometrically_equal_but_different_overlap
|
32
26
|
undef_method :test_empty_equal
|
33
27
|
undef_method :test_not_equal
|
34
|
-
|
35
|
-
|
36
28
|
end
|
37
|
-
|
38
29
|
end
|
39
30
|
end
|
40
31
|
end
|
@@ -4,34 +4,25 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/multi_line_string_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/multi_line_string_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module SimpleCartesian
|
16
|
-
|
17
|
-
class TestMultiLineString < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module SimpleCartesian # :nodoc:
|
15
|
+
class TestMultiLineString < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def create_factory
|
21
17
|
@factory = ::RGeo::Cartesian.simple_factory
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
20
|
include ::RGeo::Tests::Common::MultiLineStringTests
|
26
21
|
|
27
|
-
|
28
22
|
undef_method :test_fully_equal
|
29
23
|
undef_method :test_geometrically_equal
|
30
24
|
undef_method :test_not_equal
|
31
|
-
|
32
|
-
|
33
25
|
end
|
34
|
-
|
35
26
|
end
|
36
27
|
end
|
37
28
|
end
|
@@ -4,37 +4,28 @@
|
|
4
4
|
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
require
|
8
|
-
require
|
9
|
-
|
10
|
-
require ::File.expand_path('../common/multi_point_tests.rb', ::File.dirname(__FILE__))
|
7
|
+
require "test/unit"
|
8
|
+
require "rgeo"
|
11
9
|
|
10
|
+
require ::File.expand_path("../common/multi_point_tests.rb", ::File.dirname(__FILE__))
|
12
11
|
|
13
12
|
module RGeo
|
14
|
-
module Tests
|
15
|
-
module SimpleCartesian
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
def create_factory(opts_={})
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module SimpleCartesian # :nodoc:
|
15
|
+
class TestMultiPoint < ::Test::Unit::TestCase # :nodoc:
|
16
|
+
def create_factory(opts_ = {})
|
21
17
|
@factory = ::RGeo::Cartesian.simple_factory(opts_)
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
20
|
include ::RGeo::Tests::Common::MultiPointTests
|
26
21
|
|
27
|
-
|
28
22
|
undef_method :test_fully_equal
|
29
23
|
undef_method :test_geometrically_equal
|
30
24
|
undef_method :test_not_equal
|
31
25
|
undef_method :test_union
|
32
26
|
undef_method :test_difference
|
33
27
|
undef_method :test_intersection
|
34
|
-
|
35
|
-
|
36
28
|
end
|
37
|
-
|
38
29
|
end
|
39
30
|
end
|
40
31
|
end
|