|
POST
|
Disclaimer: not exactly sure I'll describe this right, but here's how I imagine it happening. Your script executes through Python one line at a time. Line 1 is a comment, Line 2 assigns some value to a variable named mapName, etc. Line 7 assigns a string to a variable named codeBlock. It does not execute the code within that string. I repeat, this is just a string. Line 14 is where all the previous lines come together. Everything is packaged up and sent, somewhat blindly, to a new Python interpreter (not totally sure how to explain this). Everything in codeBlock is sent together. No substitution happened in the codeBlock string. This new Python instance does have the scope to access your main script. It is a separate thing. Once it's done it's thing, it will disappear and return to your original script. In the end, you should be able to solve your problem by substituting the value of the region variable into the codeBlock variable before sending it to CalculateField. Something like: codeBlock = """def Reclass (CUSTNodeID, CUSTRegion):
if CUSTNodeID != None:
return " + region + "
else:
return None"""
... View more
07-01-2015
11:33 AM
|
2
|
9
|
6400
|
|
POST
|
Convince yourself that this is corrupt by trying to open the .prj file in a text editor. It should be well-known text. It isn't.
... View more
07-01-2015
10:52 AM
|
1
|
1
|
903
|
|
POST
|
It sounds like you have two issues: 1.) Your numeric field is actually storing more digits than 6, so trying to jam it directly into a string field of length 6 will result in truncation, and/or warnings. 2.) Your expression depends on which parser you use TL;DR - use the round() function, regardless of parser. Say you have some numbers in a double field that are set to display zero decimal places: As Ian Murray describes, the field still holds values: VB Script parser: Expression: [POINT_X] Result: Truncation (warning) Expression: int( [POINT_X] ) Result: Incorrect rounding (truncation) Expression: round( [POINT_X] ) Result: Success! Python Parser: Expression: !POINT_X! Result: Incorrect rounding (truncation) Expression: int(!POINT_X!) Result: Incorrect rounding (truncation) Expression: round( !POINT_X! ) Result: Success!
... View more
07-01-2015
10:31 AM
|
1
|
1
|
1283
|
|
POST
|
Just to expand on Melita Kennedy's comment, you can shift the CRS over by changing the central meridian parameter and saving as a custom projection, in the Data Frame Properties. Original (using Web Mercator, but you can change any CRS): Change CRS in Data Frame Properties: Final:
... View more
06-30-2015
04:20 PM
|
4
|
2
|
2881
|
|
POST
|
Do they work in a new mxd? If not, does it help to reset your Normal.mxt (see bottom of this page)?
... View more
06-30-2015
09:55 AM
|
0
|
1
|
4996
|
|
POST
|
Since this is not ArcGIS-specific, you'll have better luck getting an answer on GIS StackExchange. I will also say, when you post this over there, you should expand on your problem. I'm not sure what your question is.
... View more
06-29-2015
01:50 PM
|
0
|
0
|
1037
|
|
POST
|
Use Spatial Join to assign the line ID of the nearest line to each track fault (are these points?). Then, Summary Statistics to get the count for each line.
... View more
06-26-2015
01:30 PM
|
0
|
1
|
818
|
|
POST
|
I hope you're not including those Google Earth images in your reports, without proper permission. If you do have permission, I'd be interested to know.
... View more
06-26-2015
09:51 AM
|
1
|
3
|
9770
|
|
POST
|
I haven't come across any way to extract feature class size from within a FGDB using Python, directly. The best workaround I found was to create a new FGDB, copy over each feature class one by one, and monitor the size of the entire FGDB.
... View more
06-26-2015
09:40 AM
|
2
|
0
|
2412
|
|
POST
|
Extract Values to Points will assign the raster values to the points.
... View more
06-26-2015
08:56 AM
|
2
|
3
|
2863
|
|
POST
|
If you're only dealing with points to raster, you can use Extract to Points http://resources.arcgis.com/en/help/main/10.1/index.html#//009z0000002t000000
... View more
06-25-2015
08:21 PM
|
0
|
1
|
911
|
|
POST
|
Does it work if you delete the word "to"? I'm guessing they meant it to be <a title="Zoom to" class=...
... View more
06-25-2015
02:08 PM
|
0
|
4
|
2023
|
|
POST
|
Have you ensured that your poorly behaving polygons aren't multipart, with a part outside your buffer? Select a polygon and zoom to selected to make sure.
... View more
06-25-2015
01:11 PM
|
1
|
1
|
2439
|
|
POST
|
Sure, you can play around with .replace(). This will replace all " & " with "-", stored in variable newString: ...
for row in cursor:
newString = row[1].replace(" & ", "-")
... View more
06-25-2015
10:04 AM
|
0
|
0
|
546
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|