- Install
ptvsd
using the same Python interpreter Qgis uses. E.g. on Windows:
C:\OSGeo4W64\apps\Python37\python.exe -m pip install ptvsd==4.3.2
- Add a debug configuration to
launch.json
:
{
"name": "Python: Remote Attach",
#!/usr/bin/env python3 | |
# vim: ft=python ts=4 sw=4 expandtab | |
# | |
# Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
# ---------------------------------------------------------------------------------------------------------------------- | |
# Name: CompareCompression.py | |
# Py-Version: 3.x.x | |
# Purpose: Takes a sample GeoTIFF and writes a table to the command line describing the | |
# file size, read speed, and write speed of each GDAL compression. You can use this | |
# tool to decide how to best compress a single image, or a collection of images. | |
# | |
# Notes: The Python interpreter and GDAL must be accessible by cmd. The easiest way to do | |
# this by using the python installation included with ArcGIS Pro 2.3.x and later. | |
# This installation has the GDAL site package and binaries already configured. Add |
__author__ = 'kersten.clauss' | |
"""Benchmark different GeoTiff compression algorithms. | |
Usage: GTiff_compression_benchmark.py some_geo.tif | |
Requires the GDAL tools to be present and executable from the command line of your system. | |
This script will take a GeoTiff as input and create copies with different compression algorithms from it. | |
It measures the filesize, compression and decompression times and returns them as a table. |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim: ft=python ts=4 sw=4 expandtab | |
# | |
# Copyright (c) 2013 Reed Kraft-Murphy <reed@reedmurphy.net> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
ptvsd
using the same Python interpreter Qgis uses.
E.g. on Windows:C:\OSGeo4W64\apps\Python37\python.exe -m pip install ptvsd==4.3.2
launch.json
:{
"name": "Python: Remote Attach",
A windows version inspired by this lovely gist: https://gist.github.com/AsgerPetersen/9ea79ae4139f4977c31dd6ede2297f90
In QGIS install the plugin debugvs
.
The debugvs
plugin needs the python module ptvsd
to function. This module is not installed by default.
if ( | |
distance( | |
overlay_nearest( | |
layer:='poligono', | |
expression:= $geometry )[0], $geometry) < | |
distance( | |
overlay_nearest( | |
layer:='linea', | |
expression:= $geometry )[0], $geometry),overlay_nearest( | |
layer:='poligono', |