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

BGDIDIC-643: aerialimages bucket migration clean-up #4466

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ API_URL=//sys-api3.dev.bgdi.ch
CACHE_CONTROL="max-age=10,public"
STATIC_MAX_AGE=100
DATAGEOADMINHOST=https://data.geo.admin.ch
AERIALIMAGES_DATA_HOST=https://aerialimages.geo.admin.ch
HIST_MAPS_DATA_HOST=https://historicalmaps.geo.admin.ch
DYNAMIC_TRANSLATION=1
GEOADMINHOST=sys-map.dev.bgdi.ch
Expand Down
1 change: 0 additions & 1 deletion .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ AWS_DEFAULT_REGION=eu-central-1
CACHE_CONTROL=no-cache
STATIC_MAX_AGE=3
DATAGEOADMINHOST=https://data.geo.admin.ch
AERIALIMAGES_DATA_HOST=https://aerialimages.geo.admin.ch
HIST_MAPS_DATA_HOST=https://historicalmaps.geo.admin.ch
DBHOST=pg-geodata-replica.bgdi.ch
DBPORT=5432
Expand Down
1 change: 0 additions & 1 deletion chsdi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def datetime_adapter(obj, request):
config.add_route('htmlPopup', '/rest/services/{map}/MapServer/{layerId}/{featureId}/htmlPopup', request_method=request_method)
config.add_route('iframeHtmlPopup', '/rest/services/{map}/MapServer/{layerId}/{featureId}/iframeHtmlPopup', request_method=request_method)
config.add_route('extendedHtmlPopup', '/rest/services/{map}/MapServer/{layerId}/{featureId}/extendedHtmlPopup', request_method=request_method)
config.add_route('luftbilder', '/luftbilder/viewer.html', request_method=request_method)
config.add_route('historicalmaps', '/historicalmaps/viewer.html', request_method=request_method)
config.add_route('checker', '/checker', request_method=request_method)
config.add_route('checker_dev', '/checker_dev', request_method=request_method)
Expand Down
1 change: 0 additions & 1 deletion chsdi/config/base.ini.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ apache_base_path = ${APACHE_BASE_PATH}
loader_js_bucket_localhost = ${LOADER_JS_BUCKET_LOCALHOST}
vector_bucket = ${VECTOR_BUCKET}
datageoadminhost = ${DATAGEOADMINHOST}
aerialimages_data_host = ${AERIALIMAGES_DATA_HOST}
hist_maps_data_host = ${HIST_MAPS_DATA_HOST}
opentrans_api_key = ${OPENTRANS_API_KEY}
empty_geotables = ch.bav.sachplan-infrastruktur-schifffahrt_anhoerung,ch.bfe.sachplan-uebertragungsleitungen_anhoerung,ch.blw.emapis-bewaesserung,ch.blw.emapis-elektrizitaetsversorgung,ch.blw.emapis-milchleitung,ch.blw.emapis-seilbahnen,ch.vbs.sachplan-infrastruktur-militaer_anhoerung,ch.sem.sachplan-asyl_anhoerung,ch.astra.sachplan-infrastruktur-strasse_anhoerung,ch.bav.sachplan-infrastruktur-schiene_anhorung
Expand Down
52 changes: 17 additions & 35 deletions chsdi/models/vector/lubis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,75 +10,70 @@

class LuftbilderBase:
__table_args__ = ({'schema': 'public', 'autoload': False})
__template__ = 'templates/htmlpopup/lubis.mako'
__returnedGeometry__ = 'the_geom_footprint'
__timeInstant__ = 'bgdi_flugjahr'
__label__ = 'flugdatum'
id = Column('ebkey', Unicode, primary_key=True)
filename = Column('filename', Unicode)
inventarnummer = Column('inventarnummer', Integer)
bildnummer = Column('bildnummer', Unicode)
flugdatum = Column('flugdatum', Unicode)
firma = Column('firma', Unicode)
filmart = Column('filmart', Unicode)
bgdi_flugjahr = Column('bgdi_flugjahr', Integer)
orientierung = Column('orientierung', Boolean)
rotation = Column('rotation', Integer)
orthophoto = Column('orthophoto', Unicode)
originalsize = Column('originalsize', Unicode)
x = Column('x', Integer)
y = Column('y', Integer)
flughoehe = Column('flughoehe', Integer)
ort = Column('ort', Unicode)
massstab = Column('massstab', Integer)
filesize_mb = Column('filesize_mb', Unicode)
bgdi_imagemode = Column('bgdi_imagemode', Unicode)
the_geom_footprint = Column('the_geom_footprint', Geometry2D)
the_geom = Column(Geometry2D)


class LuftbilderBaseStac(LuftbilderBase):
class LuftbilderBaseDritte(LuftbilderBase):
__template__ = 'templates/htmlpopup/lubis.mako'
inventarnummer = Column('inventarnummer', Integer)
bildnummer = Column('bildnummer', Unicode)
orientierung = Column('orientierung', Boolean)
rotation = Column('rotation', Integer)
ort = Column('ort', Unicode)
massstab = Column('massstab', Integer)
filesize_mb = Column('filesize_mb', Unicode)


class LuftbilderBaseSwisstopo(LuftbilderBase):
__template__ = 'templates/htmlpopup/lubis_stac.mako'
ebkey_old = Column('ebkey_old', Unicode)
feature_id = Column('feature_id', Unicode)
acquired = Column('acquired', Date)
film_type = Column('film_type', Unicode)
orthofilename = Column('orthofilename', Unicode)
filename = Column('filename', Unicode)
e = Column('e', Numeric)
n = Column('n', Numeric)
z = Column('z', Numeric)


class LuftbilderSwisstopoFarbe(Base, LuftbilderBaseStac, Vector):
class LuftbilderSwisstopoFarbe(Base, LuftbilderBaseSwisstopo, Vector):
__tablename__ = 'luftbilder_swisstopo_color'
__bodId__ = 'ch.swisstopo.lubis-luftbilder_farbe'
image_height = Column('image_height', Integer)
image_width = Column('image_width', Integer)

register('ch.swisstopo.lubis-luftbilder_farbe', LuftbilderSwisstopoFarbe)


class LuftbilderSwisstopoIr(Base, LuftbilderBaseStac, Vector):
__extended_info__ = True
class LuftbilderSwisstopoIr(Base, LuftbilderBaseSwisstopo, Vector):
__tablename__ = 'luftbilder_swisstopo_ir'
__bodId__ = 'ch.swisstopo.lubis-luftbilder_infrarot'
image_height = Column('image_height', Integer)
image_width = Column('image_width', Integer)

register('ch.swisstopo.lubis-luftbilder_infrarot', LuftbilderSwisstopoIr)


class LuftbilderSwisstopoSw(Base, LuftbilderBaseStac, Vector):
class LuftbilderSwisstopoSw(Base, LuftbilderBaseSwisstopo, Vector):
__tablename__ = 'luftbilder_swisstopo_bw'
__bodId__ = 'ch.swisstopo.lubis-luftbilder_schwarzweiss'
image_height = Column('image_height', Integer)
image_width = Column('image_width', Integer)

register('ch.swisstopo.lubis-luftbilder_schwarzweiss', LuftbilderSwisstopoSw)


class LuftbilderDritteFirmen(Base, LuftbilderBase, Vector):
class LuftbilderDritteFirmen(Base, LuftbilderBaseDritte, Vector):
__tablename__ = 'luftbilder_dritte_firmen'
__bodId__ = 'ch.swisstopo.lubis-luftbilder-dritte-firmen'
contact = Column('contact', Unicode)
Expand All @@ -89,7 +84,7 @@ class LuftbilderDritteFirmen(Base, LuftbilderBase, Vector):
register('ch.swisstopo.lubis-luftbilder-dritte-firmen', LuftbilderDritteFirmen)


class LuftbilderDritteKantone(Base, LuftbilderBase, Vector):
class LuftbilderDritteKantone(Base, LuftbilderBaseDritte, Vector):
__tablename__ = 'luftbilder_dritte_kantone'
__bodId__ = 'ch.swisstopo.lubis-luftbilder-dritte-kantone'
contact = Column('contact', Unicode)
Expand Down Expand Up @@ -139,23 +134,16 @@ class LuftbilderSchraegaufnahmen(Base, Vector):
__template__ = 'templates/htmlpopup/lubis_schraegaufnahmen.mako'
__bodId__ = 'ch.swisstopo.lubis-luftbilder_schraegaufnahmen'
__timeInstant__ = 'bgdi_flugjahr'
__extended_info__ = True
# Composite labels
__label__ = 'flightdate'
id = Column('ebkey', Unicode, primary_key=True)
ebkey_old = Column('ebkey_old', Unicode)
inventory_number = Column('inventory_number', Unicode)
flightdate = Column('flightdate', Unicode)
medium_format = Column('medium_format', Unicode)
filesize_mb = Column('filesize_mb', Unicode)
filename = Column('filename', Unicode)
filmart = Column('filmart', Unicode)
stereo_couple = Column('stereo_couple', Unicode)
bgdi_flugjahr = Column('bgdi_flugjahr', Integer)
x = Column('x', Integer)
y = Column('y', Integer)
contact = Column('contact', Unicode)
contact_email = Column('contact_email', Unicode)
the_geom = Column(Geometry2D)

register('ch.swisstopo.lubis-luftbilder_schraegaufnahmen', LuftbilderSchraegaufnahmen)
Expand All @@ -168,12 +156,10 @@ class LuftbilderTerrA(Base, Vector):
__bodId__ = 'ch.swisstopo.lubis-terrestrische_aufnahmen'
__timeInstant__ = 'bgdi_flugjahr'
__returnedGeometry__ = 'the_geom_footprint'
__extended_info__ = True
__label__ = 'flugdatum'
id = Column('inventory_number', Unicode, primary_key=True)
inventarnummer_old = Column('inventarnummer_old', Unicode)
inventarnummer = Column('objectid', Integer)
image_number = Column('image_number', Integer)
flugdatum = Column('bgdi_flugdatum', Unicode)
bgdi_flugjahr = Column('year', Integer)
filmart = Column('filmart', Unicode)
Expand All @@ -182,12 +168,8 @@ class LuftbilderTerrA(Base, Vector):
base_uuid = Column('base_uuid', Unicode)
x = Column('easting', Numeric)
y = Column('northing', Numeric)
medium_format = Column('format', Unicode)
filesize_mb = Column('filesize_mb', Unicode)
filename = Column('filename', Unicode)
bgdi_imagemode = Column('bgdi_imagemode', Unicode)
image_height = Column('image_height', Integer)
image_width = Column('image_width', Integer)
smapshot_id = Column('smapshot_id', Integer)
the_geom_footprint = Column('the_geom_footprint', Geometry2D)
the_geom = Column(Geometry2D)
Expand Down
Loading