QGIS Python (PyQGIS) - Add layer to a map layout

  Рет қаралды 12,494

Geospatial School

Geospatial School

Күн бұрын

Пікірлер: 23
@no_justno
@no_justno 10 ай бұрын
Please don't apologize for those mistakes. Those mistakes make this more informative than anything else because we learn what common errors we can make and avoid them preemptively. Your work is phenomenal.
@geospatialschool
@geospatialschool 10 ай бұрын
Thank you!
@babuvanam9448
@babuvanam9448 4 жыл бұрын
Thank you very much, your tutorials helped me a lot,how can I create frame in print layout using python
@tofusandwich5016
@tofusandwich5016 4 жыл бұрын
That's really useful, thank you. Do you know how to apply a theme by name to the layout?
@teo11300
@teo11300 4 жыл бұрын
Now I'd like to see this scripted outside of a QGIS session, in a standalone python script. Using a popular IDE like PyCharm.
@jonathanlalrinawma7919
@jonathanlalrinawma7919 2 жыл бұрын
I get a error when i put a code layer = layers[0] like this File "", line 4, in IndexError: list index out of range can you please help me
@brennafrank3132
@brennafrank3132 Жыл бұрын
same
@diwaker8616
@diwaker8616 4 жыл бұрын
Hello Friend, Could you pleae help how i can add the google map [live -street view] in QGIS? Idea is to analyze the situation while jumping on to an old location with the current live situation. I looked into your videos but couldn't find it any of the videos. May be a plug in would be helpful, if any.
@babuvanam9448
@babuvanam9448 4 жыл бұрын
I was able to label my shape file using python but I have to label using expression Label expression is like below wordwrap("name",-3) || ' ' || "value" name and value are attributes how to do this using python?? Thanks in advance 😊
@pavel_pereverzev
@pavel_pereverzev 5 жыл бұрын
Great tutorial! I need to create a table item in layout that contains coordinates. Is it possible to do in pyqgis?
@geospatialschool
@geospatialschool 5 жыл бұрын
Thanks! I haven't looked into tables yet, and haven't seen any tutorials on it. I think it would be possible to do, but might take a little work to figure out. I'll have a video next week that shows how to add legends and scalebars. You may be able to follow the same general idea to add a table.
@pavel_pereverzev
@pavel_pereverzev 5 жыл бұрын
@@geospatialschool okay, will be waiting for it! I thought about making a simple text label that contains text with tabulations and ' ' sequences to write every pair of coordinates in a new line, but that would be too ugly to watch it without borders.
@geospatialschool
@geospatialschool 5 жыл бұрын
Here's a link to the python documentation for the table item: qgis.org/pyqgis/3.0/core/Layout/QgsLayoutItemTextTable.html I haven't worked with it yet, but it seems like it will get you what you want. This is something I could try to do in a future video.
@pavel_pereverzev
@pavel_pereverzev 5 жыл бұрын
@@geospatialschool yeah, I saw that and moreover tried to use more simple thing that load attribute table to layout. But pyqgis throws an error that tells that table layout class doesn't support by layout's method of adding features. Also create a new question here, still waiting for someone who knows;) gis.stackexchange.com/questions/314721/how-to-add-attribute-table-into-layout-pyqgis-3-x
@geospatialschool
@geospatialschool 5 жыл бұрын
I tried your code and got the same error. I tried some other things, and couldn't get it to work either. It could be a bug on the QGIS end, because I think it should work. I also can't construct a QgsLayoutItemAttributeTable the same way as other layout items. For the other items I can call it like this: QgsLayoutItemAttributeTable(layout), but that throws an error about a C++ abstract class. I have to call it using the create() method like you have done.
@vagvaf
@vagvaf 4 жыл бұрын
Hey that's really great and helpful! How about displaying two layers in two maps within the same layout? I tried fiddling with the code (create a layer2 and map2 and then ms2.setLayers([layer2])) but it will display the first layer. any ideas?
@geospatialschool
@geospatialschool 4 жыл бұрын
Did you add the second map item to the layout? Like this: layout.addLayoutItem(map2)
@vagvaf
@vagvaf 4 жыл бұрын
Hey, thanks for your quick response! Yes, I did. I understand that this is not stack exchange but in cause you wanna have a look at the code: pastebin.com/aVQXYrzZ thanks again
@willerfagundesdeoliveira3261
@willerfagundesdeoliveira3261 5 жыл бұрын
Nice!!!
@geospatialschool
@geospatialschool 5 жыл бұрын
Thanks! I'll have a video next week that shows how to add a legend and scalebar
@irpanhidaya5329
@irpanhidaya5329 Жыл бұрын
code please, hahaha, thanks so much
QGIS Python (PyQGIS) - Export print composer as image and PDF
5:16
Geospatial School
Рет қаралды 7 М.
QGIS Python (PyQGIS) - Calculate Field Values (Field Calculator)
18:06
Geospatial School
Рет қаралды 13 М.
哈哈大家为了进去也是想尽办法!#火影忍者 #佐助 #家庭
00:33
火影忍者一家
Рет қаралды 130 МЛН
버블티로 부자 구별하는법4
00:11
진영민yeongmin
Рет қаралды 23 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 12 МЛН
How to Make a QGIS Plugin
24:03
GIS Coordinated
Рет қаралды 18 М.
Introducing: the AI Georeferencer for QGIS
5:58
Bunting Labs
Рет қаралды 2,3 М.
QGIS Python (PyQGIS) - Buffer Features
15:10
Geospatial School
Рет қаралды 9 М.
QGis tutorial - Plugin development - part 1
9:22
Rob
Рет қаралды 29 М.
QGIS Python (PyQGIS) - Create features (point)
10:04
Geospatial School
Рет қаралды 11 М.
How I Would Learn GIS (If I Had To Start Over)
24:46
Matt Forrest
Рет қаралды 80 М.