POST
|
Are you sure you're looking for touches and not within or contains or not disjoint? Touches only returns true if the geometry lies on the edge of the other geometry.
... View more
11-30-2010
06:16 AM
|
0
|
0
|
294
|
POST
|
STDIN is not functional in the Python window in ArcGIS 10 (the interpreter doesn't actually open stdin/stdout pipes to talk to the interpreter), and therefore input and raw_input do not work either.
... View more
11-24-2010
12:43 PM
|
0
|
0
|
546
|
POST
|
If you have records with multiple spaces this will fall down. There's an optional second argument to string.split to limit the number of splits performed: SPLIT1 = !ORIG_FIELD!.split(" ", 1)[0] #0 being the 1st word SPLIT2 = !ORIG_FIELD!.split(" ", 1)[-1] #-1 being the last word And then you may only have one token, in which case you can use a conditional variable to rightly leave the second field as blank (otherwise, [0] and [-1] will be pointing to the same index in the list, meaning both fields are populated with the same value). So a more refined version would be: SPLIT1 = !ORIG_FIELD!.split(" ", 1)[0] SPLIT2 = !ORIG_FIELD!.split(" ", 1)[1] if " " in !ORIG_FIELD! else ""
... View more
11-24-2010
10:26 AM
|
0
|
0
|
7221
|
POST
|
You'll want to use AddField to add the new field for splitting, then use two CalculateValue calls -- one to populate the new field and another to truncate down the old field into the first word.
... View more
11-24-2010
09:22 AM
|
0
|
0
|
7221
|
POST
|
if not hasattr(mxd, 'dataDrivenPages'): arcpy.AddError("No data driven pages enabled.")
... View more
11-22-2010
06:02 PM
|
1
|
0
|
226
|
POST
|
Which version of wx and Python are you using? QT with PyQT may be a more viable option, I know that behaves a lot better when embedded in apps with their own event loops.
... View more
11-21-2010
06:55 PM
|
0
|
0
|
536
|
POST
|
There are several strategies you could take here: Set up a PDF printer as the default printer on the machine, turn off the print dialog, and use the command line to call MS word with the /P flag to print your word document out to a temporary location Have a pre-prepared PDF (potentially authored with Word) with blank areas where the dynamic parts go and use ReportLab to place the additional text Put it into Dynamic Text on an MXD layout (without data frames) and export that MXD to a PDF page each time for integrating into your final PDF 3 is the easiest.
... View more
11-16-2010
02:14 PM
|
0
|
0
|
1831
|
POST
|
I think you might do well by switching your NumPy array to use memmaps -- this minimizes the amount of IPC you're going to need to do and on Linux and Windows a memory-mapped file tends to be quite a bit more efficient than manually crafted sequential I/O with serialization/deserialization across the pipe.
... View more
11-10-2010
10:30 PM
|
0
|
0
|
4574
|
POST
|
Another thing you can try is to isolate when the memory is leaking; you can monitor the process with psutil, maybe in conjunction with some additional superfluous logging in your loops to see what calls correlate with the leak and work from there.
... View more
11-10-2010
07:04 PM
|
0
|
0
|
1056
|
POST
|
print x is a syntax error in Python 3.0, so you're not future-proofing your code nearly as well as you think. Starting from 2.6, you can import print as a function from the future with from __future__ import print_function directive and use print as a 3.x style function across the board in your script.
... View more
11-03-2010
05:42 PM
|
0
|
0
|
485
|
POST
|
There is no way to do this; arcpy depends on a significant number of new 10.0 features and links against a new version of Python (2.6, will not be binary compatible with the 2.5 version installed with 9.3).
... View more
11-01-2010
03:38 PM
|
0
|
0
|
516
|
POST
|
I am using ExportToPDF in a Python script. With none of the optional parameters set, the export works great. Now I want to define some parameters to tweak the PDF file size and such. I am finding that some of the values for the 'image_compression' parameter are not available; namely JPEG and ADAPTIVE. These parameter values are not available in the Python Window in ArcGIS, and if defined in a Python script, throw errors when the script is run. I have attached a screenshot showing the available values for the 'image_compression' parameter in the Python Window in ArcGIS. Also, note in the attached screenshot that the 'jpeg_compression_quality' parameter is not even an option. Can anybody shed light on why these parameters are in the documentation but are not accessible from the Python Window or when running a Python script? Thanks in advance, Brad It's safer to use None than an empty string to specify unset parameters. It's even better to skip straight to them with named arguments e.g. arcpy.mapping.ExportToPDF(mxd, "c:\\text\\out.pdf", resolution=300, image_compression="LZW") I don't think jpeg_compression_quality is available until 10.0 SP1.
... View more
10-14-2010
10:11 AM
|
0
|
0
|
234
|
POST
|
poly_kmz = os.path.join("C:\\Craig\\Working\\07282010\\KML\\", os.path.splitext(os.path.basename(infile))[0] + '.kml')
... View more
08-24-2010
01:28 PM
|
0
|
0
|
1589
|
POST
|
In this context, it's a Python dictionary of a specific form that, from what I can tell, has the data you're going for already in a convenient format.
... View more
08-23-2010
01:54 PM
|
0
|
0
|
313
|
POST
|
You can do pnt.__geo_interface__ to get a GeoJson representation, the "coordinates" attribute of the dictionary is what you need. You can use AsShape to go the other direction.
... View more
08-23-2010
12:51 PM
|
0
|
0
|
313
|
Title | Kudos | Posted |
---|---|---|
1 | 09-26-2012 02:46 AM | |
1 | 08-13-2014 11:55 AM | |
1 | 10-29-2014 09:40 AM | |
1 | 03-25-2014 12:18 PM | |
1 | 06-08-2012 01:38 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:22 AM
|