|
POST
|
I don't believe ".lower()" can be used with the VB parser. That is Python.
... View more
10-22-2014
06:51 AM
|
1
|
1
|
2301
|
|
POST
|
I haven't tested this or even looked up the Eliminate tool, but this doesn't look quite right:
### Execute Eliminate
arcpy.Eliminate_management(in_features = "layer", out_feature_class = outputshapefile, selection = "AREA", ex_where_clause = ' "Vegetation" = 5 ')
Seems like you just need to replace with your layer variables:
### Execute Eliminate
arcpy.Eliminate_management(inputshapefile, outputshapefile, "AREA", ' "Vegetation" = 5 ')
... View more
10-10-2014
08:17 AM
|
0
|
1
|
2356
|
|
POST
|
The user "behr" is excecuting the code, but is not the admin on the PC
That is the likely culprit.
... View more
10-08-2014
06:26 AM
|
0
|
0
|
889
|
|
POST
|
Your expression was actually written for VBScript, not the Python parser. Maybe you should double-check that.
... View more
10-06-2014
01:54 PM
|
0
|
6
|
1688
|
|
POST
|
Did you set the field type to Short Integer for the Index field? I setup the same way and do not get any error.
... View more
10-06-2014
11:34 AM
|
0
|
1
|
3852
|
|
POST
|
Try to wrap your evaluation statement into quotes: If [Lin_typ] = "major" Then
... View more
10-06-2014
11:16 AM
|
0
|
3
|
3852
|
|
POST
|
ArcGIS Help 10.1 "Placing labels for contours" should do what you want.
... View more
10-06-2014
10:35 AM
|
0
|
6
|
3852
|
|
POST
|
I didn't notice any code suggesting to perform SA checkout and I why I posted. The OP was in English and a quick scan of the thread didn't show any solutions in any language -- but no, I don't speak German If the user "behr" is not actually the account executing the code then I'd think there would be permission issues.
... View more
10-02-2014
06:20 AM
|
0
|
2
|
889
|
|
POST
|
I don't see where you are checking out/in your Spatial Analyst extension.
### see if spatial analyst extension is available for use
availability = arcpy.CheckExtension("Spatial")
if availability == "Available":
arcpy.CheckOutExtension("Spatial")
arcpy.AddMessage("SA Ext checked out")
else:
arcpy.AddError("%s extension is not available (%s)"%("Spatial Analyst Extension",availability))
arcpy.AddError("Please ask someone who has it checked out but not using to turn off the extension")
return
#do your processing with SA
# check the sa extension back in
arcpy.CheckInExtension("Spatial")
... View more
10-02-2014
05:42 AM
|
0
|
0
|
3119
|
|
POST
|
Then I would seriously question the validity of the data you are being provided. If the provider cannot or will not perform a simple process (like removing leading/trailing spaces in a string field), then I would have some pause as to the correctness of the data in its entirety. Anytime a developer has to perform silly gymnastics is only compounding the potential problems and potential incorrect, inconsistent and overall poor output/results. With that said, I would suggest to go back to your OP and simplify the query to bare-bones minimum. For example I'd take this:
sql = "PRODUCER like 'A%' and (SERIES_ID is null or LENGTH(TRIM(SERIES_ID)) = 0) and SCALE > 75000"
arcpy.SelectLayerByAttribute_management(tmplyr, "NEW_SELECTION", sql)
and try this:
sql = "PRODUCER like 'A%'"
arcpy.SelectLayerByAttribute_management(tmplyr, "NEW_SELECTION", sql)
Does it work? Yes? Then expand it a bit:
sql = "PRODUCER like 'A%' AND SCALE > 75000"
arcpy.SelectLayerByAttribute_management(tmplyr, "NEW_SELECTION", sql)
No? Then something basic like "PRODUCER" is not actually a field in your in_memory fc.
... View more
10-01-2014
06:03 AM
|
0
|
0
|
1866
|
|
POST
|
I guess I don't understand why you do not actually fix the underlying problem. You have identified a need to issue TRIM(), so why don't you fix the datasource now and eliminate the need to perform this in your SQL? Also, print out the field names for the in_memory fc's your are generating. Perhaps the query fails because you are not stating the correct fields?
... View more
10-01-2014
05:08 AM
|
0
|
2
|
1866
|
|
POST
|
LTRIM() or RTRIM() would be what to use. Try:
sql = "PRODUCER like 'A%' and (SERIES_ID is null or LEN(LTRIM(RTRIM(SERIES_ID))) = 0)
... View more
09-30-2014
12:02 PM
|
0
|
6
|
3608
|
|
POST
|
" I am using a for loop to go through each row and iterating a count variable each time through the loop."
That sounds like a taxing event. Hard to tell with no code to review, but have you attempted to issue your SQL when constructing your UpdateCursor?
... View more
09-30-2014
10:09 AM
|
0
|
1
|
4096
|
|
POST
|
Curtis, In RDBMS-landia, if I have >1000 values I'd probably insert them into a temporary table of the values for my IN operator and setup a JOIN to the main table I am interested in querying. I know that doesn't specifically address your post but is likely the best solution. Or if I were in SQL Server I'd likely opt for the Table variable instead of a Temp Table.
... View more
09-30-2014
05:38 AM
|
1
|
1
|
1364
|
|
POST
|
Then you should mark Curtis' answer as the correct one because it better describes your situation and requirements to arrive at a solution. Also, it's best if you post the current code version you are stuck at in your original post so the forum members can arrive at a solution much quicker rather than having to dig out what it is you are attempting -- I couldn't quite tell what you needed to accomplish and was the reason for my questions rather than posting an actual solution or sample. Glad you figured it out.
... View more
09-30-2014
05:28 AM
|
0
|
2
|
3089
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 1 | 10-25-2022 11:46 AM | |
| 1 | 08-08-2022 01:40 PM | |
| 1 | 02-15-2019 08:21 AM | |
| 2 | 08-14-2023 07:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|