Package: pyramid-oereb
Project descriptionpyramid_oerebis an open-source implementation of the server side part for the swiss“Cadastre of
Public-law Restrictions on landownership” (PLR-cadastre).It is written in Python and designed as a plugin for thePyramid Web Framework. This allowspyramid_oerebto be
included in any Pyramid web application.Please refer to thedocumentationfor detailed
information and instructions for installation and configuration.If you are interested in contributing or extending the project, take a look at thecontribution page.Starting the development serverBuild run the initial build depending on your OS:docker network createprint-networkLinux:docker compose run--rm-u$(id-u):$(id-g)oereb-makebuildMAC/Windows:docker compose run--rmoereb-makebuilddocker compose upRunningdocker compose upwill start the DB (it will automatically import the test/dev data on startup) and start
a running instance of the pyramid_oereb DEV server connected to the DB. The project folder is mounted
to it. So changes take effect.The sample static extract should then be available athttp://localhost:6543/oereb/extract/json?EGRID=CH113928077734Running the testsTo run the tests locally:The docker way:docker network createprint-networkLinux:docker compose run--rm-u$(id-u):$(id-g)oereb-servermake build testsMAC/Windows:docker compose run--rmoereb-servermake build testsFor systems having a local make tool, the following recipe can be used:makedocker-testssometimes the local postgres port is already in use, and you must override it:EXPOSED_PGPORT=5433 makedocker-testsLocal tests:For local tests without the complete docker composition you need a running DB.
You can create one based on the oereb image:docker compose up-doereb-dbor create an empty postgis DBdocker run-p5555:5432--namepg_oereb--rm-it-ePOSTGRES_PASSWORD=pw postgis/postgisThen you can run the tests easily:make testsIf the DB does not use standard credentials, you can set them as ENV vars:PGPORT=5555 PGPASSWORD=pw make testsTo run one specfic test:dockercomposeexecoereb-serverPYTEST_OPTS="-k <name_of_the_test>"maketestsTroubleshootingSome local files may remain from previous builds, and the regular user may not be able to delete them.
In this case cleanup can be done like:dockercomposerun--rmoereb-makeclean-allUsefulmaketargetsRun themaketargets found in the Makefile either in theoereb-servercontainer (if usingdocker compose) or in your local shell (if running the server locally).
Some useful targets:makeserve-devto run the applicationmake teststo run the application testsmakedocker-teststo run the application tests inside a docker composition, so one does not have to care about local set upmake cleanto empty the databasemakeclean-allto empty the database, uninstall the application and the virtual env and clear the rendered configuration filesmakedocker-clean-allto clean up everything written by the docker container. This is sometimes useful when docker has created some files with root only permissionIf necessary the application is re-installed and the database is filled when runningmakeserve-devagain.There are further make targets to check the validity of federal data:make check_fed_datadownloads currently known federal data definitions and compares them with the active onesmake update_fed_data_urlstry to retrieve the new urls from the server’s index page. The file fed.urls must then be committed to the repomake update_fed_data_urlsgenerate new json files in the repo. The modified files must then be committedmake auto_update_fed_dataautomagic command which finds the new URLs, generates json data, copies json to project. The files fed.urls and dev/sample_data/ch.*.json must be committed if changedUsing MapFish-PrintTo be able to test the OEREB static extract (pdf), you need to runpyramid_oerebwithdocker composeand to have a running instance ofpyramid_oereb_mfp.
The Docker networkprint-networkis also required and can be created with:dockernetworkcreateprint-networkIt is also possible to launch a Mapfish Print service on a local URL (via Docker or not) and then run the server viamake serve. The correct print url must be provided:PRINT_URL="http://localhost:8680/print/oereb"EXPOSED_PGPORT=5433PGPORT=5433makeserve-devThe sample static extract should then be available athttp://localhost:6543/oereb/extract/pdf?EGRID=CH113928077734CI StatusCI status on master branch:Daily check status:Code Quality Status:Changelog2.5.0Use ST_DWithin instead of ST_Distance for performance reasons (#1930)Library upgrades (SQLAlchemy, geoalchemy2, urllib3, pypdf)2.4.8Support new Oereblex API version (via geolink-formatter 2.0.5)Enhance test coverage (#1904)Library upgrades (SQLAlchemy, lxml, jsonschema, c2cwsgiutils, pillow, pytest)Fix database setup scripts (#1913, #1914)Fix deprecation (#1915)2.4.7Add extract_index to disclaimer and general infomation (#1753)Interlis bug fix (#1881)Library upgrades (geoalchemy2, SQLAlchemy, jsonschema, lxml, responses, urllib3, pypdf)Test coverage improvementsPython 3.8 is no longer explicitly supportedRemove print proxy xml2pdf, no longer used by the community (#1889)2.4.6Fix error with large of contents and new pdf library (#1813)Fix timestamp for archived PDF (#1815)Library upgrades (SQLAlchemy, geoalchemy2, shapely, psycopg2, pyreproj, pyramid, responses, urllib, pillow, pypdf, jsonschema)2.4.5Fix base layer usage in grouped PLRs (#1302)Various minor library upgrades (SQLAlchemy, geoalchemy2, pypdf, lxml, urllib3)2.4.4Add option for a hook method for LogoRef URLs (#929, #1744)Various minor library upgrades (urllib, requests, SQLAlchemy, geoalchemy2)2.4.3Add support for newest oereblex API (via geolink-formatter, #1703)Various minor library upgrades (SQLAlchemy, geoalchemy, psycopg2, pypdf)2.4.2Add print configuration parameter for municipality name (#1703)Various minor library upgrades (pyramid, shapely, grcode, pypdf)2.4.1Improve getegrid performance (#1680)Remove unwanted URL encoding for symbol_ref (#1678)Upgrade geolink_formatter library (#1682)Various minor library upgrades (#1688, #1689)2.4.0Upgrade to pyramid 2, shapely 2 (#1625, #1642, #1647, #1662)Various minor library upgradesPreparations for SQLAlchemy 2 upgrade (#1665)Python 3.8 is now the minimal recommended version of python2.3.0Add support for prepublinks (#1618)Allow to force real estate geometry output (#1619)Library updates (#1615, #1622)2.2.6Allow usage of xml2pdf service with embedded images (#1612, #1614)2.2.5Fix response code for parameter “url” (#1605)Fix order of change order of ExtractIdentifier & MunicipalityCode (#1606)Sort plr within themes (#1607)Minor library updates (#1609)2.2.4Support tolerance per geometry type (#1603)Library updates (#1604)2.2.3Fix xml2pdf proxy (#1596)Library updates (#1597, #1598)2.2.2Default index for oereblex documents (#1591)Sort theme lists (#1592)Library updates (#1593, #1595)2.2.1Add library needed for QR-Code (#1589)Various library updates (#1590)2.2.0Performance improvements (#1580)Add QR-Code functionality (#1579)Bug-fix for Other Legend (#1586)Add optional tolerance on geometric operations (#1571)Improve PDF filename when not using egrid (#1585)2.1.1Fix value for service version (#1576)Fix XML for localized image blob (#1577)Raise error in case of unsupported geometry type (#1578)2.1.0Move DataIntegration to application schema (#1549)Bug fix for document relevant only for one municipality (#1561)Bug fix for oereblex optional parameters (#1565)Library updates (#1567)2.0.2Oereblex integration: facilitate customization of title logic (#1556)Fix automated documentation publication (#1555)Improve automated testing of federal data (#1548)2.0.1Disclaimer, glossary and municipality are now read only on startup, to improve performance (#1544)Add support for OEREBlex prepubs URL (#1546)Fix real estate type in XML for GetEgrid (#1545)2.0.0Fix legend entry collection (#1529)Fix stats for GetEgrid (#1524)Update theme and texts URL according to swisstopo (#1526)Fix JSON response of GetEgrid (#1534)Fix error in Interlis model sub-code usage (#1538)Improve performance by moving availability to main schema and read only on startup (#1540)2.0.0.rc2Finalize stats reactivation (#1517)2.0.0.rc1Updates of all essential libraries usedFix multiple disclaimers in print (#1511)2.0.0.b15Fix capabilities extract (#1489)Fix real estate type in get egrid extract (#1491)Fix legend entry symbol selection (#1505)Add document sorting by index in print (#1504)2.0.0.b14Reorganize hook methos (#1484)Fix Office Record assignment (#1473)External library updates2.0.0.b13Fix collection of legend entries (#1482)2.0.0.b12Reactivate statistics functionality from V1 (#1480)Additional fix for static extract (#1478)2.0.0.b11Additional fix for static extract2.0.0.b10Fixes for static extract2.0.0.b9Fixes in configuration (#1445)2.0.0.b8Fix XML templates2.0.0.b7Fix sub-theme generation2.0.0.b6Improvements in error logging2.0.0.b5Fixes in Oereblex integration2.0.0.b4Fix JSON extract2.0.0.b3New federal data import tool and bug-fixes V2 (Status: beta)2.0.0.b2First fully functional implementation of new Oereb specification as per 28.10.11 (Status: beta)2.0.0.b1Implementation of the new Oereb specification 2021 (Status: beta)1.9.2Oereblex: improve testing functionality for Oereblex (#1197)Various library updates1.9.1Oereblex: support new Oereblex API version 1.2.1Various library updates1.9.0Oereblex: add configuration to pass URL parameters to the oereblex call (#1117)Various library updatesImprove handling of empty geometries, in preparation of additional library updates (#1107)Print using MapFish Print: the inclusion of the cantonal logo is now configurable (#1139)1.8.1Update of external libraries such as numpy, SQLAlchemy, lxml, and more.oereblex support: avoid extract failure upon missing enactment_date in oereblex (#1093)Improve support of Python 3.7 in template Makefile and sample data loading (#1104, #1106)1.8.0Fix bug affecting concurrent requests (#1068)Enhance federal data import script to make it more usable with Docker (#1078)For full extracts, add configuration parameter to make additional sld usage optional (#1077)1.7.6Improve federal data import script (#1057)Last maintenance release with verified python2 compatibility1.7.5Update of all libraries used by pyramid_oereb that still work with python21.7.4Federal data import script: add SLD_VERSION for legend_at_web (#1022)Oereblex integration: add optional configuration ‘validation’ (#1034)Restrict the version of the Shapely library used to 1.6 (#1037)1.7.3Fix import of federal data for cases including both coordinate reference systems (#1011)Oereblex: support geolink schema version 1.2.0 (#1010)Print: make geometry inclusion optional (performance improvement for MapFish Print) (#1006)1.7.2Test release only; not an official release.1.7.1Print: fix nr_of_points computation (#1002)1.7.0Oereblex: improve performance (implement per topic store) (#993)Add statistics functionality (#987)Print: fix table of contents page numbering (#983)1.6.0Improve multilingual support (#915, #918, #943, #950)Ensure XML schema compliance (#914, #926)Improve extract speed (#965)Additional options for sorting and grouping (#925, #931, #948, #979)Additional options for xml2pdf integration (#905, #938)Add PDF archive functionality (#982)Make WMS usage in print more flexible (#986)Bug fixes and debugging possibilities improvement (#910, #909, #897, #894, #916, #919, #870, #908, #932, #955, #958, #963, #970)1.5.2Provide multilingual OEREB logo (#915)Add file extension in logo and symbol URLs (#917)1.5.1Ensure XML Schema compliance (#872, #891)Fix polygon GML rendering (#830)Integration ofXML2PDFservice (#631, #883, #887)1.5.0Fixed a number formatting problem in the legend list (Mapfish Print, GitHub issue 824, pull request 826)Fixed an encoding issue for PLR records (GitHub pull request 828)Allow configuration of custom parameters for WMS calls in Mapfish Print (GitHub pull request 831)Section ‘Certification’ is now optional, can be configured in the Mapfish Print config (GitHub pull request 841)Only prints the PLR section of the PDF if at least one PLR is available (Mapfish Print, GitHub pull request 846)Various layout fixes in the table of contents of the Mapfish Print PDF (GitHub pull requests 842, 856, 859)Legends are now sorted by geometry type and value (Mapfish Print, GitHub pull request 851)Multiple ResponsibleOffices per theme are now rendered correctly (Mapfish Print, GitHub issue 651, pull request 865)PDF/A conformance enabled by default (Mapfish Print, GitHub pull request 852)In the XML output, LengthShare and NrOfPoints elements were moved to their correct place (GitHub issue 834, GitHub pull request 854)Optimized theme sorting (GitHub issue 443, GitHub pull request 858)Updated Mapfish Print to 3.20.0Dependency updates, better test coverage1.4.3Fixed import script for federal topics (GitHub pull request 821)Added test for ordering of non-concerned themes (GitHub pull request 817)Fixed footer with disappearing page numbers with MapFish print 3.18 (GitHub pull request 814)1.4.2Downgrade version of pyproj to fix coordinate reprojections (GitHub pull request 810)Dependency updates1.4.1Fixed id types in oereblex models and model template, fixed documentation errors in standard models
and model template  (GitHub pull request 807)Fixed warnings in tests (GitHub pull request 803)Dependency updates (GitHub pull request 805)1.4.0Additional multilingual functionality (GitHub issues 704, 705, 779)1.3.1Maintenance release (GitHub issues 447, 610, 590, 609, 757, 750, 681, 752, 753, 460, 736,
666, 596, 678, 461, 751)1.3.0Import script for federal data1.2.3Bug-fix release for 1.2.2 (fix intersection bug, fix pdfreport template)1.2.2Further bug-fixes for oereb service versoin 1.0, notably regarding schema conformity
and better support for other OS versions.New configuration parameter type_mapping in real_estate, which allows to configuratively
define the texts to be used for realestate types (optional parameter).1.2.1Bug-fixes for service version 1.0 (pyramid_oereb 1.2.0),
using results from pilot integration of new version at BL.1.2.0First implementation of federal extract requirements as per november 2017
(service in version 1.0, extract in version 1.0.1, data model in version 1.0.1).Update of automated tests to correspond to new requirements.Static extract implementation update according to Weisung july 1st, 2018.Oereb lex model creation support and documentation.Bug fixes (legend entries, multiple view services, scaling in print, document titles in print).Facilitate customization of document title generation.1.1.0Final implementation of federal extract requirements as per november 2016
(extract in version 0.8, data model in version 0.4).1.0.1introduce configurable pdf print service (print proxy)enable proxy configuration for external web api usagefix standard databaseimprove python 3 compatibilityminor bug fixing1.0.0improved docfix bug for doc creation on python 3.61.0.0-beta.1first approach of OEREB serverimproved documentation onhttps://openoereb.github.io/pyramid_oereb/doc/cleaned and reorganized codebinding to OEREB-LEX and GeoAdmin-Api-Address-Service
(http://api.geo.admin.ch/services/sdiservices.html#search) as sourcesproviding pyconizer as icon generator (https://pypi.python.org/pypi/pyconizer)proxy binding of geomapfish_print for pdf output as renderer
(http://mapfish.github.io/mapfish-print-doc/#/overview)providing extensive standard configuration for out-of-the-box-usagegeneral bug fixingadd python 3.x support1.0.0-alpha.2proceed with renderer for xml and jsonadd metadata for embeddable flavourimages accessible via URLadd configurable methods for processingimprove geometry handlingadd documentation onhttps://openoereb.github.io/pyramid_oereb/doc/several bugfixes1.0.0-alpha.1first running approach of servermain web services are available (not all formats are implemented yet)standard configuration can be used to run server out of the boxsee README for more details0.0.1initial version