Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove vendored gems.

  • Loading branch information...
commit 6a1ff7ca3e0f3ee69d801298e9b0f798dbbf6ceb 1 parent 1f596da
@crowbot crowbot authored
Showing with 0 additions and 28,777 deletions.
  1. +0 −138 vendor/gems/GeoRuby-1.3.4/.specification
  2. +0 −7 vendor/gems/GeoRuby-1.3.4/MIT-LICENSE
  3. +0 −83 vendor/gems/GeoRuby-1.3.4/README
  4. +0 −16 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby.rb
  5. +0 −180 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/shp4r/dbf.rb
  6. +0 −701 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/shp4r/shp.rb
  7. +0 −134 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/envelope.rb
  8. +0 −216 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/ewkb_parser.rb
  9. +0 −336 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/ewkt_parser.rb
  10. +0 −225 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry.rb
  11. +0 −136 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry_collection.rb
  12. +0 −81 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/geometry_factory.rb
  13. +0 −135 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/georss_parser.rb
  14. +0 −18 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/helper.rb
  15. +0 −166 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/line_string.rb
  16. +0 −12 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/linear_ring.rb
  17. +0 −39 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/multi_line_string.rb
  18. +0 −41 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/multi_point.rb
  19. +0 −38 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/multi_polygon.rb
  20. +0 −236 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/point.rb
  21. +0 −150 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/polygon.rb
  22. +0 −50 vendor/gems/GeoRuby-1.3.4/rakefile.rb
  23. BIN  vendor/gems/GeoRuby-1.3.4/test/data/multipoint.dbf
  24. BIN  vendor/gems/GeoRuby-1.3.4/test/data/multipoint.shp
  25. BIN  vendor/gems/GeoRuby-1.3.4/test/data/multipoint.shx
  26. BIN  vendor/gems/GeoRuby-1.3.4/test/data/point.dbf
  27. BIN  vendor/gems/GeoRuby-1.3.4/test/data/point.shp
  28. BIN  vendor/gems/GeoRuby-1.3.4/test/data/point.shx
  29. BIN  vendor/gems/GeoRuby-1.3.4/test/data/polygon.dbf
  30. BIN  vendor/gems/GeoRuby-1.3.4/test/data/polygon.shp
  31. BIN  vendor/gems/GeoRuby-1.3.4/test/data/polygon.shx
  32. BIN  vendor/gems/GeoRuby-1.3.4/test/data/polyline.dbf
  33. BIN  vendor/gems/GeoRuby-1.3.4/test/data/polyline.shp
  34. BIN  vendor/gems/GeoRuby-1.3.4/test/data/polyline.shx
  35. +0 −171 vendor/gems/GeoRuby-1.3.4/test/test_ewkb_parser.rb
  36. +0 −193 vendor/gems/GeoRuby-1.3.4/test/test_ewkt_parser.rb
  37. +0 −231 vendor/gems/GeoRuby-1.3.4/test/test_georss_kml.rb
  38. +0 −76 vendor/gems/GeoRuby-1.3.4/test/test_shp.rb
  39. +0 −150 vendor/gems/GeoRuby-1.3.4/test/test_shp_write.rb
  40. +0 −506 vendor/gems/GeoRuby-1.3.4/test/test_simple_features.rb
  41. +0 −6 vendor/gems/GeoRuby-1.3.4/tools/db.yml
  42. +0 −7 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/MIT-LICENSE
  43. +0 −116 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/README
  44. +0 −14 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/init.rb
  45. +0 −177 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/lib/common_spatial_adapter.rb
  46. +0 −197 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/lib/mysql_spatial_adapter.rb
  47. +0 −411 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/lib/post_gis_adapter.rb
  48. +0 −36 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/rakefile.rb
  49. +0 −87 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/access_mysql_test.rb
  50. +0 −151 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/access_postgis_test.rb
  51. +0 −18 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/common/common_mysql.rb
  52. +0 −19 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/common/common_postgis.rb
  53. +0 −5 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/db/database_mysql.yml
  54. +0 −4 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/db/database_postgis.yml
  55. +0 −64 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/find_mysql_test.rb
  56. +0 −66 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/find_postgis_test.rb
  57. +0 −23 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/fixture_mysql_test.rb
  58. +0 −23 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/fixture_postgis_test.rb
  59. +0 −204 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/migration_mysql_test.rb
  60. +0 −219 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/migration_postgis_test.rb
  61. +0 −25 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/models/models_mysql.rb
  62. +0 −41 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/models/models_postgis.rb
  63. +0 −40 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/schema/schema_mysql.rb
  64. +0 −65 vendor/gems/GeoRuby-1.3.4/tools/lib/spatial_adapter/test/schema/schema_postgis.rb
  65. +0 −92 vendor/gems/GeoRuby-1.3.4/tools/shp2sql.rb
  66. +0 −68 vendor/gems/abstract-1.0.0/.specification
  67. +0 −3  vendor/gems/abstract-1.0.0/ChangeLog
  68. +0 −57 vendor/gems/abstract-1.0.0/README.txt
  69. +0 −48 vendor/gems/abstract-1.0.0/abstract.gemspec
  70. +0 −75 vendor/gems/abstract-1.0.0/lib/abstract.rb
  71. +0 −1,331 vendor/gems/abstract-1.0.0/setup.rb
  72. +0 −91 vendor/gems/abstract-1.0.0/test/test.rb
  73. +0 −4 vendor/gems/activerecord-diff-0.0.2/.gitignore
  74. +0 −135 vendor/gems/activerecord-diff-0.0.2/.specification
  75. +0 −4 vendor/gems/activerecord-diff-0.0.2/Gemfile
  76. +0 −42 vendor/gems/activerecord-diff-0.0.2/README.txt
  77. +0 −11 vendor/gems/activerecord-diff-0.0.2/Rakefile
  78. +0 −28 vendor/gems/activerecord-diff-0.0.2/activerecord-diff.gemspec
  79. +0 −3  vendor/gems/activerecord-diff-0.0.2/lib/..rb
  80. +0 −3  vendor/gems/activerecord-diff-0.0.2/lib/active_record_diff/version.rb
  81. +0 −73 vendor/gems/activerecord-diff-0.0.2/lib/activerecord-diff.rb
  82. +0 −90 vendor/gems/activerecord-diff-0.0.2/test/test.rb
  83. +0 −9 vendor/gems/authlogic-2.1.6/.gitignore
  84. +0 −251 vendor/gems/authlogic-2.1.6/.specification
  85. +0 −345 vendor/gems/authlogic-2.1.6/CHANGELOG.rdoc
  86. +0 −20 vendor/gems/authlogic-2.1.6/LICENSE
  87. +0 −246 vendor/gems/authlogic-2.1.6/README.rdoc
  88. +0 −41 vendor/gems/authlogic-2.1.6/Rakefile
  89. +0 −5 vendor/gems/authlogic-2.1.6/VERSION.yml
  90. +0 −216 vendor/gems/authlogic-2.1.6/authlogic.gemspec
  91. +0 −9 vendor/gems/authlogic-2.1.6/generators/session/session_generator.rb
  92. +0 −2  vendor/gems/authlogic-2.1.6/generators/session/templates/session.rb
  93. +0 −1  vendor/gems/authlogic-2.1.6/init.rb
  94. +0 −64 vendor/gems/authlogic-2.1.6/lib/authlogic.rb
  95. +0 −107 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/base.rb
  96. +0 −110 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/email.rb
  97. +0 −60 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/logged_in_status.rb
  98. +0 −141 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/login.rb
  99. +0 −24 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/magic_columns.rb
  100. +0 −355 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/password.rb
  101. +0 −105 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/perishable_token.rb
  102. +0 −68 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/persistence_token.rb
  103. +0 −61 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/restful_authentication.rb
  104. +0 −139 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/session_maintenance.rb
  105. +0 −65 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/single_access_token.rb
  106. +0 −32 vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/validations_scope.rb
  107. +0 −42 vendor/gems/authlogic-2.1.6/lib/authlogic/authenticates_many/association.rb
  108. +0 −55 vendor/gems/authlogic-2.1.6/lib/authlogic/authenticates_many/base.rb
  109. +0 −67 vendor/gems/authlogic-2.1.6/lib/authlogic/controller_adapters/abstract_adapter.rb
  110. +0 −30 vendor/gems/authlogic-2.1.6/lib/authlogic/controller_adapters/merb_adapter.rb
  111. +0 −48 vendor/gems/authlogic-2.1.6/lib/authlogic/controller_adapters/rails_adapter.rb
  112. +0 −61 vendor/gems/authlogic-2.1.6/lib/authlogic/controller_adapters/sinatra_adapter.rb
  113. +0 −43 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/aes256.rb
  114. +0 −90 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/bcrypt.rb
  115. +0 −34 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/md5.rb
  116. +0 −35 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/sha1.rb
  117. +0 −50 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/sha256.rb
  118. +0 −50 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/sha512.rb
  119. +0 −43 vendor/gems/authlogic-2.1.6/lib/authlogic/crypto_providers/wordpress.rb
  120. +0 −83 vendor/gems/authlogic-2.1.6/lib/authlogic/i18n.rb
  121. +0 −15 vendor/gems/authlogic-2.1.6/lib/authlogic/i18n/translator.rb
  122. +0 −33 vendor/gems/authlogic-2.1.6/lib/authlogic/random.rb
  123. +0 −25 vendor/gems/authlogic-2.1.6/lib/authlogic/regex.rb
  124. +0 −58 vendor/gems/authlogic-2.1.6/lib/authlogic/session/activation.rb
  125. +0 −64 vendor/gems/authlogic-2.1.6/lib/authlogic/session/active_record_trickery.rb
  126. +0 −37 vendor/gems/authlogic-2.1.6/lib/authlogic/session/base.rb
  127. +0 −96 vendor/gems/authlogic-2.1.6/lib/authlogic/session/brute_force_protection.rb
  128. +0 −99 vendor/gems/authlogic-2.1.6/lib/authlogic/session/callbacks.rb
  129. +0 −130 vendor/gems/authlogic-2.1.6/lib/authlogic/session/cookies.rb
  130. +0 −93 vendor/gems/authlogic-2.1.6/lib/authlogic/session/existence.rb
  131. +0 −63 vendor/gems/authlogic-2.1.6/lib/authlogic/session/foundation.rb
  132. +0 −58 vendor/gems/authlogic-2.1.6/lib/authlogic/session/http_auth.rb
  133. +0 −41 vendor/gems/authlogic-2.1.6/lib/authlogic/session/id.rb
  134. +0 −78 vendor/gems/authlogic-2.1.6/lib/authlogic/session/klass.rb
  135. +0 −95 vendor/gems/authlogic-2.1.6/lib/authlogic/session/magic_columns.rb
  136. +0 −59 vendor/gems/authlogic-2.1.6/lib/authlogic/session/magic_states.rb
  137. +0 −101 vendor/gems/authlogic-2.1.6/lib/authlogic/session/params.rb
  138. +0 −240 vendor/gems/authlogic-2.1.6/lib/authlogic/session/password.rb
  139. +0 −18 vendor/gems/authlogic-2.1.6/lib/authlogic/session/perishable_token.rb
  140. +0 −70 vendor/gems/authlogic-2.1.6/lib/authlogic/session/persistence.rb
  141. +0 −34 vendor/gems/authlogic-2.1.6/lib/authlogic/session/priority_record.rb
  142. +0 −101 vendor/gems/authlogic-2.1.6/lib/authlogic/session/scopes.rb
  143. +0 −62 vendor/gems/authlogic-2.1.6/lib/authlogic/session/session.rb
  144. +0 −82 vendor/gems/authlogic-2.1.6/lib/authlogic/session/timeout.rb
  145. +0 −50 vendor/gems/authlogic-2.1.6/lib/authlogic/session/unauthorized_record.rb
  146. +0 −82 vendor/gems/authlogic-2.1.6/lib/authlogic/session/validation.rb
  147. +0 −120 vendor/gems/authlogic-2.1.6/lib/authlogic/test_case.rb
  148. +0 −45 vendor/gems/authlogic-2.1.6/lib/authlogic/test_case/mock_controller.rb
  149. +0 −14 vendor/gems/authlogic-2.1.6/lib/authlogic/test_case/mock_cookie_jar.rb
  150. +0 −10 vendor/gems/authlogic-2.1.6/lib/authlogic/test_case/mock_logger.rb
  151. +0 −19 vendor/gems/authlogic-2.1.6/lib/authlogic/test_case/mock_request.rb
  152. +0 −30 vendor/gems/authlogic-2.1.6/lib/authlogic/test_case/rails_request_adapter.rb
  153. +0 −1  vendor/gems/authlogic-2.1.6/rails/init.rb
  154. +0 −69 vendor/gems/authlogic-2.1.6/shoulda_macros/authlogic.rb
  155. +0 −18 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/base_test.rb
  156. +0 −101 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/email_test.rb
  157. +0 −36 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/logged_in_status_test.rb
  158. +0 −109 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/login_test.rb
  159. +0 −27 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/magic_columns_test.rb
  160. +0 −236 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/password_test.rb
  161. +0 −90 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/perishable_token_test.rb
  162. +0 −55 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/persistence_token_test.rb
  163. +0 −40 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/restful_authentication_test.rb
  164. +0 −84 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/session_maintenance_test.rb
  165. +0 −44 vendor/gems/authlogic-2.1.6/test/acts_as_authentic_test/single_access_test.rb
  166. +0 −16 vendor/gems/authlogic-2.1.6/test/authenticates_many_test.rb
  167. +0 −14 vendor/gems/authlogic-2.1.6/test/crypto_provider_test/aes256_test.rb
  168. +0 −14 vendor/gems/authlogic-2.1.6/test/crypto_provider_test/bcrypt_test.rb
  169. +0 −23 vendor/gems/authlogic-2.1.6/test/crypto_provider_test/sha1_test.rb
  170. +0 −14 vendor/gems/authlogic-2.1.6/test/crypto_provider_test/sha256_test.rb
  171. +0 −14 vendor/gems/authlogic-2.1.6/test/crypto_provider_test/sha512_test.rb
  172. +0 −5 vendor/gems/authlogic-2.1.6/test/fixtures/companies.yml
  173. +0 −17 vendor/gems/authlogic-2.1.6/test/fixtures/employees.yml
  174. +0 −3  vendor/gems/authlogic-2.1.6/test/fixtures/projects.yml
  175. +0 −24 vendor/gems/authlogic-2.1.6/test/fixtures/users.yml
  176. +0 −33 vendor/gems/authlogic-2.1.6/test/i18n_test.rb
  177. +0 −7 vendor/gems/authlogic-2.1.6/test/libs/affiliate.rb
  178. +0 −6 vendor/gems/authlogic-2.1.6/test/libs/company.rb
  179. +0 −7 vendor/gems/authlogic-2.1.6/test/libs/employee.rb
  180. +0 −2  vendor/gems/authlogic-2.1.6/test/libs/employee_session.rb
  181. +0 −3  vendor/gems/authlogic-2.1.6/test/libs/ldaper.rb
  182. +0 −9 vendor/gems/authlogic-2.1.6/test/libs/ordered_hash.rb
  183. +0 −3  vendor/gems/authlogic-2.1.6/test/libs/project.rb
  184. +0 −5 vendor/gems/authlogic-2.1.6/test/libs/user.rb
  185. +0 −6 vendor/gems/authlogic-2.1.6/test/libs/user_session.rb
  186. +0 −42 vendor/gems/authlogic-2.1.6/test/random_test.rb
  187. +0 −43 vendor/gems/authlogic-2.1.6/test/session_test/activation_test.rb
  188. +0 −36 vendor/gems/authlogic-2.1.6/test/session_test/active_record_trickery_test.rb
  189. +0 −101 vendor/gems/authlogic-2.1.6/test/session_test/brute_force_protection_test.rb
  190. +0 −6 vendor/gems/authlogic-2.1.6/test/session_test/callbacks_test.rb
  191. +0 −112 vendor/gems/authlogic-2.1.6/test/session_test/cookies_test.rb
  192. 0  vendor/gems/authlogic-2.1.6/test/session_test/credentials_test.rb
  193. +0 −64 vendor/gems/authlogic-2.1.6/test/session_test/existence_test.rb
  194. +0 −28 vendor/gems/authlogic-2.1.6/test/session_test/http_auth_test.rb
  195. +0 −17 vendor/gems/authlogic-2.1.6/test/session_test/id_test.rb
  196. +0 −40 vendor/gems/authlogic-2.1.6/test/session_test/klass_test.rb
  197. +0 −62 vendor/gems/authlogic-2.1.6/test/session_test/magic_columns_test.rb
  198. +0 −60 vendor/gems/authlogic-2.1.6/test/session_test/magic_states_test.rb
  199. +0 −53 vendor/gems/authlogic-2.1.6/test/session_test/params_test.rb
  200. +0 −106 vendor/gems/authlogic-2.1.6/test/session_test/password_test.rb
  201. +0 −15 vendor/gems/authlogic-2.1.6/test/session_test/perishability_test.rb
  202. +0 −21 vendor/gems/authlogic-2.1.6/test/session_test/persistence_test.rb
  203. +0 −60 vendor/gems/authlogic-2.1.6/test/session_test/scopes_test.rb
  204. +0 −59 vendor/gems/authlogic-2.1.6/test/session_test/session_test.rb
  205. +0 −52 vendor/gems/authlogic-2.1.6/test/session_test/timeout_test.rb
  206. +0 −13 vendor/gems/authlogic-2.1.6/test/session_test/unauthorized_record_test.rb
  207. +0 −23 vendor/gems/authlogic-2.1.6/test/session_test/validation_test.rb
  208. +0 −182 vendor/gems/authlogic-2.1.6/test/test_helper.rb
  209. +0 −76 vendor/gems/babosa-0.2.0/.specification
  210. +0 −19 vendor/gems/babosa-0.2.0/MIT-LICENSE
  211. +0 −169 vendor/gems/babosa-0.2.0/README.md
  212. +0 −29 vendor/gems/babosa-0.2.0/Rakefile
  213. +0 −3  vendor/gems/babosa-0.2.0/init.rb
  214. +0 −23 vendor/gems/babosa-0.2.0/lib/babosa.rb
  215. +0 −78 vendor/gems/babosa-0.2.0/lib/babosa/characters.rb
  216. +0 −266 vendor/gems/babosa-0.2.0/lib/babosa/identifier.rb
  217. +0 −20 vendor/gems/babosa-0.2.0/lib/babosa/utf8/active_support_proxy.rb
  218. +0 −41 vendor/gems/babosa-0.2.0/lib/babosa/utf8/dumb_proxy.rb
  219. +0 −24 vendor/gems/babosa-0.2.0/lib/babosa/utf8/java_proxy.rb
  220. +0 −193 vendor/gems/babosa-0.2.0/lib/babosa/utf8/mappings.rb
  221. +0 −118 vendor/gems/babosa-0.2.0/lib/babosa/utf8/proxy.rb
  222. +0 −21 vendor/gems/babosa-0.2.0/lib/babosa/utf8/unicode_proxy.rb
  223. +0 −5 vendor/gems/babosa-0.2.0/lib/babosa/version.rb
  224. +0 −189 vendor/gems/babosa-0.2.0/test/babosa_test.rb
  225. +0 −7 vendor/gems/bcrypt-ruby-2.1.4/.gitignore
  226. +0 −3  vendor/gems/bcrypt-ruby-2.1.4/.rspec
  227. +0 −104 vendor/gems/bcrypt-ruby-2.1.4/.specification
  228. +0 −40 vendor/gems/bcrypt-ruby-2.1.4/CHANGELOG
  229. +0 −33 vendor/gems/bcrypt-ruby-2.1.4/COPYING
  230. +0 −2  vendor/gems/bcrypt-ruby-2.1.4/Gemfile
  231. +0 −175 vendor/gems/bcrypt-ruby-2.1.4/README
  232. +0 −89 vendor/gems/bcrypt-ruby-2.1.4/Rakefile
  233. +0 −28 vendor/gems/bcrypt-ruby-2.1.4/bcrypt-ruby.gemspec
  234. +0 −752 vendor/gems/bcrypt-ruby-2.1.4/ext/jruby/bcrypt_jruby/BCrypt.java
  235. +0 −297 vendor/gems/bcrypt-ruby-2.1.4/ext/mri/bcrypt.c
  236. +0 −67 vendor/gems/bcrypt-ruby-2.1.4/ext/mri/bcrypt.h
  237. +0 −87 vendor/gems/bcrypt-ruby-2.1.4/ext/mri/bcrypt_ext.c
  238. +0 −86 vendor/gems/bcrypt-ruby-2.1.4/ext/mri/blf.h
  239. +0 −635 vendor/gems/bcrypt-ruby-2.1.4/ext/mri/blowfish.c
  240. +0 −17 vendor/gems/bcrypt-ruby-2.1.4/ext/mri/extconf.rb
  241. +0 −190 vendor/gems/bcrypt-ruby-2.1.4/lib/bcrypt.rb
  242. +0 −194 vendor/gems/bcrypt-ruby-2.1.4/spec/TestBCrypt.java
  243. +0 −82 vendor/gems/bcrypt-ruby-2.1.4/spec/bcrypt/engine_spec.rb
  244. +0 −67 vendor/gems/bcrypt-ruby-2.1.4/spec/bcrypt/password_spec.rb
  245. +0 −2  vendor/gems/bcrypt-ruby-2.1.4/spec/spec_helper.rb
  246. +0 −108 vendor/gems/cocaine-0.0.2/.specification
  247. +0 −26 vendor/gems/cocaine-0.0.2/LICENSE
  248. +0 −77 vendor/gems/cocaine-0.0.2/README.md
  249. +0 −15 vendor/gems/cocaine-0.0.2/Rakefile
  250. +0 −5 vendor/gems/cocaine-0.0.2/lib/cocaine.rb
  251. +0 −85 vendor/gems/cocaine-0.0.2/lib/cocaine/command_line.rb
  252. +0 −6 vendor/gems/cocaine-0.0.2/lib/cocaine/exceptions.rb
  253. +0 −3  vendor/gems/cocaine-0.0.2/lib/cocaine/version.rb
  254. +0 −132 vendor/gems/cocaine-0.0.2/spec/cocaine/command_line_spec.rb
  255. +0 −10 vendor/gems/cocaine-0.0.2/spec/spec_helper.rb
  256. +0 −12 vendor/gems/cocaine-0.0.2/spec/support/with_exitstatus.rb
  257. +0 −378 vendor/gems/erubis-2.6.6/.specification
  258. +0 −752 vendor/gems/erubis-2.6.6/CHANGES.txt
  259. +0 −20 vendor/gems/erubis-2.6.6/MIT-LICENSE
  260. +0 −102 vendor/gems/erubis-2.6.6/README.txt
  261. +0 −6 vendor/gems/erubis-2.6.6/benchmark/Makefile
  262. +0 −313 vendor/gems/erubis-2.6.6/benchmark/bench.rb
  263. +0 −141 vendor/gems/erubis-2.6.6/benchmark/bench_context.yaml
  264. +0 −4 vendor/gems/erubis-2.6.6/benchmark/templates/_footer.html
  265. +0 −52 vendor/gems/erubis-2.6.6/benchmark/templates/_header.html
  266. +0 −29 vendor/gems/erubis-2.6.6/benchmark/templates/bench_erb.rhtml
  267. +0 −29 vendor/gems/erubis-2.6.6/benchmark/templates/bench_erubis.rhtml
  268. +0 −29 vendor/gems/erubis-2.6.6/benchmark/templates/bench_eruby.rhtml
  269. +0 −10 vendor/gems/erubis-2.6.6/bin/erubis
  270. +0 −3,330 vendor/gems/erubis-2.6.6/contrib/erubis
  271. +0 −132 vendor/gems/erubis-2.6.6/contrib/erubis-run.rb
  272. +0 −179 vendor/gems/erubis-2.6.6/contrib/inline-require
  273. +0 −105 vendor/gems/erubis-2.6.6/doc-api/classes/ActionView.html
  274. +0 −209 vendor/gems/erubis-2.6.6/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html
  275. +0 −101 vendor/gems/erubis-2.6.6/doc-api/classes/ERB.html
  276. +0 −353 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis.html
  277. +0 −175 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/ArrayBufferEnhancer.html
  278. +0 −120 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/ArrayBufferEruby.html
  279. +0 −174 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/ArrayEnhancer.html
  280. +0 −120 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/ArrayEruby.html
  281. +0 −112 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/Basic.html
  282. +0 −327 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/Basic/Converter.html
  283. +0 −130 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/Basic/Engine.html
  284. +0 −215 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/BiPatternEnhancer.html
  285. +0 −120 vendor/gems/erubis-2.6.6/doc-api/classes/Erubis/BiPatternEruby.html
Sorry, we could not display the entire diff because too many files (1,965) changed.
View
138 vendor/gems/GeoRuby-1.3.4/.specification
@@ -1,138 +0,0 @@
---- !ruby/object:Gem::Specification
-name: GeoRuby
-version: !ruby/object:Gem::Version
- prerelease: false
- segments:
- - 1
- - 3
- - 4
- version: 1.3.4
-platform: ruby
-authors:
-- Guilhem Vellut
-autorequire:
-bindir: bin
-cert_chain: []
-
-date: 2009-03-19 00:00:00 +00:00
-default_executable:
-dependencies: []
-
-description: GeoRuby is intended as a holder for data returned from PostGIS and MySQL Spatial queries. The data model roughly follows the OGC "Simple Features for SQL" specification (see www.opengis.org/docs/99-049.pdf), although without any kind of advanced functionalities (such as geometric operators or reprojections)
-email: guilhem.vellut@gmail.com
-executables: []
-
-extensions: []
-
-extra_rdoc_files:
-- README
-files:
-- lib/geo_ruby/shp4r/dbf.rb
-- lib/geo_ruby/shp4r/shp.rb
-- lib/geo_ruby/simple_features/envelope.rb
-- lib/geo_ruby/simple_features/ewkb_parser.rb
-- lib/geo_ruby/simple_features/ewkt_parser.rb
-- lib/geo_ruby/simple_features/geometry.rb
-- lib/geo_ruby/simple_features/geometry_collection.rb
-- lib/geo_ruby/simple_features/geometry_factory.rb
-- lib/geo_ruby/simple_features/georss_parser.rb
-- lib/geo_ruby/simple_features/helper.rb
-- lib/geo_ruby/simple_features/line_string.rb
-- lib/geo_ruby/simple_features/linear_ring.rb
-- lib/geo_ruby/simple_features/multi_line_string.rb
-- lib/geo_ruby/simple_features/multi_point.rb
-- lib/geo_ruby/simple_features/multi_polygon.rb
-- lib/geo_ruby/simple_features/point.rb
-- lib/geo_ruby/simple_features/polygon.rb
-- lib/geo_ruby.rb
-- test/test_ewkb_parser.rb
-- test/test_ewkt_parser.rb
-- test/test_georss_kml.rb
-- test/test_shp.rb
-- test/test_shp_write.rb
-- test/test_simple_features.rb
-- README
-- MIT-LICENSE
-- rakefile.rb
-- test/data/multipoint.shp
-- test/data/point.shp
-- test/data/polygon.shp
-- test/data/polyline.shp
-- test/data/multipoint.dbf
-- test/data/point.dbf
-- test/data/polygon.dbf
-- test/data/polyline.dbf
-- test/data/multipoint.shx
-- test/data/point.shx
-- test/data/polygon.shx
-- test/data/polyline.shx
-- tools/db.yml
-- tools/lib/spatial_adapter/test/db/database_mysql.yml
-- tools/lib/spatial_adapter/test/db/database_postgis.yml
-- tools/lib/spatial_adapter/init.rb
-- tools/lib/spatial_adapter/lib/common_spatial_adapter.rb
-- tools/lib/spatial_adapter/lib/mysql_spatial_adapter.rb
-- tools/lib/spatial_adapter/lib/post_gis_adapter.rb
-- tools/lib/spatial_adapter/rakefile.rb
-- tools/lib/spatial_adapter/test/access_mysql_test.rb
-- tools/lib/spatial_adapter/test/access_postgis_test.rb
-- tools/lib/spatial_adapter/test/common/common_mysql.rb
-- tools/lib/spatial_adapter/test/common/common_postgis.rb
-- tools/lib/spatial_adapter/test/find_mysql_test.rb
-- tools/lib/spatial_adapter/test/find_postgis_test.rb
-- tools/lib/spatial_adapter/test/fixture_mysql_test.rb
-- tools/lib/spatial_adapter/test/fixture_postgis_test.rb
-- tools/lib/spatial_adapter/test/migration_mysql_test.rb
-- tools/lib/spatial_adapter/test/migration_postgis_test.rb
-- tools/lib/spatial_adapter/test/models/models_mysql.rb
-- tools/lib/spatial_adapter/test/models/models_postgis.rb
-- tools/lib/spatial_adapter/test/schema/schema_mysql.rb
-- tools/lib/spatial_adapter/test/schema/schema_postgis.rb
-- tools/shp2sql.rb
-- tools/lib/spatial_adapter
-- tools/lib/spatial_adapter/lib
-- tools/lib/spatial_adapter/MIT-LICENSE
-- tools/lib/spatial_adapter/README
-- tools/lib/spatial_adapter/test
-- tools/lib/spatial_adapter/test/common
-- tools/lib/spatial_adapter/test/db
-- tools/lib/spatial_adapter/test/models
-- tools/lib/spatial_adapter/test/schema
-has_rdoc: true
-homepage: http://thepochisuperstarmegashow.com/projects/
-licenses: []
-
-post_install_message:
-rdoc_options:
-- --main
-- README
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- segments:
- - 0
- version: "0"
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- segments:
- - 0
- version: "0"
-requirements:
-- none
-rubyforge_project:
-rubygems_version: 1.3.6
-signing_key:
-specification_version: 2
-summary: Ruby data holder for OGC Simple Features
-test_files:
-- test/test_ewkb_parser.rb
-- test/test_ewkt_parser.rb
-- test/test_georss_kml.rb
-- test/test_shp.rb
-- test/test_shp_write.rb
-- test/test_simple_features.rb
View
7 vendor/gems/GeoRuby-1.3.4/MIT-LICENSE
@@ -1,7 +0,0 @@
-Copyright (c) 2006 Guilhem Vellut <guilhem.vellut+georuby@gmail.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
83 vendor/gems/GeoRuby-1.3.4/README
@@ -1,83 +0,0 @@
-=GeoRuby
-
-This is GeoRuby 1.3.0 It is intended as a holder for data returned from PostGIS and the Spatial Extensions of MySql. The data model roughly follows the OGC "Simple Features for SQL" specification (see http://www.opengis.org/docs/99-049.pdf), although without any kind of advanced functionalities (such as geometric operators or reprojections). It also supports various output and input formats (GeoRSS, KML, Shapefile).
-
-===Available data types
-The following geometric data types are provided :
-- Point
-- Line string
-- Linear ring
-- Polygon
-- Multi point
-- Multi line string
-- Multi polygon
-- Geometry collection
-
-They can be in 2D, 3DZ, 3DM, and 4D.
-
-On top of this an Envelope class is available, to contain the bounding box of a geometry.
-
-===Input and output
-These geometries can be input and output in WKB/EWKB/WKT/EWKT format (as well as the related HexWKB and HexEWKB formats). HexEWKB and WKB are the default form under which geometric data is returned respectively from PostGIS and MySql.
-
-GeoRSS Simple, GeoRSS W3CGeo, GeoRSS GML can also be input and output. Note that they will not output valid RSS, but just the part strictly concerning the geometry as outlined in http://www.georss.org/1/ . Since the model does not allow multiple geometries, for geometry collections, only the first geometry will be output. Similarly, for polygons, the GeoRSS output will only contain the outer ring. As for W3CGeo output, only points can be output, so the first point of the geometry is chosen. By default the Simple format is output. Envelope can also be output in these formats: The box geometric type is chosen (except for W3CGeo, where the center of the envelope is chose). These formats can also be input and a GeoRuby geometry will be created. Note that it will not read a valid RSS file, only a geometry string.
-
-On top of that, there is now support for KML output and input. As for GeoRSS, a valid KML file will not be output, but only the geometric data. Options <tt>:id</tt>, <tt>:extrude</tt>, <tt>:tesselate</tt> and <tt>:altitude_mode</tt> can be given. Note that if the <tt>:altitude_mode</tt> option is not passed or set to <tt>clampToGround</tt>, the altitude data will not be output even if present. Envelopes output a LatLonAltBox instead of a geometry. For the output, the following geometric types are supported : Point, LineString, Polygon.
-
-===SHP reading et writing
-Georuby has support for reading ESRI shapefiles (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf). A tool called <tt>shp2sql.rb</tt> is also provided : it shows how to use the SHP reading functionality together with the spatial adapter plugin for Rails to import spatial features into MySQL and PostGIS.
-
-Here is an example of Shapefile reading, that goes through all the geometries in a file and disaply the values of the attributes :
- ShpFile.open(shpfile) do |shp|
- shp.each do |shape|
- geom = shape.geometry #a GeoRuby SimpleFeature
- att_data = shape.data #a Hash
- shp.fields.each do |field|
- puts att_data[field.name]
- end
- end
- end
-
-Support for ESRI shapefile creation and modification has been added as well. New shapefiles can be created given a geometry type and specifications for the DBF fields. Data can be added and removed from an existing shapefile. An update operation is also provided for convenience : it just performs a 'delete' and an 'add', which means the index of the modified record will change. Note that once a shapefile has been created, GeoRuby does not allow the modification of the schema (it will probably be done in a subsequent version).
-
-Here is an example of how to create a new Shapefile with 2 fields :
- shpfile = ShpFile.create('hello.shp',ShpType::POINT,[Dbf::Field.new("Hoyoyo","C",10),Dbf::Field.new("Boyoul","N",10,0)])
-The file is then open for reading and writing.
-
-Here is an example of how to write to a shapefile (created or not with GeoRuby) :
- shpfile = ShpFile.open('places.shp')
- shpfile.transaction do |tr|
- tr.add(ShpRecord.new(Point.from_x_y(123.4,123.4),'Hoyoyo' => "AEZ",'Bouyoul' => 45))
- tr.update(4,ShpRecord.new(Point.from_x_y(-16.67,16.41),'Hoyoyo' => "EatMe",'Bouyoul' => 42))
- tr.delete(1)
- end
- shpfile.close
-
-Note the transaction is just there so the operations on the files can be buffered. Nothing happens on the original files until the block has finished executing. Calling <tt>tr.rollback</tt> at anytime during the execution will prevent the modifications.
-
-Also currently, error reporting is minimal and it has not been tested that thoroughly so caveat emptor and backup before performing any destructive operation.
-
-===Installation
-To install the latest version, just type :
- gem install GeoRuby
-
-===Changes since the last version
-- Writing of ESRI shapefiles
-- Reading of ESRI shapefiles
-- Addition of a small tool to import spatial features in MySQL and PostGIS from a SHP file
-
-===Coming in the next versions
-- Schema modification of existing shapefiles
-- More error reporting when writing shapefiles
-- More tests on writing shapefiles ; tests on real-world shapefiles
-- Better shp2sql import tool
-- Documentation
-
-===Acknowledgement
-The SHP reading part uses a modified version of the DBF library (http://rubyforge.org/projects/dbf/) by Keith Morrison (http://infused.org). Thanks also to Pramukta Kumar and Pete Schwamb for their contributions.
-
-===License
-GeoRuby is released under the MIT license.
-
-===Support
-Any questions, enhancement proposals, bug notifications or corrections can be sent to mailto:guilhem.vellut@gmail.com.
View
16 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby.rb
@@ -1,16 +0,0 @@
-require 'geo_ruby/simple_features/helper'
-require 'geo_ruby/simple_features/geometry'
-require 'geo_ruby/simple_features/point'
-require 'geo_ruby/simple_features/line_string'
-require 'geo_ruby/simple_features/linear_ring'
-require 'geo_ruby/simple_features/polygon'
-require 'geo_ruby/simple_features/multi_point'
-require 'geo_ruby/simple_features/multi_line_string'
-require 'geo_ruby/simple_features/multi_polygon'
-require 'geo_ruby/simple_features/geometry_collection'
-require 'geo_ruby/simple_features/envelope'
-require 'geo_ruby/simple_features/geometry_factory'
-require 'geo_ruby/simple_features/ewkb_parser'
-require 'geo_ruby/simple_features/ewkt_parser'
-require 'geo_ruby/simple_features/georss_parser'
-require 'geo_ruby/shp4r/shp'
View
180 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/shp4r/dbf.rb
@@ -1,180 +0,0 @@
-# Copyright 2006 Keith Morrison (http://infused.org)
-# Modified version of his DBF library (http://rubyforge.org/projects/dbf/)
-
-module GeoRuby
- module Shp4r
- module Dbf
-
- DBF_HEADER_SIZE = 32
- DATE_REGEXP = /([\d]{4})([\d]{2})([\d]{2})/
- VERSION_DESCRIPTIONS = {
- "02" => "FoxBase",
- "03" => "dBase III without memo file",
- "04" => "dBase IV without memo file",
- "05" => "dBase V without memo file",
- "30" => "Visual FoxPro",
- "31" => "Visual FoxPro with AutoIncrement field",
- "7b" => "dBase IV with memo file",
- "83" => "dBase III with memo file",
- "8b" => "dBase IV with memo file",
- "8e" => "dBase IV with SQL table",
- "f5" => "FoxPro with memo file",
- "fb" => "FoxPro without memo file"
- }
-
- class DBFError < StandardError; end
- class UnpackError < DBFError; end
-
- class Reader
- attr_reader :field_count
- attr_reader :fields
- attr_reader :record_count
- attr_reader :version
- attr_reader :last_updated
- attr_reader :header_length
- attr_reader :record_length
-
- def initialize(file)
- @data_file = File.open(file, 'rb')
- reload!
- end
-
- def self.open(file)
- reader = Reader.new(file)
- if block_given?
- yield reader
- reader.close
- else
- reader
- end
- end
-
- def close
- @data_file.close
- end
-
- def reload!
- get_header_info
- get_field_descriptors
- end
-
- def field(field_name)
- @fields.detect {|f| f.name == field_name.to_s}
- end
-
- # An array of all the records contained in the database file
- def records
- seek_to_record(0)
- @records ||= Array.new(@record_count) do |i|
- if active_record?
- build_record
- else
- seek_to_record(i + 1)
- nil
- end
- end
- end
- alias_method :rows, :records
-
- # Jump to record
- def record(index)
- seek_to_record(index)
- active_record? ? build_record : nil
- end
-
- alias_method :row, :record
-
- def version_description
- VERSION_DESCRIPTIONS[version]
- end
-
- private
-
- def active_record?
- @data_file.read(1).unpack('H2').to_s == '20' rescue false
- end
-
- def build_record
- record = DbfRecord.new
- @fields.each do |field|
- case field.type
- when 'N'
- record[field.name] = unpack_integer(field) rescue nil
- when 'F'
- record[field.name] = unpack_float(field) rescue nil
- when 'D'
- raw = unpack_string(field).to_s.strip
- unless raw.empty?
- begin
- record[field.name] = Time.gm(*raw.match(DATE_REGEXP).to_a.slice(1,3).map {|n| n.to_i})
- rescue
- record[field.name] = Date.new(*raw.match(DATE_REGEXP).to_a.slice(1,3).map {|n| n.to_i}) rescue nil
- end
- end
- when 'L'
- record[field.name] = unpack_string(field) =~ /^(y|t)$/i ? true : false rescue false
- when 'C'
- record[field.name] = unpack_string(field).strip
- else
- record[field.name] = unpack_string(field)
- end
- end
- record
- end
-
- def get_header_info
- @data_file.rewind
- @version, @record_count, @header_length, @record_length = @data_file.read(DBF_HEADER_SIZE).unpack('H2xxxVvv')
- @field_count = (@header_length - DBF_HEADER_SIZE + 1) / DBF_HEADER_SIZE
- end
-
- def get_field_descriptors
- @fields = Array.new(@field_count) {|i| Field.new(*@data_file.read(32).unpack('a10xax4CC'))}
- end
-
- def seek(offset)
- @data_file.seek(@header_length + offset)
- end
-
- def seek_to_record(index)
- seek(@record_length * index)
- end
-
- def unpack_field(field)
- @data_file.read(field.length).unpack("a#{field.length}")
- end
-
- def unpack_string(field)
- unpack_field(field).to_s
- end
-
- def unpack_integer(field)
- unpack_string(field).to_i
- end
-
- def unpack_float(field)
- unpack_string(field).to_f
- end
-
- end
-
- class FieldError < StandardError; end
-
- class Field
- attr_reader :name, :type, :length, :decimal
-
- def initialize(name, type, length, decimal = 0)
- raise FieldError, "field length must be greater than 0" unless length > 0
- if type == 'N' and decimal != 0
- type = 'F'
- end
- @name, @type, @length, @decimal = name.strip, type,length, decimal
- end
- end
-
- class DbfRecord < Hash
- end
-
- end
- end
-end
View
701 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/shp4r/shp.rb
@@ -1,701 +0,0 @@
-require 'date'
-require 'fileutils' if !defined?(FileUtils)
-require File.dirname(__FILE__) + '/dbf'
-
-
-module GeoRuby
- module Shp4r
-
- #Enumerates all the types of SHP geometries. The MULTIPATCH one is the only one not currently supported by GeoRuby.
- module ShpType
- NULL_SHAPE = 0
- POINT = 1
- POLYLINE = 3
- POLYGON = 5
- MULTIPOINT = 8
- POINTZ = 11
- POLYLINEZ = 13
- POLYGONZ = 15
- MULTIPOINTZ = 18
- POINTM = 21
- POLYLINEM = 23
- POLYGONM = 25
- MULTIPOINTM = 28
- end
-
- #An interface to an ESRI shapefile (actually 3 files : shp, shx and dbf). Currently supports only the reading of geometries.
- class ShpFile
- attr_reader :shp_type, :record_count, :xmin, :ymin, :xmax, :ymax, :zmin, :zmax, :mmin, :mmax, :file_root, :file_length
-
- include Enumerable
-
- #Opens a SHP file. Both "abc.shp" and "abc" are accepted. The files "abc.shp", "abc.shx" and "abc.dbf" must be present
- def initialize(file)
- #strip the shp out of the file if present
- @file_root = file.gsub(/.shp$/i,"")
- #check existence of shp, dbf and shx files
- unless File.exists?(@file_root + ".shp") and File.exists?(@file_root + ".dbf") and File.exists?(@file_root + ".shx")
- raise MalformedShpException.new("Missing one of shp, dbf or shx for: #{@file}")
- end
-
- @dbf = Dbf::Reader.open(@file_root + ".dbf")
- @shx = File.open(@file_root + ".shx","rb")
- @shp = File.open(@file_root + ".shp","rb")
- read_index
- end
-
- #force the reopening of the files compsing the shp. Close before calling this.
- def reload!
- initialize(@file_root)
- end
-
- #opens a SHP "file". If a block is given, the ShpFile object is yielded to it and is closed upon return. Else a call to <tt>open</tt> is equivalent to <tt>ShpFile.new(...)</tt>.
- def self.open(file)
- shpfile = ShpFile.new(file)
- if block_given?
- yield shpfile
- shpfile.close
- else
- shpfile
- end
- end
-
- #create a new Shapefile of the specified shp type (see ShpType) and with the attribute specified in the +fields+ array (see Dbf::Field). If a block is given, the ShpFile object newly created is passed to it.
- def self.create(file,shp_type,fields,&proc)
- file_root = file.gsub(/.shp$/i,"")
- shx_io = File.open(file_root + ".shx","wb")
- shp_io = File.open(file_root + ".shp","wb")
- dbf_io = File.open(file_root + ".dbf","wb")
- str = [9994,0,0,0,0,0,50,1000,shp_type,0,0,0,0,0,0,0,0].pack("N7V2E8")
- shp_io << str
- shx_io << str
- rec_length = 1 + fields.inject(0) {|s,f| s + f.length} #+1 for the prefixed space (active record marker)
- dbf_io << [3,107,7,7,0,33 + 32 * fields.length,rec_length ].pack("c4Vv2x20") #32 bytes for first part of header
- fields.each do |field|
- dbf_io << [field.name,field.type,field.length,field.decimal].pack("a10xax4CCx14")
- end
- dbf_io << ['0d'].pack("H2")
-
- shx_io.close
- shp_io.close
- dbf_io.close
-
- open(file,&proc)
-
- end
-
- #Closes a shapefile
- def close
- @dbf.close
- @shx.close
- @shp.close
- end
-
- #starts a transaction, to buffer physical file operations on the shapefile components.
- def transaction
- trs = ShpTransaction.new(self,@dbf)
- if block_given?
- answer = yield trs
- if answer == :rollback
- trs.rollback
- elsif !trs.rollbacked
- trs.commit
- end
- else
- trs
- end
- end
-
- #return the description of data fields
- def fields
- @dbf.fields
- end
-
- #Tests if the file has no record
- def empty?
- record_count == 0
- end
-
- #Goes through each record
- def each
- (0...record_count).each do |i|
- yield get_record(i)
- end
- end
- alias :each_record :each
-
- #Returns record +i+
- def [](i)
- get_record(i)
- end
-
- #Returns all the records
- def records
- Array.new(record_count) do |i|
- get_record(i)
- end
- end
-
- private
- def read_index
- @file_length, @shp_type, @xmin, @ymin, @xmax, @ymax, @zmin, @zmax, @mmin,@mmax = @shx.read(100).unpack("x24Nx4VE8")
- @record_count = (@file_length - 50) / 4
- if @record_count == 0
- #initialize the bboxes to default values so if data added, they will be replaced
- @xmin, @ymin, @xmax, @ymax, @zmin, @zmax, @mmin,@mmax = Float::MAX, Float::MAX, -Float::MAX, -Float::MAX, Float::MAX, -Float::MAX, Float::MAX, -Float::MAX
- end
- unless @record_count == @dbf.record_count
- raise MalformedShpException.new("Not the same number of records in SHP and DBF")
- end
- end
-
- #TODO : refactor to minimize redundant code
- def get_record(i)
- return nil if record_count <= i or i < 0
- dbf_record = @dbf.record(i)
- @shx.seek(100 + 8 * i) #100 is the header length
- offset,length = @shx.read(8).unpack("N2")
- @shp.seek(offset * 2 + 8)
- rec_shp_type = @shp.read(4).unpack("V")[0]
-
- case(rec_shp_type)
- when ShpType::POINT
- x, y = @shp.read(16).unpack("E2")
- geometry = GeoRuby::SimpleFeatures::Point.from_x_y(x,y)
- when ShpType::POLYLINE #actually creates a multi_polyline
- @shp.seek(32,IO::SEEK_CUR) #extent
- num_parts, num_points = @shp.read(8).unpack("V2")
- parts = @shp.read(num_parts * 4).unpack("V" + num_parts.to_s)
- parts << num_points #indexes for LS of idx i go to parts of idx i to idx i +1
- points = Array.new(num_points) do
- x, y = @shp.read(16).unpack("E2")
- GeoRuby::SimpleFeatures::Point.from_x_y(x,y)
- end
- line_strings = Array.new(num_parts) do |i|
- GeoRuby::SimpleFeatures::LineString.from_points(points[(parts[i])...(parts[i+1])])
- end
- geometry = GeoRuby::SimpleFeatures::MultiLineString.from_line_strings(line_strings)
- when ShpType::POLYGON
- #TODO : TO CORRECT
- #does not take into account the possibility that the outer loop could be after the inner loops in the SHP + more than one outer loop
- #Still sends back a multi polygon (so the correction above won't change what gets sent back)
- @shp.seek(32,IO::SEEK_CUR)
- num_parts, num_points = @shp.read(8).unpack("V2")
- parts = @shp.read(num_parts * 4).unpack("V" + num_parts.to_s)
- parts << num_points #indexes for LS of idx i go to parts of idx i to idx i +1
- points = Array.new(num_points) do
- x, y = @shp.read(16).unpack("E2")
- GeoRuby::SimpleFeatures::Point.from_x_y(x,y)
- end
- linear_rings = Array.new(num_parts) do |i|
- GeoRuby::SimpleFeatures::LinearRing.from_points(points[(parts[i])...(parts[i+1])])
- end
- geometry = GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_linear_rings(linear_rings)])
- when ShpType::MULTIPOINT
- @shp.seek(32,IO::SEEK_CUR)
- num_points = @shp.read(4).unpack("V")[0]
- points = Array.new(num_points) do
- x, y = @shp.read(16).unpack("E2")
- GeoRuby::SimpleFeatures::Point.from_x_y(x,y)
- end
- geometry = GeoRuby::SimpleFeatures::MultiPoint.from_points(points)
-
-
- when ShpType::POINTZ
- x, y, z, m = @shp.read(24).unpack("E4")
- geometry = GeoRuby::SimpleFeatures::Point.from_x_y_z_m(x,y,z,m)
-
-
- when ShpType::POLYLINEZ
- @shp.seek(32,IO::SEEK_CUR)
- num_parts, num_points = @shp.read(8).unpack("V2")
- parts = @shp.read(num_parts * 4).unpack("V" + num_parts.to_s)
- parts << num_points #indexes for LS of idx i go to parts of idx i to idx i +1
- xys = Array.new(num_points) { @shp.read(16).unpack("E2") }
- @shp.seek(16,IO::SEEK_CUR)
- zs = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- @shp.seek(16,IO::SEEK_CUR)
- ms = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- points = Array.new(num_points) do |i|
- GeoRuby::SimpleFeatures::Point.from_x_y_z_m(xys[i][0],xys[i][1],zs[i],ms[i])
- end
- line_strings = Array.new(num_parts) do |i|
- GeoRuby::SimpleFeatures::LineString.from_points(points[(parts[i])...(parts[i+1])],GeoRuby::SimpleFeatures::DEFAULT_SRID,true,true)
- end
- geometry = GeoRuby::SimpleFeatures::MultiLineString.from_line_strings(line_strings,GeoRuby::SimpleFeatures::DEFAULT_SRID,true,true)
-
-
- when ShpType::POLYGONZ
- #TODO : CORRECT
-
- @shp.seek(32,IO::SEEK_CUR)#extent
- num_parts, num_points = @shp.read(8).unpack("V2")
- parts = @shp.read(num_parts * 4).unpack("V" + num_parts.to_s)
- parts << num_points #indexes for LS of idx i go to parts of idx i to idx i +1
- xys = Array.new(num_points) { @shp.read(16).unpack("E2") }
- @shp.seek(16,IO::SEEK_CUR)#extent
- zs = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- @shp.seek(16,IO::SEEK_CUR)#extent
- ms = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- points = Array.new(num_points) do |i|
- Point.from_x_y_z_m(xys[i][0],xys[i][1],zs[i],ms[i])
- end
- linear_rings = Array.new(num_parts) do |i|
- GeoRuby::SimpleFeatures::LinearRing.from_points(points[(parts[i])...(parts[i+1])],GeoRuby::SimpleFeatures::DEFAULT_SRID,true,true)
- end
- geometry = GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_linear_rings(linear_rings)],GeoRuby::SimpleFeatures::DEFAULT_SRID,true,true)
-
-
- when ShpType::MULTIPOINTZ
- @shp.seek(32,IO::SEEK_CUR)
- num_points = @shp.read(4).unpack("V")[0]
- xys = Array.new(num_points) { @shp.read(16).unpack("E2") }
- @shp.seek(16,IO::SEEK_CUR)
- zs = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- @shp.seek(16,IO::SEEK_CUR)
- ms = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
-
- points = Array.new(num_points) do |i|
- Point.from_x_y_z_m(xys[i][0],xys[i][1],zs[i],ms[i])
- end
-
- geometry = GeoRuby::SimpleFeatures::MultiPoint.from_points(points,GeoRuby::SimpleFeatures::DEFAULT_SRID,true,true)
-
- when ShpType::POINTM
- x, y, m = @shp.read(24).unpack("E3")
- geometry = GeoRuby::SimpleFeatures::Point.from_x_y_m(x,y,m)
-
- when ShpType::POLYLINEM
- @shp.seek(32,IO::SEEK_CUR)
- num_parts, num_points = @shp.read(8).unpack("V2")
- parts = @shp.read(num_parts * 4).unpack("V" + num_parts.to_s)
- parts << num_points #indexes for LS of idx i go to parts of idx i to idx i +1
- xys = Array.new(num_points) { @shp.read(16).unpack("E2") }
- @shp.seek(16,IO::SEEK_CUR)
- ms = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- points = Array.new(num_points) do |i|
- Point.from_x_y_m(xys[i][0],xys[i][1],ms[i])
- end
- line_strings = Array.new(num_parts) do |i|
- GeoRuby::SimpleFeatures::LineString.from_points(points[(parts[i])...(parts[i+1])],GeoRuby::SimpleFeatures::DEFAULT_SRID,false,true)
- end
- geometry = GeoRuby::SimpleFeatures::MultiLineString.from_line_strings(line_strings,GeoRuby::SimpleFeatures::DEFAULT_SRID,false,true)
-
-
- when ShpType::POLYGONM
- #TODO : CORRECT
-
- @shp.seek(32,IO::SEEK_CUR)
- num_parts, num_points = @shp.read(8).unpack("V2")
- parts = @shp.read(num_parts * 4).unpack("V" + num_parts.to_s)
- parts << num_points #indexes for LS of idx i go to parts of idx i to idx i +1
- xys = Array.new(num_points) { @shp.read(16).unpack("E2") }
- @shp.seek(16,IO::SEEK_CUR)
- ms = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
- points = Array.new(num_points) do |i|
- Point.from_x_y_m(xys[i][0],xys[i][1],ms[i])
- end
- linear_rings = Array.new(num_parts) do |i|
- GeoRuby::SimpleFeatures::LinearRing.from_points(points[(parts[i])...(parts[i+1])],GeoRuby::SimpleFeatures::DEFAULT_SRID,false,true)
- end
- geometry = GeoRuby::SimpleFeatures::MultiPolygon.from_polygons([GeoRuby::SimpleFeatures::Polygon.from_linear_rings(linear_rings)],GeoRuby::SimpleFeatures::DEFAULT_SRID,false,true)
-
-
- when ShpType::MULTIPOINTM
- @shp.seek(32,IO::SEEK_CUR)
- num_points = @shp.read(4).unpack("V")[0]
- xys = Array.new(num_points) { @shp.read(16).unpack("E2") }
- @shp.seek(16,IO::SEEK_CUR)
- ms = Array.new(num_points) {@shp.read(8).unpack("E")[0]}
-
- points = Array.new(num_points) do |i|
- Point.from_x_y_m(xys[i][0],xys[i][1],ms[i])
- end
-
- geometry = GeoRuby::SimpleFeatures::MultiPoint.from_points(points,GeoRuby::SimpleFeatures::DEFAULT_SRID,false,true)
- else
- geometry = nil
- end
-
- ShpRecord.new(geometry,dbf_record)
- end
- end
-
- #A SHP record : contains both the geometry and the data fields (from the DBF)
- class ShpRecord
- attr_reader :geometry , :data
-
- def initialize(geometry, data)
- @geometry = geometry
- @data = data
- end
-
- #Tests if the geometry is a NULL SHAPE
- def has_null_shape?
- @geometry.nil?
- end
- end
-
- #An object returned from ShpFile#transaction. Buffers updates to a Shapefile
- class ShpTransaction
- attr_reader :rollbacked
-
- def initialize(shp, dbf)
- @deleted = Hash.new
- @added = Array.new
- @shp = shp
- @dbf = dbf
- end
-
- #delete a record. Does not take into account the records added in the current transaction
- def delete(i)
- raise UnexistantRecordException.new("Invalid index : #{i}") if @shp.record_count <= i
- @deleted[i] = true
- end
-
- #Update a record. In effect just a delete followed by an add.
- def update(i, record)
- delete(i)
- add(record)
- end
-
- #add a ShpRecord at the end
- def add(record)
- record_type = to_shp_type(record.geometry)
- raise IncompatibleGeometryException.new("Incompatible type") unless record_type==@shp.shp_type
- @added << record
- end
-
- #updates the physical files
- def commit
- @shp.close
- @shp_r = open(@shp.file_root + ".shp", "rb")
- @dbf_r = open(@shp.file_root + ".dbf", "rb")
- @shp_io = open(@shp.file_root + ".shp.tmp.shp", "wb")
- @shx_io = open(@shp.file_root + ".shx.tmp.shx", "wb")
- @dbf_io = open(@shp.file_root + ".dbf.tmp.dbf", "wb")
- index = commit_delete
- min_x,max_x,min_y,max_y,min_z,max_z,min_m,max_m = commit_add(index)
- commit_finalize(min_x,max_x,min_y,max_y,min_z,max_z,min_m,max_m)
- @shp_r.close
- @dbf_r.close
- @dbf_io.close
- @shp_io.close
- @shx_io.close
- FileUtils.move(@shp.file_root + ".shp.tmp.shp", @shp.file_root + ".shp")
- FileUtils.move(@shp.file_root + ".shx.tmp.shx", @shp.file_root + ".shx")
- FileUtils.move(@shp.file_root + ".dbf.tmp.dbf", @shp.file_root + ".dbf")
-
- @deleted = Hash.new
- @added = Array.new
-
- @shp.reload!
- end
-
- #prevents the udpate from taking place
- def rollback
- @deleted = Hash.new
- @added = Array.new
- @rollbacked = true
- end
-
- private
-
- def to_shp_type(geom)
- root = if geom.is_a? GeoRuby::SimpleFeatures::Point
- "POINT"
- elsif geom.is_a? GeoRuby::SimpleFeatures::LineString
- "POLYLINE"
- elsif geom.is_a? GeoRuby::SimpleFeatures::Polygon
- "POLYGON"
- elsif geom.is_a? GeoRuby::SimpleFeatures::MultiPoint
- "MULTIPOINT"
- elsif geom.is_a? GeoRuby::SimpleFeatures::MultiLineString
- "POLYLINE"
- elsif geom.is_a? GeoRuby::SimpleFeatures::MultiPolygon
- "POLYGON"
- else
- false
- end
- return false if !root
-
- if geom.with_z
- root = root + "Z"
- elsif geom.with_m
- root = root + "M"
- end
- eval "ShpType::" + root
- end
-
- def commit_add(index)
- max_x, min_x, max_y, min_y,max_z,min_z,max_m,min_m = @shp.xmax,@shp.xmin,@shp.ymax,@shp.ymin,@shp.zmax,@shp.zmin,@shp.mmax,@shp.mmin
- @added.each do |record|
- @dbf_io << ['20'].pack('H2')
- @dbf.fields.each do |field|
- data = record.data[field.name]
- str = if field.type == 'D'
- sprintf("%04i%02i%02i",data.year,data.month,data.mday)
- elsif field.type == 'L'
- if data
- "T"
- else
- "F"
- end
- else
- data.to_s
- end
- @dbf_io << [str].pack("A#{field.length}")
- end
-
- shp_str,min_xp,max_xp,min_yp,max_yp,min_zp,max_zp,min_mp,max_mp = build_shp_geometry(record.geometry)
- max_x = max_xp if max_xp > max_x
- min_x = min_xp if min_xp < min_x
- max_y = max_yp if max_yp > max_y
- min_y = min_yp if min_yp < min_y
- max_z = max_zp if max_zp > max_z
- min_z = min_zp if min_zp < min_z
- max_m = max_mp if max_mp > max_m
- min_m = min_mp if min_mp < min_m
- length = (shp_str.length/2 + 2).to_i #num of 16-bit words; geom type is included (+2)
- @shx_io << [(@shp_io.pos/2).to_i,length].pack("N2")
- @shp_io << [index,length,@shp.shp_type].pack("N2V")
- @shp_io << shp_str
- index += 1
- end
- @shp_io.flush
- @shx_io.flush
- @dbf_io.flush
- [min_x,max_x,min_y,max_y,min_z,max_z,min_m,max_m]
- end
-
- def commit_delete
- @shp_r.rewind
- header = @shp_r.read(100)
- @shp_io << header
- @shx_io << header
- index = 1
- while(!@shp_r.eof?)
- icur,length = @shp_r.read(8).unpack("N2")
- unless(@deleted[icur-1])
- @shx_io << [(@shp_io.pos/2).to_i,length].pack("N2")
- @shp_io << [index,length].pack("N2")
- @shp_io << @shp_r.read(length * 2)
- index += 1
- else
- @shp_r.seek(length * 2,IO::SEEK_CUR)
- end
- end
- @shp_io.flush
- @shx_io.flush
-
- @dbf_r.rewind
- @dbf_io << @dbf_r.read(@dbf.header_length)
- icur = 0
- while(!@dbf_r.eof?)
- unless(@deleted[icur])
- @dbf_io << @dbf_r.read(@dbf.record_length)
- else
- @dbf_r.seek(@dbf.record_length,IO::SEEK_CUR)
- end
- icur += 1
- end
- @dbf_io.flush
- index
- end
-
- def commit_finalize(min_x,max_x,min_y,max_y,min_z,max_z,min_m,max_m)
- #update size in shp and dbf + extent and num records in dbf
- @shp_io.seek(0,IO::SEEK_END)
- shp_size = @shp_io.pos / 2
- @shx_io.seek(0,IO::SEEK_END)
- shx_size= @shx_io.pos / 2
- @shp_io.seek(24)
- @shp_io.write([shp_size].pack("N"))
- @shx_io.seek(24)
- @shx_io.write([shx_size].pack("N"))
- @shp_io.seek(36)
- @shx_io.seek(36)
- str = [min_x,min_y,max_x,max_y,min_z,max_z,min_m,max_m].pack("E8")
- @shp_io.write(str)
- @shx_io.write(str)
-
- @dbf_io.seek(4)
- @dbf_io.write([@dbf.record_count + @added.length - @deleted.length].pack("V"))
- end
-
- def build_shp_geometry(geometry)
- m_range = nil
- answer =
- case @shp.shp_type
- when ShpType::POINT
- bbox = geometry.bounding_box
- [geometry.x,geometry.y].pack("E2")
- when ShpType::POLYLINE
- str,bbox = create_bbox(geometry)
- build_polyline(geometry,str)
- when ShpType::POLYGON
- str,bbox = create_bbox(geometry)
- build_polygon(geometry,str)
- when ShpType::MULTIPOINT
- str,bbox = create_bbox(geometry)
- build_multi_point(geometry,str)
- when ShpType::POINTZ
- bbox = geometry.bounding_box
- [geometry.x,geometry.y,geometry.z,geometry.m].pack("E4")
- when ShpType::POLYLINEZ
- str,bbox = create_bbox(geometry)
- m_range = geometry.m_range
- build_polyline(geometry,str)
- build_polyline_zm(geometry,:@z,[bbox[0].z,bbox[1].z],str)
- build_polyline_zm(geometry,:@m,m_range,str)
- when ShpType::POLYGONZ
- str,bbox = create_bbox(geometry)
- m_range = geometry.m_range
- build_polygon(geometry,str)
- build_polygon_zm(geometry,:@z,[bbox[0].z,bbox[1].z],str)
- build_polygon_zm(geometry,:@m,m_range,str)
- when ShpType::MULTIPOINTZ
- str,bbox = create_bbox(geometry)
- m_range = geometry.m_range
- build_multi_point(geometry,str)
- build_multi_point_zm(geometry,:@z,[bbox[0].z,bbox[1].z],str)
- build_multi_point_zm(geometry,:@m,m_range,str)
- when ShpType::POINTM
- bbox = geometry.bounding_box
- [geometry.x,geometry.y,geometry.m].pack("E3")
- when ShpType::POLYLINEM
- str,bbox = create_bbox(geometry)
- m_range = geometry.m_range
- build_polyline(geometry,str)
- build_polyline_zm(geometry,:@m,m_range,str)
- when ShpType::POLYGONM
- str,bbox = create_bbox(geometry)
- m_range = geometry.m_range
- build_polygon(geometry,str)
- build_polygon_zm(geometry,:@m,m_range,str)
- when ShpType::MULTIPOINTM
- str,bbox = create_bbox(geometry)
- m_range = geometry.m_range
- build_multi_point(geometry,str)
- build_multi_point_zm(geometry,:@m,m_range,str)
- end
- m_range ||= [0,0]
- [answer,bbox[0].x,bbox[1].x,bbox[0].y,bbox[1].y,bbox[0].z || 0, bbox[1].z || 0, m_range[0], m_range[1]]
- end
-
- def create_bbox(geometry)
- bbox = geometry.bounding_box
- [[bbox[0].x,bbox[0].y,bbox[1].x,bbox[1].y].pack("E4"),bbox]
- end
-
- def build_polyline(geometry,str)
- if geometry.is_a? GeoRuby::SimpleFeatures::LineString
- str << [1,geometry.length,0].pack("V3")
- geometry.each do |point|
- str << [point.x,point.y].pack("E2")
- end
- else
- #multilinestring
- str << [geometry.length,geometry.inject(0) {|l, ls| l + ls.length}].pack("V2")
- str << geometry.inject([0]) {|a,ls| a << (a.last + ls.length)}.pack("V#{geometry.length}") #last element of the previous array is dropped
- geometry.each do |ls|
- ls.each do |point|
- str << [point.x,point.y].pack("E2")
- end
- end
- end
- str
- end
-
- def build_polyline_zm(geometry,zm,range,str)
- str << range.pack("E2")
- if geometry.is_a? GeoRuby::SimpleFeatures::LineString
- geometry.each do |point|
- str << [point.instance_variable_get(zm)].pack("E")
- end
- else
- #multilinestring
- geometry.each do |ls|
- ls.each do |point|
- str << [point.instance_variable_get(zm)].pack("E")
- end
- end
- end
- str
- end
-
- def build_polygon(geometry,str)
- if geometry.is_a? GeoRuby::SimpleFeatures::Polygon
- str << [geometry.length,geometry.inject(0) {|l, lr| l + lr.length}].pack("V2")
- str << geometry.inject([0]) {|a,lr| a << (a.last + lr.length)}.pack("V#{geometry.length}") #last element of the previous array is dropped
- geometry.each do |lr|
- lr.each do |point|
- str << [point.x,point.y].pack("E2")
- end
- end
- else
- #multipolygon
- num_rings = geometry.inject(0) {|l, poly| l + poly.length}
- str << [num_rings, geometry.inject(0) {|l, poly| l + poly.inject(0) {|l2,lr| l2 + lr.length} }].pack("V2")
- str << geometry.inject([0]) {|a,poly| poly.inject(a) {|a2, lr| a2 << (a2.last + lr.length)}}.pack("V#{num_rings}") #last element of the previous array is dropped
- geometry.each do |poly|
- poly.each do |lr|
- lr.each do |point|
- str << [point.x,point.y].pack("E2")
- end
- end
- end
- end
- str
- end
-
- def build_polygon_zm(geometry,zm,range,str)
- str << range.pack("E2")
- if geometry.is_a? GeoRuby::SimpleFeatures::Polygon
- geometry.each do |lr|
- lr.each do |point|
- str << [point.instance_variable_get(zm)].pack("E")
- end
- end
- else
- geometry.each do |poly|
- poly.each do |lr|
- lr.each do |point|
- str << [point.instance_variable_get(zm)].pack("E")
- end
- end
- end
- end
- str
- end
-
- def build_multi_point(geometry,str)
- str << [geometry.length].pack("V")
- geometry.each do |point|
- str << [point.x,point.y].pack("E2")
- end
- str
- end
-
- def build_multi_point_zm(geometry,zm,range,str)
- str << range.pack("E2")
- geometry.each do |point|
- str << [point.instance_variable_get(zm)].pack("E")
- end
- str
- end
- end
-
- class MalformedShpException < StandardError
- end
-
- class UnexistantRecordException < StandardError
- end
-
- class IncompatibleGeometryException < StandardError
- end
-
- class IncompatibleDataException < StandardError
- end
- end
-end
View
134 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/envelope.rb
@@ -1,134 +0,0 @@
-module GeoRuby
- module SimpleFeatures
-
- #Contains the bounding box of a geometry
- class Envelope
- attr_accessor :lower_corner, :upper_corner
- attr_accessor :srid, :with_z
-
- #Creates a enw Envelope with +lower_corner+ as the first element of the corners array and +upper_corner+ as the second element
- def initialize(srid = DEFAULT_SRID, with_z = false)
- @srid = srid
- @with_z = with_z
- end
-
- #Merges the argument with the current evelope
- def extend!(envelope)
- lower_corner.x = [lower_corner.x,envelope.lower_corner.x].min
- lower_corner.y = [lower_corner.y,envelope.lower_corner.y].min
- upper_corner.x = [upper_corner.x,envelope.upper_corner.x].max
- upper_corner.y = [upper_corner.y,envelope.upper_corner.y].max
- self
- end
-
- #Merges the argument with the current evelope and sends back a new
- #envelope without changing the current one
- def extend(envelope)
- e = Envelope.from_points([Point.from_x_y(lower_corner.x,lower_corner.y),
- Point.from_x_y(upper_corner.x,upper_corner.y)],srid,with_z)
- e.extend!(envelope)
- e
- end
-
- #Sends back the center of the envelope
- def center
- Point.from_x_y((lower_corner.x + upper_corner.x)/2,(lower_corner.y + upper_corner.y)/2)
- end
-
- #Tests the equality of line strings
- def ==(other_envelope)
- if other_envelope.class != self.class
- false
- else
- upper_corner == other_envelope.upper_corner and lower_corner == other_envelope.lower_corner
- end
- end
-
- #georss serialization: Dialect can be passed as option <tt>:dialect</tt> and set to <tt>:simple</tt> (default)
- #<tt>:w3cgeo</tt> or <tt>:gml</tt>. Options <tt>:featuretypetag
- def as_georss(options = {})
- dialect= options[:dialect] || :simple
- case(dialect)
- when :simple
- geom_attr = ""
- geom_attr += " featuretypetag=\"#{options[:featuretypetag]}\"" if options[:featuretypetag]
- geom_attr += " relationshiptag=\"#{options[:relationshiptag]}\"" if options[:relationshiptag]
- geom_attr += " floor=\"#{options[:floor]}\"" if options[:floor]
- geom_attr += " radius=\"#{options[:radius]}\"" if options[:radius]
- geom_attr += " elev=\"#{options[:elev]}\"" if options[:elev]
-
- georss_simple_representation(options.merge(:geom_attr => geom_attr))
- when :w3cgeo
- georss_w3cgeo_representation(options)
- when :gml
- georss_gml_representation(options)
- end
- end
-
- #georss simple representation
- def georss_simple_representation(options = {}) #:nodoc:
- georss_ns = options[:georss_ns] || "georss"
- geom_attr = options[:geom_attr]
- "<#{georss_ns}:box#{geom_attr}>#{lower_corner.y} #{lower_corner.x} #{upper_corner.y} #{upper_corner.x}</#{georss_ns}:box>\n"
- end
-
- #georss w3c representation : outputs the first point of the line
- def georss_w3cgeo_representation(options = {}) #:nodoc:
- w3cgeo_ns = options[:w3cgeo_ns] || "geo"
- point = self.center
- "<#{w3cgeo_ns}:lat>#{point.y}</#{w3cgeo_ns}:lat>\n<#{w3cgeo_ns}:long>#{point.x}</#{w3cgeo_ns}:long>\n"
- end
-
- #georss gml representation
- def georss_gml_representation(options = {}) #:nodoc:
- georss_ns = options[:georss_ns] || "georss"
- gml_ns = options[:gml_ns] || "gml"
- result = "<#{georss_ns}:where>\n<#{gml_ns}:Envelope>\n"
- result += "<#{gml_ns}:LowerCorner>" + "#{lower_corner.y} #{lower_corner.x}" + "</#{gml_ns}:LowerCorner>"
- result += "<#{gml_ns}:UpperCorner>" + "#{upper_corner.y} #{upper_corner.x}" + "</#{gml_ns}:UpperCorner>"
- result += "</#{gml_ns}:Envelope>\n</#{georss_ns}:where>\n"
- end
-
- #Sends back a latlonaltbox
- def as_kml(options = {})
- geom_data = ""
- geom_data = "<altitudeMode>#{options[:altitude_mode]}</altitudeMode>\n" if options[:altitude_mode]
-
- allow_z = with_z && (!options[:altitude_mode].nil?) && options[:atitude_mode] != "clampToGround"
-
- kml_representation(options.merge(:geom_data => geom_data,:allow_z => allow_z))
- end
-
- def kml_representation(options = {})#:nodoc:
- result = "<LatLonAltBox>\n"
- result += options[:geom_data]
- result += "<north>#{upper_corner.y}</north>\n"
- result += "<south>#{lower_corner.y}</south>\n"
- result += "<east>#{upper_corner.x}</east>\n"
- result += "<west>#{lower_corner.x}</west>\n"
-
- if with_z
- result += "<minAltitude>#{lower_corner.z}</minAltitude>"
- result += "<maxAltitude>#{upper_corner.z}</maxAltitude>"
- end
-
- result += "</LatLonAltBox>\n"
- end
-
- #Creates a new envelope. Accept an array of 2 points as argument
- def self.from_points(points,srid=DEFAULT_SRID,with_z=false)
- e = Envelope.new(srid,with_z)
- e.lower_corner, e.upper_corner = points
- e
- end
-
- #Creates a new envelope. Accept a sequence of point coordinates as argument : ((x,y),(x,y))
- def self.from_coordinates(points,srid=DEFAULT_SRID,with_z=false)
- e = Envelope.new(srid,with_z)
- e.lower_corner, e.upper_corner = points.collect{|point_coords| Point.from_coordinates(point_coords,srid,with_z)}
- e
- end
-
- end
- end
-end
View
216 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/ewkb_parser.rb
@@ -1,216 +0,0 @@
-require 'geo_ruby/simple_features/point'
-require 'geo_ruby/simple_features/line_string'
-require 'geo_ruby/simple_features/linear_ring'
-require 'geo_ruby/simple_features/polygon'
-require 'geo_ruby/simple_features/multi_point'
-require 'geo_ruby/simple_features/multi_line_string'
-require 'geo_ruby/simple_features/multi_polygon'
-require 'geo_ruby/simple_features/geometry_collection'
-
-module GeoRuby
- module SimpleFeatures
-
- #Raised when an error in the EWKB string is detected
- class EWKBFormatError < StandardError
- end
-
- #Parses EWKB strings and notifies of events (such as the beginning of the definition of geometry, the value of the SRID...) the factory passed as argument to the constructor.
- #
- #=Example
- # factory = GeometryFactory::new
- # ewkb_parser = EWKBParser::new(factory)
- # ewkb_parser.parse(<EWKB String>)
- # geometry = @factory.geometry
- #
- #You can also use directly the static method Geometry.from_ewkb
- class EWKBParser
-
- def initialize(factory)
- @factory = factory
- @parse_options ={
- 1 => method(:parse_point),
- 2 => method(:parse_line_string),
- 3 => method(:parse_polygon),
- 4 => method(:parse_multi_point),
- 5 => method(:parse_multi_line_string),
- 6 => method(:parse_multi_polygon),
- 7 => method(:parse_geometry_collection)
- }
- end
-
- #Parses the ewkb string passed as argument and notifies the factory of events
- def parse(ewkb)
- @factory.reset
- @unpack_structure=UnpackStructure::new(ewkb)
- @with_z = false
- @with_m = false
- parse_geometry
- @unpack_structure.done
- @srid=nil
- end
-
- private
- def parse_geometry
- @unpack_structure.endianness=@unpack_structure.read_byte
- @geometry_type = @unpack_structure.read_uint
-
- if (@geometry_type & Z_MASK) != 0
- @with_z=true
- @geometry_type = @geometry_type & ~Z_MASK
- end
- if (@geometry_type & M_MASK) != 0
- @with_m=true
- @geometry_type = @geometry_type & ~M_MASK
- end
- if (@geometry_type & SRID_MASK) != 0
- @srid = @unpack_structure.read_uint
- @geometry_type = @geometry_type & ~SRID_MASK
- else
- #to manage multi geometries : the srid is not present in sub_geometries, therefore we take the srid of the parent ; if it is the root, we take the default srid
- @srid= @srid || DEFAULT_SRID
- end
-
- if @parse_options.has_key? @geometry_type
- @parse_options[@geometry_type].call
- else
- raise EWKBFormatError::new("Unknown geometry type")
- end
- end
-
- def parse_geometry_collection
- parse_multi_geometries(GeometryCollection)
- end
-
- def parse_multi_polygon
- parse_multi_geometries(MultiPolygon)
- end
-
- def parse_multi_line_string
- parse_multi_geometries(MultiLineString)
- end
-
- def parse_multi_point
- parse_multi_geometries(MultiPoint)
- end
-
- def parse_multi_geometries(geometry_type)
- @factory.begin_geometry(geometry_type,@srid)
- num_geometries = @unpack_structure.read_uint
- 1.upto(num_geometries) { parse_geometry }
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_polygon
- @factory.begin_geometry(Polygon,@srid)
- num_linear_rings = @unpack_structure.read_uint
- 1.upto(num_linear_rings) {parse_linear_ring}
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_linear_ring
- parse_point_list(LinearRing)
- end
-
- def parse_line_string
- parse_point_list(LineString)
- end
-
- #used to parse line_strings and linear_rings
- def parse_point_list(geometry_type)
- @factory.begin_geometry(geometry_type,@srid)
- num_points = @unpack_structure.read_uint
- 1.upto(num_points) {parse_point}
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_point
- @factory.begin_geometry(Point,@srid)
- x = @unpack_structure.read_double
- y = @unpack_structure.read_double
- if ! (@with_z or @with_m) #most common case probably
- @factory.add_point_x_y(x,y)
- elsif @with_m and @with_z
- z = @unpack_structure.read_double
- m = @unpack_structure.read_double
- @factory.add_point_x_y_z_m(x,y,z,m)
- elsif @with_z
- z = @unpack_structure.read_double
- @factory.add_point_x_y_z(x,y,z)
- else
- m = @unpack_structure.read_double
- @factory.add_point_x_y_m(x,y,m)
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
- end
-
- #Parses HexEWKB strings. In reality, it just transforms the HexEWKB string into the equivalent EWKB string and lets the EWKBParser do the actual parsing.
- class HexEWKBParser < EWKBParser
- def initialize(factory)
- super(factory)
- end
- #parses an HexEWKB string
- def parse(hexewkb)
- super(decode_hex(hexewkb))
- end
- #transforms a HexEWKB string into an EWKB string
- def decode_hex(hexewkb)
- result=""
- num_bytes = (hexewkb.size + 1) / 2
- 0.upto(num_bytes-1) do |i|
- result << hexewkb[i*2,2].hex
- end
- result
- end
- end
-
- class HexEWKBParser < EWKBParser
- #transforms a HexEWKB string into an EWKB string
- # Patched for speedup
-
- end
-
- class UnpackStructure #:nodoc:
- NDR=1
- XDR=0
- def initialize(ewkb)
- @position=0
- @ewkb=ewkb
- end
- def done
- raise EWKBFormatError::new("Trailing data") if @position != @ewkb.length
- end
- def read_double
- i=@position
- @position += 8
- packed_double = @ewkb[i...@position]
- raise EWKBFormatError::new("Truncated data") if packed_double.nil? or packed_double.length < 8
- packed_double.unpack(@double_mark)[0]
- end
- def read_uint
- i=@position
- @position += 4
- packed_uint = @ewkb[i...@position]
- raise EWKBFormatError::new("Truncated data") if packed_uint.nil? or packed_uint.length < 4
- packed_uint.unpack(@uint_mark)[0]
- end
- def read_byte
- i = @position
- @position += 1
- packed_byte = @ewkb[i...@position]
- raise EWKBFormatError::new("Truncated data") if packed_byte.nil? or packed_byte.length < 1
- packed_byte.unpack("C")[0]
- end
- def endianness=(byte_order)
- if(byte_order == NDR)
- @uint_mark="V"
- @double_mark="E"
- elsif(byte_order == XDR)
- @uint_mark="N"
- @double_mark="G"
- end
- end
- end
- end
-end
View
336 vendor/gems/GeoRuby-1.3.4/lib/geo_ruby/simple_features/ewkt_parser.rb
@@ -1,336 +0,0 @@
-require 'geo_ruby/simple_features/point'
-require 'geo_ruby/simple_features/line_string'
-require 'geo_ruby/simple_features/linear_ring'
-require 'geo_ruby/simple_features/polygon'
-require 'geo_ruby/simple_features/multi_point'
-require 'geo_ruby/simple_features/multi_line_string'
-require 'geo_ruby/simple_features/multi_polygon'
-require 'geo_ruby/simple_features/geometry_collection'
-
-require 'strscan'
-
-module GeoRuby
- module SimpleFeatures
-
- #Raised when an error in the EWKT string is detected
- class EWKTFormatError < StandardError
- end
-
- #Parses EWKT strings and notifies of events (such as the beginning of the definition of geometry, the value of the SRID...) the factory passed as argument to the constructor.
- #
- #=Example
- # factory = GeometryFactory::new
- # ewkt_parser = EWKTParser::new(factory)
- # ewkt_parser.parse(<EWKT String>)
- # geometry = @factory.geometry
- #
- #You can also use directly the static method Geometry.from_ewkt
- class EWKTParser
-
- def initialize(factory)
- @factory = factory
- @parse_options ={
- "POINT" => method(:parse_point),
- "LINESTRING" => method(:parse_line_string),
- "POLYGON" => method(:parse_polygon),
- "MULTIPOINT" => method(:parse_multi_point),
- "MULTILINESTRING" => method(:parse_multi_line_string),
- "MULTIPOLYGON" => method(:parse_multi_polygon),
- "GEOMETRYCOLLECTION" => method(:parse_geometry_collection)
- }
- end
-
- #Parses the ewkt string passed as argument and notifies the factory of events
- def parse(ewkt)
- @factory.reset
- @tokenizer_structure = TokenizerStructure.new(ewkt)
- @with_z=false
- @with_m=false
- @is_3dm = false
- parse_geometry(true)
- @srid=nil
- end
-
- private
- def parse_geometry(srid_allowed)
-
- token = @tokenizer_structure.get_next_token
- if token == 'SRID'
- #SRID present
- raise EWKTFormatError.new("SRID not allowed at this position") if(!srid_allowed)
- if @tokenizer_structure.get_next_token != '='
- raise EWKTFormatError.new("Invalid SRID expression")
- else
- @srid = @tokenizer_structure.get_next_token.to_i
- raise EWKTFormatError.new("Invalid SRID separator") if @tokenizer_structure.get_next_token != ';'
- geom_type = @tokenizer_structure.get_next_token
- end
-
- else
- #to manage multi geometries : the srid is not present in sub_geometries, therefore we take the srid of the parent ; if it is the root, we take the default srid
- @srid= @srid || DEFAULT_SRID
- geom_type = token
- end
-
- if geom_type[-1] == ?M
- @is_3dm=true
- @with_m=true
- geom_type.chop! #remove the M
- end
-
- if @parse_options.has_key?(geom_type)
- @parse_options[geom_type].call
- else
- raise EWKTFormatError.new("Urecognized geometry type: #{geom_type}")
- end
- end
-
- def parse_geometry_collection
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid GeometryCollection')
- end
-
- @factory.begin_geometry(GeometryCollection,@srid)
-
- token = ''
- while token != ')'
- parse_geometry(false)
- token = @tokenizer_structure.get_next_token
- if token.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_multi_polygon
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid MultiLineString')
- end
-
- @factory.begin_geometry(MultiPolygon,@srid)
- token = ''
- while token != ')'
- parse_polygon
- token = @tokenizer_structure.get_next_token
- if token.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_multi_line_string
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid MultiLineString')
- end
-
- @factory.begin_geometry(MultiLineString,@srid)
-
- token = ''
- while token != ')'
- parse_line_string
- token = @tokenizer_structure.get_next_token
- if token.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_polygon
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid Polygon')
- end
-
- @factory.begin_geometry(Polygon,@srid)
-
- token = ''
- while token != ')'
- parse_linear_ring
- token = @tokenizer_structure.get_next_token
- if token.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
-
- #must support the PostGIS form and the one in the specification
- def parse_multi_point
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid MultiPoint')
- end
-
- token = @tokenizer_structure.check_next_token
- if token == '('
- #specification
- @factory.begin_geometry(MultiPoint,@srid)
-
- token = ''
- while token != ')'
- parse_point
- token = @tokenizer_structure.get_next_token
- if token.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
- end
-
- @factory.end_geometry(@with_z,@with_m)
- else
- #postgis
- parse_point_list(MultiPoint)
- end
- end
-
- def parse_linear_ring
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid Linear ring')
- end
-
- parse_point_list(LinearRing)
- end
-
- def parse_line_string
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid Line string')
- end
-
- parse_point_list(LineString)
- end
-
- #used to parse line_strings and linear_rings and the PostGIS form of multi_points
- def parse_point_list(geometry_type)
- @factory.begin_geometry(geometry_type,@srid)
-
- token = ''
- while token != ')'
- @factory.begin_geometry(Point,@srid)
- token = parse_coords
- if token.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
- @factory.end_geometry(@with_z,@with_m)
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_point
- if @tokenizer_structure.get_next_token !='('
- raise EWKTFormatError.new('Invalid Point')
- end
-
- @factory.begin_geometry(Point,@srid)
-
- token = parse_coords
-
- if token != ')'
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
-
- @factory.end_geometry(@with_z,@with_m)
- end
-
- def parse_coords
- coords = Array.new
- x = @tokenizer_structure.get_next_token
- y = @tokenizer_structure.get_next_token
-
- if x.nil? or y.nil?
- raise EWKTFormatError.new("Bad Point format")
- end
-
- if @is_3dm
- m = @tokenizer_structure.get_next_token
-
- if m.nil? or m == ',' or m == ')'
- raise EWKTFormatError.new("No M dimension found")
- else
- @factory.add_point_x_y_m(x.to_f,y.to_f,m.to_f)
- @tokenizer_structure.get_next_token
- end
- else
- z = @tokenizer_structure.get_next_token
-
- if z.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
-
- if z == ',' or z == ')'
- #2D : no z no m
- @factory.add_point_x_y(x.to_f,y.to_f)
- z
- else
- m = @tokenizer_structure.get_next_token
- if m.nil?
- raise EWKTFormatError.new("EWKT string not correctly terminated")
- end
-
- if m == ',' or m ==')'
- #3Dz : no m
- @with_z = true
- @factory.add_point_x_y_z(x.to_f,y.to_f,z.to_f)
- m
- else
- #4D
- @with_z = true
- @with_m = true
- @factory.add_point_x_y_z_m(x.to_f,y.to_f,z.to_f,m.to_f)
- @tokenizer_structure.get_next_token
- end
- end
- end
- end
- end
-
- class TokenizerStructure
-
- def initialize(ewkt)
- @ewkt = ewkt
- @scanner = StringScanner.new(ewkt)
- @regex = /\s*([\w.-]+)s*/
- end
-
- def get_next_token
- if @scanner.scan(@regex).nil?
- if @scanner.eos?
- nil
- else
- ch = @scanner.getch
- while ch == ' '
- ch = @scanner.getch
- end
- ch
- end
- else
- @scanner[1]
- end
- end
-
-
- def check_next_token
- check = @scanner.check(@regex)
- if check.nil?
- if @scanner.eos?
- nil
- else
- pos = @scanner.pos