From c0b6fcb60e9937b09e81ce32dd4b30ac5cb0024d Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 10 十一月 2022 10:18:28 +0800 Subject: [PATCH] 1 --- ExportMap/Sources/Layout.qpt | 558 +++++++++++++++++++++++++++++++++++++++ ExportMap/Sources/main.py | 35 ++ ExportMap/Sources/render_bak.py | 85 ++++++ ExportMap/Sources/ui.py | 48 +++ ExportMap/Sources/说明.txt | 69 ++++ 5 files changed, 795 insertions(+), 0 deletions(-) diff --git a/ExportMap/Sources/Layout.qpt b/ExportMap/Sources/Layout.qpt new file mode 100644 index 0000000..561ba53 --- /dev/null +++ b/ExportMap/Sources/Layout.qpt @@ -0,0 +1,558 @@ +<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/main.py b/ExportMap/Sources/main.py new file mode 100644 index 0000000..f73432c --- /dev/null +++ b/ExportMap/Sources/main.py @@ -0,0 +1,35 @@ +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/render_bak.py b/ExportMap/Sources/render_bak.py new file mode 100644 index 0000000..56741be --- /dev/null +++ b/ExportMap/Sources/render_bak.py @@ -0,0 +1,85 @@ +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/ui.py b/ExportMap/Sources/ui.py new file mode 100644 index 0000000..ca3f68d --- /dev/null +++ b/ExportMap/Sources/ui.py @@ -0,0 +1,48 @@ +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() diff --git "a/ExportMap/Sources/\350\257\264\346\230\216.txt" "b/ExportMap/Sources/\350\257\264\346\230\216.txt" new file mode 100644 index 0000000..4fc36b5 --- /dev/null +++ "b/ExportMap/Sources/\350\257\264\346\230\216.txt" @@ -0,0 +1,69 @@ +锘�================================================================================ QGIS鐜閰嶇疆 +1.path 璁剧疆锛� +C:\Program Files\QGIS 3.16\apps\Python37; +C:\Program Files\QGIS 3.16\bin; +C:\Program Files\QGIS 3.16\apps\qgis-ltr\bin锛� + +2.PYTHONPATH 璁剧疆锛� +C:\Program Files\QGIS 3.16\apps\qgis-ltr\python; +C:\Program Files\QGIS 3.16\apps\qgis-ltr\bin; +C:\Program Files\QGIS 3.16\apps\qgis-ltr\python\qgis; +C:\Program Files\QGIS 3.16\apps\Python37\Lib; +C:\Program Files\QGIS 3.16\apps\Python37\Lib\site-packages; +C:\Program Files\QGIS 3.16\apps\Python37\DLLs; +C:\Program Files\QGIS 3.16\apps\Python37\Scripts; + +3.PYTHONHOME 璁剧疆锛� +C:\Program Files\QGIS 3.16\apps\Python37; + +4.妫�鏌ラ厤缃紙濡傛灉娌℃湁鎻愮ず閿欒锛屽嵆鍙互璁や负閰嶇疆鎴愬姛锛夛細 +>>> from qgis.core import * +>>> import qgis.core + +python E:/terrait/TianJin/ExportMap/ExportMap/Sources/render.py -qgz Test.qgz -qpt Template.qpt +================================================================================ 搴撶畝浠� +鏍煎紡鍖栵細ctrl + alt + l +PyQGIS搴撶殑浜斾釜鍖咃細 +qgis.core 杩欐牱鍙互璁块棶鏁翠釜QGIS涓娇鐢ㄧ殑鏍稿績GIS鍔熻兘銆� +qgis.gui 杩欏畾涔変簡涓�绯诲垪GUI灏忛儴浠讹紝鎮ㄥ彲浠ュ湪鑷繁鐨勭▼搴忎腑鍖呭惈杩欎簺灏忛儴浠躲�� +qgis.analysis 杩欐彁渚涗簡绌洪棿鍒嗘瀽宸ュ叿鏉ュ垎鏋愮煝閲忓拰鏍呮牸鏍煎紡鏁版嵁銆� +qgis.networkanalysis 杩欐彁渚涗簡鏋勫缓鍜屽垎鏋愭嫇鎵戠殑宸ュ叿銆� +qgis.utils 杩欏疄鐜颁簡鍚勭鍔熻兘锛屽厑璁告偍浣跨敤Python浣跨敤QGIS搴旂敤绋嬪簭銆� +================================================================================ 鎵ц +exec(open('E:/terrait/TianJin/LFServer/QGIS/render.py', encoding='utf-8').read()) + +python E:/terrait/TianJin/LFServer/QGIS/main.py +python E:/terrait/TianJin/LFServer/QGIS/render.py -qgz Test.qgz -qpt Test.qpt +================================================================================ +https://blog.csdn.net/qq_44894692/article/details/125956196 +澶╁湴鍥惧奖鍍忥細 +http://t0.tianditu.gov.cn/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=94a34772eb88317fcbf8428e10448561 > 娉ㄨ +http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=94a34772eb88317fcbf8428e10448561 > 褰卞儚 +澶╁湴鍥剧煝閲忥細 +http://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=94a34772eb88317fcbf8428e10448561 > 娉ㄨ +http://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=94a34772eb88317fcbf8428e10448561 > 鐭㈤噺 + +娣诲姞澶╁湴鍥撅細 +https://mp.weixin.qq.com/s?__biz=MzA4NzAzMjc5Mg==&mid=2247484627&idx=1&sn=6a03729cafc8938aa33801c4bccee804&scene=21#wechat_redirect +================================================================================ +https://blog.csdn.net/qq_23034515/article/details/107643428 +https://vimsky.com/examples/detail/python-ex-qgis.core-QgsPrintLayout-itemByUuid-method.html # ReadWriteXml +https://vimsky.com/zh-tw/examples/detail/python-ex-qgis.core-QgsLayoutFrame-setId-method.html # Python QgsLayoutFrame.setId + +https://mrdata.usgs.gov/services/nmra?version=1.3.0 # WMS鏈嶅姟 +https://mrdata.usgs.gov/services/nmra?request=getcapabilities&service=WMS&version=1.3.0& +https://mrdata.usgs.gov/services/nmra?request=GetMetadata&layer=Alkaline_AuTe + +1.鎼缓QGIS+Python寮�鍙戠幆澧� +2.鎵垮痉楂樻柊鍖烘寚鎸ュ钩鍙帮紝灏嗗拰瀵硅闆嗘垚鍒颁富绔欑偣(http鍗忚)涓� +3.qgis python浜屾寮�鍙� +================================================================================ +<Extent xmax="146.8160000000000025" ymin="9.56599999999999895" xmin="59.05799999999999272" ymax="64.12399999999999523"/> + +A0 = 1200 dpi = 14043 * 9933 +A1 = 850 dpi = 9933 * 7015 +A2 = 600 dpi = 7015 * 4960 +A3 = 424 dpi = 4960 * 3507 +A4 = 300 dip = 3507 * 2480 +A5 = 212 dip = 2480 * 1748 +A6 = 150 dip = 1748 * 1240 -- Gitblit v1.9.3