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,48 +4,38 @@
|
|
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 GeosFFI
|
14
|
-
|
15
|
-
class TestParsingUnparsing < ::Test::Unit::TestCase # :nodoc:
|
16
|
-
|
17
|
-
|
11
|
+
module Tests # :nodoc:
|
12
|
+
module GeosFFI # :nodoc:
|
13
|
+
class TestParsingUnparsing < ::Test::Unit::TestCase # :nodoc:
|
18
14
|
def test_wkt_generator_default_floating_point
|
19
15
|
# Bug report GH-4
|
20
|
-
factory_ = ::RGeo::Geos.factory(:
|
16
|
+
factory_ = ::RGeo::Geos.factory(native_interface: :ffi)
|
21
17
|
point_ = factory_.point(111.99, -40.37)
|
22
|
-
assert_equal(
|
18
|
+
assert_equal("POINT (111.99 -40.37)", point_.as_text)
|
23
19
|
end
|
24
20
|
|
25
|
-
|
26
21
|
def test_wkt_generator_downcase
|
27
|
-
factory_ = ::RGeo::Geos.factory(:
|
28
|
-
|
22
|
+
factory_ = ::RGeo::Geos.factory(wkt_generator: { convert_case: :lower },
|
23
|
+
native_interface: :ffi)
|
29
24
|
point_ = factory_.point(1, 1)
|
30
|
-
assert_equal(
|
25
|
+
assert_equal("point (1.0 1.0)", point_.as_text)
|
31
26
|
end
|
32
27
|
|
33
|
-
|
34
28
|
def test_wkt_generator_geos
|
35
|
-
factory_ = ::RGeo::Geos.factory(:
|
29
|
+
factory_ = ::RGeo::Geos.factory(wkt_generator: :geos, native_interface: :ffi)
|
36
30
|
point_ = factory_.point(1, 1)
|
37
|
-
assert_equal(
|
31
|
+
assert_equal("POINT (1.0000000000000000 1.0000000000000000)", point_.as_text)
|
38
32
|
end
|
39
33
|
|
40
|
-
|
41
34
|
def test_wkt_parser_default_with_non_geosable_input
|
42
|
-
factory_ = ::RGeo::Geos.factory(:
|
43
|
-
assert_not_nil(factory_.parse_wkt(
|
35
|
+
factory_ = ::RGeo::Geos.factory(native_interface: :ffi)
|
36
|
+
assert_not_nil(factory_.parse_wkt("Point (1 1)"))
|
44
37
|
end
|
45
|
-
|
46
|
-
|
47
38
|
end
|
48
|
-
|
49
39
|
end
|
50
40
|
end
|
51
41
|
end if ::RGeo::Geos.ffi_supported?
|
data/test/geos_ffi/tc_point.rb
CHANGED
@@ -4,36 +4,29 @@
|
|
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 GeosFFI
|
16
|
-
|
17
|
-
class TestPoint < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module GeosFFI # :nodoc:
|
15
|
+
class TestPoint < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
|
-
@factory = ::RGeo::Geos.factory(:
|
22
|
-
@zfactory = ::RGeo::Geos.factory(:
|
23
|
-
@mfactory = ::RGeo::Geos.factory(:
|
24
|
-
@zmfactory = ::RGeo::Geos.factory(:
|
25
|
-
|
17
|
+
@factory = ::RGeo::Geos.factory(native_interface: :ffi, buffer_resolution: 8)
|
18
|
+
@zfactory = ::RGeo::Geos.factory(has_z_coordinate: true, native_interface: :ffi)
|
19
|
+
@mfactory = ::RGeo::Geos.factory(has_m_coordinate: true, native_interface: :ffi)
|
20
|
+
@zmfactory = ::RGeo::Geos.factory(has_z_coordinate: true, has_m_coordinate: true,
|
21
|
+
native_interface: :ffi)
|
26
22
|
end
|
27
23
|
|
28
|
-
|
29
24
|
include ::RGeo::Tests::Common::PointTests
|
30
25
|
|
31
|
-
|
32
26
|
# TEMP until ffi-geos 0.0.5 is released
|
33
27
|
undef_method :test_buffer
|
34
28
|
# END_TEMP
|
35
29
|
|
36
|
-
|
37
30
|
def test_is_geos
|
38
31
|
point_ = @factory.point(21, -22)
|
39
32
|
assert_equal(true, ::RGeo::Geos.is_geos?(point_))
|
@@ -45,19 +38,16 @@ module RGeo
|
|
45
38
|
assert_equal(true, ::RGeo::Geos.is_ffi_geos?(point2_))
|
46
39
|
end
|
47
40
|
|
48
|
-
|
49
41
|
def test_has_no_projection
|
50
42
|
point_ = @factory.point(21, -22)
|
51
43
|
assert(!point_.respond_to?(:projection))
|
52
44
|
end
|
53
45
|
|
54
|
-
|
55
46
|
def test_srid
|
56
47
|
point_ = @factory.point(11, 12)
|
57
48
|
assert_equal(0, point_.srid)
|
58
49
|
end
|
59
50
|
|
60
|
-
|
61
51
|
def test_distance
|
62
52
|
point1_ = @factory.point(11, 12)
|
63
53
|
point2_ = @factory.point(11, 12)
|
@@ -66,27 +56,22 @@ module RGeo
|
|
66
56
|
assert_equal(2, point1_.distance(point3_))
|
67
57
|
end
|
68
58
|
|
69
|
-
|
70
59
|
if defined?(::Encoding)
|
71
60
|
|
72
61
|
def test_as_text_encoding
|
73
|
-
factory_ = ::RGeo::Geos.factory(:
|
62
|
+
factory_ = ::RGeo::Geos.factory(native_interface: :ffi, wkt_generator: :geos)
|
74
63
|
point_ = factory_.point(11, 12)
|
75
64
|
assert_equal(::Encoding::US_ASCII, point_.as_text.encoding)
|
76
65
|
end
|
77
66
|
|
78
|
-
|
79
67
|
def test_as_binary_encoding
|
80
|
-
factory_ = ::RGeo::Geos.factory(:
|
68
|
+
factory_ = ::RGeo::Geos.factory(native_interface: :ffi, wkb_generator: :geos)
|
81
69
|
point_ = factory_.point(11, 12)
|
82
70
|
assert_equal(::Encoding::ASCII_8BIT, point_.as_binary.encoding)
|
83
71
|
end
|
84
72
|
|
85
73
|
end
|
86
|
-
|
87
|
-
|
88
74
|
end
|
89
|
-
|
90
75
|
end
|
91
76
|
end
|
92
77
|
end if ::RGeo::Geos.ffi_supported?
|
data/test/geos_ffi/tc_polygon.rb
CHANGED
@@ -4,27 +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 GeosFFI
|
16
|
-
|
17
|
-
class TestPolygon < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module GeosFFI # :nodoc:
|
15
|
+
class TestPolygon < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
|
-
@factory = ::RGeo::Geos.factory(:
|
17
|
+
@factory = ::RGeo::Geos.factory(native_interface: :ffi)
|
22
18
|
end
|
23
19
|
|
24
|
-
|
25
20
|
include ::RGeo::Tests::Common::PolygonTests
|
26
21
|
|
27
|
-
|
28
22
|
def test_intersection
|
29
23
|
point1_ = @factory.point(0, 0)
|
30
24
|
point2_ = @factory.point(0, 2)
|
@@ -36,7 +30,6 @@ module RGeo
|
|
36
30
|
assert_equal(poly2_, poly3_)
|
37
31
|
end
|
38
32
|
|
39
|
-
|
40
33
|
def test_union
|
41
34
|
point1_ = @factory.point(0, 0)
|
42
35
|
point2_ = @factory.point(0, 2)
|
@@ -47,10 +40,7 @@ module RGeo
|
|
47
40
|
poly3_ = poly1_.union(poly2_)
|
48
41
|
assert_equal(poly1_, poly3_)
|
49
42
|
end
|
50
|
-
|
51
|
-
|
52
43
|
end
|
53
|
-
|
54
44
|
end
|
55
45
|
end
|
56
46
|
end if ::RGeo::Geos.ffi_supported?
|
@@ -4,36 +4,29 @@
|
|
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 GeosFFI
|
16
|
-
|
17
|
-
class TestZMFactory < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module GeosFFI # :nodoc:
|
15
|
+
class TestZMFactory < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def setup
|
21
|
-
@factory = ::RGeo::Geos.factory(:
|
22
|
-
|
17
|
+
@factory = ::RGeo::Geos.factory(has_z_coordinate: true, has_m_coordinate: true,
|
18
|
+
srid: 1000, buffer_resolution: 2, native_interface: :ffi)
|
23
19
|
@srid = 1000
|
24
20
|
end
|
25
21
|
|
26
|
-
|
27
22
|
include ::RGeo::Tests::Common::FactoryTests
|
28
23
|
|
29
|
-
|
30
24
|
def test_is_geos_factory
|
31
25
|
assert_equal(true, ::RGeo::Geos.is_geos?(@factory))
|
32
26
|
assert_equal(false, ::RGeo::Geos.is_capi_geos?(@factory))
|
33
27
|
assert_equal(true, ::RGeo::Geos.is_ffi_geos?(@factory))
|
34
28
|
end
|
35
29
|
|
36
|
-
|
37
30
|
def test_factory_parts
|
38
31
|
assert_equal(1000, @factory.srid)
|
39
32
|
assert_equal(1000, @factory.z_factory.srid)
|
@@ -49,7 +42,6 @@ module RGeo
|
|
49
42
|
assert(@factory.m_factory.property(:has_m_coordinate))
|
50
43
|
end
|
51
44
|
|
52
|
-
|
53
45
|
def test_4d_point
|
54
46
|
point_ = @factory.point(1, 2, 3, 4)
|
55
47
|
assert_equal(Feature::Point, point_.geometry_type)
|
@@ -60,10 +52,7 @@ module RGeo
|
|
60
52
|
assert_nil(point_.m_geometry.z)
|
61
53
|
assert_equal(4, point_.m_geometry.m)
|
62
54
|
end
|
63
|
-
|
64
|
-
|
65
55
|
end
|
66
|
-
|
67
56
|
end
|
68
57
|
end
|
69
58
|
end if ::RGeo::Geos.ffi_supported?
|
@@ -4,30 +4,22 @@
|
|
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 ProjectedGeographic
|
16
|
-
|
17
|
-
class TestFactory < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestFactory < ::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
|
@srid = 4326
|
23
19
|
end
|
24
20
|
|
25
|
-
|
26
21
|
include ::RGeo::Tests::Common::FactoryTests
|
27
|
-
|
28
|
-
|
29
22
|
end
|
30
|
-
|
31
23
|
end
|
32
24
|
end
|
33
25
|
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/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 ProjectedGeographic
|
16
|
-
|
17
|
-
class TestGeometryCollection < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestGeometryCollection < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def create_factory
|
21
|
-
::RGeo::Geographic.projected_factory(:
|
17
|
+
::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::GeometryCollectionTests
|
26
|
-
|
27
|
-
|
28
21
|
end
|
29
|
-
|
30
22
|
end
|
31
23
|
end
|
32
24
|
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/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 ProjectedGeographic
|
16
|
-
|
17
|
-
class TestLineString < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestLineString < ::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::LineStringTests
|
26
|
-
|
27
|
-
|
28
21
|
end
|
29
|
-
|
30
22
|
end
|
31
23
|
end
|
32
24
|
end if ::RGeo::CoordSys::Proj4.supported?
|
@@ -4,32 +4,23 @@
|
|
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 ProjectedGeographic
|
16
|
-
|
17
|
-
class TestMultiLineString < ::Test::Unit::TestCase # :nodoc:
|
18
|
-
|
19
|
-
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestMultiLineString < ::Test::Unit::TestCase # :nodoc:
|
20
16
|
def create_factory
|
21
|
-
::RGeo::Geographic.projected_factory(:
|
17
|
+
::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::MultiLineStringTests
|
26
21
|
|
27
|
-
|
28
22
|
undef_method :test_length
|
29
|
-
|
30
|
-
|
31
23
|
end
|
32
|
-
|
33
24
|
end
|
34
25
|
end
|
35
26
|
end if ::RGeo::CoordSys::Proj4.supported?
|
@@ -4,36 +4,27 @@
|
|
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 ProjectedGeographic
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
def create_factory(opts_={})
|
13
|
+
module Tests # :nodoc:
|
14
|
+
module ProjectedGeographic # :nodoc:
|
15
|
+
class TestMultiPoint < ::Test::Unit::TestCase # :nodoc:
|
16
|
+
def create_factory(opts_ = {})
|
21
17
|
::RGeo::Geographic.projected_factory(opts_.merge(
|
22
|
-
|
18
|
+
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))
|
23
19
|
end
|
24
20
|
|
25
|
-
|
26
21
|
include ::RGeo::Tests::Common::MultiPointTests
|
27
22
|
|
28
|
-
|
29
23
|
# These tests suffer from floating point issues
|
30
24
|
undef_method :test_union
|
31
25
|
undef_method :test_difference
|
32
26
|
undef_method :test_intersection
|
33
|
-
|
34
|
-
|
35
27
|
end
|
36
|
-
|
37
28
|
end
|
38
29
|
end
|
39
30
|
end if ::RGeo::CoordSys::Proj4.supported?
|