Tag Info

New answers tagged

0

Since you are using QGIS, the simplest way I can think of to achieve what you need is to use Atlas Generation in Print Composer and you will have no need for any programming. Have a look at this tutorial. Essentially, your process will be as follows: Create a vector polygon file where each polygon is the extent of each raster. Do this by having all your ...


0

I posted a python script to use from ArcGIS here: Exporting 3GB ArcGIS Raster to KML without losing resolution? The different models support different numbers of tiles. You have to look at this limitation, the extent of imagery you want to use, and the minimum resolution you want to use. Then you need to possibly create multiple files from your original ...


0

I've also put a DummyInterface together, which enables you to test QGIS plugins standalone. After reading Snorfalorpagus blog, check out my answer here. To find a real-life example, on how I test(ed) QGIS-plugins visit this github project at https://github.com/UdK-VPT/Open_eQuarter/tree/master/mole and have a look into the tests-package. Hope this helps!


2

Being very keen on the TDD paradigm, I've spent some time putting together a dummy-interface (based on some code fragments I found on the internet) which enables calling QGIS and QGIS-plugins standalone. The interface I came up with looks as follows and I used it for all my unit-tests since: # coding=utf-8 """QGIS plugin implementation. .. note:: This ...


1

There is no page attribute on the QStackWidget object. Here are all the methods that it has: http://doc.qt.io/qt-4.8/qstackedwidget.html What you need to do get the widget is call the widget function: widget = self.stackedWidget.widget(index) where index is the page index of the widget.


0

First, you need to import the points, and make sure they have the same coordinate system. Then you can use intersect to find out for each point in what polygon it is located. See this topic also. Intersection between points and polygons in QGis


0

Yes, you should be able to select which features you want to use for both layers (I'm using QGIS 2.6.1): Hope this helps!


0

This requires a few steps; 1. Transform your CSV to a shapefile using the add delimited layer Here Then merge your point layer to the polygon layer using spatial location :see here Now each point has its polygon attributes.


2

You have a few options (in no particular order): You could define a view in PostGIS and load the view as a layer in QGIS. You could open DBManager and perform the spatial query in the SQL window and check the box under the results window to "Load as new Layer". Perform your spatial query and save the selected features as a new dataset for use in your ...


1

Method getobject() cannot be found in module processing because the method is named getObject() (mention the big O). Try getFeatures() in the following line, it is the same problem here.


1

After you have added the shapefile, take a look at Rightclick -> SET CRS for Layer. The layer CRS should be either EPSG:102711, or a custom CRS with these parameters: +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs You can enable on-the-fly-reprojection, set the project CRS to EPSG:3857, ...


1

This code works in my Python Console: from qgis.core import QgsRasterLayer from PyQt4.QtCore import QFileInfo def StringToRaster(raster): # Check if string is provided fileInfo = QFileInfo(raster) path = fileInfo.filePath() baseName = fileInfo.baseName() layer = QgsRasterLayer(path, baseName) ...


3

ST_Collect is probably not the function you are looking for, as this simply combines geometries into a geometry collection of some type, and does not actually union/dissolve them. ST_Union, on the other hand, does dissolve overlaps, and assuming polygonal input (which is most probable in conjunction with ST_Buffer and an input table called point), and ...


0

It should be the problem that @Jake mentioned. When adding a CSV layer you are creating a temporary layer which do not alter the default on-the-fly CRS (i.e. WGS-84). When adding the shapefile with a different CRS, you do however alter the on-the-fly CRS to NAD1983, which shift and/or distort your original temporary data. Two things you may do: Export ...


1

You may still have 10dp numbers reported, but count the number of nodes in the modified file, and it should be far fewer that the original. The tolerance unit is whatever the unit of your map data uses. 0.000001┬░ would keep destination paths no more than 0.000001┬░ (a metre 10 cm or so) from their original location. It would be far too small if your data ...


1

You could add row numbers to the points and then join points and non-spatial table based on row number and ogc_fid (assuming ogc_fid starts with 1).


2

Sorry, but the layers are not in the same CRS. The Catchments is in an Albers Equal area projection (units-meters) and the other two are in Haartebeesthoek94, with degree as units. So your area calculations are in square degrees. If you reproject the transmissivity and intersect polygons to Albers Eq Area (with the "Save As..." option in QGIS) then ...


1

Assuming that your projection is in meters, the procedure for rasterizing include: 1) At the layer properties, copy the extent of your 'rivers' shapefile and remove the text characters. In my example is: 168902.13 85311.7 831499.38 1271303.48 2) Click in Raster -> Conversi├│n -> Rasterize menu option. Select the output file name and, afterward, click in ...


1

You can either rename the layer in the layer panel and then add the legend into a composer again (so the changed name is used) or you can follow this manual that should answer your question as well.


0

Bug reports generally need to be logged on the qgis site with screenshots and posibly sample data so that developers can try to replicate your error. In the meantime try to add the shapefile to spatialite and try to eliminate if it is a shapefile error. Vector>properties>save as>choose type as spatialite and try to replicate the behaviour then you can know ...


2

I can answer my own question, because I found the solution. It is a known QGIS 2.8.1. bug that is going to be fixed with version 2.8.2. The problem is with rotational informations stored in the World File. The bug is causing the misreading of such informations. If you try to change rotational information in the World File to be zero (actually all the World ...


0

The option (Auto open form) has been moved to the Identify Results dock, see


2

After alot of trial and error, I found my answer. For GIS beginners, like myself, what I was looking for was a spatial join, which could be done easily with QGIS: Vector > Data Management Tools > Join Attributes by Location


0

One of possible answer is to use multiple Extract by attribute functions. Alternatively, Select by expression and Intersection afterwards could be used. In Select by expression function, it is possible to create such a expressions as: "Variable_name" = 'Value_one' OR "Variable_name" = 'Value_two'


0

use the or operator : "||" or the and if you want both : "&&" For example "val1" || "val2"


0

Just put dummy print 'xxx' statement immediately after self.iface.messageBar().pushMessage call.


0

The easier way to use the Clip Tool in QGIS is by using the "extent clipping mode". For example, I want to clip the area represented by the shapefile in the next image: With Raster -> Extraction -> Clipper, put the output name raster and select its area by drag on shapefile area. Then, click on Ok. At the layer properties of the clipped raster you ...


1

At this point I haven't implemented this stuff myself, but the approach that I am planning on is combining boto with the information on Amazon's page on Landsat on AWS. At first glance, it appears to be a rather doable task. Another option is landsat-util which can be found on github, which is python-based and can interface with AWS.


2

This looks to me like a network connection problem. Under Settings -> Options -> Network, you can enter proxy settings as needed for your network. Alternatively, take the project file home and try it on your own computer.


1

You write that you have reprojected the DEM from WGS84 to UTM, but the -projwin coordinates you give are in degrees. That does not work. You have to work either in degrees, or a projected CRS in metres (or else). Turning On-the-fly-reprojection OFF and work solely in one CRS is a good way to avoid such errors in raster operations.


1

OK so I wanted to convert islands to holes and holes into islands but couldn't find a command to do it in QGIS so I wrote a script myself. Here is that "simple" script which will invert an input_layer into a bbox polygon in an output_layer. The whole process ran over a couple of seconds to invert a 25MB shape file. Better than crashing out with a call to ...


1

To be honest I'm not sure that this will work but have you tried smoothing/simplifying the shapefile? This can be done in QGIS (alternatively try http://mapshaper.org/). I would try it myself but I don't have any shapefile data similar to what you've described. Regards, Eamon


0

Summing up the discussion above: While Winkel Tripel projection is defined in the proj library and can be called from the command line, it can't be used as a custom CRS in QGIS because there's no inverse transformation in the proj library. The enhancement request to add this functionality has been closed since it seems that the inverse transformation ...


1

the most easy way to do this in a script is to use the subprocess module and gdal_translate import subprocess image_in = "path_input_image" image_out = "path_output_image.tif" subprocess.call(["gdal_translate.exe","-co", "TILED=YES", "-co", "COMPRESS=LZW" "-ot", "Byte", "-scale", image_in, image_out ] if you are in Linux, you don't need the ".exe" after ...


0

You can use turf.js in client side (as Devdatta said) but also on the server. It requires nodejs and spatial data in geojson format, the perfect format if you like to render it on a leaflet map. You can install just the modules that you need: Buffer: turf-buffer Merge: turf-merge Overlap: turf-overlaps Here is an example with node


0

This is a bug that's gone back to QGIS version 1.8 or so - still unfixed, unfortunately. This source (http://hub.qgis.org/issues/5827) has more info on what's been done so far to try and deal with it.


0

You can add a HTML frame from Google Charts in QGIS Note: If you update your chart attributes you need to click 'Refresh HTML' before exporting again in the print composer.


1

You can do that directly in QGIS with Raster -> Conversion -> Translate (Convert Format). To test it, I used a Float64 (Sixty four bit floating point) raster (named test) loaded in the Map View of QGIS. To convert it to Byte (8 bit type), I named it first at the "output file space" as test_byte.tif and afterward, I click in the icon pencil of "Translate ...


1

Your code is uncomplete and not well formated. However, this adaptation seems to work as it is espected: canvas1 = iface.mapCanvas() layers = [] n = canvas1.layerCount() for i in range(n): layers.append(canvas1.layer(i)) canvas2 = canvas1 properties = {"color": "255,0,0", "outline_color": "255,0,255"} symbol = ...


1

I tried your dataset and: Open the Shapefile with QGIS Set CRS of the layer to "SAD 69 / UTM zone 23 S EPSG 29193" Save layer as Shapefile, with projection "WGS 84 EPSG 4326". After this, we're requested for the datum, choose: "+towgs84=-66..87,4.37,-38.52" It works! :)


2

A similar function has been introduced recently It requires the possible values to be grouped on the related layer and is slightly more involved in setup. If you have a layer Plots Name class (foreign key to Classes:pk) And a layer Classes pk Type [Agriculture/Forest] Plant [Pines/Olives/Corn/Wheat] You will need to add a new relation in Project ...


1

You will have to go through several process. Here are a few indications to help your out. First create a new column in your layer BIG_ID_COLUMN. Update this column with the Id of each parishes Create a new shapefileBIG_SHAPEFILE with the largest parishes and one for the small ones SMALL_SHAPEFILE Use a closest neighbor tool (v.distance ; grass) or follow ...


1

You have to use signals. Here you have a nice documentation http://doc.qt.io/qt-4.8/signalsandslots.html. Every widget can send different signals. For example combobox (QComboBox object) send signal every time if you select another text inside: activated(const QString & text) This signal is sent when the user chooses an item in the combobox. The item's ...


4

In this test raster (20x20), with values between 1 and 50, I replaced 19 value by -32768 value. In the following raster, the -32768 values were replaced by -3.40282e+38 values (see window of Value Tool Plugin): The used expression is in the window of "Raster calculator expression" (below image and code sample): ...


1

You could use your file system's tools: put the project file and data in a directory that is read only for your users


2

You can't sum columns using the Field Calculator (although it would be useful in certain situations). To be able to sum columns and obtain a value, you can use: QGIS function - Basic Statistics (Vector > Analysis Tools > Basic Statistics) QGIS Plugin - GroupStats (Plugins > Manage and Install Plugins) QGIS Plugin - Statist (Plugins > Manage and Install ...


0

The GPS data format does not know polygon features (only points and lines), so you will not be able to import and edit them. I suggest to use a shapefile format or spatialite database for off-Postgis-use.


1

The answer to your question is yes. You might like to clarify what kind of server-side software you have. You can use GeoServer to do WPS requests. You could use a Python library like Shapely. Or a C# library, or a Java library, or a JavaScript library. Or the QGIS API, or the ArcGIS API or the database, be that SQL Server, PostGIS or Oracle. So, to ...


0

When you set up the connection, you can change whether QGIS reads the geometry_columns table (an OGC standard, I think) or just investigates the database tables when you click connect. Setting up geometry columns is really important as it speeds up the process a lot. But there's no automatic way to do it. I'll copy the schema for geometry columns below. For ...


1

from https://hub.qgis.org/wiki/quantum-gis/QGIS_Citation_Repository bibtex: @Manual{QGIS_software, title = {QGIS Geographic Information System}, author = {{QGIS Development Team}}, organization = {Open Source Geospatial Foundation}, year = {2009}, url = {http://qgis.osgeo.org}, } which gives QGIS Development Team, 2009. QGIS ...



Top 50 recent answers are included