POST
|
Thanks for the help! 13 overviews were generated for the 194 rasters. Just curious, do you know if they're now hidden files? I don't actually see them anymore in the Catalog tree. I know they exist, I can see them when I'm zoomed out (1:8M scale) and they appear when I use the Identify tool, but they're not physically showing in the geodatabase.
... View more
09-10-2015
11:40 AM
|
0
|
1
|
13
|
POST
|
I have loaded 194 DEMs geotiffs (overlapping, single band, same coordinate system, same pixel sizes) into a raster catalog within a file geodatabase called 'Data'. I then created a mosaic dataset in the same geodatabase, and added the rasters from the raster catalog into the mosaic dataset. I also checked the box to Build Overviews. I loaded the rasters from the raster catalog (as opposed to loading the tiffs directly into the mosaic dataset) because I wanted a neat package where all of my raster data was contained in the geodatabase. However, the overviews are being built just outside the geodatabase in a windows directory called 'Data.Overviews' Is there any way to get the Overviews into the geodatabase? I'm using ArcGIS Desktop 10.3 (Advanced) on Windows 7, if that matters. Thanks in advance!
... View more
09-10-2015
08:21 AM
|
0
|
3
|
1945
|
POST
|
Bingo! Removing the 'x' from the world file extension did the trick. Wonderful! I did have to define the projection but the extent was finally updated. Thanks so much for your help!
... View more
08-10-2015
07:46 AM
|
0
|
0
|
24
|
POST
|
Hi Xander Bakker I tried that. No dice 😞 Still loads in the same spot off in no-where-land in the data frame with no spatial reference. They're both tiffs, and so the world file has a *.tfwx extension. This is what's in the world file. 0.045677623 -0.000313868 -0.000576502 -0.044168095 1821.654417 -2401823.433 At this point I just manually georeferenced the new raster, but I would still like to know if there is a work-around to this. Thanks for your input@
... View more
08-06-2015
01:08 PM
|
0
|
2
|
24
|
POST
|
I have successfully georeferenced a UAV-generated image (4-band) using the georeferencing toolbar (using the Update Georeferencing option to create a world file). I saved my link table. A colleague had generated a classification from the original (ungeoreferenced) image. It has the same number of rows and columns, but pixel values are different and it has only one band (not four). I want to georectify this image in the exact same way using the same control points and the exact projected coordinate system. However, when I try to apply the control points to this new derivative layer, I get collinearity issues and the two images do not line up at all. I would think that they're practically the exact same image-- why wouldn't control points from the first image work to register the second image? I did notice that when the images were brought into ArcGIS in their unregistered state, their extents do not match (see attached screenshot). Any idea of a work-around for this? Or do I manually have to georectify the second image? Thanks
... View more
08-04-2015
06:34 AM
|
0
|
6
|
3002
|
POST
|
Thanks, Ben. That's what I ended up doing. Here's the code in case anyone's interested. I'm sure someone else out there could do it in less lines of code, but it works nonetheless. import os from operator import itemgetter import arcpy inspace = "C:/Data/export.gdb" shapefile = inspace + os.sep + "classification_2011_1028" fields = arcpy.ListFields(shapefile, "M*") # The "nonsense" name of the 10 fields all began with 'M' newfields = ["First", "Second", "Third"] # The empty fields where the top three numbers would go uCursor = arcpy.UpdateCursor(shapefile) for row in uCursor: fuzzy = [] topthree = [] x = 1 for field in fields: name = field.aliasName value = row.getValue(field.name) fuzzy.append([name,value]) fuzzy.sort(key=itemgetter(1),reverse=True) for f in fuzzy: if x < 4: topthree.append(f[0]) x+=1 for rank, value in zip(newfields,topthree): row.setValue(rank,value) uCursor.updateRow(row)
... View more
11-02-2011
07:17 AM
|
0
|
0
|
0
|
POST
|
I have 10 fields that have a floating value between 0 and 1. These fields have a meaningless name, so they've been assigned aliases. I also have three fields called 'First', 'Second', and 'Third' that are empty. Using python, I want to find the first, second, and third highest of the 10 values for each record and assign the field alias to the First, Second, and Third fields respectively. For instance, in a given record, if the highest value of the 10 floating numbers was from the field with the alias 'NF', then the field 'First' would get the value 'NF'. I've been at this for a few hours and I can't seem to make it work. Any help would be much appreciated.
... View more
10-31-2011
08:26 AM
|
0
|
2
|
2622
|
POST
|
Using the spatial reference information in the search cursor seems to have worked for me. I'm using a point feature class within a file geodatabase that is in WGS84, and I'm checking each point for overlap with a list of rasters. I have something that looks like this: import arcpy from arcpy import env from arcpy import management as dm inspace = "C:/test" env.workspace = inspace sort = "pointfile" hypdir = arcpy.ListRasters("","TIF") dm.MakeFeatureLayer(sort,inlyr) for scene in hypdir: des = arcpy.Describe(scene) sr1 = des.spatialReference rows = arcpy.SearchCursor(inlyr, "", sr1) for row in rows: ID = row.getValue("ID") Expression = "\"ID \" = " + str(ID) dm.SelectLayerByAttribute(inlyr, "NEW_SELECTION", Expression ... and so on. Since my rasters are all in different UTM zones, the extracted values would all be 'Null' without the 'sr1' parameter in the search cursor (that's what prompted me to originally post). 🙂
... View more
03-08-2011
11:35 AM
|
0
|
0
|
70
|
POST
|
I am trying to write a python script to do a batch extraction of pixel values. I have a feature class in a file geodatabase that has about 6500 records in it, and I also have a list of rasters. I am trying to write code that will select one point at a time based on an attribute called 'cellnum', scroll through the list of rasters and see if the point overlaps with any of the rasters, and if it does, it will extract the pixel value. However, the points are in WGS84 and my rasters are all in different UTM zones. I need to reproject the selected point to match the raster in question (the script doesn't do on-the-fly projections). However, when I try to reproject the selected point, I get errors. import arcpy
from arcpy import env
env.overwriteOutput = True
env.workspace = "C:/Data/Project.gdb"
env.scratchWorkspace = env.workspace
sort = "points"
inlyr = "in_memory\\sort"
newlyr = "in_memory\\sort2"
hypdir = arcpy.ListRasters("")
arcpy.MakeFeatureLayer_management(sort, inlyr)
rows = arcpy.SearchCursor(inlyr)
for row in rows:
center = row.getValue("cellnum")
Expression = "\"cellnum\" = " + str(center)
if center == 0:
arcpy.SelectLayerByAttribute_management(inlyr, "NEW_SELECTION", Expression)
point = arcpy.SearchCursor(inlyr)
for i in point:
for scene in hypdir:
des = arcpy.Describe(scene)
descr = arcpy.Describe(inlyr)
sr1 = des.spatialReference
sr2 = descr.spatialReference
if sr1 != sr2:
print "Matching projections..."
arcpy.Project_management(inlyr, newlyr, str(sr1.exportToString())) I get the error message: Failed to execute. Parameters are not valid. ERROR 000944: Output feature class cannot be in the in_memory workspace. Failed to execute (Project). I understand that. So I change 'newlyr' to be "C:/Data/temp_sort.lyr", and I get this error: ERROR 999999: Error executing function. Create output feature class failed Failed to execute (Project). I've tried this also, newlyr = "C:/Data/Project.gdb/temp_sort", but still get an error: Runtime error <type 'exceptions.IOError'>: C:/Data/Project.gdb/temp_sort does not exist I'd rather not reproject the entire point file each time if I don't have to. This script will be run in the future with other datasets that could be much larger. I'm at my wit's end. Can anyone shed some light? Thanks a million in advance, this has been giving me headaches for over a week now.
... View more
02-10-2011
06:14 AM
|
0
|
10
|
6214
|
Online Status |
Offline
|
Date Last Visited |
12-21-2020
02:15 PM
|