| | |
| | | </custom-order> |
| | | </layer-tree-group> |
| | | </LayoutItem> |
| | | <LayoutItem templateUuid="{4e649c5d-cabe-431f-a385-d69809d87ebf}" excludeFromExports="0" id="é室,管éä¸å¿çº¿,é«å¾·å½±å" background="true" followPresetName="" blendMode="0" zValue="2" positionLock="true" visibility="1" type="65639" frameJoinStyle="round" keepLayerSet="false" uuid="{4e649c5d-cabe-431f-a385-d69809d87ebf}" isTemporal="0" frame="true" followPreset="false" position="9.47563,16.5367,mm" outlineWidthM="4,px" drawCanvasItems="false" itemRotation="0" groupUuid="" positionOnPage="9.47563,16.5367,mm" labelMargin="0,mm" size="278.717,173.275,mm" referencePoint="0" opacity="1" mapRotation="0" mapFlags="0"> |
| | | <LayoutItem templateUuid="{4e649c5d-cabe-431f-a385-d69809d87ebf}" excludeFromExports="0" id="å°å¾" background="true" followPresetName="" blendMode="0" zValue="2" positionLock="true" visibility="1" type="65639" frameJoinStyle="round" keepLayerSet="false" uuid="{4e649c5d-cabe-431f-a385-d69809d87ebf}" isTemporal="0" frame="true" followPreset="false" position="9.47563,16.5367,mm" outlineWidthM="4,px" drawCanvasItems="false" itemRotation="0" groupUuid="" positionOnPage="9.47563,16.5367,mm" labelMargin="0,mm" size="278.717,173.275,mm" referencePoint="0" opacity="1" mapRotation="0" mapFlags="0"> |
| | | <FrameColor blue="0" green="0" red="0" alpha="255"/> |
| | | <BackgroundColor blue="255" green="255" red="255" alpha="255"/> |
| | | <LayoutObject> |
| | |
| | | <property key="imageCropMarginTop" value="0"/> |
| | | <property key="imageCropToContents" value="false"/> |
| | | <property key="singleFile" value="true"/> |
| | | <property key="layers" value="é室,管éä¸å¿çº¿,é«å¾·å½±å"/> |
| | | <property key="imgPath" value="E:/terrait/TianJin/LFServer/QGIS/render.png"/> |
| | | </customproperties> |
| | | <Atlas coverageLayer="" filterFeatures="0" sortFeatures="0" enabled="0" hideCoverage="0" pageNameExpression="" filenamePattern="'output_'||@atlas_featurenumber"/> |
| | | </Layout> |
| | |
| | | node.setItemVisibilityChecked(flag) |
| | | |
| | | |
| | | QgsApplication.setPrefixPath(r"C:/Program Files/QGIS 3.16/bin", True) |
| | | # QgsApplication.setPrefixPath(r"E:/terrait/TianJin/LFServer/QGIS/", True) |
| | | qgs = QgsApplication([], True) |
| | | qgs.initQgis() |
| | | |
| | | project = QgsProject.instance() |
| | | project.read(r'E:/terrait/TianJin/LFServer/QGIS/Test.qgz') |
| | | project.read(r'Test.qgz') |
| | | print("FileName: " + project.fileName()) |
| | | |
| | | # layout = QgsPrintLayout(project) |
| | | layout = QgsLayout(project) |
| | | # layout.initializeDefaults() |
| | | |
| | | with open(r"E:/terrait/TianJin/LFServer/QGIS/Template.qpt", 'r', encoding='utf-8') as f: |
| | | with open(r"Template.qpt", 'r', encoding='utf-8') as f: |
| | | template_content = f.read() |
| | | doc = QDomDocument() |
| | | doc.setContent(template_content) |
| | |
| | | |
| | | # "é室", "ç«åº", "管éä¸å¿çº¿", "ç¢é注记", "ç¢éå¾", "é«å¾·å½±å注记", "é«å¾·å½±å", "影忳¨è®°", "å½±åå¾" |
| | | # showLayers = ["é室", "管éä¸å¿çº¿", "ç¢é注记", "ç¢éå¾"] |
| | | showLayers = map.id().split(',') |
| | | showLayers = layout.customProperty("layers").split(',') |
| | | root = project.layerTreeRoot() |
| | | # setLayersValid(project, showLayers) |
| | | setItemVisibility(root, showLayers) |
| | |
| | | map.refresh() |
| | | |
| | | exporter = QgsLayoutExporter(layout) |
| | | img_path = os.path.join(r"E:/terrait/TianJin/LFServer/QGIS", "render.png") |
| | | # 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() |
| | |
| | | 天å°å¾ç¢éï¼ |
| | | 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 |