|
POST
|
I get arr = TableToNumPyArray(fc, "*") TypeError: long() argument must be a string or a number, not 'NoneType'
... View more
02-08-2021
06:34 PM
|
0
|
1
|
1563
|
|
POST
|
Maybe I'm missing the obvious, but when I run and print the suggested solution I don't see unique dates. That is, I get this: [
{
"start": "2020-05-27 23:44:17",
"guid": "{A6618411-6CF7-4D7C-9D11-C6F73AC6BC1B}",
"end": "2020-05-28 05:22:50"
},
{
"start": "2020-05-27 23:44:17",
"guid": "{A6618411-6CF7-4D7C-9D11-C6F73AC6BC1B}",
"end": "2020-05-28 05:22:50"
},
{
"start": "2020-05-27 23:44:17",
"guid": "{A6618411-6CF7-4D7C-9D11-C6F73AC6BC1B}",
"end": "2020-05-28 05:22:50"
},
{
"start": "2020-06-04 00:19:40",
"guid": "{8C6FCDEC-4BF1-4A71-8479-2925952A0993}",
"end": "2020-06-04 04:23:58"
},
{
"start": "2020-06-04 00:19:40",
"guid": "{8C6FCDEC-4BF1-4A71-8479-2925952A0993}",
"end": "2020-06-04 04:23:58"
},
{
"start": "2020-06-04 00:19:40",
"guid": "{8C6FCDEC-4BF1-4A71-8479-2925952A0993}",
"end": "2020-06-04 04:23:58"
}
] But I need this: [
{
"start": "2020-05-27 23:44:17",
"guid": "{A6618411-6CF7-4D7C-9D11-C6F73AC6BC1B}",
"end": "2020-05-28 05:22:50"
},
{
"start": "2020-06-04 00:19:40",
"guid": "{8C6FCDEC-4BF1-4A71-8479-2925952A0993}",
"end": "2020-06-04 04:23:58"
}
]
... View more
02-08-2021
06:07 PM
|
0
|
3
|
5762
|
|
POST
|
I'm not getting a unique list of StartSurvey and EndSurvey values. Can you point out where this is supposed to happen in your example. Thanks!
... View more
02-08-2021
05:48 PM
|
0
|
1
|
5791
|
|
POST
|
I need create a list of unique values from multiple date columns ("startSurvey" and "EndSurvey")...(I guess a list of lists is fine as long as I can iterate over it and grab the 2 unique values). In the end, I am trying to build sql for a separate SearchCursor. The desired result of the example needs to be: [[StartSurvey: 6/5/2020 12:21:19 AM, EndSurvey: 6/5/2020 12:35:32 AM, [StartSurvey: 6/11/2020 12:42:05 AM, EndSurvey: 6/11/2020 5:13:18 AM]] It doesn't necessarily have to be list of lists like this, but in some way that I can easily iterate over it to grab the unique StartDate/EndDate valules.
... View more
02-08-2021
05:07 PM
|
0
|
13
|
7355
|
|
POST
|
I will go ahead and mark as the solution because it appears to work as intended and I am running into another issue that needs resolved in order to actually implement this. Thanks again!
... View more
02-08-2021
04:44 PM
|
0
|
0
|
2793
|
|
POST
|
very promising. ...and simple. Love that. Let me give it a go and check back but def looks preferable to nested cursors. Thanks, j
... View more
02-08-2021
02:50 PM
|
0
|
0
|
2800
|
|
POST
|
I'm also incorrectly implementing cursor.next() It seems each time that is invoked it immediately skips to the next row. I'm not exactly sure how best to get the values for row n and n+1 WHILE the current row is at n.
... View more
02-08-2021
02:16 PM
|
0
|
0
|
2805
|
|
POST
|
right... I think that's my problem: I cannot update row[n+1] rather than the current row.
... View more
02-08-2021
01:35 PM
|
0
|
1
|
2812
|
|
POST
|
if the rows oid=1 and oid=5 (see image in op) are the 2 rows being evaluated and elapsedSeconds calculated, does your suggestion update row OID=5? In the image OID=1 should be 0.00 seconds and OID=5 should be 5.00 seconds Thanks!
... View more
02-08-2021
12:57 PM
|
0
|
3
|
2818
|
|
POST
|
FileGDB ArcGIS 10.4 Need to calculate elapsedSeconds column by first sorting on location_timestamp and then evaluate if PEP_land_name matches in row[n] and row[n+1]. If true, then set row[n+1] to elapsedSeconds value. fields = ['PEP_land_name','location_timestamp','elapsedSeconds']
with arcpy.da.UpdateCursor(tracksToProcMonth, fields, sql, sql_clause=(None, 'ORDER BY location_timesatmp ASC')) as u_cur:
with arcpy.da.SearchCursor(tracksToProcMonth,fields, sql, sql_clause=(None, 'ORDER BY location_timestamp ASC')) as cursor:
for row in cursor:
firstlLand = row[0]
firstTimestamp = row[1]
try:
nextLand = cursor.next()[0]
nextTimestamp = cursor.next()[1]
if firstlLand == nextLand:
tdt = nextTimestamp - firstTimestamp
totSecs = tdt.total_seconds()
print 'totSecs: {}'.format(totSecs)
u_row = totSecs
u_cur.updateRow()
else:
totSecs = 0.00
u_row = totSecs
u_cur.updateRow() I seem to be close in that I can arrive at the correct sort and evaluation, but I'm not exactly sure what to do about the updateCursor and setting the elapsedSeconds value in row[n+1]. In the attached image, OID 1 elapsedSeconds would be 0, OID 5 would be 5, and so on and on...
... View more
02-08-2021
12:10 PM
|
0
|
10
|
3294
|
|
POST
|
I think I got it. Instead of adding a New FeatureLayer, I simply needed to get a reference to the desired operationalLayer. But one missing thing was to make sure the reference on the opLayer object's "layerObject" and not just the layer itself. From this function the selection is performed using the geometry of the extent drawn. However, I am setting the reference to this.selectionLayer in another function that controls layer visibility by the user. selectParcelsFromExtent: function (drawResults) {
var extent = drawResults.geometry;
var query = new Query();
query.geometry = extent;
this.selectionLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW);
var selectedFeatures = this.selectionLayer.getSelectedFeatures();
for (var i in selectedFeatures) {
console.log("Asset Name: " + selectedFeatures[i].attributes.NAME)
}
}, A different function provides user interaction with the various operationalLayers from the webmap source (don't ask, there's a ton of layers and this just allows for easy display that makes sense). In any event, I am setting that this.selectedFeatures reference at this level which makes a lot of sense for UI flow: _operLayers = this.map.itemInfo.itemData.operationalLayers;
array.map(_operLayers, lang.hitch(this, function (lyr) {
if (lyr.layerObject) {
if (lyr.title === "Alert 24hr - Hydraulic Element Set (Active)") {
if (chkHES == true && selectedAlertValue === "Active24") {
lyr.layerObject.setVisibility(true);
lyr.visibility = true;
this.selectionLayer = lyr.layerObject;
}
else if (chkHES == true && selectedAlertValue === "All24") {
lyr.layerObject.setVisibility(true);
lyr.visibility = true;
}
else {
lyr.layerObject.setVisibility(false);
lyr.visibility = false;
}
}
... View more
01-13-2021
10:09 AM
|
0
|
0
|
980
|
|
POST
|
I'm looking for simple example to select features of an operationalLayer by dragging an extent box. I'm attempting to build a new widget with a button that will activate the drawtool and allow the user to drag a box to select features and deactivate when completed. Javascript API 3x Edit to add current code. div on the widget's html: <div class="jimu-btn finish-select" data-dojo-attach-event="click:activateAcknowledgeTool" id="btnActivateSelection">Activate</div> activateAcknowledgeTool: function () {
if (!this.drawToolbar) {
this.setupDrawToolbar();
}
this.enableDrawToolbar();
},
setupDrawToolbar: function () {
this.createDrawToolbar();
this.setupDrawToolbarListener();
},
createDrawToolbar: function () {
this.drawToolbar = new Draw(this.map, { showTooltips: false });
},
setupDrawToolbarListener: function () {
on(this.drawToolbar, "draw-complete", lang.hitch(this, this.selectParcelsFromExtent));
},
selectParcelsFromExtent: function (drawResults) {
var extent = drawResults.geometry;
var query = new Query();
query.geometry = extent;
parcelLayer = new FeatureLayer("https://somedomain.com/someagssite/rest/services/somemapservice/MapServer/0", {
outFields: ["*"],
mode: FeatureLayer.MODE_SELECTION
});
this.map.addLayer(parcelLayer);
parcelLayer.selectFeatures(query, FeatureLayer.SELECTION_ADD);
var selectedFeatures = parcelLayer.getSelectedFeatures();
for (var i in selectedFeatures) {
console.log(selectedFeatures[i].attributes.OBJECTID)
}
},
enableDrawToolbar: function () {
this.drawToolbar.activate(Draw.EXTENT);
} it doesn't appear to select anything within the extent box drawn, the selectedFeatures array is empty.
... View more
01-13-2021
08:40 AM
|
0
|
1
|
991
|
|
POST
|
This is data problem, not an issue with this awesome widget -- specifically, a geometry problem as evidenced in the dev tools screenshot. It's null/empty. Upon inspection of the source data used to publish the service, it has some null coordinate values that are used to build the feature class, hence the null/empty shape column I suppose.
... View more
12-22-2020
09:19 AM
|
1
|
0
|
882
|
|
POST
|
Edit: WAB Developer 2.16 eSearch: 2.13 Hi again, Strange issue with configuring eSearch on a hosted feature service. The service has 3 layers but 1 of the layers is generating errors with the auto zoom to search results property set. The search actually produces the correct result but is failing to auto zoom as well as zoom from clicking on a result.
... View more
12-22-2020
08:48 AM
|
0
|
1
|
889
|
| 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
|