the_geom_geojson 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 340ff888874bd866f745932b2866111f8accd642
4
- data.tar.gz: 3fe225b6c9398d9a15aa5e1a641b07c03ff046b8
3
+ metadata.gz: ffe2d91489bee741cbeda1627076c563bc85b1ca
4
+ data.tar.gz: 95fefdd350e5e37490265361b35a2037ddd1a61a
5
5
  SHA512:
6
- metadata.gz: 82eaa293691910f7bceaa17edcad2cf1b26bc22d429c82648bbeafb76f370093cf105ac75c75a5f8f0dba26012e26cffa8e8d6d3a37fb6c6dbe1546cf76075a6
7
- data.tar.gz: 910e318ce9138eb46a4207450ab7fa124d123c6a59892eb417d32090e2e53c794573a7fbb89a765dc032ed1d7f8f8264bf209345fb1f5e13a92c86c7391ce903
6
+ metadata.gz: 13a6463a0e6fdba2ed50dc56d11294a7075c0814dd905c7222eccebf63c50d1277d6c21714e7140eb20ea95a3ee303fc6da1284e07220de65882730439794dc6
7
+ data.tar.gz: 594030fe91fda9ec7846577dc6c0f8f11968df166c33e5106b576dd195759c36af0fbe44ef191c6513ff0d368a5cfb31c9f86dc3c30cf6caf47353a73bf80114
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.0.5 / 2014-10-17
2
+
3
+ * Enhancements
4
+
5
+ * Don't go to PostGIS database to convert WKB->GeoJSON, use rubyland RGeo instead.
6
+
1
7
  0.0.4 / 2014-10-09
2
8
 
3
9
  * Enhancements
@@ -46,10 +46,9 @@ module TheGeomGeoJSON
46
46
  def the_geom_geojson
47
47
  if @the_geom_geojson_dirty
48
48
  @the_geom_geojson_change
49
- elsif id
50
- self.class.connection_pool.with_connection do |c|
51
- c.select_value "SELECT ST_AsGeoJSON(the_geom) FROM #{self.class.quoted_table_name} WHERE #{self.class.quoted_primary_key} = #{c.quote(id)} LIMIT 1"
52
- end
49
+ elsif the_geom
50
+ parser = RGeo::WKRep::WKBParser.new nil, support_ewkb: true
51
+ JSON.dump RGeo::GeoJSON.encode(parser.parse(the_geom))
53
52
  end
54
53
  end
55
54
 
@@ -1,3 +1,3 @@
1
1
  module TheGeomGeoJSON
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -1,5 +1,8 @@
1
1
  require_relative 'the_geom_geojson/version'
2
2
 
3
+ require 'rgeo'
4
+ require 'rgeo/geo_json'
5
+
3
6
  module TheGeomGeoJSON
4
7
  Dirty = Class.new(RuntimeError)
5
8
  end
@@ -20,6 +20,8 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_runtime_dependency 'activerecord'
22
22
  spec.add_runtime_dependency 'pg'
23
+ spec.add_runtime_dependency 'rgeo'
24
+ spec.add_runtime_dependency 'rgeo-geojson'
23
25
 
24
26
  spec.add_development_dependency "bundler", "~> 1.6"
25
27
  spec.add_development_dependency "rake"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_geom_geojson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rgeo
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rgeo-geojson
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: bundler
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -163,3 +191,4 @@ test_files:
163
191
  - spec/spec_helper.rb
164
192
  - spec/the_geom_geojson/active_record_spec.rb
165
193
  - spec/the_geom_geojson_spec.rb
194
+ has_rdoc: