|
POST
|
Thanks for all your help and testing Robert. I will submit a bug to ESRI.
... View more
03-19-2018
04:59 AM
|
0
|
0
|
1084
|
|
POST
|
I have a python script that I would like to publish as a geoprocessing service, but it contains many update and insert cursors to update database tables. Since instances of these cursors cannot occur simultaneously, how do you manage having multiple users possibly using it at the same time? I would assume versioning of the database, but then isn't a lock made on the database when you save the edits to the default database? Does anyone have a quick arcpy sample of versioning?
... View more
03-15-2018
08:43 AM
|
0
|
1
|
1047
|
|
POST
|
I'm not sure I can use a Geoprocessing service. The web application is written in .NET, inside the .NET code I call the python script and it runs. Can you call Geoprocessing services from .NET? //Set up Habitat Classification script
IGeoProcessorResult result;
IGeoProcessor2 gp = new GeoProcessor() as IGeoProcessor2;
string tlbxPath = Server.MapPath("~/ArcToolbox/HabitatMon.tbx");
gp.AddToolbox(@tlbxPath);
IVariantArray parameters = new VarArray();
string HB_dbConFile = Server.MapPath("~/SDE_DBConnectionFiles/HbTest.sde");
string FA_dbConFile = Server.MapPath("~/SDE_DBConnectionFiles/Focal.sde");
parameters.Add(HB_dbConFile);
parameters.Add(FA_dbConFile);
parameters.Add(geodatabase);
//Run Habitat Classification script
try
{
result = gp.Execute("HabitatClassification", parameters, null);
}
... View more
03-15-2018
07:38 AM
|
0
|
0
|
2444
|
|
POST
|
Yes, it's just an outline. Anytime I change the opacity on the FeatureLayer, the outline, which should be on the GraphicsLayer, also becomes transparent.
... View more
03-15-2018
07:33 AM
|
0
|
0
|
1084
|
|
POST
|
Yeah, you're right! Good catch. That was a hold-over from when I was switching back and forth between using a GraphicsLayer and just adding/removing graphics instead. I changed it to this, I think it only adds the GraphicsLayer once and then just removes/adds graphics to and from the layer based on clicking. Still getting the same opacity issue though. //When the popupBox is closed, then remove the selection outline
view.popup.watch("visible", function(visible){
if (visible == false){
graphicLyr.removeAll();
}
});
//Create a selection outline on a patch when it is clicked
view.on("click", function(evt){
var screenPoint = {
x: evt.x,
y: evt.y
};
view.hitTest(screenPoint).then(getGraphics);
});
var graphicLyr = new GraphicsLayer({opacity: 1});
map.add(graphicLyr);
function getGraphics(response){
graphicLyr.removeAll();
var selectionSymbol = {
type: "simple-fill",
style: "none",
outline: {
color: [56, 247, 247],
width: 2
}
}
var graphic = new Graphic({
geometry: response.results[0].graphic.geometry,
symbol: selectionSymbol
});
graphicLyr.add(graphic);
};
... View more
03-15-2018
07:32 AM
|
0
|
0
|
2729
|
|
POST
|
I'm thinking this isn't possible as the ArcPy library accesses the ArcGIS application to run geoprocessing tools, but I'm asking anyway. We're publishing a web application to a web server that does not have ArcGIS installed on it. This web application runs a python script that utilizes ArcPy. Ideally, we'd like to keep the web server free of an ArcGIS installation, but I don't know how to run arcpy-centric scripts without it installed. Anybody have any ideas?
... View more
03-15-2018
07:21 AM
|
0
|
3
|
3134
|
|
POST
|
If it helps visualize it at all, this is the HTML element where all the radio buttons correspond to changing renders/opacity.
... View more
03-15-2018
06:15 AM
|
0
|
4
|
2729
|
|
POST
|
I was editing my above post when you replied! I've attached the code as a .txt file in the previous reply I made; I realized it's going to be kinda hard to play with in the sandbox without my services since all the gigantic renderers in there won't work on just any old polygon layer, but at least you can look through it and see if there's anything out of place. Let me know if there's something I can do to make it easier to test with. Thanks for your help!
... View more
03-15-2018
06:04 AM
|
0
|
0
|
2729
|
|
POST
|
Yup, I've given that a shot as well and it doesn't not work either. I've attached my full code as a .txt file (minus the my actual services since I cannot share those) if you want to look at it. I'm unsure if it's something I'm doing or if it's really a bug. on(query('input[name="setOpacity"]'), "click", function (evt){
var opacity = evt.target.id;
switch(opacity){
case "100-percent":
featureLayer.opacity = 1;
break;
case "25-percent":
featureLayer.opacity = .25;
break;
case "50-percent":
featureLayer.opacity = .5;
break;
case "75-percent":
featureLayer.opacity = .75;
break;
}
});
//Create a selection outline on a patch when it is clicked
view.on("click", function(evt){
var screenPoint = {
x: evt.x,
y: evt.y
};
view.hitTest(screenPoint).then(getGraphics);
});
var graphicLyr = new GraphicsLayer({opacity: 1});
function getGraphics(response){
graphicLyr.removeAll();
var selectionSymbol = {
type: "simple-fill",
style: "none",
outline: {
color: [56, 247, 247],
width: 2
}
}
var graphic = new Graphic({
geometry: response.results[0].graphic.geometry,
symbol: selectionSymbol
});
graphicLyr.add(graphic);
map.add(graphicLyr);
};
... View more
03-15-2018
05:53 AM
|
0
|
7
|
2729
|
|
POST
|
Hi Robert, I have tried that and unfortunately it does not work. It continues to inherit the opacity from the FeatureLayer. on(query('input[name="setOpacity"]'), "click", function (evt){
var opacity = evt.target.id;
switch(opacity){
case "100-percent":
featureLayer.opacity = 1;
break;
case "25-percent":
featureLayer.opacity = .25;
break;
case "50-percent":
featureLayer.opacity = .5;
break;
case "75-percent":
featureLayer.opacity = .75;
break;
}
});
//When the popupBox is closed, then remove the selection outline
view.popup.watch("visible", function(visible){
if (visible == false){
view.graphics.removeAll();
}
});
//Create a selection outline on a patch when it is clicked
view.on("click", function(evt){
var screenPoint = {
x: evt.x,
y: evt.y
};
view.hitTest(screenPoint).then(getGraphics);
});
var graphicLyr = new GraphicsLayer({});
function getGraphics(response){
view.graphics.removeAll();
graphicLyr.removeAll();
var selectionSymbol = {
type: "simple-fill",
style: "none",
outline: {
color: [56, 247, 247, 1],
width: 2
}
}
var graphic = new Graphic({
geometry: response.results[0].graphic.geometry,
symbol: selectionSymbol
});
//view.graphics.add(graphic);
graphicLyr.add(graphic);
graphicLyr.opacity = 1;
map.add(graphicLyr);
};
... View more
03-14-2018
07:25 AM
|
0
|
9
|
2729
|
|
POST
|
I am encountering a similar problem. I have not yet found a solution. I allow users to choose the opacity of my FeatureLayer via radio button, and then if they click a polygon, I create a new graphic from their selected polygon (hitTest) and set the symbol to be a blue outline. I add that graphic to a GraphicsLayer. Unfortunately, the graphic inherits the opacity from the FeatureLayer even if I set the opacity to something different on the GL. GraphicsLayer takes on opacity from FeatureLayer I have tried both gl = new GraphicsLayer({opacity: 1}); and gl.add(graphic);
map.add(gl);
gl.opacity = 1; I have also tried setting the opacity on the actual graphic symbol: color: [56, 247, 247, 1] None of it works.
... View more
03-14-2018
04:34 AM
|
0
|
1
|
2674
|
|
POST
|
I'm trying to symbolize selections using a GraphicsLayer derived from a FeatureLayer. When I change the opacity of the FeatureLayer and get a graphic based on whatever polygon I have clicked on, it sets the opacity of the GraphicsLayer to the same as the FeatureLayer, even if I set the opacity to something different on the GraphicsLayer. When they click on a radio button here, the opacity of the FeatureLayer changes to reflect their choice: on(query('input[name="setOpacity"]'), "click", function (evt){
var opacity = evt.target.id;
switch(opacity){
case "100-percent":
featureLayer.opacity = 1;
break;
case "25-percent":
featureLayer.opacity = .25;
break;
case "50-percent":
featureLayer.opacity = .5;
break;
case "75-percent":
featureLayer.opacity = .75;
break;
}
}); Next, if I select a polygon on the map (via clicking), I create a new graphic of that polygon and set the symbol to be a blue outline. Then I add it to a GraphicsLayer, set the opacity to 1, and then add it to the map. But the opacity remains at 25/50/75 percent or whatever is selected by the user on the FeatureLayer. Is this happening because the graphic is derived from the FeatureLayer? Is there a way to fix this? view.on("click", function(evt){
var screenPoint = {
x: evt.x,
y: evt.y
};
view.hitTest(screenPoint).then(getGraphics);
});
var graphicLyr = new GraphicsLayer({});
function getGraphics(response){
graphicLyr.removeAll();
var selectionSymbol = {
type: "simple-fill",
style: "none",
outline: {
color: [56, 247, 247],
width: 2
}
}
var graphic = new Graphic({
geometry: response.results[0].graphic.geometry,
symbol: selectionSymbol
});
graphicLyr.add(graphic);
graphicLyr.opacity = 1;
map.add(graphicLyr);
};
... View more
03-13-2018
12:45 PM
|
0
|
13
|
4151
|
|
POST
|
Hi Robert, I'm reporting back. I have something that works, though I have a feeling it could be a lot cleaner than the way I did it. I'm a newbie when it comes to javascript and dojo, so the way I do things might be kind of clunky...definitely open to suggestions. Here is the HTML: <body>
<div id="viewDiv"></div>
<div id="toggleLayers">
<legend>Toggle layers:</legend>
<label><input type="radio" id="qhStatusLyr" name="chosenLayer" value="qhStatus" checked> Quail Habitat Status</label>
<label><input type="radio" id="coarseHabLyr" name="chosenLayer" value="coarse"> Coarse-level Habitat Types</label>
<label><input type="radio" id="fineHabLyr" name="chosenLayer" value="fine"> Fine-level Habitat Types</label>
</div>
</body> I then created three different UniqueValueRenderers and switch between them using this javascript: //Get radio buttons by ID
var qhStatusToggle = dom.byId("qhStatusLyr");
var coarseToggle = dom.byId("coarseHabLyr");
var fineToggle = dom.byId("fineHabLyr");
//Change the renderer if the user selects one of the various options via radio button
on(qhStatusToggle, "change", function(){
if (qhStatusToggle.checked){
featureLayer.renderer = qhRenderer;
}
});
on(coarseToggle, "change", function(){
if (coarseToggle.checked){
featureLayer.renderer = coarseRenderer;
}
});
on(fineToggle, "change", function(){
if (fineToggle.checked){
featureLayer.renderer = fineRenderer;
}
}); I really want to come up with a way to use a switch statement, but I can't figure out how to get the value from the radio buttons using dojo. If I could get all the radio buttons in a group based on the "name" attribute (because name is the same for all of them), then I think I could get the value of whatever one is checked and use a switch statement to set the renderer. Just an idea.
... View more
03-13-2018
06:46 AM
|
0
|
0
|
3165
|
|
POST
|
Will leave this up for others, but answered it a minute later. If you remove the "defaultSymbol" parameter it gets rids of "others". This makes sense the more I think about it as the defaultSymbol would be the catch all for anything you didn't specifically symbolize, so the category on the legend would be as vague as "others".
... View more
03-09-2018
08:04 AM
|
1
|
0
|
2299
|
|
POST
|
I've got something weird in my legend. It is showing "others" as a category when there is no such attribute in my field. I don't know where it comes from or how to get rid of it. The only values in my attribute field (OfficialQH) are 0 and 1, integers. The layer is symbolizing correctly and as I would expect, I just need to get "others" off my legend. var qhRenderer = {
type: "unique-value",
field: "OfficialQH",
defaultSymbol: {type: "simple-fill"},
uniqueValueInfos: [{
value: 0,
symbol: {
type: "simple-fill",
color: [225, 225, 225],
outline: {
color: "black",
width: 1
}
},
label: "Not Quail Habitat"
},
{
value: 1,
symbol: {
type: "simple-fill",
color: "green",
outline: {
color: "black",
width: 1
}
},
label: "Quail Habitat"
}]
};
//Add the patches feature class to the map
var featureLayer = new FeatureLayer({
url: "https://www.quailcount.org/nbcigis/rest/services/HbMonitoringTest/Patches/MapServer/0",
outFields: ["*"],
popupTemplate: popupBox,
renderer: qhRenderer
});
map.add(featureLayer);
//Create a legend
var legend = new Legend({
view: view,
layerInfos: [{
layer: featureLayer,
title: "Quail Habitat Status"
}]
});
... View more
03-09-2018
07:40 AM
|
0
|
2
|
2714
|
| 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
|