charta 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b57d9dc1461dc8978d34f13e8724d173fcb9a95a
4
- data.tar.gz: 7dda0f7c5d00088060e6475b88a770bb19365f06
3
+ metadata.gz: 6e8a91f2b818cc99ed6f77f938f4c38b70e9be7d
4
+ data.tar.gz: 5a9de8a40efb3fcae10738f9630c508f11e42e50
5
5
  SHA512:
6
- metadata.gz: d4b1f0c6e499b09df8c156d3bf449f5655c4f686586624f42b6cf8b8d2bb1efede40e1d53444a2f70d64f24f70502edc153d51acba254c7643eab0935233b4e3
7
- data.tar.gz: 2db91883e43df8348abeffb14398613b1e8503e5bc12e182c1d241ef18da05d8ef35fefabe71711153e2665ba5bd135857e2899dee95cb7f95816aed8cc09b82
6
+ metadata.gz: 55ba30dc33527c548e2105cd0c557884270811e0a17be36f4d2563ebce23e7d506f5f11f9bbc019c977407f80d3c5af945a9175e4a385762e3a486a0c8030e3d
7
+ data.tar.gz: b66842d74f9ce47c4478b989f46c01fb59dd7ab01503c6eba6334f8cd1cfd6bb363869d2bfd064686c38fb1e4b60c43beb6a964f56545df567f5422a6ffe7444
@@ -1,5 +1,7 @@
1
- sudo: false
2
1
  language: ruby
3
2
  rvm:
4
- - 2.2.3
5
- before_install: gem install bundler -v 1.14.6
3
+ - 2.2.7
4
+ before_install:
5
+ - gem install bundler -v 1.14.6
6
+ - sudo apt-get install -f libgeos-dev libproj-dev
7
+ script: bundle exec rake test
@@ -73,7 +73,7 @@ module Charta
73
73
 
74
74
  def new_geometry(coordinates, srs = nil, format = nil, _flatten_collection = true, _options = {})
75
75
  return coordinates if coordinates.is_a?(::Charta::Geometry)
76
- feature = Charta.new_feature(coordinates)
76
+ feature = Charta.new_feature(coordinates, srs, format, _flatten_collection, _options)
77
77
  type = feature.geometry_type
78
78
  geom = case type
79
79
  when RGeo::Feature::Point then
@@ -93,7 +93,8 @@ module Charta
93
93
  end
94
94
 
95
95
  def new_point(lat, lon, srid = 4326)
96
- Point.new("SRID=#{srid};POINT(#{lon} #{lat})")
96
+ feature = Charta.new_feature("SRID=#{srid};POINT(#{lon} #{lat})")
97
+ Point.new(feature)
97
98
  end
98
99
 
99
100
  def make_line(points, options = {})
@@ -3,7 +3,8 @@ module Charta
3
3
  class GeometryCollection < Geometry
4
4
  def self.empty(srid = nil)
5
5
  srid = Charta.find_srid(srid.nil? ? :WGS84 : srid)
6
- new("SRID=#{srid};GEOMETRYCOLLECTION EMPTY")
6
+ feature = Charta.new_feature("GEOMETRYCOLLECTION EMPTY", srid)
7
+ new(feature)
7
8
  end
8
9
 
9
10
  def to_json_feature_collection
@@ -14,8 +14,7 @@ module Charta
14
14
 
15
15
  def points
16
16
  @points ||= feature.points.map do |point|
17
- generator = RGeo::WKRep::WKTGenerator.new(tag_format: :ewkt, emit_ewkt_srid: true)
18
- Point.new(generator.generate(point))
17
+ Point.new(point)
19
18
  end || []
20
19
  end
21
20
  end
@@ -15,14 +15,9 @@ module Charta
15
15
 
16
16
  # Extract polygons ordered by 'PointOnSurface' position
17
17
  def polygons
18
- unless defined? @polygons
19
- @polygons = []
20
- feature.each do |polygon|
21
- generator = RGeo::WKRep::WKTGenerator.new(tag_format: :ewkt, emit_ewkt_srid: true)
22
- @polygons << Polygon.new(generator.generate(polygon))
23
- end
24
- end
25
- @polygons
18
+ @polygons ||= feature._elements.map do |polygon|
19
+ Polygon.new(polygon)
20
+ end || []
26
21
  end
27
22
  end
28
23
  end
@@ -1,3 +1,3 @@
1
1
  module Charta
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice TEXIER
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.5.2
175
+ rubygems_version: 2.6.13
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: Simple tool over geos and co