POST
|
I have several services published to my ArcGIS enterprise. Here is some server information ArcGIS Portal Windows Server 2016 Portal 10.5.1 Tomcat Web server for web tier authentication connecting to LDAP server Webadaptor name https://gisportal.mydomain.com/portal ArcGIS Server Windows Server 2016 ArcServer 10.5.1 Webadaptor Name https://engineering.mydomain.com/arconline The Server is federated with Portal. My arcserver is accessible to the internet through the webadapter, my gisportal is not. What I am trying to do is add a web service to my arcgis online account which is hosted on my enterprise server. I keep getting a generate token error even though it seems to be getting a token. I have attached some screen shots to show. As you can see it does connect to my server and recognize it is secure and asks for my username and password. I enter the information EXACTLY as it is in my portal. both the username and password match in case. This is what is returned. As you can see it looks like the first time is requests a token through POST it does receive the token, but then it seems to request a token through GET, and that returns an "Unable to generate token" error I am not sure if this is a bug on ESRI's side or if I need to change some settings on my end. I have been on the phone with ESRI for days now and have not been able to resolve. I am reaching out to the community for some extra help hoping someone has run into this. Thanks in advance for your help Ray
... View more
01-29-2018
06:43 AM
|
0
|
1
|
1459
|
POST
|
Thank you very much Jake. That did it. A few steps involved but that did the trick. If anyone else is looking for a bit of a tutorial. Shut down database instance - sqlplus>shutdown immediate Backup the spfile (copied to another folder) Delete the spfile Edited the init<sid>.ora file (set compatible=12.1.0.0.0) start the database (will use init<sid>.ora file to startup when no spfile found) - sqlplus>startup create new spfile from init file sqlplus>create spfile from pfile='<oracle_home>/dbs/init<sid>.ora' alter database - sqlplus>ALTER SYSTEM SET COMPATIBLE = '11.1.0' SCOPE = SPFILE; shutdown database(just to be sure) - sqlplus>shutdown immediate start database - sqlplus>startup Appreciate the help Ray
... View more
09-08-2017
07:16 AM
|
3
|
0
|
2219
|
POST
|
I am trying to upgrade from 10.1 geodatabase to 10.5 when I run the upgrade check it says all is good to upgrade, but when I actually run the upgrade I keep getting an error. Here is the output of the script. Executing: UpgradeGDB "Database Connections\GISPROD as SDE.sde" PREREQUISITE_CHECK UPGRADE Start Time: Fri Sep 08 08:47:16 2017 Paused the database for upgrade. There are no other active connections. User has privileges required to upgrade. Connected RDBMS instance is setup for ST_GEOMETRY configuration. Running Pre-Requisite check (C:\Users\Raymondg\AppData\Roaming\ESRI\Desktop10.5\ArcCatalog\GISPROD as SDE.sde). Instance supports XML type. Updating server tables and stored procedures. Could not update server tables and stored procedures. (branches : Error (406) DBMS error code: 406 ORA-00406: COMPATIBLE parameter needs to be 12.0.0.0.0 or greater ORA-00722: Feature "SQL identity columns" ) Refer to upgrade logfiles for more details: C:\Users\Raymondg\AppData\Local\Esri\Desktop10.5\GDBUpgrade.log C:\Users\Raymondg\AppData\Local\Temp\sde_setup.log Unpaused the database. Failed to execute (UpgradeGDB). Failed at Fri Sep 08 08:47:17 2017 (Elapsed Time: 1.16 seconds) Oracle Database: 12.1.0.2 OS: SLES 11 SP4 I am at a loss here. Any help appreciated. Thanks Ray
... View more
09-08-2017
05:56 AM
|
0
|
2
|
3202
|
POST
|
Got it to work. this is the part I missed The static portion of SEQNAME in the DynamicValue table. Since there are four quadrants, there must be four rows whose SEQNAME is GRIDSEQ* (where * is the corresponding value defined in the GRIDID field in the Fire District layer). Thanks Ray
... View more
04-04-2017
11:08 AM
|
0
|
0
|
490
|
POST
|
I was on that track but what I am not sure of, is how will it know which sequence to use?? How do I tell it to use a certain sequence?
... View more
04-04-2017
06:33 AM
|
0
|
0
|
490
|
POST
|
I am at a water utility and we cover multiple cities. I would like to generate ID's for our fire hydrants. Our ID's start with the first letter of the city then a sequential number after it. ie P1200 or C1564. Problem is we have a different number of hydrants in each city and the sequential numbers are at different values (see attached). I do have a layer that I can add that has polygons around the cities with a field that has the first letter to be used for the start of the hydrant number. My question is, can I have multiple sequences for one layer? If so how can I tell the assistant to use a particular sequence? I would be fine if it prompted me. So if I am adding a new hydrant in the city of Providence, I would like it to use sequence PHYDRANT so the next hydrant number would be P3240. If city of Johnston use sequence JHYDRANT and next Hydrant number would be J0501 and so on. Also hydrant numbers are 4 characters long, but I think I know how to accomplish that. Thanks Ray
... View more
04-04-2017
06:19 AM
|
0
|
3
|
1119
|
POST
|
Thanks for the tip. I will look into it. One thing I should have mentioned is only the SERVICELOCATION table is a feature layer. The odc connection is just an oracle table in another database. The reason I wanted the checks in there is in case the GIS editor puts the wrong SVCLOC number in the GIS table I want to make sure it exists in the SVC_LOC table. I have been going through the code and found this works fine. # ------------------------------------------------------------------------------
# Cstar_Update.py
# Created on: 2012-06-05 12:56:35.00000
# Updated 05/18/2016 by: Raymond Goins
#
# Description:
# Updates Stop number in Customer Star database from selected feature in ArcMap
# ------------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Local variables:
table = r"C:\PWSB GIS\GIS Scripts\conn\CStar.odc\SVC_LOC"
# table = r"C:\PWSB GIS\GIS Scripts\conn\PWMedia.odc\CSTARTMP"
# Set variable to see if a feature is selected
sel = len(arcpy.Describe("WATER.SERVICELOCATION").FIDSet)
if sel >= 1:
wslrow = arcpy.da.SearchCursor("WATER.ServiceLocation", ['STOP_NUMBER', 'SVC_LOC_NB'])
# Loop through selected features
for row in wslrow:
stopnumber = row[0]
svcloc = row[1]
# Make sure SVCLOC number is not null
if svcloc is not None:
#Check to make sure Stop number is not null
if stopnumber is not None:
# Check to see if SrvLoc number exists
rcheck = arcpy.SearchCursor(table, "SLOC_SVC_LOC_NBR = " + "'" + str(svcloc) + "'")
i = 0
for r in rcheck:
i += 1
del r
del rcheck
# If exists loop through
if i > 0:
csrows = arcpy.UpdateCursor(table, "SLOC_SVC_LOC_NBR = '" + str(svcloc) + "'")
for csrow in csrows:
arcpy.AddMessage("ServiceLoc " + str(svcloc) + " found")
csrow.setValue("SLOC_STOP_NUMBER", stopnumber)
csrows.updateRow(csrow)
arcpy.AddMessage("Stop number updated to " + str(stopnumber))
del csrows
del csrow
else:
arcpy.AddMessage("Service Loc not found in CStar. Could not update Stop Number.")
del i
else:
arcpy.AddMessage("Stop Number Not Set in GIS.")
else:
arcpy.AddMessage("Service Loc Not Set in GIS.")
del svcloc
del stopnumber
del row
del wslrow
else:
arcpy.AddMessage("Please select a service Location.")
del sel Seems the arcpy.da function is causing the problem. I also removed "with" and went to deleting the objects manually. All seems to work fine so far Thanks again for the help and tips Ray
... View more
05-19-2016
06:22 AM
|
0
|
0
|
1067
|
POST
|
I have tried commenting and commenting all the del statements and no go. This is the complete error Traceback (most recent call last): File "C:\PWSB GIS\GIS Scripts\Cstar_Update.py", line 38, in <module> for csrow in csrows: RuntimeError: workspace already in transaction mode
... View more
05-19-2016
05:27 AM
|
0
|
1
|
1067
|
POST
|
I updated some of the code # ------------------------------------------------------------------------------
# Cstar_Update.py
# Created on: 2012-06-05 12:56:35.00000
# Updated 05/18/2016 by: Raymond Goins
#
# Description:
# Updates Stop number in Customer Star database from selected feature in ArcMap
# ------------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Local variables:
# table = r"C:\PWSB GIS\GIS Scripts\conn\CStar.odc\SVC_LOC"
table = r"C:\PWSB GIS\GIS Scripts\conn\PWMedia.odc\CSTARTMP"
# Set variable to see if a feature is selected
sel = len(arcpy.Describe("WATER.SERVICELOCATION").FIDSet)
if sel >= 1:
with arcpy.da.SearchCursor("WATER.ServiceLocation", ['STOP_NUMBER', 'SVC_LOC_NB']) as wslrow:
# Loop through selected features
for row in wslrow:
stopnumber = row[0]
svcloc = row[1]
# Make sure SVCLOC number is not null
if svcloc is not None:
# Check to see if SrvLoc number exists
with arcpy.da.SearchCursor(table, ['SLOC_SVC_LOC_NBR'], "SLOC_SVC_LOC_NBR = " + "'" + str(svcloc) + "'") as rcheck:
i = 0
for r in rcheck:
i += 1
del r
# del rcheck
# If exists loop through
if i > 0:
with arcpy.da.UpdateCursor(table, ['SLOC_STOP_NUMBER'], "SLOC_SVC_LOC_NBR = '" + str(svcloc) + "'") as csrows:
for csrow in csrows:
arcpy.AddMessage("ServiceLoc " + str(svcloc) + " found")
csrow[0] = stopnumber
csrows.updateRow(csrow)
arcpy.AddMessage("Stop number updated to " + str(stopnumber))
del csrows
del csrow
else:
arcpy.AddMessage("Service Loc not found in CStar. Could not update Stop Number.")
del i
else:
arcpy.AddMessage("Service Loc Not Set in GIS.")
del svcloc
del stopnumber
del row
del wslrow
else:
arcpy.AddMessage("Please select a service Location.")
del sel Thanks for the quick response. The spaces haven't been an issue as of yet. I can check it though. I have commented it out before I posted the question, but no go. As I said it works fine the first time I run it then error's out after that. If I shut down ArcMap and reopen it, it works again once then dies. Ray
... View more
05-18-2016
01:28 PM
|
0
|
3
|
1067
|
POST
|
I know this has been asked, and I have tried all suggestion I could find. Maybe I am missing something. Here is my code # ------------------------------------------------------------------------------
# Cstar_Update.py
# Created on: 2012-06-05 12:56:35.00000
# Updated 05/18/2016 by: Raymond Goins
#
# Description:
# Updates Stop number in Customer Star database from selected feature in ArcMap
# ------------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Local variables:
# table = r"C:\PWSB GIS\GIS Scripts\conn\CStar.odc\SVC_LOC"
table = r"C:\PWSB GIS\GIS Scripts\conn\PWMedia.odc\CSTARTMP"
# Set variable to see if a feature is selected
sel = len(arcpy.Describe("WATER.SERVICELOCATION").FIDSet)
if sel >= 1:
with arcpy.da.SearchCursor("WATER.ServiceLocation", ['STOP_NUMBER', 'SVC_LOC_NB']) as wslrow:
# Loop through selected features
for row in wslrow:
stopnumber = row[0]
svcloc = row[1]
# Make sure SVCLOC number is not null
if svcloc is not None:
# Check to see if SrvLoc number exists
rcheck = arcpy.da.SearchCursor(table, ['*'], "SLOC_SVC_LOC_NBR = " + "'" + str(svcloc) + "'")
i = 0
for r in rcheck:
i += 1
del r
del rcheck
# If exists loop through
if i > 0:
csrows = arcpy.da.UpdateCursor(table, ['SLOC_STOP_NUMBER'], "SLOC_SVC_LOC_NBR = '" + str(svcloc) + "'")
for csrow in csrows:
arcpy.AddMessage("ServiceLoc " + str(svcloc) + " found")
csrow.SLOC_STOP_NUMBER = stopnumber
csrows.updateRow(csrow)
arcpy.AddMessage("Stop number updated to " + str(stopnumber))
del csrows
del csrow
else:
arcpy.AddMessage("Service Loc not found in CStar. Could not update Stop Number.")
del i
del svcloc
del stopnumber
else:
arcpy.AddMessage("Service Loc Not Set in GIS.")
del row
del wslrow
else:
arcpy.AddMessage("Please select a service Location.")
del sel It works the first time but the get the workspace already in transaction mode error. I use this while in the same edit session. I basically click a feature update the field then push it into another database. Both databases use ORACLE but are on different servers. Thanks for taking a look Ray
... View more
05-18-2016
01:06 PM
|
0
|
7
|
7310
|
POST
|
I decided to use geometryEngine instead. I then sent the results to a php script through ajax, queried the data, added the distance then sorted the array with PHP. Works rather well. Thanks for your help. Ray
... View more
03-02-2016
12:06 PM
|
0
|
0
|
648
|
POST
|
OK I got it adding the distance to the feature set. Now another problem. WTF!!! When I loop through the results the buffer distance come through undefined. When i view the object in firebug the damn thing is there. Am I missing something??? I also have out figure out sorting the array. function selectInBuffer(results){
//console.log(results);
sResults = {displayFieldName: null, features:[]};
var features = results.features;
if(features.length > 0)
{
$.each(results.features, function(k, v)
{
//console.log(k);
var distParams = new DistanceParameters();
distParams.distanceUnit = geometryService.UNIT_FOOT;
distParams.geometry1 = pt;
distParams.geometry2 = v.geometry;
distParams.geodesic = true;
v.setSymbol(symbol2);
v.setInfoTemplate(infoTemplate);
map.graphics.add(v);
geometryService.distance(distParams, function(distance) {
var d = distance;
//console.log(features);
// Add distance to feature object
results.features .buffer = d;
//console.log(results);
if (!sResults.displayFieldName){ sResults.displayFieldName = results.displayFieldName }
// push feature into results object to use for the "show Feature" function
sResults.features.push(results.features );
});
});
}
registry.byId("grid").set("content", formatResults(results));
} function formatResults(results)
{
var template = "";
var wfeatures = results.features;
//console.log(results);
/*wfeatures.sort(function(a,b){
return a.dist-b.dist;
}) */
//console.log(wfeatures);
var ServLocArray = { 'STOP_NBR':'Stop#', 'SVC_LOC_NBR':'Svc Loc#', 'ACCT_NBR':'Acct#' ,'RespParty':'Resp Party', 'DAY_PHONE':'Day Phone', 'SLOC_DWELLING_CD':'Dwl Cd', 'Address':'Service Address', 'DIST': 'Dist', 'PipeType':'Pipe Type', 'INSTDATE':'Install Year', 'TIER1_FLAG':'Tier1?' };
template = "<i>Total features returned: " + wfeatures.length + "</i>";
template += '<table border="1" style="text-align:center;">';
template += "<tr>"
$.each(ServLocArray, function(tkey, tvalue){
template += "<th>"+tvalue+"</th>"
});
template += "<th>act</th>";
template += "</tr>";
if(wfeatures.length > 0)
{
$.each(wfeatures, function(k, v) {
console.log(v);
srvloc = v['attributes']['SVC_LOC'];
ptype = v['attributes']['DIAM'] + '" ' + v['attributes']['PIPETYPE'];
var bdist = v['buffer'];
var instyear = formatDate( v['attributes']['INSTDATE'], 'yyyy');
template += "<tr>";
template += "<td>"+ v['attributes']['STOP_NBR'] +"</td>";
template += "<td>"+ srvloc +' <a href="#" onclick="showFeature(sResults.features['+ k +']); return false;">(show)</a></td>';
template += "<td>"+ v['attributes']['ACCT_NBR'] +"</td>";
template += '<td><div class="csspointer" style="color:blue;text-decoration:underline;" onClick="window.open(\'/gis/CstarQuery/'+srvloc+'\', \'\', \'width=400,height=400,menubar=no,scrollbars=yes\')">'+ v['attributes']['FNAME'] +" "+ v['attributes']['LNAME'] +'</div></td>';
template += "<td>"+ format_phone( v['attributes']['DAY_PHONE']) +"</td>";
template += "<td>"+ v['attributes']['SLOC_DWELLING_CD'] +"</td>";
template += "<td width='150'>"+ v['attributes']['BLDGNBR'] +" "+ v['attributes']['STNAME'] +" "+ v['attributes']['SUFFIX'] +"</td>";
template += "<td width='75'>"+ bdist +"</td>";
template += "<td>"+ ptype +"</td>";
template += "<td>"+ instyear +"</td>";
template += "<td>"+ v['attributes']['TIER1_FLAG'] +"</td>";
template += '<td><div class="csspointer" style="color:blue;text-decoration:underline;" onClick="window.open(\'/gis/CstarQuery/'+srvloc+'\', \'\', \'width=400,height=400,menubar=no,scrollbars=yes\')">CStar</div></td>';
template += "</tr>";
});
} else {
template += '<tr><td colspan="12">No Results found</td></tr>';
}
template += "</table>";
return template;
} Thanks again Ray
... View more
02-23-2016
08:33 AM
|
0
|
0
|
648
|
POST
|
Thanks for the response. Had a couple days off and just getting back to looking at my app. To clarify some of my crazy code I will just try to explain what I am doing. I have a feature. When the page loads I have a drop down of a distance the user would like to buffer. When the drop down changes the script runs and returns the results and selects them on the map and also shows a grid of those results. The results are not sorted in any way so I would like to sort them by the distance they are away from the original feature hence the distance function. I took your suggestion and redid my function. Have 2 issues 1. When I push the distance value into the feat object it seems to be putting in the same value all the time. (see image) 2. Just got word they would like to add a where clause when running the buffer query. Can I do that??? The initial point is already on the map and is in the variable "pt" which is the center of the circle for the buffer. here are the functions I have so far. I use jQuery also so the onchange event is jquery not esri. onChane event $("#buffer").change(function(){
map.graphics.clear();
var fbuffer = dom.byId("buffer").value;
//console.log(pt);
// When the buffer distance is changed create the new buffer and query.
circle = new Circle({
center: pt,
geodesic: false,
radius: fbuffer,
radiusUnit: "esriFeet",
spatialReference: pt.spatialReference
});
var graphic = new Graphic(circle, circleSymb);
map.graphics.add(graphic);
var query2 = new Query();
query2.outFields = ["*"];
query2.geometry = circle;
query2.returnGeometry = true;
query2.outSpatialReference = map.spatialReference;
query2.spatialRelationship = Query.SPATIAL_REL_CONTAINS;
console.dir(query2);
queryTask2.execute(query2, selectInBuffer);
}); Select function function selectInBuffer(results){
//console.log(results);
sResults = {displayFieldName: null, features:[]};
var features = results.features;
for (i = 0; i < features.length; i++) {
var feat = features;
var distParams = new DistanceParameters();
distParams.distanceUnit = geometryService.UNIT_FOOT;
distParams.geometry1 = pt;
distParams.geometry2 = feat.geometry;
distParams.geodesic = true;
feat.setSymbol(symbol2);
feat.setInfoTemplate(infoTemplate);
map.graphics.add(feat);
geometryService.distance(distParams, function(distance) {
var d = distance;
console.log(feat);
// Add distance to feature object
feat['dist'] = d;
console.log(feat);
if (!sResults.displayFieldName){ sResults.displayFieldName = results.displayFieldName }
// push feature into results object to use for the "show Feature" function
sResults.features.push(feat);
});
}
//console.log(feat);
registry.byId("grid").set("content", formatResults(sResults));
//console.log(sResults);
} Function to format results for the grid this is where I would sort the results by distance function formatResults(results)
{
console.log(results);
var template = "";
var wfeatures = results.features;
var ServLocArray = { 'STOP_NBR':'Stop#', 'SVC_LOC_NBR':'Svc Loc#', 'ACCT_NBR':'Acct#' ,'RespParty':'Resp Party', 'DAY_PHONE':'Day Phone', 'SLOC_DWELLING_CD':'Dwl Cd', 'Address':'Service Address', 'DIST': 'Dist', 'PipeType':'Pipe Type', 'INSTDATE':'Install Year', 'TIER1_FLAG':'Tier1?' };
/*wfeatures.sort(function(a,b){
return a.dist-b.dist;
}) */
console.log(wfeatures);
template = "<i>Total features returned: " + wfeatures.length + "</i>";
template += '<table border="1" style="text-align:center;">';
template += "<tr>"
$.each(ServLocArray, function(tkey, tvalue){
template += "<th>"+tvalue+"</th>"
});
template += "<th>act</th>";
template += "</tr>";
for (var i = 0, il = wfeatures.length; i < il; i++)
{
srvloc = wfeatures.attributes['SVC_LOC'];
var instyear = formatDate(wfeatures.attributes['INSTDATE'], 'yyyy');
template += "<tr>";
template += "<td>"+ wfeatures.attributes['STOP_NBR'] +"</td>";
template += "<td>"+ srvloc +' <a href="#" onclick="showFeature(sResults.features['+ i +']); return false;">(show)</a></td>';
template += "<td>"+ wfeatures.attributes['ACCT_NBR'] +"</td>";
template += '<td><div class="csspointer" style="color:blue;text-decoration:underline;" onClick="window.open(\'/gis/CstarQuery/'+srvloc+'\', \'\', \'width=400,height=400,menubar=no,scrollbars=yes\')">'+ wfeatures.attributes['FNAME'] +" "+ wfeatures.attributes['LNAME'] +'</div></td>';
template += "<td>"+ format_phone(wfeatures.attributes['DAY_PHONE']) +"</td>";
template += "<td>"+ format_phone(wfeatures.attributes['SLOC_DWELLING_CD']) +"</td>";
template += "<td width='150'>"+ wfeatures.attributes['BLDGNBR'] +" "+ wfeatures.attributes['STNAME'] +" "+ wfeatures.attributes['SUFFIX'] +"</td>";
//template += "<td width='75'>"+ wfeatures.dist +"</td>";
template += "<td>"+ format_phone(wfeatures.attributes['DAY_PHONE']) +"</td>";
template += "<td>"+ instyear +"</td>";
template += "<td>"+ wfeatures.attributes['TIER1_FLAG'] +"</td>";
template += '<td><div class="csspointer" style="color:blue;text-decoration:underline;" onClick="window.open(\'/gis/CstarQuery/'+srvloc+'\', \'\', \'width=400,height=400,menubar=no,scrollbars=yes\')">CStar</div></td>';
template += "</tr>";
}
template += "</table>";
return template;
} I hope that clarifies thing a bit. the tfeat was a temporary holder I was trying to create in order to sort the features. but dropped that idea and trying to just push the distance into the feat array. Thanks again for your help. Ray
... View more
02-23-2016
06:39 AM
|
0
|
0
|
648
|
POST
|
This is killing me. Been working on this for hours and can't seem to work this out. Here is my function. function selectInBuffer(results){
//console.log(results);
sResults = {displayFieldName: null, features:[]};
var feat;
var features = results.features;
for (var i = 0; i < features.length; i++) {
var feat = features;
tfeat = feat;
var distParams = new DistanceParameters();
distParams.distanceUnit = geometryService.UNIT_FOOT;
distParams.geometry1 = pt;
distParams.geometry2 = feat.geometry;
distParams.geodesic = true;
distp = geometryService.distance(distParams);
console.dir(distp);
tfeat.dist = distp;
feat.setSymbol(symbol2);
feat.setInfoTemplate(infoTemplate);
map.graphics.add(feat);
if (!sResults.displayFieldName){ sResults.displayFieldName = results.displayFieldName }
sResults.features.push(feat);
}
console.log(tfeat);
registry.byId("grid").set("content", formatResults(results));
//console.log(sResults);
} According to all the samples I have seen, var distp should be just a number. I am getting back an object that I can't seem to do anything with it. Here is what is return with firebug What I am trying to do is create a buffer, which works fine. Then query a layer to return the features in that buffer, again works fine. What I am doing here is loop through those results to push a field into the object array with the distance. Then I want to sort the array based on the distance. Then show the results in a grid. Thanks in advance for help. Ray
... View more
02-19-2016
01:10 PM
|
0
|
4
|
2331
|
POST
|
Yes {
"name" : "STATIC_PRES",
"type" : "esriFieldTypeSmallInteger",
"alias" : "Static Pressure",
"sqlType" : "sqlTypeOther",
"nullable" : true,
"editable" : true,
"domain" : null,
"defaultValue" : null
},
... View more
12-23-2015
10:59 AM
|
0
|
1
|
908
|
Title | Kudos | Posted |
---|---|---|
3 | 09-08-2017 07:16 AM |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|