Hot answers tagged

5

Modified version of createBuffer function using a column as the distance value is here: import ogr, os def createBuffer(inputfn, outputBufferfn, bufferField): inputds = ogr.Open(inputfn) inputlyr = inputds.GetLayer() shpdriver = ogr.GetDriverByName('ESRI Shapefile') if os.path.exists(outputBufferfn): shpdriver.DeleteDataSource(...


4

You can use the GeoPandas library to read in your Shapefile as a GeoDataFrame. Then you can make use of the function written in this answer. Here's a quick mock-up of what it would look like. import geopandas as gpd # Copy the definition of the make_variable_buffer function # from here: https://gis.stackexchange.com/a/398549/123828 # Reading in the input ...


2

If I understood your question correctly, this script will solve your problem. (Reference) from osgeo import gdal, ogr import numpy as np raster_file = "image.tif" ds = gdal.Open(raster_file) c, a, b, f, d, e = ds.GetGeoTransform() def p(col, row): #p: pixel coords to map coords x_geo = a * col + b * row + a * 0.5 + b * 0.5 + c y_geo = d * ...


2

Example solution using Windows CMD syntax. Initialize the target using a single source layer as a template: ogrmerge -o img-source-footprints.shp ^ -single ^ -src_layer_field_name Source ^ -src_layer_field_content {AUTO_NAME} ^ \\server\imagery\Satellites\S_AitchHill.gdb ^ -nln S_Satellites_AitchHill_50cm_16Sep2011_f Now use a shell scripting FOR ...


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