From c2d04dc827ea71031eb231a1950faaa6c63ceaa8 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期五, 05 一月 2024 11:28:55 +0800 Subject: [PATCH] 修改ignore --- /dev/null | 48 ------------------------------------------------ .gitignore | 1 + 2 files changed, 1 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index b4d64b7..9f498b8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /MoonExp/Sources/Moon.qgz /MoonExp/Sources/Moon.qpt /MoonExp/Sources/MoonExp.py +/ExportMap/Sources/bak diff --git a/ExportMap/Sources/bak/Layout.qpt b/ExportMap/Sources/bak/Layout.qpt deleted file mode 100644 index 561ba53..0000000 --- a/ExportMap/Sources/bak/Layout.qpt +++ /dev/null @@ -1,558 +0,0 @@ -<Layout printResolution="300" name="TestLayout" worldFileMap="{95fd7a40-049b-4350-9f5a-6e3acdce4327}" units="mm"> - <Snapper snapToGuides="1" snapToGrid="1" tolerance="5" snapToItems="1"/> - <Grid offsetY="0" resUnits="mm" resolution="10" offsetUnits="mm" offsetX="0"/> - <PageCollection> - <symbol force_rhr="0" alpha="1" type="fill" clip_to_extent="1" name=""> - <layer class="SimpleFill" enabled="1" pass="0" locked="0"> - <prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/> - <prop v="255,255,255,255" k="color"/> - <prop v="miter" k="joinstyle"/> - <prop v="0,0" k="offset"/> - <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> - <prop v="MM" k="offset_unit"/> - <prop v="35,35,35,255" k="outline_color"/> - <prop v="no" k="outline_style"/> - <prop v="0.26" k="outline_width"/> - <prop v="MM" k="outline_width_unit"/> - <prop v="solid" k="style"/> - <data_defined_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </data_defined_properties> - </layer> - </symbol> - <LayoutItem itemRotation="0" uuid="{8e6af7e2-d503-4f06-ada4-f9875107df83}" frame="false" outlineWidthM="0.3,mm" blendMode="0" excludeFromExports="0" positionLock="false" templateUuid="{8e6af7e2-d503-4f06-ada4-f9875107df83}" type="65638" size="297,210,mm" opacity="1" frameJoinStyle="miter" zValue="0" background="true" id="" position="0,0,mm" referencePoint="0" positionOnPage="0,0,mm" visibility="1" groupUuid=""> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <symbol force_rhr="0" alpha="1" type="fill" clip_to_extent="1" name=""> - <layer class="SimpleFill" enabled="1" pass="0" locked="0"> - <prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/> - <prop v="255,255,255,255" k="color"/> - <prop v="miter" k="joinstyle"/> - <prop v="0,0" k="offset"/> - <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> - <prop v="MM" k="offset_unit"/> - <prop v="35,35,35,255" k="outline_color"/> - <prop v="no" k="outline_style"/> - <prop v="0.26" k="outline_width"/> - <prop v="MM" k="outline_width_unit"/> - <prop v="solid" k="style"/> - <data_defined_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </data_defined_properties> - </layer> - </symbol> - </LayoutItem> - <GuideCollection visible="1"/> - </PageCollection> - <LayoutItem labelText="涓浗鐭虫补澶╃劧姘旂閬撳伐绋嬫湁闄愬叕鍙�" itemRotation="0" uuid="{ae0ef846-fa6b-47a5-b1e7-0af1f11c8341}" frame="false" outlineWidthM="0.3,mm" marginY="0" blendMode="0" excludeFromExports="0" positionLock="true" templateUuid="{ae0ef846-fa6b-47a5-b1e7-0af1f11c8341}" type="65641" size="76.0244,9.39831,mm" valign="128" opacity="1" halign="4" frameJoinStyle="miter" zValue="8" background="false" id="" position="212.337,195.29,mm" referencePoint="0" positionOnPage="212.337,195.29,mm" marginX="0" visibility="1" groupUuid="" htmlState="0"> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <LabelFont style="甯歌" description="瀹嬩綋,14,-1,5,50,0,0,0,0,0,甯歌"/> - <FontColor blue="0" alpha="255" green="0" red="0"/> - </LayoutItem> - <LayoutItem pictureHeight="10.4237" mapUuid="{95fd7a40-049b-4350-9f5a-6e3acdce4327}" itemRotation="0" uuid="{fb2d0661-f39e-4739-a978-b7ebc191a722}" frame="false" outlineWidthM="0.3,mm" blendMode="0" pictureRotation="90" excludeFromExports="0" positionLock="true" templateUuid="{fb2d0661-f39e-4739-a978-b7ebc191a722}" type="65640" svgBorderColor="0,0,0,255" size="10.4237,11.1743,mm" northMode="0" pictureWidth="8.25774" resizeMode="0" opacity="1" frameJoinStyle="miter" northOffset="0" zValue="8" background="false" id="鎸囧寳閽�" svgFillColor="255,255,255,255" position="277.938,2.42978,mm" svgBorderWidth="0.2" referencePoint="0" positionOnPage="277.938,2.42978,mm" file=":/images/north_arrows/layout_default_north_arrow.svg" mode="0" visibility="1" groupUuid="" anchorPoint="0"> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - </LayoutItem> - <LayoutItem pictureHeight="10.7409" mapUuid="" itemRotation="0" uuid="{9f93543c-2d87-4b0e-9fcf-f4044036a0a1}" frame="false" outlineWidthM="0.3,mm" blendMode="0" pictureRotation="0" excludeFromExports="0" positionLock="true" templateUuid="{9f93543c-2d87-4b0e-9fcf-f4044036a0a1}" type="65640" svgBorderColor="0,0,0,255" size="11.6809,10.7409,mm" northMode="0" pictureWidth="11.4207" resizeMode="0" opacity="1" frameJoinStyle="miter" northOffset="0" zValue="7" background="false" id="" svgFillColor="255,255,255,255" position="200.5,194.948,mm" svgBorderWidth="0.2" referencePoint="0" positionOnPage="200.5,194.948,mm" file="../../terrait/CPPE/CPPE/imgs/logo.png" mode="1" visibility="1" groupUuid="" anchorPoint="0"> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - </LayoutItem> - <LayoutItem itemRotation="0" uuid="{37d9aa35-1483-496b-8987-725bbce53515}" frame="false" sectionWidth="43.1968" outlineWidthM="0.3,mm" blendMode="0" excludeFromExports="0" sectionHeight="25.6574" positionLock="true" templateUuid="{37d9aa35-1483-496b-8987-725bbce53515}" type="65647" size="43.1968,25.6574,mm" sectionY="0" sectionX="0" opacity="1" frameJoinStyle="miter" zValue="6" hidePageIfEmpty="0" background="false" id="璇存槑" multiFrameTemplateUuid="{3f590e9a-19b4-46d3-90bb-6a188b24aaa6}" position="242.194,161,mm" referencePoint="0" positionOnPage="242.194,161,mm" hideBackgroundIfEmpty="0" visibility="1" groupUuid="" multiFrame="{3f590e9a-19b4-46d3-90bb-6a188b24aaa6}"> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - </LayoutItem> - <LayoutItem labelText="绠¢亾鍩虹澶ф暟鎹钩鍙帮紙DW1-1锛�" itemRotation="0" uuid="{bd216b40-3917-4158-9fc0-7f0df0a7a84c}" frame="false" outlineWidthM="0.3,mm" marginY="0" blendMode="0" excludeFromExports="0" positionLock="true" templateUuid="{bd216b40-3917-4158-9fc0-7f0df0a7a84c}" type="65641" size="129.364,11.1743,mm" valign="128" opacity="1" halign="4" frameJoinStyle="miter" zValue="4" background="false" id="" position="84.816,2.42978,mm" referencePoint="0" positionOnPage="84.816,2.42978,mm" marginX="0" visibility="1" groupUuid="" htmlState="0"> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <LabelFont style="Bold" description="寰蒋闆呴粦,24,-1,5,75,0,0,0,0,0,Bold"/> - <FontColor blue="0" alpha="255" green="0" red="0"/> - </LayoutItem> - <LayoutItem minSymbolSize="0" visibility="1" position="12.9877,147.385,mm" wrapChar="" columnSpace="2" maxSymbolSize="0" symbolHeight="4" wmsLegendWidth="50" titleAlignment="1" resizeToContents="0" lineSpacing="1" positionOnPage="12.9877,147.385,mm" uuid="{40b9158a-208c-4dbc-8964-5ac43158f9fc}" rasterBorder="1" background="true" outlineWidthM="0.3,mm" groupUuid="" fontColor="#000000" legendFilterByAtlas="0" id="" type="65642" templateUuid="{40b9158a-208c-4dbc-8964-5ac43158f9fc}" columnCount="1" boxSpace="2" equalColumnWidth="0" symbolAlignment="1" zValue="3" wmsLegendHeight="25" positionLock="true" symbolWidth="7" rasterBorderWidth="0" opacity="1" rasterBorderColor="0,0,0,255" frame="false" frameJoinStyle="miter" itemRotation="0" splitLayer="0" referencePoint="0" blendMode="0" excludeFromExports="0" size="70.2172,39.2726,mm" title="鍥句緥"> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <styles> - <style name="title" alignment="1" marginBottom="3.5"> - <styleFont style="" description="SimSun,16,-1,5,50,0,0,0,0,0"/> - </style> - <style marginTop="3" name="group" alignment="1"> - <styleFont style="" description="SimSun,14,-1,5,50,0,0,0,0,0"/> - </style> - <style marginTop="3" name="subgroup" alignment="1"> - <styleFont style="" description="SimSun,12,-1,5,50,0,0,0,0,0"/> - </style> - <style marginTop="2.5" name="symbol" alignment="1"> - <styleFont style="" description="SimSun,9,-1,5,50,0,0,0,0,0"/> - </style> - <style marginTop="2" name="symbolLabel" alignment="1" marginLeft="2"> - <styleFont style="" description="SimSun,12,-1,5,50,0,0,0,0,0"/> - </style> - </styles> - </LayoutItem> - <LayoutItem itemRotation="0" uuid="{95fd7a40-049b-4350-9f5a-6e3acdce4327}" frame="true" isTemporal="0" outlineWidthM="4,px" blendMode="0" excludeFromExports="0" positionLock="true" drawCanvasItems="false" templateUuid="{95fd7a40-049b-4350-9f5a-6e3acdce4327}" mapRotation="90" type="65639" size="278.717,173.294,mm" mapFlags="0" opacity="1" frameJoinStyle="round" followPreset="false" labelMargin="0,mm" zValue="2" keepLayerSet="false" background="true" id="鍦板浘" position="9.47563,16.5367,mm" referencePoint="0" positionOnPage="9.47563,16.5367,mm" followPresetName="" visibility="1" groupUuid=""> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <Extent ymin="32.92756964471694658" xmin="65.46900278918894855" xmax="95.28806216935879547" ymax="51.46777955242695413"/> - <crs> - <spatialrefsys> - <wkt>GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],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["unknown"],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> - <LayerSet/> - <ComposerMapGrid intervalX="30" gridFrameMargin="0" rotatedTicksEnabled="0" annotationFormat="4" bottomAnnotationDisplay="0" position="3" rightAnnotationDirection="2" gridFramePenColor="0,0,0,255" bottomAnnotationDirection="0" gridFrameWidth="2" bottomFrameDivisions="0" rotatedTicksMinimumAngle="0" frameAnnotationDistance="1" rotatedAnnotationsLengthMode="0" gridFrameStyle="0" offsetY="0" show="1" crossLength="3" rotatedAnnotationsEnabled="0" uuid="{33b582a6-ae09-42c2-b50b-ae68c9d6d71a}" gridStyle="3" leftAnnotationPosition="1" topAnnotationDisplay="0" leftAnnotationDisplay="0" topAnnotationPosition="1" maximumIntervalWidth="10" gridFramePenThickness="0.29999999999999999" offsetX="0" intervalY="30" annotationPrecision="3" frameFillColor2="0,0,0,255" rotatedAnnotationsMarginToCorner="0" frameFillColor1="255,255,255,255" bottomAnnotationPosition="1" leftAnnotationDirection="2" rotatedTicksMarginToCorner="0" leftFrameDivisions="0" unit="1" minimumIntervalWidth="12" rightAnnotationDisplay="0" name="缃戞牸 1" annotationExpression="" topFrameDivisions="0" gridFrameSideFlags="15" showAnnotation="1" rotatedAnnotationsMinimumAngle="0" rotatedTicksLengthMode="0" rightFrameDivisions="0" blendMode="0" rightAnnotationPosition="1" topAnnotationDirection="0"> - <lineStyle> - <symbol force_rhr="0" alpha="0.616" type="line" clip_to_extent="1" name=""> - <layer class="SimpleLine" enabled="1" pass="0" locked="0"> - <prop v="0" k="align_dash_pattern"/> - <prop v="round" k="capstyle"/> - <prop v="0.66;2" k="customdash"/> - <prop v="3x:0,0,0,0,0,0" k="customdash_map_unit_scale"/> - <prop v="MM" k="customdash_unit"/> - <prop v="0" k="dash_pattern_offset"/> - <prop v="3x:0,0,0,0,0,0" k="dash_pattern_offset_map_unit_scale"/> - <prop v="MM" k="dash_pattern_offset_unit"/> - <prop v="0" k="draw_inside_polygon"/> - <prop v="round" k="joinstyle"/> - <prop v="0,0,0,255" k="line_color"/> - <prop v="solid" k="line_style"/> - <prop v="0.5" k="line_width"/> - <prop v="MM" k="line_width_unit"/> - <prop v="0" k="offset"/> - <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> - <prop v="MM" k="offset_unit"/> - <prop v="0" k="ring_filter"/> - <prop v="0" k="tweak_dash_pattern_on_corners"/> - <prop v="1" k="use_custom_dash"/> - <prop v="3x:0,0,0,0,0,0" k="width_map_unit_scale"/> - <data_defined_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </data_defined_properties> - </layer> - </symbol> - </lineStyle> - <markerStyle> - <symbol force_rhr="0" alpha="1" type="marker" clip_to_extent="1" name=""> - <layer class="SimpleMarker" enabled="1" pass="0" locked="0"> - <prop v="0" k="angle"/> - <prop v="0,0,0,255" k="color"/> - <prop v="1" k="horizontal_anchor_point"/> - <prop v="bevel" k="joinstyle"/> - <prop v="circle" k="name"/> - <prop v="0,0" k="offset"/> - <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> - <prop v="MM" k="offset_unit"/> - <prop v="35,35,35,255" k="outline_color"/> - <prop v="solid" k="outline_style"/> - <prop v="0" k="outline_width"/> - <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/> - <prop v="MM" k="outline_width_unit"/> - <prop v="diameter" k="scale_method"/> - <prop v="2" k="size"/> - <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/> - <prop v="MM" k="size_unit"/> - <prop v="1" k="vertical_anchor_point"/> - <data_defined_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </data_defined_properties> - </layer> - </symbol> - </markerStyle> - <spatialrefsys> - <wkt>GEOGCRS["WGS 84",DATUM["World Geodetic System 1984",ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]]],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["unknown"],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> - <text-style fontUnderline="0" previewBkgrdColor="255,255,255,255" textOpacity="1" blendMode="0" fontSize="8" multilineHeight="1" fontSizeMapUnitScale="3x:0,0,0,0,0,0" fontSizeUnit="Point" fontWordSpacing="0" namedStyle="" fontWeight="50" fontStrikeout="0" fontItalic="0" textOrientation="horizontal" capitalization="0" fontFamily="SimSun" textColor="0,0,0,255" fontLetterSpacing="0" allowHtml="0" fontKerning="1"> - <text-buffer bufferJoinStyle="128" bufferDraw="0" bufferSize="1" bufferColor="255,255,255,255" bufferBlendMode="0" bufferOpacity="1" bufferSizeMapUnitScale="3x:0,0,0,0,0,0" bufferSizeUnits="MM" bufferNoFill="1"/> - <text-mask maskOpacity="1" maskSize="1.5" maskSizeUnits="MM" maskJoinStyle="128" maskSizeMapUnitScale="3x:0,0,0,0,0,0" maskedSymbolLayers="" maskEnabled="0" maskType="0"/> - <background shapeBorderColor="128,128,128,255" shapeOffsetMapUnitScale="3x:0,0,0,0,0,0" shapeSVGFile="" shapeOffsetX="0" shapeBorderWidthUnit="MM" shapeSizeMapUnitScale="3x:0,0,0,0,0,0" shapeRadiiY="0" shapeOffsetY="0" shapeRotation="0" shapeSizeY="0" shapeSizeType="0" shapeBorderWidthMapUnitScale="3x:0,0,0,0,0,0" shapeRadiiX="0" shapeBlendMode="0" shapeJoinStyle="64" shapeDraw="0" shapeType="0" shapeSizeX="0" shapeBorderWidth="0" shapeRotationType="0" shapeRadiiMapUnitScale="3x:0,0,0,0,0,0" shapeOpacity="1" shapeOffsetUnit="MM" shapeRadiiUnit="MM" shapeFillColor="255,255,255,255" shapeSizeUnit="MM"> - <symbol force_rhr="0" alpha="1" type="marker" clip_to_extent="1" name="markerSymbol"> - <layer class="SimpleMarker" enabled="1" pass="0" locked="0"> - <prop v="0" k="angle"/> - <prop v="231,113,72,255" k="color"/> - <prop v="1" k="horizontal_anchor_point"/> - <prop v="bevel" k="joinstyle"/> - <prop v="circle" k="name"/> - <prop v="0,0" k="offset"/> - <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> - <prop v="MM" k="offset_unit"/> - <prop v="35,35,35,255" k="outline_color"/> - <prop v="solid" k="outline_style"/> - <prop v="0" k="outline_width"/> - <prop v="3x:0,0,0,0,0,0" k="outline_width_map_unit_scale"/> - <prop v="MM" k="outline_width_unit"/> - <prop v="diameter" k="scale_method"/> - <prop v="2" k="size"/> - <prop v="3x:0,0,0,0,0,0" k="size_map_unit_scale"/> - <prop v="MM" k="size_unit"/> - <prop v="1" k="vertical_anchor_point"/> - <data_defined_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </data_defined_properties> - </layer> - </symbol> - </background> - <shadow shadowRadiusAlphaOnly="0" shadowOpacity="0.7" shadowScale="100" shadowColor="0,0,0,255" shadowRadius="1.5" shadowOffsetMapUnitScale="3x:0,0,0,0,0,0" shadowDraw="0" shadowOffsetUnit="MM" shadowRadiusUnit="MM" shadowOffsetAngle="135" shadowOffsetDist="1" shadowOffsetGlobal="1" shadowUnder="0" shadowRadiusMapUnitScale="3x:0,0,0,0,0,0" shadowBlendMode="6"/> - <dd_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dd_properties> - </text-style> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - </ComposerMapGrid> - <AtlasMap atlasDriven="0" margin="0.10000000000000001" scalingMode="2"/> - <labelBlockingItems/> - <atlasClippingSettings forceLabelsInside="0" restrictLayers="0" clippingType="1" enabled="0"> - <layersToClip/> - </atlasClippingSettings> - <itemClippingSettings forceLabelsInside="0" clippingType="1" enabled="0" clipSource=""/> - </LayoutItem> - <LayoutItem itemRotation="0" uuid="{196a8082-83a1-4c8c-be62-ebceba06906c}" frame="false" outlineWidthM="0.3,mm" blendMode="0" excludeFromExports="0" cornerRadiusMeasure="0,mm" positionLock="true" templateUuid="{196a8082-83a1-4c8c-be62-ebceba06906c}" type="65643" size="292.354,205.447,mm" opacity="1" frameJoinStyle="miter" shapeType="1" zValue="1" background="false" id="杈规" position="2.6816,2,mm" referencePoint="0" positionOnPage="2.6816,2,mm" visibility="1" groupUuid=""> - <FrameColor blue="0" alpha="255" green="0" red="0"/> - <BackgroundColor blue="255" alpha="255" green="255" red="255"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <symbol force_rhr="0" alpha="1" type="fill" clip_to_extent="1" name=""> - <layer class="SimpleLine" enabled="1" pass="0" locked="0"> - <prop v="0" k="align_dash_pattern"/> - <prop v="square" k="capstyle"/> - <prop v="5;2" k="customdash"/> - <prop v="3x:0,0,0,0,0,0" k="customdash_map_unit_scale"/> - <prop v="Pixel" k="customdash_unit"/> - <prop v="0" k="dash_pattern_offset"/> - <prop v="3x:0,0,0,0,0,0" k="dash_pattern_offset_map_unit_scale"/> - <prop v="MM" k="dash_pattern_offset_unit"/> - <prop v="0" k="draw_inside_polygon"/> - <prop v="bevel" k="joinstyle"/> - <prop v="53,121,177,255" k="line_color"/> - <prop v="solid" k="line_style"/> - <prop v="0.96" k="line_width"/> - <prop v="Pixel" k="line_width_unit"/> - <prop v="0" k="offset"/> - <prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/> - <prop v="Pixel" k="offset_unit"/> - <prop v="0" k="ring_filter"/> - <prop v="0" k="tweak_dash_pattern_on_corners"/> - <prop v="0" k="use_custom_dash"/> - <prop v="3x:0,0,0,0,0,0" k="width_map_unit_scale"/> - <data_defined_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </data_defined_properties> - </layer> - </symbol> - </LayoutItem> - <LayoutMultiFrame gridColor="0,0,0,255" backgroundColor="255,255,255,255" uuid="{3f590e9a-19b4-46d3-90bb-6a188b24aaa6}" includeHeader="0" showGrid="0" horizontalGrid="1" emptyTableMessage="" templateUuid="{3f590e9a-19b4-46d3-90bb-6a188b24aaa6}" emptyTableMode="0" type="65652" resizeMode="0" wrapBehavior="0" cellMargin="1" showEmptyRows="0" headerHAlignment="0" verticalGrid="1" gridStrokeWidth="0.5" headerMode="2"> - <childFrame uuid="{37d9aa35-1483-496b-8987-725bbce53515}" templateUuid="{37d9aa35-1483-496b-8987-725bbce53515}"/> - <LayoutObject> - <dataDefinedProperties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dataDefinedProperties> - <customproperties/> - </LayoutObject> - <headerTextFormat> - <text-style fontUnderline="0" previewBkgrdColor="255,255,255,255" textOpacity="1" blendMode="0" fontSize="10" multilineHeight="1" fontSizeMapUnitScale="3x:0,0,0,0,0,0" fontSizeUnit="Point" fontWordSpacing="0" namedStyle="" fontWeight="50" fontStrikeout="0" fontItalic="0" textOrientation="horizontal" capitalization="0" fontFamily="SimSun" textColor="0,0,0,255" fontLetterSpacing="0" allowHtml="0" fontKerning="1"> - <text-buffer bufferJoinStyle="128" bufferDraw="0" bufferSize="1" bufferColor="255,255,255,255" bufferBlendMode="0" bufferOpacity="1" bufferSizeMapUnitScale="3x:0,0,0,0,0,0" bufferSizeUnits="MM" bufferNoFill="1"/> - <text-mask maskOpacity="1" maskSize="1.5" maskSizeUnits="MM" maskJoinStyle="128" maskSizeMapUnitScale="3x:0,0,0,0,0,0" maskedSymbolLayers="" maskEnabled="0" maskType="0"/> - <background shapeBorderColor="128,128,128,255" shapeOffsetMapUnitScale="3x:0,0,0,0,0,0" shapeSVGFile="" shapeOffsetX="0" shapeBorderWidthUnit="MM" shapeSizeMapUnitScale="3x:0,0,0,0,0,0" shapeRadiiY="0" shapeOffsetY="0" shapeRotation="0" shapeSizeY="0" shapeSizeType="0" shapeBorderWidthMapUnitScale="3x:0,0,0,0,0,0" shapeRadiiX="0" shapeBlendMode="0" shapeJoinStyle="64" shapeDraw="0" shapeType="0" shapeSizeX="0" shapeBorderWidth="0" shapeRotationType="0" shapeRadiiMapUnitScale="3x:0,0,0,0,0,0" shapeOpacity="1" shapeOffsetUnit="MM" shapeRadiiUnit="MM" shapeFillColor="255,255,255,255" shapeSizeUnit="MM"/> - <shadow shadowRadiusAlphaOnly="0" shadowOpacity="0.7" shadowScale="100" shadowColor="0,0,0,255" shadowRadius="1.5" shadowOffsetMapUnitScale="3x:0,0,0,0,0,0" shadowDraw="0" shadowOffsetUnit="MM" shadowRadiusUnit="MM" shadowOffsetAngle="135" shadowOffsetDist="1" shadowOffsetGlobal="1" shadowUnder="0" shadowRadiusMapUnitScale="3x:0,0,0,0,0,0" shadowBlendMode="6"/> - <dd_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dd_properties> - </text-style> - </headerTextFormat> - <contentTextFormat> - <text-style fontUnderline="0" previewBkgrdColor="255,255,255,255" textOpacity="1" blendMode="0" fontSize="10" multilineHeight="1" fontSizeMapUnitScale="3x:0,0,0,0,0,0" fontSizeUnit="Point" fontWordSpacing="0" namedStyle="" fontWeight="50" fontStrikeout="0" fontItalic="0" textOrientation="horizontal" capitalization="0" fontFamily="SimSun" textColor="0,0,0,255" fontLetterSpacing="0" allowHtml="0" fontKerning="1"> - <text-buffer bufferJoinStyle="128" bufferDraw="0" bufferSize="1" bufferColor="255,255,255,255" bufferBlendMode="0" bufferOpacity="1" bufferSizeMapUnitScale="3x:0,0,0,0,0,0" bufferSizeUnits="MM" bufferNoFill="1"/> - <text-mask maskOpacity="1" maskSize="1.5" maskSizeUnits="MM" maskJoinStyle="128" maskSizeMapUnitScale="3x:0,0,0,0,0,0" maskedSymbolLayers="" maskEnabled="0" maskType="0"/> - <background shapeBorderColor="128,128,128,255" shapeOffsetMapUnitScale="3x:0,0,0,0,0,0" shapeSVGFile="" shapeOffsetX="0" shapeBorderWidthUnit="MM" shapeSizeMapUnitScale="3x:0,0,0,0,0,0" shapeRadiiY="0" shapeOffsetY="0" shapeRotation="0" shapeSizeY="0" shapeSizeType="0" shapeBorderWidthMapUnitScale="3x:0,0,0,0,0,0" shapeRadiiX="0" shapeBlendMode="0" shapeJoinStyle="64" shapeDraw="0" shapeType="0" shapeSizeX="0" shapeBorderWidth="0" shapeRotationType="0" shapeRadiiMapUnitScale="3x:0,0,0,0,0,0" shapeOpacity="1" shapeOffsetUnit="MM" shapeRadiiUnit="MM" shapeFillColor="255,255,255,255" shapeSizeUnit="MM"/> - <shadow shadowRadiusAlphaOnly="0" shadowOpacity="0.7" shadowScale="100" shadowColor="0,0,0,255" shadowRadius="1.5" shadowOffsetMapUnitScale="3x:0,0,0,0,0,0" shadowDraw="0" shadowOffsetUnit="MM" shadowRadiusUnit="MM" shadowOffsetAngle="135" shadowOffsetDist="1" shadowOffsetGlobal="1" shadowUnder="0" shadowRadiusMapUnitScale="3x:0,0,0,0,0,0" shadowBlendMode="6"/> - <dd_properties> - <Option type="Map"> - <Option type="QString" value="" name="name"/> - <Option name="properties"/> - <Option type="QString" value="collection" name="type"/> - </Option> - </dd_properties> - </text-style> - </contentTextFormat> - <displayColumns> - <column attribute="" width="0" hAlignment="1" vAlignment="128" heading="" sortByRank="0" sortOrder="0"> - <backgroundColor blue="0" alpha="0" green="0" red="0"/> - </column> - <column attribute="" width="0" hAlignment="1" vAlignment="128" heading="璇存槑" sortByRank="0" sortOrder="0"> - <backgroundColor blue="0" alpha="0" green="0" red="0"/> - </column> - </displayColumns> - <sortColumns/> - <cellStyles> - <oddColumns enabled="0" cellBackgroundColor="255,255,255,255"/> - <evenColumns enabled="0" cellBackgroundColor="255,255,255,255"/> - <oddRows enabled="0" cellBackgroundColor="255,255,255,255"/> - <evenRows enabled="0" cellBackgroundColor="255,255,255,255"/> - <firstColumn enabled="0" cellBackgroundColor="255,255,255,255"/> - <lastColumn enabled="0" cellBackgroundColor="255,255,255,255"/> - <headerRow enabled="0" cellBackgroundColor="255,255,255,255"/> - <firstRow enabled="0" cellBackgroundColor="255,255,255,255"/> - <lastRow enabled="0" cellBackgroundColor="255,255,255,255"/> - </cellStyles> - <headers> - <header attribute="" width="0" hAlignment="1" vAlignment="128" heading="" sortByRank="0" sortOrder="0"> - <backgroundColor blue="0" alpha="0" green="0" red="0"/> - </header> - <header attribute="" width="0" hAlignment="1" vAlignment="128" heading="璇存槑" sortByRank="0" sortOrder="0"> - <backgroundColor blue="0" alpha="0" green="0" red="0"/> - </header> - </headers> - <contents> - <row> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="璇�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="2" name="halign"/> - <Option type="int" value="0" name="valign"/> - </Option> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="鏄�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="0" name="halign"/> - <Option type="int" value="0" name="valign"/> - </Option> - </row> - <row> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="鐪佷唤锛�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="2" name="halign"/> - <Option type="int" value="128" name="valign"/> - </Option> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="娌冲寳鐪�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="1" name="halign"/> - <Option type="int" value="128" name="valign"/> - </Option> - </row> - <row> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="姣斾緥灏猴細" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="2" name="halign"/> - <Option type="int" value="128" name="valign"/> - </Option> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="1锛�25涓�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="1" name="halign"/> - <Option type="int" value="128" name="valign"/> - </Option> - </row> - <row> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="褰卞儚鍒嗚鲸鐜囷細" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="0" name="halign"/> - <Option type="int" value="0" name="valign"/> - </Option> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="20绫�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="0" name="halign"/> - <Option type="int" value="0" name="valign"/> - </Option> - </row> - <row> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="鍒跺浘鏃堕棿锛�" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="2" name="halign"/> - <Option type="int" value="0" name="valign"/> - </Option> - <Option type="Map"> - <Option type="color" value="" name="background"/> - <Option type="QString" value="2019.10.15" name="content"/> - <Option type="color" value="" name="foreground"/> - <Option type="int" value="0" name="halign"/> - <Option type="int" value="0" name="valign"/> - </Option> - </row> - </contents> - <rowHeights> - <row height="0"/> - <row height="0"/> - <row height="0"/> - <row height="0"/> - <row height="0"/> - </rowHeights> - <columnWidths> - <column width="0"/> - <column width="0"/> - </columnWidths> - </LayoutMultiFrame> - <customproperties> - <property key="atlasRasterFormat" value="png"/> - <property key="imageAntialias" value="true"/> - <property key="imageCropMarginBottom" value="0"/> - <property key="imageCropMarginLeft" value="0"/> - <property key="imageCropMarginRight" value="0"/> - <property key="imageCropMarginTop" value="0"/> - <property key="imageCropToContents" value="false"/> - <property key="rasterize" value="true"/> - <property key="singleFile" value="true"/> - </customproperties> - <Atlas coverageLayer="" filenamePattern="'output_'||@atlas_featurenumber" pageNameExpression="" hideCoverage="0" enabled="0" sortFeatures="0" filterFeatures="0"/> -</Layout> diff --git a/ExportMap/Sources/bak/Lengend.png b/ExportMap/Sources/bak/Lengend.png deleted file mode 100644 index 11fffac..0000000 --- a/ExportMap/Sources/bak/Lengend.png +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/Test.qgz b/ExportMap/Sources/bak/Test.qgz deleted file mode 100644 index 30432eb..0000000 --- a/ExportMap/Sources/bak/Test.qgz +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/geo.png b/ExportMap/Sources/bak/geo.png deleted file mode 100644 index 75044fa..0000000 --- a/ExportMap/Sources/bak/geo.png +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/geo_render.py b/ExportMap/Sources/bak/geo_render.py deleted file mode 100644 index 51eb70e..0000000 --- a/ExportMap/Sources/bak/geo_render.py +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env -# -*- coding: utf-8 -*- -import os -import sys -import math -import argparse -from qgis.core import * -from qgis.gui import * -from qgis.PyQt.QtGui import * -from qgis.PyQt.QtCore import * -from qgis.PyQt.QtWidgets import * -from qgis.PyQt.QtXml import * - - -# 鑾峰彇瀹屾暣璺緞 -def get_full_path(): - return os.path.split(sys.argv[0])[0] - - -# 鑾峰彇鍙傛暟 -def get_args(): - print("argv = ", sys.argv[1:]) - parser = argparse.ArgumentParser(description='ArgUtils') - parser.add_argument("-src", type=str, default=get_full_path(), required=False) - parser.add_argument("-qgz", type=str, default="LF.qgz", required=False) - parser.add_argument("-qpt", type=str, default="LF.qpt", required=False) - - return parser.parse_args() - - -# 璁剧疆鍥惧眰鍙敤鎬� -def set_layers_valid(prj, show_layers): - for layer in prj.mapLayers().values(): - flag = layer.name() in show_layers - print(layer.name() + ": " + str(flag)) - # if not flag: - # project.removeMapLayer(layer) - layer.setValid(flag) - - -# 璁剧疆鍥惧眰鍙鎬� -def set_item_visibility(root_node, show_layers): - print(root_node.name() + ': Group') - for node in root_node.children(): - # QgsLayerTreeLayer - if isinstance(node, QgsLayerTreeGroup): - set_item_visibility(node, show_layers) - # QgsRasterLayer, QgsVectorLayer - else: - name = node.layer().name() - flag = name in showLayers - print(name + ": " + str(flag)) - # if not flag: - # root_node.removeLayer(node.layer()) - # node.layer().setValid(False) - node.setItemVisibilityChecked(flag) - - -# 鍒濆鍖� -# QgsApplication.setPrefixPath(r"E:/terrait/TianJin/LFServer/QGIS/", True) -qgs = QgsApplication([], True) -qgs.initQgis() - -# 鍔犺浇宸ョ▼ -args = get_args() -project = QgsProject.instance() -# project.read(r'Test.qgz') -project.read(os.path.join(args.src, args.qgz)) -print("FileName: " + project.fileName()) - -# layout = QgsPrintLayout(project) -layout = QgsLayout(project) -# layout.initializeDefaults() - -# 鍔犺浇妯℃澘 -# with open(r'Test.qpt', 'r', encoding='utf-8') as f: -with open(os.path.join(args.src, args.qpt), 'r', encoding='utf-8') as f: - template_content = f.read() -doc = QDomDocument() -doc.setContent(template_content) -layout.loadFromTemplate(doc, QgsReadWriteContext(), True) - -# map = layout.itemById(r'鍦板浘') -map = layout.referenceMap() -map.zoomToExtent(map.extent()) -print('1:' + str(math.ceil(map.scale()))) - -size = map.sizeWithUnits() -print('size: ' + str(size.width()) + " * " + str(size.height()) + " mm") -if size.width() > 280 or size.height() > 174: - map.attemptResize(QgsLayoutSize(280, 174, QgsUnitTypes.LayoutMillimeters)) - print('size: ' + str(map.sizeWithUnits().width()) + " * " + str(map.sizeWithUnits().height()) + " mm") - -# 璁剧疆鍥惧眰 -# "闃�瀹�", "绔欏満", "绠¢亾涓績绾�", "鐭㈤噺娉ㄨ", "鐭㈤噺鍥�", "楂樺痉褰卞儚娉ㄨ", "楂樺痉褰卞儚", "褰卞儚娉ㄨ", "褰卞儚鍥�" -# showLayers = ["闃�瀹�", "绠¢亾涓績绾�", "鐭㈤噺娉ㄨ", "鐭㈤噺鍥�"] -showLayers = layout.customProperty("layers").split(',') -root = project.layerTreeRoot() -# set_layers_valid(project, showLayers) -set_item_visibility(root, showLayers) - -# collection = layout.pageCollection() -# page = collection.page(0) -# page.refreshItemSize() - -legend = layout.itemById(r'鍥句緥') -# legend.setLinkedMap(map) -# legend.setLegendFilterByMapEnabled(False) -# legend.setLegendFilterOutAtlas(True) -legend.updateFilterByMap(True) -legend.refreshFrame(True) -legend.updateLegend() -legend.refresh() - -# 鍒锋柊 -map.refresh() -layout.updateBounds() -layout.refresh() - -# 瀵煎嚭 -exporter = QgsLayoutExporter(layout) -# img_path = os.path.join(r"E:/terrait/TianJin/LFServer/QGIS", "render.png") -img_path = layout.customProperty("imgPath") -exporter.exportToImage(img_path, QgsLayoutExporter.ImageExportSettings()) - -# 閫�鍑� -qgs.exitQgis() diff --git a/ExportMap/Sources/bak/logo2.png b/ExportMap/Sources/bak/logo2.png deleted file mode 100644 index 9be41e0..0000000 --- a/ExportMap/Sources/bak/logo2.png +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/main.py b/ExportMap/Sources/bak/main.py deleted file mode 100644 index f73432c..0000000 --- a/ExportMap/Sources/bak/main.py +++ /dev/null @@ -1,35 +0,0 @@ -from qgis.core import * -from qgis.gui import * -from qgis.PyQt.QtGui import (QColor) - -# QgsApplication.setPrefixPath("e:/", True) - -qgs = QgsApplication([], True) -qgs.initQgis() - - -# 鍒涘缓瀹炰緥 -project = QgsProject.instance() -project.read(r'E:/data/1.Natural_Earth/Test.qgz') -print("FileName: " + project.fileName()) - -# canvas = QgsMapCanvas() -# canvas.show() -# bridge = QgsLayerTreeMapCanvasBridge(QgsProject.instance().layerTreeRoot(), canvas) - -layers_list = {} -for layer in project.mapLayers().values(): - layers_list[layer.name()] = layer -print(layers_list) - -openStreetMapLayer = project.mapLayersByName("OpenStreetMap")[0] -print(openStreetMapLayer) - -root = project.layerTreeRoot() -print(root.findLayerIds()[0]) - -# 淇濆瓨锛屽彟瀛樹负 -# project.write() -# project.write("E:/new_qgis_project.qgz") - -# qgs.exitQgis() diff --git a/ExportMap/Sources/bak/qgis_py.png b/ExportMap/Sources/bak/qgis_py.png deleted file mode 100644 index af6667c..0000000 --- a/ExportMap/Sources/bak/qgis_py.png +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/render1.png b/ExportMap/Sources/bak/render1.png deleted file mode 100644 index 68120c8..0000000 --- a/ExportMap/Sources/bak/render1.png +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/render2.png b/ExportMap/Sources/bak/render2.png deleted file mode 100644 index 2e4cb13..0000000 --- a/ExportMap/Sources/bak/render2.png +++ /dev/null Binary files differ diff --git a/ExportMap/Sources/bak/render_bak.py b/ExportMap/Sources/bak/render_bak.py deleted file mode 100644 index 56741be..0000000 --- a/ExportMap/Sources/bak/render_bak.py +++ /dev/null @@ -1,85 +0,0 @@ -import os -from qgis.core import * -from qgis.gui import * -from qgis.PyQt.QtGui import * -from qgis.PyQt.QtCore import * -from qgis.PyQt.QtWidgets import * -from qgis.PyQt.QtXml import * - -def finished(): - img = render.renderedImage() - # QgsProject.instance().homePath() - image_location = os.path.join("e:/", "render.png") - # save the image; e.g. img.save("/Users/myuser/render.png","png") - img.save(image_location, "png") - -QgsApplication.setPrefixPath("C:/Program Files/QGIS 3.16/bin", True) -qgs = QgsApplication([], True) -qgs.initQgis() - -# vlayer = iface.activeLayer() -project = QgsProject.instance() -project.read(r'E:/data/1.Natural_Earth/Test.qgz') - -layers = project.mapLayers().values() -# root = project.layerTreeRoot() - -# layout = QgsPrintLayout(project) -layout = QgsLayout(project) -layout.initializeDefaults() - -with open("E:/data/1.Natural_Earth/Layout.qpt", 'r', encoding='utf-8') as f: - template_content = f.read() -doc = QDomDocument() -doc.setContent(template_content) -# doc = QDomDocument("E:/data/1.Natural_Earth/Layout.qpt") -#ele = layout.writeXml(doc, QgsReadWriteContext()) -#layout.readLayoutXml(ele, doc, QgsReadWriteContext()) -layout.loadFromTemplate(doc, QgsReadWriteContext(), False) - -map = QgsLayoutItemMap(layout) -# # map.zoomToExtent(layers[0].extent()) -layout.addItem(map) - -# collection = layout.pageCollection() -# page = QgsLayoutItemPage(layout) -# page.setPageSize('A4') -# collection.addPage(page) - -layoutView = QgsLayoutView() -layoutView.setPreviewModeEnabled(True) -layoutView.setContentsMargins(0, 0, 0, 0) -layoutView.setCurrentLayout(layout) - -# map = QgsLayoutItemMap(layout) -# # map.zoomToExtent(layers[0].extent()) -# # map.attemptResize(QgsLayoutSize(2480, 1748, QgsUnitTypes.LayoutPixels)) -# layout.addItem(map) - -# collection = layout.pageCollection() -# collection.deletePage(0) -# page = QgsLayoutItemPage(layout) -# page.setPageSize('A5', True) -# collection.addPage(page) -# collection.redraw() - -# collection = layout.pageCollection() -# page = collection.page(0) -# # QgsUnitTypes.LayoutCentimeters -# # size = QgsLayoutSize(2480, 1748, QgsUnitTypes.LayoutPixels) -# page.setPageSize('A5', True) - -# imgSetting = QgsLayoutExporter.ImageExportSettings() -# imgSetting.imageSize.width = 4096 -# imgSetting.imageSize.heigth = 3507 - -# layout.updateBounds() -# layout.refresh() -# page.redraw() -# collection.redraw() - -exporter = QgsLayoutExporter(layout) -img_path = os.path.join("e:/", "render.png") -exporter.exportToImage(img_path, QgsLayoutExporter.ImageExportSettings()) - -qgs.exitQgis() diff --git a/ExportMap/Sources/bak/ui.py b/ExportMap/Sources/bak/ui.py deleted file mode 100644 index ca3f68d..0000000 --- a/ExportMap/Sources/bak/ui.py +++ /dev/null @@ -1,48 +0,0 @@ -import os -import sys -from qgis.gui import * -from qgis.core import * -from qgis.PyQt.QtCore import * -from qgis.PyQt.QtWidgets import * - - -class MapViewer(QMainWindow): - def __init__(self, shapefile): - QMainWindow.__init__(self) - self.setWindowTitle("Map Viewer") - - canvas = QgsMapCanvas() - canvas.setCanvasColor(Qt.white) - canvas.show() - - project = QgsProject.instance() - project.read(r'E:/data/1.Natural_Earth/Test.qgz') - - layer = QgsVectorLayer(shapefile, "layer1", "ogr") - if not layer.isValid(): - raise IOError("Invalid shapefile") - - # project.addMapLayer(layer) - # canvas.setExtent(layer.extent()) - # canvas.setLayers([layer]) - layers = project.mapLayers().values() - canvas.setLayers(layers) - - layout = QVBoxLayout() - layout.addWidget(canvas) - - contents = QWidget() - contents.setLayout(layout) - self.setCentralWidget(contents) - - -if __name__ == "__main__": - QgsApplication.setPrefixPath("qgis", True) - qgs = QgsApplication([], True) - qgs.initQgis() - - viewer = MapViewer("./data/Counties.shp") - viewer.show() - exitCode = qgs.exec() - - qgs.exitQgis() -- Gitblit v1.9.3