|
POST
|
How bout just use the Append tool (with the field mapping object) to append their data into your template?
... View more
11-23-2010
08:49 AM
|
0
|
0
|
2626
|
|
POST
|
You would have to create a seperate .ini file for each .csv file (or at least make a one .ini, and then create multiple copies for each .csv). myfile2.csv needs a matching myfile2.ini Maybe a better idea: Can't you just parse the .csv and force the data types using str(), int(), float(), etc? I assume you are using insert cursors to write the geometry, right?
... View more
11-23-2010
08:45 AM
|
0
|
0
|
3337
|
|
POST
|
Not sure why UNC is faster, just something I got into the habit of doing a long time ago. I have a pet peeve against using network drive letters (The S:\ drive?!?! I don't have an S:\ drive, what the hell is that? Oh you mean \\snarf\am\div_lm\ds?, well why didn't you say so!?!). Pet peeve... Anyway... Setting the license level is also another thing I got into the habit of doing. Like the UNC path thing, I'm not really sure why, just something i started doing, and my scripts always seem to run fine (minus other stuff :)). Here's some v9.3 code that checks out the highest level license (given ArcInfo, ArcEditor, or ArcView): if gp.CheckProduct("ArcInfo") == "Available":
gp.SetProduct("ArcInfo")
elif gp.CheckProduct("ArcEditor") == "Available":
gp.SetProduct("ArcEditor")
elif gp.CheckProduct("ArcView") == "Available":
gp.SetProduct("ArcView")
else:
messsage = "ERROR: Can't specify ArcGIS license level... Exiting script!"; showPyMessage(); sys.exit()
message = "Selected an " + gp.ProductInfo() + " license"; showPyMessage()
... View more
11-22-2010
03:09 PM
|
0
|
0
|
1405
|
|
POST
|
Yes, also UNC pathnames (as opposed to mapped drive letters) are ALWAYS the way to go...
... View more
11-22-2010
02:23 PM
|
0
|
0
|
1405
|
|
POST
|
Definitely use setproduct(). In v9.x I found this to be a pretty critical step... If you are moving from .shp to FGDB format, you probably won't have any schema issues, and therefore probably don't need the arcpy.Validate thing. If you aren't changing the schema around, you might consider just using the CopyFeatures tool (instead of FeatureClassToFeatureClass). It should be a little easier/faster.
... View more
11-22-2010
02:21 PM
|
0
|
0
|
1405
|
|
POST
|
When you are reading the .csv file, ca1n't you just force it to assume a string value? lineValues = readLine.split(",")
for lineValues:
idValue = str(lineValue[0]) #1st field, force it to be a string
otherValue = int(lineValue[1]) #2nd field, force it to be an integer
anotherValue = float(lineValue[2]) #3rd field, force it to be a float Another idea: Create a "companion" schema.ini file (http://msdn.microsoft.com/en-us/library/ms709353(VS.85).aspx so that it forces ArcMap to see the data how you want it. What does your code and .csv file look like?
... View more
11-22-2010
12:35 PM
|
0
|
0
|
3337
|
|
POST
|
There are some different thoughts on the subject: 1. Get the elevations of just the Start and End nodes (FeatureVerticesToPoints_management tool and then ExtractValueToPoints_sa tool) 2. Get the elevations of all the vertices (FeatureVerticesToPoints_management tool and then ExtractValueToPoints_sa tool) - This is a bit more involved... 3. Rasterize the stream layer, derive a slope grid, and then use the ZonalStatistics tool (MEAN) to get the mean slope for each stream segment. AThis is probably the easiest, but again is the mean slope, not really THE slope. You could also mix it up a bit and get the MIN and MAX elevations for each stream segment zone using the ZonalStatistics tool, and then derive slope similar to #1.
... View more
11-22-2010
11:42 AM
|
0
|
0
|
803
|
|
POST
|
Why do you guys keep referring to the old forums as "broken" (besides the fact that it really is broken now that you can't post to it)? I thought that it was awesome! Ok, maybe a bit 1990's, and I do admit that it did lack the all-important emoticon functionality, which I have found to be quite critical. Never even crossed my mind that they were "broken" in any sort of way. :confused: I am glad Jim (being a dictator of benevolent nature) has taken the "adaptive management" approach to solicit/implement ideas on how to make things better. It ain't my fault that most people are apathetic. In my book, apathy means your opinion doesn't count - sorry. Election day is over, and the votes are tallied. Time to act (or not). P.S. In Jim's own words: "I.... love Python... and think it... should have it's own forum on... the 19th".
... View more
11-19-2010
01:33 PM
|
0
|
0
|
1480
|
|
POST
|
Nice quote Ryan! Python = The heart and soul of GIS Not so sure, about the "heart and soul", but maybe if it makes it so ESRI can say "yes" they've embraced open source (well sort of) and at the same time still make $$$ hand over fist - Well I guess that's good enough for a clear conscience. Heart and soul! Go Python!
... View more
11-19-2010
10:34 AM
|
0
|
0
|
1480
|
|
POST
|
Yes, you just need to use an update cursor (and specify the spatial reference parameter): http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Setting_a_cursor_s_spatial_reference/002z0000001w000000/ Then the "Shape" field's coordinate values will be reported in whatever coordinate system you specified...
... View more
11-19-2010
09:46 AM
|
1
|
0
|
4144
|
|
POST
|
PyCharm looks cool ($100 though - actually $200 for me (govt.)) - but where's the interactive/immediate window? I run this code in PyCharm: import random
randomList = []
for i in range (1,11):
randomList.append(random.random()) How can I view the contents of randomList?
... View more
11-19-2010
07:34 AM
|
0
|
0
|
1547
|
|
POST
|
Ryan - You are on the right track for sure. You can get the "correct" case tool names I think from gp.listtools() - or arcpy.listtools() and use that to build a crosswalk. Switching the tool names wouldn't be too horrible, something like... 1. Build a tool name dictionary - toolNameDict[toolName.split("_")[0].lower()] = toolName - {"clip":"Clip_Analysis"} 2. Look for lines with "gp." 3. Isolate the part after the "gp." but before the "_' and/or "(" 4. Convert to lower() 5. Now scan through the dictionary and hopefully find a match The methods and properties would be harder, although most of them tend to be pretty specific keywords like ".getvalue" or ".oidfieldname". Some are not so obscure, like ".name" or ".type". It'd be pretty hard to get something 100% accurate, but even 50% would be better than 0% (as long as it didn't completely bugger your code). Anyway, it would be a pretty good challenge... stuff like this puts the P in GISP for sure.
... View more
11-18-2010
06:37 PM
|
0
|
0
|
2947
|
|
POST
|
Google-enhanced Latin speakers? Well then it's honorary/free... Also honorary for people that are old enough to have ever done GIS with freakin' punch cards, so I guess we are both covered after all... 😄 MTFBWY - I had to look that one up. I too am looking forward to that functionality. Hope the beta testers do a better job this time.
... View more
11-18-2010
05:27 PM
|
0
|
0
|
1451
|
|
POST
|
first computer science course 1968...first GIS stuff was mainframe and on cards... Mainframe? Cards? Dan, are you honestly claiming that practical experience is more important than a $500 piece of paper? If so, I hope you got my jest...
... View more
11-18-2010
04:33 PM
|
0
|
0
|
1451
|
|
POST
|
@Jim: Didn't mean to razz you too bad about "GIS in General". A little bummed that some get their suggestions acted upon right away, while others have to work a little harder and wait a bit longer. @Ryan: Dan isn't GISP certified, so go easy on him. You guys do have something in common you know... @Ted: I'm not taking credit (or the blame). I think it was the 'Yes' voters/commenters that ultimately may(?) get a Python forum created - tomorrow's the 19th right? Not that I am counting down or anything :). @Dan: Jim expressed something to the effect of he hopes everyone keeps on posting regardless of what decision he makes. If he doesn't split, I'll be kinda pissed, but I will surely still contribute. I'm sure we can all get past the outcome, regardless. I get your point about voter apathy - seems to be a common occurrence - even with the proposed Editing forum vote. Have you voted? There aren't any 'No' votes yet ;).
... View more
11-18-2010
03:24 PM
|
0
|
0
|
1451
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2014 12:57 PM | |
| 1 | 08-29-2024 08:23 AM | |
| 1 | 08-29-2024 08:21 AM | |
| 1 | 02-13-2012 09:06 AM | |
| 2 | 10-05-2010 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-30-2024
12:25 AM
|