Package: terra-layer
Terra LayerThis django applications aims to provide an API to connect django_geosource to django_geodata.
It serve an API that provides informations wanted by a frontend to configure data rendering.Pre-requisiteYou need the last version of docker and docker-compose to execute a dev instance.Set configurationIn Django settings, you must set the different views provided to fronted, like this:# Map settings. Sent to mapbox clientside.TERRA_DEFAULT_MAP_SETTINGS={'accessToken':'<your mapbox access token>','backgroundStyle':'<background style file>','center':[-0.655,43.141],# Default view center'zoom':7.7,# Default zoom'maxZoom':19.9,'minZoom':5,'fitBounds':{# Default bounding box'coordinates':[[-4.850,46.776],[-0.551,48.886]],},}# Style and Legend autogenerationTERRA_LAYER_STYLE_SETTINGS={"circle_min_legend_height":14,# minimum height for circle legend label."fill_color":"#0000cc",# Default fill color"fill_opacity":0.4,# Default fill opacity"stroke_color":"#ffffff",# Default stroke color"stroke_width":0.3,# Default stroke width}Add a load xls commandYou can define in the project usingterra_layera load_xls command that takes
two parameters:-s (--scene-name): receive the scene name.-f (--file): the input xls file to load.This command is launched when a file is send with a view. See the test project
for an exemple.To start a dev instanceDefine settings you wants intest_terralayerdjango project.docker-composeupFirst start should failed as the database need to be initialized. Just launch
the same command twice.Then initialize the database:docker-composeexecweb/code/venv/bin/python3/code/src/manage.pymigrateYou can now edit your code. A django runserver is launched internally so the
this is an autoreload server.You can access to the api onhttp://localhost:8000/api/TestTo run test suite, just launch:docker-composeexecweb/code/venv/bin/python3/code/src/manage.pytestContributingYou must use factoryboy factories to develop your tests. The factories are available
atterra_layer/tests/factoriesYou must update the CHANGES.md file on each MR and increment version if needed.0.7.12 / 2022-09-15LayerViewset return customStyle for each layer instead of reference group0.7.11 / 2022-03-10Improve CIDev with python 3.6Prevent postgresql bugAllow djangoFix black alerts0.7.10 / 2021-10-07Add source filter field (#79)0.7.9 / 2021-03-09Set main_field to null when source field is removed0.7.8 / 2021-02-11Fix text size generation0.7.7 / 2021-02-08Better legend cleanupRemove diameter in legendUse correct legend field on strokeUpdate legend instead of dropping and recreate themAdd uid to style to prepare legend linkUpdate legend code generation0.7.6 / 2021-01-26Add icon/text/zoom style generationPaint is now optionnalSplit style in multiple files to ease maintenance0.7.5 / 2020-12-17Fix again ghost style0.7.4 / 2020-12-16Fix extrusion style generationMore robust migration0.7.3 / 2020-12-14Fix extra style not generated0.7.2 / 2020-12-14Try to fix automatic legend duplicationDont generate style for another map_styleFix base layer addition when baselayer already definedRespect filter field orderEnhance populate baselayer command0.7.1 / 2020-12-09Make migration more robustAdd command to populate baselayer from settings0.7.0 / 2020-12-02/!\ Major breaking change for style générationImprove style generation, API updated0.6.0 / 2020-12-02Breaking changesMinisheet api as evolved.Permissions are now implementedChangesAdd github actions[Breaking change] Move minisheet info into a config field[Breaking change] Upgrade terra-settings & terra-accounts0.5.3 / 2020-11-02Remove popup_enable & minisheet_enable filter fields0.5.2 / 2020-10-27Move popup data into a config json field for deeper customization/configuration0.5.1 / 2020-10-07Feature: Show scene with it's map settings from config json fieldFeature: Add credit from layer's sourceFix: Tabular view is exportable only if the global export parameter is set to true on the layer0.5.0 / 2020-06-30Fix bad format type sent to serverAdd an option to not generate wizardFix circle legend generator using decimal valueStyle generator: graduated, no data close to small value in legendStyle generator: deal with null value vs empty tableGen style, fix color usageFix & remove default params to gen_legend_circle()Add a dict level style in wizard configStyle generator, support of null value on layer style and legendUpdating a layer's source do not delete field settings anymore0.4.13 / 2020-06-25Update source layer by layer pk and not by name0.4.12 / 2020-06-23Fix missing property on interactions0.4.11 / 2020-06-04Command to replace the source of the layer0.4.10 / 2020-04-27Filter NULL value on discretize method0.4.9 / 2020-03-19Add missing display and config field properties0.4.8 / 2020-03-16Add import file process only if load_xls command existsAdd way to specify selectors when inserting in treeFix boundaries when no dataAllow to provide manual boundaries for graduatedFix circle size legendAdd default style on field less layerImplement auto legend for Proportional SymbolAdd mapbox gl style generator0.4.7 / 2020-03-10Add initial opacity of layerAdd insert in tree to ease processingReview README0.4.6      (2019-02-06)FixesField order was not savedDon't save layer group on write0.4.5      (2019-02-04)FixesReplace SimpleRouteur by DefaultRouter that handleformatparam0.4.4      (2019-01-22)FixesRemove id to source field translation for fields0.4.3      (2019-01-21)FixesFix field ordering bugFix migration bug on GroupAdd permission on layersRemove code slug is NoneQualityIncrease coverageAdd a lot of testsAdd flake8 pipeline travisFix coveragerc0.4.2      (2019-01-07)FixesFix load layer commandImprovesAdd uuid field for layer to ease import/export0.4.1      (2019-12-19)FixesHandle group selectors and settings in tree0.4.0      (2019-12-18)ImprovesAdd tree edition support via Scene APICan now have geolayers at tree rootGeolayers and groups can be mixed in any order0.3.14     (2019-12-18)Support python 3.8, django 3.0 and DRF 3.11Improve ordering and filtersDrop requirement over url-filter0.3.13      (2019-12-11)ImprovesUpdate code documentationAllow layer ordering by view nameAllow layer search by name and settingsAllow layer filter by source0.3.12      (2019-11-25)FixesCustom styles must be anonymized on exports to be importables0.3.11      (2019-11-21)FixesFixes some layer's export/import mistakes0.3.10      (2019-11-20)ImprovesAdd layer_dump and layer_load_dump management command to save and restore layers0.3.9      (2019-11-19)ImprovesAdd default layer activation supportAdd layer_dump and layer_load_dump management command to save and restore layers0.3.8      (2019-11-13)FixDeep layer groups raises an error0.3.7      (2019-11-12)Fixslug can now be modified and is optionnalImprovesAdd default layer activation support0.3.6      (2019-11-07)FixFix geolayer urls double dash0.3.5      (2019-11-06)ImprovesSet correct permission classes to viewsets0.3.4      (2019-11-06)FixesFix geostore namespace that is not necessary anymore0.3.3      (2019-11-06)FixesAdd Manifest0.3.2      (2019-11-05)FixesFix url namespace of geostore0.3.1      (2019-11-05)ImprovesIntegrate terra permissions mecanism0.3.0      (2019-10-18)ReleaseFirst release