Tag Info

New answers tagged

0

A calculation like A*B*C / Sum (A*B*C) will perform the A*B*C operation twice. To avoid that duplicate effort instead do it in two steps X = A*B*C X / Sum(X) Storing A*B*C has an immediate payoff. To implement the Sum operation, use a zonal summary operator with the entire raster as the zone. That requires placing a constant, non-null value at every ...


0

Why not just open the Attribute Table (VAT) and multiply all the values times all the counts ?


0

Have exactly the same problem, including the Beep. I copied the shapes from the network to my desktop, projected into Qgis, started editing, no beeps or performance problems. As soon that i project the shape that is on the network, in the same project, the beep starts, even the zoom in and out produces a beep. Performance gets decreased when editing, ...


0

I've also wanted to do this since finding out how to add SVG symbols yesterday, but they were all black. The answer given by jgrocha works - I wanted to vote it up but having just joined the GIS forum, I need to get some reputation first! I also found this page which confirms the answer: SVG SYMBOLS IN QGIS WITH MODIFIABLE COLORS To have the possibility ...


1

You can import your shapefile to a postgis database with this python command : import os #Import shapefile to postgis DB os.system("shp2pgsql -s SRID -c -D -I /path/shape.shp tablename | psql -d dbname -h localhost -U username") (Just change : SRID (ex 4326), tablename (give any name), path, dbname and username).


1

I had the same issue using eVis. I first thought it was due to using the Dutch coordinate system (EPSG 28992). After selecting a feature with the Event ID-tool the map centered on 0,0, which in this case is somewhere near Paris. The problem was that I was using a Multipoint layer from my PostGIS database. After converting to Point geometries (single-part ...


1

Making the ids: Right-click on your point layer and Open the attributes table from the pop-up menu. Make the layer editable by clicking on the yellow pencil icon Click the Open Field Calculator button (last on the right - abacus icon) Ensure that Create a new field is checked (it should be by default). Call the field 'Id' (or something) - you can accept ...


1

Double click in the points layer, go to label tab, Active "label this layer with" and select the field name: X or Y If you want both, you can write an expression like X||' - '||Y


1

Key column is a value, that is saved to the field and replaces previous value. The idea is that each key corresponds to value, that you see in the drop-down menu. EDIT: Imagine a simple table: Key | Value 1 | Apple 2 | Pear 3 | Passion fruit Value relation enables you to select "apple" in a drop-down, but save value "1" (the key) to the field. As ...


0

From my understanding the current version of QGIS does not have 3D capabilities. You would have do, as you stated, 3D work in PostGIS or Spatialite. There may be a method to do the 3D functions you are inquiring about in Grass, which has a QGIS plugin.


2

Do you mean it's not showing up in the menu bar? It's not in the Plugins menu - it has its own Dropdown menu title.


0

I downloaded a county shapefile from the MnDOT Geodetics website in hopes of getting the WKT projection directly from the source, but the shapefile came without a .prj file. Foiled! I would have thought that they may have changed the false easting value, but a cursory glance at the coordinates in the county file makes it seem like they are indeed just ...


7

I bet it may be the slight discrepancy between Esri's WKT definition of 26915 and the OGC WKT version. I think the only real difference is in the name (NAD83 / UTM zone 15N vs NAD_1983_UTM_Zone_15N). You could try making a copy of the shapefile, then replace the PRJ file text with the Esri version linked above.


0

As a related addition to people having similar problems: if your TIF only has one colour (i.e. blocks of the same exact colour, and transparent) then the min & max will be the same, and the default image may be transparent, which is confusing. If you zoom to layer extent, and you're in the right place, this may be the case. Go to styles and play around ...


1

After I checked my data source and used different GIS Tools (under them 3DEM a really nice DEM Viever, that gave me the right heights), I came to the conclusion that the grayband values, that are shown by QGIS, when you drag your DEMs in it, are simply wrong and aren't the height values. Both SRTM and ASTER DEMs store (in general) their data in meter. If ...


1

You are looking for ST_Intersection, not ST_Intersects. http://postgis.refractions.net/docs/ST_Intersection.html also: http://postgis.net/docs/ST_Intersection.html If you have lines that intersect at multiple locations (sometimes it happens), you may need to look into ST_Dump to get all of those intersection points. The query might look like this (not ...


0

The description is not very thorough and it is hard to know what causes those errors, but here is something that might help. Set zero values to NoData for both rasters (use ArcMap Set Null -tool or rastercalculator). I would suggest that you convert the bathymetric file into .tif -format, so that it eliminates the conflict between the different file types ...


1

I just found the SAGA tools and the better raster calculator provided. I solved the problem using the following formula: ifelse(eq(a,190), 1, 0) which actively sets all cells with a value other than 190 to zero. Edit: I just found the reason why QGIS dealt differently, too: I was wrong stating that both rasters had the same format. In the first case ...


3

For QGIS 2.4.0, you don't have to install the Lidar toolbox; it is installed by default. What you have to do: Make sure Processing is enabled in Plugins -> Manage and install Plugins activate the Advanced interface at the bottom of the processing toolbox enable the Lidar toolbox in Processing -> Options and configuration -> Providers -> Tools ...


1

Not at the moment, but it's a good request. Can you please file it over at http://hub.qgis.org?


1

I would suggest to export the shapefile(s) to SQlite or FileGDB (which should perform better in QGIS). You can either do this in QGIS GUI (right click on layer a select Save As), or use OSGeo4WShell to covert using ogr2ogr, e.g. command: ogr2ogr -f "FileGDB" C:/Temp/myshp.shp C:/Temp/test.gdb OR ogr2ogr -f "SQLite" C:/Temp/myshp.shp C:/Temp/test.sqlite ...


5

Load the data into SpatiaLite in QGIS... best way is to create a new SpatiaLite database via the right-click GUI in the browser window, then simply drag and drop your shapefile onto the SpatiaLite database you just created. From there you have all the power of SpatiaLite at your disposal. Some more documentation can be found here, and there's the SpatiaLite ...


0

Perhaps use GRASS to Clip the area? You could run this in command prompt, and it wouldn't require loading the dataset with qGIS first.


1

Within QGIS, I find the raster calculator a little limiting, but you can use the SAGA processing tool "Reclassify grid cells" (Processing Toolbox > SAGA > Grid-Tools In the parameters, you can select "[1] range" for method, provide your range, and select 0 for "new value for other values".


1

Well, you can do that using ogr2ogr, after exporting vectors from GRASS to shp: ogr2ogr -sql "SELECT * FROM file_in WHERE 'category' == 2 AND OGR_GEOM_AREA > 10000" file_out.shp file_in.shp file_in.shp is your data exported from GRASS file_out.shp is your filtered results. Then you can run: ogr2ogr -sql "SELECT count(OGR_GEOM_AREA) FROM file_out" ...


0

a possible solution : export from the composer the map in a raster format, with only the labels being activated (everything else being hidden, including the line vector) add the raster from the composer in your view, assign a transparent value (likely white) Place this raster layer below the vector ... The problem may be that your raster file will ...


0

Not sure if you have already tried this but you can edit the placement of your labels: Layer properties > Labels > Placement Select Offset from centroid and choose the whole polygon and the centre quadrant. Unless you also edit the Scale-based visibility in the Rendering section (Layer properties > Labels > Rendering), the labels will constantly appear ...


2

Google satellite (EPSG:3857) is not a good idea. The units are metres, but only at the aequator. The more to the North you go, the greater the difference gets. Alternatively, you can use a custom CRS in transverse mercator projection, with latitude and longitude of origin (in degrees) at the point where your dxf file has its origin: +proj=tmerc +lat_0=... ...


-1

Your table does not have a primary key. QGIS must detect a primary key to work. Make a primary key field in your table and everything should go OK.


0

The best answer I have for this (to my own question), is to continuously save to a raster file, overwriting it. You then use another program to continuously read from that same file over and over again. If all parts of this thing worked properly it would be something close to graphical animation.


1

The ETOPO1 dataset merges topography and bathymetry in one elevation model. Quoting the home page: ETOPO1 is a 1 arc-minute global relief model of Earth's surface that integrates land topography and ocean bathymetry. It was built from numerous global and regional data sets, and is available in "Ice Surface" (top of Antarctic and Greenland ice ...


0

This problem was resolved by editing the install path to remove all spaces. I used d:\program\qgischugiak\, so this implies that perhaps the name used does not have to comply with 8.3 filename convention and is interpreted correctly by the OS. This worked perfectly, for such a simple fix. This fix came from some suggestions on other sites (thanks to ...


1

Try this while connecting: currentIndexChanged function pass 1 argument i.e is changed index and while defining build_Layer_Index_Changed pass two arguments (self, index). QtCore.QObject.connect(dlg2.Sel_Build_Layer, QtCore.SIGNAL("currentIndexChanged(int)"), self.build_Layer_Index_Changed())


2

If you set the project CRS in QGIS to EPSG:32718 (UTM zone 18), you get the same coordinates as reported by Google Earth. You might get different results if you have chosen another CRS. There are several CRS that are called UTM 18S (=South), but only one is based on the WGS84 ellipsoid. The negative Y coordinate looks like a UTM 18N (=North) CRS. For QGIS, ...


1

In a command window, type set > set.txt to get a list of all environment variables you have set. Your python installation may have set some values that QGIS does not like. The PATH variable is save, because qgis.bat sets its own path variable, but PYTHONPATH or something else may be harmful. Once you found a link to C:\Python27, go to the system ...


0

The regular pattern of the image makes me suspect that you have loaded the data incorrectly. I'm not sure how you loaded the CSVs. Assuming that each CSV is a three colum table with a header, I would try loading it using Layer→Add Delimited Text Layer. Make sure the result of this a point layer that displays as points with plausible water depths in the ...


1

Since you mentioned address search, you might be interested in the search plugins using Nominatim to geocode addresses: OSM place search or osmSearch


0

QgsVectorLayer.changeGeometry function can be used to update the geometry after combining the manipulated geometries to form a single geometry. if geom.isMultipart(): geomColl = geom.asGeometryCollection() tempGeom = QgsGeometry() for g in geomColl: #g is QgsGeometry g2 = reverseDirection(g) # your function to manipulate the geometry ...


0

OK so you want to know how to generate polygons centered on selected points in pyQGIS and retain all the attributes of the points in the new polygons? Here's a script to do that: Note that the code was written to apply to a points-containing example shape file I have. You need to remove the section which reads in my example file in order for it to use your ...


8

Sure it is. Depending on what you need: zoom to whole layer right click on layer in Layers list and first item is "Zoom to layer" zoom to selected feature(s) select feature in map and click on icon "Zoom to selection" in the main toolbar or right click on layer in layers list and choose "Open Attribute Table" (there is also icon in the main ...


2

See How to obtain rotation field name defined in the Labels "Data Defined" section in pyqgis?. You will need to refresh the map canvas at the end of your code to see changes. You are setting the palyr.fieldName to 'name,' which will need to be a valid attribute table field. Please verify. You mention adding the labeling settings to ...


0

If your points are in UTM zone 20S, lat and lon should be swapped. Reprojecting the coordinates to UTM 20S, I get the following x-y coordinates: id;lat;long;x;y 1;-37,83722374;-61,82795608;603131;5811597 2;-37,83772773;-61,82861595;603072;5811542 3;-37,83767676;-61,82724009;603193;5811546 4;-37,83817749;-61,82789676;603135;5811492 The distance from one ...


6

You should be able to do a simple 'select by expression' where DATECOLUMN like "% 12%" This is assuming your date is a string column. Essentially; the query is using the 'pattern' that is formed, and saying "Find me every record where there's a space, followed by 12, follow by a colon. Since your data is in 24h format, the only records criteria that ...


0

It looks like it is possible with custom forms, as explained in this tutorial here: http://woostuff.wordpress.com/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/


1

The measuring tool has some advanced logic to calculate distances from lat/lon coordinates, all other tools just use the units of the layer (degrees in your case). For all britain, EPSG:27700 should be the best. The result will be in metres. But: Don't use Set CRS for Layer, instead Save As.. under another name with changed CRS.


0

I haven't used .mdb files (not yet anyway!) so I am not sure if the following will work but I believe this is how you can import .mdb files: Layer > Add Vector Layer... > select Database > ESRI Personal GeoDatabase Perhaps then you can do a join...?


1

I get the same nasty effect if I load the data with Add vector layer using the ogr driver: <provider encoding="System">ogr</provider> Alternatively (and the preferred way) I can load the data with Add spatialite layer. The encoding line changes to: <provider encoding="System">spatialite</provider> which is wrong ...


0

Let me give you some suggestions: For SFM workflow you can use VisualSFM (http://ccwu.me/vsfm/). It is free for non-commercial use. Here you can also transform coordinates using GCP or GPS data in EXIF file of images/input gps file. The output of PMVS can be stored and opened in Meshlab. From there you can export .ply file (I guess should not be saved as ...


2

Ok, found at least one working solution. After finding that on Linux everything is fine suspected the default encoding in Windows. So I opened the QGIS project file (*.qgs) in PSPad and found this in layer description: <provider encoding="System">ogr</provider> So probably QGIS uses CP1250 encoding as default in Windows while the database is ...


1

I modified the redistribute_selection() function above to make ~/.qgis2/python/mytools.py : from qgis.core import (QgsFeature, QgsGeometry, QgsVectorLayer, QgsMapLayerRegistry, QgsField) from PyQt4.QtCore import QVariant from qgis.utils import iface import math import numpy def ...



Top 50 recent answers are included