POST
|
Hi Everyone, I'm trying to use California wildfires 2017 - Thomas Fire analysis Sample provided in ArcGIS Python API Samples. I have used sentinel imagery to do the same analysis but I always end up getting black imagery (All 0s). Can you please suggest where I'm doing wrong? import arcgis
from arcgis import *
from arcgis.mapping import MapImageLayer
gis = GIS(profile="krishna_dev")
#Sentinel2
sentinel_item = gis.content.search('title:Sentinel2', 'Imagery Layer', outside_org=True)[0]
sentinel = sentinel_item.layers[0]
sentinel_item
aoi = {'spatialReference': {'latestWkid': 3857, 'wkid': 102100}, 'type': 'extent',
'xmax': 9028482.969, 'xmin': 8908018.212, 'ymax': 2478700.211, 'ymin': 2248166.133}
arcgis.env.analysis_extent = {'xmax': 9028482.969, 'xmin': 8908018.212, 'ymax': 2478700.211, 'ymin': 2248166.133,
"spatialReference":{"wkid":102100,"latestWkid":3857}}
sentinel.extent = aoi
import pandas as pd
from datetime import datetime
selected = sentinel.filter_by(where="(Category = 1)",
time=[datetime(2020, 4, 3), datetime(2020, 4, 15)],
geometry=arcgis.geometry.filters.intersects(aoi))
df = selected.query(out_fields="acquisitiondate, name, cloudcover",
order_by_fields="acquisitiondate").sdf
df['acquisitiondate'] = pd.to_datetime(df['acquisitiondate'], unit='ms')
df.tail()
prefire = sentinel.filter_by('OBJECTID in ( 10127407, 10187367)') # 2020-04-03
prefire = prefire.blend()
midfire = sentinel.filter_by('OBJECTID in (10304749, 10304746)') # 2020-04-13
midfire = midfire.blend()
from arcgis.raster.functions import *
extracted_band = extract_band(midfire, [13,12,4])
extracted_band_prefire = extract_band(prefire, [13,12,4])
nbr_prefire = band_arithmetic(prefire, "(b9 - b13) / (b9 + b13) + 2000")
nbr_postfire = band_arithmetic(midfire, "(b9 - b13) / (b9 + b13) + 2000")
nbr_diff = nbr_prefire - nbr_postfir
nbr_diff
burnt_areas = colormap(remap(nbr_diff,
input_ranges=[0.1, 0.27, # low severity
0.27, 0.44, # medium severity
0.44, 0.66, # moderate severity
0.66, 1.00], # high severity burn
output_values=[1, 2, 3, 4],
no_data_ranges=[-1, 0.1], astype='u8'),
colormap=[[4, 0xFF, 0xC3, 0], [3, 0xFA, 0x8E, 0], [2, 0xF2, 0x55, 0], [1, 0xE6, 0, 0]])
burnt_areas Thanks, Krish
... View more
12-08-2020
01:00 AM
|
0
|
4
|
827
|
POST
|
Hi All, While Running Survey123 Template from App Studio (Version : 4.3.193), I'm getting below error: Please let me know how to fix this error. Erwin Soekianto Thanks, Krish
... View more
09-21-2020
05:35 AM
|
0
|
1
|
439
|
POST
|
Hi Mehdi Pira, The code you provided is running successfully but It doesn't change anything in the webmap. Thanks, Krish
... View more
09-14-2020
08:09 PM
|
0
|
0
|
2538
|
POST
|
Dear All, Is it possible to Enable popup in Web Map using ArcGIS API for Python? Thanks, Krish
... View more
09-14-2020
07:37 AM
|
0
|
5
|
2651
|
POST
|
Thanks Robert Scheitlin, GISP! It worked Perfectly. I'm just getting extra columns x and y in csv. Thanks, Krish
... View more
04-18-2020
02:40 AM
|
0
|
1
|
1419
|
POST
|
Hi Robert Scheitlin, GISP, I tried to find "_genereateFields" function in jimu.js/exportUtils.js file but unable to find it (WAB 2.15). Do I have to create another function with this name? I have tried by commenting below lines but still, it downloads all the fields: findPopupInfo: function(featureSet) {
if (!featureSet || !featureSet.features || featureSet.features.length === 0) {
return null;
}
var feature = featureSet.features[0];
var layerId;
var fields;
/*
if(feature._layer) {
//fields = feature._layer.fields;
//layerId = feature._layer.id;
var layerInfos = LayerInfos.getInstanceSync();
var layerInfo = layerInfos.getLayerInfoById(layerId);
if (layerInfo) {
var popupInfo = layerInfo.getPopupInfo();
if (!popupInfo) {
// Try another way to get popupInfo
popupInfo = layerInfo.layerObject.infoTemplate && layerInfo.layerObject.infoTemplate.info;
}
return popupInfo;
}
}*/
return null;
}, findLayerDefinition: function(featureSet) {
if (!featureSet || !featureSet.features || featureSet.features.length === 0) {
return null;
}
var feature = featureSet.features[0];
// if(feature._layer) {
// return {
// geometryType: featureSet.geometryType,
// fields: feature._layer.fields
// };
// }
var fields = [];
var attributes = feature.attributes;
var item;
for (item in attributes) {
if(attributes.hasOwnProperty(item)){
fields.push({
name: item
});
}
}
return {
geometryType: featureSet.geometryType,
fields: fields
};
}, Thanks, Krish
... View more
04-09-2020
02:00 AM
|
0
|
3
|
1419
|
POST
|
Hi Robert Scheitlin, GISP, I'm using WAB 2.15. Thanks, Krish
... View more
04-08-2020
02:30 AM
|
0
|
5
|
1419
|
POST
|
Hi Robert Scheitlin, GISP, Yes. I'm getting expected fields only. But when clicked , on export to csv, i'm getting all the fields in downloaded csv file. Thanks, Krish
... View more
04-06-2020
04:38 PM
|
0
|
7
|
1419
|
POST
|
Hi All, I have seen Robert Scheitlin, GISP solution on below link and tried the same using WAB 2.15 but all the fields are getting downloaded in my csv. Web App Builder - How to limit fields in "export to CSV" option in query widget? I have tried below code: var resultfields = [];
for (i=0; i< popupInfos.length-1; i++){
if (popupInfos[i].visible == true){
resultfields.push(popupInfos[i].fieldName)
}
}
var fFlds = array.filter(layer.fields, lang.hitch(this, function(fldInfo) {
return resultfields.indexOf(fldInfo.name) > 0;
;}));
var featureSet = new FeatureSet();
featureSet.fields = lang.clone(fFlds); Please help. Thanks, Krish
... View more
04-04-2020
04:09 AM
|
0
|
10
|
1794
|
POST
|
Yes Erwin. Is there any way I can reduce the size or it will be approx 60MB?
... View more
02-25-2020
08:41 AM
|
0
|
0
|
582
|
POST
|
Hi Graham Hudgins, I have tested with hosted feature service and Downloads is getting enabled but map is getting hidden as shown below: But for feature services (Extract Capability) download is getting disabled but able to see on map and unable to download & Chart errors remain the same. Thanks, Krish
... View more
02-25-2020
08:29 AM
|
0
|
1
|
380
|
POST
|
Hi Graham Hudgins, Published a feature service without extract capability (10.6.1) to ArcGIS Server and used it in ArcGIS Hub then we were able to download the service. Same process we followed now (tested with extract capability also). We have the download options disabled in both ArcGIS Hub and Sites. Also, when i used 10.6.1 feature service in the sites, download status shows as shown below: Nicole Ueberschär: Were you able to fix? Thanks, Krish
... View more
02-24-2020
08:33 PM
|
0
|
6
|
1223
|
POST
|
Hi Graham Hudgins No, I have shared with everyone. Thanks, Krish
... View more
02-24-2020
08:13 AM
|
0
|
11
|
1223
|
POST
|
Hi Erwin Soekianto, thanks for your response. I have checked the folder size by clicking on files from AppStudio for ArcGIS and found the size is only 5.13 MB as shown in below screenshot. But when I upload and make it as app, the size becomes 60 MB. Can you suggest how to reduce file size? Thanks, Krish
... View more
02-24-2020
07:56 AM
|
0
|
2
|
582
|
POST
|
Hi All, I'm using Enterprise sites 10.7.1 When I click on any of the attribute, I'm getting below error instead of Chart. Also my download option is disabled. I'm using Feature Service and Shared to everyone if I have to change anything. Even, if there are one unique value, instead of showing some graph, it shows empty chart. Is it expected behaviour.? Please suggest. Thanks, Krish
... View more
02-24-2020
07:50 AM
|
0
|
13
|
1881
|
Title | Kudos | Posted |
---|---|---|
1 | 11-16-2021 03:44 AM | |
1 | 08-21-2019 10:49 PM | |
1 | 12-08-2020 08:29 PM | |
1 | 12-08-2020 01:22 AM | |
1 | 06-04-2017 08:38 AM |
Online Status |
Offline
|
Date Last Visited |
01-11-2024
03:54 PM
|