Tag Info

New answers tagged

0

@comments If you cant set a Parameter 'slider: false' for the Basic layer group (you are using map.getLayerGroup()) then you should just set the slider for all layers true resp. false/undefinded for the ones who shouldn't have a slider. After that switch the If-statment. var slider = layer.get('slider'); var name = layer.get('name') ? ...


0

Not sure if this is still up to date, but in the LocationTech Geoff project I am using OpenLayers 3 embedded in a Java environment for visualizing geodata. Maybe, you can get some impressions from the code/approach or even better use the project as a framework. It provides a simple to use Java API. Currently, it has support for SWT, but support for the ...


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 ...


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" ...


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.


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 ...


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.


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 ...


0

Create the xy event layer using the Add Delimited Text layer tool. Once you have the point data loaded define the CRS as whatever the point coordinates are in (e.g. EPSG:4326 - WGS 84), then export out the event layer to a actual GIS point layer (e.g. Shapefile or something else). Finally, make sure your Project>Project Properties>CRS setting for Enable ...


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 ...


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 ...


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


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.


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.


1

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


0

Nice map! That was a bug that was fixed (documented here). From what I can see in your map, that does not happen anymore.


0

When the row limit of Excel is exceeded, this should be an indication to switch to a database. Use PostGIS, put an index on the timestamp and animating that table with QGIS Time Manager will be a breeze.


0

Maybe you'd be better off doing a spatial join the other way around? Not sure I understand what you mean by "more data". More columns of attributes or more records/features?


0

Just try to pass the viewparams as part of the WMS_URL: var viewparams = [ 'x1:' + startCoord[0], 'y1:' + startCoord[1], 'x2:' + destCoord[0], 'y2:' + destCoord[1] ]; var baseURL="http://192.168.0.34:8080/geoserver/wms"; var better_BaseURL=encodeURI(baseURL+"?viewparams="+viewparams.join(';')); var myLayer = ...


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 = ...


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 ...


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.



Top 50 recent answers are included