Skip to content

Commit

Permalink
feat: add custom type to PostgreSQL schema for Bundesland extent
Browse files Browse the repository at this point in the history
In the adv-inspire-alignments, the ELU alignment has a special mechanism to
include the extent of a German Bundesland via an additional CSV source file.
Because of how the postnas-inspire-alignments are derived from the
adv-inspire-alignments, this additional source information needs to be
present in the matching alignment.

To avoid having to deal with both a database and a file source, a custom table
is added to the PostgreSQL schema instead and included in the matching
alignment. This table can be added by users to their PostgreSQL source database
to provide the Bundesland extent.

SVC-1734
  • Loading branch information
florianesser committed Sep 10, 2024
1 parent 78b3ef6 commit 8bc4bdd
Show file tree
Hide file tree
Showing 9 changed files with 1,334 additions and 474 deletions.
1,117 changes: 1,115 additions & 2 deletions database/matching.halex

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions database/matching.halex.alignment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126148,4 +126148,34 @@
</property>
</target>
</cell>
<cell relation="eu.esdihumboldt.hale.align.retype" id="C25d5217e-bd6c-4630-80ee-a3c20b50e601" priority="normal">
<source>
<class>
<type name="extentBundesland"/>
</class>
</source>
<target>
<class>
<type name="extent_bundesland" ns="jdbc:postgresql:testbed:public"/>
</class>
</target>
<parameter value="false" name="ignoreNamespaces"/>
<parameter value="false" name="structuralRename"/>
</cell>
<cell relation="eu.esdihumboldt.hale.align.rename" id="C11103c2f-cfa3-4714-be48-38f6f0cb7559" priority="normal">
<source>
<property>
<type name="extentBundesland"/>
<child name="WKT"/>
</property>
</source>
<target>
<property>
<type name="extent_bundesland" ns="jdbc:postgresql:testbed:public"/>
<child name="wkt"/>
</property>
</target>
<parameter value="false" name="ignoreNamespaces"/>
<parameter value="false" name="structuralRename"/>
</cell>
</alignment>
37 changes: 36 additions & 1 deletion database/schema.hsd
Original file line number Diff line number Diff line change
Expand Up @@ -2524,8 +2524,11 @@
<hsd:entry index="840">
<hsd:name namespace="jdbc:postgresql:testbed:public">vor_flst</hsd:name>
</hsd:entry>
<hsd:entry index="841">
<hsd:name namespace="jdbc:postgresql:testbed:public">extent_bundesland</hsd:name>
</hsd:entry>
</hsd:type-index>
<hsd:mapping-relevant>7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 550 552 553 554 555 556 557 559 560 561 562 563 564 565 721 722 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 836 837 839 840</hsd:mapping-relevant>
<hsd:mapping-relevant>7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 550 552 553 554 555 556 557 559 560 561 562 563 564 565 721 722 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 836 837 839 840 841</hsd:mapping-relevant>
<hsd:types>
<hsd:type index="0">
<hsd:name namespace="jdbc:postgresql:testbed">_bool</hsd:name>
Expand Down Expand Up @@ -89541,6 +89544,38 @@
</hsd:property>
</hsd:declares>
</hsd:type>
<hsd:type index="841">
<hsd:name namespace="jdbc:postgresql:testbed:public">extent_bundesland</hsd:name>
<hsd:description>Umring Bundesland für ELU</hsd:description>
<hsd:constraint type="abstract" value="false"/>
<hsd:constraint type="has-value" value="false"/>
<hsd:constraint type="jdbc_sqlquery">
<core:text xml:space="preserve" xmlns:core="http://www.esdi-humboldt.eu/hale/core">SELECT * FROM "public"."extent_bundesland"</core:text>
</hsd:constraint>
<hsd:constraint type="jdbc_table">
<core:properties xmlns:core="http://www.esdi-humboldt.eu/hale/core">
<core:property name="schema">
<core:value value="public"/>
</core:property>
<core:property name="usequote">
<core:value value="true"/>
</core:property>
<core:property name="table">
<core:value value="extent_bundesland"/>
</core:property>
</core:properties>
</hsd:constraint>
<hsd:constraint type="mappable" value="true"/>
<hsd:constraint type="mapping-relevant" value="true"/>
<hsd:declares>
<hsd:property>
<hsd:name>wkt</hsd:name>
<hsd:constraint type="cardinality" value="1..1"/>
<hsd:constraint type="nillable" value="false"/>
<hsd:propertyType index="834"/>
</hsd:property>
</hsd:declares>
</hsd:type>
</hsd:types>
</hsd:schema>
</hsd:schemas>
7 changes: 4 additions & 3 deletions projects/elu-auto.halex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hale-project version="5.1.0.release">
<hale-project version="5.3.0.release">
<name>[Annex III] AdV ALKIS 7.1.2 zu INSPIRE Existing Land Use</name>
<author>Johanna Ott</author>
<description>Transformationsprojekt für die Transformation von Daten aus ALKIS nach INSPIRE ExistingLandUse.&#13;
Expand All @@ -17,7 +17,7 @@ Hinweis zur Nutzung der Projektvariablen:&#13;
ATKIS als Quelle derzeit ausgeschlossen&#13;
(Begründung aus Email Herr Schliebner 30.05.2018: "Keine Verflächung von linienhaften Elementen. Zum AdV-Plenums-Beschluss 127/7 soll ein entsprechendes Änderungsersuchen gestellt werden, was Herr Dr. Seifert am 05.-06.Juni 2018 bei der AK IK-Tagung thematisieren wird. Diese Änderung kann hieb- und stichfest damit begründet werden, dass zur Schaffung von INSPIRE-Daten aus ATKIS erheblicher Aufwand anfiele.")</description>
<created>2018-02-16T08:44:39.500+01:00</created>
<modified>2024-04-25T17:06:48.724+02:00</modified>
<modified>2024-08-30T12:08:18.732+02:00</modified>
<save-config provider-id="eu.esdihumboldt.hale.io.project.hale25.xml.writer">
<setting name="charset">UTF-8</setting>
<setting name="projectFiles.separate">false</setting>
Expand Down Expand Up @@ -1359,14 +1359,15 @@ ATKIS als Quelle derzeit ausgeschlossen&#13;
<property name="mappableSourceType/24">{jdbc:postgresql:testbed:public}ax_meer</property>
<property name="mappableSourceType/25">{jdbc:postgresql:testbed:public}ax_bergbaubetrieb</property>
<property name="mappableSourceType/26">{jdbc:postgresql:testbed:public}ax_bahnverkehr</property>
<property name="mappableSourceType/27">{jdbc:postgresql:testbed:public}extent_bundesland</property>
<property name="mappableSourceType/3">{jdbc:postgresql:testbed:public}ax_gehoelz</property>
<property name="mappableSourceType/4">{jdbc:postgresql:testbed:public}ax_hafenbecken</property>
<property name="mappableSourceType/5">{jdbc:postgresql:testbed:public}ax_sportfreizeitunderholungsflaeche</property>
<property name="mappableSourceType/6">{jdbc:postgresql:testbed:public}ax_flaechebesondererfunktionalerpraegung</property>
<property name="mappableSourceType/7">{jdbc:postgresql:testbed:public}ax_friedhof</property>
<property name="mappableSourceType/8">{jdbc:postgresql:testbed:public}ax_platz</property>
<property name="mappableSourceType/9">{jdbc:postgresql:testbed:public}ax_heide</property>
<property name="mappableSourceType/count">26</property>
<property name="mappableSourceType/count">27</property>
<property name="resource-027e1fd9-4ed3-4780-a48d-60fb209277cc:defaultCRS:{http://www.adv-online.de/namespaces/adv/gid/7.1}AX_LandwirtschaftType/{http://www.adv-online.de/namespaces/adv/gid/7.1}position/{http://www.opengis.net/gml/3.2}Surface">code:EPSG:25832</property>
<property name="resource-027e1fd9-4ed3-4780-a48d-60fb209277cc:defaultCRS:{http://www.adv-online.de/namespaces/adv/gid/7.1}AX_LandwirtschaftType/{http://www.adv-online.de/namespaces/adv/gid/7.1}position/{http://www.opengis.net/gml/3.2}Surface/{http://www.opengis.net/gml/3.2}patches/{http://www.opengis.net/gml/3.2}PolygonPatch/{http://www.opengis.net/gml/3.2}exterior/{http://www.opengis.net/gml/3.2}Ring/{http://www.opengis.net/gml/3.2}curveMember/{http://www.opengis.net/gml/3.2}Curve/{http://www.opengis.net/gml/3.2}segments/{http://www.opengis.net/gml/3.2}LineStringSegment">code:EPSG:25832</property>
<property name="resource-027e1fd9-4ed3-4780-a48d-60fb209277cc:defaultCRS:{http://www.adv-online.de/namespaces/adv/gid/7.1}AX_SportFreizeitUndErholungsflaecheType/{http://www.adv-online.de/namespaces/adv/gid/7.1}position/{http://www.opengis.net/gml/3.2}Surface">code:EPSG:25832</property>
Expand Down
4 changes: 2 additions & 2 deletions projects/elu-auto.halex.alignment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ Aktuell ist folgende Abbildung umgesetzt:
<cell relation="eu.esdihumboldt.cst.functions.groovy.retype" id="C40961cf5-b96a-4105-a945-d0b32805f640" priority="normal">
<source>
<class>
<type name="extentBundesland"/>
<type name="extent_bundesland" ns="jdbc:postgresql:testbed:public"/>
</class>
</source>
<target>
Expand All @@ -795,7 +795,7 @@ c.wkt &lt;&lt; _source.p.WKT.value()
<annotation type="message">
<core:message xmlns:core="http://www.esdi-humboldt.eu/hale/core" category="migration">
<core:content>
<core:text xml:space="preserve">No match for entity [type] /extentBundesland found</core:text>
<core:text xml:space="preserve">The cell's source entities have been replaced, the new entities may have a different structure and/or names and may require updating the Groovy script accordingly</core:text>
</core:content>
</core:message>
</annotation>
Expand Down
Loading

0 comments on commit 8bc4bdd

Please sign in to comment.