rgeo 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +29 -0
  3. data/ext/geos_c_impl/Makefile_2.2.3 +260 -0
  4. data/ext/geos_c_impl/coordinates.c +65 -0
  5. data/ext/geos_c_impl/coordinates.h +2 -0
  6. data/ext/geos_c_impl/extconf.rb +19 -43
  7. data/ext/geos_c_impl/geometry.c +24 -0
  8. data/ext/geos_c_impl/geometry_collection.c +99 -1
  9. data/ext/geos_c_impl/geos_c_impl_2.2.3.bundle +0 -0
  10. data/ext/geos_c_impl/line_string.c +38 -0
  11. data/ext/geos_c_impl/mkmf.log +123 -0
  12. data/ext/geos_c_impl/point.c +27 -0
  13. data/ext/geos_c_impl/polygon.c +26 -0
  14. data/ext/proj4_c_impl/Makefile_2.2.3 +260 -0
  15. data/ext/proj4_c_impl/extconf.rb +32 -32
  16. data/ext/proj4_c_impl/mkmf.log +47 -0
  17. data/ext/proj4_c_impl/proj4_c_impl_2.2.3.bundle +0 -0
  18. data/lib/rgeo.rb +10 -11
  19. data/lib/rgeo/cartesian.rb +7 -12
  20. data/lib/rgeo/cartesian/analysis.rb +13 -26
  21. data/lib/rgeo/cartesian/bounding_box.rb +45 -114
  22. data/lib/rgeo/cartesian/calculations.rb +3 -21
  23. data/lib/rgeo/cartesian/factory.rb +101 -122
  24. data/lib/rgeo/cartesian/feature_classes.rb +9 -59
  25. data/lib/rgeo/cartesian/feature_methods.rb +15 -45
  26. data/lib/rgeo/cartesian/interface.rb +6 -17
  27. data/lib/rgeo/coord_sys.rb +9 -15
  28. data/lib/rgeo/coord_sys/cs/entities.rb +84 -330
  29. data/lib/rgeo/coord_sys/cs/factories.rb +2 -32
  30. data/lib/rgeo/coord_sys/cs/wkt_parser.rb +52 -80
  31. data/lib/rgeo/coord_sys/proj4.rb +28 -67
  32. data/lib/rgeo/coord_sys/proj4_c_impl.bundle +0 -0
  33. data/lib/rgeo/coord_sys/srs_database/interface.rb +4 -24
  34. data/lib/rgeo/coord_sys/srs_database/proj4_data.rb +20 -38
  35. data/lib/rgeo/coord_sys/srs_database/sr_org.rb +6 -22
  36. data/lib/rgeo/coord_sys/srs_database/url_reader.rb +6 -21
  37. data/lib/rgeo/error.rb +0 -6
  38. data/lib/rgeo/feature.rb +18 -23
  39. data/lib/rgeo/feature/curve.rb +0 -14
  40. data/lib/rgeo/feature/factory.rb +13 -38
  41. data/lib/rgeo/feature/factory_generator.rb +4 -16
  42. data/lib/rgeo/feature/geometry.rb +18 -60
  43. data/lib/rgeo/feature/geometry_collection.rb +3 -17
  44. data/lib/rgeo/feature/line.rb +0 -10
  45. data/lib/rgeo/feature/line_string.rb +1 -13
  46. data/lib/rgeo/feature/linear_ring.rb +0 -9
  47. data/lib/rgeo/feature/mixins.rb +11 -36
  48. data/lib/rgeo/feature/multi_curve.rb +0 -11
  49. data/lib/rgeo/feature/multi_line_string.rb +0 -9
  50. data/lib/rgeo/feature/multi_point.rb +0 -9
  51. data/lib/rgeo/feature/multi_polygon.rb +0 -9
  52. data/lib/rgeo/feature/multi_surface.rb +0 -12
  53. data/lib/rgeo/feature/point.rb +0 -13
  54. data/lib/rgeo/feature/polygon.rb +1 -14
  55. data/lib/rgeo/feature/surface.rb +0 -12
  56. data/lib/rgeo/feature/types.rb +19 -61
  57. data/lib/rgeo/geographic.rb +10 -15
  58. data/lib/rgeo/geographic/factory.rb +126 -147
  59. data/lib/rgeo/geographic/interface.rb +67 -81
  60. data/lib/rgeo/geographic/proj4_projector.rb +13 -37
  61. data/lib/rgeo/geographic/projected_feature_classes.rb +7 -66
  62. data/lib/rgeo/geographic/projected_feature_methods.rb +15 -80
  63. data/lib/rgeo/geographic/projected_window.rb +15 -67
  64. data/lib/rgeo/geographic/simple_mercator_projector.rb +32 -56
  65. data/lib/rgeo/geographic/spherical_feature_classes.rb +9 -68
  66. data/lib/rgeo/geographic/spherical_feature_methods.rb +18 -51
  67. data/lib/rgeo/geographic/spherical_math.rb +26 -51
  68. data/lib/rgeo/geos.rb +23 -20
  69. data/lib/rgeo/geos/capi_factory.rb +125 -131
  70. data/lib/rgeo/geos/capi_feature_classes.rb +21 -88
  71. data/lib/rgeo/geos/ffi_factory.rb +90 -143
  72. data/lib/rgeo/geos/ffi_feature_classes.rb +8 -63
  73. data/lib/rgeo/geos/ffi_feature_methods.rb +46 -162
  74. data/lib/rgeo/geos/geos_c_impl.bundle +0 -0
  75. data/lib/rgeo/geos/interface.rb +4 -23
  76. data/lib/rgeo/geos/utils.rb +4 -19
  77. data/lib/rgeo/geos/zm_factory.rb +82 -131
  78. data/lib/rgeo/geos/zm_feature_classes.rb +8 -63
  79. data/lib/rgeo/geos/zm_feature_methods.rb +34 -107
  80. data/lib/rgeo/impl_helper.rb +8 -13
  81. data/lib/rgeo/impl_helper/basic_geometry_collection_methods.rb +27 -71
  82. data/lib/rgeo/impl_helper/basic_geometry_methods.rb +10 -28
  83. data/lib/rgeo/impl_helper/basic_line_string_methods.rb +21 -57
  84. data/lib/rgeo/impl_helper/basic_point_methods.rb +12 -30
  85. data/lib/rgeo/impl_helper/basic_polygon_methods.rb +9 -28
  86. data/lib/rgeo/impl_helper/math.rb +4 -10
  87. data/lib/rgeo/impl_helper/utils.rb +2 -10
  88. data/lib/rgeo/version.rb +1 -1
  89. data/lib/rgeo/wkrep.rb +4 -9
  90. data/lib/rgeo/wkrep/wkb_generator.rb +22 -46
  91. data/lib/rgeo/wkrep/wkb_parser.rb +25 -52
  92. data/lib/rgeo/wkrep/wkt_generator.rb +39 -69
  93. data/lib/rgeo/wkrep/wkt_parser.rb +52 -89
  94. data/lib/rgeo/yaml.rb +1 -7
  95. data/test/common/factory_tests.rb +4 -19
  96. data/test/common/geometry_collection_tests.rb +6 -39
  97. data/test/common/line_string_tests.rb +10 -39
  98. data/test/common/multi_line_string_tests.rb +10 -30
  99. data/test/common/multi_point_tests.rb +15 -34
  100. data/test/common/multi_polygon_tests.rb +26 -28
  101. data/test/common/point_tests.rb +37 -59
  102. data/test/common/polygon_tests.rb +16 -25
  103. data/test/coord_sys/tc_ogc_cs.rb +151 -186
  104. data/test/coord_sys/tc_proj4.rb +35 -60
  105. data/test/coord_sys/tc_proj4_srs_data.rb +15 -24
  106. data/test/coord_sys/tc_sr_org.rb +11 -19
  107. data/test/coord_sys/tc_url_reader.rb +13 -23
  108. data/test/geos_capi/tc_factory.rb +7 -16
  109. data/test/geos_capi/tc_geometry_collection.rb +6 -14
  110. data/test/geos_capi/tc_line_string.rb +7 -15
  111. data/test/geos_capi/tc_misc.rb +26 -41
  112. data/test/geos_capi/tc_multi_line_string.rb +6 -14
  113. data/test/geos_capi/tc_multi_point.rb +7 -15
  114. data/test/geos_capi/tc_multi_polygon.rb +8 -18
  115. data/test/geos_capi/tc_parsing_unparsing.rb +11 -21
  116. data/test/geos_capi/tc_point.rb +12 -26
  117. data/test/geos_capi/tc_polygon.rb +52 -17
  118. data/test/geos_capi/tc_zmfactory.rb +7 -18
  119. data/test/geos_ffi/tc_factory.rb +7 -16
  120. data/test/geos_ffi/tc_geometry_collection.rb +7 -15
  121. data/test/geos_ffi/tc_line_string.rb +7 -15
  122. data/test/geos_ffi/tc_misc.rb +8 -18
  123. data/test/geos_ffi/tc_multi_line_string.rb +7 -15
  124. data/test/geos_ffi/tc_multi_point.rb +8 -16
  125. data/test/geos_ffi/tc_multi_polygon.rb +9 -18
  126. data/test/geos_ffi/tc_parsing_unparsing.rb +14 -24
  127. data/test/geos_ffi/tc_point.rb +13 -28
  128. data/test/geos_ffi/tc_polygon.rb +7 -17
  129. data/test/geos_ffi/tc_zmfactory.rb +8 -19
  130. data/test/projected_geographic/tc_factory.rb +7 -15
  131. data/test/projected_geographic/tc_geometry_collection.rb +7 -15
  132. data/test/projected_geographic/tc_line_string.rb +7 -15
  133. data/test/projected_geographic/tc_multi_line_string.rb +7 -16
  134. data/test/projected_geographic/tc_multi_point.rb +8 -17
  135. data/test/projected_geographic/tc_multi_polygon.rb +8 -16
  136. data/test/projected_geographic/tc_point.rb +11 -23
  137. data/test/projected_geographic/tc_polygon.rb +7 -15
  138. data/test/simple_cartesian/tc_calculations.rb +6 -22
  139. data/test/simple_cartesian/tc_factory.rb +7 -16
  140. data/test/simple_cartesian/tc_geometry_collection.rb +6 -15
  141. data/test/simple_cartesian/tc_line_string.rb +6 -15
  142. data/test/simple_cartesian/tc_multi_line_string.rb +6 -15
  143. data/test/simple_cartesian/tc_multi_point.rb +7 -16
  144. data/test/simple_cartesian/tc_multi_polygon.rb +7 -16
  145. data/test/simple_cartesian/tc_point.rb +10 -21
  146. data/test/simple_cartesian/tc_polygon.rb +6 -15
  147. data/test/simple_mercator/tc_factory.rb +6 -14
  148. data/test/simple_mercator/tc_geometry_collection.rb +6 -14
  149. data/test/simple_mercator/tc_line_string.rb +6 -14
  150. data/test/simple_mercator/tc_multi_line_string.rb +6 -15
  151. data/test/simple_mercator/tc_multi_point.rb +7 -16
  152. data/test/simple_mercator/tc_multi_polygon.rb +7 -15
  153. data/test/simple_mercator/tc_point.rb +11 -24
  154. data/test/simple_mercator/tc_polygon.rb +6 -14
  155. data/test/simple_mercator/tc_window.rb +10 -34
  156. data/test/spherical_geographic/tc_calculations.rb +5 -32
  157. data/test/spherical_geographic/tc_factory.rb +6 -15
  158. data/test/spherical_geographic/tc_geometry_collection.rb +6 -15
  159. data/test/spherical_geographic/tc_line_string.rb +6 -15
  160. data/test/spherical_geographic/tc_multi_line_string.rb +6 -15
  161. data/test/spherical_geographic/tc_multi_point.rb +7 -16
  162. data/test/spherical_geographic/tc_multi_polygon.rb +7 -16
  163. data/test/spherical_geographic/tc_point.rb +10 -22
  164. data/test/spherical_geographic/tc_polygon.rb +6 -15
  165. data/test/tc_cartesian_analysis.rb +4 -16
  166. data/test/tc_cartesian_bbox.rb +7 -21
  167. data/test/tc_mixins.rb +8 -25
  168. data/test/tc_oneoff.rb +5 -13
  169. data/test/tc_types.rb +7 -16
  170. data/test/wkrep/tc_wkb_generator.rb +63 -97
  171. data/test/wkrep/tc_wkb_parser.rb +63 -100
  172. data/test/wkrep/tc_wkt_generator.rb +54 -92
  173. data/test/wkrep/tc_wkt_parser.rb +84 -133
  174. metadata +39 -9
  175. data/lib/rgeo/coord_sys/srs_database/active_record_table.rb +0 -166
  176. data/test/coord_sys/tc_active_record_table.rb +0 -79
@@ -0,0 +1,260 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ Q1 = $(V:1=)
7
+ Q = $(Q1:0=@)
8
+ ECHO1 = $(V:1=@:)
9
+ ECHO = $(ECHO1:0=@echo)
10
+ NULLCMD = :
11
+
12
+ #### Start of system configuration section. ####
13
+
14
+ srcdir = .
15
+ topdir = /Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0
16
+ hdrdir = $(topdir)
17
+ arch_hdrdir = /Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/x86_64-darwin14
18
+ PATH_SEPARATOR = :
19
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
20
+ prefix = $(DESTDIR)/Users/tee/.rubies/ruby-2.2.3
21
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
22
+ rubyarchprefix = $(rubylibprefix)/$(arch)
23
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
24
+ exec_prefix = $(prefix)
25
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
26
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
27
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
28
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
29
+ sitehdrdir = $(rubyhdrdir)/site_ruby
30
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
31
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
32
+ vendorlibdir = $(vendordir)/$(ruby_version)
33
+ vendordir = $(rubylibprefix)/vendor_ruby
34
+ sitearchdir = $(sitelibdir)/$(sitearch)
35
+ sitelibdir = $(sitedir)/$(ruby_version)
36
+ sitedir = $(rubylibprefix)/site_ruby
37
+ rubyarchdir = $(rubylibdir)/$(arch)
38
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
39
+ sitearchincludedir = $(includedir)/$(sitearch)
40
+ archincludedir = $(includedir)/$(arch)
41
+ sitearchlibdir = $(libdir)/$(sitearch)
42
+ archlibdir = $(libdir)/$(arch)
43
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
44
+ mandir = $(datarootdir)/man
45
+ localedir = $(datarootdir)/locale
46
+ libdir = $(exec_prefix)/lib
47
+ psdir = $(docdir)
48
+ pdfdir = $(docdir)
49
+ dvidir = $(docdir)
50
+ htmldir = $(docdir)
51
+ infodir = $(datarootdir)/info
52
+ docdir = $(datarootdir)/doc/$(PACKAGE)
53
+ oldincludedir = $(DESTDIR)/usr/include
54
+ includedir = $(prefix)/include
55
+ localstatedir = $(prefix)/var
56
+ sharedstatedir = $(prefix)/com
57
+ sysconfdir = $(prefix)/etc
58
+ datadir = $(datarootdir)
59
+ datarootdir = $(prefix)/share
60
+ libexecdir = $(exec_prefix)/libexec
61
+ sbindir = $(exec_prefix)/sbin
62
+ bindir = $(exec_prefix)/bin
63
+ archdir = $(rubyarchdir)
64
+
65
+
66
+ CC = clang
67
+ CXX = clang++
68
+ LIBRUBY = $(LIBRUBY_A)
69
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
70
+ LIBRUBYARG_SHARED =
71
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation
72
+ empty =
73
+ OUTFLAG = -o $(empty)
74
+ COUTFLAG = -o $(empty)
75
+
76
+ RUBY_EXTCONF_H =
77
+ cflags = $(optflags) $(debugflags) $(warnflags)
78
+ optflags = -O3 -fno-fast-math
79
+ debugflags = -ggdb3
80
+ warnflags = -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens
81
+ CCDLFLAGS = -fno-common
82
+ CFLAGS = $(CCDLFLAGS) -O3 -Wno-error=shorten-64-to-32 -pipe $(ARCH_FLAG)
83
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
84
+ DEFS =
85
+ CPPFLAGS = -DHAVE_PROJ_API_H -DHAVE_PJ_INIT_PLUS -I/usr/local/include -I/Library/Frameworks/PROJ.framework/unix/include -I/usr/include -I/Users/tee/.rubies/ruby-2.2.3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
86
+ CXXFLAGS = $(CCDLFLAGS) $(cxxflags) $(ARCH_FLAG)
87
+ ldflags = -L. -L/Users/tee/.rubies/ruby-2.2.3/lib -fstack-protector -L/usr/local/lib
88
+ dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
89
+ ARCH_FLAG =
90
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
91
+ LDSHARED = $(CC) -dynamic -bundle
92
+ LDSHAREDXX = $(CXX) -dynamic -bundle
93
+ AR = ar
94
+ EXEEXT =
95
+
96
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
97
+ RUBY_SO_NAME = ruby
98
+ RUBYW_INSTALL_NAME =
99
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
100
+ RUBYW_BASE_NAME = rubyw
101
+ RUBY_BASE_NAME = ruby
102
+
103
+ arch = x86_64-darwin14
104
+ sitearch = $(arch)
105
+ ruby_version = 2.2.0
106
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
107
+ RUBY = $(ruby)
108
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
109
+
110
+ RM = rm -f
111
+ RM_RF = $(RUBY) -run -e rm -- -rf
112
+ RMDIRS = rmdir -p
113
+ MAKEDIRS = mkdir -p
114
+ INSTALL = /usr/bin/install -c
115
+ INSTALL_PROG = $(INSTALL) -m 0755
116
+ INSTALL_DATA = $(INSTALL) -m 644
117
+ COPY = cp
118
+ TOUCH = exit >
119
+
120
+ #### End of system configuration section. ####
121
+
122
+ preload =
123
+
124
+ libpath = /Users/tee/.rubies/ruby-2.2.3/lib /usr/local/lib /Library/Frameworks/PROJ.framework/unix/lib /usr/lib . $(libdir)
125
+ LIBPATH = -L/Users/tee/.rubies/ruby-2.2.3/lib -L/usr/local/lib -L/Library/Frameworks/PROJ.framework/unix/lib -L/usr/lib -L. -L$(libdir)
126
+ DEFFILE =
127
+
128
+ CLEANFILES = mkmf.log
129
+ DISTCLEANFILES =
130
+ DISTCLEANDIRS =
131
+
132
+ extout =
133
+ extout_prefix =
134
+ target_prefix = /rgeo/coord_sys
135
+ LOCAL_LIBS =
136
+ LIBS = -lproj -lpthread -lgmp -ldl -lobjc
137
+ ORIG_SRCS = main.c
138
+ SRCS = $(ORIG_SRCS)
139
+ OBJS = main.o
140
+ HDRS =
141
+ TARGET = proj4_c_impl
142
+ TARGET_NAME = proj4_c_impl
143
+ TARGET_ENTRY = Init_$(TARGET_NAME)
144
+ DLLIB = $(TARGET).bundle
145
+ EXTSTATIC =
146
+ STATIC_LIB =
147
+
148
+ TIMESTAMP_DIR = .
149
+ BINDIR = $(bindir)
150
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
151
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
152
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
153
+ HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
154
+ ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
155
+
156
+ TARGET_SO = $(DLLIB)
157
+ CLEANLIBS = $(TARGET).bundle
158
+ CLEANOBJS = *.o *.bak
159
+
160
+ all: $(DLLIB)
161
+ static: $(STATIC_LIB)
162
+ .PHONY: all install static install-so install-rb
163
+ .PHONY: clean clean-so clean-static clean-rb
164
+
165
+ clean-static::
166
+ clean-rb-default::
167
+ clean-rb::
168
+ clean-so::
169
+ clean: clean-so clean-static clean-rb-default clean-rb
170
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
171
+
172
+ distclean-rb-default::
173
+ distclean-rb::
174
+ distclean-so::
175
+ distclean-static::
176
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
177
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
178
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
179
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
180
+
181
+ realclean: distclean
182
+ install: install-so install-rb
183
+
184
+ install-so: $(DLLIB) $(TIMESTAMP_DIR)/.RUBYARCHDIR.-.rgeo.-.coord_sys.time
185
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
186
+ clean-static::
187
+ -$(Q)$(RM) $(STATIC_LIB)
188
+ install-rb: pre-install-rb install-rb-default
189
+ install-rb-default: pre-install-rb-default
190
+ pre-install-rb: Makefile
191
+ pre-install-rb-default: Makefile
192
+ pre-install-rb-default:
193
+ @$(NULLCMD)
194
+ $(TIMESTAMP_DIR)/.RUBYARCHDIR.-.rgeo.-.coord_sys.time:
195
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
196
+ $(Q) $(TOUCH) $@
197
+
198
+ site-install: site-install-so site-install-rb
199
+ site-install-so: install-so
200
+ site-install-rb: install-rb
201
+
202
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
203
+
204
+ .cc.o:
205
+ $(ECHO) compiling $(<)
206
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
207
+
208
+ .cc.S:
209
+ $(ECHO) translating $(<)
210
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
211
+
212
+ .mm.o:
213
+ $(ECHO) compiling $(<)
214
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
215
+
216
+ .mm.S:
217
+ $(ECHO) translating $(<)
218
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
219
+
220
+ .cxx.o:
221
+ $(ECHO) compiling $(<)
222
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
223
+
224
+ .cxx.S:
225
+ $(ECHO) translating $(<)
226
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
227
+
228
+ .cpp.o:
229
+ $(ECHO) compiling $(<)
230
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
231
+
232
+ .cpp.S:
233
+ $(ECHO) translating $(<)
234
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $<
235
+
236
+ .c.o:
237
+ $(ECHO) compiling $(<)
238
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
239
+
240
+ .c.S:
241
+ $(ECHO) translating $(<)
242
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
243
+
244
+ .m.o:
245
+ $(ECHO) compiling $(<)
246
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
247
+
248
+ .m.S:
249
+ $(ECHO) translating $(<)
250
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $<
251
+
252
+ $(DLLIB): $(OBJS) Makefile
253
+ $(ECHO) linking shared-object rgeo/coord_sys/$(DLLIB)
254
+ -$(Q)$(RM) $(@)
255
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
256
+ $(Q) $(POSTLINK)
257
+
258
+
259
+
260
+ $(OBJS): $(HDRS) $(ruby_headers)
@@ -6,57 +6,57 @@
6
6
 
7
7
  if ::RUBY_DESCRIPTION =~ /^jruby\s/
8
8
 
9
- ::File.open('Makefile', 'w'){ |f_| f_.write(".PHONY: install\ninstall:\n") }
9
+ ::File.open("Makefile", "w") { |f_| f_.write(".PHONY: install\ninstall:\n") }
10
10
 
11
11
  else
12
12
 
13
- require 'mkmf'
13
+ require "mkmf"
14
14
 
15
15
  header_dirs_ =
16
16
  [
17
- '/usr/local/include',
18
- '/usr/local/proj/include',
19
- '/usr/local/proj4/include',
20
- '/opt/local/include',
21
- '/opt/proj/include',
22
- '/opt/proj4/include',
23
- '/opt/include',
24
- '/Library/Frameworks/PROJ.framework/unix/include',
25
- ::RbConfig::CONFIG['includedir'],
26
- '/usr/include',
17
+ ::RbConfig::CONFIG["includedir"],
18
+ "/usr/local/include",
19
+ "/usr/local/proj/include",
20
+ "/usr/local/proj4/include",
21
+ "/opt/local/include",
22
+ "/opt/proj/include",
23
+ "/opt/proj4/include",
24
+ "/opt/include",
25
+ "/Library/Frameworks/PROJ.framework/unix/include",
26
+ "/usr/include"
27
27
  ]
28
28
  lib_dirs_ =
29
29
  [
30
- '/usr/local/lib',
31
- '/usr/local/lib64',
32
- '/usr/local/proj/lib',
33
- '/usr/local/proj4/lib',
34
- '/opt/local/lib',
35
- '/opt/proj/lib',
36
- '/opt/proj4/lib',
37
- '/opt/lib',
38
- '/Library/Frameworks/PROJ.framework/unix/lib',
39
- ::RbConfig::CONFIG['libdir'],
40
- '/usr/lib',
41
- '/usr/lib64',
30
+ ::RbConfig::CONFIG["libdir"],
31
+ "/usr/local/lib",
32
+ "/usr/local/lib64",
33
+ "/usr/local/proj/lib",
34
+ "/usr/local/proj4/lib",
35
+ "/opt/local/lib",
36
+ "/opt/proj/lib",
37
+ "/opt/proj4/lib",
38
+ "/opt/lib",
39
+ "/Library/Frameworks/PROJ.framework/unix/lib",
40
+ "/usr/lib",
41
+ "/usr/lib64"
42
42
  ]
43
- header_dirs_.delete_if{ |path_| !::File.directory?(path_) }
44
- lib_dirs_.delete_if{ |path_| !::File.directory?(path_) }
43
+ header_dirs_.delete_if { |path_| !::File.directory?(path_) }
44
+ lib_dirs_.delete_if { |path_| !::File.directory?(path_) }
45
45
 
46
46
  found_proj_ = false
47
- header_dirs_, lib_dirs_ = dir_config('proj', header_dirs_, lib_dirs_)
48
- if have_header('proj_api.h')
49
- $libs << ' -lproj'
50
- if have_func('pj_init_plus', 'proj_api.h')
47
+ header_dirs_, lib_dirs_ = dir_config("proj", header_dirs_, lib_dirs_)
48
+ if have_header("proj_api.h")
49
+ $libs << " -lproj"
50
+ if have_func("pj_init_plus", "proj_api.h")
51
51
  found_proj_ = true
52
52
  else
53
- $libs.gsub!(' -lproj', '')
53
+ $libs.gsub!(" -lproj", "")
54
54
  end
55
55
  end
56
56
  unless found_proj_
57
57
  puts "**** WARNING: Unable to find Proj headers or Proj version is too old."
58
58
  puts "**** Compiling without Proj support."
59
59
  end
60
- create_makefile('rgeo/coord_sys/proj4_c_impl')
60
+ create_makefile("rgeo/coord_sys/proj4_c_impl")
61
61
 
62
62
  end
@@ -0,0 +1,47 @@
1
+ have_header: checking for proj_api.h... -------------------- yes
2
+
3
+ "clang -o conftest -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/x86_64-darwin14 -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/ruby/backward -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0 -I. -I/usr/local/include -I/Library/Frameworks/PROJ.framework/unix/include -I/usr/include -I/Users/tee/.rubies/ruby-2.2.3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -Wno-error=shorten-64-to-32 -pipe conftest.c -L/Users/tee/.rubies/ruby-2.2.3/lib -L/usr/local/lib -L/Library/Frameworks/PROJ.framework/unix/lib -L/usr/lib -L. -L/Users/tee/.rubies/ruby-2.2.3/lib -L. -L/Users/tee/.rubies/ruby-2.2.3/lib -fstack-protector -L/usr/local/lib -lruby-static -framework CoreFoundation -lpthread -lgmp -ldl -lobjc "
4
+ checked program was:
5
+ /* begin */
6
+ 1: #include "ruby.h"
7
+ 2:
8
+ 3: int main(int argc, char **argv)
9
+ 4: {
10
+ 5: return 0;
11
+ 6: }
12
+ /* end */
13
+
14
+ "clang -E -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/x86_64-darwin14 -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/ruby/backward -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0 -I. -I/usr/local/include -I/Library/Frameworks/PROJ.framework/unix/include -I/usr/include -I/Users/tee/.rubies/ruby-2.2.3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -Wno-error=shorten-64-to-32 -pipe conftest.c -o conftest.i"
15
+ checked program was:
16
+ /* begin */
17
+ 1: #include "ruby.h"
18
+ 2:
19
+ 3: #include <proj_api.h>
20
+ /* end */
21
+
22
+ --------------------
23
+
24
+ have_func: checking for pj_init_plus() in proj_api.h... -------------------- yes
25
+
26
+ "clang -o conftest -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/x86_64-darwin14 -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0/ruby/backward -I/Users/tee/.rubies/ruby-2.2.3/include/ruby-2.2.0 -I. -I/usr/local/include -I/Library/Frameworks/PROJ.framework/unix/include -I/usr/include -I/Users/tee/.rubies/ruby-2.2.3/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -Wno-error=shorten-64-to-32 -pipe conftest.c -L/Users/tee/.rubies/ruby-2.2.3/lib -L/usr/local/lib -L/Library/Frameworks/PROJ.framework/unix/lib -L/usr/lib -L. -L/Users/tee/.rubies/ruby-2.2.3/lib -L. -L/Users/tee/.rubies/ruby-2.2.3/lib -fstack-protector -L/usr/local/lib -lproj -lruby-static -framework CoreFoundation -lproj -lpthread -lgmp -ldl -lobjc "
27
+ checked program was:
28
+ /* begin */
29
+ 1: #include "ruby.h"
30
+ 2:
31
+ 3: #include <proj_api.h>
32
+ 4:
33
+ 5: /*top*/
34
+ 6: extern int t(void);
35
+ 7: int main(int argc, char **argv)
36
+ 8: {
37
+ 9: if (argc > 1000000) {
38
+ 10: printf("%p", &t);
39
+ 11: }
40
+ 12:
41
+ 13: return 0;
42
+ 14: }
43
+ 15: int t(void) { void ((*volatile p)()); p = (void ((*)()))pj_init_plus; return 0; }
44
+ /* end */
45
+
46
+ --------------------
47
+
data/lib/rgeo.rb CHANGED
@@ -76,15 +76,14 @@
76
76
  module RGeo
77
77
  end
78
78
 
79
-
80
79
  # Core modules
81
- require 'rgeo/yaml'
82
- require 'rgeo/version'
83
- require 'rgeo/error'
84
- require 'rgeo/feature'
85
- require 'rgeo/coord_sys'
86
- require 'rgeo/impl_helper'
87
- require 'rgeo/wkrep'
88
- require 'rgeo/geos'
89
- require 'rgeo/cartesian'
90
- require 'rgeo/geographic'
80
+ require "rgeo/yaml"
81
+ require "rgeo/version"
82
+ require "rgeo/error"
83
+ require "rgeo/feature"
84
+ require "rgeo/coord_sys"
85
+ require "rgeo/impl_helper"
86
+ require "rgeo/wkrep"
87
+ require "rgeo/geos"
88
+ require "rgeo/cartesian"
89
+ require "rgeo/geographic"
@@ -5,8 +5,6 @@
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
7
  module RGeo
8
-
9
-
10
8
  # The Cartesian module is a gateway to implementations that use the
11
9
  # Cartesian (i.e. flat) coordinate system. It provides convenient
12
10
  # access to Cartesian factories such as the Geos implementation and
@@ -15,16 +13,13 @@ module RGeo
15
13
 
16
14
  module Cartesian
17
15
  end
18
-
19
-
20
16
  end
21
17
 
22
-
23
18
  # Implementation files.
24
- require 'rgeo/cartesian/calculations'
25
- require 'rgeo/cartesian/feature_methods'
26
- require 'rgeo/cartesian/feature_classes'
27
- require 'rgeo/cartesian/factory'
28
- require 'rgeo/cartesian/interface'
29
- require 'rgeo/cartesian/bounding_box'
30
- require 'rgeo/cartesian/analysis'
19
+ require "rgeo/cartesian/calculations"
20
+ require "rgeo/cartesian/feature_methods"
21
+ require "rgeo/cartesian/feature_classes"
22
+ require "rgeo/cartesian/factory"
23
+ require "rgeo/cartesian/interface"
24
+ require "rgeo/cartesian/bounding_box"
25
+ require "rgeo/cartesian/analysis"