charta 0.1.3 → 0.1.4
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 +4 -4
- data/lib/charta/geometry.rb +3 -3
- data/lib/charta/geometry_collection.rb +7 -4
- data/lib/charta/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8714ebcfc89f8507cf20d24450bfe64537f2466
|
4
|
+
data.tar.gz: 753ff77066f3443fb8fca493cbd4edf64011046c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10908d9cc9e07db0b3699f2b640324d2a4f96368ead65f26c74d15ab46374f452374306b19603ca3a891d88f5356171d8d5b8ccbed481b062a5ba357e4f30a99
|
7
|
+
data.tar.gz: 674cb95b22abc9604d7eaeb9076c805d3afc752af532260f586810457d99f774823abcfe309c98906afed1945588efb4453f216ce11474bc737eedcc65480f8f
|
data/lib/charta/geometry.rb
CHANGED
@@ -42,7 +42,7 @@ module Charta
|
|
42
42
|
|
43
43
|
# Returns the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata
|
44
44
|
def to_text
|
45
|
-
@feature.as_text
|
45
|
+
@feature.as_text.match(/\ASRID=.*;(.*)/)[1]
|
46
46
|
end
|
47
47
|
alias as_text to_text
|
48
48
|
alias to_wkt to_text
|
@@ -236,8 +236,8 @@ module Charta
|
|
236
236
|
@feature
|
237
237
|
end
|
238
238
|
|
239
|
-
def to_json_feature
|
240
|
-
{ type: 'Feature', geometry: to_json_object }
|
239
|
+
def to_json_feature(properties = {})
|
240
|
+
{ type: 'Feature', properties: properties, geometry: to_json_object }
|
241
241
|
end
|
242
242
|
|
243
243
|
class << self
|
@@ -7,11 +7,14 @@ module Charta
|
|
7
7
|
new(feature)
|
8
8
|
end
|
9
9
|
|
10
|
-
def to_json_feature_collection
|
11
|
-
features =
|
12
|
-
|
13
|
-
|
10
|
+
def to_json_feature_collection(collection_properties = [])
|
11
|
+
features = feature.each.with_index.collect do |f,i|
|
12
|
+
properties = {}
|
13
|
+
properties = collection_properties[i] unless collection_properties[i].nil?
|
14
|
+
|
15
|
+
Charta.new_geometry(f).to_json_feature(properties)
|
14
16
|
end
|
17
|
+
|
15
18
|
{ type: 'FeatureCollection', features: features }
|
16
19
|
end
|
17
20
|
end
|
data/lib/charta/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.4
|
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-
|
11
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|