spatial_features 3.10.0 → 3.10.1
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/spatial_features/importers/kml.rb +15 -16
- data/lib/spatial_features/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c0e0009e894639d857055d9352765ff673d5d3759bc12b7382f132fd72af923
|
|
4
|
+
data.tar.gz: 6ecc2848af239c202773a3e80522fa8172619808254fd5ad39c15e20708abf2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7da7be9e6b5bb1ec0db3980ca273e8ce0156be36ea3b00a06b6c5d60316ed9b19960b9d0ebf7803ec71147f5b0e72c85028e3f64acc75f2d8b47bd5d2a924b6
|
|
7
|
+
data.tar.gz: 32ac8b571dd0d223145c5980b56d040ba7daa3fc5070558c192267011a735a95e0d0088332047ccba75f3bad9a2aa5b7aa7f575f1555b3457f4c8275fad243ca
|
|
@@ -56,24 +56,23 @@ module SpatialFeatures
|
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def geom_from_kml(kml)
|
|
59
|
-
geom = nil
|
|
60
|
-
conn = nil
|
|
61
|
-
|
|
62
59
|
strip_altitude(kml)
|
|
63
60
|
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
61
|
+
# Run the parse inside a SAVEPOINT so a `ST_GeomFromKML` failure on a single
|
|
62
|
+
# invalid feature rolls back only that savepoint, not the surrounding
|
|
63
|
+
# transaction. The previous implementation spawned a thread and checked out
|
|
64
|
+
# a fresh connection for the same isolation reason, but on Rails 8 that
|
|
65
|
+
# pattern deadlocks under `use_transactional_fixtures` — the test pins its
|
|
66
|
+
# connection, the spawned thread blocks indefinitely waiting on
|
|
67
|
+
# `ActiveRecord::Base.connection_pool.checkout`. A nested transaction
|
|
68
|
+
# (`requires_new: true`) gives identical fault containment without crossing
|
|
69
|
+
# thread boundaries.
|
|
70
|
+
ActiveRecord::Base.transaction(requires_new: true) do
|
|
71
|
+
conn = ActiveRecord::Base.connection
|
|
72
|
+
conn.select_value("SELECT ST_GeomFromKML(#{conn.quote(kml.to_s)})")
|
|
73
|
+
end
|
|
74
|
+
rescue ActiveRecord::StatementInvalid # Discard invalid KML features
|
|
75
|
+
nil
|
|
77
76
|
end
|
|
78
77
|
|
|
79
78
|
def images_from_metadata(metadata)
|
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.10.
|
|
4
|
+
version: 3.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Wallace
|
|
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
235
235
|
- !ruby/object:Gem::Version
|
|
236
236
|
version: '0'
|
|
237
237
|
requirements: []
|
|
238
|
-
rubygems_version:
|
|
238
|
+
rubygems_version: 4.0.5
|
|
239
239
|
specification_version: 4
|
|
240
240
|
summary: Adds spatial methods to a model.
|
|
241
241
|
test_files: []
|