Tag Info

New answers tagged

0

open .ui file with QT Designer or QT Creator and follow QT guides. Other QGIS oriented references are: PyQGIS Programmers's Guide - https://locatepress.com/ppg and some more Packt books in publishing


1

This is fairly simple to achieve using QGIS (I think any version will do) and a very simple SQL statement in DB manager. But for that your that must be in some kind of spatial database (Postgis or spatialite). Since it's more accessible to most people, I will assume using spatialite, but the SQL statements are the same for Postgis. Create a new Spatialite ...


0

Found the solution. Albeit without SQL style joining, but this structure operates in the same way and is clearer so it is preferable. Double click on the layer you wish to join extra attributes to; Click on 'Joins' on the left; Click the '+' symbol at the bottom to add a new join to the double clicked layer; Select the join layer (layer you wish to take ...


0

Not currently, unfortunately. I'm working on a solution to this for 2.10 but that's some time off.


0

You can do that by following these steps (QGIS >= v.2.4): Get the layer tree object root = QgsProject.instance().layerTreeRoot() Find the desired group by name mygroup = root.findGroup("group1") Get the group index parentGroup = mygroup.parent() groupIndex=-1 for child in parentGroup.children(): groupIndex+=1 if mygroup == child: break ...


0

I have a processing model for that: https://github.com/falu/qgis-split-lines-by-polygons. It works only with qgis 2.4


1

By using the new Layer tree (aka legend or Toc) added by Martin Dobias since QGIS v.2.4, you can load a raster layer to any position of the ToC following these steps: Get a reference of the layer tree root = QgsProject.instance().layerTreeRoot() Create the raster layer object from PyQt4.QtCore import QFileInfo fileName = "/path/to/raster/file.tif" ...


3

In qgis you can use the mmqgis plugin to geocode addresses. How to use this plugin can be found here: http://michaelminn.com/linux/mmqgis in the chapter Geocode Tools


-1

os.path.join(os.path.dirname(file), '')


6

It's not built in (yet. I might just put it on my todo xmas list) however you can use some Python to do this: from PyQt4.QtCore import * from PyQt4.QtGui import * dock = iface.mainWindow().findChild(QDockWidget, "Layers") def activated(): visible = dock.isVisible() dock.setVisible(not visible) short = QShortcut(QKeySequence(Qt.ALT + Qt.Key_1), ...


0

now the QGIS web client has an easy installer that will take care of all the paths.


1

By using the new Layer tree (aka legend or Toc) added by Martin Dobias since QGIS v.2.4, you can load a layer to the bottom of the ToC following these steps: Get a reference of the layer tree root = QgsProject.instance().layerTreeRoot() Create the layer object mylayer = QgsVectorLayer("/Path/to/your/data.shp", "my layer", "ogr") Add the layer to the QGIS ...


0

It sounds like what you've done (reasonably enough) has provided you with raw Openstreetmap data, rather than the map pictures which you're familiar with looking at. What you have is a set of points and lines, each with data attached to them - so for example a line might represent a motorway, a river, or a boundary (etc). This is a good thing - if what you ...


0

I've not tried to do this recently, but in the past (6 months ago) the creation of a printed map using composer and the Openlayers plugin with some (all?) of the available OSM layers often didn't work for me. The other problem was that the only way I could find to set the choice of zoom level that the printed map used was to alter the resolution in the ...


4

I work in an environment where we use both softwares and here are my impressions. I began to use QGIS about a year ago when I finally became fed up with paying for additional extensions and licence levels. I find QGIS to be good for manipulating data and getting it into more open source friendly formats while ArcGIS is much better for Map creation. That ...


1

Maybe try something like this? http://docs.geotools.org/stable/userguide/library/jts/geometry.html#creating-circularstring


1

If you're using Ubuntu, the commands found in the QGIS menu are accessible via heads-up-display (HUD). To show / hide the layers panel, or the browser panel for example: click the ALT key then type 'layers' then click ENTER. The layers panel will show/hide


2

Looking at https://en.wikipedia.org/wiki/ISO/IEC_8859-1, I don't see any support for Indian font characters. I suggest to create a shapefile in UTF-8 encoding, which is able to display all characters of the world that are defined by unicode correctly. If you load the file into QGIS, make sure the encoding is set to UTF-8 and not to System (which varies ...


0

After a lot of thinking and research here, I believe I found a solution. I would love to receive some peer review and feedback on this approach. I used ogr2ogr to generate a GeoJSON file from a PostGIS query using the CIRCULARSTRING function. ogr2ogr -s_srs EPSG:26910 -t_srs EPSG:26910 -f GeoJSON testArc.geojson PG:"host=localhost ...


3

I have not come across such a shortcut, but rightclicking on an empty part of the toolbar area lets you easily activate or deactivate panels and toolbars. I guess it would not be too difficult to write a python plugin with its own icon for your task.


0

I think you mis understand what QgsApplication.pluginPath is meant to return. The path it returns is the plugins for the application itself, not the user plugins. Application plugins include the data providers, C++ core plugins, etc


1

@coelacanth, if you just consider the styling, this is easy using two 'Marker lines', both with interval X, for the first set X/2 as 'offset along line', then set offset Y, for the other set the opposite offset -Y!


0

Your data seems to be equally spaced, so I suggest to load it as a XYZ Raster file. You have to obey the expected sorting order: http://www.gdal.org/frmt_xyz.html If qgis fails on the file size, try to do the conversion with pure GDAL. It gives better error messages, and saves the valuable RAM that the QGIS GUI needs.


3

To find out the right CRS, create a new project in QGIS with project CRS set to EPSG:3857, load Google or OpenStreetMap background from the Openlayers plugin, and look where your data is placed. If you set the Layer CRS of your data to EPSG:32749 WGS 84 / UTM zone 49S, your data will be placed in the right position (at least the same place a Google search ...


0

Try the Unique_values_saver plugin for QGIS. It allows you to save one vector layer for each unique value from a specific field. For instance, for a layer with world countries and regions, I've generated 10 vector layers, each one corresponding to a different region. If you really need the way to do it in Python, just have a look at the source code of ...


2

Those input points are not in urn:ogc:def:crs:OGC:1.3:CRS84, since that is (roughly) WGS84 lon / lat, and (taking the first point): [ 383707.21875, 9211513.0 ] is not a reasonable lon / lat combination. What QGIS is (probably) doing in converting that point to -52.78125,9211513.0 is taking 383707 and wrapping it around a few times (383707.2185 - 1066 * 360 ...


2

Use TileMill or MapBoxStudio or if you have lots of Maps/Charts in GeoTiff then MapTilerPro. For ArcGIS for Desktop you can use Arc2Earth Extension to create Tiles. Are you looking to create XYZ, TMS or MBTILES sqlite database? For mobile app use mbtiles. For web TMS, check out http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/ for ...


2

I came across the same issue last week. Follow this work flow and you'll be able to see selected points, even if they share position with non-selected points: Load your point layer in QGIS and make sure it is in the first position of the ToC. Open the Python Console from Menu Plugins. Copy the next Python code in the Python console and press Enter (you ...


1

One alternative solution is to use Mobile Atlas Creator (MOBAC) http://mobac.sourceforge.net/ to download aerial imagery tiles as a .png + worlfile (stipulation remains that it be in EPSG:3857) or depending on where you are the National Aerial Imagery Program has some good aerial imagery that can be downloaded as .Tif files ...


0

There are packages created for MacOS, usually by KingChaos. Looks like you can also use homebrew: http://www.kyngchaos.com/software/postgres http://brew.sh/ As usual, the best way is to look at the docs, as already said by John, check this link: http://postgis.net/install


4

There's a "Copyright" decoration option in QGIS already. View... Decorations... Copyright Label. Choose text, placement position, colour. Make sure to enable the checkbox. Doesn't have text size or font choice, but the defaults look okay. Use © if you want a copyright symbol. This is QGIS 2.4.


2

You may use the addGroup function like this: MyFirstGroup = iface.legendInterface().addGroup('Group No. 1') MySecondGroup = iface.legendInterface().addGroup('Group No. 2', true, MyFirstGroup)


2

If qgis freezes, try the same command in GDAL/OGR: Open source software to merge large shape files It gives you the opportunity to see error messages, as well as saving valuable RAM that is used by the QGIS GUI. The shapefile 2GB limit that you cross can not be solved by that, so you need another output format, like spatialite database.


6

You could check out the Watermark plugin for QGIS https://plugins.qgis.org/plugins/watermark/ Hope this helps


-1

On second thought, I just had a very successful session with the "split feature' tool. My advice, de-select every time.


0

I guess your problem is rather How to remove an old version of QGIS completely before re-installing. Mixing ubuntugis and qgis debian packages might lead to unexpected behaviour. On updating from QGIS 2.6.0 to 2.6.1 I noticed that some ubuntugis packages (qgis, python-qgis and one other) were not upgraded, but manually forcing the install did the trick.


2

I figured it out. Go the Layer labeling settings window ( Layer >> Labeling ) Click on the blue and orange icon in the upper right hand corner (Automated Placement Engine.) Deselect "Show Partial Labels"


2

What I usually do Create point layer from midpoints of network segments. Spatial join of points to CLOSEST info line, define distance field name Transfer attributes back to segments, where you think they are close enough


2

The Generate Near Table tool in ArcGIS will do what you want, but it requires an Advanced license and will do it for all points/polygons - not just those associated with each other. This means for each of your 95 objects you will get the ranked distance for all 211 properties, so 20,045 rows in the table. You'd either have to filter the resulting table or as ...


1

You could try to install everything from packages first, then add the hdf5 libs and re-build gdal with that. All other ways (except self-compiling all) will end in the problems you discovered.


1

You could combine the select by location query with a comparison of line length. I'm not really sure how feasible it is, but you could cycle through all of the features in the good geometry shp, select each one and then do a select by location on the other layer. Then, for all of the selected features in the bad geometry layer, compare the value in the ...


2

Working (albeit cumbersome) solution to convert KML-/KMZ-files with <gx:Track>-Extension to gpx/csv/tcx, via Googles MyTracks-App. I tried to import a .kmz-file to QGIS, containing a GPS-track as <gx:track>-Element. (Track was recorded with MyTracks-App on Android. I only had the .kmz.) After numerous attempts, using various tools ...


2

ArcGIS Snap tool will do this for you (standard and up license level). You need to fill in what type of snapping you are looking for in the Type column. Also the Distance of the snapping. Also keep in mind this is a tool with no outputs, so make copies of your input data before trying.


2

I disagree that QGIS always uses multipoint. If you use the Extract Nodes tool, you get a single point layer, and converting Multipart to singlepart and back changes the geometry type as expected. You can run ogrinfo on the shapefiles to check the geometry type. Unfortunately, QGIS reports the layers metadata always as Point.


0

With the new layer list widget (aka legend, ToC or layer tree) added by Martin Dobias since QGIS v.2.4, you can follow this procedure from the QGIS Python console in order to add layers to a specific group (you won't need group indices anymore): Get the reference of the layer tree. root = QgsProject.instance().layerTreeRoot() Find the desired group. ...


3

You need ST_Difference which returns the the geometry of a feature that does not intersect with another feature. In your case something like this: SELECT l.id, ST_Difference(l.geom, p.wkb_geometry) As diff_geom FROM lines l, polygons p Modify for your actual table and field names.


1

Use the QuickMultiAttributeEdit plugin. This is the work flow: Load a vector layer. Select some features. Press F12 (or click the plugin button). Select the field you want to edit and set the new value for selected features. Click OK and save the edits.


0

Use the Text Annotation tool to select the annotations ("pinned points") and use the Delete key to remove them.


2

Go Settings -> Project Properties, in CRS tab enable on the fly transformation; in General tab in Measure tool menu choose ellipsoid for distance calculations. See picture: When you start measurement move cursor to the measurement window: the information about your measurement settings will pop up: NOTE: ALWAYS check measurement settings in the measure ...


0

Follow these 5 steps in the QGIS Python console: Get the layer reference (I assume the layer is at the top of the ToC): l = iface.mapCanvas().layers()[0] Get a featureIterator from an expression: expr = QgsExpression( "\"EXCHANGE_1141_CODE\"='IH'" ) it = l.getFeatures( QgsFeatureRequest( expr ) ) Build a list of feature Ids from the result obtained in ...



Top 50 recent answers are included