Tag Info

Hot answers tagged

4

Out of the box, field calculator does not support spatial joins across feature layers. But, if you have a look at NathanW's post on the function editor for qgis expressions you will be able to make out that we can script our own data interaction. The following script will allow you to express what you're after. It works by iterating through all features ...


3

I think you are asking for the username of a layer's SDE connection. You need to use IWorkspace and IPropertySet. Something like this: Dim pDataset As IDataset = the feature layer/raster layer you want the user name of Dim pWorkspace As IWorkspace = pDataset.Workspace Dim pPropertySet As IPropertySet = pWorkspace.ConnectionProperties Dim userName As String ...


3

I've certainly created something like this; it's a great use for definition queries. Here's a copy/paste/modification from a tool I've written. You'll have to look up how to create a script tool in a toolbox. When you do, make two parameters, one to hold the input shapefile/feature class (type = Feature Class or Layer), and one to enter the "layer by" ...


3

You could use this function: def laylist(): l=[] for layer in iface.mapCanvas().layers(): item = layer.name() l.append(item) print l or this one, if you only want to get layer names printed: def laylist(): for layer in iface.mapCanvas().layers(): print layer.name() Tested in the QGIS Python console. EDIT: In ...


2

I am rather new to QGIS as well so there may be a much better way to accomplish map tip suppression for individual layers: Just made a quick test with v2.8.2 on Windows. From the "Display" page of the layer properties, setting the Map Tip to display to be a field filled with NULL values results in no map tip for that layer. I also found if the map tip ...


2

As Sercan says this sounds an awful lot like coordinate systems not lining up properly. When you zoom to the separate layers are you ending up with stupid scale readings? If so you probably haven't set up the correct transformations and coordinate systems.


2

I would add an if statement and a GetCount_management before your SaveToLayerFile_mangement. If the feature layer has no records, you can skip the iteration. Maybe: if int(arcpy.GetCount_mangement (name_of_layer).getOutput (0)) == 0: continue


2

You could try exporting the whole project with extent and pixel size=resolution set to match the input files: qgis --project myproject.qgs --snapshot image.png --width 1500 --height 1000 --extent xmin,ymin,xmax,ymax cf. http://anitagraser.com/2010/11/30/creating-high-resolution-images-using-qgis/ edit: that's comparable to Project->Save As Image ...


1

You can get the layers selected in the TOC with something like this selectedLayers = iface.legendInterface().selectedLayers() the selectedLayers method in QgsLegendInterface do the trick.


1

When you're building the layer tree you need to check the layer.getVisible() value and assign the correct eye icon. See the example below: http://jsfiddle.net/arcf7k77/2/ Alternatively, you could use something like knockout or angular to support the binding. Further to your comment, in order to persist the eye icon state recursively, you would need to ...


1

An option that has worked for me is using the data source options you have from python. This has allowed me to write a script to transfer pie chart symbology, which isn't possible for some reason with standard tools. It also lets me repair broken links where symbology gets dropped when the data source is relinked from layer properties. You can also relink ...


1

I suspect that the default location into which outputs of your geoprocessing tools are written, has been reset by the upgrade. Next time you run a tool pay careful attention to the workspace into which the output is being written, and check that against the source of any layer that you are expecting it to overwrite.


1

I Was able to find Solution. In my Original code I was three separate list that were created from a search cursor. Each of these list consisted of a unique values within the fields. But really what I am interested in is the unique value of three fields combined So instead of doing three separate Search cursor's I did one but extracted the three fields ...


1

I found an answer with a count & group by: select c.gid, c.*, count(c.gid) from c1 join c2 on st_disjoint(c1.geom, c2.geom) WHERE c2.nom_comm ILIKE 'blabla' GROUP BY c.gid having count(c.gid) >22 ; 22 means disjoint with all features of c2.


1

In QGIS use the dissolve function from menu: Vector > Geoprocessing Tools > Dissolve... This will get you a new table with only the outer perimeter geometry.


1

What kind of projection systems do you use for your layers? I think your layers have different projection systems.


1

The problem is that 'QgsVectorLayer' objects have not attribute 'renderer'. This kind of method is for raster layers. If you want to change the transparency of QgsVectorLayer objects you have to use the method: 'setLayerTransparency(int)'; located in QgsVectorLayer class. Next code works for these kind of objects: mc=iface.mapCanvas() layers=[] n = ...


1

Thank you for your help! (Nathan helped me on the QGIS issue tracking page with the same advice he posted here and that mapBaker also posted). I added a unique int column to this table and then it loaded the layer with no problem. Thanks again.


1

Gery, I am in a similar situation. I donĀ“t need to hide or show the different rasters separately. If that's OK for you, this is what I did: As far as I know, in the mapfile - Layer - Data you can only specify one file, but you can create several identical layers with the very same name, each one of them pointing to a different raster. Loading this WMS ...



Only top voted, non community-wiki answers of a minimum length are eligible