/build/cite/wfs10/citewfs-1.0/cite_data_postgis2.sql

https://github.com/geoserver/geoserver · SQL · 505 lines · 263 code · 86 blank · 156 comment · 0 complexity · 4c71c2fc41a31305fc18792dca1029df MD5 · raw file

  1. -- This file inserts all the appropriate cite data into postgis to run with
  2. -- geoserver. To work with the tar file of featureType directories it
  3. -- should be run in a database called cite, that either has a user with
  4. -- a password of cite, cite, or that allows anyone read/write access.
  5. -- You can also just run this script in whatever database you like with
  6. -- your user name, but then you have to modify all the user access info
  7. -- of the info.xml files. Uncommenting lines at 253 will create the cite
  8. -- user and grant access to it on all the relavant tables, the user you are
  9. -- connecting with must have the appropriate permissions to do that.
  10. -- Uncomment and change this to the user who has permissions to drop and
  11. -- create tables in this db.
  12. -- \connect - cite
  13. create extension postgis;
  14. --uncomment these if you want to reset everything.
  15. drop table "Nulls";
  16. drop table "Points";
  17. drop table "Other";
  18. drop table "Lines";
  19. drop table "Polygons";
  20. drop table "MLines";
  21. drop table "MPolygons";
  22. drop table "MPoints";
  23. drop table "Seven";
  24. drop table "Fifteen";
  25. drop table "Updates";
  26. drop table "Inserts";
  27. drop table "Deletes";
  28. drop table "Locks";
  29. delete from "geometry_columns" where srid=32615;
  30. --
  31. -- TOC Entry ID 23 (OID 312261)
  32. --
  33. -- Name: SevenFeature Type: TABLE Owner: ciesin
  34. --
  35. CREATE TABLE "Seven" (
  36. "boundedBy" geometry('POLYGON', 32615),
  37. "pointProperty" geometry('POINT', 32615)
  38. );
  39. --
  40. -- TOC Entry ID 24 (OID 312275)
  41. --
  42. -- Name: NullFeature Type: TABLE Owner: cite
  43. --
  44. CREATE TABLE "Nulls" (
  45. "description" character varying,
  46. "name" character varying,
  47. "boundedBy" geometry('POLYGON', 32615),
  48. "integers" integer,
  49. "dates" date,
  50. "pointProperty" geometry('POINT', 32615)
  51. );
  52. --
  53. -- TOC Entry ID 25 (OID 312300)
  54. --
  55. -- Name: DeleteFeature Type: TABLE Owner: cite
  56. --
  57. CREATE TABLE "Deletes" (
  58. "boundedBy" geometry('POLYGON', 32615),
  59. "id" character varying,
  60. "pointProperty" geometry('POINT', 32615)
  61. );
  62. --
  63. -- TOC Entry ID 26 (OID 312305)
  64. --
  65. -- Name: InsertFeature Type: TABLE Owner: cite
  66. --
  67. CREATE TABLE "Inserts" (
  68. "boundedBy" geometry('POLYGON', 32615),
  69. "id" character varying,
  70. "pointProperty" geometry('POINT', 32615)
  71. );
  72. --
  73. -- TOC Entry ID 27 (OID 312310)
  74. --
  75. -- Name: UpdateFeature Type: TABLE Owner: cite
  76. --
  77. CREATE TABLE "Updates" (
  78. "boundedBy" geometry('POLYGON', 32615),
  79. "id" character varying,
  80. "pointProperty" geometry('POINT', 32615)
  81. );
  82. --
  83. -- TOC Entry ID 28 (OID 312315)
  84. --
  85. -- Name: PointFeature Type: TABLE Owner: cite
  86. --
  87. CREATE TABLE "Points" (
  88. "id" character varying,
  89. "pointProperty" geometry('POINT', 32615)
  90. );
  91. --
  92. -- TOC Entry ID 29 (OID 312322)
  93. --
  94. -- Name: LineStringFeature Type: TABLE Owner: cite
  95. --
  96. CREATE TABLE "Lines" (
  97. "id" character varying,
  98. "lineStringProperty" geometry('LINESTRING', 32615)
  99. );
  100. --
  101. -- TOC Entry ID 30 (OID 312329)
  102. --
  103. -- Name: PolygonFeature Type: TABLE Owner: cite
  104. --
  105. CREATE TABLE "Polygons" (
  106. "id" character varying,
  107. "polygonProperty" geometry('POLYGON', 32615)
  108. );
  109. --
  110. -- TOC Entry ID 31 (OID 312335)
  111. --
  112. -- Name: MultiPointFeature Type: TABLE Owner: cite
  113. --
  114. CREATE TABLE "MPoints" (
  115. "id" character varying,
  116. "multiPointProperty" geometry('MULTIPOINT', 32615)
  117. ) WITH OIDS;
  118. --
  119. -- TOC Entry ID 32 (OID 312341)
  120. --
  121. -- Name: MultiLineStringFeature Type: TABLE Owner: cite
  122. --
  123. CREATE TABLE "MLines" (
  124. "id" character varying,
  125. "multiLineStringProperty" geometry('MULTILINESTRING', 32615)
  126. );
  127. --
  128. -- TOC Entry ID 33 (OID 312348)
  129. --
  130. -- Name: MultiPolygonFeature Type: TABLE Owner: cite
  131. --
  132. CREATE TABLE "MPolygons" (
  133. "id" character varying,
  134. "multiPolygonProperty" geometry('MULTIPOLYGON', 32615)
  135. );
  136. --
  137. -- TOC Entry ID 34 (OID 312391)
  138. --
  139. -- Name: FifteenFeature Type: TABLE Owner: cite
  140. --
  141. CREATE TABLE "Fifteen" (
  142. "boundedBy" geometry('POLYGON', 32615),
  143. "pointProperty" geometry('POINT', 32615)
  144. );
  145. --
  146. -- TOC Entry ID 35 (OID 312430)
  147. --
  148. -- Name: LockFeature Type: TABLE Owner: cite
  149. --
  150. CREATE TABLE "Locks" (
  151. "boundedBy" geometry('POLYGON', 32615),
  152. "id" character varying,
  153. "pointProperty" geometry('POINT', 32615)
  154. );
  155. --
  156. -- TOC Entry ID 36 (OID 312570)
  157. --
  158. -- Name: OtherFeature Type: TABLE Owner: cite
  159. --
  160. CREATE TABLE "Other" (
  161. "description" character varying,
  162. "name" character varying,
  163. "boundedBy" geometry('POLYGON', 32615),
  164. "pointProperty" geometry('POINT', 32615),
  165. "string1" character varying NOT NULL,
  166. "string2" character varying,
  167. "integers" integer,
  168. "dates" date
  169. );
  170. --
  171. -- Data for TOC Entry ID 39 (OID 113496)
  172. --
  173. -- Name: county Type: TABLE DATA Owner: public
  174. --
  175. COPY "Seven" FROM stdin;
  176. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  177. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  178. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  179. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  180. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  181. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  182. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  183. \.
  184. --
  185. -- Data for TOC Entry ID 59 (OID 312275)
  186. --
  187. -- Name: NullFeature Type: TABLE DATA Owner: public
  188. --
  189. COPY "Nulls" FROM stdin;
  190. nullFeature \N SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) \N \N \N
  191. \.
  192. --
  193. -- Data for TOC Entry ID 60 (OID 312300)
  194. --
  195. -- Name: DeleteFeature Type: TABLE DATA Owner: public
  196. --
  197. COPY "Deletes" FROM stdin;
  198. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) td0001 SRID=32615;POINT(500050 500050)
  199. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) td0002 SRID=32615;POINT(500050 500050)
  200. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) td0003 SRID=32615;POINT(500050 500050)
  201. \.
  202. --
  203. -- Data for TOC Entry ID 61 (OID 312305)
  204. --
  205. -- Name: InsertFeature Type: TABLE DATA Owner: public
  206. --
  207. COPY "Inserts" FROM stdin;
  208. \.
  209. --
  210. -- Data for TOC Entry ID 62 (OID 312310)
  211. --
  212. -- Name: UpdateFeature Type: TABLE DATA Owner: public
  213. --
  214. COPY "Updates" FROM stdin;
  215. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) tu0001 SRID=32615;POINT(500050 500050)
  216. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) tu0002 SRID=32615;POINT(500050 500050)
  217. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) tu0003 SRID=32615;POINT(500050 500050)
  218. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) tu0004 SRID=32615;POINT(500050 500050)
  219. \.
  220. --
  221. -- Data for TOC Entry ID 63 (OID 312315)
  222. --
  223. -- Name: PointFeature Type: TABLE DATA Owner: public
  224. --
  225. COPY "Points" FROM stdin;
  226. t0000 SRID=32615;POINT(500050 500050)
  227. \.
  228. --
  229. -- Data for TOC Entry ID 64 (OID 312322)
  230. --
  231. -- Name: LineStringFeature Type: TABLE DATA Owner: public
  232. --
  233. COPY "Lines" FROM stdin;
  234. t0001 SRID=32615;LINESTRING(500125 500025,500175 500075)
  235. \.
  236. --
  237. -- Data for TOC Entry ID 65 (OID 312329)
  238. --
  239. -- Name: PolygonFeature Type: TABLE DATA Owner: public
  240. --
  241. COPY "Polygons" FROM stdin;
  242. t0002 SRID=32615;POLYGON((500225 500025,500225 500075,500275 500050,500275 500025,500225 500025))
  243. \.
  244. --
  245. -- Data for TOC Entry ID 66 (OID 312335)
  246. --
  247. -- Name: MultiPointFeature Type: TABLE DATA Owner: public
  248. --
  249. COPY "MPoints" FROM stdin;
  250. t0003 SRID=32615;MULTIPOINT(500325 500025,500375 500075)
  251. \.
  252. --
  253. -- Data for TOC Entry ID 67 (OID 312341)
  254. --
  255. -- Name: MultiLineStringFeature Type: TABLE DATA Owner: public
  256. --
  257. COPY "MLines" FROM stdin;
  258. t0004 SRID=32615;MULTILINESTRING((500425 500025,500475 500075),(500425 500075,500475 500025))
  259. \.
  260. --
  261. -- Data for TOC Entry ID 68 (OID 312348)
  262. --
  263. -- Name: MultiPolygonFeature Type: TABLE DATA Owner: public
  264. --
  265. COPY "MPolygons" FROM stdin;
  266. t0005 SRID=32615;MULTIPOLYGON(((500525 500025,500550 500050,500575 500025,500525 500025)),((500525 500050,500525 500075,500550 500075,500550 500050,500525 500050)))
  267. \.
  268. --
  269. -- Data for TOC Entry ID 69 (OID 312391)
  270. --
  271. -- Name: FifteenFeature Type: TABLE DATA Owner: public
  272. --
  273. COPY "Fifteen" FROM stdin;
  274. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  275. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  276. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  277. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  278. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  279. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  280. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  281. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  282. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  283. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  284. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  285. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  286. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  287. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  288. SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050)
  289. \.
  290. --
  291. -- Data for TOC Entry ID 70 (OID 312430)
  292. --
  293. -- Name: LockFeature Type: TABLE DATA Owner: public
  294. --
  295. COPY "Locks" FROM stdin;
  296. \N lfla0001 \N
  297. \N lfla0002 \N
  298. \N lfla0003 \N
  299. \N lfla0004 \N
  300. \N gfwlla0001 \N
  301. \N gfwlla0002 \N
  302. \N gfwlla0003 \N
  303. \N gfwlla0004 \N
  304. \N lfbt0001 \N
  305. \N lfbt0002 \N
  306. \N lfbt0003 \N
  307. \N lfbt0004 \N
  308. \N lfbt0005 \N
  309. \N lfbt0006 \N
  310. \N gfwlbt0001 \N
  311. \N gfwlbt0002 \N
  312. \N gfwlbt0003 \N
  313. \N gfwlbt0004 \N
  314. \N gfwlbt0005 \N
  315. \N gfwlbt0006 \N
  316. \N lfe0001 \N
  317. \N lfe0002 \N
  318. \N lfe0003 \N
  319. \N lfe0004 \N
  320. \N gfwle0001 \N
  321. \N gfwle0002 \N
  322. \N gfwle0003 \N
  323. \N gfwle0004 \N
  324. \N lfra0001 \N
  325. \N lfra0002 \N
  326. \N lfra0003 \N
  327. \N lfra0004 \N
  328. \N lfra0005 \N
  329. \N lfra0006 \N
  330. \N lfra0007 \N
  331. \N lfra0008 \N
  332. \N lfra0009 \N
  333. \N lfra0010 \N
  334. \N gfwlra0001 \N
  335. \N gfwlra0002 \N
  336. \N gfwlra0003 \N
  337. \N gfwlra0004 \N
  338. \N gfwlra0005 \N
  339. \N gfwlra0006 \N
  340. \N gfwlra0007 \N
  341. \N gfwlra0008 \N
  342. \N gfwlra0009 \N
  343. \N gfwlra0010 \N
  344. \N lfrs0001 \N
  345. \N lfrs0002 \N
  346. \N lfrs0003 \N
  347. \N lfrs0004 \N
  348. \N lfrs0005 \N
  349. \N lfrs0006 \N
  350. \N lfrs0007 \N
  351. \N lfrs0008 \N
  352. \N lfrs0009 \N
  353. \N lfrs0010 \N
  354. \N gfwlrs0001 \N
  355. \N gfwlrs0002 \N
  356. \N gfwlrs0003 \N
  357. \N gfwlrs0004 \N
  358. \N gfwlrs0005 \N
  359. \N gfwlrs0006 \N
  360. \N gfwlrs0007 \N
  361. \N gfwlrs0008 \N
  362. \N gfwlrs0009 \N
  363. \N gfwlrs0010 \N
  364. \.
  365. UPDATE "Locks" SET "boundedBy" = ST_GeometryFromText('POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000))', 32615) WHERE TRUE;
  366. UPDATE "Locks" SET "pointProperty" = ST_GeometryFromText('POINT(500050 500050)', 32615) WHERE TRUE;
  367. --
  368. -- Data for TOC Entry ID 71 (OID 312570)
  369. --
  370. -- Name: OtherFeature Type: TABLE DATA Owner: public
  371. --
  372. COPY "Other" FROM stdin;
  373. A Single Feature used to test returning of properties singleFeature SRID=32615;POLYGON((500000 500000,500000 500100,500100 500100,500100 500000,500000 500000)) SRID=32615;POINT(500050 500050) always sometimes 7 2002-12-02
  374. \.
  375. --
  376. -- Fixes to have primary keys and no oids
  377. --
  378. alter table "Deletes" add column pkey serial;
  379. alter table "Deletes" add primary key (pkey);
  380. alter table "Deletes" set without oids;
  381. alter table "Fifteen" add column pkey serial;
  382. alter table "Fifteen" add primary key (pkey);
  383. alter table "Fifteen" set without oids;
  384. alter table "Inserts" add column pkey serial;
  385. alter table "Inserts" add primary key (pkey);
  386. alter table "Inserts" set without oids;
  387. alter table "Lines" add column pkey serial;
  388. alter table "Lines" add primary key (pkey);
  389. alter table "Lines" set without oids;
  390. alter table "Locks" add column pkey serial;
  391. alter table "Locks" add primary key (pkey);
  392. alter table "Locks" set without oids;
  393. alter table "MLines" add column pkey serial;
  394. alter table "MLines" add primary key (pkey);
  395. alter table "MLines" set without oids;
  396. alter table "MPoints" add column pkey serial;
  397. alter table "MPoints" add primary key (pkey);
  398. alter table "MPoints" set without oids;
  399. alter table "MPolygons" add column pkey serial;
  400. alter table "MPolygons" add primary key (pkey);
  401. alter table "MPolygons" set without oids;
  402. alter table "Nulls" add column pkey serial;
  403. alter table "Nulls" add primary key (pkey);
  404. alter table "Nulls" set without oids;
  405. alter table "Other" add column pkey serial;
  406. alter table "Other" add primary key (pkey);
  407. alter table "Other" set without oids;
  408. alter table "Points" add column pkey serial;
  409. alter table "Points" add primary key (pkey);
  410. alter table "Points" set without oids;
  411. alter table "Polygons" add column pkey serial;
  412. alter table "Polygons" add primary key (pkey);
  413. alter table "Polygons" set without oids;
  414. alter table "Seven" add column pkey serial;
  415. alter table "Seven" add primary key (pkey);
  416. alter table "Seven" set without oids;
  417. alter table "Updates" add column pkey serial;
  418. alter table "Updates" add primary key (pkey);
  419. alter table "Updates" set without oids;