Tag Info

New answers tagged

0

For the clipping of two layers, it is mandatory that both are stored to disk in the same CRS. What you can do is: Save the polygon layer with Rightclick -> Save As ... choose a new filename and WGS84 as CRS Add the new shapefile to the canvas remove the old polygon layer clip the roads to the polygons You can obviously do it the other way round too.


0

Ok I fixed it by using the multiparts to singleparts function first. Then it works.


0

Assuming that you have a layer called "overlay" and another one called "layer_to_clip" loaded. # get the overlay layer in the console overlay_layer = [x for x in iface.legendInterface().layers() if x.name() == 'overlay'][0] # get the layer to clip in the console layer_to_clip = [x for x in iface.legendInterface().layers() if x.name() == 'layer_to_clip'][0] ...


0

I think I had to post this question to solve it... I clipped the first raster with my vector layer and used it to make a mask with either 1's ou 0's. I then multiplied this mask with every raster one by one.


1

You can always use a tool's batch functionality--just right-click on the tool > batch... and fill in the blanks. However, this type of operation is typically done in an automated fashion. You do not have to create individual shapefiles from features in a shapefile. Instead, you can use a Search Cursor to access all of the features in the FC. This is ...


0

This answer is not intended for beginners to ArcGIS. Having some knowledge of Model Builder, especially iterators would be best. I would use ModelBuilder to iterate through your shapefile directory, and run a clipping process. If you have spatial analyst, I would recommend using Extract By Mask. If not, you can use Clip, but you'll need to do an extra ...


0

You can use Python's built-in .sep to extract that part of the name: file = "WVHGT_201403281200_f180_201404050000.shp" name = file.split("_") print name[2] >>> f180 Now, integrate this into the for loop. I am assuming you are iterating through a collection of files rather than individual features. import arcpy, os from arcpy import env ...


1

I would loop through each feature in the FC and write the geometry to a new FC. import arcpy # This is a path to an ESRI FC of the USA states = r'C:\Program Files (x86)\ArcGIS\Desktop10.2\TemplateData\TemplateData.gdb\USA\states' out_path = r'C:\temp' with arcpy.da.SearchCursor(states, ["STATE_NAME", "SHAPE@"]) as cursor: for row in cursor: ...


1

If you have a list of the states you can do something similar to the following: import arcpy statelist = [row.getValue('STATE_NAME') for row in arcpy.SearchCursor("INPUT DATASET")] for state in statelist: arcpy.Select_analysis("INPUT DATASET", str(state), '[STATE_NAME] = "' + str(state) + '"')



Top 50 recent answers are included