rgeo 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/README.rdoc +1 -1
- data/Version +1 -1
- data/ext/geos_c_impl/extconf.rb +13 -13
- data/ext/geos_c_impl/factory.c +30 -18
- data/ext/geos_c_impl/factory.h +18 -12
- data/ext/geos_c_impl/geometry.c +11 -11
- data/ext/geos_c_impl/geometry.h +7 -7
- data/ext/geos_c_impl/geometry_collection.c +15 -15
- data/ext/geos_c_impl/geometry_collection.h +8 -8
- data/ext/geos_c_impl/line_string.c +14 -14
- data/ext/geos_c_impl/line_string.h +7 -7
- data/ext/geos_c_impl/main.c +7 -7
- data/ext/geos_c_impl/point.c +9 -9
- data/ext/geos_c_impl/point.h +7 -7
- data/ext/geos_c_impl/polygon.c +9 -9
- data/ext/geos_c_impl/polygon.h +7 -7
- data/ext/geos_c_impl/preface.h +7 -7
- data/ext/proj4_c_impl/extconf.rb +13 -13
- data/ext/proj4_c_impl/main.c +12 -12
- data/lib/rgeo.rb +26 -26
- data/lib/rgeo/cartesian.rb +12 -12
- data/lib/rgeo/cartesian/analysis.rb +26 -26
- data/lib/rgeo/cartesian/bounding_box.rb +83 -83
- data/lib/rgeo/cartesian/calculations.rb +36 -36
- data/lib/rgeo/cartesian/factory.rb +78 -78
- data/lib/rgeo/cartesian/feature_classes.rb +74 -74
- data/lib/rgeo/cartesian/feature_methods.rb +34 -34
- data/lib/rgeo/cartesian/interface.rb +33 -33
- data/lib/rgeo/coord_sys.rb +15 -15
- data/lib/rgeo/coord_sys/cs/entities.rb +533 -534
- data/lib/rgeo/coord_sys/cs/factories.rb +69 -69
- data/lib/rgeo/coord_sys/cs/wkt_parser.rb +44 -44
- data/lib/rgeo/coord_sys/proj4.rb +85 -85
- data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +31 -31
- data/lib/rgeo/coord_sys/srs_database/interface.rb +44 -44
- data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +31 -31
- data/lib/rgeo/coord_sys/srs_database/sr_org.rb +31 -31
- data/lib/rgeo/coord_sys/srs_database/url_reader.rb +29 -29
- data/lib/rgeo/error.rb +17 -17
- data/lib/rgeo/feature.rb +15 -15
- data/lib/rgeo/feature/curve.rb +58 -58
- data/lib/rgeo/feature/factory.rb +84 -84
- data/lib/rgeo/feature/factory_generator.rb +32 -32
- data/lib/rgeo/feature/geometry.rb +215 -215
- data/lib/rgeo/feature/geometry_collection.rb +46 -46
- data/lib/rgeo/feature/line.rb +21 -21
- data/lib/rgeo/feature/line_string.rb +35 -35
- data/lib/rgeo/feature/linear_ring.rb +20 -20
- data/lib/rgeo/feature/mixins.rb +61 -61
- data/lib/rgeo/feature/multi_curve.rb +37 -37
- data/lib/rgeo/feature/multi_line_string.rb +20 -20
- data/lib/rgeo/feature/multi_point.rb +22 -22
- data/lib/rgeo/feature/multi_polygon.rb +28 -28
- data/lib/rgeo/feature/multi_surface.rb +39 -39
- data/lib/rgeo/feature/point.rb +42 -42
- data/lib/rgeo/feature/polygon.rb +50 -50
- data/lib/rgeo/feature/surface.rb +42 -42
- data/lib/rgeo/feature/types.rb +58 -58
- data/lib/rgeo/geographic.rb +14 -14
- data/lib/rgeo/geographic/factory.rb +87 -87
- data/lib/rgeo/geographic/interface.rb +55 -55
- data/lib/rgeo/geographic/proj4_projector.rb +35 -35
- data/lib/rgeo/geographic/projected_feature_classes.rb +95 -95
- data/lib/rgeo/geographic/projected_feature_methods.rb +81 -81
- data/lib/rgeo/geographic/projected_window.rb +103 -103
- data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -32
- data/lib/rgeo/geographic/spherical_feature_classes.rb +93 -93
- data/lib/rgeo/geographic/spherical_feature_methods.rb +25 -25
- data/lib/rgeo/geographic/spherical_math.rb +58 -58
- data/lib/rgeo/geos.rb +22 -17
- data/lib/rgeo/geos/factory.rb +93 -93
- data/lib/rgeo/geos/ffi_classes.rb +306 -231
- data/lib/rgeo/geos/ffi_factory.rb +100 -96
- data/lib/rgeo/geos/impl_additions.rb +22 -22
- data/lib/rgeo/geos/interface.rb +45 -45
- data/lib/rgeo/geos/zm_factory.rb +90 -90
- data/lib/rgeo/geos/zm_impl.rb +167 -167
- data/lib/rgeo/impl_helper.rb +11 -11
- data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +71 -71
- data/lib/rgeo/impl_helper/basic_geometry_methods.rb +29 -29
- data/lib/rgeo/impl_helper/basic_line_string_methods.rb +61 -61
- data/lib/rgeo/impl_helper/basic_point_methods.rb +43 -43
- data/lib/rgeo/impl_helper/basic_polygon_methods.rb +35 -35
- data/lib/rgeo/impl_helper/math.rb +13 -13
- data/lib/rgeo/version.rb +10 -10
- data/lib/rgeo/wkrep.rb +16 -16
- data/lib/rgeo/wkrep/wkb_generator.rb +51 -51
- data/lib/rgeo/wkrep/wkb_parser.rb +52 -52
- data/lib/rgeo/wkrep/wkt_generator.rb +51 -51
- data/lib/rgeo/wkrep/wkt_parser.rb +66 -66
- data/lib/rgeo/yaml.rb +14 -14
- data/test/common/geometry_collection_tests.rb +53 -53
- data/test/common/line_string_tests.rb +57 -57
- data/test/common/multi_line_string_tests.rb +43 -43
- data/test/common/multi_point_tests.rb +43 -43
- data/test/common/multi_polygon_tests.rb +43 -43
- data/test/common/point_tests.rb +75 -75
- data/test/common/polygon_tests.rb +37 -37
- data/test/coord_sys/tc_active_record_table.rb +25 -25
- data/test/coord_sys/tc_ogc_cs.rb +72 -72
- data/test/coord_sys/tc_proj4.rb +51 -51
- data/test/coord_sys/tc_proj4_srs_data.rb +17 -17
- data/test/coord_sys/tc_sr_org.rb +15 -15
- data/test/coord_sys/tc_url_reader.rb +19 -19
- data/test/geos_capi/tc_factory.rb +21 -21
- data/test/geos_capi/tc_geometry_collection.rb +15 -15
- data/test/geos_capi/tc_line_string.rb +15 -15
- data/test/geos_capi/tc_misc.rb +33 -22
- data/test/geos_capi/tc_multi_line_string.rb +15 -15
- data/test/geos_capi/tc_multi_point.rb +15 -15
- data/test/geos_capi/tc_multi_polygon.rb +15 -15
- data/test/geos_capi/tc_parsing_unparsing.rb +19 -19
- data/test/geos_capi/tc_point.rb +21 -21
- data/test/geos_capi/tc_polygon.rb +19 -19
- data/test/geos_capi/tc_zmfactory.rb +17 -17
- data/test/geos_ffi/tc_factory.rb +21 -21
- data/test/geos_ffi/tc_geometry_collection.rb +15 -15
- data/test/geos_ffi/tc_line_string.rb +15 -15
- data/test/geos_ffi/tc_misc.rb +49 -15
- data/test/geos_ffi/tc_multi_line_string.rb +15 -15
- data/test/geos_ffi/tc_multi_point.rb +15 -15
- data/test/geos_ffi/tc_multi_polygon.rb +15 -15
- data/test/geos_ffi/tc_parsing_unparsing.rb +19 -19
- data/test/geos_ffi/tc_point.rb +21 -21
- data/test/geos_ffi/tc_polygon.rb +19 -19
- data/test/geos_ffi/tc_zmfactory.rb +17 -17
- data/test/projected_geographic/tc_geometry_collection.rb +15 -15
- data/test/projected_geographic/tc_line_string.rb +15 -15
- data/test/projected_geographic/tc_multi_line_string.rb +15 -15
- data/test/projected_geographic/tc_multi_point.rb +15 -15
- data/test/projected_geographic/tc_multi_polygon.rb +15 -15
- data/test/projected_geographic/tc_point.rb +23 -23
- data/test/projected_geographic/tc_polygon.rb +15 -15
- data/test/simple_cartesian/tc_calculations.rb +31 -31
- data/test/simple_cartesian/tc_geometry_collection.rb +17 -17
- data/test/simple_cartesian/tc_line_string.rb +17 -17
- data/test/simple_cartesian/tc_multi_line_string.rb +17 -17
- data/test/simple_cartesian/tc_multi_point.rb +17 -17
- data/test/simple_cartesian/tc_multi_polygon.rb +17 -17
- data/test/simple_cartesian/tc_point.rb +21 -21
- data/test/simple_cartesian/tc_polygon.rb +17 -17
- data/test/simple_mercator/tc_geometry_collection.rb +15 -15
- data/test/simple_mercator/tc_line_string.rb +15 -15
- data/test/simple_mercator/tc_multi_line_string.rb +15 -15
- data/test/simple_mercator/tc_multi_point.rb +15 -15
- data/test/simple_mercator/tc_multi_polygon.rb +15 -15
- data/test/simple_mercator/tc_point.rb +23 -23
- data/test/simple_mercator/tc_polygon.rb +15 -15
- data/test/simple_mercator/tc_window.rb +50 -50
- data/test/spherical_geographic/tc_calculations.rb +47 -47
- data/test/spherical_geographic/tc_geometry_collection.rb +17 -17
- data/test/spherical_geographic/tc_line_string.rb +17 -17
- data/test/spherical_geographic/tc_multi_line_string.rb +17 -17
- data/test/spherical_geographic/tc_multi_point.rb +17 -17
- data/test/spherical_geographic/tc_multi_polygon.rb +17 -17
- data/test/spherical_geographic/tc_point.rb +23 -23
- data/test/spherical_geographic/tc_polygon.rb +17 -17
- data/test/tc_cartesian_analysis.rb +23 -23
- data/test/tc_mixins.rb +39 -39
- data/test/tc_oneoff.rb +15 -15
- data/test/tc_types.rb +17 -17
- data/test/wkrep/tc_wkb_generator.rb +67 -67
- data/test/wkrep/tc_wkb_parser.rb +73 -73
- data/test/wkrep/tc_wkt_generator.rb +75 -75
- data/test/wkrep/tc_wkt_parser.rb +97 -97
- metadata +3 -3
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Geometry collection methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -37,7 +37,7 @@
|
|
37
37
|
|
38
38
|
#ifndef RGEO_GEOS_GEOMETRY_COLLECTION_INCLUDED
|
39
39
|
#define RGEO_GEOS_GEOMETRY_COLLECTION_INCLUDED
|
40
|
-
|
40
|
+
|
41
41
|
#include <ruby.h>
|
42
42
|
#include <geos_c.h>
|
43
43
|
|
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Line string methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -469,7 +469,7 @@ static VALUE cmethod_create_line(VALUE module, VALUE factory, VALUE start, VALUE
|
|
469
469
|
has_z = (char)(factory_data->flags & RGEO_FACTORYFLAGS_SUPPORTS_Z_OR_M);
|
470
470
|
point_type = factory_data->globals->feature_point;
|
471
471
|
context = factory_data->geos_context;
|
472
|
-
|
472
|
+
|
473
473
|
start_geom = rgeo_convert_to_geos_geometry(factory, start, point_type);
|
474
474
|
if (start_geom) {
|
475
475
|
end_geom = rgeo_convert_to_geos_geometry(factory, end, point_type);
|
@@ -485,7 +485,7 @@ static VALUE cmethod_create_line(VALUE module, VALUE factory, VALUE start, VALUE
|
|
485
485
|
}
|
486
486
|
}
|
487
487
|
}
|
488
|
-
|
488
|
+
|
489
489
|
return result;
|
490
490
|
}
|
491
491
|
|
@@ -554,19 +554,19 @@ void rgeo_init_geos_line_string(RGeo_Globals* globals)
|
|
554
554
|
rb_const_get_at(globals->feature_module, rb_intern("Curve")), geos_line_string_class);
|
555
555
|
rb_funcall(globals->global_mixins, rb_intern("include_in_class"), 2,
|
556
556
|
globals->feature_line_string, geos_line_string_class);
|
557
|
-
|
557
|
+
|
558
558
|
geos_linear_ring_class = rb_define_class_under(globals->geos_module, "LinearRingImpl", geos_line_string_class);
|
559
559
|
globals->geos_linear_ring = geos_linear_ring_class;
|
560
560
|
globals->feature_linear_ring = rb_const_get_at(globals->feature_module, rb_intern("LinearRing"));
|
561
561
|
rb_funcall(globals->global_mixins, rb_intern("include_in_class"), 2,
|
562
562
|
globals->feature_linear_ring, geos_linear_ring_class);
|
563
|
-
|
563
|
+
|
564
564
|
geos_line_class = rb_define_class_under(globals->geos_module, "LineImpl", geos_line_string_class);
|
565
565
|
globals->geos_line = geos_line_class;
|
566
566
|
globals->feature_line = rb_const_get_at(globals->feature_module, rb_intern("Line"));
|
567
567
|
rb_funcall(globals->global_mixins, rb_intern("include_in_class"), 2,
|
568
568
|
globals->feature_line, geos_line_class);
|
569
|
-
|
569
|
+
|
570
570
|
rb_define_module_function(geos_line_string_class, "create", cmethod_create_line_string, 2);
|
571
571
|
rb_define_module_function(geos_line_string_class, "_copy_from", cmethod_line_string_copy_from, 2);
|
572
572
|
rb_define_method(geos_line_string_class, "eql?", method_line_string_eql, 1);
|
@@ -579,11 +579,11 @@ void rgeo_init_geos_line_string(RGeo_Globals* globals)
|
|
579
579
|
rb_define_method(geos_line_string_class, "end_point", method_line_string_end_point, 0);
|
580
580
|
rb_define_method(geos_line_string_class, "is_closed?", method_line_string_is_closed, 0);
|
581
581
|
rb_define_method(geos_line_string_class, "is_ring?", method_line_string_is_ring, 0);
|
582
|
-
|
582
|
+
|
583
583
|
rb_define_module_function(geos_linear_ring_class, "create", cmethod_create_linear_ring, 2);
|
584
584
|
rb_define_module_function(geos_linear_ring_class, "_copy_from", cmethod_linear_ring_copy_from, 2);
|
585
585
|
rb_define_method(geos_linear_ring_class, "geometry_type", method_linear_ring_geometry_type, 0);
|
586
|
-
|
586
|
+
|
587
587
|
rb_define_module_function(geos_line_class, "create", cmethod_create_line, 3);
|
588
588
|
rb_define_module_function(geos_line_class, "_copy_from", cmethod_line_copy_from, 2);
|
589
589
|
rb_define_method(geos_line_class, "geometry_type", method_line_geometry_type, 0);
|
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Line string methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
data/ext/geos_c_impl/main.c
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Main initializer for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
data/ext/geos_c_impl/point.c
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Point methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -182,9 +182,9 @@ void rgeo_init_geos_point(RGeo_Globals* globals)
|
|
182
182
|
globals->feature_point = rb_const_get_at(globals->feature_module, rb_intern("Point"));
|
183
183
|
rb_funcall(globals->global_mixins, rb_intern("include_in_class"), 2,
|
184
184
|
globals->feature_point, geos_point_class);
|
185
|
-
|
185
|
+
|
186
186
|
rb_define_module_function(geos_point_class, "create", cmethod_create, 4);
|
187
|
-
|
187
|
+
|
188
188
|
rb_define_method(geos_point_class, "eql?", method_point_eql, 1);
|
189
189
|
rb_define_method(geos_point_class, "geometry_type", method_point_geometry_type, 0);
|
190
190
|
rb_define_method(geos_point_class, "x", method_point_x, 0);
|
data/ext/geos_c_impl/point.h
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Point methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
data/ext/geos_c_impl/polygon.c
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Polygon methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -281,9 +281,9 @@ void rgeo_init_geos_polygon(RGeo_Globals* globals)
|
|
281
281
|
rb_const_get_at(globals->feature_module, rb_intern("Surface")), geos_polygon_class);
|
282
282
|
rb_funcall(globals->global_mixins, rb_intern("include_in_class"), 2,
|
283
283
|
globals->feature_polygon, geos_polygon_class);
|
284
|
-
|
284
|
+
|
285
285
|
rb_define_module_function(geos_polygon_class, "create", cmethod_create, 3);
|
286
|
-
|
286
|
+
|
287
287
|
rb_define_method(geos_polygon_class, "eql?", method_polygon_eql, 1);
|
288
288
|
rb_define_method(geos_polygon_class, "geometry_type", method_polygon_geometry_type, 0);
|
289
289
|
rb_define_method(geos_polygon_class, "area", method_polygon_area, 0);
|
data/ext/geos_c_impl/polygon.h
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Polygon methods for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
data/ext/geos_c_impl/preface.h
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Preface header for GEOS wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
data/ext/proj4_c_impl/extconf.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# -----------------------------------------------------------------------------
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Makefile builder for Proj4 wrapper
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# -----------------------------------------------------------------------------
|
6
|
-
# Copyright 2010 Daniel Azuma
|
7
|
-
#
|
6
|
+
# Copyright 2010-2012 Daniel Azuma
|
7
|
+
#
|
8
8
|
# All rights reserved.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# Redistribution and use in source and binary forms, with or without
|
11
11
|
# modification, are permitted provided that the following conditions are met:
|
12
|
-
#
|
12
|
+
#
|
13
13
|
# * Redistributions of source code must retain the above copyright notice,
|
14
14
|
# this list of conditions and the following disclaimer.
|
15
15
|
# * Redistributions in binary form must reproduce the above copyright notice,
|
@@ -18,7 +18,7 @@
|
|
18
18
|
# * Neither the name of the copyright holder, nor the names of any other
|
19
19
|
# contributors to this software, may be used to endorse or promote products
|
20
20
|
# derived from this software without specific prior written permission.
|
21
|
-
#
|
21
|
+
#
|
22
22
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
23
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
24
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -35,13 +35,13 @@
|
|
35
35
|
|
36
36
|
|
37
37
|
if ::RUBY_DESCRIPTION =~ /^jruby\s/
|
38
|
-
|
38
|
+
|
39
39
|
::File.open('Makefile', 'w'){ |f_| f_.write(".PHONY: install\ninstall:\n") }
|
40
|
-
|
40
|
+
|
41
41
|
else
|
42
|
-
|
42
|
+
|
43
43
|
require 'mkmf'
|
44
|
-
|
44
|
+
|
45
45
|
header_dirs_ =
|
46
46
|
[
|
47
47
|
'/usr/local/include',
|
@@ -70,7 +70,7 @@ else
|
|
70
70
|
]
|
71
71
|
header_dirs_.delete_if{ |path_| !::File.directory?(path_) }
|
72
72
|
lib_dirs_.delete_if{ |path_| !::File.directory?(path_) }
|
73
|
-
|
73
|
+
|
74
74
|
found_proj_ = false
|
75
75
|
header_dirs_, lib_dirs_ = dir_config('proj', header_dirs_, lib_dirs_)
|
76
76
|
if have_header('proj_api.h')
|
@@ -86,5 +86,5 @@ else
|
|
86
86
|
puts "**** Compiling without Proj support."
|
87
87
|
end
|
88
88
|
create_makefile('rgeo/coord_sys/proj4_c_impl')
|
89
|
-
|
89
|
+
|
90
90
|
end
|
data/ext/proj4_c_impl/main.c
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
-----------------------------------------------------------------------------
|
3
|
-
|
3
|
+
|
4
4
|
Main initializer for Proj4 wrapper
|
5
|
-
|
5
|
+
|
6
6
|
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2010 Daniel Azuma
|
8
|
-
|
7
|
+
Copyright 2010-2012 Daniel Azuma
|
8
|
+
|
9
9
|
All rights reserved.
|
10
|
-
|
10
|
+
|
11
11
|
Redistribution and use in source and binary forms, with or without
|
12
12
|
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
13
|
+
|
14
14
|
* Redistributions of source code must retain the above copyright notice,
|
15
15
|
this list of conditions and the following disclaimer.
|
16
16
|
* Redistributions in binary form must reproduce the above copyright notice,
|
@@ -19,7 +19,7 @@
|
|
19
19
|
* Neither the name of the copyright holder, nor the names of any other
|
20
20
|
contributors to this software, may be used to endorse or promote products
|
21
21
|
derived from this software without specific prior written permission.
|
22
|
-
|
22
|
+
|
23
23
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
24
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
25
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
@@ -125,7 +125,7 @@ static VALUE method_proj4_initialize_copy(VALUE self, VALUE orig)
|
|
125
125
|
self_data->pj = NULL;
|
126
126
|
self_data->original_str = Qnil;
|
127
127
|
}
|
128
|
-
|
128
|
+
|
129
129
|
// Copy value from orig
|
130
130
|
orig_data = RGEO_PROJ4_DATA_PTR(orig);
|
131
131
|
if (!NIL_P(orig_data->original_str)) {
|
@@ -138,7 +138,7 @@ static VALUE method_proj4_initialize_copy(VALUE self, VALUE orig)
|
|
138
138
|
}
|
139
139
|
self_data->original_str = orig_data->original_str;
|
140
140
|
self_data->uses_radians = orig_data->uses_radians;
|
141
|
-
|
141
|
+
|
142
142
|
return self;
|
143
143
|
}
|
144
144
|
|
@@ -149,7 +149,7 @@ static VALUE method_proj4_set_value(VALUE self, VALUE str, VALUE uses_radians)
|
|
149
149
|
projPJ pj;
|
150
150
|
|
151
151
|
Check_Type(str, T_STRING);
|
152
|
-
|
152
|
+
|
153
153
|
// Clear out any existing value
|
154
154
|
self_data = RGEO_PROJ4_DATA_PTR(self);
|
155
155
|
pj = self_data->pj;
|
@@ -158,12 +158,12 @@ static VALUE method_proj4_set_value(VALUE self, VALUE str, VALUE uses_radians)
|
|
158
158
|
self_data->pj = NULL;
|
159
159
|
self_data->original_str = Qnil;
|
160
160
|
}
|
161
|
-
|
161
|
+
|
162
162
|
// Set new data
|
163
163
|
self_data->pj = pj_init_plus(RSTRING_PTR(str));
|
164
164
|
self_data->original_str = str;
|
165
165
|
self_data->uses_radians = RTEST(uses_radians) ? 1 : 0;
|
166
|
-
|
166
|
+
|
167
167
|
return self;
|
168
168
|
}
|
169
169
|
|