Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading building geometries into db #20

Closed
traveller195 opened this issue Feb 18, 2023 · 11 comments
Closed

loading building geometries into db #20

traveller195 opened this issue Feb 18, 2023 · 11 comments

Comments

@traveller195
Copy link
Contributor

loading building geometries into db
from LoD2 dataset GeoSN / Saxony, Germany

@traveller195
Copy link
Contributor Author

@traveller195
Copy link
Contributor Author

traveller195 commented Feb 18, 2023

first using own python script: cc_sachsen_origin_data2db_schema.py
to transfer LoD2 building footprint data into the colouring-core db tables geometries, buildings and buildings_properties

second using own python script: import_colouring_cities_with_ssh_03.py
to import those three db tables into db
first only into temp db tables! must be transferred by SQL commands manually

@traveller195
Copy link
Contributor Author

run INDEX for db tables again after loading the building data (would make sense to do so...)?

@traveller195
Copy link
Contributor Author

important: care about other administrative geometries in the 'geometries' db table!

see colouring-cities/colouring-core#1102

@traveller195
Copy link
Contributor Author

see #23

fist, delete the London boroughs from geometries table.
Then, insert building geometries

Afterwards, the Dresden borough geometries could be inserted

@traveller195
Copy link
Contributor Author

change column length, to be able to insert the building data

ALTER TABLE public.geometries
ALTER COLUMN source_id TYPE VARCHAR(100);

@traveller195
Copy link
Contributor Author

now transfer the data from temp db tables into the target tables


INSERT INTO public.geometries
SELECT * FROM public.temp_geometries;

INSERT INTO public.buildings (building_id, geometry_id)
SELECT building_id, geometry_id FROM public.temp_buildings;


INSERT INTO public.building_properties (building_property_id, building_id)
SELECT building_property_id, building_id FROM public.temp_building_properties;

@traveller195
Copy link
Contributor Author

now, create INDEX for buildings agin, now with the data

first, drop current index by

psql -f 002.index-geometries.down.sql

then, CREATE INDEX again, now with the real data
psql -f 002.index-geometries.up.sql

also for buildings

psql -f 003.index-buildings.down.sql

psql -f 003.index-buildings.up.sql

@traveller195
Copy link
Contributor Author

because , I suppose, there are some problems with performance and 2.6 million builings of whole saxony in the database (e.g. for tile renderer), I will do the last steps all again with a subset of buildings only for Dresden

grafik

@traveller195
Copy link
Contributor Author

To Do:
Update building data with

  • data which is newer
  • data extent city Dresden + adjacent counties?

@traveller195
Copy link
Contributor Author

the plan is, to keep Dresden city data (no additional extent / buffer)... but it should be updated with newer data!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant