|
POST
|
If I'm wanting to modify/build on an existing WAB widget but keep my custom code in a separate file from the existing widget's widget.js, would it be common practice to put it in Utils.js, and do something like ... define([
...,
'./Utils',
...
], function(..., myUtils,
...) {
myUtils.foo(...);
} ... to access any methods defined in Utils.js? I've seen use of Utils.js but haven't had a need to ask what it's doing, so I could be completely wrong. Learning Javascript a mountain building speed.
... View more
08-11-2020
03:06 PM
|
0
|
2
|
1088
|
|
POST
|
Did you see this? Error: DBMS table not found [ORA- 00942 : table or view does not exist]
... View more
08-11-2020
01:15 PM
|
1
|
1
|
1433
|
|
POST
|
How about wrapping the whole if/then in a try/except?... If something goes wrong, you can send yourself an email.
... View more
08-11-2020
09:57 AM
|
1
|
0
|
4083
|
|
POST
|
Assuming the original question was address a while back. So Daryl Hochhalter ... I've run into various issues with this but ultimately got it working and now have scheduled tasked for arcpy jobs running on Win Server. Typically I have found: Use a service account to run the job. Make sure service account has logon as service privileges. Make sure the service account get can a Pro license (named or concurrent, depending on your version of Pro) Start up ArcGIS Pro at least once using the service account to set up that account's environment. Make sure you can import arcpy when running the script manually. Make sure you're Python path is correct or you put in the whole path to the conda Python install in any batch files that gets executed in task scheduler. Don't forget about this process when you upgrade/change license servers or make Portal changes.
... View more
08-11-2020
06:38 AM
|
1
|
1
|
1929
|
|
POST
|
Sounds like you got it working then? For me the following works ... conda create --clone arcgispro-py3 --name arcgispro-clone I don't clone my environments very often, so I'm not sure how many others way to do this there are. The export route works for me when I try this: # Pick the environment to clone
activate <your-environment>
# Dump the environment into a file
conda env export > c:\temp\test.yaml
# Create new environment from that file
conda env create --file c:\temp\test.yaml -n test
... View more
08-10-2020
05:21 PM
|
0
|
1
|
1142
|
|
POST
|
You're referring to checking If the name value is equal to the longName value, the layer is not inside a group layer. No, I didn't even catch that... I'll take a look. But it still doesn't explain how you're supposed to use isGroupLayer. Thanks, Dan.
... View more
08-10-2020
02:26 PM
|
0
|
0
|
2117
|
|
POST
|
Working with arcpy for ArcGIS Pro and trying to manipulate a map in APRX project before converting to PDF. Just stumbled across my own post from earlier in the year... How to reorder/add/remove layers APRX map programmatically? So maybe I'm still not understanding something or there is something wrong. I'm trying to do something similar to what's explained in the post about flattening Group Layers for MXD. But a group layer set up in ArcGIS Pro 2.5 will return ... map.listLayers('My Group Layer').isGroupLayer
>>> False To me the group layer should be the 'Parent' as it is in ArcMap or Pro, so the parent should return isGroupLayer = True. Even assuming that arcpy considers the 'Child' the GroupLayer,for me isGroupLayer return 'False' for any/all layers in the map. At the same time, the layer behaves like it's a GroupLayer. Setting childLayer.visible = True ...automatically makes the parent visible, too. Is the property isGroupLayer not working correctly, or at least not working as described here - Layer—ArcGIS Pro | Documentation ? Ultimately I'm trying to hide the Group Layer name from the Legend. This can be accomplished in Pro but I'm looking for a way to do this in Python and don't see anything the documentation for LegendElement—ArcGIS Pro | Documentation.
... View more
08-10-2020
12:37 PM
|
0
|
2
|
2176
|
|
POST
|
Are you mixing lower case "x" and "y" with uppercase "X" and "Y" throughout the code, including in the mapping?
... View more
07-29-2020
06:49 AM
|
0
|
0
|
3066
|
|
POST
|
Not sure about your specific error... I've seen something similar when the order of function arguments does not match the order of require arguments. But that seems to be correct. Is there a reason why you can't reference the CDN version of JSAPI? When I try the following, which is similar to your examples, it works" <html>
<head>
...
// Reference the JSAPI here
<script src="https://js.arcgis.com/4.16/"></script>
<script>
// Only reference module names not the full path like you did
require([
"esri/portal/PortalItem",
"esri/WebMap",
"esri/views/MapView",
], function (
PortalItem,
WebMap,
MapView
) {
// Grab anitem from your Portal
var portalitem = new PortalItem({
id: "< some item Id >",
portal:"<my own portal URL >"}
);
portalitem.load();
// Create a web map with that item
var webmap = new WebMap({
portalItem: portalitem
});
// Crwate a view to hold the map
var view = new MapView({
map: webmap, // The WebMap instance created above
...
});
});
</script>
</head>
<body>
<div id="viewDiv"</div>
</body>
</html>
Not saying what you tried can't work but the above looks more familiar to me.
... View more
07-24-2020
02:52 PM
|
1
|
1
|
1132
|
|
POST
|
What I have done in the past and seen explained elsewhere is going to the services directories on the machine your GIS Server is installed on. That's provided you have access to that. Typically you will find the path to the original MXD there: EXAMPLE \<arcgisserver_install_dir>\directories\arcgissystem\arcgisinput\<service_folder>\<service_name>.MapServer\extracted\manifest.json JSON would look something like this: {"databases":[{
"byReference":true,
"onServerWorkspaceFactoryProgID":".,...",
"onServerConnectionString":"....",
"onServerName":"....",
"onPremisePath":"",
"datasets":[{"onServerName":" ...."}]
}],
"resources":[{"onPremisePath":"<<<<<<<path to .MXD file>>>>>>>",
"clientName":"....",
"serverPath":"<path to .msd file>"}
]}
... View more
07-24-2020
11:54 AM
|
1
|
1
|
6107
|
|
POST
|
Full disclosure, I don't know too much about the exact commands or the nature of field mapping syntax you're using but - just off the cuff - the following looks like it could use some quotes and commas around various parameters... e.g. "true true true" looks weird field_mapping="BUSINESS_NO \"BUSINESS_NO\" true true false 4 Long 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,BUSINESS_NO,-1,-1;SITE_APN \"SITE_APN\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,SITE_APN,0,8000;COMPANY \"COMPANY\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,COMPANY,0,8000;LOC_ADDRESS1 \"LOC_ADDRESS1\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,LOC_ADDRESS1,0,8000;INSPECTIONTYPE \"INSPECTIONTYPE\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,INSPECTIONTYPE,0,8000;INSPECTOR \"INSPECTOR\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,INSPECTOR,0,8000;BUS_LIC_NO \"BUS_LIC_NO\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,BUS_LIC_NO,0,8000;STATUS \"STATUS\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,STATUS,0,8000;LATEST_REVIEW_DATE \"LATEST_REVIEW_DATE\" true true false 8 Date 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,LATEST_REVIEW_DATE,-1,-1;LATEST_SCORE \"LATEST_SCORE\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,LATEST_SCORE,0,8000;RECORDID \"RECORDID\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,RECORDID,0,8000;PREVIOUS_REVIEW_DATE \"PREVIOUS_REVIEW_DATE\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,PREVIOUS_REVIEW_DATE,0,8000;PREVIOUS_SCORE \"PREVIOUS_SCORE\" true true false 8000 Text 0 0,First,#,
P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,PREVIOUS_SCORE,0,8000"
... View more
07-24-2020
11:38 AM
|
0
|
0
|
1438
|
|
POST
|
import arcpy
def Model(): # Model
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = True
restaurant_scores_csv = "P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv"
ReastaurantInspections_gdb = "C:\\arcgisserver\\arcgisresources\\Code\\ReastaurantInspections.gdb"
CompositeSubStreet_loc = "S:\\Police\\GIS\\AddressLocators\\CompositeSubStreet.loc"
# Process: Table To Table (Table To Table)
Scores = arcpy.TableToTable_conversion(in_rows=restaurant_scores_csv, out_path=ReastaurantInspections_gdb, out_name="Scores", where_clause="", field_mapping="BUSINESS_NO \"BUSINESS_NO\" true true false 4 Long 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,BUSINESS_NO,-1,-1;SITE_APN \"SITE_APN\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,SITE_APN,0,8000;COMPANY \"COMPANY\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,COMPANY,0,8000;LOC_ADDRESS1 \"LOC_ADDRESS1\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,LOC_ADDRESS1,0,8000;INSPECTIONTYPE \"INSPECTIONTYPE\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,INSPECTIONTYPE,0,8000;INSPECTOR \"INSPECTOR\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,INSPECTOR,0,8000;BUS_LIC_NO \"BUS_LIC_NO\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,BUS_LIC_NO,0,8000;STATUS \"STATUS\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,STATUS,0,8000;LATEST_REVIEW_DATE \"LATEST_REVIEW_DATE\" true true false 8 Date 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,LATEST_REVIEW_DATE,-1,-1;LATEST_SCORE \"LATEST_SCORE\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,LATEST_SCORE,0,8000;RECORDID \"RECORDID\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,RECORDID,0,8000;PREVIOUS_REVIEW_DATE \"PREVIOUS_REVIEW_DATE\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,PREVIOUS_REVIEW_DATE,0,8000;PREVIOUS_SCORE \"PREVIOUS_SCORE\" true true false 8000 Text 0 0,First,#,P:\\GIS\\Brad Simpson\\Python\\restaurant_scores.csv,PREVIOUS_SCORE,0,8000", config_keyword="")[0]
# Process: Geocode Addresses (Geocode Addresses)
Scores_Geocoded = "C:\\arcgisserver\\arcgisresources\\Code\\ReastaurantInspections.gdb\\Scores_Geocoded"
arcpy.GeocodeAddresses_geocoding(in_table=Scores, address_locator=CompositeSubStreet_loc, in_address_fields="'Single Line Input' LOC_ADDRESS1 VISIBLE NONE", out_feature_class=Scores_Geocoded, out_relationship_type="STATIC", country=[], location_type="", category=[])
# Process: Add Field (Add Field)
Scores_Geocoded_2_ = arcpy.AddField_management(in_table=Scores_Geocoded, field_name="establishmentname", field_type="TEXT", field_precision=None, field_scale=None, field_length=200, field_alias="Establishment Name", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (2) (Add Field)
Scores_Geocoded_3_ = arcpy.AddField_management(in_table=Scores_Geocoded_2_, field_name="address", field_type="TEXT", field_precision=None, field_scale=None, field_length=200, field_alias="Full Address", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (3) (Add Field)
Scores_Geocoded_4_ = arcpy.AddField_management(in_table=Scores_Geocoded_3_, field_name="identifier", field_type="TEXT", field_precision=None, field_scale=None, field_length=50, field_alias="Identifier", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (4) (Add Field)
Scores_Geocoded_5_ = arcpy.AddField_management(in_table=Scores_Geocoded_4_, field_name="permnum", field_type="TEXT", field_precision=None, field_scale=None, field_length=50, field_alias="Permit Number", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (5) (Add Field)
Scores_Geocoded_6_ = arcpy.AddField_management(in_table=Scores_Geocoded_5_, field_name="inspdate", field_type="DATE", field_precision=None, field_scale=None, field_length=50, field_alias="Inspection Date", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (6) (Add Field)
Scores_Geocoded_11_ = arcpy.AddField_management(in_table=Scores_Geocoded_6_, field_name="latestscore", field_type="TEXT", field_precision=None, field_scale=None, field_length=100, field_alias="Latest Score", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (7) (Add Field)
Scores_Geocoded_8_ = arcpy.AddField_management(in_table=Scores_Geocoded_11_, field_name="PreviousTempDate", field_type="TEXT", field_precision=None, field_scale=None, field_length=50, field_alias="Previous Inspection Date", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Add Field (8) (Add Field)
Scores_Geocoded_7_ = arcpy.AddField_management(in_table=Scores_Geocoded_8_, field_name="previnspscore", field_type="TEXT", field_precision=None, field_scale=None, field_length=50, field_alias="Previous Inspection Score", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")[0]
# Process: Calculate Field (Calculate Field)
Scores_Geocoded_9_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_7_, field="establishmentname", expression="!USER_COMPANY!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (2) (Calculate Field)
Scores_Geocoded_18_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_9_, field="address", expression="!USER_LOC_ADDRESS1!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (3) (Calculate Field)
Scores_Geocoded_12_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_18_, field="identifier", expression="!USER_INSPECTOR!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (4) (Calculate Field)
Scores_Geocoded_10_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_12_, field="inspdate", expression="!USER_LATEST_REVIEW_DATE!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (5) (Calculate Field)
Scores_Geocoded_13_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_10_, field="latestscore", expression="!USER_LATEST_SCORE!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (6) (Calculate Field)
Scores_Geocoded_14_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_13_, field="PreviousTempDate", expression="!USER_PREVIOUS_REVIEW_DATE!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (7) (Calculate Field)
Scores_Geocoded_15_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_14_, field="permnum", expression="!USER_BUS_LIC_NO!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Calculate Field (8) (Calculate Field)
Scores_Geocoded_16_ = arcpy.CalculateField_management(in_table=Scores_Geocoded_15_, field="previnspscore", expression="!USER_PREVIOUS_SCORE!", expression_type="PYTHON3", code_block="", field_type="TEXT")[0]
# Process: Delete Field (Delete Field)
Scores_Geocoded_17_ = arcpy.DeleteField_management(in_table=Scores_Geocoded_16_, drop_field=["Loc_name", "Status", "Score", "Match_type", "Match_addr", "User_fld", "Addr_type", "Side", "IN_SingleLine", "USER_BUSINESS_NO", "USER_SITE_APN", "USER_COMPANY", "USER_LOC_ADDRESS1", "USER_INSPECTIONTYPE", "USER_INSPECTOR", "USER_BUS_LIC_NO", "USER_STATUS", "USER_LATEST_SCORE", "USER_LATEST_REVIEW_DATE", "USER_RECORDID", "USER_PREVIOUS_REVIEW_DATE", "USER_PREVIOUS_SCORE"])[0]
if __name__ == '__main__':
# Global Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\pforrest\Documents\ArcGIS\Projects\Restaurant Inspections\Restaurant Inspections.gdb", workspace=r"C:\Users\pforrest\Documents\ArcGIS\Projects\Restaurant Inspections\Restaurant Inspections.gdb"):
Model() Check out the name of your GDB... # this is line 9
ReastaurantInspections_gdb =
"C:\\arcgisserver\\arcgisresources\\Code\\ReastaurantInspections.gdb"
# this is line 72
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\pforrest\Documents\ArcGIS\Projects\Restaurant Inspections\Restaurant Inspections.gdb", workspace=r"C:\Users\pforrest\Documents\ArcGIS\Projects\Restaurant Inspections\Restaurant Inspections.gdb"):
Model() Do both lines need to point to the same GDB?
... View more
07-24-2020
11:21 AM
|
0
|
2
|
1438
|
|
POST
|
Hey David, Appreciate you chiming in ... I'll check out the link you sent. But still hope to hear from a customer. If you were willing to put me in touch with a customer directly, I'd take you up on that as well. Arne
... View more
07-24-2020
07:20 AM
|
0
|
0
|
2157
|
|
POST
|
Looks to me like the default for "wait' is True, so you really shouldn't need it. Documentation says it's a Boolean, so I'd drop the quotes around True. item.export (..., wait = True, ...)
... View more
07-23-2020
03:40 PM
|
2
|
2
|
2906
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-16-2025 07:32 AM | |
| 1 | 02-09-2024 05:18 PM | |
| 1 | 02-04-2025 09:27 AM | |
| 1 | 03-22-2019 10:55 AM | |
| 1 | 03-05-2020 08:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|