POST
|
Hi Priscilla, Thank you for the modification, it worked quite well including setting a def query before executing. And thanks for contacting ESRI about this. Best, Robert
... View more
01-07-2019
04:22 PM
|
0
|
0
|
1216
|
POST
|
Hi, thanks for replying. Sorry for the confusion. I am not using the python code to return an OID to use in a definition query. The definition query is set before the python code is used, in order to first confine the set of points I am working with. The first image that I attached to my post is an example of that confined set of points. The second image is an example of what results from using the python code on the points. You are correct in your impression of what i'd like the outcome to be. However, I do not want to select/assign all points to groups at the same time. To properly reiterate my desired outcome: I would like to randomly select some points (no greater than a max number that I define) from a specific set of points (a subset of the 27,000). Then assign that selection a label in a new field. After this, I need to repeat the process of random selection on the same initial specific set of points, but exclude those points that have already been assigned a label. Whenever I go through the process of random selection, I only wanted to work with a subset of points from the layer of 27,000. This is why I thought to use a definition query.
... View more
12-18-2018
07:06 PM
|
0
|
0
|
1216
|
POST
|
Hi everyone, I want to use definition queries with this code, taken from this ESRI page, in order to randomly select a subset of preexisting points by count: import arcpy
def SelectRandomByCount (layer, count):
import random
layerCount = int (arcpy.GetCount_management (layer).getOutput (0))
if layerCount < count:
print "input count is greater than layer count"
return
oids = [oid for oid, in arcpy.da.SearchCursor (layer, "OID@")]
oidFldName = arcpy.Describe (layer).OIDFieldName
delimOidFld = arcpy.AddFieldDelimiters (layer, oidFldName)
randOids = random.sample (oids, count)
oidsStr = ", ".join (map (str, randOids))
sql = "{0} IN ({1})".format (delimOidFld, oidsStr)
arcpy.SelectLayerByAttribute_management (layer, "", sql)
__________________________________________________________________
SelectRandomByPercent ("layer", num) The code works with a shapefile, but does not work for me with a personal geodatabase. My desired scenario with using a definition query is as follows: I have 27,000 points in one layer and 511 polygons in another. The points are draw over the polygons and are only contained within the boundaries of the polygons. Phase One: 1. I want to first filter out a subset of points, using a simple definition query (e.g. "ID = #") that is set via the layer properties 2. I want to randomly select a max number of points from the layer that has the definition query set, using the script above 3. Once that selection is made, I will assign the selected points a unique name in a field i've created. Phase Two: 1. I want to set a definition query and repeat Phase One - Step 1. with the addition of excluding the points assigned a name. Can anyone help with this? I've attached a representation of the points and polygons. Thank you Best, Robert
... View more
11-28-2018
02:10 PM
|
0
|
6
|
1549
|
POST
|
Hi Jake and Jonathan, Thanks for your replies. We are using SQL Server Express 2017 ver 14.0.1000.169 and yes to confirm: it is freezing at the Enable Geodatabase Storage operation. I've previously left it in that state for over an hour, in the seemingly unlikely event that it will restore operation, but it did not recover. I will definitely open a case with Support Services to continue this troubleshooting. Hopefully that helps. Thank you. - Robert
... View more
06-25-2018
08:23 AM
|
0
|
0
|
755
|
POST
|
Hello, I am trying to create a workgroup geodatabase by setting up a database server along with ArcGIS Server 10.6. I have SQL Server 2017. When attempting to do so via this help page and through ArcCatalog (Create a desktop or workgroup geodatabase—Database Server (Workgroup) Installation Guide | ArcGIS Enterprise) I get an error that states "Error creating this geodatabase. The application is not licensed to perform this operation." I have proceeded to run the Database Server setup wizard (Set up a database server—Database Server (Workgroup) Installation Guide | ArcGIS Enterprise) but upon setting the sql server instance and windows login, the application freezes. In brief: has anyone else had a similar experience with a enterprise workgroup license ArcGIS Server setup? How was it setup to create a editable workgroup geodatabase? Thank you - Robert
... View more
06-15-2018
08:16 AM
|
0
|
4
|
1312
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|