New answers tagged

3 votes
Accepted

Iterating over the features of a vector layor then performing zonal statistics algorithm on each feature in PyQGIS

You can make use of the QgsFeatureSource.materialize() method. from qgis.analysis import QgsZonalStatistics from qgis.core import QgsRasterLayer, QgsVectorLayer v_layer = QgsVectorLayer("...
Matt's user avatar
  • 16.2k
0 votes

Finding the position with the most points in a polygon

If I were you I would try either of the following approaches Solution 1. Generate a neighborhood graph For each point find the k-nearest neighbours. If the neighbour is less than a certain threshold ...
Abhilshit's user avatar
  • 656
1 vote

Query polygon layer by geometry size

Right click on the layer --> Filter Enter your query It doesn't work if your layer is in the edit mode In Arcgis it is a little bit more logical that the defintion qurey is in the property window/...
Xeppit's user avatar
  • 1,255
0 votes

Importing vector layers where geometry is WKT in PostGIS

I don't know if this helps but storing the shape as GEOMETRY is preferred and that can be used directly in the QGIS. In another case, you can use GENERATED COLUMNS to create a GEOMETRY column from the ...
json singh's user avatar
3 votes
Accepted

Display point with heighest value in group of points

Perhaps, you will find this expression suitable for you: geometry_n( collect( expression:=$geometry, group_by:=substr("NumeroNom", 0, 5), filter:="AmslFt&...
Taras's user avatar
  • 32.7k
1 vote

Get the name of the geometry column(s) of a GeoDataFrame

In geopandas 0.14.2, there is an easier way to find the active geometry column. (I'm not sure what version this started in). gdf.geometry.name You can also use the attribute gdf.geometry to always ...
Rejexx's user avatar
  • 13
0 votes

Segment lines by given divider

Update: I managed to do it with the v.segment tools from GRASS. I had issues creating the .txt needed but in the end it did exactly what I needed. So the txt file needs to be ordered that way with Tab ...
basile's user avatar
  • 69
0 votes

Segment lines by given divider

It can be done using the Split Lines by Maximum Length processing algorithm. Use the layer that has one feature per line; since you are splitting the lines only in two, you can use either of the 2 ...
crafter6029's user avatar
0 votes

Calculating distance between two point layers based on matching ID using QGIS

As commented by @J.Monticolo: Just replace PID0001 by the "PID" field value : length(shortest_line($geometry, geometry(get_feature('LandscapeAll', 'PID', "PID")))).
PolyGeo's user avatar
  • 65.1k
3 votes
Accepted

GEE Error: .setGeometry is not a function

To solve this, you need to explicitly cast old_feature to an ee.Feature because Earth Engine wasn't able to infer its type. var new_feature = ee.Feature(old_feature).setGeometry(g); //g is a geometry ...
Aaron Zuspan's user avatar
1 vote

GEE Error: .setGeometry is not a function

As @Aaron Zuspan correctly mentioned, in this case GEE is unable to infere the type of old_feature and therefore one needs to explicitely define the type of it : var new_feature = ee.Feature(...
Sina NAKHOSTIN's user avatar
0 votes

GEE Classification Error Multiple Geometry types

You can get the polygon within the GeometryCollection using (if there is one): var list = geometryCollection.geometries().filter(ee.Filter.hasType('item','Polygon')) var polygon = ee.Geometry.Polygon(...
Kadir Şahbaz's user avatar
2 votes
Accepted

Why the buffer geometry column in the GeoDataFrame is in point form although it's actually in polygon form?

You have a typo in your read_file call. You use parameter layers="buffers" instead of layer="buffers". So: shopping_centre_buffers = geopandas.read_file( DATA_DIRECTORY / "...
Pieter's user avatar
  • 1,530

Top 50 recent answers are included