spatialthoughts / courses Goto Github PK
View Code? Open in Web Editor NEWCode and HTML page repository for courses.spatialthoughts.com
Code and HTML page repository for courses.spatialthoughts.com
You can dramatically improve the performance of the https://courses.spatialthoughts.com/qgis-actions.html#select-features-in-a-buffer-zone example by using the option to pass a rectangle to QgsVectorLayer.getFeatures()
:
line_layer = QgsProject.instance().mapLayer('[% @layer_id %]')
polygon_layer_name = 'buildings'
distance = 20
fid = [% $id %]
line_feature = line_layer.getFeature(fid)
line_buffer = line_feature.geometry().buffer(distance, 5)
polygon_layer = QgsProject.instance().mapLayersByName(polygon_layer_name)[0]
nearby_features = [
p.id()
for p in polygon_layer.getFeatures(line_buffer.boundingBox())
if p.geometry().intersects(line_buffer)
]
polygon_layer.selectByIds(nearby_features)
This allows the request to use a spatial index (if exist) to quickly limit the number of features to just the candidates that intersect the rectangle. So the if ... intersects
only has to check those remaining buildings. Not much of a noticeable difference in the example data but with bigger datasets it will be a huge speed improvement.
Shout if you'd like it, then I'd make a pull request. Would you like to include both versions for the users to experience and learn?
Locate the updated URL and change it at https://www.qgistutorials.com/en/docs/3/importing_spreadsheets_csv.html
If needed, update the steps.
https://courses.spatialthoughts.com/introduction-to-qgis.html
The correct syntax is
[Back to Top](#){style='float:right'}
https://www.qgistutorials.com/en/docs/3/georeferencing_basics.html
Add an overlay text for 'Select CRS' button in Step 9.
Feedback from https://www.qgistutorials.com/en/docs/3/georeferencing_basics.html#comment-5617670103
https://courses.spatialthoughts.com/end-to-end-gee-supplement.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.