summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_finds/tests.py1
-rw-r--r--ishtar_common/qfield/model/Finds.gpkg (renamed from archaeological_finds/tests/Finds.gpkg)bin98304 -> 106496 bytes
-rw-r--r--ishtar_common/qfield/model/Prospections.qgs1400
-rw-r--r--ishtar_common/qfield/model/Prospections_attachments.zipbin0 -> 1124 bytes
-rw-r--r--ishtar_common/qfield/model/Prospections_qfield.zipbin0 -> 1219 bytes
-rw-r--r--ishtar_common/tests.py115
-rw-r--r--ishtar_common/tests/Finds.gpkgbin98304 -> 0 bytes
-rw-r--r--ishtar_common/views.py6
-rw-r--r--ishtar_common/views_item.py152
9 files changed, 1634 insertions, 40 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 87ed1f179..b5f7ee8b7 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -1283,6 +1283,7 @@ class ImportFindTest(BaseImportFindTest):
layer.CreateFeature(feature)
feature = None
datasource = None
+ os.remove(gpkg)
class ExportTest(FindInit, TestCase):
diff --git a/archaeological_finds/tests/Finds.gpkg b/ishtar_common/qfield/model/Finds.gpkg
index 1b71e2aa6..a439d366d 100644
--- a/archaeological_finds/tests/Finds.gpkg
+++ b/ishtar_common/qfield/model/Finds.gpkg
Binary files differ
diff --git a/ishtar_common/qfield/model/Prospections.qgs b/ishtar_common/qfield/model/Prospections.qgs
new file mode 100644
index 000000000..5049b2e4e
--- /dev/null
+++ b/ishtar_common/qfield/model/Prospections.qgs
@@ -0,0 +1,1400 @@
+<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
+<qgis saveUser="thomas" saveDateTime="2025-04-30T12:15:50" projectname="" saveUserFull="Thomas ANDRE" version="3.40.5-Bratislava">
+ <homePath path=""/>
+ <title></title>
+ <transaction mode="Disabled"/>
+ <projectFlags set=""/>
+ <projectCrs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </projectCrs>
+ <verticalCrs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt></wkt>
+ <proj4></proj4>
+ <srsid>0</srsid>
+ <srid>0</srid>
+ <authid></authid>
+ <description></description>
+ <projectionacronym></projectionacronym>
+ <ellipsoidacronym></ellipsoidacronym>
+ <geographicflag>false</geographicflag>
+ </spatialrefsys>
+ </verticalCrs>
+ <elevation-shading-renderer light-altitude="45" light-azimuth="315" edl-distance="0.5" hillshading-is-active="0" hillshading-z-factor="1" edl-strength="1000" hillshading-is-multidirectional="0" combined-method="0" edl-is-active="1" edl-distance-unit="0" is-active="0"/>
+ <layer-tree-group>
+ <customproperties>
+ <Option/>
+ </customproperties>
+ <layer-tree-layer providerKey="ogr" expanded="1" source="./Finds.gpkg|layername=Finds" patch_size="-1,-1" name="Finds" legend_exp="" checked="Qt::Checked" legend_split_behavior="0" id="Finds_7595ca92_4128_456d_a700_416cedf9aaa4">
+ <customproperties>
+ <Option/>
+ </customproperties>
+ </layer-tree-layer>
+ <layer-tree-group expanded="1" name="Cartes" checked="Qt::Checked" groupLayer="">
+ <customproperties>
+ <Option/>
+ </customproperties>
+ <layer-tree-layer providerKey="wms" expanded="0" source="crs=EPSG:3857&amp;format&amp;type=xyz&amp;url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&amp;zmax=19&amp;zmin=0" patch_size="-1,-1" name="OSM Standard" legend_exp="" checked="Qt::Checked" legend_split_behavior="0" id="OSM_Standard_88a32e94_cd29_412c_8b66_ee44fe338fab">
+ <customproperties>
+ <Option type="Map">
+ <Option type="invalid" name="expandedLegendNodes"/>
+ </Option>
+ </customproperties>
+ </layer-tree-layer>
+ <layer-tree-layer providerKey="wms" expanded="0" source="crs=EPSG:3857&amp;dpiMode=7&amp;featureCount=10&amp;format=image/jpeg&amp;layers=HR.ORTHOIMAGERY.ORTHOPHOTOS&amp;styles=normal&amp;tileMatrixSet=PM_6_19&amp;tilePixelRatio=0&amp;url=https://data.geopf.fr/wmts?SERVICE%3DWMTS%26VERSION%3D1.0.0%26REQUEST%3DGetCapabilities" patch_size="-1,-1" name="Ortho 20 cm" legend_exp="" checked="Qt::Checked" legend_split_behavior="0" id="Ortho_20_cm_f8497a68_e819_4170_a2ce_17cc699ac2d2">
+ <customproperties>
+ <Option/>
+ </customproperties>
+ </layer-tree-layer>
+ </layer-tree-group>
+ <custom-order enabled="0">
+ <item>Finds_7595ca92_4128_456d_a700_416cedf9aaa4</item>
+ <item>OSM_Standard_88a32e94_cd29_412c_8b66_ee44fe338fab</item>
+ <item>Ortho_20_cm_f8497a68_e819_4170_a2ce_17cc699ac2d2</item>
+ </custom-order>
+ </layer-tree-group>
+ <snapping-settings intersection-snapping="0" self-snapping="0" minScale="0" maxScale="0" enabled="0" type="1" tolerance="12" mode="2" scaleDependencyMode="0" unit="1">
+ <individual-layer-settings>
+ <layer-setting units="1" minScale="0" maxScale="0" enabled="0" type="1" tolerance="12" id="Finds_7595ca92_4128_456d_a700_416cedf9aaa4"/>
+ </individual-layer-settings>
+ </snapping-settings>
+ <relations/>
+ <polymorphicRelations/>
+ <mapcanvas annotationsVisible="1" name="theMapCanvas">
+ <units>degrees</units>
+ <extent>
+ <xmin>-4.83189219737137599</xmin>
+ <ymin>43.70747210619575895</ymin>
+ <xmax>8.19138905262862771</xmax>
+ <ymax>49.86105416580328864</ymax>
+ </extent>
+ <rotation>0</rotation>
+ <destinationsrs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </destinationsrs>
+ <rendermaptile>0</rendermaptile>
+ <expressionContextScope/>
+ </mapcanvas>
+ <projectModels/>
+ <legend updateDrawingOrder="true">
+ <legendlayer open="true" showFeatureCount="0" drawingOrder="-1" name="Finds" checked="Qt::Checked">
+ <filegroup open="true" hidden="false">
+ <legendlayerfile isInOverview="0" layerid="Finds_7595ca92_4128_456d_a700_416cedf9aaa4" visible="1"/>
+ </filegroup>
+ </legendlayer>
+ <legendgroup open="true" name="Cartes" checked="Qt::Checked">
+ <legendlayer open="false" showFeatureCount="0" drawingOrder="-1" name="OSM Standard" checked="Qt::Checked">
+ <filegroup open="false" hidden="false">
+ <legendlayerfile isInOverview="0" layerid="OSM_Standard_88a32e94_cd29_412c_8b66_ee44fe338fab" visible="1"/>
+ </filegroup>
+ </legendlayer>
+ <legendlayer open="false" showFeatureCount="0" drawingOrder="-1" name="Ortho 20 cm" checked="Qt::Checked">
+ <filegroup open="false" hidden="false">
+ <legendlayerfile isInOverview="0" layerid="Ortho_20_cm_f8497a68_e819_4170_a2ce_17cc699ac2d2" visible="1"/>
+ </filegroup>
+ </legendlayer>
+ </legendgroup>
+ </legend>
+ <mapViewDocks/>
+ <main-annotation-layer legendPlaceholderImage="" autoRefreshMode="Disabled" maxScale="0" minScale="1e+08" type="annotation" autoRefreshTime="0" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" styleCategories="AllStyleCategories" hasScaleBasedVisibilityFlag="0">
+ <id>Annotations_61e154b2_8160_463f_af4c_71565a806b89</id>
+ <datasource></datasource>
+ <keywordList>
+ <value></value>
+ </keywordList>
+ <layername>Annotations</layername>
+ <srs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </srs>
+ <resourceMetadata>
+ <identifier></identifier>
+ <parentidentifier></parentidentifier>
+ <language></language>
+ <type></type>
+ <title></title>
+ <abstract></abstract>
+ <links/>
+ <dates/>
+ <fees></fees>
+ <encoding></encoding>
+ <crs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt></wkt>
+ <proj4></proj4>
+ <srsid>0</srsid>
+ <srid>0</srid>
+ <authid></authid>
+ <description></description>
+ <projectionacronym></projectionacronym>
+ <ellipsoidacronym></ellipsoidacronym>
+ <geographicflag>false</geographicflag>
+ </spatialrefsys>
+ </crs>
+ <extent/>
+ </resourceMetadata>
+ <items/>
+ <flags>
+ <Identifiable>1</Identifiable>
+ <Removable>1</Removable>
+ <Searchable>1</Searchable>
+ <Private>0</Private>
+ </flags>
+ <customproperties>
+ <Option/>
+ </customproperties>
+ <layerOpacity>1</layerOpacity>
+ <blendMode>0</blendMode>
+ <paintEffect/>
+ </main-annotation-layer>
+ <projectlayers>
+ <maplayer geometry="Point" refreshOnNotifyEnabled="0" readOnly="0" autoRefreshTime="0" autoRefreshMode="Disabled" simplifyLocal="1" styleCategories="AllStyleCategories" symbologyReferenceScale="-1" simplifyDrawingTol="1" refreshOnNotifyMessage="" simplifyAlgorithm="0" simplifyDrawingHints="0" simplifyMaxScale="1" labelsEnabled="0" legendPlaceholderImage="" type="vector" minScale="100000000" maxScale="0" wkbType="PointZ" hasScaleBasedVisibilityFlag="0">
+ <id>Finds_7595ca92_4128_456d_a700_416cedf9aaa4</id>
+ <datasource>./Finds.gpkg|layername=Finds</datasource>
+ <keywordList>
+ <value></value>
+ </keywordList>
+ <layername>Finds</layername>
+ <srs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </srs>
+ <resourceMetadata>
+ <identifier></identifier>
+ <parentidentifier></parentidentifier>
+ <language></language>
+ <type>dataset</type>
+ <title></title>
+ <abstract></abstract>
+ <contact>
+ <name></name>
+ <organization></organization>
+ <position></position>
+ <voice></voice>
+ <fax></fax>
+ <email></email>
+ <role></role>
+ </contact>
+ <links/>
+ <dates/>
+ <fees></fees>
+ <encoding></encoding>
+ <crs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </crs>
+ <extent>
+ <spatial dimensions="2" maxx="-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368" minx="179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368" crs="EPSG:4326" maxy="-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368" miny="179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368" maxz="0" minz="0"/>
+ <temporal>
+ <period>
+ <start></start>
+ <end></end>
+ </period>
+ </temporal>
+ </extent>
+ </resourceMetadata>
+ <provider encoding="UTF-8">ogr</provider>
+ <vectorjoins/>
+ <layerDependencies/>
+ <dataDependencies/>
+ <expressionfields/>
+ <map-layer-style-manager current="défaut">
+ <map-layer-style name="défaut"/>
+ </map-layer-style-manager>
+ <auxiliaryLayer/>
+ <metadataUrls/>
+ <flags>
+ <Identifiable>1</Identifiable>
+ <Removable>1</Removable>
+ <Searchable>1</Searchable>
+ <Private>0</Private>
+ </flags>
+ <temporal limitMode="0" durationField="fid" startExpression="" endField="" startField="champ_date" durationUnit="min" enabled="0" accumulate="0" mode="0" fixedDuration="0" endExpression="">
+ <fixedRange>
+ <start></start>
+ <end></end>
+ </fixedRange>
+ </temporal>
+ <elevation extrusionEnabled="0" respectLayerSymbol="1" showMarkerSymbolInSurfacePlots="0" type="IndividualFeatures" binding="Centroid" zscale="1" symbology="Line" zoffset="0" extrusion="0" clamping="Relative">
+ <data-defined-properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data-defined-properties>
+ <profileLineSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="line" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleLine" enabled="1" id="{0e604244-2679-4405-bcb5-4701e7ff0f5f}">
+ <Option type="Map">
+ <Option value="0" type="QString" name="align_dash_pattern"/>
+ <Option value="square" type="QString" name="capstyle"/>
+ <Option value="5;2" type="QString" name="customdash"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="customdash_map_unit_scale"/>
+ <Option value="MM" type="QString" name="customdash_unit"/>
+ <Option value="0" type="QString" name="dash_pattern_offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="dash_pattern_offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="dash_pattern_offset_unit"/>
+ <Option value="0" type="QString" name="draw_inside_polygon"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="213,180,60,255,rgb:0.83529411764705885,0.70588235294117652,0.23529411764705882,1" type="QString" name="line_color"/>
+ <Option value="solid" type="QString" name="line_style"/>
+ <Option value="0.6" type="QString" name="line_width"/>
+ <Option value="MM" type="QString" name="line_width_unit"/>
+ <Option value="0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="0" type="QString" name="ring_filter"/>
+ <Option value="0" type="QString" name="trim_distance_end"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="trim_distance_end_map_unit_scale"/>
+ <Option value="MM" type="QString" name="trim_distance_end_unit"/>
+ <Option value="0" type="QString" name="trim_distance_start"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="trim_distance_start_map_unit_scale"/>
+ <Option value="MM" type="QString" name="trim_distance_start_unit"/>
+ <Option value="0" type="QString" name="tweak_dash_pattern_on_corners"/>
+ <Option value="0" type="QString" name="use_custom_dash"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="width_map_unit_scale"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileLineSymbol>
+ <profileFillSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="fill" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleFill" enabled="1" id="{daa6a3e5-1f01-4487-bf4f-1c447419415c}">
+ <Option type="Map">
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
+ <Option value="213,180,60,255,rgb:0.83529411764705885,0.70588235294117652,0.23529411764705882,1" type="QString" name="color"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="0,0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="152,129,43,255,rgb:0.59662775616083008,0.50420386053253985,0.1680628671702144,1" type="QString" name="outline_color"/>
+ <Option value="solid" type="QString" name="outline_style"/>
+ <Option value="0.2" type="QString" name="outline_width"/>
+ <Option value="MM" type="QString" name="outline_width_unit"/>
+ <Option value="solid" type="QString" name="style"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileFillSymbol>
+ <profileMarkerSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="marker" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleMarker" enabled="1" id="{e9c5e175-35b4-4e7e-a297-f58c3427362e}">
+ <Option type="Map">
+ <Option value="0" type="QString" name="angle"/>
+ <Option value="square" type="QString" name="cap_style"/>
+ <Option value="213,180,60,255,rgb:0.83529411764705885,0.70588235294117652,0.23529411764705882,1" type="QString" name="color"/>
+ <Option value="1" type="QString" name="horizontal_anchor_point"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="diamond" type="QString" name="name"/>
+ <Option value="0,0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="152,129,43,255,rgb:0.59662775616083008,0.50420386053253985,0.1680628671702144,1" type="QString" name="outline_color"/>
+ <Option value="solid" type="QString" name="outline_style"/>
+ <Option value="0.2" type="QString" name="outline_width"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="outline_width_map_unit_scale"/>
+ <Option value="MM" type="QString" name="outline_width_unit"/>
+ <Option value="diameter" type="QString" name="scale_method"/>
+ <Option value="3" type="QString" name="size"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="size_map_unit_scale"/>
+ <Option value="MM" type="QString" name="size_unit"/>
+ <Option value="1" type="QString" name="vertical_anchor_point"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileMarkerSymbol>
+ </elevation>
+ <renderer-v2 enableorderby="0" symbollevels="0" referencescale="-1" type="singleSymbol" forceraster="0">
+ <symbols>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="marker" name="0" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleMarker" enabled="1" id="{d4d2458c-5070-44b4-8b16-7704a2b29174}">
+ <Option type="Map">
+ <Option value="0" type="QString" name="angle"/>
+ <Option value="square" type="QString" name="cap_style"/>
+ <Option value="219,30,42,255,rgb:0.85882352941176465,0.11764705882352941,0.16470588235294117,1" type="QString" name="color"/>
+ <Option value="1" type="QString" name="horizontal_anchor_point"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="circle" type="QString" name="name"/>
+ <Option value="0,0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="0,0,0,255,rgb:0,0,0,1" type="QString" name="outline_color"/>
+ <Option value="solid" type="QString" name="outline_style"/>
+ <Option value="0.4" type="QString" name="outline_width"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="outline_width_map_unit_scale"/>
+ <Option value="MM" type="QString" name="outline_width_unit"/>
+ <Option value="diameter" type="QString" name="scale_method"/>
+ <Option value="4" type="QString" name="size"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="size_map_unit_scale"/>
+ <Option value="MM" type="QString" name="size_unit"/>
+ <Option value="1" type="QString" name="vertical_anchor_point"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </symbols>
+ <rotation/>
+ <sizescale/>
+ <data-defined-properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data-defined-properties>
+ </renderer-v2>
+ <selection mode="Default">
+ <selectionColor invalid="1"/>
+ <selectionSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="marker" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleMarker" enabled="1" id="{11e497de-d80c-447a-90ea-4868bf8b3c9d}">
+ <Option type="Map">
+ <Option value="0" type="QString" name="angle"/>
+ <Option value="square" type="QString" name="cap_style"/>
+ <Option value="255,0,0,255,rgb:1,0,0,1" type="QString" name="color"/>
+ <Option value="1" type="QString" name="horizontal_anchor_point"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="circle" type="QString" name="name"/>
+ <Option value="0,0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" type="QString" name="outline_color"/>
+ <Option value="solid" type="QString" name="outline_style"/>
+ <Option value="0" type="QString" name="outline_width"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="outline_width_map_unit_scale"/>
+ <Option value="MM" type="QString" name="outline_width_unit"/>
+ <Option value="diameter" type="QString" name="scale_method"/>
+ <Option value="2" type="QString" name="size"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="size_map_unit_scale"/>
+ <Option value="MM" type="QString" name="size_unit"/>
+ <Option value="1" type="QString" name="vertical_anchor_point"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </selectionSymbol>
+ </selection>
+ <customproperties>
+ <Option type="Map">
+ <Option value="copy" type="QString" name="QFieldSync/action"/>
+ <Option value="{&quot;champ_media&quot;: &quot;'DCIM/support_' || format_date(now(),'yyyyMMddhhmmsszzz') || '.{extension}'&quot;}" type="QString" name="QFieldSync/attachment_naming"/>
+ <Option value="offline" type="QString" name="QFieldSync/cloud_action"/>
+ <Option type="invalid" name="QFieldSync/geometry_locked_expression"/>
+ <Option value="{&quot;champ_media&quot;: &quot;'DCIM/support_' || format_date(now(),'yyyyMMddhhmmsszzz') || '.{extension}'&quot;}" type="QString" name="QFieldSync/photo_naming"/>
+ <Option value="{}" type="QString" name="QFieldSync/relationship_maximum_visible"/>
+ <Option value="Support_920d875a_c96c_44bd_a775_da5094508e21" type="QString" name="QFieldSync/remoteLayerId"/>
+ <Option value="fid" type="QString" name="QFieldSync/sourceDataPrimaryKeys"/>
+ <Option value="30" type="int" name="QFieldSync/tracking_distance_requirement_minimum_meters"/>
+ <Option value="1" type="int" name="QFieldSync/tracking_erroneous_distance_safeguard_maximum_meters"/>
+ <Option value="0" type="int" name="QFieldSync/tracking_measurement_type"/>
+ <Option value="30" type="int" name="QFieldSync/tracking_time_requirement_interval_seconds"/>
+ <Option value="0" type="int" name="QFieldSync/value_map_button_interface_threshold"/>
+ <Option type="List" name="dualview/previewExpressions">
+ <Option value="&quot;champ_id&quot;" type="QString"/>
+ </Option>
+ <Option value="0" type="int" name="embeddedWidgets/count"/>
+ <Option type="invalid" name="variableNames"/>
+ <Option type="invalid" name="variableValues"/>
+ </Option>
+ </customproperties>
+ <blendMode>0</blendMode>
+ <featureBlendMode>0</featureBlendMode>
+ <layerOpacity>1</layerOpacity>
+ <geometryOptions removeDuplicateNodes="0" geometryPrecision="0">
+ <activeChecks/>
+ <checkConfiguration/>
+ </geometryOptions>
+ <legend showLabelLegend="0" type="default-vector"/>
+ <referencedLayers/>
+ <fieldConfiguration>
+ <field name="fid" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_id" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_date" configurationFlags="NoFlag">
+ <editWidget type="DateTime">
+ <config>
+ <Option type="Map">
+ <Option value="true" type="bool" name="allow_null"/>
+ <Option value="true" type="bool" name="calendar_popup"/>
+ <Option value="dd/MM/yyyy" type="QString" name="display_format"/>
+ <Option value="yyyy-MM-dd" type="QString" name="field_format"/>
+ <Option value="true" type="bool" name="field_format_overwrite"/>
+ <Option value="false" type="bool" name="field_iso_format"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_datetime" configurationFlags="NoFlag">
+ <editWidget type="DateTime">
+ <config>
+ <Option type="Map">
+ <Option value="true" type="bool" name="allow_null"/>
+ <Option value="true" type="bool" name="calendar_popup"/>
+ <Option value="dd/MM/yyyy HH:mm:ss" type="QString" name="display_format"/>
+ <Option value="yyyy-MM-dd HH:mm:ss" type="QString" name="field_format"/>
+ <Option value="true" type="bool" name="field_format_overwrite"/>
+ <Option value="false" type="bool" name="field_iso_format"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_x" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_y" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_z" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_media" configurationFlags="NoFlag">
+ <editWidget type="ExternalResource">
+ <config>
+ <Option type="Map">
+ <Option value="1" type="int" name="DocumentViewer"/>
+ <Option value="0" type="int" name="DocumentViewerHeight"/>
+ <Option value="0" type="int" name="DocumentViewerWidth"/>
+ <Option value="true" type="bool" name="FileWidget"/>
+ <Option value="true" type="bool" name="FileWidgetButton"/>
+ <Option type="invalid" name="FileWidgetFilter"/>
+ <Option type="Map" name="PropertyCollection">
+ <Option type="invalid" name="name"/>
+ <Option type="invalid" name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ <Option value="0" type="int" name="RelativeStorage"/>
+ <Option type="invalid" name="StorageAuthConfigId"/>
+ <Option value="0" type="int" name="StorageMode"/>
+ <Option type="invalid" name="StorageType"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_wkt_2d" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ <field name="champ_wkt_3d" configurationFlags="NoFlag">
+ <editWidget type="TextEdit">
+ <config>
+ <Option type="Map">
+ <Option value="false" type="bool" name="IsMultiline"/>
+ <Option value="false" type="bool" name="UseHtml"/>
+ </Option>
+ </config>
+ </editWidget>
+ </field>
+ </fieldConfiguration>
+ <aliases>
+ <alias index="0" name="" field="fid"/>
+ <alias index="1" name="" field="champ_id"/>
+ <alias index="2" name="" field="champ_date"/>
+ <alias index="3" name="" field="champ_datetime"/>
+ <alias index="4" name="" field="champ_x"/>
+ <alias index="5" name="" field="champ_y"/>
+ <alias index="6" name="" field="champ_z"/>
+ <alias index="7" name="" field="champ_media"/>
+ <alias index="8" name="" field="champ_wkt_2d"/>
+ <alias index="9" name="" field="champ_wkt_3d"/>
+ </aliases>
+ <splitPolicies>
+ <policy policy="DefaultValue" field="fid"/>
+ <policy policy="DefaultValue" field="champ_id"/>
+ <policy policy="DefaultValue" field="champ_date"/>
+ <policy policy="DefaultValue" field="champ_datetime"/>
+ <policy policy="DefaultValue" field="champ_x"/>
+ <policy policy="DefaultValue" field="champ_y"/>
+ <policy policy="DefaultValue" field="champ_z"/>
+ <policy policy="DefaultValue" field="champ_media"/>
+ <policy policy="DefaultValue" field="champ_wkt_2d"/>
+ <policy policy="DefaultValue" field="champ_wkt_3d"/>
+ </splitPolicies>
+ <duplicatePolicies>
+ <policy policy="Duplicate" field="fid"/>
+ <policy policy="Duplicate" field="champ_id"/>
+ <policy policy="Duplicate" field="champ_date"/>
+ <policy policy="Duplicate" field="champ_datetime"/>
+ <policy policy="Duplicate" field="champ_x"/>
+ <policy policy="Duplicate" field="champ_y"/>
+ <policy policy="Duplicate" field="champ_z"/>
+ <policy policy="Duplicate" field="champ_media"/>
+ <policy policy="Duplicate" field="champ_wkt_2d"/>
+ <policy policy="Duplicate" field="champ_wkt_3d"/>
+ </duplicatePolicies>
+ <defaults>
+ <default applyOnUpdate="0" field="fid" expression=""/>
+ <default applyOnUpdate="1" field="champ_id" expression="concat(now(),'-',CASE&#xa;WHEN maximum(&quot;fid&quot;) is NULL THEN 1&#xa;WHEN &quot;fid&quot; > 1 THEN maximum(&quot;fid&quot;)+1&#xa;ELSE &quot;fid&quot;&#xa;END)"/>
+ <default applyOnUpdate="0" field="champ_date" expression="now()"/>
+ <default applyOnUpdate="0" field="champ_datetime" expression="now()"/>
+ <default applyOnUpdate="1" field="champ_x" expression="x(@geometry)"/>
+ <default applyOnUpdate="1" field="champ_y" expression="y(@geometry)"/>
+ <default applyOnUpdate="1" field="champ_z" expression=" if( z(@geometry) = 0, z(@geometry), 0)"/>
+ <default applyOnUpdate="0" field="champ_media" expression=""/>
+ <default applyOnUpdate="0" field="champ_wkt_2d" expression="geom_to_wkt(@geometry)"/>
+ <default applyOnUpdate="1" field="champ_wkt_3d" expression="replace(geom_to_wkt(@geometry),' 0', ' '||&quot;champ_z&quot;)"/>
+ </defaults>
+ <constraints>
+ <constraint exp_strength="0" notnull_strength="1" constraints="3" unique_strength="1" field="fid"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_id"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_date"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_datetime"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_x"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_y"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_z"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_media"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_wkt_2d"/>
+ <constraint exp_strength="0" notnull_strength="0" constraints="0" unique_strength="0" field="champ_wkt_3d"/>
+ </constraints>
+ <constraintExpressions>
+ <constraint exp="" field="fid" desc=""/>
+ <constraint exp="" field="champ_id" desc=""/>
+ <constraint exp="" field="champ_date" desc=""/>
+ <constraint exp="" field="champ_datetime" desc=""/>
+ <constraint exp="" field="champ_x" desc=""/>
+ <constraint exp="" field="champ_y" desc=""/>
+ <constraint exp="" field="champ_z" desc=""/>
+ <constraint exp="" field="champ_media" desc=""/>
+ <constraint exp="" field="champ_wkt_2d" desc=""/>
+ <constraint exp="" field="champ_wkt_3d" desc=""/>
+ </constraintExpressions>
+ <expressionfields/>
+ <attributeactions>
+ <defaultAction value="{00000000-0000-0000-0000-000000000000}" key="Canvas"/>
+ </attributeactions>
+ <attributetableconfig sortOrder="0" sortExpression="" actionWidgetStyle="dropDown">
+ <columns>
+ <column width="-1" type="field" name="fid" hidden="0"/>
+ <column width="409" type="field" name="champ_id" hidden="0"/>
+ <column width="-1" type="field" name="champ_date" hidden="0"/>
+ <column width="-1" type="field" name="champ_datetime" hidden="0"/>
+ <column width="-1" type="field" name="champ_x" hidden="0"/>
+ <column width="-1" type="field" name="champ_y" hidden="0"/>
+ <column width="-1" type="field" name="champ_z" hidden="0"/>
+ <column width="-1" type="field" name="champ_media" hidden="0"/>
+ <column width="-1" type="field" name="champ_wkt_2d" hidden="0"/>
+ <column width="-1" type="field" name="champ_wkt_3d" hidden="0"/>
+ <column width="-1" type="actions" hidden="1"/>
+ </columns>
+ </attributetableconfig>
+ <conditionalstyles>
+ <rowstyles/>
+ <fieldstyles/>
+ </conditionalstyles>
+ <storedexpressions/>
+ <editform tolerant="1"></editform>
+ <editforminit/>
+ <editforminitcodesource>0</editforminitcodesource>
+ <editforminitfilepath></editforminitfilepath>
+ <editforminitcode><![CDATA[# -*- coding: utf-8 -*-
+"""
+Les formulaires QGIS peuvent avoir une fonction Python qui est appelée lorsque le formulaire est
+ouvert.
+
+Utilisez cette fonction pour ajouter une logique supplémentaire à vos formulaires.
+
+Entrez le nom de la fonction dans le champ
+"Fonction d'initialisation Python".
+Voici un exemple:
+"""
+from qgis.PyQt.QtWidgets import QWidget
+
+def my_form_open(dialog, layer, feature):
+ geom = feature.geometry()
+ control = dialog.findChild(QWidget, "MyLineEdit")
+]]></editforminitcode>
+ <featformsuppress>0</featformsuppress>
+ <editorlayout>generatedlayout</editorlayout>
+ <editable>
+ <field name="champ_date" editable="1"/>
+ <field name="champ_datetime" editable="1"/>
+ <field name="champ_id" editable="1"/>
+ <field name="champ_media" editable="1"/>
+ <field name="champ_wkt" editable="1"/>
+ <field name="champ_wkt_2d" editable="1"/>
+ <field name="champ_wkt_3d" editable="1"/>
+ <field name="champ_x" editable="1"/>
+ <field name="champ_y" editable="1"/>
+ <field name="champ_z" editable="1"/>
+ <field name="fid" editable="1"/>
+ </editable>
+ <labelOnTop>
+ <field name="champ_date" labelOnTop="0"/>
+ <field name="champ_datetime" labelOnTop="0"/>
+ <field name="champ_id" labelOnTop="0"/>
+ <field name="champ_media" labelOnTop="0"/>
+ <field name="champ_wkt" labelOnTop="0"/>
+ <field name="champ_wkt_2d" labelOnTop="0"/>
+ <field name="champ_wkt_3d" labelOnTop="0"/>
+ <field name="champ_x" labelOnTop="0"/>
+ <field name="champ_y" labelOnTop="0"/>
+ <field name="champ_z" labelOnTop="0"/>
+ <field name="fid" labelOnTop="0"/>
+ </labelOnTop>
+ <reuseLastValue>
+ <field reuseLastValue="0" name="champ_date"/>
+ <field reuseLastValue="0" name="champ_datetime"/>
+ <field reuseLastValue="1" name="champ_id"/>
+ <field reuseLastValue="0" name="champ_media"/>
+ <field reuseLastValue="0" name="champ_wkt"/>
+ <field reuseLastValue="0" name="champ_wkt_2d"/>
+ <field reuseLastValue="0" name="champ_wkt_3d"/>
+ <field reuseLastValue="0" name="champ_x"/>
+ <field reuseLastValue="0" name="champ_y"/>
+ <field reuseLastValue="0" name="champ_z"/>
+ <field reuseLastValue="0" name="fid"/>
+ </reuseLastValue>
+ <dataDefinedFieldProperties/>
+ <widgets/>
+ <previewExpression>"champ_id"</previewExpression>
+ <mapTip enabled="1"></mapTip>
+ </maplayer>
+ <maplayer legendPlaceholderImage="" autoRefreshMode="Disabled" maxScale="0" minScale="1e+08" type="raster" autoRefreshTime="0" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" styleCategories="AllStyleCategories" hasScaleBasedVisibilityFlag="0">
+ <extent>
+ <xmin>-20037508.34278924390673637</xmin>
+ <ymin>-20037508.34278924763202667</ymin>
+ <xmax>20037508.34278924390673637</xmax>
+ <ymax>20037508.34278924763202667</ymax>
+ </extent>
+ <wgs84extent>
+ <xmin>-180</xmin>
+ <ymin>-85.05112877980660357</ymin>
+ <xmax>180</xmax>
+ <ymax>85.05112877980660357</ymax>
+ </wgs84extent>
+ <id>OSM_Standard_88a32e94_cd29_412c_8b66_ee44fe338fab</id>
+ <datasource>crs=EPSG:3857&amp;format&amp;type=xyz&amp;url=http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png&amp;zmax=19&amp;zmin=0</datasource>
+ <keywordList>
+ <value></value>
+ </keywordList>
+ <attribution href="https://www.openstreetmap.org/copyright">© OpenStreetMap contributors, CC-BY-SA</attribution>
+ <layername>OSM Standard</layername>
+ <srs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
+ <proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
+ <srsid>3857</srsid>
+ <srid>3857</srid>
+ <authid>EPSG:3857</authid>
+ <description>WGS 84 / Pseudo-Mercator</description>
+ <projectionacronym>merc</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>false</geographicflag>
+ </spatialrefsys>
+ </srs>
+ <resourceMetadata>
+ <identifier>Tuiles OpenStreetMap</identifier>
+ <parentidentifier></parentidentifier>
+ <language></language>
+ <type>dataset</type>
+ <title>Tuiles OpenStreetMap</title>
+ <abstract>OpenStreetMap est construit par une communauté de cartographes qui contribuent et maintiennent des données sur les routes, les sentiers, les cafés, les gares, et bien plus encore, dans le monde entier.</abstract>
+ <links>
+ <link format="" mimeType="" name="Source" type="WWW:LINK" url="https://www.openstreetmap.org/" description="" size=""/>
+ </links>
+ <dates/>
+ <fees></fees>
+ <rights>Fond de carte et données d’OpenStreetMap et de la Fondation OpenStreetMap (CC-BY-SA). © les contributeurs de https://www.openstreetmap.org.</rights>
+ <license>Open Data Commons Open Database License (ODbL)</license>
+ <license>Creative Commons Attribution-ShareAlike (CC-BY-SA)</license>
+ <encoding></encoding>
+ <crs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
+ <proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
+ <srsid>3857</srsid>
+ <srid>3857</srid>
+ <authid>EPSG:3857</authid>
+ <description>WGS 84 / Pseudo-Mercator</description>
+ <projectionacronym>merc</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>false</geographicflag>
+ </spatialrefsys>
+ </crs>
+ <extent>
+ <spatial dimensions="2" maxx="180" minx="-180" crs="EPSG:4326" maxy="85.05112877980660357" miny="-85.05112877980660357" maxz="nan" minz="nan"/>
+ </extent>
+ </resourceMetadata>
+ <provider>wms</provider>
+ <noData>
+ <noDataList bandNo="1" useSrcNoData="0"/>
+ </noData>
+ <map-layer-style-manager current="défaut">
+ <map-layer-style name="défaut"/>
+ </map-layer-style-manager>
+ <metadataUrls/>
+ <flags>
+ <Identifiable>1</Identifiable>
+ <Removable>1</Removable>
+ <Searchable>0</Searchable>
+ <Private>0</Private>
+ </flags>
+ <temporal fetchMode="0" bandNumber="1" enabled="0" mode="0">
+ <fixedRange>
+ <start></start>
+ <end></end>
+ </fixedRange>
+ </temporal>
+ <elevation enabled="0" band="1" mode="RepresentsElevationSurface" symbology="Line" zscale="1" zoffset="0">
+ <data-defined-properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data-defined-properties>
+ <profileLineSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="line" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleLine" enabled="1" id="{12c4ea8e-af4f-47ab-9aa9-58d863f5a27c}">
+ <Option type="Map">
+ <Option value="0" type="QString" name="align_dash_pattern"/>
+ <Option value="square" type="QString" name="capstyle"/>
+ <Option value="5;2" type="QString" name="customdash"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="customdash_map_unit_scale"/>
+ <Option value="MM" type="QString" name="customdash_unit"/>
+ <Option value="0" type="QString" name="dash_pattern_offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="dash_pattern_offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="dash_pattern_offset_unit"/>
+ <Option value="0" type="QString" name="draw_inside_polygon"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="125,139,143,255,rgb:0.49019607843137253,0.54509803921568623,0.5607843137254902,1" type="QString" name="line_color"/>
+ <Option value="solid" type="QString" name="line_style"/>
+ <Option value="0.6" type="QString" name="line_width"/>
+ <Option value="MM" type="QString" name="line_width_unit"/>
+ <Option value="0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="0" type="QString" name="ring_filter"/>
+ <Option value="0" type="QString" name="trim_distance_end"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="trim_distance_end_map_unit_scale"/>
+ <Option value="MM" type="QString" name="trim_distance_end_unit"/>
+ <Option value="0" type="QString" name="trim_distance_start"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="trim_distance_start_map_unit_scale"/>
+ <Option value="MM" type="QString" name="trim_distance_start_unit"/>
+ <Option value="0" type="QString" name="tweak_dash_pattern_on_corners"/>
+ <Option value="0" type="QString" name="use_custom_dash"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="width_map_unit_scale"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileLineSymbol>
+ <profileFillSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="fill" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleFill" enabled="1" id="{3347962e-73d6-4857-bee9-bb9c3f9d99f8}">
+ <Option type="Map">
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
+ <Option value="125,139,143,255,rgb:0.49019607843137253,0.54509803921568623,0.5607843137254902,1" type="QString" name="color"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="0,0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" type="QString" name="outline_color"/>
+ <Option value="no" type="QString" name="outline_style"/>
+ <Option value="0.26" type="QString" name="outline_width"/>
+ <Option value="MM" type="QString" name="outline_width_unit"/>
+ <Option value="solid" type="QString" name="style"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileFillSymbol>
+ </elevation>
+ <customproperties>
+ <Option type="Map">
+ <Option value="no_action" type="QString" name="QFieldSync/action"/>
+ <Option value="{}" type="QString" name="QFieldSync/attachment_naming"/>
+ <Option value="no_action" type="QString" name="QFieldSync/cloud_action"/>
+ <Option type="invalid" name="QFieldSync/geometry_locked_expression"/>
+ <Option value="{}" type="QString" name="QFieldSync/photo_naming"/>
+ <Option value="{}" type="QString" name="QFieldSync/relationship_maximum_visible"/>
+ <Option value="OSM_Standard_88a32e94_cd29_412c_8b66_ee44fe338fab" type="QString" name="QFieldSync/remoteLayerId"/>
+ <Option value="30" type="int" name="QFieldSync/tracking_distance_requirement_minimum_meters"/>
+ <Option value="false" type="bool" name="QFieldSync/tracking_erroneous_distance_safeguard_maximum_meters"/>
+ <Option value="0" type="int" name="QFieldSync/tracking_measurement_type"/>
+ <Option value="30" type="int" name="QFieldSync/tracking_time_requirement_interval_seconds"/>
+ <Option value="0" type="int" name="QFieldSync/value_map_button_interface_threshold"/>
+ <Option value="Undefined" type="QString" name="identify/format"/>
+ </Option>
+ </customproperties>
+ <mapTip enabled="1"></mapTip>
+ <pipe-data-defined-properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </pipe-data-defined-properties>
+ <pipe>
+ <provider>
+ <resampling zoomedInResamplingMethod="nearestNeighbour" zoomedOutResamplingMethod="nearestNeighbour" enabled="false" maxOversampling="2"/>
+ </provider>
+ <rasterrenderer opacity="1" alphaBand="-1" nodataColor="" type="singlebandcolordata" band="1">
+ <rasterTransparency/>
+ <minMaxOrigin>
+ <limits>None</limits>
+ <extent>WholeRaster</extent>
+ <statAccuracy>Estimated</statAccuracy>
+ <cumulativeCutLower>0.02</cumulativeCutLower>
+ <cumulativeCutUpper>0.98</cumulativeCutUpper>
+ <stdDevFactor>2</stdDevFactor>
+ </minMaxOrigin>
+ </rasterrenderer>
+ <brightnesscontrast brightness="0" contrast="0" gamma="1"/>
+ <huesaturation colorizeGreen="128" grayscaleMode="0" colorizeBlue="128" invertColors="0" colorizeOn="0" saturation="0" colorizeRed="255" colorizeStrength="100"/>
+ <rasterresampler maxOversampling="2"/>
+ <resamplingStage>resamplingFilter</resamplingStage>
+ </pipe>
+ <blendMode>0</blendMode>
+ </maplayer>
+ <maplayer legendPlaceholderImage="" autoRefreshMode="Disabled" maxScale="0" minScale="1e+08" type="raster" autoRefreshTime="0" refreshOnNotifyMessage="" refreshOnNotifyEnabled="0" styleCategories="AllStyleCategories" hasScaleBasedVisibilityFlag="0">
+ <extent>
+ <xmin>-20037508.34278924390673637</xmin>
+ <ymin>-15538711.09630922041833401</ymin>
+ <xmax>20037508.34278924390673637</xmax>
+ <ymax>15538711.09630922041833401</ymax>
+ </extent>
+ <wgs84extent>
+ <xmin>-180</xmin>
+ <ymin>-80</ymin>
+ <xmax>180</xmax>
+ <ymax>80</ymax>
+ </wgs84extent>
+ <id>Ortho_20_cm_f8497a68_e819_4170_a2ce_17cc699ac2d2</id>
+ <datasource>crs=EPSG:3857&amp;dpiMode=7&amp;featureCount=10&amp;format=image/jpeg&amp;layers=HR.ORTHOIMAGERY.ORTHOPHOTOS&amp;styles=normal&amp;tileMatrixSet=PM_6_19&amp;tilePixelRatio=0&amp;url=https://data.geopf.fr/wmts?SERVICE%3DWMTS%26VERSION%3D1.0.0%26REQUEST%3DGetCapabilities</datasource>
+ <keywordList>
+ <value></value>
+ </keywordList>
+ <layername>Ortho 20 cm</layername>
+ <srs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
+ <proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
+ <srsid>3857</srsid>
+ <srid>3857</srid>
+ <authid>EPSG:3857</authid>
+ <description>WGS 84 / Pseudo-Mercator</description>
+ <projectionacronym>merc</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>false</geographicflag>
+ </spatialrefsys>
+ </srs>
+ <resourceMetadata>
+ <identifier></identifier>
+ <parentidentifier></parentidentifier>
+ <language></language>
+ <type></type>
+ <title></title>
+ <abstract></abstract>
+ <links/>
+ <dates/>
+ <fees></fees>
+ <encoding></encoding>
+ <crs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt></wkt>
+ <proj4></proj4>
+ <srsid>0</srsid>
+ <srid>0</srid>
+ <authid></authid>
+ <description></description>
+ <projectionacronym></projectionacronym>
+ <ellipsoidacronym></ellipsoidacronym>
+ <geographicflag>false</geographicflag>
+ </spatialrefsys>
+ </crs>
+ <extent/>
+ </resourceMetadata>
+ <provider>wms</provider>
+ <noData>
+ <noDataList bandNo="1" useSrcNoData="0"/>
+ </noData>
+ <map-layer-style-manager current="défaut">
+ <map-layer-style name="défaut"/>
+ </map-layer-style-manager>
+ <metadataUrls/>
+ <flags>
+ <Identifiable>1</Identifiable>
+ <Removable>1</Removable>
+ <Searchable>1</Searchable>
+ <Private>0</Private>
+ </flags>
+ <temporal fetchMode="0" bandNumber="1" enabled="0" mode="0">
+ <fixedRange>
+ <start></start>
+ <end></end>
+ </fixedRange>
+ </temporal>
+ <elevation enabled="0" band="1" mode="RepresentsElevationSurface" symbology="Line" zscale="1" zoffset="0">
+ <data-defined-properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data-defined-properties>
+ <profileLineSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="line" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleLine" enabled="1" id="{0fe4e027-8b1d-488b-b613-919bf0e4043c}">
+ <Option type="Map">
+ <Option value="0" type="QString" name="align_dash_pattern"/>
+ <Option value="square" type="QString" name="capstyle"/>
+ <Option value="5;2" type="QString" name="customdash"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="customdash_map_unit_scale"/>
+ <Option value="MM" type="QString" name="customdash_unit"/>
+ <Option value="0" type="QString" name="dash_pattern_offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="dash_pattern_offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="dash_pattern_offset_unit"/>
+ <Option value="0" type="QString" name="draw_inside_polygon"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="145,82,45,255,rgb:0.56862745098039214,0.32156862745098042,0.17647058823529413,1" type="QString" name="line_color"/>
+ <Option value="solid" type="QString" name="line_style"/>
+ <Option value="0.6" type="QString" name="line_width"/>
+ <Option value="MM" type="QString" name="line_width_unit"/>
+ <Option value="0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="0" type="QString" name="ring_filter"/>
+ <Option value="0" type="QString" name="trim_distance_end"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="trim_distance_end_map_unit_scale"/>
+ <Option value="MM" type="QString" name="trim_distance_end_unit"/>
+ <Option value="0" type="QString" name="trim_distance_start"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="trim_distance_start_map_unit_scale"/>
+ <Option value="MM" type="QString" name="trim_distance_start_unit"/>
+ <Option value="0" type="QString" name="tweak_dash_pattern_on_corners"/>
+ <Option value="0" type="QString" name="use_custom_dash"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="width_map_unit_scale"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileLineSymbol>
+ <profileFillSymbol>
+ <symbol force_rhr="0" clip_to_extent="1" alpha="1" type="fill" name="" is_animated="0" frame_rate="10">
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ <layer locked="0" pass="0" class="SimpleFill" enabled="1" id="{0b36c597-d1e6-4109-9408-50bf7acc0149}">
+ <Option type="Map">
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
+ <Option value="145,82,45,255,rgb:0.56862745098039214,0.32156862745098042,0.17647058823529413,1" type="QString" name="color"/>
+ <Option value="bevel" type="QString" name="joinstyle"/>
+ <Option value="0,0" type="QString" name="offset"/>
+ <Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
+ <Option value="MM" type="QString" name="offset_unit"/>
+ <Option value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" type="QString" name="outline_color"/>
+ <Option value="no" type="QString" name="outline_style"/>
+ <Option value="0.26" type="QString" name="outline_width"/>
+ <Option value="MM" type="QString" name="outline_width_unit"/>
+ <Option value="solid" type="QString" name="style"/>
+ </Option>
+ <data_defined_properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </data_defined_properties>
+ </layer>
+ </symbol>
+ </profileFillSymbol>
+ </elevation>
+ <customproperties>
+ <Option type="Map">
+ <Option value="Ortho_20_cm_f8497a68_e819_4170_a2ce_17cc699ac2d2" type="QString" name="QFieldSync/remoteLayerId"/>
+ <Option value="Html" type="QString" name="identify/format"/>
+ </Option>
+ </customproperties>
+ <mapTip enabled="1"></mapTip>
+ <pipe-data-defined-properties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </pipe-data-defined-properties>
+ <pipe>
+ <provider>
+ <resampling zoomedInResamplingMethod="nearestNeighbour" zoomedOutResamplingMethod="nearestNeighbour" enabled="false" maxOversampling="2"/>
+ </provider>
+ <rasterrenderer opacity="1" alphaBand="-1" nodataColor="" type="singlebandcolordata" band="1">
+ <rasterTransparency/>
+ <minMaxOrigin>
+ <limits>None</limits>
+ <extent>WholeRaster</extent>
+ <statAccuracy>Estimated</statAccuracy>
+ <cumulativeCutLower>0.02</cumulativeCutLower>
+ <cumulativeCutUpper>0.98</cumulativeCutUpper>
+ <stdDevFactor>2</stdDevFactor>
+ </minMaxOrigin>
+ </rasterrenderer>
+ <brightnesscontrast brightness="0" contrast="0" gamma="1"/>
+ <huesaturation colorizeGreen="128" grayscaleMode="0" colorizeBlue="128" invertColors="0" colorizeOn="0" saturation="0" colorizeRed="255" colorizeStrength="100"/>
+ <rasterresampler maxOversampling="2"/>
+ <resamplingStage>resamplingFilter</resamplingStage>
+ </pipe>
+ <blendMode>0</blendMode>
+ </maplayer>
+ </projectlayers>
+ <layerorder>
+ <layer id="Finds_7595ca92_4128_456d_a700_416cedf9aaa4"/>
+ <layer id="OSM_Standard_88a32e94_cd29_412c_8b66_ee44fe338fab"/>
+ <layer id="Ortho_20_cm_f8497a68_e819_4170_a2ce_17cc699ac2d2"/>
+ </layerorder>
+ <labelEngineSettings/>
+ <properties>
+ <Digitizing>
+ <AvoidIntersectionsMode type="int">0</AvoidIntersectionsMode>
+ </Digitizing>
+ <Gui>
+ <CanvasColorBluePart type="int">255</CanvasColorBluePart>
+ <CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
+ <CanvasColorRedPart type="int">255</CanvasColorRedPart>
+ <SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
+ <SelectionColorBluePart type="int">0</SelectionColorBluePart>
+ <SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
+ <SelectionColorRedPart type="int">255</SelectionColorRedPart>
+ </Gui>
+ <Legend>
+ <filterByMap type="bool">false</filterByMap>
+ </Legend>
+ <Measure>
+ <Ellipsoid type="QString">EPSG:7030</Ellipsoid>
+ </Measure>
+ <Measurement>
+ <AreaUnits type="QString">m2</AreaUnits>
+ <DistanceUnits type="QString">meters</DistanceUnits>
+ </Measurement>
+ <PAL>
+ <CandidatesLinePerCM type="double">5</CandidatesLinePerCM>
+ <CandidatesPolygonPerCM type="double">2.5</CandidatesPolygonPerCM>
+ <DrawLabelMetrics type="bool">false</DrawLabelMetrics>
+ <DrawRectOnly type="bool">false</DrawRectOnly>
+ <DrawUnplaced type="bool">false</DrawUnplaced>
+ <PlacementEngineVersion type="int">1</PlacementEngineVersion>
+ <SearchMethod type="int">0</SearchMethod>
+ <ShowingAllLabels type="bool">false</ShowingAllLabels>
+ <ShowingCandidates type="bool">false</ShowingCandidates>
+ <ShowingPartialsLabels type="bool">true</ShowingPartialsLabels>
+ <TextFormat type="int">0</TextFormat>
+ <UnplacedColor type="QString">255,0,0,255,rgb:1,0,0,1</UnplacedColor>
+ </PAL>
+ <Paths>
+ <Absolute type="bool">false</Absolute>
+ </Paths>
+ <PositionPrecision>
+ <Automatic type="bool">true</Automatic>
+ <DecimalPlaces type="int">2</DecimalPlaces>
+ </PositionPrecision>
+ <QFieldSync>
+ <dirsToCopy type="QString">{}</dirsToCopy>
+ <exportDirectoryProject type="QString">/home/thomas/StageM2/ishtar/ishtar_common/qfield/model</exportDirectoryProject>
+ </QFieldSync>
+ <SpatialRefSys>
+ <ProjectionsEnabled type="int">1</ProjectionsEnabled>
+ </SpatialRefSys>
+ <qfieldsync>
+ <originalProjectPath type="QString">.</originalProjectPath>
+ </qfieldsync>
+ </properties>
+ <dataDefinedServerProperties>
+ <Option type="Map">
+ <Option value="" type="QString" name="name"/>
+ <Option name="properties"/>
+ <Option value="collection" type="QString" name="type"/>
+ </Option>
+ </dataDefinedServerProperties>
+ <visibility-presets/>
+ <transformContext/>
+ <projectMetadata>
+ <identifier></identifier>
+ <parentidentifier></parentidentifier>
+ <language></language>
+ <type></type>
+ <title></title>
+ <abstract></abstract>
+ <links/>
+ <dates>
+ <date value="2025-04-29T16:38:23" type="Created"/>
+ </dates>
+ <author>Thomas ANDRE</author>
+ <creation>2025-04-29T16:38:23</creation>
+ </projectMetadata>
+ <Annotations/>
+ <Layouts/>
+ <mapViewDocks3D/>
+ <Bookmarks/>
+ <Sensors/>
+ <ProjectViewSettings rotation="0" UseProjectScales="0">
+ <Scales/>
+ <DefaultViewExtent xmax="8.19138905262862771" ymin="41.87702493936143355" xmin="-4.83189219737137599" ymax="51.69150133263761404">
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </DefaultViewExtent>
+ </ProjectViewSettings>
+ <ProjectStyleSettings projectStyleId="attachment:///Rpvzry_styles.db" colorModel="Rgb" iccProfileId="attachment:///QGIS3-wynsgg" DefaultSymbolOpacity="1" RandomizeDefaultSymbolColor="1">
+ <databases/>
+ </ProjectStyleSettings>
+ <ProjectTimeSettings timeStepUnit="h" timeStep="1" cumulativeTemporalRange="0" totalMovieFrames="100" frameRate="1"/>
+ <ElevationProperties FilterInvertSlider="0">
+ <terrainProvider type="flat">
+ <TerrainProvider offset="0" scale="1"/>
+ </terrainProvider>
+ </ElevationProperties>
+ <ProjectDisplaySettings CoordinateType="MapCrs" CoordinateAxisOrder="Default">
+ <BearingFormat id="bearing">
+ <Option type="Map">
+ <Option type="invalid" name="decimal_separator"/>
+ <Option value="6" type="int" name="decimals"/>
+ <Option value="0" type="int" name="direction_format"/>
+ <Option value="0" type="int" name="rounding_type"/>
+ <Option value="false" type="bool" name="show_plus"/>
+ <Option value="true" type="bool" name="show_thousand_separator"/>
+ <Option value="false" type="bool" name="show_trailing_zeros"/>
+ <Option type="invalid" name="thousand_separator"/>
+ </Option>
+ </BearingFormat>
+ <GeographicCoordinateFormat id="geographiccoordinate">
+ <Option type="Map">
+ <Option value="DecimalDegrees" type="QString" name="angle_format"/>
+ <Option type="invalid" name="decimal_separator"/>
+ <Option value="6" type="int" name="decimals"/>
+ <Option value="0" type="int" name="rounding_type"/>
+ <Option value="false" type="bool" name="show_leading_degree_zeros"/>
+ <Option value="false" type="bool" name="show_leading_zeros"/>
+ <Option value="false" type="bool" name="show_plus"/>
+ <Option value="false" type="bool" name="show_suffix"/>
+ <Option value="true" type="bool" name="show_thousand_separator"/>
+ <Option value="false" type="bool" name="show_trailing_zeros"/>
+ <Option type="invalid" name="thousand_separator"/>
+ </Option>
+ </GeographicCoordinateFormat>
+ <CoordinateCustomCrs>
+ <spatialrefsys nativeFormat="Wkt">
+ <wkt>GEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],CS[ellipsoidal,2],AXIS["geodetic latitude (Lat)",north,ORDER[1],ANGLEUNIT["degree",0.0174532925199433]],AXIS["geodetic longitude (Lon)",east,ORDER[2],ANGLEUNIT["degree",0.0174532925199433]],USAGE[SCOPE["Horizontal component of 3D system."],AREA["World."],BBOX[-90,-180,90,180]],ID["EPSG",4326]]</wkt>
+ <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
+ <srsid>3452</srsid>
+ <srid>4326</srid>
+ <authid>EPSG:4326</authid>
+ <description>WGS 84</description>
+ <projectionacronym>longlat</projectionacronym>
+ <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
+ <geographicflag>true</geographicflag>
+ </spatialrefsys>
+ </CoordinateCustomCrs>
+ </ProjectDisplaySettings>
+ <ProjectGpsSettings destinationFollowsActiveLayer="1" autoAddTrackVertices="0" autoCommitFeatures="0" destinationLayer="">
+ <timeStampFields/>
+ </ProjectGpsSettings>
+</qgis>
diff --git a/ishtar_common/qfield/model/Prospections_attachments.zip b/ishtar_common/qfield/model/Prospections_attachments.zip
new file mode 100644
index 000000000..3932d291c
--- /dev/null
+++ b/ishtar_common/qfield/model/Prospections_attachments.zip
Binary files differ
diff --git a/ishtar_common/qfield/model/Prospections_qfield.zip b/ishtar_common/qfield/model/Prospections_qfield.zip
new file mode 100644
index 000000000..ee82cc69e
--- /dev/null
+++ b/ishtar_common/qfield/model/Prospections_qfield.zip
Binary files differ
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index d14c861bd..fd56b1a83 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -29,7 +29,8 @@ from time import time
import zipfile
from io import StringIO
from unittest.runner import TextTestRunner, TextTestResult
-
+from osgeo import ogr, osr
+from zipfile import ZipFile
from django.apps import apps
@@ -2773,6 +2774,118 @@ class BaseImportTest(TestCase):
return impt
+ def test_verify_qfield_folder(self):
+ """
+ :function: Verify if all folders necessary for QField are here
+ """
+ # Definition of the path to test importer data for GIS data
+ root = os.path.join(settings.LIB_BASE_PATH, "ishtar_common")
+ folder = os.path.join(root, "qfield", "model")
+ dir_list = os.listdir(folder)
+ try:
+ self.assertEqual(len(dir_list), 4)
+ self.assertEqual(dir_list,['Finds.gpkg', 'Prospections_attachments.zip', 'Prospections_qfield.zip', 'Prospections.qgs'])
+ except:
+ self.assertEqual(len(dir_list), 5)
+ self.assertEqual(dir_list,['Finds.gpkg', 'Prospections_attachments.zip', 'Prospections.qgs~', 'Prospections_qfield.zip', 'Prospections.qgs'])
+ with ZipFile(os.path.join(folder, "Prospections_qfield.zip"), 'r') as zip_file:
+ # Verification of the number of files in the .zip
+ self.assertEqual(len(zip_file.namelist()),1)
+ # Verification of the names of the files in the .zip
+ list_files = ["Prospections_attachments.zip"]
+ self.assertEqual(zip_file.namelist(), list_files)
+ # Closing of the .zip
+ zip_file.close()
+
+
+ def test_modification_xml(self):
+ """
+ :function: Test to modify the content of a style file for QGIS
+ """
+ # Definition of the path to test importer data for GIS data
+ root = os.path.join(settings.LIB_BASE_PATH, "ishtar_common")
+ filename = os.path.join(root, "qfield", "model", "Prospections.qgs")
+ new_file = os.path.join(root, "qfield", "model", "Test.qgs")
+ with open(filename, 'r', encoding ='utf-8') as file:
+ style = file.read()
+ modifications = style.replace('champ_','test_modif_')
+ with open(new_file, 'w', encoding ='utf-8') as file:
+ file.write(modifications)
+ with open(new_file, 'r', encoding='utf-8') as file:
+ style = file.read()
+ bool = 'test_modif_' in style
+ self.assertEqual(bool, True)
+ bool = 'champ_' in style
+ self.assertEqual(bool, False)
+ os.remove(new_file)
+
+
+ def test_export_qfield(self):
+ # Verification of the original files
+ self.test_verify_qfield_folder()
+ # Preparation for the .gpkg
+ driver = ogr.GetDriverByName("GPKG")
+ root = settings.LIB_BASE_PATH + "ishtar_common/qfield/"
+ filename = os.path.join(root, "export", "Finds.gpkg")
+ # Verification to delete it if already existing
+ if os.path.exists(filename):
+ os.remove(filename)
+ datasource = driver.CreateDataSource(filename)
+ srs = osr.SpatialReference()
+ srs.ImportFromEPSG(4326)
+ # Preparation for the copy of the .qgs
+ qgs_path = os.path.join(root, "model", "Prospections.qgs")
+ new_qgs = os.path.join(root, "export", "Prospections.qgs")
+ # Preparation for the copy of the .zip
+ project = os.path.join(root, "model", "Prospections_qfield.zip")
+ duplicate = os.path.join(root, "export", "Prospections_qfield_export.zip")
+ # Verification to delete it if already existing
+ if os.path.exists(duplicate):
+ os.remove(duplicate)
+ shutil.copyfile(project, duplicate)
+ layer = datasource.CreateLayer("Finds", srs, ogr.wkbPoint)
+ list = ["x", "y", "z"]
+ for elem in list:
+ layer.CreateField(ogr.FieldDefn(elem, ogr.OFTReal))
+ feature = ogr.Feature(layer.GetLayerDefn())
+ for elem in list:
+ feature.SetField(elem, 14.0)
+ layer.CreateFeature(feature)
+ feature = None
+ datasource = None
+ # Verification of the modifications
+ text = open(qgs_path, encoding='utf-8').read()
+ for elem in list:
+ text = text.replace(f"champ_{elem}", elem)
+ with open(new_qgs, 'w', encoding='utf-8') as file:
+ file.write(text)
+ # Creation of the new .zip
+ with ZipFile(duplicate, 'a') as zip_file:
+ zip_file.write(filename, os.path.basename(filename))
+ zip_file.write(new_qgs, os.path.basename(new_qgs))
+ zip_file.close()
+ # Verification of the content of the .zip
+ folder = os.path.join(root, "export")
+ dir_list = os.listdir(folder)
+ self.assertEqual(len(dir_list), 3)
+ self.assertEqual(dir_list, ['Finds.gpkg', 'Prospections_qfield_export.zip','Prospections.qgs'])
+ with open(new_qgs, 'r', encoding='utf-8') as file:
+ style = file.read()
+ for elem in list:
+ bool = f'"{elem}"' in style
+ self.assertEqual(bool, True)
+ bool = f'champ_{elem}' in style
+ self.assertEqual(bool, False)
+ with ZipFile(os.path.join(folder, "Prospections_qfield_export.zip"), 'r') as zip_file:
+ self.assertEqual(len(zip_file.namelist()),3)
+ list_files = ["Prospections_attachments.zip", "Finds.gpkg", "Prospections.qgs"]
+ self.assertEqual(zip_file.namelist(), list_files)
+ zip_file.close()
+ os.remove(filename)
+ os.remove(new_qgs)
+ os.remove(duplicate)
+
+
class ImportTestInterface(BaseImportTest):
def setUp(self):
diff --git a/ishtar_common/tests/Finds.gpkg b/ishtar_common/tests/Finds.gpkg
deleted file mode 100644
index 5000f2234..000000000
--- a/ishtar_common/tests/Finds.gpkg
+++ /dev/null
Binary files differ
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index a2c041030..a6010dfa6 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -870,9 +870,13 @@ def get_by_importer(
importer = q.all()[0]
importer_class = importer.get_importer_class()
cols, col_names = importer.get_columns(importer_class=importer_class)
+ if importer.export_format:
+ data_type = importer.export_format
+ dct["type"] = importer.export_format
+ print(data_type)
+ print(dct)
if data_type == "csv" or dct.get("type", "") == "csv":
obj_name = importer.name
- print(obj_name)
elif data_type == "gpkg" or dct.get("type", "") == "gpkg":
obj_name = importer.name
else:
diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py
index 4126219fd..bd8780ea9 100644
--- a/ishtar_common/views_item.py
+++ b/ishtar_common/views_item.py
@@ -32,6 +32,7 @@ import subprocess # nosec
from tempfile import NamedTemporaryFile
from osgeo import ogr, osr
import shutil
+from zipfile import ZipFile
from django.apps import apps
from django.conf import settings
@@ -2374,7 +2375,7 @@ def get_item(
EMPTY = "[]"
if not return_query and data_type not in (
- "json", "csv", "json-image", "json-map", "json-stats"):
+ "json", "csv", "json-image", "json-map", "json-stats", "gpkg"):
return HttpResponse(EMPTY, content_type="text/plain")
if data_type == "json-stats" and len(model.STATISTIC_MODALITIES) < 2:
@@ -2991,7 +2992,7 @@ def get_item(
items, query_table_cols, my_extra_request_keys,
geo_fields=geo_fields
)
- elif data_type != "csv" and getattr(model, "NEW_QUERY_ENGINE", False):
+ elif data_type not in ["csv", "gpkg"] and getattr(model, "NEW_QUERY_ENGINE", False):
datas = _get_data_from_query(items, query_table_cols, my_extra_request_keys)
else:
datas = _get_data_from_query_old(
@@ -3218,22 +3219,40 @@ def get_item(
except UnicodeEncodeError:
vals.append(unidecode(v).encode(ENCODING).decode(ENCODING))
writer.writerow(vals)
- #return response
+ return response
elif data_type == "gpkg":
# Work in progress
- # Creation of the .gpkg
+ # I. Preparations
driver = ogr.GetDriverByName("GPKG")
- root = settings.LIB_BASE_PATH + "ishtar_common/tests/"
- filename = os.path.join(root, "Finds.gpkg")
+ root = settings.LIB_BASE_PATH + "ishtar_common/qfield/"
+ # 1) Creation of the .gpkg
+ filename = os.path.join(root, "export", "Finds.gpkg")
# Verification to delete it if already existing
if os.path.exists(filename):
os.remove(filename)
datasource = driver.CreateDataSource(filename)
srs = osr.SpatialReference()
srs.ImportFromEPSG(4326)
- # Layer creation
- layer = datasource.CreateLayer("Finds", srs, ogr.wkbPoint)
- # Getting all the column names (copy from below)
+ # 2) Preparations for the modification of the style in the .qgs file
+ qgs_path = os.path.join(root, "model", "Prospections.qgs")
+ new_qgs = os.path.join(root, "export", "Prospections.qgs")
+ if os.path.exists(new_qgs):
+ os.remove(new_qgs)
+ # 3) Duplication of the .zip for export
+ project = os.path.join(root, "model", "Prospections_qfield.zip")
+ duplicate = os.path.join(root, "export", "Prospections_qfield_export.zip")
+ if os.path.exists(duplicate):
+ os.remove(duplicate)
+ shutil.copyfile(project, duplicate)
+ # II. Populating of the .gpkg
+ # 1) Layer creation with verification of the type of geometry to create
+ if "base_finds__point_2d" in table_cols:
+ layer = datasource.CreateLayer("Finds", srs, ogr.wkbPoint)
+ elif any(elem in table_cols for elem in ["base_finds__point_3d", "_z"]):
+ layer = datasource.CreateLayer("Finds", srs, ogr.wkbPoint25D)
+ else:
+ layer = datasource.CreateLayer("Finds", srs, ogr.wkbPolygon)
+ # 2) Getting all the column names (copy from below)
if col_names:
col_names = [name for name in col_names]
else:
@@ -3258,44 +3277,101 @@ def get_item(
)
continue
col_names.append(str(field.verbose_name))
- # Creation of the columns
- for name in col_names:
- layer.CreateField(ogr.FieldDefn(name, ogr.OFTString))
+ # 3) Creation of the attributes
+ print("II.3)")
+ for idx in range(0, len(col_names)):
+ if any(elem in table_cols[idx] for elem in ["index", "order", "quantity", "taq", "tpq", "year"]):
+ layer.CreateField(ogr.FieldDefn(col_names[idx], ogr.OFTInteger64))
+ elif any(elem in table_cols[idx] for elem in ["_x", "_y", "_z", "circumference", "cost", "depth", "diameter", "height", "length", "number", "surface", "side", "thickness", "value", "volume", "weight", "width"]):
+ layer.CreateField(ogr.FieldDefn(col_names[idx], ogr.OFTReal))
+ elif "_date" in table_cols[idx]:
+ layer.CreateField(ogr.FieldDefn(col_names[idx], ogr.OFTDate))
+ elif "_datetime" in table_cols[idx]:
+ layer.CreateField(ogr.FieldDefn(col_names[idx], ogr.OFTDateTime))
+ elif any(elem in table_cols[idx] for elem in ["large_area_prescription", "is_complete", "executed"]):
+ layer.CreateField(ogr.FieldDefn(col_names[idx], ogr.OFTBinary))
+ else:
+ layer.CreateField(ogr.FieldDefn(col_names[idx], ogr.OFTString))
+ idx += 1
max = len(col_names)
- # Looping on all the datas extracted
+ # Looping on all the datas extracted to create features
for data in datas:
# Creation of a new feature
feature = ogr.Feature(layer.GetLayerDefn())
+ # Preparations for the geometry
+ point = ""
+ geom_x = ""
+ geom_y = ""
+ geom_z = ""
# Looping on the attributes to add them to the feature
- for n in range (0, max) :
- # +1 because the first value in the attributes is ''
- m = n + 1
- feature.SetField(col_names[n], str(data[m]))
- # First version to create the geometry of the feature
- # Work in progress
- if "x" in col_names[n] or "X" in col_names[n]:
- try:
- float(data[m])
- geom_x = data[m]
- except:
- pass
- if "y" in col_names[n] or "Y" in col_names[n]:
+ for idx in range (0, max) :
+ # 4) Completion of the attributes
+ if any(elem == table_cols[idx] for elem in ["_date", "_datetime"]):
+ # Preparations for specific values for the date and date_time
try:
- float(data[m])
- geom_y = data[m]
+ # First version if it has all the data necessary for an ogr.OFTDateTime
+ # +1 because the first value in the attributes is ''
+ feature.SetField(col_names[idx], data[idx + 1])
except:
- pass
- try:
- point = ogr.Geometry(ogr.wkbPoint)
- point.AddPoint(float(geom_x), float(geom_y))
- feature.SetGeometry(point)
- layer.CreateFeature(feature)
- except:
- pass
+ # Second version if some values are missing
+ # +1 because the first value in the attributes is ''
+ feature.SetField(col_names[idx], data[idx + 1].year, data[idx + 1].month, data[idx + 1].day, 0, 0, 0)
+ else:
+ # +1 because the first value in the attributes is ''
+ feature.SetField(col_names[idx], str(data[idx + 1]))
+ # 5) Gestion of the geometry
+ if any(elem in table_cols for elem in ["base_finds__point_2d", "base_finds__point_3d", "_line", "_points", "_polygon"]):
+ if table_cols[idx] in ["base_finds__point_2d", "base_finds__point_3d", "_line", "_points", "_polygon"]:
+ try:
+ point = ogr.CreateGeometryFromWkt(data[idx + 1].split(";")[1])
+ except:
+ pass
+ else:
+ if "base_finds__x" and "base_finds__y" in table_cols:
+ if table_cols[idx] == "base_finds__x":
+ geom_x = data[idx + 1]
+ elif table_cols[idx] == "base_finds__y":
+ geom_y = data[idx + 1]
+ if "base_finds__z" in table_cols:
+ if table_cols[idx] == "base_finds__z":
+ geom_z = data[idx + 1]
+ # Prevent problems when both x,y and geometry are present
+ if point == "" and geom_x != "" and geom_y != "":
+ if geom_z != "":
+ point = ogr.Geometry(ogr.wkbPoint25D)
+ point.AddPoint(float(geom_x), float(geom_y), float(geom_z))
+ else:
+ point = ogr.Geometry(ogr.wkbPoint)
+ point.AddPoint(float(geom_x), float(geom_y))
+ if point != "":
+ feature.SetGeometry(point)
+ layer.CreateFeature(feature)
feature = None
datasource = None
- # Missing : Part where the new .gpkg is moved to a copy of the QField folder
- # Work in progress
+ # 6) Modification of the style
+ list_ref = ["champ_id", "champ_date", "champ_datetime", "champ_x", "champ_y", "champ_z", "champ_media", "champ_wkt_2d", "champ_wkt_3d"]
+ list_search = ["label", "_date", "_datetime", "base_finds__x", "base_finds__y", "base_finds__z", "_image", "__point_2d", "__point_2d"]
+ text = open(qgs_path, encoding='utf-8').read()
+ for elem in list_search:
+ for col in table_cols:
+ if elem in col:
+ id_old = list_search.index(elem)
+ id_new = table_cols.index(col)
+ text = text.replace(list_ref[id_old], col_names[id_new])
+ else:
+ pass
+ with open(new_qgs, 'w', encoding='utf-8') as file:
+ file.write(text)
+ # III. Moving the .gpkg in a copy of the Qfield test project
+ with ZipFile(duplicate, 'a') as zip_file:
+ # Adding the .gpkg to the .zip
+ zip_file.write(filename, os.path.basename(filename))
+ zip_file.write(new_qgs, os.path.basename(new_qgs))
+ # Closing of the .zip
+ zip_file.close()
+ response = HttpResponse(open(duplicate, 'rb'), content_type='application/zip')
+ response['Content-Disposition'] = 'attachment; filename="Qfield_prospections.zip"'
+ return response
return HttpResponse("{}", content_type="text/plain")
return func