Hot answers tagged

8 votes
Accepted

Creating CSV with lat/long from point shapefile using Python

Use GeoPandas to solve your problem. import geopandas as gpd 1. Load Spatial Data gdf = gpd.read_file(shp_file_path) When you load spatial data using geopandas, you can view the geometry with ...
user avatar
  • 578
5 votes

QgsPoint invalid argumets in PyQGIS 3

vertexAt method returns QgsPoint. So, you don't need to construct new one. You get the error since QgsPoint class doesn't have any constructor method which takes a QgsPoint argument in QGIS 3 unlike ...
user avatar
5 votes

Selecting points which touch "boundaries" of another polygon using QGIS

You can use "Select by expression" via QGIS's Processing Toolbox (Ctrl+Alt+T) or attribute table (F6). Run it on your points layer and use this expression: distance( $geometry, ...
user avatar
  • 24.5k
4 votes

Selecting points which touch "boundaries" of another polygon using QGIS

Convert your polygons to lines Select by location, the buffers intersecting the lines (or Select within distance, your title says points but question body says polygons)
user avatar
  • 51.1k
4 votes

Plot points around defined centroid using degrees and distance in QGIS

You should be able to use the pyproj.geod module to determine the coordinates of the trees... https://pyproj4.github.io/pyproj/stable/api/geod.html#pyproj.Geod.fwd To quote from the docs for geod.fwd()...
user avatar
  • 261
3 votes
Accepted

Plot points around defined centroid using degrees and distance in QGIS

Join the tables using "Join attributes by field value". The plot points as input layer, the trees table as input layer 2, join type "one to many". I saved the excel to csv and drag-...
user avatar
  • 51.1k
2 votes

Finding distance between two different point layers in QGIS

I had a similar problem: The Receiver layer had 48600 points and I needed to find the closest point in the Source layer (15900 points). QGIS>Vector>Analysis Tools> Distance Matrix. 1."...
user avatar
  • 21
2 votes
Accepted

Looking for Python equivalent of QGIS "Nearest Neighbour analysis" tool

This attempt is not finished yet, because it requires Ellipsoidal distance instead of Cartesian. As you can see in the source code spatialIndex = QgsSpatialIndex(source, feedback) distance = ...
user avatar
  • 22.7k
2 votes

Creating CSV with lat/long from point shapefile using Python

Another solution involves the PyShp package and some Python standard libraries: csv and os. Let's assume there is a point layer called 'points' with 10 features in it, see the image below. Apply the ...
user avatar
  • 22.7k
2 votes
Accepted

Extracting polygon features based on single layer attribute polygons using ArcGIS Pro

Steps: Create a Spatial Join. Target Features: points - Join Features: polygons - Join Operation: Join one to many - Match Option: Within. Use the Split by attribute geoprocessing tool on the newly ...
user avatar
  • 673
1 vote
Accepted

Creating a point pattern (ppp) error using SpatStat in R: "Only projected coordinates may be converted to spatstat class objects"

Calling st_as_sf on something that is already an sf object appears to be a null operation: Sample data frame: > d = data.frame(x=1:5, y=1:5, a=5:1, b=5:1) > d x y a b 1 1 1 5 5 2 2 2 4 4 3 3 3 ...
user avatar
  • 51k
1 vote

Adding break/vertex on a polyline from points

An easy way to do this is to use the "Snap geometries to layer" tool from the Processing Toolbox with the following options: Input layer: the polyline you want to add vertices to Reference ...
user avatar

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