Hot answers tagged

3 votes

Specifying target resolution when resampling with rasterio

You just need to figure out the scale factor from your chosen and current pixel size, e.g. I want to resample this 10m resolution "input.tif" to 12.5m: import rasterio from rasterio.enums ...
user avatar
  • 52.7k
3 votes

Finding distance between points using Python

As @Vince notes in a comment: Your query asks for the distance between a point and itself, so zero is the correct answer. If you want to compare each point with the other points you need to nest the ...
user avatar
  • 52.7k
2 votes
Accepted

Distance between polygons and points in GeoPandas

Attention, you are trying to calculate the Euclidean distance in meters between geometries in degrees (WSG 84, longitude, latitude, EPSG:4326, unit Degree) which is wrong. There are many question/...
user avatar
  • 51.1k
2 votes

Retrieve pixel value using SNAP-engine and Python for specific geographic coordinates

I know it has been two years, but there are three things: You have to load raster data after retrieving a band p=ProductIO.readProduct('/path/to/file.xml') iwv=p.getBand('IWV') iwv.loadRasterData() #...
user avatar
1 vote
Accepted

Set-Operations with Overlay when columns match

A simple solution is to select the rows of the GeoDataFrames before overlay: df1 = df1[df1['name'] == 'B'] df2 = df2[df2['name'] == 'B'] result = df1.overlay(df2,how='symmetric_difference') ax = ...
user avatar
  • 51.1k
1 vote

Randomly select points in a feature layer

The below will select a user defined number of level 1 and level 2 records at random from the dataset, just update the num_level1 and num_level2 variables. I have commented the code for ease of use. ...
user avatar
  • 1,026

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