Hot answers tagged

7

Interesting question! I'm not aware of any other way of achieving what you want, but using PyQGIS. Read the code below. It has some texts in it: 'lines', 'length', 'startX', 'startY', 'endX', 'endY'. You can adjust those names in the script for it to work on your data. The first one is you layer name, whereas the rest corresponds to field names. I assume ...


6

If you only need these fields inside QGIS, you can use virtual fields. These allow using an expression (like $length) that depends on other values or the geometry. Open the field calculator, add a new field with the name length, check the "Virtual Field" checkbox and enter $length as expression (or something else for the other fields). These will however ...


2

If the points are regular points having the same distance between each point, you can convert the points to raster instead of polygons. But you need to select the proper cell size, simply by measuring the distance among the points. Then you can Go Raster -> Conversion -> Rasterize. Set a vector layer to process, a field with values and desired raster ...


2

Definitely, you need a "Group stats" plugin: a litle tutorial from Anita Graser: https://anitagraser.com/2013/02/02/group-stats-tutorial/ It works like a dynamic table in Excel.


1

If you mean to have 1-4 adjacent color boxes at bottom-left, top-left, bottom-right, and top-right positions then I would do it by having one square symbol with points POINTS 0 0 0 1 1 1 1 0 0 0 END Then I would make four copies of the symbol with different ANCHORPOINTs as documented in http://www.mapserver.org/mapfile/symbol.html. ...


1

Perhaps you could to use coordinate X and Y from the group of point to obtain x min, x max, y min and y max and then you could obtain X and Y from the center and the radius or diameter. Obviously, you'll obtain 2 data, X and Y, you should to choose the more interesting from your work, mínimun, mean, maximum... In this way to obtain the circle and the ...


1

I would put the data in a database (PostGIS) and extract the data to QGIS with a (probably materialized) view.


1

Altough I wasn't able to find a bug in the above code... I managed to work it around using another way to load GeoJSON based layers. Another thing, the lat and longs weren't properly ordered in the example given (so that the correspond to positions on Rosario, Argentina)... Below are written correctly. <!DOCTYPE html> <html> <head> ...


1

The geojson layer is in EPSG:4326, not 3857. For the center_coord, you should reproject the degree values to EPSG:900913: new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());


1

If they are in the same projection You can use spatial join from Vector -> Data Management Tool -> Join Attributes by location. Try to use "Take attributes of first located feature" as shown below.


1

Thats what you need to add: import sys # where is the module sys.path.append("/Applications/QGIS.app/Contents/Resources/python/") sys.path.append('/Applications/QGIS.app/Contents/Resources/python/plugins') qpp = QgsApplication([], True) QgsApplication.setPrefixPath(r"/Applications/QGIS.app/Contents/PlugIns", True) QgsApplication.initQgis()


1

Update: IMHO Shapefiles should be called deprecated these days. GeoPackage is a promising successor. It's similar to Spatialite but from OGC and it's been adopted by many software, inlcuding ArcGIS and OGR. See the official homepage http://www.geopackage.org/ and e.g. this presentation: http://www.slideshare.net/JeffYutzler/geopackage-swg-overview



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