Hot answers tagged

7

You can use the floor function in your expression, like this: floor($id /24) IN (1,3,5,7,9,11,13,15,17,19,21) On a sample grid I've obtained this result with my own numbers (my grid has 13 columns per row): I've used: floor($id/13) IN (1,3,5,7,9) So, in general: floor($id / number_of_columns) IN (1, 3, 5, ..., 2*number_of_rows_to_be_selected - 1) ...


6

I'm assuming you want to automatically populate the field with the date at which the feature was edited - apologies if this is not correct. Create the shapefile and add a field in the attribute table in which to store the date - you should be able to specify "date" as the type of input. Add the shapefile into QGIS and then open its properties. Under the ...


5

You can add items from a template by creating a new print composer and selecting the option shown in the image: Then select your template and it should load up all the items you created.


5

From the documentation Using PyQGIS in custom application, you need to add the paths to where QGIS is installed and load its providers before you can use its features and tools: from qgis.core import * # supply path to where is your qgis installed QgsApplication.setPrefixPath("/path/to/qgis/installation", True) # load providers QgsApplication.initQgis() ...


4

The problem was the parameter "allow only horizontal and vertical flow of water". I really don't know why this is set by default in QGIS/Processing!!! damn noob error!


4

Editing CSV files inside QGIS, AFAIK, is not possible. Never the less, while importing the CSV with the add delimited text tool, you have a option to choose what characters to ignore. If your data does not have any ' beside the ones on your problematic strings, you can simply add that characther to that option and it will never be imported in qgis in the ...


4

To get the information you want, you need to use the QSettings class. This uses a hierarchical structure, like the Windows registry. If you have the latest version of QGIS, you can see this hierarchy using Settings>Options>Advanced The following code works from the Python Console. I've not tried this from a plugin or outside of QGIS, so some additional work ...


4

This is by no means an answer to your specific problem but an explanation of elevation data and vertical accuracy. Also, this all wouldn't fit in a comment. Only a select number (depending of area of lidar coverage) of elevation control points are used when checking the vertical accuracy of lidar data. I wouldn't expect all elevation markers to match ...


4

You can create a new field with the field calculator and write the current date with a simple SQL command. Open the Layer properties Enable editing open field calculator Create a new field using now from the date and time section of the functions This creates the current date on the new attribute. If you need to write the current date every time you ...


3

If you set the symbol size to "map unit" it should give you the option to control symbol scaling; via the little spanner to the right of the dropdown box. This should allow you to lock the size of the symbols and stop it scaling them.


3

Just Add Features in your lake shapefile, you should be able to add as many Lakes as you want in the shapefile, add the attributes of the lakes as required (either on first creating the shapefile or later on by editing the attribute table) You can assign names to the lakes or categorize them anyway you want by adding an column in the attribute table (By ...


3

You can use the Select by location from the Selection tab in ArcMap to select the properties in the Parish, then you can use Select by Attribute to select the properties based on your previous selection.


3

From GRASS Manual: Categories to become no data are specified by setting the output category value to "NULL".


3

There is no way to do this currently - it has been under discussion by QGIS developers for a while. https://hub.qgis.org/issues/3239


3

The GDAL section of the Options from the Settings menu will tell you which raster file formats GDAL in your QGIS can load. I can't find a corresponding list for OGR (vector) drivers, but the popup on the "Load Vector Layer" probably has all the file-based ones:


3

Install the dissolve with stats plugin. Dissolve by the towns attribute, adding a stat for the max neighbourhood population. Join the data table created to your original one using the towns attribute and then query the neighbourhoods for ones where the population = the max stat in the joined table. A bit messy but should work.


3

This is a fairly simple task. Load both datasets into QGIS Join the two datasets using the column they both share. There are a lot of tutorials on joining on the internet. I.e.: http://maps.cga.harvard.edu/qgis/wkshop/join_csv.php or https://infogeoblog.wordpress.com/2013/02/18/joining-layers-in-qgis/ Now you just need to use the Field Calculator ...


3

Uncheck the "Coordinate GMS" option which I believe in English is "DMS coordinates". The csv file you linked to is not in degrees/minutues/seconds but in XY coordinates. Unchecking this option should let you import the csv as a point shapefile.


3

My answer will be nearly the same as the previous one but you can avoid to loop all the settings and only obtain PostgreSQL connexions with from PyQt4.QtCore import QSettings s = QSettings() s.beginGroup("PostgreSQL/connections") print s.allKeys() print s.value("GEODEMO/username") s.endGroup()


3

To see the preview thumbnail you need to open and save the project. Then when you reopen QGIS you should see the image


3

You can use the "select by expression" geoalgorithm with an expression like id>= and id<=24 or id>=49 and id<=72..... Since the cell values seem to be numbered by standard count laterally, it shouldn't be a problem to figure out the ranges you need even if your data set contains more rows than listed above.


3

Make sure the layer you wish to choose is highlighted in the Layer Control Box Then using the Select By Expression button Type what you see in the picture into the Expression Box. It should look like this when you are finished (( "ID" ) - 1) % 24 = 0 If the expression is correct you will see a result in the bottom of the Expression Builder Dialog that ...


2

Use the QChainage plugin to create points at equal distances along the lines. Extract the coordinates of all points. Export your data to a csv file and open as a spreadsheet. For each distance value, average the x coords and average the y coords between all lines. The resulting pairs of coordinates should be an average of the lines at each distance along. ...


2

Try out the RUGeocoder plugin as an alternative


2

Probably the CRS of your layer is not WGS84. First Save your layer using Save as ... from the popup menu of the layer, select WGS84 (EPSG:4326). After it in the new layer you will have latitude, longitude using $x and $y. Be careful about the projection setting of your original layer. If it is false the result of Save as will be false too. You can see and ...


2

Export the layer as a shapefile, find the shapefile on your PC. Copy/Rename the filename of the DBF part of the shapefile exportes to be 8 or under characters if it's not. (OLD MS DOS FILENAME ISSUE). Then, drag-drop the DBF right into Excel. Save as XLS. The copy paste method right form QGIS made text/character returns in a blob reset to the next row and ...


2

Perhaps another way is to set all your values to a text like you mentioned and then for the values you want to keep same (no data) you can use *. e.g: 1 thru 5 = 2 3 thru 8 = 10 * = *


2

There's been somewhat of a development in QGIS since I asked this question back in 04/2014 so will post an answer to close off this question. The following code does what I had wanted (practically similar to the "Hex grid from layer bounds" script but this wasn't available at the time): ##Create Grid=name ##layer=vector ##cellsize=number 1000 ##grid=output ...


2

I have QGIS 2.12.3-Lyon and used the following in the Python Console to find out which scipy version I have installed (QGIS was installed using the OSGeo4W Network Installer package): >>>import scipy >>>print scipy.__version__ 0.14.0


2

Below should work. The key part is the assignment d[(mainArray == 0)] = 0 setting all the items to zero in a new array where mainArray is zero. Sounds like your rasters might be spatial so the projection setting stuff is important too. Cheers. # # ----- create output raster # outfilename = outputFolder + '/zeros.tif' driver = ...



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