Tag Info

Hot answers tagged

6

The following is basically quoted from the book: "Mastering QGIS" by Kurt Menke et al on page 199: mapX and mapY are the Destination Coordinates. pixelX and pixelY are the Source Coordinates. enable has a boolean value where 1 means it will be used in the transformation; 0 means it will not be used. Hope this helps!


4

Instead of a trigger, who can add a constraint based on st_isvalid(), like: ALTER TABLE public.uniteobservation ADD CONSTRAINT enforce_valid_geom CHECK (st_isvalid(geom));


3

I did some reformating to your data: N, E, height -15.04074, 34.71926, 1037 -15.05633, 34.71407, 1053 -15.03052, 34.70221, 1165 -15.03939, 34.69643, 1334 and it loads perfectly as delimited text inside Malawi: Note that QGIS always wants coordinates in East - North order, unless you specfiy it in the header. Southern and western coordinates require a ...


3

Definitely that's not an obvious way of loading a WMS. This is what have worked for me (QGIS v.2.8.1): urlWithParams = "url=http://maps.itu.edu.tr:8082/geoserver/sf/wms&format=image/png&layers=sfdem&styles=&crs=EPSG:26713" rlayer = QgsRasterLayer(urlWithParams, 'DEM', 'wms') rlayer.isValid() # Returns True this time ...


3

It's just a widget so you sure can. Normally you would add it to a layout however that will resize your canvas when it pops up which is a bit annoying IMO. What you can do is just some logic to resize the bar to match the parent size when it is shown. Here is some code that I use to do just that: class MessageBar(QgsMessageBar): def __init__(self, ...


3

That is true. QGIS2leaf does not support "Scale Dependent Visibility"! QGIS2leaf was developed to extract a qgis project into a leaflet based webmap. It is not designed to "transfer" all qgis possibilities into styling/behaviour of leaflet. It can build the basis for great webmaps but will definitely require you to do some manual coding in the ...


3

SimpleSVG is a Python plugin https://plugins.qgis.org/plugins/simplesvg/ --> using PyQGIS! Therefore its source code should be the perfect example of how to export SVG from QGIS.


2

1) The easiest solution is to use the processing module in the QGIS Python console: import processing processing.runalg("qgis:joinattributesbylocation","BKMapPLUTO.shp","DCP_nyc_freshzoning.shp","['intersects']",0,"sum,mean,min,max,median",0,'result.shp') 2) Without a GIS, you can use Fiona (read and write shapefiles as Python dictionaries) and Shapely ...


2

There is ST_LineMerge function http://postgis.net/docs/manual-2.0/ST_LineMerge.html You could try to serve all your rivers network as one MultiLineString ST_LineMerge(ST_Multi(St_Collect(geometry))) The result is also a MultiLineString with segments sewed together. So after ST_LineMerge you could get sewed segments via ST_Dump.


2

Several things to check here: Firstly, make sure that %QGIS_PATH%\apps\qgis\python\plugins\processing is added to the PYTHON_PATH environment variable. Secondly, instead of: import processing from processing import * Use: import processing from processing.core.Processing import Processing Finally, before calling any algorithms using processing, do ...


2

For Windows you can use the OSGeo4W Installer which has 2.10.0-1 included. I don't think the Ubuntu/Debian package is ready just yet, since the official QGIS page still lists 2.9 as developement.


2

You can make sure all folders in your hard drive and your .qgis2 folder (C:\Users\You.qgis2) are deleted. You could also delete the Registry entries for QGIS by running the regedit program and searching for QGIS: Hopefully when you restart your computer, you will be able to reinstall QGIS again. Hope this helps!


2

There's several methods but I will mention the ones I normally use, both using the Python Console. For SINGLE shapefiles: Method 1 - Using a method utilising the QGIS algorithm - Delete Column: output_0=processing.runalg('qgis:deletecolumn', myshapefile.shp, "myFirstField", None) output_1=processing.runalg('qgis:deletecolumn', output_0['OUTPUT'], ...


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


2

A good way to figure this sort of thing out is to manipulate the two layers interactively. Translate and rotate one to make it coincide as well as possible with the other. If you can succeed in this, then (a) the problem may simply be that an incorrect datum (or coordinate system) has been assigned to one (or both) layers and (b) regardless, you will have ...


2

If you want to replicate the status bar shown in the image, do this: Add a QMainWindow in Qt-Designer. A QStatusBar is added by default. Add widgets (2 QLabel) to the status bar in your Python class: self.lblXY = QLabel() self.lblXY.setFrameStyle( QFrame.Box ) self.lblXY.setMinimumWidth( 170 ) self.lblXY.setAlignment( Qt.AlignCenter ) ...


2

You could simply use the Coalesce function which returns the first non-NULL value from the given columns (fields). Insert this expression into the Field Calculator as a new field: coalesce( "Field_1", "Field_2", "Field_3" ) Below is a simple example: If a feature has columns with multiple values (eg. 1, NULL, 3), then you may need to include ...


2

Maybe a slightly different approach will match your needs. Try looping thru all the elevations that you will be snipping from felt, and create a raster for each, then convert each to a polygon vector. You'll end up with lots of separate polygons, one for each elevation, ready for the scissors. For e in 10 20 30 40 50 60 70 80 90 100; do r.mapcalc ...


2

To get a coloured picture of the AHN DEM, add a NODATA value of -2147483647 in the Transparency tab. In the Style tab, load the Extrema ( not the default 2% to 98%) and select one channel pseudo colour. With the Spectral colour ramp [x] inverted, the output looks like this: For the viewshed, I clipped the data to my area of interest and converted the ...


2

You're almost there, you need to declare the sequence as a dependent of the table. ALTER SEQUENCE polygon2_gid_seq OWNED BY polygon2.gid; Now the sequence will cascade drop with the table.


2

This seems to be a rather elusive issue. This thread http://comments.gmane.org/gmane.comp.gis.qgis.user/31735 suggests that restarting a few times might fix it.


2

As Luigi suggests, you can have a look at the API documentation, specifically to QgsVectorFileWriter::writeAsVectorFormat, and realize you're just missing one parameter (from the docs): bool onlySelected = false, It says that the parameter onlySelected is of type boolean and is false by default. This parameter is right after the driver name. So, calling ...


2

As far as I know there is no such tool. The work-around is to either split the polygon into multiple polygons or create a point layer for label placement. The spatial join approach you've posted has to be slow since it does not take advantage of any spatial index thus looping through all features every time.


1

The GeoTiff format is a good format for interchange with ArcGis, it is one of few that: Supports more than 3 bands. Has a wide range of pixel types (from 1 bit to 32bit signed/unsigned/float). Has multiple compression options (from none to JPEG/Lossy). Read more about supported raster formats from the Esri docs. It is a good idea to verify the spatial ...


1

The Ubuntu/Debian packages for 2.10.0 are already listed at http://qgis.org/debian/dists/vivid/main/binary-amd64/Packages but not yet announced. Apart from that, you can already compile from source: http://qgis.org/downloads/qgis-2.10.0.tar.bz2


1

Not sure there's a simple process to achieve this in QGIS, atleast not that I know of. To get a similar legend icon, you can follow this link: Continuous color band for a raster legend in QGIS composer legend. To get the legend to say High or Low, you can achieve this by deleting everything inside the Legend Format textbox and then manually type "High" ...


1

It is the zoom tool. select the zoom tool. left click and hold, drag rectangle. This is from QGIS 2.6.1


1

Figured it out, and it had to do with my understanding of the shapefile format. I was not aware that each feature has their own seperate boundaries. I used to think that one edge can be shared by two adjacent polygons. To have both lines/vertices move at the same time all you have to do is enable topological editing in the snapping options.


1

I don't think this is a bug as currently, you're selecting to move the vertex of the left polygon which is similar to reshaping it: With the Node Tool, first select a node from the right polygon so that the Node tool knows which vertices belong to it. Then move the same vertex as before: There shouldn't be a gap anymore, instead you would be ...


1

To exclude some of the arrows of labels that have been moved with the tool you can manipulate label's layer. I first selected all the labels with arrows that should not have arrows and then used the Field Calculator to add a new column in the attribute table. In this column I put a "1" for the selected labels. For the labels that were not moved or should ...



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