POST
|
Dear Colleagues, Apologies for cross-posting. We would kindly like to invite lecturers to participate in a short survey on the use of technology in geology education. The survey can be accessed here and will be available until Saturday the 30th of September 2017 at 00:00 GMT. The goal of this survey is to investigate various aspects on the use of technology in geology education. Filling out the survey (which contains 22 simple questions) takes about 10 minutes. One survey form is used for one course that you teach and multiple responses may be submitted if desired. If you have questions or comments on the survey please contact us at bjorn.nyberg@uib.no. You have the right to withdraw at any point during the study. To do so, email the principal investigator, Björn Nyberg. All data obtained from the proposed research will be anonymous before it is analysed and any publications resulting from this data will be filtered to prevent individual teachers, courses or institutions from being identified. Data obtained from the proposed research will be securely stored and all personal information (e.g., email address, age, location) will be kept confidential. If you could share this information with other colleagues at your department or collaborators, then we would be most grateful! Best Regards, Björn Nyberg and Henk Keers ----------------------------- Postdoctoral Fellow Department of Earth Science, University of Bergen PO Box 7803, 5020, Bergen, Norway
... View more
09-15-2017
03:00 AM
|
0
|
0
|
454
|
POST
|
Does anyone in the community know if it is possible to extract ArcGIS landsat imagery by the tiles that build up its dataset. What I want to do is split the dataset into each landsat acquisition and perform a simple DOS before recombining them. The original dataset contains some vector information but I am not sure how to extract that information. Any ideas would be most useful. J
... View more
08-05-2012
10:56 AM
|
0
|
0
|
705
|
POST
|
Could make a shapefile of the entire extent of the raster dataset and erase by the original shapefile to create a shapefile of the ocean regions.
... View more
03-20-2012
04:47 AM
|
0
|
0
|
702
|
POST
|
Could you explain why you are doing this step? "Now for my final process I am intersecting that polygon with a layer that does not have the same spatial resolution causing my original dataset to be cut off." Perhaps a different tool, for example the Union tool, might achieve what you need to do without losing or cutting off the polygons. The union feature does not provide the function that I want unless I am missing some hidden feature or procedure. Let me explain further by a better example perhaps. I have two datasets one at a coarser resolution ('name') and one at a finer resolution('orig'). [ATTACH=CONFIG]12846[/ATTACH] [ATTACH=CONFIG]12847[/ATTACH] [ATTACH=CONFIG]12848[/ATTACH] My desired outcome is a shapefile with the attributes of my 'orig' dataset where the feature class boundaries of each polygon are defined by 'GRIDCODE' in the 'name' dataset. [ATTACH=CONFIG]12849[/ATTACH] Unfortunaltey as shown in the first image the intersect tool will not help as the 'name' dataset does not cover the entire 'orig' dataset. Therefore I've tried a erase - spatial join - merge - dissolve procedure creating that image above however the dissolve function removes all the 'orig' attributes The union function creates [ATTACH=CONFIG]12850[/ATTACH] However the non covered region has a 'GRIDCODE' of 0 which does not give me the result that I had in mind even if I were to intersect that with the original dataset. Ideally my final output should consit of 3 polygons. The two polygons that share a common boarder should have the same 'Unique ID', 'Region' and 'Area'(i.e. Total Area of that entire polygon) but with a different 'GRIDCODE' (14 & 13). Any ideas would be appreciated once again.
... View more
03-20-2012
01:33 AM
|
0
|
0
|
641
|
POST
|
I've encountered a small problem that I cant seem to resolve wherby i've done a series of analyses on a feature class layer. These analyses result in a shapefile with attributes include country, region, name, ID etc... Now for my final process I am intersecting that polygon with a layer that does not have the same spatial resolution causing my original dataset to be cut off. [ATTACH=CONFIG]12820[/ATTACH] What I want to be able to do is that those areas that have been cut off are remerged (and dissolved) into the intersected data and take the attribute datasets of the closest polygon. My current approach has been to erase polygon differences, apply spatial join (closest to intersect data), merge, and dissolve. Now unfotunatley when I dissolve by field "name", all the other attribute data is lost in the final product. Using the statistics field and statistics type "First" or "Last" and/or using another spatial join between the original data and the dissolve gives some weird results. If anyone would be so kind as to give me their current workflow Id be more than grateful.
... View more
03-19-2012
10:28 AM
|
0
|
3
|
896
|
POST
|
Thanks @curtvprice for the repost. Yes, any help would be most appreciated... currently exploring options in numpy.
... View more
02-20-2012
11:11 PM
|
0
|
0
|
261
|
POST
|
***UPDATE*** I continue to receive the ERROR 101302/ERROR 10067 where FocalSt_strm1 is trying to be created but cannot. The FocalSt_srtm1 is a file created in association with focal statistics analyses and I do not know if that name can be changed at all. One interesting note is that the strange sr.. folders that are generated are only created for those processes that are queued in the jobs list??? Those that have been processed properly (i.e. the first batch) do not have them. Any help or support documents from ESRI on the subject would be most apprecaited. Sicnerely, Bjorn
... View more
12-11-2011
11:10 PM
|
0
|
0
|
1709
|
POST
|
Hi, Stacy Thanks once again for your help... Out of curiosity have you ever run into the problem where the first batch of multiprocessing jobs are completed and the next set of batches are about to be loaded but fail at the first geoprocessing? Namely I receive the following error... ERROR 010302: Unable to create the output raster: C:\Data\sr6f8~1\FocalSt_srtm1
ERROR 010067: Error in executing grid expression.
Failed to execute (FocalStatistics). I believe FocalSt_srtm1 is a temporary file created by arcpy for Focal statistics however I am not sure why a seperate folder is created with the strange characters 'sr6f8~1' (perhaps an os or arcpy thing?) It contains the FocalSt_srtm1 file and files named dblbnd.adf, hdr.adf, w001001.adf and w001001x.adf. I have also started to run my programs through python.exe rather than the pythonw.exe window as pythonw.exe does not appear to close the program after execution has finished as apparently due to its design. Kind Regards, Bjorn ps - When I study the performance more it appears as though certain processing are not being performed by several cores simultaneously (with CPU down to around 10%) which might be a limitation of arcpy?
... View more
12-11-2011
02:36 AM
|
0
|
0
|
1709
|
POST
|
Has anyone tried to implement multiprocessing into their scripts? I've attempted to use the suggestion from http://blogs.esri.com/Dev/blogs/geoprocessing/archive/2011/08/29/Multiprocessing.aspx with raster processes but with no success i.e. import os, multiprocessing, arcpy def project(raster): arcpy.ProjectRaster_management(raster...) def main(): workspace = r'c:\somepath' arcpy.env.workspace = workspace fcs = arcpy.ListRasters('*') fc_list = [os.path.join(workspace, fc) for fc in fcs] pool = multiprocessing.Pool() pool.map(project, fc_list) pool.close() pool.join() if __name__ == '__main__': main() However in the command line this gives me the error File "C:\Python26\ArcGIS10.0\lib\multiprocessing\process.py", line 232, in _bootstrap self.run() File "C:\Python26\ArcGIS10.0\lib\multiprocessing\process.py", line 88, in run self._target(*self._args, **self._kwargs) File "C:\Python26\ArcGIS10.0\lib\multiprocessing\pool.py", line 57, in worker task = get() File "C:\Python26\ArcGIS10.0\lib\multiprocessing\queues.py", line 352, in get return recv() AttributeError: 'module' object has no attribute'project' I've been trying to work around the problem with parallel python without success and I cannot figure out how my code differs from the original. Bjebn
... View more
12-07-2011
10:38 PM
|
0
|
4
|
4861
|
POST
|
I am still having problems with map algebra... its probably an obvious mistake but I cant identify it! Here is a part of the code im having trouble with... import arcpy, os, sys, string from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("spatial") arcpy.env.workspace = r'O:\DATA\test' InputFolder = arcpy.env.workspace Temp4 = InputFolder + '\\' + temp4 RasterList = arcpy.ListRasters() for RasterImage in RasterList: Temp4 = FocalStatistics('RasterImage', NbrRectangle (9, 9, 'CELL'), "RANGE", "DATA") print ('Focal Statistics') ..... I receive the following error "Traceback (most recent call last): File "O:\test.py", line 67, in <module> Temp4 = FocalStatistics('RasterImage', NbrRectangle (9, 9, 'CELL'), "RANGE", "DATA") File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 4796, in FocalStatistics ignore_nodata) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Utils.py", line 47, in swapper result = wrapper(*args, **kwargs) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 4790, in wrapper ignore_nodata) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda> return lambda *args: val(*gp_fixargs(args)) ExecuteError: Failed to execute. Parameters are not valid. ERROR 000865: Input raster: RasterImage does not exist.Failed to execute (FocalStatistics)." It does not seem to recognize my for in loop of the RasterImage - any ideas?
... View more
11-29-2011
05:55 AM
|
0
|
0
|
1003
|
POST
|
according to the help, the raster calculator is for use inside arcmap only, for calculations in python you should use mapalgebra: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000z7000000.htm Ah of course... i did the mistake of exporting the script from the modelbuilder and tried to modify it - what a frustrating mistake!
... View more
11-28-2011
09:16 AM
|
0
|
0
|
1003
|
POST
|
Hi Everyone, I am trying to implement a simple raster calculator within my python script as the following arcpy.gp.RasterCalculator_sa("\"%Temp4%\"/2", Temp2)
But I am receiving the following error in python "Warning (from warnings module): File "<string>", line 1 SyntaxWarning: import * only allowed at module level Traceback (most recent call last): File "F:\test.py", line 75, in <module> arcpy.gp.RasterCalculator_sa("\"%Temp4%\"/2", Temp2) File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in <lambda> return lambda *args: val(*gp_fixargs(args)) ExecuteError: ERROR 000539: Error running expression: rcexec() <type 'exceptions.TypeError'>: unsupported operand type(s) for /: 'str' and 'int' Failed to execute (RasterCalculator)." I am using arcpy.CheckOutExtension("spatial") so im not sure what the first point of the error is implying! This is really frustrating... any help would be appreciated! Bjebn
... View more
11-28-2011
03:11 AM
|
0
|
4
|
13028
|
POST
|
Just a few observations. The variables set from system arguments are buried in DefineProjection() def block, and as far as I can see, DefineProjection() never gets run. Python does not evaluate or execute code in a def block until it is called. Since the try:except block is not in that function, and do not call it, where are the parameters used in the try block set? Now, even if you are importing the whole module, (where you would be setting the workspace, for example) it is odd that you would go back to sys.srgv for the arguments... Why not pass the args to the function explicitly? To wit: def DefineProjection(InFolder, OutFolder, incoordinate, outcoordinate): you can capture them from the command arguments before calling the function. In any event, lists don't have Reset() or Next() functions. Use a >> for rasterImage in RasterList: << loop instead. Alright thanks mdenil... that solved the problem! I thought it didnt look quite right but I didnt think that rewritting the code was necessary if it had already been done before so I simply tried to remodify this script to the newest version of arcpy. I suppose Reset() and Next() functions are primarily used after yield statments? Thanks again, Bjorn
... View more
11-17-2011
11:11 PM
|
0
|
0
|
344
|
POST
|
Hi Everyone, I've been working on some code to automatically sort a list of subdirectores and then to reproject those dems which end with *dem.tif. The function to find those files has worked (on its own) but the reprojection function does not seem to work at all, either on its own or with the find function described above. Here is the code... # Batch Processing Script used to redefine projection
import os, fnmatch, arcpy, sys, string
# Sort files by a Specified Filename
def File_Find(filepat,top):
for path, dirlist, filelist in os.walk(top):
for name in fnmatch.filter(filelist,filepat):
yield os.path.join(path,name)
#Reproject Raster Datasets
def DefineProjection():
#Variables
InFolder = sys.argv[1]
OutFolder = sys.argv[2]
incoordinate = sys.argv[3]
outcoordinate = sys.argv[4]
SFiles = File_Find('*dem.tif',InFolder) # Files Used in Reprojection
arcpy.env.workspace = SFiles
#Reprojection Function
try:
RasterList = arcpy.ListRasters()
RasterList.Reset()
RasterImage = RasterList.Next()
arcpy.AddMessage('\n' + 'Begin Processing.......' + '\n')
while RasterImage:
arcpy.AddMessage(' Projecting ' + RasterImage)
InFileName = ReProject + "\\" + RasterImage
arcpy.AddMessage( 'infilename = ' + InFileName)
OutFileName = OutFolder + '\\ ' + RasterImage
arcpy.AddMessage('outfilename = ' + OutFileName)
arcpy.ProjectRaster_management(InFileName, OutFileName, outcoordinate, 'CUBIC', '#', '#', '#', incoordinate)
arcpy.AddMessage(RasterImage + ' Projected')
arcpy.AddMessage('\n')
RasterImage = RasterClassList.Next()
except:
print arcpy.GetMessages(2)
print 'No Files Match That Criteria!'
The code runs without any error in ArcGIS, but it does not produce any results, so I suspect it has something to do with the way I have used the list rasters function. Any help would be most appreciated, Sincerely, Bjorn
... View more
11-17-2011
12:10 AM
|
0
|
3
|
612
|
POST
|
Hi Everyone, I was wondering if anyone could give me any ideas/thoughts/links to get myself familiar UTM Conversion from lat long. I am using a lot of DEM data (i.e. SRTM or AGDEM) who provide the data in tif format with the name representing the lat long in WGS84 (center?). i.e. ASTMGTM2_N37W110 = North037 and W-110 degrees that according to http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html conversion tool would be in UTM zone 12. If I could apply an automated process similar to that conversion tool on the downloaded datasets (using the name in lat/long)then I would simply need to apply the standard project raster tool in ArcGIS to apply the actual projection of the data. I realize that one could define the projection in the project raster manually and then use a batch process but I was wondering if a fully automated solution in python is possible? Sincerely, Bjorn
... View more
11-11-2011
05:13 AM
|
0
|
4
|
9166
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|