|
POST
|
Thanks Ya'll for your comments....turns out there was an issue with the FC itself. I rebuilt the db and everything works regarding the DELETE....thanks again
... View more
03-18-2022
05:48 AM
|
0
|
0
|
3040
|
|
POST
|
Yea I was thinking that....but was wondering if at the end of the script I could just DELETE ALL or something like that...like clearing the Cache on your browser
... View more
03-17-2022
10:32 AM
|
0
|
0
|
3126
|
|
POST
|
I am running a script that has many Features added. Up until now the script would run and then end and be done but I am adding a WHILE loop that reruns the script. In this script there are a bunch of Feature Layers that get created like below. At the end of the Script before it runs again I want to DELETE all of the FeatureLayers that were created in memory... Is there a call that will do the delete. target_lyr = arcpy.MakeFeatureLayer_management(os.path.join(db['Path'], layer), layer+'_exclude')
... View more
03-17-2022
09:40 AM
|
0
|
3
|
3159
|
|
POST
|
OK so its telling me its locked but I have already cleared the locks....there is no service hitting this db and its on a test box so nothing should be accessing it.... I first check to make sure it exists I then try to disconnect all users I then test that specific FC for a lock It keeps telling me its locked but when I check the DB and FC after it runs there are no locks? for fc in fc_Delete:
fc_path = os.path.join(workspaceLocation, fc)
print fc_path
if arcpy.Exists(fc_path):
arcpy.DisconnectUser(r"C:/GIS_Scripts/Update/OSConnection.sde/", "ALL")
print fc_path + " exists"
if not arcpy.TestSchemaLock(fc_path):
print "Can't proceed - " + fc_path + " feature class is locked"
else:
arcpy.ClearWorkspaceCache_management()
arcpy.Delete_management(fc_path)
... View more
03-16-2022
06:06 AM
|
0
|
0
|
3099
|
|
POST
|
It almost appears that its creating its own lock when its trying to read if it exists....
... View more
03-16-2022
05:39 AM
|
0
|
2
|
3108
|
|
POST
|
The dbo.features_update FC exists.... Thats the crazy thing there are no locks.... That is ALL the code that I am trying to use....is there something else that I am missing....
... View more
03-16-2022
05:32 AM
|
0
|
3
|
3110
|
|
POST
|
I am trying to read my SDE database and then delete specific feature classes if they exist... I keep getting error below....not sure whats up....do I need to make a different connection to the db? ExecuteError: ERROR 000601: Cannot delete C:/GIS_Scripts/Update/OS@Connection.sde/database.DBO.FEATURES_update. May be locked by another application. Failed to execute (Delete). def main():
sqlPath = r"C:/GIS_Scripts/Update/OS@Connection.sde/"
fc_Delete = ["database.DBO.FEATURES_update","fc_Out2a"]
for fc in fc_Delete:
fc_path = os.path.join(sqlPath, fc)
print fc_path
if arcpy.Exists(fc_path):
arcpy.Delete_management(fc_path)
... View more
03-15-2022
03:35 PM
|
0
|
10
|
3538
|
|
POST
|
THINK I GOT IT...testing now....will report my solution when done
... View more
01-14-2022
09:31 AM
|
0
|
0
|
1262
|
|
POST
|
I am launching this from a button and when I do this is the "inputParam" to text.... This is the error I am getting after the call is attempted... Do I have to create seperate Params for the GP Tool as seen in the the image earlier from ArcGIS Server protected void btnGpTool_Click(object sender, EventArgs e)
{
string gpUrl = "https://xxxx/arcgis/rest/services/xxx/GP/GPServer/Search";
string requestUrl = gpUrl + "/execute";
//make sure requestUrl end with execute **
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(requestUrl));
request.KeepAlive = true;
request.Method = "POST";
request.AllowAutoRedirect = true;
request.CookieContainer = new System.Net.CookieContainer();
request.ContentType = "application/x-www-form-urlencoded";// my mistake should be form
StringBuilder paramString = new StringBuilder();
string inputParam = @"{""site"": FeatureSet.fromJSON(
{""geometryType"": ""esriGeometryPoint"",""spatialReference"": {""wkid"": 102100 },""features"":
[{""attributes"": {""OBJECTID"": 0},""geometry"": {""spatialReference"": {""latestWkid"": 3857, ""wkid"": 102100 },
""x"":-8911682.294077562, ""y"": 4518347.849955901 } }]}
),
""Buffer_Distance"": LinearUnit.fromJSON({""distance"": 2,
""units"": ""miles""}),""user"": ""username"",""Report_Type"": ""reporttype""}";
GPToolParams.Text = inputParam;
paramString.Append($"request=" + inputParam);
paramString.Append($"&f=json");
byte[] data = Encoding.ASCII.GetBytes(paramString.ToString());
request.ContentLength = data.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string responseStr = getStringFromWebResponse(response);
Response.Write(responseStr);
GPTooltext.Text = responseStr;
}
... View more
01-13-2022
12:35 PM
|
0
|
0
|
1276
|
|
POST
|
This is what the GP Tool is expecting...I think this is just down to syntax on my inputParam variable? Am I even doing this correctly...Basically the GP Tool accepts these parameters and then sends back a JSON file. I want to capture this JSON file and simply show the text in the app for starters.
... View more
01-13-2022
11:45 AM
|
0
|
1
|
1281
|
|
POST
|
I have some code that I was using in a different project to pass some parameters to a GP Tool. I am trying to reuse it but with a different C# call to a new GP Service with different parameters. In the example below which is a JavaScript example this is how the parameters I want to use were formatted. I need to somehow alter the JavaScript Param below into something this C# code can interpret...I dont know if this is just a formatting thing or what. NEW PARAMETERS needed BUT from JavaScript example - variable "inputParam" var geometry = xxxx.Session.searchRequestTextbox.siteGeometry;
var geometryType = (geometry.x)
? "point"
: (geometry.rings)
? "polygon"
: (geometry.paths)
? "polyline"
: ""
;
var inputParam = {
"site": FeatureSet.fromJSON(
{
"geometryType": geometryType,
"spatialReference": { "wkid": 102100},
"features": [
{
"attributes": {
"OBJECTID": 0
},
"geometry": geometry
}
]
}
),
"Buffer_Distance": LinearUnit.fromJSON({
"distance": VaFWIS.Session.searchRequestTextbox.Distance,
"units": "miles"
}),
"user": UserRoleINEED,
"Report_Type": xxx.Session.searchRequestTextbox.reportType
}; As you can see in this example below the "inputParam" was housing the parameters I was passing to this GP Tool in one long string where the python file parsed everything out and did its thing. I need to take the parameters as seen in the JavaScript example above and make a new "inputParam" variable with the parameters from the above example. Any thoughts? Anyone have an idea how I can do this???? EXISTING C# CODE CALLING GP TOOL protected void btnGpTool_Click(object sender, EventArgs e)
{
string gpUrl = "https://xxxxx/arcgis/rest/services/xxx/xxxx/GPServer/Search";
string requestUrl = gpUrl + "/execute";
//make sure requestUrl end with execute **
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(requestUrl));
request.KeepAlive = true;
request.Method = "POST";
request.AllowAutoRedirect = true;
request.CookieContainer = new System.Net.CookieContainer();
request.ContentType = "application/x-www-form-urlencoded";// my mistake should be form
StringBuilder paramString = new StringBuilder();
// THIS IS THE OLD inputParams string that needs to be replaced
// with the example I showed above
string inputParam = "{\"employees\":[{\"address\":\"15 Oak Ln, somewhere, Florida, 23229\",\"distance\":\"10\",\"id\":\"9a35172e071f4a33b191172a9b4b02ae\"}]}";
paramString.Append($"request=" + inputParam);//no need ?
paramString.Append($"&f=json");
byte[] data = Encoding.ASCII.GetBytes(paramString.ToString());
request.ContentLength = data.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string responseStr = getStringFromWebResponse(response);
Response.Write(responseStr);
... View more
01-13-2022
10:23 AM
|
0
|
3
|
1303
|
|
POST
|
Does the later have an actual example....I dont think you can just write execute(xyz,xyz,xyz)
... View more
11-30-2021
08:55 AM
|
0
|
1
|
1401
|
|
POST
|
I have an .aspx app that is running some JavaScript 4.13 api code. In this code I am calling a GP Tool that I published. This GP Service is not secured. I can navigate to it with no issues or credentials needed In Visual Studio I can run my code with no errors, which is calling this service If I go to the server where the website is I can run this code from IIS with no errors, which is calling this service If I navigate to this site from outside the server or Visual studio I get the error below asking me for credentials. The service is not secured....I am baffled. BUT if I open it on the server or Visual Studio I am not asked for the credentials....????? Anyone have any thoughts? Could this be something in the JS? Or maybe on the server side? Anyone ever see this before?
... View more
11-30-2021
08:51 AM
|
0
|
1
|
602
|
|
POST
|
I have an existing Publish GP Tool that accepts a couple Parameters. It does its thing and then passes back some results. Something is going on and I want to rewrite this persons code but before doing so I want to make sure I am doing this the most logical way. The Current project is using API 4.13 SERVICE OVERVIEW Execution Type: esriExecutionTypeSynchronous Supported Operations: Execute Task CREDENTIALS - I need to add to this a Token that the service will require as its secured. How do I add the token BELOW are the params I am looking to send NOTING - I need to use the EXECUTE not SUBMIT as that is what the service requires Can someone help with an example to show me the correct syntax etc to CALL and then grab the RESULTS and simply put in an ALERT box???? let params = {
"site": FeatureSet.fromJSON(
{
"geometryType": geometryType9,
"spatialReference": { "wkid": 102100 },
"features": [
{
"attributes": {
"OBJECTID": 0
},
"geometry": geometry9
}
]
}
),
"Buffer_Distance": LinearUnit.fromJSON({
"distance": xxx.Session.searchRequestTextbox.bufferDistance,
"units": "miles"
}),
"user": UserRole,
"Report_Type": xxxx.Session.searchRequestTextbox.reportType
};
... View more
11-30-2021
06:55 AM
|
0
|
3
|
1444
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|