|
POST
|
I think this is the direction I would go too. It seems unnecessary to have this in a loop. Here's my take. TID = tuple(str(i) for i in TID)
where = "{} in{}".format(TID_field, TID)
arcpy.MakeTableView_management(parcels, "parcels_tblvw", where)
arcpy.SelectLayerByAttribute_management("parcels_tblvw", "NEW_SELECTION")
... View more
01-27-2017
12:31 PM
|
0
|
0
|
2848
|
|
POST
|
I have not seen Python upgrade the license on its own. Try running something like Near that only works on an Advanced license and you should get an exception. If you verify the install on that computer is using a Basic license with ArcGIS Administrator, monitor the Availability folder in your License Manager when you start ArcMap, and get an exception when running an ArcPy tool that requires an advanced license, the only conclusion I see is that "Where Have All the Licenses Gone" is not reporting the license type correctly.
... View more
01-19-2017
03:29 PM
|
0
|
1
|
2743
|
|
POST
|
In line 36 of Xander's code where the SearchCursor is created, I think fc should be changed to tbl. However, it also looks like fld_oid is undefined on line 35; maybe should be fld_oid_in?
... View more
01-12-2017
11:03 AM
|
1
|
10
|
9030
|
|
POST
|
Ah, I forgot tuples are immutable so you can't change them; sorry! You have to convert the row tuple to a list to change it. Here's the updated code: try:
allPoints = r'\\GIS\allPoints'
whereClause = (
"RESERVOIR IN('CLEAR FORK', 'STRAWN', 'WOLFBERRY')"
" AND EUR IS NOT NULL"
" AND RESERVOIR2 IS NULL"
)
fields = [
"SHAPE@XY",
"PROPNUM",
"WellID",
"RESV_CAT",
"RESERVOIR",
"HORIZONTAL",
"EUR",
"VOOIPratio",
"fcEUR",
"RESERVOIR2"
]
with arcpy.da.SearchCursor(allPoints, fields, whereClause) as sCur:
with arcpy.da.InsertCursor(allPoints, fields) as iCur:
for row in sCur:
# Convert row tuple from search cursor to list for modifications
new_row = list(row)
# Duplicate row modifications for ATOKA
new_row[7] = 0.00425532 ## VOOIPratio
new_row[8] = row[6] * 0.00425532 ## fcEUR
new_row[9] = "ATOKA" ## RESERVOIR2
iCur.insertRow(new_row)
# Duplicate row modifications for CLFKL
new_row[7] = 0.1617021 ## VOOIPratio
new_row[8] = row[6] * 0.1617021 ## fcEUR
new_row[9] = "CLFKL" ## RESERVOIR2
iCur.insertRow(new_row)
except Exception as e:
print e
... View more
01-09-2017
10:25 AM
|
2
|
1
|
3809
|
|
POST
|
Are you referring to cbevilacqua's original script or the one I posted? I only create the cursor once before any inserts so shouldn't it miss any of the new, duplicate records it adds?
... View more
01-06-2017
07:38 AM
|
1
|
1
|
3809
|
|
POST
|
Here's my take on what I think you're trying to accomplish. It looks like your whereClause and field names are the same for both ATOKA and CLFKL so I condensed the cursors together. I also reformatted your whereClause because it looked strange. However, I'm not sure your allPoints variable is correctly pointing to a feature class. try:
allPoints = r'\\GIS\allPoints'
whereClause = (
"RESERVOIR IN('CLEAR FORK', 'STRAWN', 'WOLFBERRY')"
" AND EUR IS NOT NULL"
" AND RESERVOIR2 IS NULL"
)
fields = [
"SHAPE@XY",
"PROPNUM",
"WellID",
"RESV_CAT",
"RESERVOIR",
"HORIZONTAL",
"EUR",
"VOOIPratio",
"fcEUR",
"RESERVOIR2"
]
with arcpy.da.SearchCursor(allPoints, fields, whereClause) as sCur:
with arcpy.da.InsertCursor(allPoints, fields) as iCur:
for row in sCur:
# Duplicate row modifications for ATOKA
row[7] = 0.00425532 ## VOOIPratio
row[8] = row[6] * 0.00425532 ## fcEUR
row[9] = "ATOKA" ## RESERVOIR2
iCur.insertRow(row)
# Duplicate row modifications for CLFKL
row[7] = 0.1617021 ## VOOIPratio
row[8] = row[6] * 0.1617021 ## fcEUR
row[9] = "CLFKL" ## RESERVOIR2
iCur.insertRow(row)
except Exception as e:
print e
... View more
01-05-2017
04:27 PM
|
1
|
8
|
3809
|
|
POST
|
It took me a while to find the WKIDs so I will post here for convenience. What are projected coordinate systems?—Help | ArcGIS Desktop http://desktop.arcgis.com/en/arcmap/latest/map/projections/pdf/projected_coordinate_systems.pdf What are geographic coordinate systems?—Help | ArcGIS Desktop http://desktop.arcgis.com/en/arcmap/latest/map/projections/pdf/geographic_coordinate_systems.pdf
... View more
01-05-2017
09:23 AM
|
1
|
3
|
3454
|
|
POST
|
I don't think there's that much control over the script tool interface. I don't have a lot of experience with it though, maybe someone else knows for sure.
... View more
01-03-2017
07:09 AM
|
0
|
0
|
1552
|
|
POST
|
It's part of the validation. Understanding validation in script tools—Help | ArcGIS for Desktop Parameter objects have a Boolean enabled property Programming a ToolValidator class—Help | ArcGIS for Desktop A parameter's value property returns an object, unless the parameter isn't populated, in which case the value returns None. To safeguard against a parameter not being populated, use a if check prior to using its value. The code snippet below tests whether the value is equal to the string "Get Spatial Weights From File". This test works because the parameter data type is a string. # If the option to use a weights file is selected, enable the
# parameter for specifying the file, otherwise disable it
if self.params[3].value: # check that parameter has a value
if self.params[3].value == "Get Spatial Weights From File":
self.params[8].enabled = True
else:
self.params[8].enabled = False
... View more
12-30-2016
09:50 AM
|
1
|
4
|
1552
|
|
POST
|
Some discussion on creating paths... /blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python
... View more
12-27-2016
11:15 AM
|
1
|
0
|
1971
|
|
POST
|
To expand on what Joshua Bixby mentioned, check out Qualified Field Names (Environment setting)—Help | ArcGIS Desktop
... View more
12-27-2016
11:10 AM
|
1
|
0
|
1947
|
|
POST
|
I don't know much about SSL and certificates, but maybe you can find an answer here.
... View more
12-21-2016
07:44 AM
|
0
|
0
|
1810
|
|
POST
|
The rotate tool in edit tools will allow you to rotate features, is that what you're looking for? By the way, you've posted this in the GeoNet Help section, which is specifically for help using the GeoNet site. Tagging Managing Data for better visibility.
... View more
12-20-2016
10:32 AM
|
0
|
0
|
1692
|
|
POST
|
Here are some resources I found helpful ArcGIS REST API Quick Tips: Consuming Feature Services with Geoprocessing | ArcGIS Blog Here's the code I put together to do a simple data download. Note, this was tested with 10.2.2, which does not support resultOffset and resultRecordCount request parameters for pagination so you will be limited to 1000 records at a time. import arcpy
import urllib
def main():
svc_lyr_url = "http://somedomain.com/arcgis/rest/services/MapServiceName/MapServer/0"
where_clause = "objectid<100" ## Required
field_names = "" ## Optional "FIELD1,FIELD2,FIELD3"
# Test availability of service
try:
svc_lyr_response = urllib.urlopen(svc_lyr_url)
print svc_lyr_response
if svc_lyr_response.getcode() == 200: ## The request has succeeded
# Build and format query url
query_url = "{}/query?where={}&outFields={}&returnGeometry=true&f=json".format(
svc_lyr_url,
where_clause,
field_names,
)
try:
query_response = urllib.urlopen(query_url)
print query_response
if query_response.getcode() == 200: ## The request has succeeded
print "http code {} from {}".format(svc_lyr_response.getcode(), query_response.geturl())
# Load JSON data from query and copy to feature class
fs = arcpy.FeatureSet()
fs.load(query_url)
arcpy.env.overwriteOutput = True ## Optional
arcpy.CopyFeatures_management(fs, r"C:\temp\TEMP.gdb\SampleDownload")
print arcpy.GetMessages()
else:
response_msg = "http code {} from {}".format(
query_response.getcode(),
query_response.geturl()
)
raise Exception(response_msg)
finally:
query_response.close()
else:
response_msg = "http code {} from {}".format(
svc_lyr_response.getcode(),
svc_lyr_response.geturl()
)
raise Exception(response_msg)
finally:
svc_lyr_response.close()
if __name__ == '__main__':
main()
... View more
12-19-2016
07:37 AM
|
0
|
0
|
4185
|
|
POST
|
Haha, sorry! I was making a joke about the repeated occurrences of "Human feces all over sign" in your posts. My apologies for any insult taken. My suggestions are honest though, I really think you should try adding some HTML formatting to style the email.
... View more
12-19-2016
07:16 AM
|
1
|
0
|
2563
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |