POST
|
I have five vector files wherein I want to determine the spatial agreements among them using intersect. Here is my illustration. (Actually these are forest shapefiles from five different forest maps) A = vector_file_1.shp B = vector_file_2.shp C = vector_file_3.shp D = vector_file_4.shp E = vector_file_5.shp So that I will have a set of spatial agreement from 2/5, 3/5, 4/5 to 5/5. For example: 1) 2/5 = A∩B, A∩C, A∩D, A∩E, B∩C, B∩D, B∩E, C∩D, C∩E 2) 3/5 = A∩B∩C, A∩B∩D, A∩B∩E, A∩C∩D, A∩D∩E, A∩C∩E, B∩C∩E, B∩C∩D, B∩D∩E, C∩D∩E 3) 4/5 = A∩B∩C∩D, A∩B∩C∩E, B∩C∩D∩E, A∩C∩D∩E 4) 5/5 = A∩B∩C∩D My question is what geoprocessing technique will I use to generate a single shapefile from each agreement above (except item # 4), supposing I've done the intersection combinations for agreement items 1-3? Will I use intersection again, union or other technique? (My professor told me to just add a field and put a number code on that field, for each shapefile, unfortunately I forgot the next process he mentioned.)
... View more
05-25-2015
06:31 AM
|
0
|
4
|
3573
|
POST
|
I am trying to batch mosaic rasters using arcpy.MosaicToNewRaster_management in arcpy: #This is for mosaicking rasters
import arcpy
from arcpy import env
#Set the current workspace and other env 't variables
env.workspace = r"C:\thesis\for_sampling\sampling_outputs\new_loss"
env.nodata = "MINIMUM"
env.compression = "LZ77"
projection = arcpy.SpatialReference(4326)
coordinate_system = projection
list_all_rasters = ["newlossGreater_Luzonforests_onlyloss_20N_120E.tif;newlossGreater_Luzonforests_onlyloss_30N_120E.tif;\
newlossGreater_Luzonforests_onlyloss_20N_110E.tif","newlossGreater_Palawanforests_onlyloss_20N_120E.tif;\
newlossGreater_Palawanforests_onlyloss_10N_110E.tif;\newlossGreater_Palawanforests_onlyloss_20N_110E.tif",\
"newlossGreater_Negros_Panayforests_onlyloss_10N_120E.tif;newlossGreater_Negros_Panayforests_onlyloss_10N_110E.tif",\
"newlossGreater_Mindanaoforests_onlyloss_10N_120E.tif;newlossGreater_Mindanaoforests_onlyloss_10N_110E.tif;\
newlossGreater_Mindanaoforests_onlyloss_20N_110E.tif"]
for raster in range(0,4):
output_list = ["Luzon_loss.tif","Palawan_losss.tif","Negros_Panay_loss.tif","Mindanao_loss.tif"]
env.workspace = r"C:\thesis\for_sampling\sampling_outputs\new_loss"
print raster # checking the list
arcpy.MosaicToNewRaster_management(list_all_rasters[raster], r"C:\thesis\for_sampling\sampling_outputs" , output_list[raster], 1, coordinate_system)
print raster+ " is ok!"
print "Finish all of them!"
However, I always get this error: ExecuteError: ERROR 000622: Failed to execute (Mosaic To New Raster). Parameters are not valid. ERROR 000628: Cannot set input into parameter coordinate_system_for_the_raster.
... View more
05-21-2015
11:02 PM
|
0
|
4
|
12245
|
POST
|
I'm converting series of raster to polygon using RastertoPolygon in arcpy. #import the module import arcpy from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") env.overwriteOutput = True #set the workspace env.workspace = r"C:\thesis\for sampling\sampling_outputs\raster_per_biogeoregion" #Get a list of rasters and convert to shapefile for raster in arcpy.ListRasters("*Luzon_*.tif", "TIF"😞 print raster #check the presence of rasters arcpy.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY") print "Finish converting all the rasters to polygon" After several checks on the syntax, formatting, I've always been stuck with this error: Traceback (most recent call last😞 File "C:\Users\brentiebark\Dropbox\Python Scripts and mxds\batch_convert_raster_to_polygon_simple.py", line 14, in <module> arcpy.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY") File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\conversion.py", line 178, in RasterToPolygon raise e ExecuteError: ERROR 010328: Syntax error at or near symbol SPACE. ERROR 010267: Syntax error in parsing grid expression. Failed to execute (RasterToPolygon).
... View more
05-21-2015
03:30 AM
|
0
|
3
|
4842
|
POST
|
thank you for this! Now, I've successfully converted my rasters.
... View more
08-12-2014
03:10 AM
|
0
|
1
|
610
|
POST
|
oh, sorry for my formatting, yes my for loop is indented.
... View more
08-11-2014
04:08 AM
|
0
|
4
|
610
|
POST
|
I'm trying yo execute the RastertoPolygon conversion tool in ArcGIs 10.1. I'm executing it through a for loop, then it resulted to an error (Unable to open feature class Failed to execute (RasterToPolygon)) at the python console. As I checked for some output, the first raster from the list is successfully converted to shp file while the rest are not. Any suggestions? Note: (All of my rasters are already in integer data type) #import the module import arcpy from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") env.overwriteOutput = True #set the workspace arcpy.env.workspace = r"C:\Users\Windows\Documents\JO_GIS_Analyst" #Get a list of rasters and convert to shapefile for raster in arcpy.ListRasters("nofpt*", "TIF"): print raster #check the presence of rasters" #convert the raster to polygon arcpy.RasterToPolygon_conversion(raster, raster +".shp", "SIMPLIFY") print "Finish converting the rasters to polygon"
... View more
08-11-2014
03:46 AM
|
0
|
6
|
3849
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|