Skip to content

Instantly share code, notes, and snippets.

@lzghzr
lzghzr / openstd.samr.gov.cn(原gb688)PDF文件载入流程.md
Last active September 7, 2023 07:03
openstd.samr.gov.cn(原gb688)PDF文件载入流程

0. 免责声明

没啥卵用, 但依然要说明一下, 本文未包含版权内容, 且未对所诉网站之程序进行破坏, 文章内容均为学习交流之用

1. 前言

2021年前, gb688 手机版使用的明文 pdf, 可直接下载, 不需要额外处理
2021年开始, 新站 openstd, 开始全面启用 pdf.js, 至此, 手机版也使用与 pc 同样加密技术
2022年4月, 网站弃用 pdf.js, 全面使用图片拼接模式, 本文内容已过时

2. 文件预览

openstd文件以两种方式开放给用户, 一种为直接下载, 另一种为在线预览

from qgis.core import Qgis, QgsMapLayer, QgsPointXY, QgsProject
from qgis.utils import iface
def create_joyplot():
rlayer = iface.activeLayer()
if rlayer.type() != QgsMapLayer.RasterLayer:
iface.messageBar().pushMessage("Error", "Please select a DEM layer", level=Qgis.Critical)
@AsgerPetersen
AsgerPetersen / notes.md
Last active April 27, 2024 13:27
Debugging QGIS 3.x python plugins on OSX using VS Code

Debugging QGIS 3.x python plugins on OSX using VS Code

Plugin

In QGIS install the plugin debugvs.

Python dependencies

The debugvs plugin needs the python module ptvsd to function. This module is not installed by default.

In principle you just pip install ptvsd in the python interpreter used by QGIS.

1.OSRM及前端工具安装部署与调试
1.1 OSRM安装
代码下载(https://github.com/Project-OSRM/osrm-backend)
安装依赖库
sudo apt install build-essential git cmake pkg-config \
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
编译安装
mkdir -p build
cd build
@c060604
c060604 / exif.py
Created May 23, 2017 03:00
User python and piexif to write some gps info into jpg pictures.
import os
import piexif
from fractions import Fraction
def to_deg(value, loc):
"""convert decimal coordinates into degrees, munutes and seconds tuple
Keyword arguments: value is float gps-value, loc is direction list ["S", "N"] or ["W", "E"]
return: tuple like (25, 13, 48.343 ,'N')
"""
@AsgerPetersen
AsgerPetersen / readme.md
Last active June 23, 2020 14:44
PyCharm remote debug of QGIS on OSX

Based heavily on this old guide by TimLinux http://linfiniti.com/2012/09/remote-debugging-qgis-plugins-using-pycharm/

  • In PyCharm click menu "Run -> Edit Configurations" (Or click Edit Configurations in the dropdown in the toolbar)
  • Click the plus to add a new "Python Remote Debug" config
  • Name the config. Use port 53100 (Could probably be any high port)
  • Add to the python code:
import sys
sys.path.append('/Applications/PyCharm.app/Contents/debug-eggs/pycharm-debug.egg')