Charlie Parr
  • Member for 6 years, 11 months
  • Last seen this week
Joining (concat) list of similar dataframes in geopandas?
23 votes

I just experimented with this - maybe in GeoPandas 0.2.1 and Pandas 0.20.3 it is a bit more concise: gdf = pd.concat([gdf1, gdf2]) gdf is automatically created as a GeoDataFrame. Of course if there ...

View answer
Python - Extract raster values at point locations
20 votes

I use rasterio and geopandas. My example uses UTM coordinates. Obviously these fields will depend on your particular shapefile. In my experience this produces indentical results to the QGIS Point ...

View answer
Rasterio: tool for creating mosaic?
12 votes

import rasterio import numpy as np from rasterio.merge import merge from rasterio.plot import show src1 = rasterio.open('/path/to/your/raster1') src2 = rasterio.open('/path/to/your/raster2') # ...

View answer
Adding CRS to shapefile in GeoPandas
10 votes

The to_crs function is for converting from one CRS to another. To assign a CRS to a GeoPandas object, simply assign it to the .crs attribute. For example: my_geoseries.crs = {'init' :'epsg:4326'} In ...

View answer
SAR - Using the Intensity or the Amplitude for the classification
Accepted answer
9 votes

The intensity image should be used for calibration and subsequent classification of geophysical features. To radiometrically calibrate the intensity, use the Calibrate tool in the Sentinel-1 Toolbox (...

View answer
What is multilooking?
7 votes

There are many multi-look algorithms. At the most basic, the process reduces noise (or "speckle") in SAR images by averaging adjacent pixels. Often SAR processors allow the user to define some N x N ...

View answer
Getis-Ord Gi* (arcgis 'hotspot analysis') with python?
Accepted answer
5 votes

Check out PySAL: The Python Spatial Analysis Library https://pysal.readthedocs.io/en/latest/

View answer
Reduce complexity of KML file
3 votes

You can do this via the command line with OGR: ogr2ogr -f KML output.kml input.kml -simplify 0.0001 The simplify parameter is in the units of whatever the units are for the input file. For example, ...

View answer
Editing LiDAR point cloud to remove noise/outliers present below and above ground?
3 votes

I'll recommend PDAL the point data abstratction library. I've had good success using PDAL for a similar filtering problem. I like PDAL because it is open source, provides Python support, and makes it ...

View answer
What do horizontal (H) and vertical (V) polarization mean for satellite radar?
2 votes

I think you have the gist of it. From Iain H. Woodhouse's text "Introduction to Microwave Remote Sensing" (a great resource on SAR and RADAR): For convenience, in remote sensing the horizontal axis,...

View answer
Calculating Similarity between Two Clusters in QGIS?
2 votes

This is a great question and something I have wrestled with quite a bit! The pursuit of pattern similarity metrics leads down a rabbit hole to entire fields of statistical, spatial, and even fractal ...

View answer
How to convert from HDF5 to GeoTIFF with Python
1 votes

You are correct, this information implies the transform and you will also want to fill out the profile so you can write the data to a GeoTIFF via rasterio. You are going for a python dict that will ...

View answer
Control histogram axis and legend with show_hist of rasterio
Accepted answer
1 votes

Try creating the figure and axis explicitly: fig, axhist = plt.subplots(1, 1) show_hist(hist_data, bins=200, histtype='stepfilled', lw=0.0, stacked=False, alpha=0.8, ax=axhist) axhist....

View answer
How to extract max elevation values for each road links in a shapefile using Python libraries?
Accepted answer
1 votes

Your raster DEM and vector road shapefile have different coordinate systems. They need a common coordinate reference system for the rasterstats package to compute the zonal statistics. import ...

View answer
PDAL Filter output is same as input file
1 votes

I think your json is being interpreted as a string rather than as a json object. Try importing the json library (part of the standard Python library) and then loading the string as a json object. For ...

View answer
Calculating skewness and kurtosis with command line GDAL?
Accepted answer
1 votes

GDAL does not have the functionality to compute histogram moments such as skewness or kurtosis. Try looking at GIS software (e.g. QGIS, ArcGIS) or if you are comfortable with Python you can read your ...

View answer
How do I combine GeoTIFF files covering the same area but storing different data into a single file?
1 votes

From the command line, execute this command inside the directory of GeoTIFF rasters you wish to stack (like a sandwich) together: gdal_merge.py -o your_depth_stack.tif -ps x y -separate *.tif This ...

View answer
Raster calculator : How to make 0 + NoData = 0?
1 votes

The Reclassify tool in ArcMap 10.3 (Spatial Analyst > Reclass > Reclassify) enables you to reclassify No Data to another value. Now, this might not work for you if you have No Data values in your ...

View answer
Why is the vector style in the PDF export different than in print composer?
Accepted answer
1 votes

I think I know this one! I believe this is a layer problem. Select your map element and under the "Item properties" tab there should be a box for "lock layers for map item" - check this box. This ...

View answer
Rasterio Write Masked Array to TIFF - Shape write and read indices are wrong
0 votes

You may be prescribing the new height and width incorrectly. What happens when you call out_image.shape before writing the raster? It may be the shape is actually 1 x 6094 x 4000 (or whatever the ...

View answer
Rasterio reading outshape resample does not give correct array
-1 votes

Try: int(dataset.height / factor), int(dataset.width / factor)))

View answer