Quantcast
Channel: Forums - Geoprocessing
Viewing all 1952 articles
Browse latest View live

Trouble with Attachment Tools

$
0
0
Hi there,

I'm running into some problems when using the Attachments tools. We're assigning traffic signs of a certain MUTCD code a single image of what that sign looks like (e.g. all stop signs will have the same attachment, which is a picture of a stop sign). I'm testing out the Generate Attachment Match Table and Add Attachments tools, but can't seem to get the attachments to actually get to signs.

Here are the details:
  • I have a folder with the jpg image of the stop sign on my desktop. The name of the image is R1-1, which is the MUTCD code for stop signs.
  • I have map open with only the sign feature class. Feature class is stored on SDE.
  • I open up the Generate Attachment Match Table tool. Input Dataset is my feature class, Input Folder is the path to the folder I describe above, Output Match Table has been pointed to a file geodatabase on my desktop, and the key field is MUTCD. Store Relative Path is checked.
  • I run the tool and the match table has the correct number of features for stop signs, with the features' OBID in the MatchID field and all records are pointed to the R1-1.jpg with the Filename field.
  • I now open the Add Attachments tool. Input Dataset is my feature class, Input Join Field is OBJECTID, Match Table is the match table in my file geodatabase, Match Join Field is MatchID, and Match Path Field is Filename. Working Folder is pointing to the folder where R1-1.jpg is.
  • When I run the tool, I'm seeing a message in the Results tab for each ObjectID in the match table that says something like, "Cannot add file 'C:\Users\khighland\Desktop\Test\R1-1.jpg' to feature with OID = 1571"

But I don't understand why it's not allowing me to add the files. Does anyone have a clue why this is happening? Am I not allowed to assign a single attachment to multiple features, with the assumption it will copy the attachment x amount of times for however many features match this MUTCD?

Using 10.1 SP1 with an Advanced license on a WIN7 PC with local admin rights.


Any info/advice would be greatly appreciated.
Kevin

using feature iterator in model using lastools functions

$
0
0
I have a question about using iterators and lastools functions in the arcgis modelbuilder.

I use ArcMap 10.1 and the LasTools ArcGIS toolbox.
So far, using lasfiles and lastools functions in the modelbuilder has worked fine.

I'm trying to clip the lasfiles onto shapefiles of single trees in a forest, and export these lasfiles to txt. I have two lasfiles, one with ground returns and one with nonground returns.

To avoid having to adapt and run the model once for every tree (there's 200+ trees in my forest plots), I have tried to incorporate a feature iterator. However, the lasclip function does not seem to accept the output feature of the iterator as input. I cannot select the iterator output in the lasclip tool interface and when I try to build a connection between the iterator output and the lasclip function, I cannot select the "input feature" option.

Has anyone encountered similar problems? Are the lastools functions incompatible with iterators?

Thanks in advance,
Rúna

PS. I'm only a bachelor student and I don't have much experience with the modelbuilder..
Attached Thumbnails
Click image for larger version

Name:	help_model.jpg‎
Views:	N/A
Size:	38.7 KB
ID:	34128  

Batch Interpolation Question??

$
0
0
Batch Interpolation Question??
I would like to perform a batch interpolation, but it is not working. I think I may have too many variables.
I have 27 point layers within the polygon that I am using as the extent. And each point has the following data in the Attribute table.


FID Shape * Year Cnt_Year Ave_Tmax Sum_Tmax Ave_Tmin Sum_Tmin Ave_Prec Sum_Prec Max_Lon Max_Lat
0 Point 1950 365 7.9088 2886.72 -5.0879 -1857.1 0.8086 295.15 -110.041 49.7744
1 Point 1951 365 6.8684 2506.96 -5.4867 -2002.65 1.4086 514.13 -110.041 49.7744
2 Point 1952 366 10.4696 3831.89 -3.3081 -1210.78 0.8703 318.53 -110.041 49.7744
3 Point 1953 365 12.0157 4385.72 -2.036 -743.15 1.0504 383.38 -110.041 49.7744
4 Point 1954 365 10.0585 3671.37 -2.7727 -1012.04 1.2912 471.27 -110.041 49.7744
5 Point 1955 365 8.5946 3137.03 -5.0283 -1835.33 1.0833 395.39 -110.041 49.7744
6 Point 1956 366 9.9917 3656.95 -3.6912 -1350.99 0.911 333.43 -110.041 49.7744
7 Point 1957 365 10.2449 3739.38 -3.0116 -1099.22 0.8716 318.12 -110.041 49.7744
8 Point 1958 365 11.2795 4117.03 -2.1885 -798.81 0.8119 296.36 -110.041 49.7744
9 Point 1959 365 9.9035 3614.79 -3.1678 -1156.23 0.8498 310.18 -110.041 49.7744
10 Point 1960 366 10.8431 3968.59 -2.9335 -1073.65 0.7129 260.92 -110.041 49.7744
11 Point 1961 365 12.0676 4404.66 -1.6152 -589.54 0.5835 212.97 -110.041 49.7744
12 Point 1962 365 11.4365 4174.33 -2.0857 -761.29 0.7275 265.54 -110.041 49.7744
13 Point 1963 365 12.1504 4434.91 -1.3317 -486.07 0.8882 324.21 -110.041 49.7744
14 Point 1964 366 10.333 3781.87 -2.3931 -875.86 1.1438 418.62 -110.041 49.7744
15 Point 1965 365 8.8727 3238.54 -3.2535 -1187.52 1.2118 442.31 -110.041 49.7744
16 Point 1966 365 9.9183 3620.18 -3.2754 -1195.52 0.9767 356.49 -110.041 49.7744
17 Point 1967 365 10.4525 3815.17 -3.2075 -1170.72 0.9967 363.81 -110.041 49.7744
18 Point 1968 366 9.8814 3616.58 -2.6298 -962.52 0.9466 346.47 -110.041 49.7744
19 Point 1969 365 9.7618 3563.07 -3.8211 -1394.7 0.8055 293.99 -110.041 49.7744
20 Point 1970 365 9.6003 3504.1 -3.7127 -1355.15 0.9912 361.78 -110.041 49.7744
21 Point 1971 365 10.4498 3814.18 -3.4033 -1242.21 0.7212 263.23 -110.041 49.7744
22 Point 1972 366 9.3783 3432.45 -4.21 -1540.86 1.0065 368.38 -110.041 49.7744
23 Point 1973 365 11.3226 4132.74 -2.5464 -929.44 0.7116 259.73 -110.041 49.7744
24 Point 1974 365 11.1159 4057.32 -2.278 -831.46 0.9736 355.35 -110.041 49.7744
25 Point 1975 365 8.501 3102.85 -3.8261 -1396.53 1.387 506.25 -110.041 49.7744
26 Point 1976 366 12.0099 4395.61 -1.7444 -638.46 0.7598 278.1 -110.041 49.7744
27 Point 1977 365 10.7566 3926.17 -2.6405 -963.78 0.8877 324 -110.041 49.7744
28 Point 1978 365 8.14 2971.11 -3.735 -1363.28 1.4043 512.58 -110.041 49.7744
29 Point 1979 365 10.1147 3691.86 -3.7621 -1373.17 0.8238 300.69 -110.041 49.7744
30 Point 1980 366 10.8475 3970.2 -2.3467 -858.9 0.9749 356.81 -110.041 49.7744
31 Point 1981 365 12.4935 4560.12 -0.8483 -309.63 0.9053 330.44 -110.041 49.7744
32 Point 1982 365 8.49 3098.84 -4.4715 -1632.11 1.1995 437.82 -110.041 49.7744
33 Point 1983 365 10.6254 3878.26 -2.0754 -757.52 0.9122 332.97 -110.041 49.7744
34 Point 1984 366 10.8432 3968.62 -2.2062 -807.48 0.8058 294.94 -110.041 49.7744
35 Point 1985 365 9.0628 3307.92 -3.3551 -1224.61 1.0316 376.54 -110.041 49.7744
36 Point 1986 365 11.4103 4164.76 -1.138 -415.37 1.4741 538.03 -110.041 49.7744
37 Point 1987 365 13.4581 4912.22 -0.5393 -196.85 0.7322 267.25 -110.041 49.7744
38 Point 1988 366 12.7467 4665.29 -1.9636 -718.68 0.6554 239.87 -110.041 49.7744
39 Point 1989 365 9.9673 3638.06 -3.039 -1109.24 1.0695 390.35 -110.041 49.7744
40 Point 1990 365 11.5382 4211.43 -2.6359 -962.09 0.9997 364.89 -110.041 49.7744
41 Point 1991 365 11.3502 4142.82 -2.1256 -775.86 1.1999 437.96 -110.041 49.7744
42 Point 1992 366 11.9397 4369.94 -1.7321 -633.95 1.0476 383.42 -110.041 49.7744
43 Point 1993 365 9.5503 3485.87 -2.8738 -1048.95 1.3836 505.03 -110.041 49.7744
44 Point 1994 365 11.155 4071.58 -1.8987 -693.03 0.988 360.61 -110.041 49.7744
45 Point 1995 365 10.4719 3822.23 -2.5105 -916.34 1.2612 460.32 -110.041 49.7744
46 Point 1996 366 8.403 3075.5 -4.1136 -1505.57 1.063 389.05 -110.041 49.7744
47 Point 1997 365 11.7508 4289.03 -2.1382 -780.45 0.6755 246.54 -110.041 49.7744
48 Point 1998 365 12.3289 4500.06 -1.2019 -438.68 1.2361 451.16 -110.041 49.7744
49 Point 1999 365 12.3895 4522.16 -1.2386 -452.08 0.9688 353.6 -110.041 49.7744
50 Point 2000 366 11.3139 4140.87 -2.291 -838.49 0.8543 312.69 -110.041 49.7744
51 Point 2001 365 12.9691 4733.71 -0.9715 -354.61 0.5692 207.75 -110.041 49.7744
52 Point 2002 365 9.9319 3625.15 -1.3963 -509.66 1.4067 513.46 -110.041 49.7744
53 Point 2003 365 11.4915 4194.39 -1.2039 -439.42 1.0723 391.38 -110.041 49.7744
54 Point 2004 366 11.0463 4042.95 -1.3381 -489.74 1.1322 414.39 -110.041 49.7744
55 Point 2005 365 11.8939 4341.29 -1.347 -491.67 1.0313 376.43 -110.041 49.7744
56 Point 2006 365 12.6792 4627.92 -0.5152 -188.06 0.8269 301.81 -110.041 49.7744
57 Point 2007 365 12.0677 4404.7 -1.3327 -486.42 0.9368 341.94 -110.041 49.7744
58 Point 2008 366 10.9467 4006.5 -2.5095 -918.49 1.033 378.08 -110.041 49.7744
59 Point 2009 365 10.0705 3675.74 -2.8561 -1042.46 1.0743 392.11 -110.041 49.7744
60 Point 2010 365 10.4167 3802.1 -1.6548 -604.01 1.5245 556.43 -110.041 49.7744
61 Point 2011 365 10.6476 3886.36 -1.4049 -512.79 0.9664 352.75 -110.041 49.7744
62 Point 2012 366 12.148 4446.17 -0.499 -182.62 1.014 371.14 -110.041 49.7744

I would like to perform an interpolation with Ave Prec . for each year. Therefore I have 27points * 62rows. How can I perform interpolation for each year????

Using Modelbuilder for a Monte Carlo Process

$
0
0
Hello,

I would like to create a model or write a script that will complete the following geoprocess:

If I have a layer of polygons, I need to place two random points in each polygon, create a line from those two points, and then check if that line falls within the polygon or not.

I am using ModelBuilder, and I am able to build a model that will create two random points within each polygon and then create a line between them. I am confident that I can figure out how to do the spatial join, but I am not sure how to use that to give me an output that essentially counts if it is inside the polygon or not.

I am unsure how to correctly set up the for - function and collecting the output data that I need.


Pseudocode:

for i=1 to 10000
Create two random points inside each polygon
Create line between those two points
Check if line falls completely within the polygon
Keep a count for each polygon if the line falls within polygon or not for each round through the loop

end

I figured I would ask if anyone had any examples they might be able to share that accomplished something similar, or if anyone had any suggestions as to how to build this model.

Much appreciated!

arcgis 10.2 output feature class: toolbox results

$
0
0
Hi. I'm using arcgis 10.2. The tools no longer appear to work (eg. Clip tool). Just sits there processing. In the results it states output feature class: <epmty>. This happens for all tools. See attached image.
Thanks in advance for any help.
Attached Thumbnails
Click image for larger version

Name:	arcgis error 1.jpg‎
Views:	N/A
Size:	136.8 KB
ID:	34157  

10.2 GP service creates file - how to write it so I can actually retrieve it

$
0
0
Hi,

I am tearing out my hair (which I can ill afford to do) over being able to retrieve a file I create via a GP service. Very simplified:-

1. Let's say I have a Python script which takes no input parameters.
2. It creates a file called 'HelloWorld.txt', which is empty.

That's it. This runs fine on the desktop and I can retrieve HelloWorld.txt. Yippee.

When I publish this, successfully, and run it, successfully, I cannot for the life of me get the file. I've tried a lot of stuff:

1. Writing to 'nowhere', i.e. just HelloWorld.txt = written in job scratch area, result url goes to a scratch folder which gives an HTTP 400, Invalid URL.
2. Writing to 'scratch' via arcpy.env.scratchFolder = same as above
3. Writing to the 'current workspace' via arcpy.env.workspace = empty on server, same as above
4. Etc

What it _appears_ I need to do is to somehow write to the 'Output Directory' specified for the service, which has a nice accompanying 'Virtual Directory'. Am I right? How on earth do I get this location? Would doing that even cause the url to be mapped to that location? Why is this so hard? :-) You just publish a GP result, right? Hooray!

Sorry. You can probably tell this has my mind in knots.

Please, if someone could provide the Python snippet that will do this, I would be most grateful. I might even make a T Shirt out of it, grow a beard and travel the world evangelizing about it, because this should be EASY, front and center whenever someone outputs a file as a script result and wants to publish it. I'm asking for a Python snippet, rather than a URL to help docs, because "I've been everywhere, man!" and really doubt those will shed any light. DO NOT let this put you off attempting to help, however. :-) I'll be truly grateful for any crumbs.

I just wanted it to work like the print task works. You get a nice URL that you download from and go on with your life. This seemed like it must be a five minute job. Tops.

Thanks for listening!

Frank

Tracing a polyline segments that falls between points?

$
0
0
Hello!

I am hoping that someone might have a suggestion to make this process a bit easier...


I have a point shapefile that represents the start and end points of certain streams within the state. Additionally I was provided with a polyline shapfile with stream segments that represents the stream flowing between the two start/end points.

What I need to be able to do is find an easier way of selecting the individual polyline segments that fall in between the corresponding start and end point. I have been going through and manual selecting the segments but I have over 450 streams that I need to do this for and eventually I will probably miss a small segment that should be included.

A more detailed breakdown of the scenario I am in:

I was provided a point and line file from the IEPA. The point file for all intents and purposes is finished but what I am trying to do is get a better version of the line file. I am trying to use the provided polyline file in conjunction with a medium resolution NHDPlus flowline file and a high resolution NHD flowline file. I need a way to select the segments in the NHD high/medium flowline files that are represented in the IEPA shapefile.

Thank you for taking the time to try and help!

Jonathan

ERROR 000820: The parameters need repair- Geoprocessing service directory not updated

$
0
0
Hi everyone,

I've been struggling for days about this one.
I've created a model including a python script tool (to create a geostatistical layer).
Everything goes smooth on ArcMap.
I can publish the service one time. Works well when tested.
But trying to update it after a few changes where made (number of parameters, type of parameters (optional to required), etc...), after deleting the existing service and publishing it again, i get the ERROR 000820: The parameters need repair.

I lost a few (numerous actually) days trying to figure out what was wrong about the script, the parameters, the model.
Then, i recently find out the service directory was just not updated as i was publishing, even if the corresponding service was deleted either in ArcGIS Admin or in ArcMap.

Of course, i can go to the directory and physically delete it any time a delete the service, but i was wondering if there is a way to force ArcGIS Server to delete the service's physical directory when the service is deleted, or to make sure it's correctly updated when the service is published.

Any help is welcome

Sort WE_SN Point Feature Class

$
0
0
I have a point Feature Class I am trying to sort. It contains both a "POINT_X" and a "POINT_Y" field. I wish to start from lower left and sort WE_SN. I have a standard license and am therefore limited to a single sort field (excluding shape) while using sort_mgmt(). I therefore am looking to calculate new sort field using "POINT_X" and "POINT_Y". Any suggestions?

Thanks in advance.

Parallel Processing Factor

$
0
0
Has anyone built a comprehensive list of the tools that honor the Parallel Processing Factor environmental setting?

I know some of the interpolation techniques (i think) and the geostatistical analyst tools honor them. just looking for a complete list.

--daniel

New to model builder - need help with something a little more complex

$
0
0
Hi all,

I am familiar with model builder and have used it to do some basic things, but now I need it to do something slightly more complex. Any help would be greatly appreciated. if this process can be done in python, I'll listen, but I have a very limited knowledge base with python.

So the basics: I am using ArcGIS 10.1
I have a shapefile of 417 parcels

My goal: to export each record individually as a shapefile into a geodatabase (jud_list_parcels) and label them according to the parcel id number which is in the field Pin_csv_PI.

I believe this can be done using model builder (possibly python if not), but feel free to correct me if I am wrong and if I have to do this the long way and select and export each one I will. Thank you for your help.

Processing set intervals in a river?

$
0
0
Hello Geoprocessing community!

I apologize if this isn't the correct subforum for this. I'm new to ArcGIS, still trying to get through that steep learning curve. Here's my scenario:

I currently have thousands of water quality data taken along a river, and I have the GPS coordinates of where each data point was taken along the river. There's a fixed route that the sampling boat was supposed to take, and samples were taken once a month for a few months.

The objective of my work is to use GPS coordinates to match data with eachother so I could see how water quality changes throughout the river over time. At first, I found the "cumulative distances" of my data using various equations and plugging them into Excel. However, I soon realized that the "cumulative distance" for one month didn't match up to the next month, and the month after. That's because the actual path that the boat traveled to the sampling sites are never identical. With that said, I can't compare the data from, say, 23 km of travel in May to the data from 23 km of travel in October, because they could be in completely different locations.

With that said, I'm wondering if I can use ArcGIS to somehow average out of my data in every 0.02 km distance along the river. This way, distance isn't measured by the path the boat took, but is using the river itself as the ruler instead.

I hope I've given enough to work with--- please let me know if there's anything I can clarify to make this more clear!

Sincerely,
ArcGIS Noob

Create a new feature from where two features do not intersect?

$
0
0
I am new, and I did do a quick search of the forums but I couldn't find anything - so I imagine this is a super simple fix that I just can't figure out. I do apologize, but I would appreciate any input. Thanks in advance.


---------

I have a bunch of buffers around features indicating areas that something can NOT be.

And I have a bunch of buffers around features indicating areas that something MUST be.

I clearly see how I can intersect them, etc, but I am interested in the areas where they do NOT intersect.

Geoprocessing Service Only Runs Once

$
0
0
Hello,

I am trying to publish an ArcGIS geoprocessing service in 10.2 I have a script setup that will run multiple times through Pycharm, but when I run it in ArcGIS it will run once and return this error:

Traceback (most recent call last):
File "C:\Users\\Desktop\git\GeoprocessingService.py", line 477, in <module>
main()
File "C:\Users\Desktop\git\GeoprocessingService.py", line 372, in main
cur)
File "C:\Users\Desktop/git\GeoprocessingService.py", line 136, in value_query
results = cur.fetchall()
File "C:\Python27\ArcGIS10.2\lib\site-packages\psycopg2\extras.py", line 81, in fetchall
res = super(DictCursorBase, self).fetchall()
File "C:\Python27\ArcGIS10.2\Lib\decimal.py", line 543, in __new__
m = _parser(value.strip())
TypeError: 'NoneType' object is not callable

Failed to execute (Script).

The script itself is 800 lines, but here is the query I have been running that errors out:
def value_query(id_field, id, value_fields, start_date, end_date, date_field, table, cur):
query2 = "SELECT "
for field in value_fields:
query2 += "NULLIF({0}, '-999')::NUMERIC(6,2),".format(field)
query2 += "{0} " \
"FROM {1} " \
"WHERE {2} = '{3}' AND {0} BETWEEN '{4}' AND '{5}' " \
"ORDER BY {0} ASC;".format(date_field, table, id_field, id, start_date, end_date)
#print "This is Query:"
#print query
arcpy.AddMessage("{0}".format(query2))
cur.execute(query2)

results = cur.fetchall()

#print "These are value query results:\n\n {0}".format(results)
return results



Like I said it runs once in ArcGIS then errors out. However, if I close Arc completely and run the exact same script again, it runs once then stops. I feel like there may be some sort of caching or something that Arc does, but am completely stumped.

Combining rasters and producing a table -- most efficient method

$
0
0
Hello!

I have a geoprocessing tasks that requires combining rasters with a polygon feature class and producing a table containing the information of the foregoing files.

I have the following geospatial data: a polygon file containing municipality boundaries called mun and 8 raster data representing a type of soil--call them soil1, soil2, etc.

The municipality polygon file has in its attribute table a column containing a unique id identifying each municipality. Each soil raster, on the other hand, take a value of 1 if the cell is of that raster's soil type (soil1 for example) and 0 otherwise.

The end product I need is a table where each row is a pixel from the raster and the following fields: municipality id, soil1, soil2, soil3,...soil8, where the soil fields takes the values 1 or 0.

I'm looking for the fastest way to accomplish this task (in terms of geoprocessing time) and so far I've tried the following:

I used the "Polygon to Raster" tool to create a raster of the municipality polygon file. Then I will use the "Combine Raster" tool to combine all nine rasters (the new municipality raster I created and the eight soil rasters). Right now I'm still trying to create the raster for the municipality polygon file and it's taking a very long time to complete (it's still running and 7 hours have passed). Thus, I imagine that the combination of all nine raster will take an even more significant amount of time.


Any suggestions of other ways to accomplish this task that may be faster?

Thanks for your help

converting coordination

$
0
0
Hi,
I have a map with NAD 1983 State Plane California _III_ FIPS 0403 Feet coordinate(Lambert-conformel-conic projection). I need to see my map on google earth to have more information about my project. As I now, google earth uses WGS84 as a coordinate system. How can i convert my projection to WGS 84 to be able to move my map to google earth?
Thanks

Fill space between polygons

$
0
0
Hi,

I'm trying to fill space between different features in a feature class.
It is a feature class with streets as polygons, and every street has a streetname as attribute value.

What I want is to fill up al the empty spaces in an specified region.
All these empty spaces need to get the streetname of the nearest street.

Like this picture:
Attached Thumbnails
Click image for larger version

Name:	Example.jpg‎
Views:	N/A
Size:	119.6 KB
ID:	34253  

Field calculation

$
0
0
I've got a set of coordinates where we are going to perform a ground survey. At the moment the sample sites do not have names yet so I was thinking of giving them easy to understand names:
First a letter stating which area in the map it is.
Second the date of the sampling.
Third (and this is where I need help) I would like to have the coordinate of a fishnet grid that I have in another layer.

So ... how do I reference the fishnetgrid in another shapefile to get the name for each sampling Point based on itäs location in the fishnet grid? Any help would be appreciated!

Cheers

Geodatabase not getting updated - No errors returned

$
0
0
I've got a geoprocessing service based on a python script. The script works great from ArcGIS Desktop but when run as a geoprocessing service, it does not update the geodatabase. It also does not provide any errors and I'm not seeing anything helpful in the server logs.

Here's what it does perfectly from the desktop:

1) Receive a username and street address.
2) Geocode that address to an XY coordinate using ArcGIS Online.
3) Write the data to a feature class in a file geodatabase.
4) Use Intersect_analysis to combine this data with a totally unrelated data set in another geodatabase.
5) Use Append_management to concatenate this new row of data onto a final feature class.

When I publish this script a geoprocessing tool, it simply doesn't work - at least not completely. All I get by way of user feedback from the REST endpoint is the following:

Job Status: esriJobSucceeded
Results: None

The geodatabase does not get updated. This seems like it might be a permissions issue, so here's what I've done:

1) Registered the geodatabase in ArcGIS Server Manager.
2) Gave the ArcGIS User account Read, Write, and Modify permissions on the directory which contains the geodatabase.

FWIW, my code is below. Any help would be much, much appreciated!

Code:

# Import arcpy module
import arcpy, os

arcpy.AddMessage("Starting the script...")

varWorkingDirectory = r"C:\Data\GISData\SalesForceDemo"
#varWorkingDirectory = os.getcwd()

# Capture the user input
varCustomerName = arcpy.GetParameterAsText(0)
varAddress = arcpy.GetParameterAsText(1)
varCity = arcpy.GetParameterAsText(2)
varState = arcpy.GetParameterAsText(3)
varZip = arcpy.GetParameterAsText(4)

# Delete any old data in the TestAddresses table
arcpy.AddMessage("Deleting any old data in the TestAddresses table...")

try:
    rows = arcpy.UpdateCursor(varWorkingDirectory + r"\SFTest.gdb\TestAddresses")
    for row in rows:
        rows.deleteRow(row)
        del row
    del rows
except:
    arcpy.AddMessage("Could not delete the old data from TestAddresses.")


# Insert the new data into the TestAddresses table so that it can be geoprocessed
arcpy.AddMessage("Inserting new data into the TestAddresses table...")

try:
    rows = arcpy.InsertCursor(varWorkingDirectory + r"\SFTest.gdb\TestAddresses")

    row = rows.newRow()
    row.Name = varCustomerName
    row.Address =varAddress
    row.City = varCity
    row.State = varState
    row.Zip = varZip
    rows.insertRow(row)

    # Delete cursor and row objects to remove locks on the data
    del row
    del rows
except:
    arcpy.AddMessage("Could not insert the new data into TestAddresses.")

# Delete the old output feature classes
arcpy.AddMessage("Deleting the old output feature classes...")

try:
    arcpy.Delete_management(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults")
    arcpy.Delete_management(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults_In")
except:
    arcpy.AddMessage("Could not delete the old data from CompletedGeocodingResults and CompletedGeocodingResults_In.")

# Local variables:
TestAddresses = varWorkingDirectory + r"\SFTest.gdb\TestAddresses"
World_GeocodeServer = "GIS Servers\\arcgis on geocode.arcgis.com (user)\\World.GeocodeServer"
RadonNew = "C:\\Data\\GISData\\ROE\\NewRadonData.gdb\\RadonNew"
CompletedGeocodingResults = varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults"
FinalGeocodingResultsWithRadon = varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults_In"

# Process: Geocode Addresses
try:
    arcpy.GeocodeAddresses_geocoding(TestAddresses, World_GeocodeServer, "Address Address VISIBLE NONE;Neighborhood <None> VISIBLE NONE;City City VISIBLE NONE;Subregion <None> VISIBLE NONE;Region State VISIBLE NONE;Postal Zip VISIBLE NONE;PostalExt <None> VISIBLE NONE;CountryCode <None> VISIBLE NONE", CompletedGeocodingResults, "STATIC")
except:
    arcpy.AddMessage("Could not perform GeocodeAddresses_geocoding.")

# Process: Intersect
arcpy.AddMessage("Performing Intersect_analysis...")

try:
    arcpy.Intersect_analysis(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults #;C:\Data\GISData\ROE\NewRadonData.gdb\RadonNew #", FinalGeocodingResultsWithRadon, "ALL", "", "INPUT")
except:
    arcpy.AddMessage("Could not perform Intersect_analysis.")

# Append the new data onto the master featureclass
# Append_management (inputs, target, {schema_type}, {field_mapping}, {subtype})

arcpy.AddMessage("Performing Append_management...")

try:
    arcpy.Append_management(varWorkingDirectory + r"\SFTest.gdb\CompletedGeocodingResults_In", r"\SFTest.gdb\FinalGeocodingResults", "TEST","","")
except:
    arcpy.AddMessage("Could not perform Append_management.")

Execute stored procedure throgh geo-processsing service

$
0
0
Hello All,

It might be basic question but I want to run stored procedure in ArcGIS and according to (google search +support+ forums ) its not possible.

Currently I am using this ArcPy script where I am executing stored procedure & its working fine outside the ArcGIS i.e. in Pyscripter.

When I execute in ArcMap (through python window) its working fine and result is appearing in result window. Now I want to make tool so that I can :

1.Create feature class in ArcMap suing the result.
2.Create Geo-processing service

So my question is it possible ? Because I have not seen similar scripts on anywhere..

So any help/any alternate workflow/steps will be great !!!

Software suit : ArcGIS 10.1

thanks in advance
Viewing all 1952 articles
Browse latest View live