Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

A very though answer from Joseph clarifying how QGiS makes measurements However, the question is now clearer to me and it is: How can I place the shape of defined dimensions (in metres, 5000m X 2000m) measured on the WGS84 ellipsoid at a location on the ellipsoid (51 degrees N 2 degrees W)?


2

QGIS 3 uses ellipsoid length calculations by default whereas in previous versions, this was ignored and instead planimetric distance calculations were used. If you measure the lines using the expression: length($geometry) You should get the values you were looking for (5000m and 2000m): Before you use your code, set your project ellipsoid measurement to ...


1

ST_GeomFromText demands the coordinates in the x1 y1,x2 y2, ... ,xn yn format, as said in the comments. Consider using something like this to adjust the format of your coordinates column: select coordinates, replace(replace(replace(coordinates, ' ', ';'), ',', ' '), ';', ',') as adjusted, ST_GeomFromText('LINESTRING('||adjusted||')') as geom from vejnet....


3

You need to use geometry:feature.getGeometry().clone() otherwise the features will share the same geometry object and a change to one will change both.


0

The QgsVectorLayer class does not have the function geometry. https://qgis.org/api/classQgsVectorLayer.html. Maybe you should use: for feature in layer.getFeatures(): print(feature.geometry().length())


1

Let’s point out some useful information: 1 - A layer has features. 2 - A feature has a geometry With that in mind, you need to iterate over the features in your layer. For each feature you do: for feature in layer.getFeatures(): geom = feature.geometry() len = geom.length() And so on...


1

To directly answer your question, you can "align" the geometry of the pixels of multiple images by using ee.Image.reproject() and ee.Image.resample() and mapping those functions over images in the collection. However, be aware that this will potentially alter/smooth the information provided in each of the original images. (Your example is for a high latitude ...


2

I would use data access search and insert cursors after creating a new feature class. This will most likely be slower than the Buffer tool but it may be more successful, or you may be able to find your problematic geometry with try/except statements. Basic script: import arcpy import os i = 'PCPP_sites' o = 'C:\buffer_test' outPath, outName = os.path.split ...


4

It looks like you’re setting the ‘cumulative’ field to the area of that record only, not the running total. Try replacing: row[1] = AreaValue with: row[1] = running


1

The easiest way to produce size invariant wind barbs is to make use of the Windbarbs mark in your style, rather than trying to construct it in map units (which is why yours change size with projection). Based on this blog post by GeoSolutions you can use a SLD file like this: <FeatureTypeStyle> <Rule> <...


0

After some further research, I found a solution: The 3D equivalent to QgsGeometry().asPolyline (which returns a list of QgsPointXY) is QgsGeometry().constGet().points(), providing a list of QgsPoint. Such list is called a QgsPointSequencein QgsAbstractGeometry class, but called a QgsPolyline in QgsGeometry class. That's definetely confusing. However, my ...


2

The code is in GitHub. The Fix Geometries tool is a wrapper to the function LWGEOM_GEOS_makeValid, which then calls different functions for different geometry types. You can read the various LWGEOM_GEOS_makeValid* functions such as the polygon one in the file qgsgeometrymakevalid.cpp


2

In R there is package cleangeo for geometry checking and celaning. You can use for example: library(cleangeo) report <- clgeo_CollectionReport(spatial_object) report #returns a table: type valid issue_type 1 <NA> TRUE <NA> 2 rgeos_validity FALSE GEOM_VALIDITY 3 rgeos_error FALSE ORPHANED_HOLE ...


3

The query is taking a long time because it is doing a cross products between tables a and b (and poly). So if poly has 1 polygon only, and both a and b have 1,000,000 features, you end up computing st_DWithin 1,000,000,000,000 times. You can try to combine the two update using a join instead. You may have to use a subquery to achieve it though, as ...


1

In theory you could create a black polygon with a hole in the center and import that. I am just not sure how well google earth would load.


Top 50 recent answers are included