Tag Info

New answers tagged

2

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.


1

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.


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

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


1

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


1

You can listen to the extent changed event and reset it back if it goes outside of the bounds: def extentsChanged(): extent = iface.mapCanvas().extent() outofbounds = # Do your check if outofbounds: iface.mapCanvas().setExtent(newextent) iface.mapCanvas().extentsChanged.connect(extentsChanged)


1

Still working on the detailed color legend but it should work fine. Thanks again!


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.


0

Not tested, but it might give you what you want. With intersections you get those ids and geometries that intersect with others. And the SELECT statement will ST_Union all of these records that intersect exactly with two other geometries. ST_Dump makes sure you don't get MultiLinestrings as a result. WITH intersections AS ( SELECT l1.id, ...


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.


0

Yes, AndreJ, you are right, thanks. For applying the “Point sample tool” the maps and grids should align with OTF off. After transforming the maps/grids to the same (Project) CRS (with "save as") everything went fine.


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


3

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));


0

The columns mean: Geographical easting/longitude Geographical northing/latitude Location of the ground control point in image pixel space from left to right Location of the ground control point in image pixel space from top to bottom Boolean selection if the GCP should be used (1) or not (0) in computing The anchor point in the image space is at top-left ...


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!


1

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

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


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


0

You could try creating fields for X and Y coordinates of the centroids. All of the Y coordinates will be the same for each column. You can select those and call them '01', '02', '03', etc. Then do the same for the rows. You can easily write a script to sort by Y coords then X coords and rename columns and rows. I just did a similar thing in ArcGIS. ...


1

The correct syntax is: cs2cs +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs +to +init=epsg:4326 -f %%.8f<nad.txt >out.txt with 987043 206407 in the input file nad.txt to get this output: -73.98992216 40.73321572 ...


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


0

you can get geonode to host your data and cartoview to serve your web mapping applications. it is compatible with ESRI standards and OGC. You can also combine it with opengeo suite. check out the demos at http://cartologic.com/cartoview/demo/


1

It's a bug - it was fixed yesterday, see https://github.com/qgis/QGIS/commit/df4a41f7800083db5be4bb9ba152209f1e57f575


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


0

then I input a shape file from the folder that consists all the shapeless that need to be merged That's a bit hard to understand but I think your problem is that you are selecting only one file to merge while you should select the folder: Don't activate Select by layers in the folder if you want to merge all files in a folder anyway!


0

It is difficult to explain your results without seeing your dataset. You may have a problem with your attribute data (non-unique InputID / TargetID?). I tested Distance Matrix in QGIS 2.8.2 using a Shapefile format layer with a projected CRS. Only neighbour points with a distance greater than 0 to the "reference point" were included in the output CSV ...


1

Thanks AndreJ, I did some further research and ended up with a custom CRS file as you suggest and that solved the problem. Contents of the CRS for this case: +proj=utm +lat_0=32 +lat_2=40 +lon_0=-78 +lon_1=-75 +lon_2=-72 +datum=WGS84 +units=m +no_defs


0

Since the picture's world file has meters as units, WGS84 is definitely wrong. You have to find out which UTM zone your data is in, then use Rightclick -> Set CRS for Layer to correct the wrong CRS. BTW, jpg files never come with a .crs file. You have to enter the CRS manually. Once done, you can save to Geotiff which has the CRS information stored inside ...


0

Okay, based on the comments above. I think your first problem is that your white lines are gaps between the polygons. I would start by establishing what the subject is. I.E. is it lines on a polygon or a polygon with loads of other polygons. I would try to convert polygons to lines using Vector>Geometry tools>polygons to lines. If this works and you are ...


1

Since I was not able to realize the rotation I did the following to achieve a comparable solution: I just switched the line direction (How can I switch line direction in QGIS?). This rotated the labels by 180°.


1

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


0

as Mkennedy says, show us an example of the points. it sounds like you may have a different CRS that what is acceptable in GIS. I have had similar problems whereby i was given a mix of long lat coords and others. Some were expressed as degrees minutes seconds, some as degrees and decimal minutes. My solution was to covert the points using a formula ...


0

Looks to me like the base layer is a Raster image, and the rivers layer is a vector file. I would also assume that the difference is due to scale of mapping/capture and not acutally the reference system or changes in the river. it would basically be the same as assuming a house outline on 1-50k mapping is the actual house outline on the 1-500 scale plan. ...


1

For QGIS 2.8.2, it works fine. You can turn the labels upside-down: To rotate labels by 180 degrees (or turn them upside-down), from the Rendering tab you can enable the option the Show upside-down labels option which would automatically rotate the labels. You don't need to define a value for 180 degrees: Then that should do it. Remember that 6 and 9 ...


1

As far as I remember, the rotation can only take effect if you also data-define the coordinates. Otherwise, labeling just follows the position defined in the placement section and ignores the data-defined settings.


1

If you know how to do a cross section with heights (using a DEM raster), then you know how to do it with any other variable. All you need to do is convert your data ( the buildings polygons) in raster using the desired field. And then use it in the profile plugin.


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


0

I would suggest you to try gdal2tiles.py gdal2tiles.py --force-kml --webviewer=none [input file] [output_dir]/ Would create a directory with all tiles and the KML file. Simply compressing it into a ZIP file and changing the file extension to .kmz gets you a KMZ file ready to put onto your GPS device. You could also script the whole process in bash: for ...


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


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

Thanks @toms! The code worked great: <table><tr><td><audio controls><source src="audio/moo.mp3"></source></audio></td></tr></table> Much appreciated!


0

I've not worked with QGIS Leaflet, but if every column in that table is just meant to be html that gets inserted in the popup, and you're ok with using HTML5 audio controls, try the following markup: <audio controls><source src="audio/moo.wav"></source></audio> You should be able to include the table wrapper, too, as you have ...


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


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.


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


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

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.


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


1

Not sure I completely understand but I noticed there's a couple of attributes in the custom label layer called LblShow and LblAShow, both of which use Boolean values (0 for false; 1 for true): The LblShow is the actual label so we can leave that with an attribute of 1. The LblAShow is the arrow (although in my view, it's practically tiny). If we update ...


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



Top 50 recent answers are included