Hot answers tagged

10

You haven't selected the feature, you used the Identify tool. The Select tool icon 2 over to the right in your toolbars


4

I would create a middle point layer for snap purpose. Using this nice script of Paul Ramsey and updating for your use case: CREATE TABLE polygons ( gid integer primary key, geom geometry(Polygon, 4326) ); INSERT INTO polygons VALUES (1, 'SRID=4326;POLYGON((0 0,1 0,1 1,0 1,0 0))'); INSERT INTO polygons VALUES (2, 'SRID=4326;POLYGON((10 10,11 10,11 ...


4

If the shapefile has real-world coordinates and the image doesn't, we georeference the features shown in the image to matching features in the shapefile to pull the image into the same real-world coordinates. On the other hand, if the image has real-world coordinates and the shape-file doesn't, then we can spatially adjust the features in the shapefile to ...


4

Approximate solution: Erase segments by polygons Place points at equal interval and join them spatially to polygons. Calculate frequency per segment and landuse. Split total length pro rata. Smaller interval gives more accurate estimate and takes longer to run


3

The tool does not carry over source point layer field/attributes. You will have to apply other tools/methods (e.g. spatial join) to bring over those attributes.


3

Just my $0.02, there may be better ways. arcpy.env.overwriteOutput() Handle this yourself, ogr.Driver.DeleteDataSource() and ogr.DataSource.DeleteLayer() can handle this. You can use OGR_TRUNCATE, but this appears to be at the layer level arcpy.MakeFeatureLayer_management() If you have writable ogr.DataSource, then ogr.DataSource.CreateLayer(...) ...


2

I think that the direct equivalencies are impossible unless you have a person who knows ArcPy and GDAL. Moreover the GDAL/OGR Python bindings (osgeo (GDAL/OGR) are not very "Pythonic" and difficult. It exists other easier alternatives ( Fiona, Pyshp (shapefile), GeoPandas,shapely, rasterio, ...). The last module is compared to ArcPy in Comparing Map ...


1

I'd say importing SA functions, setting workspace to fastest media possible using TableToNumpyArray might help as well: from arcpy.sa import * from arcpy import env env.workspace='in_memory' If in_memory doesn't work set it to folder (not FGDB) on fastest disk. This is where ArcGIS stores temp rasters RasterInt=Int(raster) numberOfCells ...


1

I second that NumPy is fast for calculations on rasters (although converting back to a raster file can seemingly take a long time for the few times I've used it). You could also calculate your area using the Raster properties. Something like this without the need of Int_3d: Edited to correct calculation area = (my_raster.width * my_raster.height) * ...


1

The following might be more of a set of a partial suggestions for your situation rather than a direct and complete answer, but have you considered performing the arcpy.Int_3d() , numberOfCells and area work using numpy arrays? I've tested the function below on some small (6k x 2.5k pixels) single-band rasters and I hope it will reduce your running time. I ...


1

I suspect this is an issue with your geo-processing environment settings. Have you gone into that and changed it? If you go into that (Geoprocessing > Geoprocessing Options...) look at what your Results Management say. If you've never changed that then you will have accepted the default of 2 Weeks. If you read the help page Using geoprocessing options to ...


1

For the road segments that run inside the polygons, you can simply use the INTERSECT tool. The others are harder. Is it acceptable to only test exactly at 30m, or do you need to look at <=30m? If just 30m, this should work, if you have ArcGIS advanced. First use ERASE to wipe out the road segments that go inside the polygons, so that you don't count ...



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