|
POST
|
Really? I'm aware that survey 123 can autopopulate coordinates of where you place a feature using lat/longs, but can it actually detect where you're standing and fill fields out based on that? If you've found any documentation on this subject before I'd love to read it. I can't find anything.
... View more
05-06-2019
05:09 AM
|
0
|
1
|
3959
|
|
POST
|
TLDR; will getting our SSL certificate signed by a CA fix this problem? Our server security protocol has HTTP and HTTPS enforced. I'm getting this error when trying to load a feature service from our AGS into a arcgis online map: Unable to establish a secure connection to the layer. The layer, [layername], cannot be added to the map. First, I'm a real beginner when it comes to AGS and http/https protocols. My knowledge is very limited, so bear with me. I am using AGS 10.6. I have been looking at this documentation: https://enterprise.arcgis.com/en/server/latest/administer/windows/secure-arcgis-server-communication.htm When I am on a machine that is not the server machine, I can login to our administrator but only using HTTP access (e.g. http://gisserver.domain.com:6080/arcgis/admin). I cannot access admin through HTTPS unless I am on the server machine. Our web adaptor is set up to not allow administrative access, so I know I cannot access AGS manager or admin through the web adaptor URL. When I try to reach our rest services through the web adaptor, I am able to use an HTTPS URL no problem. Anyway, once in server admin, I go to security > config like it says and the protocol is set to allow HTTP and HTTPS access. SSL protocols include TLSv1.2 and the older ones. Now, I hop over to machines > [machine name] and it says our admin URL is https://gisserver.domain.com:6443/arcgis/admin. I check that our GIS server has the correct SSL certificate is assigned, which it is and it does not expire until 2028. We created this certificate last year and I assume it is self-signed, so it's not "trusted." When I go to sign into manager on the server machine I get the warning that the site is not secure. Considering our certificate has not been signed by a CA - if we get it signed by a CA, will this allow us to access our feature services on ArcGIS online? I need to get this to work so we can start using our server services in AGOL for use in Collector.
... View more
04-26-2019
11:40 AM
|
0
|
4
|
2980
|
|
POST
|
I'm a little late to the party on this, but... I use try/except blocks where it's something the user has to fix on their end and it is something I cannot fix because I don't know the nuances in their data collection. For example, they submit to me a bunch of polygons that should be conicident with each other, but my script finds multiple large gaps (I fix small ones with the eliminate tool) between the polygons they have drawn. I cannot fix those boundaries because I do not know where those boundaries are supposed to lie; they do. This is something the user has to fix since I cannot, so I create a class for the error and create a specific error message telling them what they need to do. I don't think try/excepts are useless in all cases.
... View more
04-17-2019
09:13 AM
|
0
|
0
|
3787
|
|
POST
|
Say someone is out in the field and they're inside a specific polygon. Let's say there's a "Name" field for that polygon and the name of this specific polygon is Hawk Ridge. When they're inside the polygon and they create a new feature, the "Name" field auto-populates with "Hawk Ridge." Is that something that can be done? It's sort of like subtypes, but instead of picking the subtype out a list, you'd just populate it based on where the person is and then they could edit attributes associated with that subtype. I assume nothing like this has been implemented, but thought I'd ask.
... View more
04-17-2019
08:44 AM
|
2
|
7
|
4422
|
|
POST
|
Based on this documentation it keeps saying "enterprise geodatabase" - can you not publish feature services with file geodatabases? When I attempt to do so I get the error message in the title of this post (without the FGDB). I have turned on Feature Access for the layer and am trying to publish the layer via an admin connection to server. The layer's data source resides in a registered folder. http://desktop.arcgis.com/en/arcmap/10.3/map/publish-map-services/00134-layers-data-source-is-not-supported-feature-service.htm
... View more
04-15-2019
09:38 AM
|
1
|
7
|
8733
|
|
POST
|
Good call. I set the workspace later in the script to make the zip file. If I move it to before the creation of the relationship, then it works! Thank you so much!! You likely have saved me many hours of anguish today. New script: arcpy.env.workspace = exportPath
arcpy.CreateRelationshipClass_management(os.path.join(exportPath, "MgmtTracts"),
os.path.join(exportPath, "MgmtTractAttrb"), 'TractAttrbRelationship', 'COMPOSITE',
'Tract2Attrb', 'Attrb2Tract', 'NONE', 'ONE_TO_MANY', 'NONE', 'MgmtTractID',
'MgmtTractID')
... View more
04-11-2019
04:51 AM
|
1
|
0
|
1465
|
|
POST
|
I have two scripts; one only works in the IDE, one works fine in the IDE and Desktop but then fails when trying to run from the server. I am getting fed up with the misleading errors or non-descriptive, vague errors. First, the one that only works in the IDE and not Desktop. I keep getting an error on using the CreateRelationshipClass_management tool: ExecuteError: Failed to execute. Parameters are not valid. ERROR 000177: Relationship classes can only be created in the same database that contains the feature classes or tables The issue with this is that when I print my export paths and ensure that the things I am creating a relationship with both are in the same geodatabase, they are: C:\Users\mfoley10\Documents\ArcGIS\scratch\HabitatData.gdb\MgmtTracts C:\Users\mfoley10\Documents\ArcGIS\scratch\HabitatData.gdb\MgmtTractAttrb This is the code that is apparently causing this error: arcpy.CreateRelationshipClass_management(os.path.join(exportPath, "MgmtTracts"),
os.path.join(exportPath, "MgmtTractAttrb"), 'TractAttrbRelationship', 'COMPOSITE',
'Tract2Attrb', 'Attrb2Tract', 'NONE', 'ONE_TO_MANY', 'NONE', 'MgmtTractID',
'MgmtTractID') So what is with the error message? It makes no sense. Second script runs fine in IDE and Desktop, but fails at the server level. The only error message I get in the results window is literally "Failed." No other details, absolutely nothing. That is entirely useless. There is absolutely no reason my script should be able to run in both the IDE and Desktop and not be able to run on Server. I checked what the code looks like on server and it looks perfectly normal. When I analyze before publishing, there is nothing listed as an error or warning. I have completely deleted the service out of my Server and republished - doesn't work. Edit: Looking at the server log, there is a more descriptive error message, saying that the index is out of range for ListTableViews call on a map document that it is editing. The line of code it is erroring on has been newly added since the last publication of the GP service, so I am wondering if the map document hasn't updated to include it? The map document is located in a registered folder, so I assumed if I saved the map document on my main machine, it would update in the registered folder on the server machine automatically. Is that not the case? I can't install Desktop on the server to check, so I'm kind of SOL in terms of seeing. Edit 2: I copied the changed MXDs to the server's registered folder and the service started working. So basically, my registered folder isn't really registered even though it is validated as a data store when I check via server properties... pretty sure that's not how registered folders are supposed to work?
... View more
04-10-2019
12:32 PM
|
0
|
2
|
1567
|
|
POST
|
My code is working, but for my own edification I'm trying to understand the documentation because there's four options for adding keys and I don't really get the difference between the two origin key options and the two destination key options. https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-relationship-class.htm Right now my code uses the origin_primary_key and the destination_primary_key. I'm wondering why there is an option for an origin_foreign_key and destination one. The descriptions don't make much sense to me, for instance the origin descriptions are this: PK: The field in the origin table, typically the OID field, that links to the Origin Foreign Key field in the relationship class table. FK: The field in the relationship class table that links it to the Origin Primary Key field in the origin table. What is a "relationship class table"? Additionally, I see that both the destination keys are optional. Don't you need to have a key in the destination table to relate it the origin table? How can that be an optional parameter? I played around with the code and only used the required options (origin PK and origin FK) and it didn't seem to make a difference from when I used the origin PK and destination PK. Just curious how these are all different?
... View more
04-10-2019
08:13 AM
|
0
|
1
|
1360
|
|
POST
|
Alright, I lied; you can use fieldmappings on layers and not just feature classes. I swear I tried this before and it didn't work, but it's working now, so I must have done something wrong the first time. The problem with my original code posted above is that my tractFC doesn't actually have the joined fields, just the original fields, so when I added the feature class table to the fieldmappings object, the only fields I was trying to remove didn't exist. I changed it to my layer and it started working. Final code: arcpy.AddJoin_management(tractLyr, 'MgmtTractID', MgmtTractAttrbTV, 'MgmtTractID', 'KEEP_COMMON')
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(tractLyr)
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_OBJECTID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_MgmtTractID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_FocalRefID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_StateID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_VegMgmtPractice"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Herbicide"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_MonthTreated"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_YearTreated"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_ImplementedBy"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_FundedBy"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_FarmBillCode"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Comments"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Area_Acres"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_DateAdded"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Contract_Number"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_CLU_Number"))
arcpy.FeatureClassToFeatureClass_conversion(tractLyr, exportPath, "MgmtTracts", "#", fieldmappings)
arcpy.RemoveJoin_management(tractLyr)
... View more
04-10-2019
07:53 AM
|
0
|
0
|
3450
|
|
POST
|
fieldmappings.removeFieldMap is supposed to delete the fields unless I am mistaken. Looking at the documentation though, this seems contradictory. Does it change the input features or not?: The Field Map parameter controls how the input fields in the Input Features will be written to the Output Features. To remove fields during processing, delete output fields from theField Map. This will not affect the input. The bolded statements completely contradict each other... For what it's worth, when I do this in the GUI in Desktop, the tool does what it's supposed to do and removes all the fields I want.
... View more
04-10-2019
07:03 AM
|
0
|
0
|
3450
|
|
POST
|
Correct. The output of the join table currently looks like this (all the fields I'm trying to remove are there, I just cut it off cause it's long): I am trying to remove all those fields with the MgmtTractAttrb prefix. To do that, you first have to create a fieldmappings object. Then add the table you want to delete things from to that object. Then find and delete the field map (after you add the table to the fieldmappings object, each field in that table is automatically a field map object). The table must be a feature class or table view, not a feature layer. I have tried using a feature layer and while the script runs, none of the fields get deleted.
... View more
04-10-2019
06:29 AM
|
0
|
2
|
3450
|
|
POST
|
Can you remove a field on a joined layer? I am trying to remove some fields before exporting the dataset, but it won't allow me to do so. The fields I am attempting to remove are the joined fields. The only work around I have to this would be to create a selection on the joined layer that selects all the records, remove the join, then export the data. I cannot use Join Field because this should technically be an "invisible" join - I am only joining the tables because I need to filter the data before exporting as the original data are related tables; I don't actually need any of the joined fields in the output. mgmtJoin = arcpy.AddJoin_management(tractLyr, 'MgmtTractID', MgmtTractAttrbTV, 'MgmtTractID', 'KEEP_COMMON')
fieldmappings = arcpy.FieldMappings()
#This is the target feature class of the join. I joined a table to this feature class.
fieldmappings.addTable(tractFC)
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_OBJECTID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_MgmtTractID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_FocalRefID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_StateID"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_VegMgmtPractice"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Herbicide"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_MonthTreated"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_YearTreated"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_ImplementedBy"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_FundedBy"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_FarmBillCode"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Comments"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Area_Acres"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_DateAdded"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_Contract_Number"))
fieldmappings.removeFieldMap(fieldmappings.findFieldMapIndex("MgmtTractAttrb_CLU_Number"))
arcpy.FeatureClassToFeatureClass_conversion(tractLyr, exportPath, "MgmtTracts", "#", fieldmappings)
arcpy.RemoveJoin_management(tractLyr)
... View more
04-10-2019
05:03 AM
|
0
|
5
|
3613
|
|
POST
|
I have a polygon feature layer with a related table that holds each polygon's associated records. The two tables are related based on the MgmtTractID field. In my script, I want to be able to pull just records and their associated polygons for a certain year. So, if the year was 2010, I would set the definition expression on the table to be "FocalRefID = '{...}' and YearTreated = 2010 or FocalRefID = '{...}' and YearTreated = 2012" and then after that has been applied, I would join the result to my polygon layer to limit the polygons shown to only those that were active in 2010. When I do this manually in Desktop, it works just how I would expect. When I try to do this in python, the join results in zero polygon features and I get a DBMS error that says my feature layer doesn't exist which is perplexing... Code that doesn't work: #Create feature layers/get table
tractFC = hbMgmt_db_con + r'\HabitatManagement.DBO.MgmtTracts'
tractLyr = arcpy.MakeFeatureLayer_management(tractFC, "MgmtTracts")
tractAttrbTbl = hbMgmt_db_con + r'\HabitatManagement.DBO.MgmtAttrb'
#Do a bunch of stuff
if "MgmtTracts" in layers:
#Generate the query expression
#...
#...
#Get the appropriate records in the related table and export them to the geodatabase
tractAttrbTV = arcpy.MakeTableView_management(tractAttrbTbl, 'tractAttrbTV', expression)
arcpy.TableToTable_conversion(tractAttrbTV, exportPath, "MgmtTractAttrb")
#Use the new table view to join to the tract layer and select the polygon tracts to export
arcpy.AddJoin_management(tractLyr, "MgmtTractID", tractAttrbTV, "MgmtTractID")
arcpy.FeatureClassToFeatureClass_conversion(tractLyr, exportPath, "MgmtTracts") If I comment out the "AddJoin" line, the script runs normally and the resulting feature layer that gets exported contains all the features with no limitations put on it. If I leave the AddJoin line as is and comment out the FeatureClassToFeatureClass line, the join carries out normally, but the result is empty. If I leave both lines uncommented I get this error. Given what I just explained, I'm 99% sure this error is bogus and it does not have anything to do with my DBMS since it obviously can find the tractLyr just fine otherwise the FC2FC line would fail, even when the AddJoin line was commented out. I do not know where the 'oHabitatManagement' is coming from though. File "D:\NET_Projects\HabitatMapGPServices\ShipHabitatData\ShipHabitatData.py", line 175, in <module> arcpy.FeatureClassToFeatureClass_conversion(tractLyr, exportPath, "MgmtTracts") File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\conversion.py", line 1910, in FeatureClassToFeatureClass raise e arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Underlying DBMS error [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'oHabitatManagement'.] [DBJoin1] Underlying DBMS error [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'oHabitatManagement'.] [DBJoin1] Underlying DBMS error [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'oHabitatManagement'.] [DBJoin1] Underlying DBMS error [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'oHabitatManagement'.] [DBJoin1] The table was not found. [MgmtTracts] Failed to execute (FeatureClassToFeatureClass). UPDATE: It apparently has something to do with the query expression I create. When I changed the expression to be something much simpler (e.g. YearTreated = 2010), the code ran without issue. This is what I do to create the definition query to be applied to the table: if "MgmtTracts" in layers:
#Get FocalReferenceIDs of interest and popuplate dictionary
frIDs = {}
states = []
with arcpy.da.SearchCursor(allCIPs, ['FocalRefID', 'StateID']) as sCursor:
for row in sCursor:
frIDs[row[0]] = years
states.append(row[1])
#Initiate new list to hold expressions for final query
expSegements = []
#Create query expression with FocalReferenceIDs and years of interest
for k,v in frIDs.items():
for value in v:
expression = "FocalRefID = '" + k + "' and YearTreated = {0}".format(value)
expSegements.append(expression)
#Convert expression segments to one long string
expression = " or ".join(expSegements) The above results in a definition query being generated that looks like this: FocalRefID = '{5B61BFBB-A99A-4EB5-ABAC-89A0D143DBDD}' and YearTreated = 2009 or
FocalRefID = '{5B61BFBB-A99A-4EB5-ABAC-89A0D143DBDD}' and YearTreated = 2015 or
FocalRefID = '{A31CF0B8-68A1-4927-9A19-6232626588DD}' and YearTreated = 2009 or
FocalRefID = '{A31CF0B8-68A1-4927-9A19-6232626588DD}' and YearTreated = 2015 I'm not seeing anything wrong with that. It applied to the table just fine, it only becomes a problem when trying to join the table result to the feature layer. From what I can deduce, the problem comes at the "or" part of the statement. If I use an expression like this: FocalRefID = '{...}' and YearTreated = 2009 It'll do the job. If I extend it with an 'or' statement like this: FocalRefID = '{...}' and YearTreated = 2009 or FocalRefID = '{...}' and YearTreated = 2015 It'll fail. Is there some other way I should be building the SQL expression?
... View more
04-09-2019
11:35 AM
|
0
|
0
|
716
|
|
POST
|
Nope, it doesn't look like it, but I'm going to talk with someone else and see if he's got any ideas. The query works if it's 28 records or 30 records, but not 29. The number of characters in the whereClause variable for 28 records is 1191 and for 30 records it's 1275, so if nothing else, I can find a workaround where if the number of characters are between those two values, then I can tack on a dummy value to get it where it needs to be. I don't like this solution very much, but I've got nothing left in the arsenal.
... View more
04-03-2019
08:28 AM
|
0
|
1
|
1629
|
|
POST
|
My serverUrls are not terribly specific (we had a long thread a long time ago where we hashed it out actually ). They look like this: <!-- Testing environment -->
<ProxyConfig allowedReferers="*"
mustMatch="true"
logFile="proxyLog.txt"
logLevel="Warning">
<serverUrls>
<serverUrl url="https://www.xxx.org/xxx/rest/services/HabitatManagement/HabitatManagement/GPServer"
username="x"
password="x"
matchAll="true"/>
<serverUrl url="https://www.xxx.org/xxx/rest/services/HabitatMonitoring/HabitatData/MapServer"
username="x"
password="x"
matchAll="true" />
<serverUrl url="https://www.xxx.org/xxx/rest/services/HabitatMonitoring/HabitatClassification/GPServer"
username="x"
password="x"
matchAll="true" />
<serverUrl url="https://www.xxx.org/xxx/rest/services/PrintHabitatMaps/PrintHabitatMap/GPServer"
username="x"
password="x"
matchAll="true" />
<serverUrl url="https://www.xxx.org/xxx/rest/services/ShipData/ShipData/GPServer"
username="x"
password="x"
matchAll="true" />
</serverUrls>
</ProxyConfig> Proxy line in JS looks like this: urlUtils.addProxyRule({
urlPrefix: "https://www.xxx.org",
//When switching between testing/development, make sure the change allowedReferers, etc. in proxy.config as well
//For production environment (publishing)
//proxyUrl: "/FocalAreas/proxy/proxy.ashx"
//For testing in development environment
proxyUrl: "/proxy/proxy.ashx"
}); Just for the sake of testing, I added more dummy parameters to the end of the 2008 query and after I did that, the method is sent as POST and the data shows up as it should. //Create the definition expression
var whereClause;
for (i = 0; i < MgmtTractIDsArr.length; i++) {
if (i == 0 && i == MgmtTractIDsArr.length - 1) {
whereClause = "MgmtTractID IN ('" + MgmtTractIDsArr[i] + "')";
}
else if (i == 0) {
whereClause = "MgmtTractID IN('" + MgmtTractIDsArr[i] + "', ";
}
else if (i !== 0 && i !== MgmtTractIDsArr.length - 1) {
whereClause = whereClause + "'" + MgmtTractIDsArr[i] + "', ";
}
else {
whereClause = whereClause + "'" + MgmtTractIDsArr[i] + "'";
}
}
//Set the polygon feature layer's definition expression based on the GUIDs
var de = hbMgmtTableFL.getDefinitionExpression();
if (de == "YearTreated = 2008") {
whereClause = whereClause + "'{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}')";
}
else {
whereClause = whereClause + ')';
}
hbMgmtTractFL.setDefinitionExpression(whereClause);
hbMgmtTractFL.refresh(); The 2008 query has 29 records. The 2009 query has 24 and is sent as a GET successfully, so it must be under the character limit.
... View more
04-03-2019
04:51 AM
|
0
|
3
|
1629
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-18-2020 10:31 AM | |
| 2 | 09-16-2025 02:17 PM | |
| 3 | 09-12-2025 09:26 AM | |
| 1 | 08-16-2023 05:11 PM | |
| 1 | 02-27-2024 06:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
09-16-2025
02:16 PM
|