[postgis-tickets] r14620 - Automatically generate system_ref_sys config dump for extension
Sandro Santilli
strk at keybit.net
Thu Jan 28 02:26:27 PST 2016
Author: strk
Date: 2016-01-28 02:26:27 -0800 (Thu, 28 Jan 2016)
New Revision: 14620
Added:
trunk/utils/create_spatial_ref_sys_config_dump.pl
Removed:
trunk/extensions/compute_srid_contiguous_ranges.sql
trunk/extensions/postgis/sql_bits/mark_editable_objects.sql.in
Modified:
trunk/extensions/postgis/Makefile.in
Log:
Automatically generate system_ref_sys config dump for extension
Fixes #3443
Deleted: trunk/extensions/compute_srid_contiguous_ranges.sql
===================================================================
--- trunk/extensions/compute_srid_contiguous_ranges.sql 2016-01-28 10:25:47 UTC (rev 14619)
+++ trunk/extensions/compute_srid_contiguous_ranges.sql 2016-01-28 10:26:27 UTC (rev 14620)
@@ -1,24 +0,0 @@
---this is the query to use to recompute what spatial_refs to exclude from backup
---it computes the where clause to put in mark_editable_objects.sql.in
-WITH s AS -- our series
- (SELECT srid As n
- FROM spatial_ref_sys
- ),
- -- get start ranges (numbers where next is not next + 1)
-n1 AS (SELECT n AS start_n
-FROM s
-EXCEPT
-SELECT n + 1 AS start_n
-FROM s),
--- for each start range find the next start range
-n2 AS (SELECT n1.start_n, lead(start_n) OVER (ORDER BY start_n) As next_set_n
-FROM n1
-GROUP BY n1.start_n),
--- determine end range for each start
--- end range is the last number that is before start of next range
-n3 As (SELECT start_n, MAX(COALESCE(s.n,start_n)) As end_n
-FROM n2 LEFT JOIN s ON( s.n >= n2.start_n AND s.n < n2.next_set_n)
-GROUP BY start_n, next_set_n
-ORDER BY start_n)
-SELECT 'WHERE NOT (' || string_agg('srid BETWEEN ' || start_n || ' AND ' || end_n, ' OR ' ORDER BY start_n) || ') '
-FROM n3 ;
\ No newline at end of file
Modified: trunk/extensions/postgis/Makefile.in
===================================================================
--- trunk/extensions/postgis/Makefile.in 2016-01-28 10:25:47 UTC (rev 14619)
+++ trunk/extensions/postgis/Makefile.in 2016-01-28 10:26:27 UTC (rev 14620)
@@ -33,7 +33,7 @@
all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql sql_minor_upgrade
-sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/mark_editable_objects.sql.in sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql
+sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/spatial_ref_sys_config_dump.sql sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql
mkdir -p sql
echo '\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \quit' > $@
cat $^ >> $@
@@ -70,6 +70,9 @@
sql_bits/rtpostgis.sql: ../../raster/rt_pg/rtpostgis.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
+sql_bits/spatial_ref_sys_config_dump.sql: ../../spatial_ref_sys.sql ../../utils/create_spatial_ref_sys_config_dump.pl
+ : ../../utils/create_spatial_ref_sys_config_dump.pl $< > $@
+
# we need to also drop this temporary function from the extension
# for casts that are being dropped we need to drop them
# from extension only if they are in the existension so we use our postgis_extension_drop..
Deleted: trunk/extensions/postgis/sql_bits/mark_editable_objects.sql.in
===================================================================
--- trunk/extensions/postgis/sql_bits/mark_editable_objects.sql.in 2016-01-28 10:25:47 UTC (rev 14619)
+++ trunk/extensions/postgis/sql_bits/mark_editable_objects.sql.in 2016-01-28 10:26:27 UTC (rev 14620)
@@ -1 +0,0 @@
-SELECT pg_catalog.pg_extension_config_dump('spatial_ref_sys', 'WHERE NOT (srid BETWEEN 2000 AND 2180 OR srid BETWEEN 2188 AND 2217 OR srid BETWEEN 2219 AND 2220 OR srid BETWEEN 2222 AND 2292 OR srid BETWEEN 2294 AND 2295 OR srid BETWEEN 2308 AND 2962 OR srid BETWEEN 2964 AND 2973 OR srid BETWEEN 2975 AND 2984 OR srid BETWEEN 2987 AND 3051 OR srid BETWEEN 3054 AND 3138 OR srid BETWEEN 3140 AND 3143 OR srid BETWEEN 3146 AND 3172 OR srid BETWEEN 3174 AND 3294 OR srid BETWEEN 3296 AND 3791 OR srid BETWEEN 3793 AND 3802 OR srid BETWEEN 3812 AND 3812 OR srid BETWEEN 3814 AND 3816 OR srid BETWEEN 3819 AND 3819 OR srid BETWEEN 3821 AND 3822 OR srid BETWEEN 3824 AND 3829 OR srid BETWEEN 3832 AND 3852 OR srid BETWEEN 3854 AND 3854 OR srid BETWEEN 3857 AND 3857 OR srid BETWEEN 3873 AND 3885 OR srid BETWEEN 3887 AND 3887 OR srid BETWEEN 3889 AND 3893 OR srid BETWEEN 3901 AND 3903 OR srid BETWEEN 3906 AND 3912 OR srid BETWEEN 3920 AND 3920 OR srid BETWEEN 3942 AND 3950 OR srid BETWEEN 3968 AND 3
970 OR srid BETWEEN 3973 AND 3976 OR srid BETWEEN 3978 AND 3979 OR srid BETWEEN 3985 AND 3989 OR srid BETWEEN 3991 AND 3992 OR srid BETWEEN 3994 AND 3997 OR srid BETWEEN 4000 AND 4016 OR srid BETWEEN 4018 AND 4039 OR srid BETWEEN 4041 AND 4063 OR srid BETWEEN 4071 AND 4071 OR srid BETWEEN 4073 AND 4073 OR srid BETWEEN 4075 AND 4075 OR srid BETWEEN 4079 AND 4079 OR srid BETWEEN 4081 AND 4083 OR srid BETWEEN 4087 AND 4088 OR srid BETWEEN 4093 AND 4100 OR srid BETWEEN 4120 AND 4176 OR srid BETWEEN 4178 AND 4185 OR srid BETWEEN 4188 AND 4289 OR srid BETWEEN 4291 AND 4304 OR srid BETWEEN 4306 AND 4319 OR srid BETWEEN 4322 AND 4322 OR srid BETWEEN 4324 AND 4324 OR srid BETWEEN 4326 AND 4326 OR srid BETWEEN 4328 AND 4328 OR srid BETWEEN 4330 AND 4338 OR srid BETWEEN 4340 AND 4340 OR srid BETWEEN 4342 AND 4342 OR srid BETWEEN 4344 AND 4344 OR srid BETWEEN 4346 AND 4346 OR srid BETWEEN 4348 AND 4348 OR srid BETWEEN 4350 AND 4350 OR srid BETWEEN 4352 AND 4352 OR srid BETWEEN 4354 AND 4354 OR
srid BETWEEN 4356 AND 4356 OR srid BETWEEN 4358 AND 4358 OR srid BETWEEN 4360 AND 4360 OR srid BETWEEN 4362 AND 4362 OR srid BETWEEN 4364 AND 4364 OR srid BETWEEN 4366 AND 4366 OR srid BETWEEN 4368 AND 4368 OR srid BETWEEN 4370 AND 4370 OR srid BETWEEN 4372 AND 4372 OR srid BETWEEN 4374 AND 4374 OR srid BETWEEN 4376 AND 4376 OR srid BETWEEN 4378 AND 4378 OR srid BETWEEN 4380 AND 4380 OR srid BETWEEN 4382 AND 4382 OR srid BETWEEN 4384 AND 4385 OR srid BETWEEN 4387 AND 4387 OR srid BETWEEN 4389 AND 4389 OR srid BETWEEN 4399 AND 4415 OR srid BETWEEN 4417 AND 4434 OR srid BETWEEN 4437 AND 4439 OR srid BETWEEN 4455 AND 4457 OR srid BETWEEN 4462 AND 4463 OR srid BETWEEN 4465 AND 4465 OR srid BETWEEN 4467 AND 4468 OR srid BETWEEN 4470 AND 4471 OR srid BETWEEN 4473 AND 4475 OR srid BETWEEN 4479 AND 4479 OR srid BETWEEN 4481 AND 4481 OR srid BETWEEN 4483 AND 4556 OR srid BETWEEN 4558 AND 4559 OR srid BETWEEN 4568 AND 4589 OR srid BETWEEN 4600 AND 4647 OR srid BETWEEN 4652 AND 4824 OR srid BE
TWEEN 4826 AND 4826 OR srid BETWEEN 4839 AND 4839 OR srid BETWEEN 4855 AND 4880 OR srid BETWEEN 4882 AND 4882 OR srid BETWEEN 4884 AND 4884 OR srid BETWEEN 4886 AND 4886 OR srid BETWEEN 4888 AND 4888 OR srid BETWEEN 4890 AND 4890 OR srid BETWEEN 4892 AND 4892 OR srid BETWEEN 4894 AND 4894 OR srid BETWEEN 4896 AND 4897 OR srid BETWEEN 4899 AND 4899 OR srid BETWEEN 4901 AND 4904 OR srid BETWEEN 4906 AND 4906 OR srid BETWEEN 4908 AND 4908 OR srid BETWEEN 4910 AND 4920 OR srid BETWEEN 4922 AND 4922 OR srid BETWEEN 4924 AND 4924 OR srid BETWEEN 4926 AND 4926 OR srid BETWEEN 4928 AND 4928 OR srid BETWEEN 4930 AND 4930 OR srid BETWEEN 4932 AND 4932 OR srid BETWEEN 4934 AND 4934 OR srid BETWEEN 4936 AND 4936 OR srid BETWEEN 4938 AND 4938 OR srid BETWEEN 4940 AND 4940 OR srid BETWEEN 4942 AND 4942 OR srid BETWEEN 4944 AND 4944 OR srid BETWEEN 4946 AND 4946 OR srid BETWEEN 4948 AND 4948 OR srid BETWEEN 4950 AND 4950 OR srid BETWEEN 4952 AND 4952 OR srid BETWEEN 4954 AND 4954 OR srid BETWEEN 4
956 AND 4956 OR srid BETWEEN 4958 AND 4958 OR srid BETWEEN 4960 AND 4960 OR srid BETWEEN 4962 AND 4962 OR srid BETWEEN 4964 AND 4964 OR srid BETWEEN 4966 AND 4966 OR srid BETWEEN 4968 AND 4968 OR srid BETWEEN 4970 AND 4970 OR srid BETWEEN 4972 AND 4972 OR srid BETWEEN 4974 AND 4974 OR srid BETWEEN 4976 AND 4976 OR srid BETWEEN 4978 AND 4978 OR srid BETWEEN 4980 AND 4980 OR srid BETWEEN 4982 AND 4982 OR srid BETWEEN 4984 AND 4984 OR srid BETWEEN 4986 AND 4986 OR srid BETWEEN 4988 AND 4988 OR srid BETWEEN 4990 AND 4990 OR srid BETWEEN 4992 AND 4992 OR srid BETWEEN 4994 AND 4994 OR srid BETWEEN 4996 AND 4996 OR srid BETWEEN 4998 AND 4998 OR srid BETWEEN 5011 AND 5011 OR srid BETWEEN 5013 AND 5016 OR srid BETWEEN 5018 AND 5018 OR srid BETWEEN 5041 AND 5042 OR srid BETWEEN 5048 AND 5048 OR srid BETWEEN 5069 AND 5072 OR srid BETWEEN 5105 AND 5130 OR srid BETWEEN 5132 AND 5132 OR srid BETWEEN 5167 AND 5188 OR srid BETWEEN 5221 AND 5221 OR srid BETWEEN 5223 AND 5223 OR srid BETWEEN 5228 AND
5229 OR srid BETWEEN 5233 AND 5235 OR srid BETWEEN 5243 AND 5244 OR srid BETWEEN 5246 AND 5247 OR srid BETWEEN 5250 AND 5250 OR srid BETWEEN 5252 AND 5259 OR srid BETWEEN 5262 AND 5262 OR srid BETWEEN 5264 AND 5264 OR srid BETWEEN 5266 AND 5266 OR srid BETWEEN 5269 AND 5275 OR srid BETWEEN 5292 AND 5311 OR srid BETWEEN 5316 AND 5316 OR srid BETWEEN 5318 AND 5318 OR srid BETWEEN 5320 AND 5322 OR srid BETWEEN 5324 AND 5325 OR srid BETWEEN 5329 AND 5332 OR srid BETWEEN 5337 AND 5337 OR srid BETWEEN 5340 AND 5341 OR srid BETWEEN 5343 AND 5349 OR srid BETWEEN 5352 AND 5352 OR srid BETWEEN 5354 AND 5358 OR srid BETWEEN 5360 AND 5363 OR srid BETWEEN 5365 AND 5365 OR srid BETWEEN 5367 AND 5369 OR srid BETWEEN 5371 AND 5371 OR srid BETWEEN 5373 AND 5373 OR srid BETWEEN 5379 AND 5379 OR srid BETWEEN 5381 AND 5383 OR srid BETWEEN 5387 AND 5389 OR srid BETWEEN 5391 AND 5391 OR srid BETWEEN 5393 AND 5393 OR srid BETWEEN 5396 AND 5396 OR srid BETWEEN 5451 AND 5451 OR srid BETWEEN 5456 AND 5464 O
R srid BETWEEN 5466 AND 5467 OR srid BETWEEN 5469 AND 5469 OR srid BETWEEN 5472 AND 5472 OR srid BETWEEN 5479 AND 5482 OR srid BETWEEN 5487 AND 5487 OR srid BETWEEN 5489 AND 5490 OR srid BETWEEN 5498 AND 5500 OR srid BETWEEN 5513 AND 5514 OR srid BETWEEN 5518 AND 5520 OR srid BETWEEN 5523 AND 5524 OR srid BETWEEN 5527 AND 5527 OR srid BETWEEN 5530 AND 5539 OR srid BETWEEN 5544 AND 5544 OR srid BETWEEN 5546 AND 5546 OR srid BETWEEN 5550 AND 5552 OR srid BETWEEN 5554 AND 5556 OR srid BETWEEN 5558 AND 5559 OR srid BETWEEN 5561 AND 5583 OR srid BETWEEN 5588 AND 5589 OR srid BETWEEN 5591 AND 5591 OR srid BETWEEN 5593 AND 5593 OR srid BETWEEN 5596 AND 5596 OR srid BETWEEN 5598 AND 5598 OR srid BETWEEN 5623 AND 5625 OR srid BETWEEN 5627 AND 5629 OR srid BETWEEN 5631 AND 5639 OR srid BETWEEN 5641 AND 5641 OR srid BETWEEN 5643 AND 5644 OR srid BETWEEN 5646 AND 5646 OR srid BETWEEN 5649 AND 5655 OR srid BETWEEN 5659 AND 5659 OR srid BETWEEN 5663 AND 5685 OR srid BETWEEN 5698 AND 5700 OR srid
BETWEEN 5707 AND 5708 OR srid BETWEEN 5825 AND 5825 OR srid BETWEEN 5828 AND 5828 OR srid BETWEEN 5832 AND 5837 OR srid BETWEEN 5839 AND 5839 OR srid BETWEEN 5842 AND 5842 OR srid BETWEEN 5844 AND 5858 OR srid BETWEEN 5875 AND 5877 OR srid BETWEEN 5879 AND 5880 OR srid BETWEEN 5884 AND 5884 OR srid BETWEEN 5886 AND 5887 OR srid BETWEEN 5890 AND 5890 OR srid BETWEEN 5921 AND 5940 OR srid BETWEEN 5942 AND 5942 OR srid BETWEEN 5945 AND 5976 OR srid BETWEEN 6050 AND 6125 OR srid BETWEEN 6128 AND 6129 OR srid BETWEEN 6133 AND 6133 OR srid BETWEEN 6135 AND 6135 OR srid BETWEEN 6141 AND 6141 OR srid BETWEEN 6144 AND 6176 OR srid BETWEEN 6190 AND 6190 OR srid BETWEEN 6204 AND 6204 OR srid BETWEEN 6207 AND 6207 OR srid BETWEEN 6210 AND 6211 OR srid BETWEEN 6316 AND 6318 OR srid BETWEEN 6320 AND 6320 OR srid BETWEEN 6322 AND 6323 OR srid BETWEEN 6325 AND 6325 OR srid BETWEEN 6328 AND 6356 OR srid BETWEEN 6362 AND 6363 OR srid BETWEEN 6365 AND 6372 OR srid BETWEEN 6381 AND 6387 OR srid BETWEEN
6391 AND 6391 OR srid BETWEEN 6393 AND 6637 OR srid BETWEEN 6646 AND 6646 OR srid BETWEEN 6649 AND 6666 OR srid BETWEEN 6668 AND 6692 OR srid BETWEEN 6696 AND 6697 OR srid BETWEEN 6700 AND 6700 OR srid BETWEEN 6703 AND 6704 OR srid BETWEEN 6706 AND 6709 OR srid BETWEEN 6720 AND 6723 OR srid BETWEEN 6732 AND 6738 OR srid BETWEEN 6781 AND 6781 OR srid BETWEEN 6783 AND 6783 OR srid BETWEEN 6867 AND 6868 OR srid BETWEEN 6870 AND 6871 OR srid BETWEEN 6875 AND 6876 OR srid BETWEEN 6879 AND 6880 OR srid BETWEEN 6884 AND 6887 OR srid BETWEEN 7400 AND 7423 OR srid BETWEEN 20004 AND 20032 OR srid BETWEEN 20064 AND 20092 OR srid BETWEEN 20135 AND 20138 OR srid BETWEEN 20248 AND 20258 OR srid BETWEEN 20348 AND 20358 OR srid BETWEEN 20436 AND 20440 OR srid BETWEEN 20499 AND 20499 OR srid BETWEEN 20538 AND 20539 OR srid BETWEEN 20790 AND 20791 OR srid BETWEEN 20822 AND 20824 OR srid BETWEEN 20934 AND 20936 OR srid BETWEEN 21035 AND 21037 OR srid BETWEEN 21095 AND 21097 OR srid BETWEEN 21100 AND
21100 OR srid BETWEEN 21148 AND 21150 OR srid BETWEEN 21291 AND 21292 OR srid BETWEEN 21413 AND 21423 OR srid BETWEEN 21453 AND 21463 OR srid BETWEEN 21473 AND 21483 OR srid BETWEEN 21500 AND 21500 OR srid BETWEEN 21780 AND 21782 OR srid BETWEEN 21817 AND 21818 OR srid BETWEEN 21891 AND 21894 OR srid BETWEEN 21896 AND 21899 OR srid BETWEEN 22032 AND 22033 OR srid BETWEEN 22091 AND 22092 OR srid BETWEEN 22171 AND 22177 OR srid BETWEEN 22181 AND 22187 OR srid BETWEEN 22191 AND 22197 OR srid BETWEEN 22234 AND 22236 OR srid BETWEEN 22275 AND 22275 OR srid BETWEEN 22277 AND 22277 OR srid BETWEEN 22279 AND 22279 OR srid BETWEEN 22281 AND 22281 OR srid BETWEEN 22283 AND 22283 OR srid BETWEEN 22285 AND 22285 OR srid BETWEEN 22287 AND 22287 OR srid BETWEEN 22289 AND 22289 OR srid BETWEEN 22291 AND 22291 OR srid BETWEEN 22293 AND 22293 OR srid BETWEEN 22300 AND 22300 OR srid BETWEEN 22332 AND 22332 OR srid BETWEEN 22391 AND 22392 OR srid BETWEEN 22521 AND 22525 OR srid BETWEEN 22700 AND 22700
OR srid BETWEEN 22770 AND 22770 OR srid BETWEEN 22780 AND 22780 OR srid BETWEEN 22832 AND 22832 OR srid BETWEEN 22991 AND 22994 OR srid BETWEEN 23028 AND 23038 OR srid BETWEEN 23090 AND 23090 OR srid BETWEEN 23095 AND 23095 OR srid BETWEEN 23239 AND 23240 OR srid BETWEEN 23433 AND 23433 OR srid BETWEEN 23700 AND 23700 OR srid BETWEEN 23830 AND 23853 OR srid BETWEEN 23866 AND 23872 OR srid BETWEEN 23877 AND 23884 OR srid BETWEEN 23886 AND 23894 OR srid BETWEEN 23946 AND 23948 OR srid BETWEEN 24047 AND 24048 OR srid BETWEEN 24100 AND 24100 OR srid BETWEEN 24200 AND 24200 OR srid BETWEEN 24305 AND 24306 OR srid BETWEEN 24311 AND 24313 OR srid BETWEEN 24342 AND 24347 OR srid BETWEEN 24370 AND 24383 OR srid BETWEEN 24500 AND 24500 OR srid BETWEEN 24547 AND 24548 OR srid BETWEEN 24571 AND 24571 OR srid BETWEEN 24600 AND 24600 OR srid BETWEEN 24718 AND 24720 OR srid BETWEEN 24817 AND 24821 OR srid BETWEEN 24877 AND 24882 OR srid BETWEEN 24891 AND 24893 OR srid BETWEEN 25000 AND 25000 OR s
rid BETWEEN 25231 AND 25231 OR srid BETWEEN 25391 AND 25395 OR srid BETWEEN 25700 AND 25700 OR srid BETWEEN 25828 AND 25838 OR srid BETWEEN 25884 AND 25884 OR srid BETWEEN 25932 AND 25932 OR srid BETWEEN 26191 AND 26195 OR srid BETWEEN 26237 AND 26237 OR srid BETWEEN 26331 AND 26332 OR srid BETWEEN 26391 AND 26393 OR srid BETWEEN 26432 AND 26432 OR srid BETWEEN 26591 AND 26592 OR srid BETWEEN 26632 AND 26632 OR srid BETWEEN 26692 AND 26692 OR srid BETWEEN 26701 AND 26722 OR srid BETWEEN 26729 AND 26760 OR srid BETWEEN 26766 AND 26787 OR srid BETWEEN 26791 AND 26799 OR srid BETWEEN 26801 AND 26803 OR srid BETWEEN 26811 AND 26815 OR srid BETWEEN 26819 AND 26826 OR srid BETWEEN 26830 AND 26837 OR srid BETWEEN 26841 AND 26870 OR srid BETWEEN 26891 AND 26899 OR srid BETWEEN 26901 AND 26923 OR srid BETWEEN 26929 AND 26946 OR srid BETWEEN 26948 AND 26998 OR srid BETWEEN 27037 AND 27040 OR srid BETWEEN 27120 AND 27120 OR srid BETWEEN 27200 AND 27200 OR srid BETWEEN 27205 AND 27232 OR srid B
ETWEEN 27258 AND 27260 OR srid BETWEEN 27291 AND 27292 OR srid BETWEEN 27391 AND 27398 OR srid BETWEEN 27429 AND 27429 OR srid BETWEEN 27492 AND 27493 OR srid BETWEEN 27500 AND 27500 OR srid BETWEEN 27561 AND 27564 OR srid BETWEEN 27571 AND 27574 OR srid BETWEEN 27581 AND 27584 OR srid BETWEEN 27591 AND 27594 OR srid BETWEEN 27700 AND 27700 OR srid BETWEEN 28191 AND 28193 OR srid BETWEEN 28232 AND 28232 OR srid BETWEEN 28348 AND 28358 OR srid BETWEEN 28402 AND 28432 OR srid BETWEEN 28462 AND 28492 OR srid BETWEEN 28600 AND 28600 OR srid BETWEEN 28991 AND 28992 OR srid BETWEEN 29100 AND 29101 OR srid BETWEEN 29118 AND 29122 OR srid BETWEEN 29168 AND 29172 OR srid BETWEEN 29177 AND 29185 OR srid BETWEEN 29187 AND 29195 OR srid BETWEEN 29220 AND 29221 OR srid BETWEEN 29333 AND 29333 OR srid BETWEEN 29371 AND 29371 OR srid BETWEEN 29373 AND 29373 OR srid BETWEEN 29375 AND 29375 OR srid BETWEEN 29377 AND 29377 OR srid BETWEEN 29379 AND 29379 OR srid BETWEEN 29381 AND 29381 OR srid BETWEE
N 29383 AND 29383 OR srid BETWEEN 29385 AND 29385 OR srid BETWEEN 29635 AND 29636 OR srid BETWEEN 29700 AND 29702 OR srid BETWEEN 29738 AND 29739 OR srid BETWEEN 29849 AND 29850 OR srid BETWEEN 29871 AND 29873 OR srid BETWEEN 29900 AND 29903 OR srid BETWEEN 30161 AND 30179 OR srid BETWEEN 30200 AND 30200 OR srid BETWEEN 30339 AND 30340 OR srid BETWEEN 30491 AND 30494 OR srid BETWEEN 30729 AND 30732 OR srid BETWEEN 30791 AND 30792 OR srid BETWEEN 30800 AND 30800 OR srid BETWEEN 31028 AND 31028 OR srid BETWEEN 31121 AND 31121 OR srid BETWEEN 31154 AND 31154 OR srid BETWEEN 31170 AND 31171 OR srid BETWEEN 31251 AND 31259 OR srid BETWEEN 31265 AND 31268 OR srid BETWEEN 31275 AND 31279 OR srid BETWEEN 31281 AND 31297 OR srid BETWEEN 31300 AND 31300 OR srid BETWEEN 31370 AND 31370 OR srid BETWEEN 31461 AND 31469 OR srid BETWEEN 31528 AND 31529 OR srid BETWEEN 31600 AND 31600 OR srid BETWEEN 31700 AND 31700 OR srid BETWEEN 31838 AND 31839 OR srid BETWEEN 31900 AND 31901 OR srid BETWEEN 319
65 AND 32003 OR srid BETWEEN 32005 AND 32031 OR srid BETWEEN 32033 AND 32058 OR srid BETWEEN 32061 AND 32062 OR srid BETWEEN 32064 AND 32067 OR srid BETWEEN 32074 AND 32077 OR srid BETWEEN 32081 AND 32086 OR srid BETWEEN 32098 AND 32100 OR srid BETWEEN 32104 AND 32104 OR srid BETWEEN 32107 AND 32130 OR srid BETWEEN 32133 AND 32158 OR srid BETWEEN 32161 AND 32161 OR srid BETWEEN 32164 AND 32167 OR srid BETWEEN 32180 AND 32199 OR srid BETWEEN 32201 AND 32260 OR srid BETWEEN 32301 AND 32360 OR srid BETWEEN 32401 AND 32460 OR srid BETWEEN 32501 AND 32560 OR srid BETWEEN 32601 AND 32667 OR srid BETWEEN 32701 AND 32761 OR srid BETWEEN 32766 AND 32766 OR srid BETWEEN 900913 AND 900913) ');
\ No newline at end of file
Added: trunk/utils/create_spatial_ref_sys_config_dump.pl
===================================================================
--- trunk/utils/create_spatial_ref_sys_config_dump.pl (rev 0)
+++ trunk/utils/create_spatial_ref_sys_config_dump.pl 2016-01-28 10:26:27 UTC (rev 14620)
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+
+#
+# PostGIS - Spatial Types for PostgreSQL
+# http://postgis.net
+#
+# Copyright (C) 2016 Sandro Santilli <strk at keybit.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU General Public Licence. See the COPYING file.
+#
+
+use warnings;
+use strict;
+
+(@ARGV) ||
+ die "Usage: perl $0 <spatial_ref_sys>\n" .
+ "Creates an SQL script to mark system records of spatial_ref_sys.\n";
+
+my $SRSFILE=$ARGV[0];
+
+open SRSFILE, "<$SRSFILE" || die "Can't open $SRSFILE for reading\n";
+
+my @SRIDS = ();
+while (<SRSFILE>) {
+ /^INSERT/ || next;
+ /\(([0-9]*),/ || next;
+ push @SRIDS, $1;
+}
+ at SRIDS = sort {$b <=> $a} @SRIDS;
+
+print "SELECT pg_catalog.pg_extension_config_dump('spatial_ref_sys',";
+print " 'WHERE NOT (\n";
+my $OR="";
+while (@SRIDS)
+{
+ my $min = pop @SRIDS;
+ #print "min:$min\n";
+ # Find upper bound
+ my $max = $min;
+ while (@SRIDS)
+ {
+ #print "next:$SRIDS[@SRIDS-1]\n";
+ last if ( $SRIDS[@SRIDS-1] != $max+1 );
+ $max = pop @SRIDS
+ };
+ if ( $min != $max ) {
+ print $OR . "srid BETWEEN $min AND $max\n";
+ } else {
+ print $OR . "srid = $min\n";
+ }
+ $OR = "OR ";
+}
+print join ",\n", @SRIDS;
+print ")');"
+#mark_editable_objects.sql.in
Property changes on: trunk/utils/create_spatial_ref_sys_config_dump.pl
___________________________________________________________________
Added: svn:executable
+ *
More information about the postgis-tickets
mailing list