Tag Info

New answers tagged

2

What you are missing is the coordinate of the origin (0,0) of the DXF drawing in degrees. You would have to put up a local coordinate reference system on the origin of the drawing. If you are lucky, the vertical axis of the drawing is in parallel to the North, otherwise you have to apply a rotation too. An oblique mercator projection can deal with that. ...


2

You can accomplish it by using the QGIS Vector Bender plugin, which allows you to translate, rotate, scale, and even distort (if necessary) your original DXF layer. Basically, you will need to provide the plugin with a line layer representing pairs of points that are the basis of the transformation. For instance, take a corner of the square you mentioned ...


1

What sort of transformation options are available to you depends on whether the LiDAR data in question was collected by a terrestrial (fixed position) scanner or some sort of mobile or airborne platform. If it was collected terrestrially, the answer also depends on whether the data you are speaking of was collected from one scan or multiple scans. Below I ...


3

You have to allow snapping and then play around with the options until you configure settings that suit your needs best. You can open the snapping options as shown here: And then configure your settings, either using map units or pixels as your tolerance unit. Alternatively you could go to Options (same screenshot), and then navigate to the Digitizing ...


0

Matplotlib has many backends In my Mac OS X matplotlib (1.4.2) installation, using the pure Python script in List of all available matplotlib backends the result is: print backends ['agg', 'cairo', 'cocoaagg', 'gdk', 'gtk', 'gtk3', 'gtk3agg', 'gtk3cairo', 'gtkagg', 'gtkcairo', 'macosx', 'mixed', 'nbagg', 'pdf', 'pgf', 'ps', 'qt4', 'qt4agg', 'qt5', ...


1

I guess pgRouting would be the best option for you. Could you please have a look at these post and say if this is in general what you are looking for? Creating many origin-destination routes with pgRouting (Answer of Otto Coster) If yes then there would be a additional loop neccessary do the calculations for all destinations


2

The PyQGIS Cookbook explains what files are common in QGIS plugins. As you can see there, you would only need three files to run a minimal plugin: __init__.py metadata.txt mainPlugin.py Regarding the QGIS Plugin Builder, I suggest you to read the official documentation to get an idea of how it is structured. I actually prefer not to use such plugin, ...


0

For reference, if you use QGIS >= v.2.4, you can set the selection color from the QGIS Python console in this way: from PyQt4.QtGui import QColor iface.mapCanvas().setSelectionColor( QColor("red") )


0

This issue is caused by the workflow intended by OTB developers. Pan-sharpening in OTB is meant to be performed using console command BundleToPerfectSensor: otbcli_BundleToPerfectSensor -inp pan_image -inxs xs_image -out output_image. As described corresponding section of the manual - if one wants to perform pansharpening using GUI (Monteverdi), one have to ...


1

If the square can be in meters instead of degrees, you can create a custom CRS in oblique mercator projection: +proj=omerc +lat_0= 21.04247 +lonc=88.38045 +alpha=-70 +k=1 +x_0=0 +y_0=0 +gamma=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs And create a vector grid with that CRS:


0

The problem with your procedure is that you probably used two different Processing versions, v.2.2.0-2 on your computer and v.2.6 on the other computer. Since v.2.6, Processing comes as a core QGIS plugin. It is installed in /usr/share/qgis/python/plugins/ (C:\OSGeo4W64\apps\qgis\python\plugins on Windows) and not in ~/.qgis2/python/plugins/ ...


0

First of all, to actually run a saga processing scrip use processing.runalg("saga:algorithmname", parameter1, parameter2) Basically Qgis can do two things: (1) Perform mathematical operations with rasters -> use saga raster calculator from processing toolbox A thing that can help you is that you can refer to the grids as a,b,c etc. a+b will add two ...


1

What you need to do is first display your CSV in the proper coordinate system (BC Albers) so QGIS can then re-project it to Google Maps Mercator (3857). EPSG:3857 -- WGS84 Web Mercator (Auxiliary Sphere) is what you want. So what you need to do is add your CSV to QGIS using 'Layer > Add Layer > Add Delimited Text Layer'. Choose the default options in the ...


1

I managed to get the script to run by copying the processing folder from my computer and placing it in the .qgis2 of the other computer. It seems there's something missing in the other computer although I'm not sure what. I did notice that when I installed QGIS via the OSGeo4W installer, there were no plugin folders in \.qgis2\python\plugins\. They only ...


1

The initial path setting might be off. QgsApplication.setPrefixPath("C:\\OSGeo4W64\\apps\\qgis", True) Maybe try setting this path to a variable, then use the variable in the set path setPath = 'C:\OSGeo4W64\apps\qgis' QgsApplication.setPrefixPath(setPath, True) OR maybe this? QgsApplication.setPrefixPath(r'C:\OSGeo4W64\apps\qgis', True) I hope this ...


0

You can grab the text like so: text = self.your_plugin_dlg.ui.yourLineEdit.text()


0

If you create a new spatialite layer with QGIS, you can select between Type: Point MultiPoint Line Multiline Polygon Multipolygon The merging will only work errorfree if your layer is of type Multi.... Even if you snap the end points of two lines, the direction of the two lines might be different, and QGIS does not create a single line, but tries to ...


1

This is a know bug and already has a ticket: https://hub.qgis.org/issues/10976 Hopefully it can be resolved for QGIS 2.8 which will be out soon.


1

When you copy a feature, not only do you copy its visible attributes (ie. from the Attribute Table) but you also copy its invisible attributes (ie. wkt_geom which is the coordinates of the features' dimensions). So when you move your features to another geographic location, the coordinates for each dimension will also change. Therefore, I do not think it's ...


1

There is an option here which should prompt users for a CRS when adding a new layer via: Settings > Options > CRS Hope this helps!


2

Go to View>Toolbar>Check Attribute. Then you will get an info icon in the toolbar. Now load a vector layer and start editing and double click on any feature.


2

You can access QGIS toolbar buttons (actions) by using the iface object (docs here). From those actions you can create a QActionGroup and add your custom action making all actions mutually exclusive. The following code snippet shows you how to do it, step by step. I've put the code snippet in the initGui(self) method of my test plugin. # Make sure your ...


0

Yes, you can do that, but only if you chose to save user and password while establishing the PostGIS connection. If you did so and your active layer is a PostGIS layer, you can access the connection information this way: layer = iface.activeLayer() source = layer.source() print source You'll get a key-value string like this: dbname='mydb' ...


1

make layers editable select items on the source layer cut to clipboard: Ctrl+X go to destination layer paste from clipboard: Ctrl+V


1

This topic has come up here: Create Shapefile with auto increment primary key in QGIS My suggestions would be: 1) SQLITE / SpatialLite databases support auto-incrementing on a field set to INTEGER PRIMARY KEY: On an INSERT, if the ROWID or INTEGER PRIMARY KEY column is not explicitly given a value, then it will be filled automatically with an ...


1

The easiest way to do this would be probably with a python script or maybe it's possible with the field calculator. Sorry I don't have one for you, maybe someone else will. In the meantime, I'd search for a python script for it. I've seen a lot about this for ArcGIS, but I'm sure there's something out there for QGIS.


0

Since you have FME I would try running the data through the LineJoiner transformer. There is a parameter in there (called "Consider Node Elevation) that lets you control whether to connect based on just X/Y or whether to include the Z value too. This is just joining lines, not creating polygons, and when three lines meet at a single point it's not certain ...


1

The problem you are facing is due to not valid layers constructed by QgsVectorLayer(). If you print shapefile.isValid() you will be getting False for all layers. This happens because you need to set the QGIS prefix path and initialize QgsApplication before using QgsVectorLayer in standalone scripts/apps. The solution for your problem is to: Add these ...


0

Presuming you don't have scale dependent visibility set in the properties window... I use GRASS for data cleaning, if you need to fill holes and undertake other topology work v.clean is a very good place to start.


1

Check to see if you have scale dependent visibility on in the layer properties general tab.


0

I noticed, on viewing the histogram for the TIF image, that there is a huge peak at 15 for all bands...which corresponds to the dark gray, apparently. I still can't make sense of why QGIS adds that gray, in the first place. Also...removing that color at 15, on all bands, using additional no data, or a custom setting with 15 for all bands, turns the ...


1

If you mean QGIS default toolbars, well, those are written in C++ and you can find their creation and configuration here (C++ file) and here (Qt4 UI file). All actions (buttons) inside QGIS toolbars are written in C++ (except by plugin buttons) and you can find them in the QGIS source code as well. If you want to get a reference of a QGIS toolbar in Python, ...


0

There's a few things you can do: Create a "svg" folder in your /Users/your_username/.qgis2/ You can find the location of the SVG symbols location by hovering your mouse cursor over the SVG Groups folder in the Styles options of a layer and selecing SVG fill: You can set the path yourself in QGIS via Settings > Options: Hope this helps!


3

Yup, edit the layer you want the polygon from by clicking on the 'pencil' icon. Then select Copy features icon (in the red circle shown) or from the Edit Toolbar. Select the layer you want the polygon to be moved to and select the Paste features icon (or from Edit menu). To move the polygon, select Move features shown in the blue circle or (you guessed ...


0

You can enable this button under the settings button within the Python console / editor.


1

@Joseph is right. Use the polygonize tool to make the raster into a polygon. Choose the option to write the raster values to an attribute column (ie: dn). This will allow you to dissolve the polygon on dn values that are the same, which will result in a cleaner looking file. With your input polygon that is a field boundary, use the clip tool ...


0

Late post but another tool you can use to look for errors is the plugin Topology Checker in QGIS which allows users to define rules for the plugin to scan vector layers with. Such rules include: Must contain layer X Must not have duplicates Must not have gaps Must not overlap Must not have invalid geometries Hope this helps!


2

You can first load your virtual environment and then start QuantumGis in the same terminal where you loaded the virtual environment. for example in linux: source /myvirtualenv/bin/activate qgis


1

4096 colour input looks like it uses paletted colours. These can not be handled correctly by the georeferencer, because he has to interpolate between pixel values. That only works with full 16mill colours in all three RGB bands. So you have to use that 16mill colours version to georeference.


0

Yes, it's possible to customize the QGIS UI from a Python plugin by both adding your own toolbars and menus as well as removing/hiding QGIS toolbars and menus. These would be the code snippets for each situation: Adding a toolbar: # Add a custom toolbar self.toolbar = self.iface.addToolBar( "My tools" ) self.toolbar.addAction( self.action ) Removing a ...


1

You can use the Diagram Overlay Plugin And some more instructions: http://darrencope.com/2011/11/01/qgis-diagrams-pie-charts-for-symbols/ Statistics or simple pie chart in Quantum Gis


0

As you can see in the QGIS API docs, the featureAdded signal only passes one argument, namely, the feature ID. When you create your slot, you must use a single argument (besides self), this way: def logFeatureAdded(self, fid): message = str( fid ) QgsMessageLog.logMessage(message) QApplication.beep() This should solve your problem!


2

Just a visual for using "Raster Calculator" in qgis. This tool is located in the "Raster" tab in the QGIS.


1

I've tested the attributeValueChanged SIGNAL in a created-from-scratch test plugin using QGIS v.2.6.1 You can connect the SIGNAL to your slot this way (I did it in my run() method): def run(self): self.lyr = self.iface.mapCanvas().layers()[0] self.lyr.attributeValueChanged.connect(self.mySlot) And then, you have two options to write your slot ...


1

So the event that works IS attributeValueChanged. I simply needed to add some arguments to my function, as mentioned by another user. This works now: def myFunction(self): self.myLayer.attributeValueChanged.connect(self.myOtherFunction) def myOtherFunction(self, fid, idx): self.myLayer.dostuff self.dlg.show()


1

I have solved this quite simply, it is not elegant but works:- CREATE OR REPLACE FUNCTION ng_research.point_spacer(record ng_research.ncn_uk_input) RETURNS bool AS $$ BEGIN IF (SELECT id FROM ng_research.ncn_uk_output WHERE ST_DWithin(wkb_geometry, record.wkb_geometry, 100) LIMIT 1) IS NULL THEN INSERT INTO ...


1

This is a process that takes several stages. 1) You need to turn the coordinates into shapes. Any good GIS can do this; in the case of QGIS just add the data using the "Add delimited data". Tutorial: http://maps.cga.harvard.edu/qgis/wkshop/import_csv.php 2) Then you need to turn it into a 3d model. This is more problematic. QGIS has poor/no real 3D ...


2

The general name for the operation that will allow you to compare two classified images is cross tabulation or what is sometimes called a contingency table. This will allow you to calculate change in class values. In the SAGA toolbox of QGIS there is a tool called Cross-classification and tabulation that will perform this operation.


1

There turn out to be two methods (more?) to see the list of available 'panels' in QGIS. One is through the main menu: View | Panels The other is to 'right click' on a toolbar. The check box for OSM Place Search is available using the second method, but not the first. NB: This is also the case for at least one other panel I can see (undo/redo).


0

I found an alternative answer to my problem, so I think I should share it with anyone interested. So, instead of trying to find a "if" function that worked, I created masks for each function, in order to only give results for the areas that I wanted to and 0 for the other zones. calc100 = QgsRasterCalculator('(d@1 < 100)*(aa@1*(1/28) + ao@1*(2/28) + ...



Top 50 recent answers are included