| 1 |
# EXAMPLE ETL CONFIGURATION (Local Dutch Address Data (BAG) to INSPIRE Addresses) |
| 2 |
# See also the INSPIRE FOSS project: |
| 3 |
# http://code.google.com/p/inspire-foss/source/browse/#svn%2Ftrunk%2Fetl%2FNL.Kadaster%2FAddresses |
| 4 |
|
| 5 |
# DEFINE THE ETL AS A ONE OR MORE CHAINS (PIPELINE) OF COMPONENTS |
| 6 |
[etl] |
| 7 |
chains = input_pg_woonplaats|gml_splitter|transformer_xslt|output_deegree_blobstore, |
| 8 |
input_pg_postcode|gml_splitter|transformer_xslt|output_deegree_blobstore, |
| 9 |
input_pg_openbareruimte|gml_splitter|transformer_xslt|output_deegree_blobstore, |
| 10 |
input_pg_ligplaats|gml_splitter|transformer_xslt|output_deegree_blobstore, |
| 11 |
input_pg_standplaats|gml_splitter|transformer_xslt|output_deegree_blobstore, |
| 12 |
input_pg_verblijfsobject|gml_splitter|transformer_xslt|output_deegree_blobstore |
| 13 |
|
| 14 |
[input_pg_woonplaats] |
| 15 |
class = stetl.inputs.ogrinput.OgrPostgisInput |
| 16 |
in_srs = EPSG:28992 |
| 17 |
in_pg_db = bag |
| 18 |
in_pg_schema = bagaveen |
| 19 |
in_pg_host = localhost |
| 20 |
in_pg_user = postgres |
| 21 |
in_pg_password = postgres |
| 22 |
in_pg_port = 5432 |
| 23 |
in_pg_sql = SELECT |
| 24 |
wp.identificatie, |
| 25 |
wp.woonplaatsnaam, |
| 26 |
translate(to_char(wp.begindatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'),' ', 'T') as begindatumtijdvakgeldigheid, |
| 27 |
translate(to_char(wp.einddatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'), ' ', 'T') as einddatumtijdvakgeldigheid |
| 28 |
FROM woonplaatsactueelbestaand as wp |
| 29 |
out_srs = EPSG:4258 |
| 30 |
out_layer_name = woonplaats |
| 31 |
out_geotype = |
| 32 |
out_gml_format = GML3 |
| 33 |
out_dimension = 2 |
| 34 |
|
| 35 |
[input_pg_postcode] |
| 36 |
class = stetl.inputs.ogrinput.OgrPostgisInput |
| 37 |
in_srs = EPSG:28992 |
| 38 |
in_pg_db = bag |
| 39 |
in_pg_schema = bagaveen |
| 40 |
in_pg_host = localhost |
| 41 |
in_pg_user = postgres |
| 42 |
in_pg_password = postgres |
| 43 |
in_pg_port = 5432 |
| 44 |
in_pg_sql = SELECT DISTINCT |
| 45 |
na.postcode |
| 46 |
FROM nummeraanduidingactueelbestaand as na |
| 47 |
out_srs = EPSG:4258 |
| 48 |
out_layer_name = postcode |
| 49 |
out_geotype = |
| 50 |
out_gml_format = GML3 |
| 51 |
out_dimension = 2 |
| 52 |
|
| 53 |
[input_pg_openbareruimte] |
| 54 |
class = stetl.inputs.ogrinput.OgrPostgisInput |
| 55 |
in_srs = EPSG:28992 |
| 56 |
in_pg_db = bag |
| 57 |
in_pg_schema = bagaveen |
| 58 |
in_pg_host = localhost |
| 59 |
in_pg_user = postgres |
| 60 |
in_pg_password = postgres |
| 61 |
in_pg_port = 5432 |
| 62 |
in_pg_sql = SELECT |
| 63 |
orn.identificatie, |
| 64 |
orn.openbareruimtenaam, |
| 65 |
translate(to_char(orn.begindatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'),' ', 'T') as begindatumtijdvakgeldigheid, |
| 66 |
translate(to_char(orn.einddatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'), ' ', 'T') as einddatumtijdvakgeldigheid |
| 67 |
FROM openbareruimteactueelbestaand as orn |
| 68 |
out_srs = EPSG:4258 |
| 69 |
out_layer_name = openbareruimte |
| 70 |
out_geotype = |
| 71 |
out_gml_format = GML3 |
| 72 |
out_dimension = 2 |
| 73 |
|
| 74 |
[input_pg_verblijfsobject] |
| 75 |
class = stetl.inputs.ogrinput.OgrPostgisInput |
| 76 |
in_srs = EPSG:28992 |
| 77 |
in_pg_db = bag |
| 78 |
in_pg_schema = public |
| 79 |
in_pg_host = localhost |
| 80 |
in_pg_user = postgres |
| 81 |
in_pg_password = postgres |
| 82 |
in_pg_port = 5432 |
| 83 |
in_pg_sql = SELECT |
| 84 |
na.identificatie, |
| 85 |
na.huisnummer, |
| 86 |
na.huisletter, |
| 87 |
na.huisnummertoevoeging, |
| 88 |
na.gerelateerdeopenbareruimte, |
| 89 |
na.postcode, |
| 90 |
(CASE |
| 91 |
WHEN wp2.woonplaatsnaam IS NULL THEN |
| 92 |
w.identificatie ELSE |
| 93 |
wp2.identificatie END) |
| 94 |
as woonplaats, |
| 95 |
translate(to_char(na.begindatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'),' ', 'T') as begindatumtijdvakgeldigheid, |
| 96 |
translate(to_char(na.einddatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'), ' ', 'T') as einddatumtijdvakgeldigheid, |
| 97 |
ST_Force_2D(ao.geopunt) |
| 98 |
FROM verblijfsobjectactueelbestaand ao |
| 99 |
JOIN nummeraanduidingactueelbestaand na ON (na.identificatie = ao.hoofdadres) |
| 100 |
JOIN openbareruimteactueelbestaand o ON (na.gerelateerdeopenbareruimte = o.identificatie) |
| 101 |
JOIN woonplaatsactueelbestaand w ON (o.gerelateerdewoonplaats = w.identificatie) |
| 102 |
LEFT OUTER JOIN woonplaatsactueelbestaand wp2 ON (na.gerelateerdewoonplaats = wp2.identificatie) |
| 103 |
out_srs = EPSG:4258 |
| 104 |
out_layer_name = adres |
| 105 |
out_geotype = POINT |
| 106 |
out_gml_format = GML3 |
| 107 |
out_dimension = 2 |
| 108 |
|
| 109 |
[input_pg_ligplaats] |
| 110 |
class = stetl.inputs.ogrinput.OgrPostgisInput |
| 111 |
in_srs = EPSG:28992 |
| 112 |
in_pg_db = bag |
| 113 |
in_pg_schema = bagaveen |
| 114 |
in_pg_host = localhost |
| 115 |
in_pg_user = postgres |
| 116 |
in_pg_password = postgres |
| 117 |
in_pg_port = 5432 |
| 118 |
in_pg_sql = SELECT |
| 119 |
na.identificatie, |
| 120 |
na.huisnummer, |
| 121 |
na.huisletter, |
| 122 |
na.huisnummertoevoeging, |
| 123 |
na.gerelateerdeopenbareruimte, |
| 124 |
na.postcode, |
| 125 |
(CASE |
| 126 |
WHEN wp2.woonplaatsnaam IS NULL THEN |
| 127 |
w.identificatie ELSE |
| 128 |
wp2.identificatie END) |
| 129 |
as woonplaats, |
| 130 |
translate(to_char(na.begindatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'),' ', 'T') as begindatumtijdvakgeldigheid, |
| 131 |
translate(to_char(na.einddatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'), ' ', 'T') as einddatumtijdvakgeldigheid, |
| 132 |
ST_Centroid(ST_Force_2D(ao.geovlak)) |
| 133 |
FROM ligplaatsactueelbestaand ao |
| 134 |
JOIN nummeraanduidingactueelbestaand na ON (na.identificatie = ao.hoofdadres) |
| 135 |
JOIN openbareruimteactueelbestaand o ON (na.gerelateerdeopenbareruimte = o.identificatie) |
| 136 |
JOIN woonplaatsactueelbestaand w ON (o.gerelateerdewoonplaats = w.identificatie) |
| 137 |
LEFT OUTER JOIN woonplaatsactueelbestaand wp2 ON (na.gerelateerdewoonplaats = wp2.identificatie) |
| 138 |
out_srs = EPSG:4258 |
| 139 |
out_layer_name = adres |
| 140 |
out_geotype = POINT |
| 141 |
out_gml_format = GML3 |
| 142 |
out_dimension = 2 |
| 143 |
|
| 144 |
[input_pg_standplaats] |
| 145 |
class = stetl.inputs.ogrinput.OgrPostgisInput |
| 146 |
in_srs = EPSG:28992 |
| 147 |
in_pg_db = bag |
| 148 |
in_pg_schema = bagaveen |
| 149 |
in_pg_host = localhost |
| 150 |
in_pg_user = postgres |
| 151 |
in_pg_password = postgres |
| 152 |
in_pg_port = 5432 |
| 153 |
in_pg_sql = SELECT |
| 154 |
na.identificatie, |
| 155 |
na.huisnummer, |
| 156 |
na.huisletter, |
| 157 |
na.huisnummertoevoeging, |
| 158 |
na.gerelateerdeopenbareruimte, |
| 159 |
na.postcode, |
| 160 |
(CASE |
| 161 |
WHEN wp2.woonplaatsnaam IS NULL THEN |
| 162 |
w.identificatie ELSE |
| 163 |
wp2.identificatie END) |
| 164 |
as woonplaats, |
| 165 |
translate(to_char(na.begindatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'),' ', 'T') as begindatumtijdvakgeldigheid, |
| 166 |
translate(to_char(na.einddatumtijdvakgeldigheid, 'YYYY-MM-DD HH24:MI:SS'), ' ', 'T') as einddatumtijdvakgeldigheid, |
| 167 |
ST_Centroid(ST_Force_2D(ao.geovlak)) |
| 168 |
FROM standplaatsactueelbestaand ao |
| 169 |
JOIN nummeraanduidingactueelbestaand na ON (na.identificatie = ao.hoofdadres) |
| 170 |
JOIN openbareruimteactueelbestaand o ON (na.gerelateerdeopenbareruimte = o.identificatie) |
| 171 |
JOIN woonplaatsactueelbestaand w ON (o.gerelateerdewoonplaats = w.identificatie) |
| 172 |
LEFT OUTER JOIN woonplaatsactueelbestaand wp2 ON (na.gerelateerdewoonplaats = wp2.identificatie) |
| 173 |
out_srs = EPSG:4258 |
| 174 |
out_layer_name = adres |
| 175 |
out_geotype = POINT |
| 176 |
out_gml_format = GML3 |
| 177 |
out_dimension = 2 |
| 178 |
|
| 179 |
[output_std] |
| 180 |
class = stetl.output.Output |
| 181 |
|
| 182 |
[output_file] |
| 183 |
class = stetl.outputs.fileoutput.FileOutput |
| 184 |
file_path = test/output.gml |
| 185 |
|
| 186 |
[output_deegree_blobstore] |
| 187 |
class = stetl.outputs.deegreeoutput.DeegreeBlobstoreOutput |
| 188 |
overwrite = False |
| 189 |
feature_member_tag = member |
| 190 |
srid = -1 |
| 191 |
database = pdok |
| 192 |
schema = inspire_ad |
| 193 |
host = localhost |
| 194 |
user = pdok_owner |
| 195 |
password = pdok_owner |
| 196 |
port = 5432 |
| 197 |
|
| 198 |
[gml_splitter] |
| 199 |
class = stetl.filters.gmlsplitter.GmlSplitter |
| 200 |
max_features = 15000 |
| 201 |
start_container = <?xml version="1.0" encoding="UTF-8"?> |
| 202 |
<ogr:FeatureCollection |
| 203 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 204 |
xsi:schemaLocation="http://ogr.maptools.org/ my.xsd" |
| 205 |
xmlns:ogr="http://ogr.maptools.org/" |
| 206 |
xmlns:gml="http://www.opengis.net/gml"> |
| 207 |
end_container = </ogr:FeatureCollection> |
| 208 |
container_tag = ogr:FeatureCollection |
| 209 |
start_feature_markers = <ogr:featureMember |
| 210 |
end_feature_markers = </ogr:featureMember> |
| 211 |
|
| 212 |
[transformer_xslt] |
| 213 |
class = stetl.filters.xsltfilter.XsltFilter |
| 214 |
script = local-to-inspire-ad-sd.xsl |
| 215 |
|
| 216 |
|
| 217 |
|