管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2022-11-10 e0efc6467622bf9944535ef15a4ab5abc44d2686
1
已修改3个文件
16 ■■■■■ 文件已修改
ExportMap/Sources/Test.qpt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/Sources/render.py 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/Sources/说明.txt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/Sources/Test.qpt
@@ -196,7 +196,7 @@
   </dataDefinedProperties>
   <customproperties/>
  </LayoutObject>
  <Extent xmax="146.81582480887351494" xmin="59.05829972526095162" ymin="9.57730491702214692" ymax="64.11233836183852475"/>
  <Extent xmin="103.394023" ymin="30.690466" ymax="37.871048" xmax="112.534648"/>
  <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>
ExportMap/Sources/render.py
@@ -82,8 +82,11 @@
# map = layout.itemById(r'地图')
map = layout.referenceMap()
map.zoomToExtent(map.extent())
# map.zoomToExtent(map.extent())
print('1:' + str(math.ceil(map.scale())))
size = map.sizeWithUnits()
print('size: ' + str(size.width()) + " * " + str(size.height()) + " mm")
# è®¾ç½®å›¾å±‚
# "阀室", "站场", "管道中心线", "矢量注记", "矢量图", "高德影像注记", "高德影像", "影像注记", "影像图"
@@ -93,9 +96,9 @@
# set_layers_valid(project, showLayers)
set_item_visibility(root, showLayers)
collection = layout.pageCollection()
page = collection.page(0)
page.refreshItemSize()
# collection = layout.pageCollection()
# page = collection.page(0)
# page.refreshItemSize()
# åˆ·æ–°
map.refresh()
ExportMap/Sources/˵Ã÷.txt
@@ -21,6 +21,9 @@
>>> import qgis.core
python E:/terrait/TianJin/ExportMap/ExportMap/Sources/render.py -qgz Test.qgz -qpt Template.qpt
<Extent xmin="59.058299" ymin="9.565969" ymax="64.123674" xmax="146.815824"/>
<Extent xmin="103.394023" ymin="30.690466" ymax="37.871048" xmax="112.534648"/>
================================================================================ åº“简介
格式化:ctrl + alt + l
PyQGIS库的五个包: