the_geom_geojson 0.0.3 → 0.0.4

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: d005d30b01144ea2f6eb965f8ee0aad96320796a
4
- data.tar.gz: eee30f805c49d9e22d04c3bcc3b12271c320b2fe
3
+ metadata.gz: 340ff888874bd866f745932b2866111f8accd642
4
+ data.tar.gz: 3fe225b6c9398d9a15aa5e1a641b07c03ff046b8
5
5
  SHA512:
6
- metadata.gz: 222e5bca8a82622800fb3311b41f4e84d37c7864e65615a5ae4f3db6027bdbd51d9c9ca6065542cd5ec71501ef232f87d350ce9782c89f2a7a7762ce03deeca7
7
- data.tar.gz: f88b1b7d2b6e59fed2d5701363f9ca6beeea8fd53f5e7d9c58e16621184b0c62ae014b86c9daa17dfa1d55be724b8bca7d0281997f76c0a043b2f14e1542b8b7
6
+ metadata.gz: 82eaa293691910f7bceaa17edcad2cf1b26bc22d429c82648bbeafb76f370093cf105ac75c75a5f8f0dba26012e26cffa8e8d6d3a37fb6c6dbe1546cf76075a6
7
+ data.tar.gz: 910e318ce9138eb46a4207450ab7fa124d123c6a59892eb417d32090e2e53c794573a7fbb89a765dc032ed1d7f8f8264bf209345fb1f5e13a92c86c7391ce903
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 0.0.4 / 2014-10-09
2
+
3
+ * Enhancements
4
+
5
+ * Define example polygons in a clockwise direction to ensure compatibility with D3 3.0
6
+
1
7
  0.0.3 / 2014-10-08
2
8
 
3
9
  * Enhancements
@@ -1,15 +1,15 @@
1
1
  module TheGeomGeoJSON
2
2
  EXAMPLES = {
3
- burlington: '{"type":"Polygon","coordinates":[[[-73.223,44.491],[-73.229,44.462],[-73.211,44.439],[-73.146,44.447],[-73.171,44.49],[-73.223,44.491]]]}',
3
+ burlington: '{"type":"Polygon","coordinates":[[[-73.223,44.491],[-73.171,44.49],[-73.146,44.447],[-73.211,44.439],[-73.229,44.462],[-73.223,44.491]]]}',
4
4
  burlington_point: '{"type":"Point","coordinates":[-73.193,44.477]}',
5
- burlington_downtown: '{"type":"Polygon","coordinates":[[[-73.218,44.487],[-73.22,44.473],[-73.211,44.466],[-73.203,44.475],[-73.203,44.482],[-73.218,44.487]]]}',
5
+ burlington_downtown: '{"type":"Polygon","coordinates":[[[-73.218,44.487],[-73.203,44.482],[-73.203,44.475],[-73.211,44.466],[-73.22,44.473],[-73.218,44.487]]]}',
6
6
  burlington_downtown_point: '{"type":"Point","coordinates":[-73.21,44.476]}',
7
- south_burlington: '{"type":"Polygon","coordinates":[[[-73.175,44.474],[-73.182,44.46],[-73.162,44.456],[-73.158,44.466],[-73.169,44.473],[-73.175,44.474]]]}',
7
+ south_burlington: '{"type":"Polygon","coordinates":[[[-73.175,44.474],[-73.169,44.473],[-73.158,44.466],[-73.162,44.456],[-73.182,44.46],[-73.175,44.474]]]}',
8
8
  south_burlington_point: '{"type":"Point","coordinates":[-73.17,44.467]}',
9
9
  montpelier: '{"type":"Polygon","coordinates":[[[-72.228,44.426],[-72.367,44.204],[-72.442,44.128],[-72.588,44.16],[-72.683,44.013],[-72.916,44.071],[-72.91,44.281],[-72.804,44.451],[-72.653,44.398],[-72.596,44.479],[-72.49,44.425],[-72.433,44.506],[-72.228,44.426]]]}',
10
10
  montpelier_point: '{"type":"Point","coordinates":[-72.486,44.185]}',
11
11
  vermont: '{"type":"Polygon","coordinates":[[[-71.494,45.02],[-71.551,44.58],[-72.03,44.306],[-72.047,44.093],[-72.397,43.542],[-72.466,42.729],[-73.253,42.751],[-73.241,43.542],[-73.423,44.079],[-73.291,44.449],[-73.353,45.009],[-71.494,45.02]]]}',
12
- montreal_canada: '{"type":"Polygon","coordinates":[[[-74.064,45.694],[-74.069,45.34],[-73.674,45.228],[-73.234,45.325],[-73.256,45.614],[-73.641,45.775],[-74.064,45.694]]]}',
12
+ montreal_canada: '{"type":"Polygon","coordinates":[[[-74.064,45.694],[-73.641,45.775],[-73.256,45.614],[-73.234,45.325],[-73.674,45.228],[-74.069,45.34],[-74.064,45.694]]]}',
13
13
  northampton_ma_point: '{"type":"Point","coordinates":[-72.638,42.318]}',
14
14
  }
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module TheGeomGeoJSON
2
- VERSION = "0.0.3"
2
+ VERSION = '0.0.4'
3
3
  end
@@ -61,17 +61,17 @@ end
61
61
 
62
62
  describe TheGeomGeoJSON do
63
63
  describe 'ActiveRecord' do
64
- # # select st_setsrid(st_geomfromgeojson('{"type":"Point","coordinates":[-73.1936,44.4775]}'),4326);
64
+ # # SELECT ST_SetSRID(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[-73.193,44.477]}'), 4326);
65
65
  # st_setsrid
66
66
  # ----------------------------------------------------
67
- # 0101000020E61000005C2041F1634C52C085EB51B81E3D4640
67
+ # 0101000020E61000003108AC1C5A4C52C0931804560E3D4640
68
68
  # (1 row)
69
69
  let(:the_geom_expected) { '0101000020E61000003108AC1C5A4C52C0931804560E3D4640' }
70
70
 
71
- # # select st_transform(st_setsrid(st_geomfromgeojson('{"type":"Point","coordinates":[-73.1936,44.4775]}'),4326), 3857);
71
+ # # SELECT ST_Transform(ST_SetSRID(ST_GeomFromGeoJSON('{"type":"Point","coordinates":[-73.193,44.477]}'), 4326), 3857);
72
72
  # st_transform
73
73
  # ----------------------------------------------------
74
- # 0101000020110F000011410192E8145FC137D58F0ECD215541
74
+ # 0101000020110F0000C22156DFD7145FC10858288EB9215541
75
75
  # (1 row)
76
76
  let(:the_geom_webmercator_expected) { '0101000020110F0000C22156DFD7145FC10858288EB9215541' }
77
77
 
@@ -181,6 +181,15 @@ describe TheGeomGeoJSON do
181
181
  end
182
182
  it_behaves_like 'different states of persistence'
183
183
  end
184
+ end
184
185
 
186
+ describe '::EXAMPLES' do
187
+ TheGeomGeoJSON::EXAMPLES.each do |name, geojson|
188
+ it "[:#{name}] respects the right-hand-rule" do
189
+ pet = Pet.create the_geom_geojson: geojson
190
+ rhr_geom = Pet.connection.execute("SELECT ST_ForceRHR(the_geom) FROM pets WHERE id = '#{pet.id}'").getvalue(0,0)
191
+ expect(pet.the_geom).to eq(rhr_geom)
192
+ end
193
+ end
185
194
  end
186
195
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_geom_geojson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seamus Abshere