-
Notifications
You must be signed in to change notification settings - Fork 1
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
Uusi aineistoluku #129
Closed
Closed
Uusi aineistoluku #129
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
*.bat text eol=crlf working-tree-encoding=cp850 | ||
# Enforce LF line endings for all text files | ||
* text=auto eol=lf | ||
|
||
# Handle line endings for specific file types | ||
*.bat text eol=crlf | ||
*.sh text eol=lf | ||
*.sql text eol=lf | ||
*.md text eol=lf | ||
*.json text eol=lf | ||
*.py text eol=lf | ||
*.yml text eol=lf | ||
*.yaml text eol=lf | ||
*.ini text eol=lf | ||
*.conf text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
POSTGRES_PASSWORD=postgres | ||
|
||
JKR_DB_HOST=10.43.16.4 | ||
JKR_DB_PORT=5432 | ||
|
||
JKR_DB=jatehuolto | ||
JKR_USER=puno_admin | ||
JKR_PASSWORD=n79FRas7pl01 | ||
PGPASSWORD=n79FRas7pl01 | ||
|
||
QGIS_BIN_PATH=C:\Program Files\QGIS 3.28.2\bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Käytä virallista Python 3.11 -slim-kuvaa pohjana | ||
FROM python:3.11-slim | ||
|
||
# Aseta ympäristömuuttujat | ||
ENV PYTHONUNBUFFERED=1 \ | ||
POETRY_VERSION=1.5.1 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
APPDATA=/usr/local/bin/dotenv | ||
|
||
# Asenna järjestelmäriippuvuudet ja QGIS | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
libpq-dev \ | ||
postgresql-client \ | ||
gdal-bin \ | ||
python3-gdal \ | ||
qgis \ | ||
libgdal-dev \ | ||
libspatialindex-dev \ | ||
curl \ | ||
git \ | ||
locales && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Aseta locale | ||
RUN sed -i '/fi_FI.UTF-8/s/^# //g' /etc/locale.gen && \ | ||
locale-gen | ||
ENV LANG fi_FI.UTF-8 | ||
ENV LANGUAGE fi_FI:fi | ||
ENV LC_ALL fi_FI.UTF-8 | ||
|
||
# Set GDAL configuration paths | ||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal | ||
ENV C_INCLUDE_PATH=/usr/include/gdal | ||
|
||
# Asenna Poetry | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
# Lisää Poetry PATH:iin | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
# Päivitä pip | ||
RUN pip install --upgrade pip | ||
|
||
# Avaa portit tarvittaessa (esim. 8000 jos sovellukselle) | ||
EXPOSE 8000 | ||
|
||
# Määritä työhakemisto | ||
WORKDIR /app | ||
|
||
# Aseta oletuskomento: asenna riippuvuudet, siirry scripts-kansioon ja käynnistä bash | ||
CMD ["bash", "-c", "poetry install --no-root && cd scripts && exec /bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- V2.43.0__Add_rakennusluokka_2018.sql | ||
ALTER TABLE jkr.rakennus | ||
ADD COLUMN rakennusluokka_2018 VARCHAR(4); | ||
|
||
COMMENT ON COLUMN jkr.rakennus.rakennusluokka_2018 | ||
IS 'Rakennusluokka 2018 -luokituksen mukainen rakennuksen käyttötarkoitus'; | ||
|
||
CREATE INDEX idx_rakennus_rakennusluokka_2018 | ||
ON jkr.rakennus(rakennusluokka_2018); |
46 changes: 46 additions & 0 deletions
46
db/migrations/V2.44_0__Add_indexes_to_speed_up_geospatial_search.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
-- V2.44.0__Add_spatial_indexes.sql | ||
-- Luodaan spatiaaliset indeksit rakennusten geometrioille | ||
CREATE INDEX IF NOT EXISTS idx_rakennus_geom | ||
ON jkr.rakennus USING GIST (geom); | ||
|
||
-- Luodaan indeksit yleisimmin käytetyille hakukentille | ||
CREATE INDEX IF NOT EXISTS idx_rakennus_omistaja | ||
ON jkr.rakennuksen_omistajat (osapuoli_id); | ||
|
||
CREATE INDEX IF NOT EXISTS idx_rakennus_osoite | ||
ON jkr.osoite (rakennus_id, katu_id, osoitenumero); | ||
|
||
-- Käytetään oikeaa sarakenimeä rakennuksenkayttotarkoitus_koodi | ||
CREATE INDEX IF NOT EXISTS idx_rakennuksenkayttotarkoitus | ||
ON jkr.rakennus (rakennuksenkayttotarkoitus_koodi); | ||
|
||
-- Luodaan materialisoitu näkymä lähellä olevien rakennusten löytämiseen | ||
CREATE MATERIALIZED VIEW IF NOT EXISTS jkr.nearby_buildings AS | ||
SELECT | ||
r1.id as rakennus1_id, | ||
r2.id as rakennus2_id, | ||
ST_Distance(r1.geom, r2.geom) as distance | ||
FROM jkr.rakennus r1 | ||
JOIN jkr.rakennus r2 ON | ||
r1.id < r2.id AND | ||
ST_DWithin(r1.geom, r2.geom, 300) | ||
WHERE | ||
r1.geom IS NOT NULL AND | ||
r2.geom IS NOT NULL; | ||
|
||
CREATE INDEX IF NOT EXISTS idx_nearby_buildings_r1 | ||
ON jkr.nearby_buildings (rakennus1_id); | ||
|
||
CREATE INDEX IF NOT EXISTS idx_nearby_buildings_r2 | ||
ON jkr.nearby_buildings (rakennus2_id); | ||
|
||
CREATE INDEX IF NOT EXISTS idx_nearby_buildings_dist | ||
ON jkr.nearby_buildings (distance); | ||
|
||
-- Funktio materialisoidun näkymän päivittämiseen | ||
CREATE OR REPLACE FUNCTION jkr.refresh_nearby_buildings() | ||
RETURNS void AS $$ | ||
BEGIN | ||
REFRESH MATERIALIZED VIEW jkr.nearby_buildings; | ||
END; | ||
$$ LANGUAGE plpgsql; |
4 changes: 4 additions & 0 deletions
4
db/migrations/V2.45_0__Add_indexes_to_speed_up_kohde_update.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- V2.45.0__Add_spatial_indexes.sql | ||
-- Luodaan indeksit nopeampaa päivitystä varten | ||
CREATE INDEX idx_kohteen_rakennukset_rakennus_id ON jkr.kohteen_rakennukset(rakennus_id); | ||
CREATE INDEX idx_kohteen_osapuolet_osapuoli_rooli ON jkr.kohteen_osapuolet(osapuoli_id, osapuolenrooli_id); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Onhan nää placeholder arvoja? Tai ainakin salikset?