POST
|
I tried that but applying symbology does not change anything. They still look different.
... View more
06-22-2018
01:11 PM
|
0
|
1
|
928
|
POST
|
I have a mosaic raster of an agricultural area. In the mosaic raster, a specific agricultural field (field no. 5) looks just like this When I clip the raster with the field's shapefile (shapefile of the field no. 5) the color changes a bit and looks like the following image. The following codes have been used to clip the mosaic raster - #clipping the raster arcpy.Clip_management(in_raster= mosaic_pan_layer, rectangle=str(extent_of_shape_file), out_raster=pan_save, in_template_dataset=shape_file, nodata_value="65536", clipping_geometry="ClippingGeometry", maintain_clipping_extent="NO_MAINTAIN_EXTENT") #saving the clipped raster arcpy.CopyRaster_management (in_raster = pan_save, out_rasterdataset = Clipped_pan_save, nodata_value = "9999") I also have done the following - - mosaic image > properties > symbology > save the statistics in xml . Then went to the symbology of the clipped result image > "rgb composite"> type = "custom" > statistics = "from custom settings", and loaded the statistics using xml. Here is the results - The result is - The mosaic image has some black portion where the pixel values are 0 Is there any way to get the clipped raster to look exactly the same as the mosaic layer?
... View more
06-22-2018
11:16 AM
|
0
|
4
|
1224
|
POST
|
I am trying to explain the whole scenario - 1. The shown image is the pansharpened image which contains 4 bands (BGR and NIR) 2. NDVI was generated using "Image Analysis" option. The object of interest is the field no. 7N as its shapefile is also turned on (red circle.) 3. Here is the clipped field -using "Extracted By Mask" (Spatial Analyst) tools. 4. After changing the color ramp, is it looks like this. It is better for visualization, so our team asked for the same color image. I am trying to save this file with exactly this color. If I use copy raster then the result gets back to the image shown in no. 3 (grayscale). Can you please tell me is there really anyway to save the raster exactly the same [as shown in no.4] with Python (Export function can do that)? Thanks
... View more
06-14-2018
08:25 PM
|
0
|
0
|
1778
|
POST
|
No, it was a single band image. NDVI value ranging from -1 to 1.
... View more
06-14-2018
01:38 PM
|
0
|
4
|
1778
|
POST
|
Here is a very similar problem. dem - Is there a way to programatically force RGB (3 bands) in a raster with arcpy? - Geographic Information Systems Sta…
... View more
06-14-2018
01:25 PM
|
0
|
0
|
1779
|
POST
|
There was no colormap. To create a colormap, I clicked "Unique Values" on the symbology of the raster properties, it showed the maximum limit of unique value has been reached. Thus, I can't even save it with any color map. Btw, after applying color ramp, the raster can manually be exported with color ramp in it. It was mainly because the RGB is forced into it. However, could not find any ArcPy so far to do that!
... View more
06-14-2018
01:24 PM
|
0
|
6
|
1778
|
POST
|
There is an NDVI image of a small agricultural area. I was also given separate shapefiles for all fields (37 fields) inside that area. I have written a script that clipped NDVI image for each field using the shapefile. When a clipped NDVI image is saved, it is exported in tiff format and grayscale. Shape_Files_Name = ['TX1_10_poly.shp', 'TX1_11N_poly.shp', 'TX1_11S_poly.shp'...........]
for n in Shape_Files_Name:
#mask out each field
Clipped_File_Name = random.randint(1,101)
arcpy.gp.ExtractByMask_sa (NDVI_Layer, n, Clipped_File_Name )
#save the raster
arcpy.CopyRaster_management ( Clipped_File_Name , NDVI_Save_Location_and_Extension) I was trying to find a way to export them to a known colour ramp. Thus, a dummy layer is created and applied the desired colour ramp to it. Later, for each NDVI field image, just applying the colour ramp by the following codes arcpy.ApplySymbologyFromLayer_management(in raster, color ramp layer) It works. But I would like to export those NDVI images in the colour ramp I applied. Is there any way to do that in ArcPy?
... View more
06-14-2018
11:12 AM
|
0
|
9
|
2735
|
POST
|
Here, I assumed mean = Raster_mean. The code is pretty different (variables), I just tried to simplify that.
... View more
06-12-2018
11:04 AM
|
0
|
0
|
673
|
POST
|
I just used Con and it worked as a charm. Here are the codes- inRaster = Raster(NDVI_file) outCon = Con(inRaster < mean, 0,1)
... View more
06-09-2018
10:16 AM
|
0
|
2
|
673
|
POST
|
I have written a python script that finds the mean of all pixel values in a raster. Once I get the mean (suppose 0.3 in this case), I can use raster calculator and assign pixel value of 1 to each pixel higher than the mean and 0 to everything else. The equation is as follows - Float(Con("Raster1"<0.3, 0, 1)) However, there are 30 raster files, thus, I want to avoid manually using the Raster Calculator. I have added the following codes to the script- Raster_mean = got from previous script [0.3 in this case] arcpy.gp.RasterCalculator_sa('Float(Con("Raster1"<Raster_mean, 0, 1))' , "E:/ArcGIS Python/raster10") I am getting the following errors- NameError: name 'Raster_mean' is not defined. Failed to execute (RasterCalculator). Seems like it does not take any predefined variable but only raw values. Is there any other option to conduct the task?
... View more
06-07-2018
10:07 AM
|
0
|
4
|
782
|
POST
|
Thanks Dan. The objects of interest are Yld_Vol_Dr'(bu/ac) and Moisture content. Thus, I just need to merge every 5 polygons, make one finally which will contain the average of the Yld_Vol_Dr' and moisture of the previous 5 polygons.
... View more
05-10-2018
08:17 PM
|
0
|
0
|
279
|
POST
|
This is the problem we talked about in our meeting. There could be different polygons in each row. For the first pass of the harvester there could be 10000 points (later converted to polygons), may for the second pass, it could be 10003. They are inconsistency. I have attached the data here. I also provided details of the problem here.
... View more
05-08-2018
09:54 AM
|
0
|
2
|
883
|
Online Status |
Offline
|
Date Last Visited |
09-30-2021
11:29 AM
|