geospatial

How to perform basic math on numpy ndarray

How to perform basic math on numpy ndarray Question: So, I have a numpy ndarray with dimensions (984, 1977, 2). What I want to accomplish is to have a numpy ndarray where I do basic math on the final values. So let’s say data is my ndarray. And data[0][0] equals to [72 46]. So I …

Total answers: 1

Plotting tiles of nighttime lights from multiple h5 files into one big map

Plotting tiles of nighttime lights from multiple h5 files into one big map Question: I am trying to create a map of nighttime lights for Europe. Data source is NASA and I am using their VNP46A1 data for 2022/03/27 (you can find the exact files in my Dropbox, too). For downloading the data, I select …

Total answers: 3

Is there a NetworkX function to find the k-nearest nodes of 0-degree nodes

Is there a NetworkX function to find the k-nearest nodes of 0-degree nodes Question: I am trying to connect the centroids of buildings (and other areas) to a NetworkX.MultiGraph representing the road network. These centroids are all 0-degree nodes. I have read posts on finding the nearest neighbors in the same graph but failed to …

Total answers: 1

Adding columns for the closest lat/long in a reference list to existing lat/long

Adding columns for the closest lat/long in a reference list to existing lat/long Question: I have a base dataframe (df_base) which contains my records and a lookup dataframe (df_lookup) containing a lookup list. I would like to find the closest lat/log in df_lookup to the lat/long in df_base and add them as columns. I am …

Total answers: 1

trying to merge 2 GeoDataFrames with sjoin and ran for infinity

trying to merge 2 GeoDataFrames with sjoin and ran for infinity Question: I have 2 geopandas dataframe gdfTraffic_df – contains polygon in geometry column num of rows = 1,916,560 gdfAlerts_df – contains point in geometry column num of rows = 632,259 im trying to merge the 2 geodataframe to a new df that give me …

Total answers: 2

How to construct a minimum bound box tuple for each geometry in a GeoDataFrame

How to construct a minimum bound box tuple for each geometry in a GeoDataFrame Question: I have a geopandas GeoDataFrame of lakes. I am trying to create a new column named ‘MBB’ with the bounding box for each lake. I am using the bounds function from GeoPandas. However, this function exports minx, miny, maxx, and …

Total answers: 1

How do I create image from binary data BSQ?

How do I create image from binary data BSQ? Question: I’ve got a problem. I’m trying create image from binary data which I got from hyperspectral camera. The file which I have is in BSQ uint16 format. From the documentation I found out that images contained in the file (.dat) have a resolution of 1024×1024 …

Total answers: 1

Calculate lat/lon of 4 corners of rectangle using Python

Calculate lat/lon of 4 corners of rectangle using Python Question: I need to find the latitude and longitude coordinates of the four corners of a rectangle in a Python script, given the center coordinate, length, width, and bearing of the shape. Length and width are in statute miles, but honestly converting those to meters is …

Total answers: 3

Equivalent of "points_to_xy" in GeoPandas to generate LineStrings faster?

Equivalent of "points_to_xy" in GeoPandas to generate LineStrings faster? Question: I have a list of lines defined by start and end points. The size is on the order of 100,000s to possibly low 1,000,000. For making a list of points I use points_from_xy in GeoPandas, which is highly optimized, but is there a similar and …

Total answers: 1

Downsampling geospatial xarrays too large for memory

Downsampling geospatial xarrays too large for memory Question: I have a very large (86400×43200) xarray dataset with geospatial coordinates (lat, lon) and elevation and would like to downsize this map to have one twentieth the resolution per dimension (4320, 2160, which is equivalent to 1/12th degree). I at first used the interp method directly, but …

Total answers: 1