New answers tagged

3

I have a hidden function for calculating the Alpha Convex Hull (Pateiro-Lopez & Rodriguez-Casal 2009) in the development version of spatialEco. The reason this function is not in the CRAN release is due to licensing issues in the alphahull package. Please note that this statistic only works for [x,y] data. Polygons are tricky because the bounding ...


-1

Import your shp to gdb. Code below will print each polygon extent: import arcpy arcpy.env.overwriteOutput = True arcpy.env.workspace = r"GDB" fc = 'feature_class' count = int(arcpy.GetCount_management(fc)[0]) +1 for fid in range(1, count): arcpy.MakeFeatureLayer_management(fc, 'temp','"OBJECTID" = {}'.format(fid))) arcpy....


2

Assuming your pdf_paths is a list containing all your file path strings, it should be as simple as either of the approaches below: Firstly, there is no need to import gdal in the script, since you are working with the GDAL provider in QGIS processing, so you can call gdal algorithms in the python console like any other QGIS processing alg. Store the path ...


0

First import your bounding box data to EE, and then add to the code editer. https://support.google.com/earth/answer/176685?hl=en You can then use the following code to generate the mean value within each polygon: var meanDictionary_rescale = vegetationIndex.reduceRegion({ reducer: ee.Reducer.mean(), geometry: boundingBox.geometry(), scale: 20, ...


1

Try pdfrw: pdfrw is a Python library and utility that reads and writes PDF files from pdfrw import PdfReader from shapely.geometry import Polygon pdffile = '/home/bera/Desktop/Layout 1.pdf' pdf = PdfReader(pdffile) box = pdf.pages[0].VP[0].Measure.GPTS #Dont know if this is standard "language" for all pdfs or just pdfs from QGIS coords = [(float(lat),...


1

In pure Python3, here the solution : import os import pathlib my_path = "V:/GIS - Files/1. Client Projects/" pdf_parent_folder = "!pdf's" pdf_paths = [] for path, sub, files in os.walk(my_path): if pdf_parent_folder in sub: for path, sub, files in os.walk(os.path.join(path, pdf_parent_folder)): for name in files: if ...


0

if the map table has a field p of type POINT with SPATIAL index you can do this: set @p = concat('Polygon((',_x0,' ',_y0,',',_x1,' ',_y0,',',_x1,' ',_y1,',',_x0,' ',_y1,',',_x0,' ',_y0,'))'); select * from map where mbrcontains(GeomFromText(@p),p);


2

I would go with... SELECT Box2D(geom) as bounds, ST_YMax(bounds) as ymax, ST_YMin(bounds) as ymin, ST_XMax(bounds) as xmax, ST_XMin(bounds) as xmin FROM nation_shapes WHERE (condition) ...as PostgreSQL's SQL engine and query planner is smart enough to figure things out and not duplicate work. If you want to not return the bbox from ...


0

I found a solution to my own question. Using what @ycartwhelen posted, I added the Iterate Feature Selection iterator. From there, I added the Buffer Tool to create a little bit of excess around the site to account for any extra data. The buffer has its own extent. That buffer is fed through the Create Fishnet Tool as the Template Extent and Environment ...


0

When creating the fishnet set the Environment variables for that tool such that they match the input feature class (rather than the entire dataset). You'd want to use the Output Extent setting, with the "same as layer input_feature_class" option.


Top 50 recent answers are included