QGIS | open source , cross platform | Map library
kandi X-RAY | QGIS Summary
kandi X-RAY | QGIS Summary
QGIS is a full-featured, user-friendly, free-and-open-source (FOSS) geographical information system (GIS) that runs on Unix platforms, Windows, and MacOS.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of QGIS
QGIS Key Features
QGIS Examples and Code Snippets
Community Discussions
Trending Discussions on QGIS
QUESTION
Class QgsVectorlayer
derives from base class QgsMapLayer
which derives from base class QObject
. I want to cast a QgsVectorlayer
object to a base class. This should easily be possbile but I get an error and don't understand why.
The annex to the (probably not unimportant) error message is:
...qgsgeometry.h:46:7: note: 'QgsVectorLayer' is incomplete
Line 46 contains only the QgsVectorLayer
class definition:
ANSWER
Answered 2022-Apr-14 at 12:13The definition of the class is missing at the point where the static_cast
is used. Just because the definition of the class exists in some header file doesn't mean that the compiler automatically knows it everywhere the class is referenced. Whichever header file defines this class was not #include
d, so the only thing that the compiler knows is that the class has been declared.
Line 46 contains only the QgsVectorLayer class definition:
class QgsVectorLayer;
The translation unit #include
d this header file, directly or indirectly.
The definition of QgsVectorLayer:
class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionContextGenerator, ... {...}
And this header file was not #include
d, directly or indirectly.
You'll need to figure out how to correctly #include
the required header files.
QUESTION
I have a shapefile of areas/polygons and I'm trying to show that in a choropleth_mapbox in plotly express. What I want to show is only the boundaries/borders. i.e. the fill colour is transparent!
I've been doing something like this:
...ANSWER
Answered 2022-Apr-08 at 12:58If all you want are boundary lines, then you can add a geojson layer. Have used other geometry as you geometry is not accessible to me.
QUESTION
Issue:
I have a data frame that has 16000 rows, and I am going to use this data to plot a boat track line in QGIS. One of the columns is called ' Course', which is the subsequent number order that the boat went out per field season.
For instance, course 1 ranges from 6/16/17 to 8/13/17. The boat track data frame has five columns for ID, date, time, course, latitude and longitude. These values were recorded every second throughout each day, which generally ranged from 6 am to 6 pm. Therefore, for each field course, there are hundreds of rows. Altogether there are 11 courses over a 5 year time period (2016-2018).
Is there any way that the data can be filtered per row by date to input a repeating number such as the value '2' (course 2) in the 'Course' column for the dates 8/14/17 to 10/16/17, and the repeating value of '3' (course 3) for the dates of 10/17/17 to 03/01/18, and so forth?
Unfortunately, I cannot share my data and I cannot find public any data that resembles my data frame that I can supply for this question using the function dput().
I have been using packages such as dplyr and tidyverse to try to solve this conundrum and I have so far been unsuccessful in finding a solution.
Would anyone be able to help?
Many thanks in advance.
...ANSWER
Answered 2022-Apr-03 at 12:50As mentioned, it is helpful to make up example data for something like this. Here, I created 2 data.frames. One will have your data (16k rows), and the second will have your filter criteria (e.g., which course and date range you want to keep).
QUESTION
I am trying to create several .qgs project files to be served at a later time by an instance of qgis Server. To this end I need to start a new PyQGIS application several times upon request. The application runs smoothly the first time it is called, but if I try to run it a second time I get a Segmentation Fault error.
Here is an example code that triggers the problem:
...ANSWER
Answered 2022-Feb-18 at 18:42UPDATE: Following a suggestion of one comment found on this post:
https://gis.stackexchange.com/questions/250933/using-exitqgis-in-pyqgis,
I substituted qgs.exitQgis()
with qgs.exit()
and now the app can be instantiated again any number of times without crashing.
It is still not clear what causes the segmentation fault, but at least I found this workaround.
QUESTION
I used osmnx to download a map and export as geopackages so that I can edit it in QGIS. After edit(mainly change CRS to GCJ-02) , I want to import the edited edges and nodes into osmnx as a graph to do some routing.
I imported them using
...ANSWER
Answered 2022-Apr-01 at 10:19Given what you describe, this warning is fully expected. If you have modified the geometry of the nodes and have not made x and y attributes consistent. Best illustrated by sample code below.
- first conversion back to a graph generates a warning
- second conversion after ensuring denormalised columns are consistent with geometry does not generate a warning
QUESTION
I have a shape file that I can read like this in R:
...ANSWER
Answered 2022-Mar-18 at 20:09Using R & the sf
package you can make a convex hull of the unioned (if necessary) shapefile. Since you haven't included data, I've used the nc
data included with the sf
package to illustrate the method.
QUESTION
I'm currently storing a lot of data on a Azure SQL for Postgres instance. My table consists of columns like lat, lon, and geometry which is created using PostGis function
...ANSWER
Answered 2022-Mar-15 at 21:25PostGIS convention is to pass longitude first (as X coordinate) and latitude second (as Y). So try
ST_MakePoint(lon, lat, 4326)
QUESTION
I've been incorporating the MarketCluster and the associated FeatureGroup.SubGroup plug ins from Leaflet to add additional functionality to my generated QGIS2web map.
Part of my requirements is toggleable layers and where MarkerCluster works well when I had categorized layers from QGIS that were automatically clustered with separate layers this is no longer the case. To my understanding I needed either MarkerCluster.LayerSupport or FeatureGroup.SubGroup plugins to handle the additional layers and still provide clustering.
I've incorporated the CSS from MarkerCluster, JS from MarkerCluster and SubGroup, as well as called it in the map and in the respective places but the icons aren't actually clustering - image below.
The bottom 3 layers are all under the parent group mcg and all have been added to the map and called under the plugin so I'm not too sure why they are not clustering at small scales?
Var map code:
...ANSWER
Answered 2022-Feb-24 at 22:39I have now got it working by using MarkerCluster.LayerSupport
and by adding it to both var map and checking it in - maybe wrong plugin usage but likely my human error.
Working code below:
QUESTION
I have nine raster layers (.tif) and each needs to have the same extent, resolution and CRS in order to work in Maxent. I have tried converting each layer to the same CRS and translating them to .asc format in QGIS. After that I tried to resample the layers in R to match one of the layers, but this resulted in errors, such as that the extents do not overlap. My question is how do I match all these layers in order to proceed with Maxent and also to use the 'stack' function in R?
Here is the zip-file with the rasters: https://drive.google.com/file/d/1lle95SPdQ7FyQSbFoFvmAzyuO2HUt7-L/view?usp=sharing
...ANSWER
Answered 2022-Feb-23 at 15:26So the initial problem is to set the crs using the 'crs' function from the raster package (I haven't used the new terra package yet). Then you need to reproject into the same crs. The next step is to resample the rasters so they all have the same cell resolution and size. Last you can put them in a stack. I was in a rush, so I didn't comment very well, but let me know if you have questions. The last point is the bedrock file. You'll need to use QGIS or another program to georeference it first. Try to find a map with a known projection that looks similar to it.
QUESTION
I am having trouble getting raster data in R from the ArcGIS REST API. It is located at the endpoint https://maps.vcgi.vermont.gov/arcgis/rest/services/EGC_service/IMG_VCGI_LIDARNDSM_WM_CACHE_v1/ImageServer and I want to fetch just the data for my area of interest. I can successfully load the data in QGIS as a web coverage service using the url "https://maps.vcgi.vermont.gov/arcgis/services/EGC_services/IMG_VCGI_LIDARNDSM_WM_CACHE_v1/ImageServer/WCSServer", but want something I can turn into a raster layer or raster brick in R.
I would prefer a high-level method and have tried the arcpullr
package, using an sf
polygon object of my area of interest to define the bounding box (aoi
in the code below, which is a simple feature collection with 1 feature and 1 field;
Bounding box: xmin: 499682.2 ymin: 208467.7 xmax: 503271.3 ymax: 212056.7;
Projected CRS: NAD83 / Vermont, 32145). This returns an empty raster brick (all values are NA) in the correct location:
ANSWER
Answered 2022-Feb-21 at 11:28The problem you are experiencing is that you are not using the right crs
. You simply need to convert your aoi
from EPSG: 32145
to EPSG: 3857
(the spatial projection information is provided on the Service webpage).
So, please find below a little reprex.
Reprex
- Code
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install QGIS
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page