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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54f447bf36298072b9480e0f33faa93145d8f4dbdecd5d1422001f0202a25354
4
- data.tar.gz: 2546213005b5fde86ed5732c9d408a9b1ee7f30d9c53afeaa75a19a4b0f299f7
3
+ metadata.gz: 20b15f8be8e82ecb943e33fa81f3ccb2a98981fcc0a6143c282ba5e86dd1021f
4
+ data.tar.gz: d8ce7b591e57b0c7ada43af9f7db1ca415d7c88cf156d8394348ba67b717b216
5
5
  SHA512:
6
- metadata.gz: f9295415b8375b8d5c9741b15371b2aebf0eb02dc75220a6d0f3ac16259d26f1dd60aefdc0f3bf96f8e5c959a4b34d81717efaa87309555f1bbfe28261797aa6
7
- data.tar.gz: 26fedef5b3779e49f656410a5fbfc7cbf8997d2a7ac627015681372a5e61dc1392116ed95a46662143f1fdd1ea628a8b5aaaf6b0e7f45b08a42189f27a5e7cca
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
- feature_type character varying(255),
32
- geog geography,
33
- geom geometry(Geometry,4326),
34
- geom_lowres geometry(Geometry,4326),
35
- tilegeom geometry(Geometry,3857),
36
- metadata hstore,
37
- area double precision,
38
- north numeric(9,6),
39
- east numeric(9,6),
40
- south numeric(9,6),
41
- west numeric(9,6),
42
- centroid geography,
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
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "3.8.0"
2
+ VERSION = "3.8.1"
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.8.0
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: 2024-09-28 00:00:00.000000000 Z
12
+ date: 2025-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails