ubuntu20.04安装QGIS

0.引言

1.QGIS install

Note:这种方法安装的是最新版本,可能会有一些兼容问题。我这里是卸载了重新安装,卸载参考,删不干净,最后手动 搜索并收删除相关文件。然后直接使用命令行安装,自动适配:sudo apt install -f qgis qgis-plugin-grass


官方安装方式:

  • 安装依赖项 sudo apt install gnupg software-properties-common

  • 安装 QGIS 签名密钥,信任并安装 QGIS 存储库的 QGIS 软件:

    sudo mkdir -m755 -p /etc/apt/keyrings  # not needed since apt version 2.4.0 like Debian 12 and Ubuntu 22 or newer
    sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg
    
  • 查看 your-distributions-codename: lsb_release -cs
    在这里插入图片描述

  • 将最新稳定版 QGIS (3.36.x Maidenhead) 的 QGIS 存储库添加到 /etc/apt/sources.list.d/qgis.sources

    Types: deb deb-src
    URIs: https://qgis.org/debian
    #这个也行https://download.qgis.org/ubuntugis-ltr
    #Suites: your-distributions-codename
    Suites: focal
    Architectures: amd64
    Components: main
    Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg
    
  • 更新存储库sudo apt update

  • 安装QGIS: sudo apt install qgis qgis-plugin-grass qgis-server

Note:这种方法安装的是最新版本,可能会有一些兼容问题。我这里是卸载了重新安装,卸载参考,删不干净,最后手动 搜索并收删除相关文件。然后直接使用命令行安装,自动适配:sudo apt install -f qgis qgis-plugin-grass

2.插件

(1) tiandi-tool

  • 貌似需要申请个账号?

  • 报错:

    无法加载插件“tianditu-tools”因在调用其classFactory()方法时发生错误 
    AttributeError: type object 'Qt' has no attribute 'MarkdownText' 
    

在这里插入图片描述

ref 解决 : pip3 install PyQt5==5.15.6

  • 报错:
    无法加载SIP模块。
    Python支持将被禁用。
    

在这里插入图片描述

ref 解决:python -m pip uninstall pyqt5 pyqt5-sip qtconsole

3.简单教程

在这里插入图片描述

瓦片连接如下:

高德矢量:http://webrd01.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8

高德影像:https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}

腾讯影像(更正:http://rt0.map.gtimg.com/realtimerender?z={z}&x={x}&y={-y}&type=vector&style=0

OSM矢量(已失效):https://tile.openstreetmap.org/{z}/{x}/{y}.png

4.加载自己数据

将 SLAM 结果转换为 geojson 格式:

import json

# 读取原始 JSON 文件
with open('optimized_keyframe_poses.json', 'r') as f:
    data = json.load(f)

# 转换为新的格式
features = []
for item in data:
    geometry = {
        "type": "Point",
        "coordinates": [item['pose']['trans'][0], item['pose']['trans'][1]]
    }
    properties = {
        "id": item['idx'],
        "stamp": item['timestamp']
    }
    feature = {
        "type": "Feature",
        "geometry": geometry,
        "properties": properties
    }
    features.append(feature)

# 构建最终的 GeoJSON 结构
geojson = {
    "type": "FeatureCollection",
    "name": "track",
    "features": features
}

# 将转换后的结果保存为新的文件
with open('optimized_keyframe_poses_geo.json', 'w') as f:
    json.dump(geojson, f, indent=2)

加载自己数据进行投影:

在这里插入图片描述

在这里插入图片描述

相关推荐

  1. Ubuntu 下 Docker安装 2024

    2024-03-28 06:44:04       28 阅读
  2. Ubuntu2204安装小熊猫C++/DevCpp

    2024-03-28 06:44:04       75 阅读
  3. ubuntu2204,mysql8.x安装

    2024-03-28 06:44:04       59 阅读
  4. ubuntu2004,自动安装mysql5.7.37

    2024-03-28 06:44:04       33 阅读
  5. 基于arm的ubuntu上运行qgc

    2024-03-28 06:44:04       38 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-28 06:44:04       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-28 06:44:04       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-28 06:44:04       87 阅读
  4. Python语言-面向对象

    2024-03-28 06:44:04       96 阅读

热门阅读

  1. 基础NLP知识了解

    2024-03-28 06:44:04       38 阅读
  2. 【aws】什么是assume role

    2024-03-28 06:44:04       35 阅读
  3. Qt实现TFTP Server和 TFTP Client(四)

    2024-03-28 06:44:04       37 阅读
  4. 关于LLM的简单赘述

    2024-03-28 06:44:04       39 阅读
  5. Microsoft VBA Excel 单元格 重复元素 去重

    2024-03-28 06:44:04       45 阅读
  6. 目标检测系列模型发展历程

    2024-03-28 06:44:04       48 阅读
  7. ubuntu20搭建Gitlab本地服务器(简洁版)

    2024-03-28 06:44:04       40 阅读
  8. OpenCV图像处理——图像矩

    2024-03-28 06:44:04       43 阅读
  9. 解锁社交媒体图像内容的深度学习之道

    2024-03-28 06:44:04       39 阅读