POST
|
Finally I had to come back on this one and I've got it working : In client side (javascript) : printTemplate.format = MapConfig.printService.format; printTemplate.layout = PrWidget.mapTemplatesFilteringSelect.get('displayedValue'); printTemplate.preserveScale = false; printTemplate.layoutOptions = { titleText:PrWidget.titleTextBox.get("value"), customTextElements:[ {Entite:PrWidget.entiteTextBox.get("value")}, {Rue:PrWidget.rueTextBox.get("value")}, {CodePostal:PrWidget.codepostalTextBox.get("value")}, {Ville:PrWidget.villeTextBox.get("value")}, {Contact:PrWidget.contactTextBox.get("value")}, {Mail:PrWidget.mailTextBox.get("value")}, {Telephone:PrWidget.telephoneTextBox.get("value")}, {Fax:PrWidget.faxTextBox.get("value")} ] }; It will automatically search for text elements in the mxd template base on textElement elementName that matches the keys (if I've got a textElement which elementName in "Entite" in my mxd, then it will update it with the value I defined). This prevent to add "extraParameters" just for updating text in the template.
... View more
03-16-2015
09:14 AM
|
0
|
0
|
152
|
POST
|
Hi, thank you Elise, Desktop is 10.2.1, Runtime is 10.2.3, is there a work arround ?
... View more
09-12-2014
04:53 AM
|
0
|
1
|
371
|
POST
|
Hi all, I'm trying to publish a Geoprocessing Package to use with ArcGIS Runtime 10.2.3, the geoprocessing uses arcpy function "FeaturesToJSON_conversion". I've got an error : "Tool Features To JSON is not licensed for use in an ArcGIS Runtime package". However, the documentation says that this tool is supported: https://developers.arcgis.com/java/guide/supported-geoprocessing-tools.htm What the problem is ? Thank you
... View more
09-09-2014
02:52 AM
|
0
|
4
|
3550
|
POST
|
I noticed something inconsistent with "null" value handling in ArcGIS Server. While doing "Queries", null values are retrieved as null (see attachment). While doing Identifies, null values are retrieves as string : "Null" (see attachment) These are examples of "Query" and "Identify" for the same data so you can notice the difference also illustrated in the attachment : Identify : http://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/MapServer/identify?geometry=%7B%22xmin%22%3A-9814291.012764301%2C%22ymin%22%3A5127179.36590259%2C%22xmax%22%3A-9812674.40536442%2C%22ymax%22%3A5128639.868823595%7D&geometryType=esriGeometryEnvelope&sr=&layers=&layerDefs=&time=&layerTimeOptions=&tolerance=0&mapExtent=%7B%22xmin%22%3A-9814291.012764301%2C%22ymin%22%3A5127179.36590259%2C%22xmax%22%3A-9812674.40536442%2C%22ymax%22%3A5128639.868823595%7D&imageDisplay=255&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&dynamicLayers=&returnZ=false&returnM=false&gdbVersion=&f=pjson Query : http://sampleserver6.arcgisonline.com/arcgis/rest/services/ServiceRequest/MapServer/0/query?where=OBJECTID+%3D+101156&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=pjson [ATTACH=CONFIG]33643[/ATTACH] I couldn't find anything about this on the forum and documentation. Please, can anyone provide explanations ? Thanks Also "Identify" return field aliases instead of field names, which is not handy at all.
... View more
05-07-2014
05:17 AM
|
0
|
1
|
587
|
POST
|
It seems that "Find" doesn't work either on Query Layer table. I also found this : http://forums.arcgis.com/threads/33117-strange-behaviour-querying-for-objects-id-a-query-layer http://forums.arcgis.com/threads/7376-querying-a-layer-that-has-it-s-table-joined
... View more
01-03-2014
03:50 AM
|
0
|
0
|
1110
|
POST
|
'Query Related Records' from ArcGIS Server 10.1 Rest API doesn't work from my Query Layer Table. I created a QueryLayer from tables that are not registered with the Geodatabase (Oracle 11g - ArcSDE 10.1). A Unique Identifier has been set : [ATTACH=CONFIG]30159[/ATTACH] The Query Layer Table has a relationship with a File Geodatabase FeatureClass : [ATTACH=CONFIG]30160[/ATTACH] Once published to the server, I'm querying related Records from the QueryLayerTable to the FeatureClass. In this example I try to get Related Records for the Object ID = 3, this returns no results although I know a related Record exists in the database : [ATTACH=CONFIG]30161[/ATTACH] So I'm trying the other way around, I'm querying related Records from the FeatureClass to the QueryLayerTable, this time I get my "OBJECTID = 3" related record from the QueryLayerTable : [ATTACH=CONFIG]30162[/ATTACH] The funny thing is that once a record was returned from the FeatureClass to the QueryLayerTable, then the "Query Related Record" works the other way around from the QueryLayerTable to the FeatureClass, but just for this record. I'm querying again Related Records from the QueryLayerTable to the FeatureClass with OBJECTID = 3, then it works : [ATTACH=CONFIG]30163[/ATTACH] But again, it won't work with OBJECTID = 4 although a related record exists in the database... Does anyone reproduce this ? Is there a special configuration I missed ? Thanks for your help.
... View more
12-31-2013
01:46 AM
|
0
|
8
|
5430
|
POST
|
Hello, The problem comes from the transparency as you know : "Invalid a value in color: 25500" At some stage, the solution consists in parsing the "webMapAsJson" to modify values, this is an extract that demonstrate how I changed GraphicsLayers's transparency :
import json
jsonMap = json.loads(webMapAsJson) # -- so you can manipulate the json
if jsonMap.has_key("operationalLayers"): # -- to get in the operational layer array :
for operationalLayer in jsonMap["operationalLayers"]: #-- for each operational layer :
if operationalLayer.has_key("featureCollection"): #-- That would be a graphicsLayer
modifyTransparencyInGraphicsLayers(operationalLayer) # -- Send to a function to modify the json (this remove transparency in my case)
outputJson = json.dumps(jsonMap ) # -- then you reencode your jsonMap to json
result = arcpy.mapping.ConvertWebMapToMapDocument(outputJson , templateMxd) # -- Finally you can get back to the method described in the tutorial
def modifyTransparencyInGraphicsLayers(operationalLayer): # -> Modify Tranparency for 'GraphicLayers'
if operationalLayer["featureCollection"].has_key("layers"):
for operationalLayersGraphicsLayerLayer in operationalLayer["featureCollection"]["layers"]:
if operationalLayersGraphicsLayerLayer.has_key("featureSet"):
if operationalLayersGraphicsLayerLayer["featureSet"].has_key("features"):
for graphicsLayerParams in operationalLayersGraphicsLayerLayer["featureSet"]["features"]:
if graphicsLayerParams.has_key("symbol"):
if graphicsLayerParams["symbol"].has_key("color"):
if len(graphicsLayerParams["symbol"]["color"]) == 4:
graphicsLayerParams["symbol"]["color"][3] = 255
if graphicsLayerParams["symbol"].has_key("outline"):
if graphicsLayerParams["symbol"]["outline"].has_key("color"):
if len(graphicsLayerParams["symbol"]["outline"]["color"]) == 4:
graphicsLayerParams["symbol"]["outline"]["color"][3] = 255
return operationalLayer
... View more
11-26-2013
05:13 AM
|
0
|
0
|
225
|
POST
|
Maybe you could convert it to json and then return it as string :
import json
outputJson = json.dumps(outputParam)
arcpy.SetParamter(outputJson )
... View more
10-04-2013
04:45 AM
|
0
|
0
|
297
|
POST
|
I usually script my stuff into a python.py file. Then I add my python script to a toolbox. And finally I publish the gp result as a geoprocessing service as shown on the tutorial I recommended above. After a quick look at python toolboxes, it seems to me that it is almost the same thing except that my two first steps are merged in one. Then to publish it a geoprocessing service, it works the same way. You can define inputs but you don't have to if you don't need any inputs from the webapp.
input = arcpy.GetParameterAsText(0) #It should be working the same in a python toolbox or it should be something similar
You can define an output too if you want (that could be the "message" you are talking about) :
if the script works :
output = "job done"
else :
output = "job not completed"
arcpy.SetParameterAsText(1, output)
- > in GetParameterAsText(0) and SetParameterAsText(1), 0 and 1 refer to the row number of the parameters list. What I don't know is how to define the inputs, output data-type (String, File), direction (Input, Output) and type (Optional, Derived) from a python toolbox (parameters don't appear in the toolbox properties). It might be filling out automatically with python toolbox. Then, when you call your geoprocessing service from you webapp, it will return an output if you defined one.
... View more
10-03-2013
12:23 AM
|
0
|
0
|
623
|
POST
|
Hi, yes, that should work, I would probably do it that way too. I guess that on the client side, the "editToolbar.deactivate();" could work as a trigger, to call the geoprocessing service. You must be pretty close from the solution...
... View more
10-02-2013
11:44 PM
|
0
|
0
|
498
|
POST
|
Is changing the last point X coordinate value according the coordinate system distance unit working ?
... View more
10-02-2013
02:46 PM
|
0
|
0
|
366
|
POST
|
I'm pretty sure you can not change mapservice datasource with arcpy unfortunately. I can't find a specific post or documentation that explicitly says it but I remember I voted for someone suggesting the idea on http://ideas.arcgis.com You can not use arcpy.mapping replaceWorkspaces, ArcGIS Server is not part of the "replaceable" workspace. Here A mapservice can be list as a layer in a map document using : for layer in arcpy.mapping.ListLayers() Then it has the property : layer.isServiceLayer = True So you can access to its : layer.serviceProperties with the information about ArcGIS Server connection properties. However, serviceProperties are read only... 😞 If I'm right, this limitation should definitively appear and here, here Dear Esri, can we have further information about it ?
... View more
10-02-2013
02:20 PM
|
0
|
0
|
394
|
POST
|
If I am editing a feature service, I need to create a local copy. I don't have a choice of where I can save it. It gets saved to a folder in the user directory. Is there a way for arcgis server to see that? A feature service is a particular ArcGIS Server service that exposes sde geodatabase editing functionalities through the web. The feature class or table to be edited need to be "registered with the geodatabase". Here is some information about feature service data requirement. Changes are saved to the database itself. Your sentence makes no sense to me... 😉 My objective is to have a web app to edit features in a feature service. But the web app will run a geoprocessing service. You can edit data through a geoprocessing service, for example : adding values to a table. Then you neither have to use a feature service nor to use database versionning. If you need to update features geometry and attributes though a web mapping application however, then you should expose your data as a feature service. On the client side (web app) you can use the editor component to handle the editing tasks. Here is an example with the Flex api, you can find it for javascript too. However to test the gp, I cannot run the data with the feature service without first having a local copy. However the data that was copied to the local folder cannot be copied to the server (this is the message I get when I try to publish it) Again, you should choose between editing your data through a geoprocessing service or a feature service. It makes no sense to edit a feature service through a geoprocessing service. It's like filling a watering-can to fill another watering-can to water your garden. ArcGIS Server says that it will copy your data to the server because the local folder where you save your data is not registered with the server. Here is more information about it. so I am not sure how to publish a geoprocessing service that will be editing a feature service :rolleyes: You should read some documentation about feature services. Once you have published your feature service, check the Flex or Javascript API to learn how to use the Editor Component client side (follow the link above) I hope it helps.
... View more
10-02-2013
01:18 PM
|
0
|
0
|
498
|
POST
|
If you mean publishing your script as a geoprocessing service, yes it will work 😄 Here is a great step-by-step tutorial that covers the whole scope. It is about a printing geoprocessing service. http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0154000005z2000000/
... View more
10-02-2013
11:58 AM
|
0
|
0
|
623
|
POST
|
Also, an alternative for me is to publish my CAD files as a mapservice with ArcGIS 9.3, to cache it and then to use the cache with a 10.1 mapservice. The problem I have in this scenario is the one I described in the previous post : Adding DWG Layer using arcpy.AddLayer doesn't preserves CAD symbology as it does when you add the layer manually in ArcMap. Adding my thousands of CAD files at once manually craches ArcMap. Does anyone know how to add DWG layers to ArcMap using python and how to preserve the CAD symbology ?
... View more
09-30-2013
03:57 AM
|
0
|
0
|
250
|
Online Status |
Offline
|
Date Last Visited |
11-16-2022
02:19 PM
|