QGIS using Python Programming for Beginners
HTML-код
- Опубликовано: 10 сен 2024
- Hi Viewers,
From this video, you will come to know how to use python(Python Interface) in QGIS. For better understanding, follow below program:
Python Interface
iface
help(iface)
##Add Vector layer:
iface.addVectorLayer("d:/.../points.shp","points", "ogr")
##Zoom
iface.zoomFull()
iface.zoomToPrevious()
iface.zoomToNext()
##Active Layer
layer = iface.activeLayer()
##Attribute Table
iface.showAttributeTable(layer)
##Layer Properties
iface.showLayerProperties(layer)
##New Project
iface.newProject()
##Add New Layer
help(iface.addVectorLayer)
iface.addVectorLayer("d:/.../points.shp","points", "ogr")
layer = iface.activeLayer()
dir(layer)
##Feature details (Attributes)
for f in layer.getFeatures():
print (f)
run python
..............................
for f in layer.getFeatures():
print(f['place'], f['amenity'])
run python
....................
##Coordinates (Lat, Long)
for f in layer.getFeatures():
geom = f.geometry()
print (geom.asPoint())
run python
..............
for f in layer.getFeatures():
geom = f.geometry()
print (geom.asPoint().x())
runpython
.............................
for f in layer.getFeatures():
geom = f.geometry()
print(geom.asPoint().y(), geom.asPoint().x()) (Lat (y)/Long(x))
run python
................................
##Coordinates along with Other Fields
for f in layer.getFeatures():
geom = f.geometry()
print ('%s, %s, %f, %f' % (f['place'], f['amenity'], geom.asPoint().y(), geom.asPoint().x()))
run python
.............................
Very useful for beginners like me. Thank you so much for this lecture..
Yes, thank you. Follow the channel for further updates.
Can I contact you bro please help me to learn i am biginner please help me🙏🙏..i.. request..you.
My coding not working in qgis 3.16
The background chill music here is so underrated🙂.
Thank you so much for suggestion. I will look it..Keep follow the channel for updates.
great video, thanks for sharing!!
Thanks for watching! Keep watching for updates..
Thank you for the tutorial...very helpful...
You're welcome 😊....Keep watching for updates
thanks for sharing your text file !
It's my pleasure
Woooww your video is easy to understand nyc representation why r u not providing more videos related to it
Thank you very much for comment. Definitely, i will workout and present more info. Please keep follow the channel for updates.
@@msrgeospatialsolutions yes sir
the background music made me feel like i went to heaven yo learn from this video...😂
Could you make a video relating to use Qgis on VS code.
I think I once watched one of your vicdeos where you said in the intro something along the lines of "I am gonna do this and that and then also split it up in several functions, organize it.... I would like to find this, because I really need to know how to solve the problem that QGIS is not updating all my scripts unless I close and restart the program...
You could make a program that calculates contour lines that runs outside of qgis
Thank you for comment. I will let you know the details soon if possible.Keep follow the channel for updates.
Please add the link of the background music either in comment section or the description.
Thanks for the comment, i will try to search it. Basically downloaded from web only.
Sir I am trying to ##add vector layer but that's not working
if i want to mark some points from that set of points using my ml model .. what to do??
Thanks for the comment. I will check and let you know, if possible.
Hi and thanks for video, trying to find a tutorial for QGIS python, want to create some points with an algorythm on differents shapefiles ans save location with GPS data in a text file, I know it's possible but cannot find a sample...
If you know what is the library I need to search (or use), it will be helpful.
Thanks for helping. 🙃👍
Thanks for comments. Tell me exactly what is your requirement? Keep watching for updates.
> Presents techniques for integrating with the API of a GIS application.
> Writes the source code in MS Word >____>
Presentation is good. what is purpose of using python code in QGIS sir?
QGIS is having excellent programming interface that allows you to extend the functionality of the software as well as write scripts to automate your tasks/works. QGIS supports the popular Python scripting language. By using python you can save time, create workflow and can prepare plugins to run the various processes.
hi sir, can you please make video how to create plug-in in qgis ???
Thank you for comment. I will let you know, if time permits.
Can you help me, i want to get some coordinates from shp file. Than that coordinates copy to attribute table in same shp file. How i can get it?
Thank you for info. Please go through the link to get coordinates
ruclips.net/video/qe7XdmdgPqE/видео.html
With python. Pyqgis
@@alexbundalo1926 Thank you. Let me check the availability of code.
Hello, great video!
Can you share the text file with me?
Very helpful👌 Is the Word document accessible?
What could be the problem?
iface
Great presentation is the word document available online? Would be a very useful tool
Yes, it is....Give me your mail
How to use pyqgis from pycharm?
Nice presentation, please can you help me on how to use python to set the map units into feet
At the moment my map canvas is set to meters and I would want to change it to feet
Ok..Go to Project - Properties - Change Units under Measurements.
Let me check it.
How to create line and and polygon
Everything is good but stop zooming in and out every other minute, brother.
Thank you for support.
stupid music in background makes it useless