spatial_features 3.8.0 → 3.8.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/README.md +24 -13
- data/lib/spatial_features/importers/kml.rb +1 -0
- 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: 20b15f8be8e82ecb943e33fa81f3ccb2a98981fcc0a6143c282ba5e86dd1021f
|
4
|
+
data.tar.gz: d8ce7b591e57b0c7ada43af9f7db1ca415d7c88cf156d8394348ba67b717b216
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71de22c18001e7b74ffc8f2caa98b5761cd92ea0c30dbf0bfdbb46f3d101b3806c44145bb897e69c4d9f2a929c07cde571490b3f2117549c6b010157c787e167
|
7
|
+
data.tar.gz: a4f3e57ac9e560dc641da35f499a3f39f73e61f1e39867a2762b51dfceb70b117ad4019ad304ae18b18338334a8297de8d65bf5bcc672bb0b6859fb90635329d
|
data/README.md
CHANGED
@@ -24,22 +24,33 @@ Adds spatial methods to a model.
|
|
24
24
|
|
25
25
|
CREATE TABLE features (
|
26
26
|
id integer NOT NULL,
|
27
|
-
type character varying(255),
|
28
27
|
spatial_model_type character varying(255),
|
29
28
|
spatial_model_id integer,
|
30
29
|
name character varying(255),
|
31
|
-
|
32
|
-
|
33
|
-
geom geometry(Geometry,
|
34
|
-
geom_lowres geometry(Geometry,
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
30
|
+
geog public.geography,
|
31
|
+
metadata public.hstore DEFAULT ''::public.hstore NOT NULL,
|
32
|
+
geom public.geometry(Geometry,3005),
|
33
|
+
geom_lowres public.geometry(Geometry,3005),
|
34
|
+
type character varying,
|
35
|
+
source_identifier character varying,
|
36
|
+
tilegeom public.geometry(Geometry,3857) GENERATED ALWAYS AS (public.st_transform(geom, 3857)) STORED,
|
37
|
+
feature_type character varying GENERATED ALWAYS AS (
|
38
|
+
CASE public.geometrytype(geog)
|
39
|
+
WHEN 'POLYGON'::text THEN 'polygon'::text
|
40
|
+
WHEN 'MULTIPOLYGON'::text THEN 'polygon'::text
|
41
|
+
WHEN 'GEOMETRYCOLLECTION'::text THEN 'polygon'::text
|
42
|
+
WHEN 'LINESTRING'::text THEN 'line'::text
|
43
|
+
WHEN 'MULTILINESTRING'::text THEN 'line'::text
|
44
|
+
WHEN 'POINT'::text THEN 'point'::text
|
45
|
+
WHEN 'MULTIPOINT'::text THEN 'point'::text
|
46
|
+
ELSE NULL::text
|
47
|
+
END) STORED,
|
48
|
+
centroid public.geography GENERATED ALWAYS AS (public.st_pointonsurface((geog)::public.geometry)) STORED,
|
49
|
+
area numeric GENERATED ALWAYS AS (public.st_area(geog)) STORED,
|
50
|
+
north numeric GENERATED ALWAYS AS (public.st_ymax(((geog)::public.geometry)::public.box3d)) STORED,
|
51
|
+
east numeric GENERATED ALWAYS AS (public.st_xmax(((geog)::public.geometry)::public.box3d)) STORED,
|
52
|
+
south numeric GENERATED ALWAYS AS (public.st_ymin(((geog)::public.geometry)::public.box3d)) STORED,
|
53
|
+
west numeric GENERATED ALWAYS AS (public.st_xmin(((geog)::public.geometry)::public.box3d)) STORED
|
43
54
|
);
|
44
55
|
|
45
56
|
CREATE SEQUENCE features_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
|
@@ -44,6 +44,7 @@ module SpatialFeatures
|
|
44
44
|
def kml_document
|
45
45
|
@kml_document ||= begin
|
46
46
|
doc = Nokogiri::XML(@data)
|
47
|
+
doc.remove_namespaces! # We don't care about namespaces since the document is going to be filled with placemark geometry and we want it all without needing to deal with namespaces
|
47
48
|
raise ImportError, "Invalid KML document (root node was '#{doc.root&.name}')" unless doc.root&.name.to_s.casecmp?('kml')
|
48
49
|
raise ImportError, "NetworkLink elements are not supported" unless doc.search('NetworkLink').empty?
|
49
50
|
doc
|
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.8.
|
4
|
+
version: 3.8.1
|
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:
|
12
|
+
date: 2025-08-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|