POST
|
And my input destination : { "geometryType":"esriGeometryPoint", "features":[{ "geometry":{ "x":482548.57666716713, "y":6509457.736269861, "spatialReference":{ "wkid":102110, "latestWkid":2154 } }, "attributes":{ "Name":"Name", "CODE_ETA":"test", "DATE_ALIM":"7 nov. 2016", "REGCODE":null, "REGNOM":null, "X":482548.57666716713, "Y":6509457.736269861, } }], "sr":{ "wkid":102110, "latestWkid":2154 } }
... View more
11-07-2016
02:09 AM
|
0
|
0
|
330
|
POST
|
Thanks Luke, Here's my code : # Import arcpy module import sys, os, arcpy path = "path_BASE_ROUTIERE" matrix = "matrix" SIG = "SDEconnection" query = arcpy.GetParameterAsText(0) destination = arcpy.GetParameterAsText(1) # Process: Make OD Cost Matrix Layer arcpy.MakeODCostMatrixLayer_na(path, matrix, "NETWORK", "", "", "", "ALLOW_UTURNS", "Oneway", "USE_HIERARCHY", "", "NO_LINES", "") arcpy.MakeQueryLayer_management(SIG,"QUERY", query, "INSEE", "POINT", "2154","") # Process: Add Origins arcpy.AddLocations_na(matrix, "Origins", "QUERY", "CurbApproach CurbApproach 0;Name INSEE #;SourceID SourceID #;SourceOID SourceOID #;PosAlong PosAlong #;SideOfEdge SideOfEdge #", "5000 Meters", "", "L93_BDROUTE SHAPE;BDROUTE_12_Junctions NONE", "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "5 Meters", "INCLUDE", "L93_BDROUTE #;BDROUTE_12_Junctions #") # Process: Add Destinations arcpy.AddLocations_na(matrix, "Destinations", destination, "Name Name #", "5000 Meters", "", "L93_BDROUTE SHAPE;BDROUTE_12_Junctions NONE", "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "5 Meters", "INCLUDE", "L93_BDROUTE #;BDROUTE_12_Junctions #") # Process: Solve arcpy.Solve_na(matrix, "SKIP", "TERMINATE", "") The destinations/featureset in JSON format are passed in the local variable "destination" from my JavaScript code. This piece of code is in fact a part of a webservice called in REST. The result is then pushed in an oracle database on a server.
... View more
11-07-2016
12:40 AM
|
0
|
1
|
330
|
POST
|
Hello everyone, Do you know how to map a field in the Arcpy's AddLocations method, from a GPFeatureRecordSetLayer dataset (FeatureSet from my JavaScript code) ? I created an OD matrix that runs well and that's got for inputs destination GPFeatureRecordSetLayer. It seems to be a problem in the field mapping when I add a location to my destinations, since my location to add are GPFeatureRecordSetLayer and not a Table View. The field mapping goes well when I try it with a table but not with my FeatureSet. Therefore, in output, I don't have the names of my destinations as I wanted to have with the field mapping, but a default name (Location 1, or 2, or 3 ...). Difficult to retrieve the good destination then ! I wish I was enough clear. I can forward my piece of code if you need. Thanks in advance !
... View more
11-03-2016
06:45 AM
|
0
|
3
|
867
|
POST
|
Tkanks very much. The inverse isn't possible I guess ? I would keep wkid 102110 as much as possible.
... View more
08-18-2016
08:53 AM
|
0
|
1
|
848
|
POST
|
Maybe I have an explanation : the spatial reference of my graphic layer (4326) which contains my polygon isn't the same of the one of my map and feature layer (102110), but I don't know why and how to fix this issue. Do you have any idea ? Thank you !
... View more
08-18-2016
08:20 AM
|
0
|
1
|
848
|
POST
|
The value of 'sqlExpression' is just the name of the field "TOTAL". And yes, I'm using ArcGIS Server 10.4. I read that on the API reference for Query : "The definitions for one or more field-based statistic to be calculated. outStatistics is only supported on layers/tables where supportsStatistics is true. If outStatistics is specified the only other query parameters that will be used are groupByFieldsForStatistics , orderByFields , text , timeExtent and where ." Does it mean that the geometry parameter can't work anyway with my query ? I can get the features in my polygon without the outStatistics property. I can get outStatistics without the geometry parameter for the query. But I can't have both like in this example : ArcGIS API for JavaScript Sandbox : the query have a geometry parameter which is the point clicked by the user, a buffer of 1 mile is calculated around, and the stats are calculated on the features in the buffer from the feature layer. Isn'it contradictory with what is said above ? Or I surely misunderstand...
... View more
08-18-2016
06:16 AM
|
0
|
1
|
848
|
POST
|
Thank you for your response. It doesn't change anything however.
... View more
08-18-2016
12:22 AM
|
0
|
1
|
848
|
POST
|
Hello everybody, I'm trying to make a queryFeatures on a feature layer with StatisticDefinition : I would like to calculate statistics on the field "TOTAL" of my feature layer res, with the features which are within my polygon. Here's my code below : for the moment, I just append a console.log with the result, but the query doesn't work. The array of features stays empty and I don't have any error message. So I guess my query is poorly constructed but I don't see where. Could you help me please ? function (polygon, res) { var queryParams = new Query(); queryParams.spatialRelationship = Query.SPATIAL_REL_WITHIN; queryParams.geometry = polygon.geometry ; queryParams.outFields = ["*"]; var countSD = new StatisticDefinition(); var sumSD = new StatisticDefinition(); var avgSD = new StatisticDefinition(); queryParams.outStatistics = [countSD, sumSD, avgSD]; var sqlExpression = "TOTAL"; countSD.statisticType = "count"; countSD.onStatisticField = sqlExpression; countSD.outStatisticFieldName = "CountResDial"; sumSD.statisticType = "sum"; sumSD.onStatisticField = sqlExpression; sumSD.outStatisticFieldName = "SumResDial"; avgSD.statisticType = "avg"; avgSD.onStatisticField = sqlExpression; avgSD.outStatisticFieldName = "AvgResDial"; res.queryFeatures(queryParams, function (results){ console.log(">>>>>>>>>>>>>> r\351sultats de la query : "); console.log(results); }, function (err){ console.log("Impossible r\351cup\351rer le nombre de dialys\351s dans les tranches isochrones : ", err); } ); }
... View more
08-17-2016
07:53 AM
|
0
|
10
|
2230
|
POST
|
Thank you very much ! It works. I had already seen this method (toJson) but I had badly implemented.
... View more
08-04-2016
07:23 AM
|
0
|
1
|
778
|
POST
|
Hello ! I would like to clone in a new array (a deep copy without references) the features I have selected from a feature layer with the getSelectedFeatures() method. I try to use lang.clone from dojo but it doesn't work. I have this error : "TypeError: this._url is null". I understand it cames from the feature layer. But I don't know how to fix this error or even if it's possible to do what I want to do by this way. I'm quite new with JSAPI. I already used lang.clone with polygons from serviceAreaSolveResult and it worked very well ! Could someone help me on this problem ? Thanks in advance. Clemini.
... View more
08-04-2016
06:35 AM
|
0
|
4
|
2151
|
POST
|
Hello everybody, I have two different points with the same exact coordinates however, and when I use a ServiceAreaTask, it creates me just one ServiceAreaPolygon instead of two. The fact is the two points have the same SourceOID since they have the same coordinates. Do you know how to do to have in result two polygons, one for each point ? Thank you very much in advance ! Clementine.
... View more
07-28-2016
11:35 PM
|
0
|
0
|
868
|
POST
|
Hello everybody, I have an issue I don't know how to fix. I'm new with the ArcGIS API for JS and with ArcGIS generally. I have a feature layer with points, provided by a Mapserver. I would like to : - select some points on the feature layer (it's ok !) - then save the selection in a variable (an array Graphic[] I guess ? But is it possible ?) - add a new point on a map and store it in the variable with the previous selection (I know how to add a point to a map) - the goal is to have a global selection (existing points and the new point) in a variable that I could reuse to make geotreatments on it (with GPserver and NAserver). I can't publish Featureserver and I can't work on the server. That's why it seems to me complicated. Maybe I'm wrong ? Do you have please any solution ? Thank you in advance ! Clementine.
... View more
06-13-2016
12:21 AM
|
0
|
0
|
1853
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|