spatial_features 3.6.1 → 3.6.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
  SHA256:
3
- metadata.gz: b7cdd5c7e10977ad9a78fb31f28eb86dd05b1e62e0249f09b126f4ed4df90a19
4
- data.tar.gz: 893d5e2d61574a7fcdedde78e5fde1e2a6ccf9d2a251bfd69cbcbcf8dcda89e9
3
+ metadata.gz: 90e1672d25b0ffc7f11092c8518322c41597c2ebc826c5db42ab4e20bb5e3ff8
4
+ data.tar.gz: 61e0e85d335afd245d87e7d6aef3ad892398c704235b450ab45f949fd7d04a74
5
5
  SHA512:
6
- metadata.gz: 7ba7abf4e57f5bb8f76500e6b501b287e6b5b3ff09c5338b088900de2e9b993d4aa0365f305c52ba7febb6ff6ecf0606396026e4cae169767948a34b46bbd768
7
- data.tar.gz: 976241133335d867dd74f05e5426b8f9281d88c126f30177e4c4f56a5e4509104dfe80f1ae4dc27bc1eaba265a079c8e2b2eaee4d0e7096a6ac136ed15c69daf
6
+ metadata.gz: 4af5bcc317b7468ed0eae22689a7d233b129d23179ef03910d6afadd1283c3b7e5f9de7af7468b40ccccce2f445f9988cc43597bfc7d15c207c1dc3ce81b8c47
7
+ data.tar.gz: 3641ff55ebaa1399101cf08637da7fd5b94c3e4f132634266883f8815845acdc682ea693431f191e770ca117cc8e7c5ddb7ffedb60cd1fbadc13681b4c46ff43
@@ -10,7 +10,7 @@ module SpatialFeatures
10
10
  # -118.1,50.9,NaN
11
11
  # -118.1,50.9,0
12
12
  # -118.1,50.9
13
- COORDINATES_WITH_ALTITUDE = /((-?\d+\.\d+,-?\d+\.\d+)(,-?[a-zA-Z\d\.]+))/.freeze
13
+ COORDINATES_WITH_ALTITUDE = /(?<lng>\S+),(?<lat>\S+),(?<alt>\S+)/.freeze
14
14
 
15
15
  def initialize(data, base_dir: nil, **options)
16
16
  @base_dir = base_dir
@@ -117,8 +117,7 @@ module SpatialFeatures
117
117
 
118
118
  def strip_altitude(kml)
119
119
  kml.css('coordinates').each do |coordinates|
120
- next unless COORDINATES_WITH_ALTITUDE.match?(coordinates.content)
121
- coordinates.content = coordinates.content.gsub(COORDINATES_WITH_ALTITUDE, '\2')
120
+ coordinates.content = coordinates.content.gsub(COORDINATES_WITH_ALTITUDE, '\k<lng>,\k<lat>')
122
121
  end
123
122
  end
124
123
  end
@@ -66,7 +66,7 @@ module SpatialFeatures
66
66
  validate_shapefile!(file.path)
67
67
  proj4 = proj4_projection(file.path)
68
68
 
69
- RGeo::Shapefile::Reader.open(file.path) do |records| # Fall back to unprojected geometry if projection fails
69
+ RGeo::Shapefile::Reader.open(file.path, :allow_unsafe => true) do |records| # Fall back to unprojected geometry if projection fails
70
70
  block.call records, proj4
71
71
  end
72
72
  ensure
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "3.6.1"
2
+ VERSION = "3.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spatial_features
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
4
+ version: 3.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-02-08 00:00:00.000000000 Z
12
+ date: 2024-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails