POST
|
Hello, Using ArcMap 9.3, I'm trying to interpolate a surface from a shapefile containing precipitation values for various rain gages. The data is monthly, and I'm creating surfaces for one month at a time. Some gages were not functional over the entire time period, so values of -99999 were used to show that is an invalid point (which needs to be distinguished from valid 0 values). Is there a way to ignore these values when using Kriging, IDW, or other interpolation methods? Otherwise, I will get giant valleys in my rasters. Thanks.
... View more
12-15-2010
09:07 AM
|
0
|
0
|
279
|
POST
|
Just worked out the final kinks (hopefully). It's a little odd that the Quick Export tool requires a separate overwrite setting.This drove me nuts at first becuase it was appending my database each time even though I had the geoprocessor object set to overwrite. In case anyone else wants to do something similar, this code takes my XY data from a table and creates/overwrites a table within a personal geodatabase. It would have to be modified considerably for anyone else who wants to use it, but at least this is a starting point.
# Import system modules
print "Importing system modules..."
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Load required toolboxes...
print "Loading toolboxes..."
gp.AddToolbox("C:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
# Setting OverWriteOutput to True allows geoprocessing tools to overwrite
# the output if it already exists.
gp.OverWriteOutput = 1
XY_Table = ""
outputDB = '"\\\\ComputerB\\AutoSitesShp\\SitesShp.mdb"'
outputLayer = "SurfaceWater"
inputTable = "\\\\ComputerB\\AutoSitesShp\\sitefile_01.mdb\\SW"
# Process: Make XY Event Layer (SW) ...
print "Making XY Event Layer (SW) ..."
gp.MakeXYEventLayer_management(inputTable, "dec_long_va", "dec_lat_va", outputLayer, "GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision")
# Process: Quick Export (SW)...
print "Processing Quick Export (SW) ..."
Output_Dataset = "GEODATABASE_MDB," + outputDB + ",\"RUNTIME_MACROS,\"\"OVERWRITE_GEODB,yes,TRANSACTION_TYPE,TRANSACTIONS,SIMPLIFY_GEOM,no,X_ORIGIN,0,Y_ORIGIN,0,XY_SCALE,0,HAS_Z_VALUES,auto_detect,Z_ORIGIN,0,Z_SCALE,0,GRID_1,0\"\",META_MACROS,\"\"DestOVERWRITE_GEODB,yes,DestTRANSACTION_TYPE,TRANSACTIONS,DestSIMPLIFY_GEOM,no,DestX_ORIGIN,0,DestY_ORIGIN,0,DestXY_SCALE,0,DestHAS_Z_VALUES,auto_detect,DestZ_ORIGIN,0,DestZ_SCALE,0,DestGRID_1,0\"\",METAFILE,GEODATABASE_MDB,COORDSYS,,__FME_DATASET_IS_SOURCE__,false\""
gp.QuickExport_interop(outputLayer, Output_Dataset)
Thanks again to everyone who posted suggestions!
... View more
08-09-2010
09:40 AM
|
0
|
0
|
545
|
POST
|
My coworker suggested a work around. Here it is in case anyone else runs into a similar problem: "You'll notice that the DrainID or HydroID of the GlobalWatershed is the same as the DrainID or HydroID of the GlobalWatershedPoint. It appears that your DrainID=DrainID, though always check it because I've seen it with different combinations. Therefore: Join the GlobalWatershed to GlobalWatershedPoint. (R-click on GlobalWatershedPoint in the TOC/joins and relates/join based on the matching field (DrainID). Then, use field calculator to calculate the GlobalWatershedPoint's name and descript based on the joined field. Finally, remove the join since you don't need it anymore."
... View more
08-09-2010
05:41 AM
|
0
|
0
|
236
|
POST
|
Thanks. I think this will work. First trial did in 5 minutes what my old code did in 2 hours.
... View more
08-06-2010
01:52 PM
|
0
|
0
|
545
|
POST
|
I've run into a small snag with the ArcHydro batch global watershed delineation. I have a "Name" and "Descript" field in my batch points; this produces the expected result in the GlobalWatershed (polygon) layer, but not in the GlobalWatershedPoint layer. Everything seems to work fine except that the GlobalWatershedPoint layer uses batch point Descprit as to populate its Name field and leaves its Descript field blank (ie. if the batch point Name= Test1 and Descript=MyDescript, then GlobalWaterShedPoint Name=MyDescript and Descript=<null>). This doesn't happen when I use the non-batch version of the global watershed delineation tool. Has anyone else had this issue? Am I messing something up or it it just a glitch? Thanks.
... View more
08-06-2010
12:02 PM
|
0
|
1
|
2081
|
POST
|
Thanks for the help (on this thread and others). I've been bouncing between projects and I'm just now getting back to this one. The Super Region Poly tool is helpful in getting my overlapping polygons into unique pieces that are still able to be joined/related back to the originals. This still leaves me with one issue: is there a way to do a area-weighted average in ArcGIS 9.3? I can now run my zonal statistics table on the non-overlapping polygons, and I can associate the non-overlapping polygons with the overlapping polygons, but I don't know how to adjust the stats to be a true average for the original (overlapping) polygons. Thanks.
... View more
08-04-2010
01:22 PM
|
0
|
1
|
407
|
POST
|
This just doesn't make any sense: using zero scripting in ArcMap (just clicking Add XY Data, then right clicking events layer and exporting the data) this process takes about 2 minutes. I can accomplish the same thing in ModelBuilder in about 10 minutes using "Make XY event layer" and "Copy features (management)". My Python script (which uses the same to geoprocessing commands as ModelBuilder) takes 2 hours. All of this with the same data and same save locations. For both the ModelBuilder and Python scripts, the step that takes the longest is Copy features. (Add XY Data takes less than 30 seconds.) What's the discrepancy here? (I'm still open to alternatives to the Copy features method also; I haven't been able to make sense of cursors yet.)
... View more
07-28-2010
12:07 PM
|
0
|
0
|
545
|
POST
|
Thanks for the replies. About the network: Yes, the files are being processed over a network. Yes, this probably adds some time. However, I don't think this is my main issue; I can perform the same task that takes 2+ hours via Python in a few minutes through ArcMap (with the same network setup). It's the gp.CopyFeatures_management line that takes most of the time; the rest runs in less than 1 minute. About cursors: This sounds promising, but it's completely new to me, I'm a programming rookie, and I couldn't really see how to apply the example scripts to my files. I'm trying to create a shapefile of points from an Access table that contains site information. The sites have about 50 fields describing various parameters, all of which need to be accessable upon "Identify" in ArcMap. Each site has its own unique name and lat/long coordinate. Could someone please provide me with more specific examples? Thanks.
... View more
07-26-2010
07:02 AM
|
0
|
0
|
545
|
IDEA
|
It would be awesome if there was a panel/toolbar in ArcCatalog that showed the files that refer to a selected data source. The panel could also have the option to update the path within these files when the data is moved. For instance, you need to relocate a shapefile that used in several different maps in different folders. This panel could access all your maps and update the data source path in all of them with a simple dialog, rather than having to open each map individually.
... View more
07-23-2010
05:54 PM
|
5
|
0
|
334
|
POST
|
Hi, I've been working on a Python script to convert a table (from MS Access .mdb) to a shapefile. The code below works well for my smaller tables (about 2,000 records with 50 fields; runs in 51 seconds), but takes far too long for larger ones (about 75,000 records with 50 fields; still running after 1 hour 45 minutes...). The idea is to programmatically replicate the ArcMap actions of "Add XY Data" and "Export Data to Shapefile", so I'm using gp.MakeXYEventLayer_management and gp.CopyFeatures_management. It takes much more time via Python than the actions would take in ArcMap, which leads me to wonder if I'm missing something. Any suggestions on how to make this work faster?
# Import system modules
print "Importing system modules..."
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Load required toolboxes...
print "Loading toolboxes..."
gp.AddToolbox("C:/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
# Setting OverWriteOutput to True allows geoprocessing tools to overwrite
# the output if it already exists.
gp.OverWriteOutput = 1
XY_Table = ""
#-------------Groundwater Part ----------------------
GWLayer = "'Groundwater$'_Layer3"
v_Groundwater = \\\\Computer\\AutoSitesShp\\sitefile_01.mdb\\GW
GW = "\\\\Computer\\AutoSitesShp\\AutoGW"
# Process: Make XY Event Layer (GW)...
print "Making XY Event Layer (GW)..."
gp.MakeXYEventLayer_management(v_Groundwater, "dec_long_va", "dec_lat_va", GWLayer, "GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];IsHighPrecision")
# Process: Copy Features...
print "Copying features (GW)..."
gp.CopyFeatures_management(GWLayer, GW, "", "0", "0", "0")
GWLayer =0
v_Groundwater = 0
GW = 0
# Clear local variables
v_Surface_Water___Layer = 0
SW = 0
XY_Table = 0
v_Surface_Water__ = 0
# Set OverWriteOutput back to false
gp.OverWriteOutput = 0
print "Done."
... View more
07-23-2010
12:41 PM
|
0
|
8
|
802
|
POST
|
Hi, In 9.3: I'm trying to get precipitation data from a raster into a table with average values for overlapping drainage basins (ie Tributary 1 and Tributary 2 each have polygons; these are overlapped by the polygon for Main River X, which also includes some area not in any of its tributary polygons). When I try using the Zonal Statistics to Table tool, it only returns values for the polygons that are not overlapped. Is there any comparable method that will give me data for every polygon? Thanks.
... View more
07-21-2010
01:30 PM
|
0
|
4
|
1580
|
POST
|
Thanks for the quick response. I'm using 9.3 and I have limited scripting experience. I explored the option of exporting the model as a script, but it seems that the model loses all documentation, parameters, and symbology options (where I set outputs to display according to a certain layer file). Am I missing something, or do all these things really have to be recreated for the script? Thanks again.
... View more
07-16-2010
06:02 AM
|
0
|
0
|
185
|
POST
|
Hi, I have a model (see attached image) built in ModelBuilder that currently takes the following path: CSV file with cooridinates and data --> Events Layer of points --> Shapefile of points --> Raster interpolated from points --> other stuff. I want to make the model more useful by allowing the user to jump in at any step (ie, if they have a point shapefile or raster dataset, let them start the model there). Any suggestions on how I can let the user specify where to start (and get the model to ignore the previous steps)? Thanks. Maria
... View more
07-15-2010
12:11 PM
|
0
|
2
|
847
|
POST
|
Sorry. It makes sense now. I didn't see the tool at first.
... View more
04-08-2010
03:30 PM
|
0
|
0
|
313
|
POST
|
That sounds promising. I know that I can use the Polygon to Raster conversion tool, but I'm lost about how to do the rest.
... View more
04-08-2010
03:28 PM
|
0
|
0
|
313
|
Title | Kudos | Posted |
---|---|---|
5 | 07-23-2010 05:54 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|