Tag Info

New answers tagged

1

With the next code you can get a ramp color red-yellow-blue . The min/max values for the renderer are got from raster stats. from PyQt4.QtCore import * from PyQt4.QtGui import * layer = iface.activeLayer() renderer = layer.renderer() provider = layer.dataProvider() extent = layer.extent() ver = provider.hasStatistics(1, QgsRasterBandStats.All) stats = ...


0

For this use case I'd suggest to specify the cutoffs by setting a respective query in General | Feature subset and then configure the graduated renderer. Similar results could be achieved using data-defined styling if you don't mind that QGIS currently cannot create a legend for data-defined styles.


2

There are two ways to accomplish this. In ArcMap load the layer in question and edit the symbology of the layer to your desired results. Then click ‘Save As’ in the Symbol Selector window and Name the symbology exactly the same name as the data layer. Now whenever that data layer is loaded in to ArcMap it will acquire the symbology with the same name. ...


1

You can load the CSV file directly (or have ftp load the file to your local drive) QGIS will detect the change and reload the data on the fly. If you want it to change use the 'watch file' result use wget to get the csv (every minute,hour,day etc) (task scheduler)


0

The warping does not work because your output format is not able to handle the warping. Try one of the formats listed in the error message, then use gdal_translate (or the QGIS menu translate) to transform to AAIGrid.


0

Figured I might as well post the answer I came up with here: from os import startfile baseurl = http://www.google.com/ someattribute = '[% "attributefield1" %]' someattributesplit = someattribute.partition(' ')[0] #get word before first space path = baseurl+someattributesplit startfile(path)


1

In QGIS 2.8 Double click on layer. Styles tab. There are Marker style assigned by default, under drop down menu find Simple marker. There will be attributes of marker, such as color and size. And small icon besides this fields which allows you to specify an expression for this attribute. (If you didn't found it, probably you haven't open dropdown list ...


0

This question is not the same but very related and the solution could work for me too, although it is not as straight forward as I would like it to be: How to map a building to only one grid which contain more than half of its area using qgis? Other suggestions are still welcome.


0

You could use the menu Vector->Data Management Tools->Join attributes by location. HTH.


0

In QGIS 2.8 you can try the new rule based styling. There is a video about it


-2

Qgis is not the best software for make a statistic map like proportional circle. If you want to use Qgis, you have to build manually circle's in fonction data's. For example, if you've value 50 and you make a circle of size 10, for value 100 you've to give a size of 20 to your circle. If you want to make a "real" statistic map, you can use the software ...


0

Use this little smart software: http://www.zonums.com/shp2kml.html Don't forget to export your shapes into wgs84 coordinate system.


-1

using qgis 2.8: Right Click on your layer > go to style > add a new style and choose your style. Once you are done, add a new style and Change it. You can remove them, rename them, and copy them and do whatever you want ! Another solution if you do not have qgis <2.8 is to copy your layer


0

Actually, with QGIS 2.8.2, it's not possible, see this bug. There was a plugin (not updated anymore), qgis2kml, but it's compatible only with QGIS 1.8.0. You can try this old version and use the plugin from here.


0

QGis now has a plugin called Vector Bender, which can spatially adjust Vector Data. You can see it in action in this Video: Presentation of Vector Bender from red on Vimeo.


2

The following Python can be used to sort features by some attribute, here the area, and increment some field, here named 'Rank'. The field should exist. Make your polygon layer the active layer and paste the following code into Python console. aLayer = qgis.utils.iface.activeLayer() # get active layer # create list of tupels of area and feature-id aList= ...


0

Can you give me the process for creating a hello word in a form, an use this project in QGis ? How can i start with QtCreator? Thank you


1

QGIS uses the Douglas-Peucker algorithm (slightly modified to handle closed loop like polygons, I think) and the unit of the tolerance parameter is the same as the unit of the reference system. Points are removed if the distance with the tentative simplified line is smaller than the tolerance.


1

The tolerance is a threshold that will usually determine the distance in which multiple nodes may be reduced into a single node or more. The documentation says the input for tolerance is a number and FWIW it represents map units from the coordinate reference system (ie, metres).


0

This is undoubtedly a topology problem with your data. I would recommend updating to the latest version of QGIS, this currently being 2.8.2 and running the Topology Checker (go to "Vector" tab) on all vector datasets concerned before ever running Dissolve process. This will identify erroneous topology which will then need to be manually rectified before ...


0

You can easily upgrade numpy by using Christoph Gohlkes precompiled Numpy wheels. Download the correct Numpy wheel Open a OSGeo4W Shell pip install numpy‑1.9.2+mkl.whl pip install pandas I did this on my machine and so far encountered no dependency errors in QGIS with the newer numpy version.


2

This is not QGIS but if you don't consider OpenJUMP Plus totally off-topic, then you can do it like this: Create a grid which has some unique ID as an attribute. Open grid layer and building layer as separate layers into a project. Use the Aggregate function of OpenJUMP Plus. Define that ID attribute will be aggregated by the "majority" criteria. ...


1

Intersect your building layer and grid layer (Vector > Geoprocessing Tools > Intersect). The result should be your buildings, cut up wherever they cross a grid line. Those pieces should have both the building id attribute and the grid cell id attribute. Open the attribute table use the Field Calculator to create a new field and calculate the area of each ...


0

I had the same problem, reinstalled python 2.7, upgraded qgis to 2.8.1, etc. My problem was caused by the configuration file. sudo rm ~/.config/QGIS/QGIS2.conf Executing the above in bash allowed QGIS to start up normally.


0

I found the solution. The error was that I didn't set GDAL_DATA environment variable: ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files. I managed environment variables in Windows and the command works right. Thanks four your help!!


0

Chris and underdark: It seems that there's no answer out-of-the-box. But your comments brought up to me a possible partial solution. One could re-use the "All-in-one Project" (AIOP) file package and plugin! As a publisher: First one would setup everything (symbology, symbols/fonts and a demo dataset). Then one could (somehow) remove the dataset, and ...


1

If you are using Linux, you should be able to connect to a WFS server, and fetch a layer without any problem with wget. I was able to fetch a dataset consisting of 10209 features, which was 33.3 MB in size. My test command was the following: wget -O output.gml ...


1

He uses a Mac. For the procedure, look at Configuring external applications. Check the path in Processing/Toolbox/Options/Providers/GRASS... If you use the KyngChaos version, there is a GRASS GIS 6.x version integrated in the QGIS application bundle and the path is /Applications/QGIS.app/Contents/MacOS/grass if you want to use another version of GRASS ...


1

For the first command line, you moved to the folder where the shapefiles are. You have to do the same for the second command line. My sample command line looks like: for %%N in (D:\Karten\gdal\ogr2ogr\*.csv) DO ogr2ogr D:\Karten\gdal\ogr2ogr\%%~nN.shp %%N pause giving full path for in and destination file. Update Testing your batch, it fails for me ...


0

I might have found the culprit: the code checks the wkbType of the layer https://github.com/qgis/QGIS/blob/master/src/plugins/roadgraph/linevectorlayerwidget.cpp#L135 if ( vl->wkbType() == QGis::WKBLineString || vl->wkbType() == QGis::WKBMultiLineString ) mcbLayers->insertItem( 0, vl->name() ); but it returns a weird value for the ...


1

You could try the OGR WFS option "-dsco OGR_WFS_PAGING_ALLOWED=ON" as described in the docs http://www.gdal.org/drv_wfs.html


0

Just rename the plugin folder, removing the dash: move mgrs-tools mgrstools ..or clone the git repository using a directory name without the dash. git clone https://github.com/volaya/mgrs-tools.git mgrstools or, now that the development has moved: git clone https://github.com/boundlessgeo/mgrs-tools.git mgrstools


0

QGIS 2.10 and above will have the ability to graduated by size alone built in.


1

Assuming all your text files are into the same directory, you can run this code snippet in the QGIS Python console to get your files loaded as individual layers in QGIS: import os.path, glob layers=[] for file in glob.glob('/tmp/xy/*.txt'): # Change this base path uri = "file://" + file + ...


1

Right click the attribute classification and select 'Change Color'. You can also change the size through the same context menu. In the screenshot below, I've changed all colors to yellow and implemented a size gradient.


1

In QGIS, the Georeferencer tool found under the Raster menu is the way to properly register an aerial photograph (or a scanned map, etc.) to your GIS mapping. Georeferencer is not automatic. It relies on you manually choosing points to register. The operation of this tool is documented at ...


1

QGIS does not write its log messages to a file by default. If you have a debug build (nightlies normally are) they are written to stdout. That means that you run it in a terminal on linux you will see the messages there. On Windows I think there is a tool called Debugging Tools for Windows or similar that can intercept the messages. An alternative is to ...


0

NetworkX (http://cheeseshop.python.org/pypi/networkx/) is a Python package with many functions for graph and network analysis. You can use it in QGIS analyze graphs without prior construction of topology. Your problem of connecting every point of a set A with points of a set B can be modeled as a bipartite graph. I use the data structure and some methods ...


0

Changing the CRS property does NOT change the coordinates. Inside QGIS, you have to use Save As ... to another file name and CRS EPSG:4326. Then the coordinates will be inside the bounds of +/- 180/90°.


0

There is now also the new relocator plugin. (marked as experimental as well at this moment). Gives you the opportunity to save all layers with the project file into one directory or even in a zip-file.


3

If your goal is to create a polygon representing the outline of a set of features, you're probably looking to create the concave-hull of this features set. While the creation of a convex-hull is a pretty straightforward operation, because there is only one possible convex-hull for a given set, this is not true in the case of the concave-hull. Because ...


0

The layer creation option separator should be helpful, i.e. SEPARATOR=TAB Based on the QgsVectorFileWriter.writeAsVectorFormat docs, this should do it (untested): QgsVectorFileWriter.writeAsVectorFormat(inputLayer, "D:/dstest/my_csv", "CP1250", None, "CSV", True, "", "SEPARATOR=TAB")


0

The tracking point function in the GPS information pane is meant to create nodes for connecting line segments in either a polyline, or polygon. When you are finished collecting the nodes you wish connected, you press the Add Line/Polygon button. When recording in a point layer, you will have to press the Add Point button for each location you wish to ...


1

The good news is that your data is good. Your file is not displaying correctly in ArcGIS because the spatial index for a shapefile is not updated during editing in QGIS. The comment reply by elrobis has an excellent suggestion to use ogr2ogr to export the file, which should fix the index problem. Simply deleting the spatial index files (.sbn and .sbx) will ...


0

Tom Patterson, the lead cartographer at the U.S. National Parks Service has some excellent tutorials on working with DEM data to make beautiful shaded reliefs. Park of his workflow involves using Natural Scene Designer and Adobe Photoshop. For my own workflow I like to use GDAL to resample the size of the DEM before rendering a shaded relief. This often ...


1

I would do a spatial join between your point data and US Counties. If you do not have US Counties, you can download the 2014 Counties here. Then, add both layers into your map. Click Vector -> Data Management Tools -> Join attributes by location Set the target vector layer to your points. Set the join vector layer to your counties. Choose to ...


2

The easiest way would be the following: enable snappig on the line layer that you are using to digitize digitize the line, but finish your sketch before you close it digitize another line, start digitizing at the end of the previously digitized line (using snapping), finish the line at the start of the previously finished line (using snapping) now select ...


0

The time it spent for reading metadata of all available tables. By looking at the GUI of QGIS it does not offer a proper method for speeding it up. Checking the "Only look for user's tables" would work if you can change the ownership to QGIS user but if you work in an enterprise that is probably not possible and a bad idea anyways. There should be a ...


1

A workaround is to digitize a temporary line starting from the final start/end vertex for creating something that you can snap to. Delete the helper line afterwards. For a proper fix make a feature request and hope that new snapping option would be implemented sooner or later. With OpenJUMP that has succeeded ...


0

I found the answers to my question here: https://stat.ethz.ch/pipermail/r-sig-geo/2008-January/003052.html To further illustrate the answer, here's some sample data set. (I can't give a preview of my own, because it's confidential.) CSVdata Area Data ID Atlanta 100 1 Belgium 200 2 Canada 300 3 Denmark 400 4 Map@data ...



Top 50 recent answers are included