Skip to content

Commit

Permalink
Updated column types of TOP1000NL schema
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteggink committed Mar 7, 2018
1 parent 9d307de commit 880c1b1
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 42 deletions.
2 changes: 1 addition & 1 deletion brt/top1000nl/etl/conf/etl-top1000nl-v1.2.0.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file_path = sql/drop-tables-v1.2.0.sql,sql/create-schema.sql
# Post SQL file inputs to be executed
[input_sql_post]
class = inputs.fileinput.StringFileInput
file_path = sql/update-geoms-v1.2.0.sql
file_path = sql/create-final-tables-v1.2.0.sql

# Generic filter to substitute Python-format string values like {schema} in string
[schema_name_filter]
Expand Down
24 changes: 12 additions & 12 deletions brt/top1000nl/etl/gfs/top1000-v1.2.0.gfs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<GMLFeatureClassList>
<!--Dit GFS-bestand is gegenereerd met make-gfs.xsl-->
<GMLFeatureClass>
<Name>FunctioneelGebied</Name>
<Name>FunctioneelGebied_tmp</Name>
<ElementPath>FunctioneelGebied</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -105,7 +105,7 @@
<!--Einde properties van FunctioneelGebied-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Gebouw</Name>
<Name>Gebouw_tmp</Name>
<ElementPath>Gebouw</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_punt</Name>
Expand Down Expand Up @@ -204,7 +204,7 @@
<!--Einde properties van Gebouw-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>GeografischGebied</Name>
<Name>GeografischGebied_tmp</Name>
<ElementPath>GeografischGebied</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -302,7 +302,7 @@
<!--Einde properties van GeografischGebied-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Hoogte</Name>
<Name>Hoogte_tmp</Name>
<ElementPath>Hoogte</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_lijn</Name>
Expand Down Expand Up @@ -396,7 +396,7 @@
<!--Einde properties van Hoogte-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Inrichtingselement</Name>
<Name>Inrichtingselement_tmp</Name>
<ElementPath>Inrichtingselement</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_lijn</Name>
Expand Down Expand Up @@ -490,7 +490,7 @@
<!--Einde properties van Inrichtingselement-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Plaats</Name>
<Name>Plaats_tmp</Name>
<ElementPath>Plaats</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -601,7 +601,7 @@
<!--Einde properties van Plaats-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>PlanTopografie</Name>
<Name>PlanTopografie_tmp</Name>
<ElementPath>PlanTopografie</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -695,7 +695,7 @@
<!--Einde properties van PlanTopografie-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>RegistratiefGebied</Name>
<Name>RegistratiefGebied_tmp</Name>
<ElementPath>RegistratiefGebied</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -799,7 +799,7 @@
<!--Einde properties van RegistratiefGebied-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Spoorbaandeel</Name>
<Name>Spoorbaandeel_tmp</Name>
<ElementPath>Spoorbaandeel</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_lijn</Name>
Expand Down Expand Up @@ -936,7 +936,7 @@
<!--Einde properties van Spoorbaandeel-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Terrein</Name>
<Name>Terrein_tmp</Name>
<ElementPath>Terrein</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -1025,7 +1025,7 @@
<!--Einde properties van Terrein-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Waterdeel</Name>
<Name>Waterdeel_tmp</Name>
<ElementPath>Waterdeel</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_vlak</Name>
Expand Down Expand Up @@ -1171,7 +1171,7 @@
<!--Einde properties van Waterdeel-->
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Wegdeel</Name>
<Name>Wegdeel_tmp</Name>
<ElementPath>Wegdeel</ElementPath>
<GeomPropertyDefn>
<Name>geometrie_lijn</Name>
Expand Down
24 changes: 12 additions & 12 deletions brt/top1000nl/etl/meta/top1000-v1.2.0-gfs-template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>FunctioneelGebied</Name>
<Name>FunctioneelGebied_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>FunctioneelGebied</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -110,7 +110,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Gebouw</Name>
<Name>Gebouw_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Gebouw</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -147,7 +147,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>GeografischGebied</Name>
<Name>GeografischGebied_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>GeografischGebied</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -183,7 +183,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Hoogte</Name>
<Name>Hoogte_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Hoogte</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -215,7 +215,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Inrichtingselement</Name>
<Name>Inrichtingselement_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Inrichtingselement</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -247,7 +247,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Plaats</Name>
<Name>Plaats_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Plaats</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -296,7 +296,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>PlanTopografie</Name>
<Name>PlanTopografie_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>PlanTopografie</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -328,7 +328,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>RegistratiefGebied</Name>
<Name>RegistratiefGebied_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>RegistratiefGebied</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -370,7 +370,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Spoorbaandeel</Name>
<Name>Spoorbaandeel_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Spoorbaandeel</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -445,7 +445,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Terrein</Name>
<Name>Terrein_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Terrein</ElementPath>
<GeomPropertyDefn>
Expand All @@ -472,7 +472,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Waterdeel</Name>
<Name>Waterdeel_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Waterdeel</ElementPath>
<GeomPropertyDefn>
Expand Down Expand Up @@ -556,7 +556,7 @@
</PropertyDefn>
</GMLFeatureClass>
<GMLFeatureClass>
<Name>Wegdeel</Name>
<Name>Wegdeel_tmp</Name>
<ParentClass>Top1000Object</ParentClass>
<ElementPath>Wegdeel</ElementPath>
<GeomPropertyDefn>
Expand Down
118 changes: 118 additions & 0 deletions brt/top1000nl/etl/sql/create-final-tables-v1.2.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
-- Create final tables in TOP1000NL schema

-- Functioneel gebied
create table functioneelgebied as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typefunctioneelgebied, soortnaam, naamnl, naamfries, case when geometrie_vlak is not null then st_multi(geometrie_vlak)::geometry(MULTIPOLYGON, 28992) else geometrie_multivlak end geometrie_multivlak, geometrie_punt from functioneelgebied_tmp;

alter table functioneelgebied add primary key (ogc_fid);
alter table functioneelgebied alter column gml_id set not null;
create index functioneelgebied_geometrie_multivlak_geom_idx on functioneelgebied using gist((geometrie_multivlak::geometry(MULTIPOLYGON, 28992)));
create index functioneelgebied_geometrie_punt_geom_idx on functioneelgebied using gist((geometrie_punt::geometry(POINT, 28992)));

drop table functioneelgebied_tmp;

-- Gebouw
create table gebouw as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typegebouw, status, soortnaam, naam, wkb_geometry geometrie_punt from gebouw_tmp;

alter table gebouw add primary key (ogc_fid);
alter table gebouw alter column gml_id set not null;
create index gebouw_geometrie_punt_geom_idx on gebouw using gist((geometrie_punt::geometry(POINT, 28992)));

drop table gebouw_tmp;

-- Geografisch gebied
create table geografischgebied as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typegeografischgebied, naamnl, naamfries, case when geometrie_vlak is not null then st_multi(geometrie_vlak)::geometry(MULTIPOLYGON, 28992) else geometrie_multivlak end geometrie_multivlak, geometrie_punt from geografischgebied_tmp;

alter table geografischgebied add primary key (ogc_fid);
alter table geografischgebied alter column gml_id set not null;
create index geografischgebied_geometrie_multivlak_geom_idx on geografischgebied using gist((geometrie_multivlak::geometry(MULTIPOLYGON, 28992)));
create index geografischgebied_geometrie_punt_geom_idx on geografischgebied using gist((geometrie_punt::geometry(POINT, 28992)));

drop table geografischgebied_tmp;

-- Hoogte
create table hoogte as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typehoogte, hoogte, referentievlak, geometrie_lijn, geometrie_punt from hoogte_tmp;

alter table hoogte add primary key (ogc_fid);
alter table hoogte alter column gml_id set not null;
create index hoogte_geometrie_lijn_geom_idx on hoogte using gist((geometrie_lijn::geometry(LINESTRING, 28992)));
create index hoogte_geometrie_punt_geom_idx on hoogte using gist((geometrie_punt::geometry(POINT, 28992)));

drop table hoogte_tmp;

-- Inrichtingselement
create table inrichtingselement as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typeinrichtingselement, soortnaam, naam, geometrie_lijn, geometrie_punt from inrichtingselement_tmp;

alter table inrichtingselement add primary key (ogc_fid);
alter table inrichtingselement alter column gml_id set not null;
create index inrichtingselement_geometrie_lijn_geom_idx on inrichtingselement using gist((geometrie_lijn::geometry(LINESTRING, 28992)));
create index inrichtingselement_geometrie_punt_geom_idx on inrichtingselement using gist((geometrie_punt::geometry(POINT, 28992)));

drop table inrichtingselement_tmp;

-- Plaats
create table plaats as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typegebied, aantalinwoners, naamofficieel, naamnl, naamfries, case when geometrie_vlak is not null then st_multi(geometrie_vlak)::geometry(MULTIPOLYGON, 28992) else geometrie_multivlak end geometrie_multivlak, geometrie_punt from plaats_tmp;

alter table plaats add primary key (ogc_fid);
alter table plaats alter column gml_id set not null;
create index plaats_geometrie_multivlak_geom_idx on plaats using gist((geometrie_multivlak::geometry(MULTIPOLYGON, 28992)));
create index plaats_geometrie_punt_geom_idx on plaats using gist((geometrie_punt::geometry(POINT, 28992)));

drop table plaats_tmp;

-- Plantopografie
create table plantopografie as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typeobject, naam, geometrie_vlak, geometrie_lijn, geometrie_punt from plantopografie_tmp;

alter table plantopografie add primary key (ogc_fid);
alter table plantopografie alter column gml_id set not null;
create index plantopografie_geometrie_vlak_geom_idx on plantopografie using gist((geometrie_vlak::geometry(POLYGON, 28992)));
create index plantopografie_geometrie_lijn_geom_idx on plantopografie using gist((geometrie_lijn::geometry(LINESTRING, 28992)));
create index plantopografie_geometrie_punt_geom_idx on plantopografie using gist((geometrie_punt::geometry(POINT, 28992)));

drop table plantopografie_tmp;

-- Registratief gebied
create table registratiefgebied as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typeregistratiefgebied, naamofficieel, naamnl, naamfries, nummer, case when geometrie_vlak is not null then st_multi(geometrie_vlak)::geometry(MULTIPOLYGON, 28992) else geometrie_multivlak end geometrie_multivlak from registratiefgebied_tmp;

alter table registratiefgebied add primary key (ogc_fid);
alter table registratiefgebied alter column gml_id set not null;
create index registratiefgebied_geometrie_multivlak_geom_idx on registratiefgebied using gist((geometrie_multivlak::geometry(MULTIPOLYGON, 28992)));

drop table registratiefgebied_tmp;

-- Spoorbaandeel
create table spoorbaandeel as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typeinfrastructuur, typespoorbaan, fysiekvoorkomen, spoorbreedte, aantalsporen, vervoerfunctie, elektrificatie, status, brugnaam, tunnelnaam, baanvaknaam, wkb_geometry geometrie_lijn from spoorbaandeel_tmp;

alter table spoorbaandeel add primary key (ogc_fid);
alter table spoorbaandeel alter column gml_id set not null;
create index spoorbaandeel_geometrie_lijn_geom_idx on spoorbaandeel using gist((geometrie_lijn::geometry(LINESTRING, 28992)));

drop table spoorbaandeel_tmp;

-- Terrein
create table terrein as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typelandgebruik, naam, voorkomen, wkb_geometry geometrie_vlak from terrein_tmp;

alter table terrein add primary key (ogc_fid);
alter table terrein alter column gml_id set not null;
create index terrein_geometrie_vlak_geom_idx on terrein using gist((geometrie_vlak::geometry(POLYGON, 28992)));

drop table terrein_tmp;

-- Waterdeel
create table waterdeel as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typewater, breedteklasse, fysiekvoorkomen, voorkomen, getijdeinvloed, vaarwegklasse, naamofficieel, naamnl, naamfries, isbagnaam, sluisnaam, brugnaam, geometrie_vlak, geometrie_lijn from waterdeel_tmp;

alter table waterdeel add primary key (ogc_fid);
alter table waterdeel alter column gml_id set not null;
create index waterdeel_geometrie_vlak_geom_idx on waterdeel using gist((geometrie_vlak::geometry(POLYGON, 28992)));
create index waterdeel_geometrie_lijn_geom_idx on waterdeel using gist((geometrie_lijn::geometry(LINESTRING, 28992)));

drop table waterdeel_tmp;

-- Wegdeel
create table wegdeel as select ogc_fid, gml_id, namespace, lokaalid, brontype, bronactualiteit::date, bronbeschrijving, bronnauwkeurigheid, objectbegintijd::date, objecteindtijd::date, visualisatiecode, typeinfrastructuur, typeweg, hoofdverkeersgebruik, fysiekvoorkomen, verhardingsbreedteklasse, gescheidenrijbaan, verhardingstype, aantalrijstroken, status, naam, isbagnaam, awegnummer, nwegnummer, ewegnummer, swegnummer, afritnummer, afritnaam, knooppuntnaam, brugnaam, tunnelnaam, geometrie_lijn, geometrie_punt from wegdeel_tmp;

alter table wegdeel add primary key (ogc_fid);
alter table wegdeel alter column gml_id set not null;
create index wegdeel_geometrie_lijn_geom_idx on wegdeel using gist((geometrie_lijn::geometry(LINESTRING, 28992)));
create index wegdeel_geometrie_punt_geom_idx on wegdeel using gist((geometrie_punt::geometry(POINT, 28992)));

drop table wegdeel_tmp;

0 comments on commit 880c1b1

Please sign in to comment.