|
POST
|
The triple quotes ensure everything inside is a string so you don't have to use escape characters when you want to use multiple quotations inside your string. You can pass variables to it using standard string substitution just like any other string, though it wouldn't be necessary. """{0}""".format(some_variable)
... View more
02-27-2013
04:18 AM
|
0
|
0
|
1107
|
|
POST
|
You are using personal geodatabase syntax on a shapefile. Try this. """"PARCEL_SPI" = '2003\PP2679'""" If you are still having issues try making your selection manually in ArcMap using select by attributes and copy the syntax that works there.
... View more
02-26-2013
12:16 PM
|
0
|
0
|
1107
|
|
POST
|
Is there some particular functionality of DDP you need? Are you getting any errors with the new code you were running?
... View more
02-26-2013
12:13 PM
|
0
|
0
|
2467
|
|
POST
|
I'm afraid I don't follow. What are you using data driven pages for if not for multiple page exports? Could you not just use the default ExportToPDF function in that case?
... View more
02-26-2013
10:50 AM
|
0
|
0
|
2467
|
|
POST
|
It should be able to handle a list of mxd paths to process on. As long as they all have DDP enabled.
... View more
02-26-2013
07:02 AM
|
0
|
0
|
2467
|
|
POST
|
That is quite a few points to get through but should be doable. Is this something you will be doing with some frequency? If so you would definitely want to write a script for it, however basic. If it is something you want to optimize and/or will be doing quite often you can get right down to the math and bypass arcpy completely (albeit reinventing the wheel a bit). It follows the concept of the Jordan curve theorem to determine whether a point is inside or outside a polygon. You can utilize the code for the even-odd rule here to get started. http://en.wikipedia.org/wiki/Even-odd_rule
... View more
02-26-2013
06:50 AM
|
0
|
1
|
4478
|
|
POST
|
Is there some reason Spatial Join doesn't work for you?
... View more
02-26-2013
06:08 AM
|
1
|
0
|
4478
|
|
POST
|
You are inserting a list into a list. Get rid of the list brackets in your sendmail call. TO = ['[email protected]','[email protected]','[email protected]'] ... server.sendmail(FROM, TO, BODY) # not [TO] As an aside, there is no need to replicate so much code. Something like this would be cleaner and a step in the direction of pythonic. def emailNotify(SUBJECT, text): print 'Changes detected. Sending email.' TO = ['[email protected]','[email protected]','[email protected]'] FROM = '[email protected]' BODY = string.join(( "From: %s" % FROM, "To: %s" % TO, "Subject: %s" % SUBJECT , "", text ), "\r\n") server = smtplib.SMTP('00.0.0.0') #removed actual server name for security server.sendmail(FROM, [TO], BODY) server.quit() print ("Email sent!") if truecount > 0: print('Changes detected. Sending email.') subject = 'CHANGE HAS OCCURED IN THE STREETS DATABASE' message = 'BREAKING NEWS! The program has detected a change has occurred in the Public Works street spatial database since the last comparison.' else: print('No changes detected. Sending email.') subject = 'No change in the streets datebase' message = 'The program has determined that no change has occurred in the Public Works street spatial database since the last comparison.' emailNotify(subject, message)
... View more
02-25-2013
12:58 PM
|
0
|
0
|
3297
|
|
POST
|
What data types are you passing as parameters? You may want to consider using astext instead of parameter. arcpy.GetParameterAsText() I'd wager your problem as more to do with your latField variable than your latTemp variable.
... View more
02-25-2013
09:18 AM
|
0
|
0
|
1977
|
|
POST
|
I assume it is this line you are having the problem with? arcpy.CalculateField_management(fc, latTemp, latField, "PYTHON") Have you tried doing that manually in ArcMap to see if your results vary?
... View more
02-25-2013
09:01 AM
|
0
|
0
|
1977
|
|
POST
|
The built in PointsToLine tool supports Z values. You just need to create a point layer/featureclass as input.
... View more
02-25-2013
07:44 AM
|
0
|
0
|
994
|
|
POST
|
How many features are you going to be going through? Is this a process you will be doing often or rarely? Depending on this you could read out the entire dataset to a dictionary using a search cursor then use an update cursor on the rows you want to transfer the values to. This would probably be the fastest method if a bit memory intensive depending on the size of your dataset. If that isn't the route you want to take you could use nested cursors as you described in your title. This may be one of the few cases it might make sense to use nested cursors if this is a process you rarely do and/or you are dealing with a very large dataset with many row pairs you need to read and write.
... View more
02-25-2013
05:58 AM
|
0
|
0
|
661
|
|
POST
|
What specifically is the error you are getting? Have you tried printing out the values of mxdPath and mxdList to see if they are indeed what you want? You can give this a try. for mxdPath in mxdList:
arcpy.AddMessage(mxdPath)
if os.path.exists(mxdPath):
mxd = arcpy.mapping.MapDocument(mxdPath)
#name = mxdPath[:-4] + ".pdf"
name = mxdPath.replace('.mxd', '.pdf', -1)
file = dir + os.sep + os.path.basename(name)
ddp = mxd
ddp.exportToPDF(file, "ALL") Also remember to use tags when posting code to retain indentation.
... View more
02-25-2013
04:22 AM
|
0
|
0
|
2467
|
|
POST
|
Did you try this? df.extent = helkalyr.getSelectedExtent()
... View more
02-25-2013
04:15 AM
|
0
|
0
|
2583
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|