POST
|
Yes, my goal is to do this programatically through python. I was hoping I could find something in arcpy that could handle this for me, but it looks like I'll have to alter the json after the service has been published, and the map server cache has been created. Thanks for pointing me in the right direction.
... View more
06-29-2017
01:32 PM
|
0
|
1
|
1154
|
POST
|
I'm trying to do something similar, using GP tools to create/manage the cache once the service has been created. However, none of the GP tools give me the ability to set the "Create tiles on demand" property... Is this something that can only be done by altering the SD draft prior to service creation? Thanks, Jason
... View more
06-29-2017
10:58 AM
|
0
|
3
|
1154
|
POST
|
Solved my own problem. I dumped the output object to a json string, and the double quotes are preserved: output = {"bbox": bbox, "elevations": elevation_list, "rows": rows, "columns": columns} #Set Output arcpy.SetParameter(2, json.dumps(output))
... View more
04-04-2017
04:54 PM
|
1
|
0
|
429
|
POST
|
Hello, I have a geoprocessing service that returns a JSON object as a result. When viewing the HTML response through the service's rest endpoint, the result "value" object has its attributes in double quotes (columns, rows, bbox, xmin, ymin, etc...): However, when viewing the json response, the result "value" object is in single quotes: Is there a way to ensure that my geoprocessing service returns all attributes with double quotes in the json response? In my code, I set the response like this: output = {"bbox": bbox, "elevations": elevation_list, "rows": rows, "columns": columns} #Set Output arcpy.SetParameter(2, output) Thanks, Jason
... View more
04-04-2017
10:09 AM
|
0
|
1
|
1070
|
POST
|
You're right Darren, I was getting thrown off by the png extension. It's not actually a png, it's a geodatabase raster. It looks like you can only store "raster" in the in memory workspace.
... View more
02-24-2017
01:36 PM
|
0
|
0
|
1253
|
POST
|
I'm using arcpy.CopyRaster_management to copy a local tiff into an in memory png: tiff = r'C:\Temp\my_tif.tif' png = r'in_memory\my_png.png' CopyRaster_management(tiff, png, pixel_type='32_BIT_SIGNED', format='PNG') f = open(png)
... View more
02-24-2017
01:06 PM
|
0
|
1
|
1253
|
POST
|
Tom, Good idea...however, python doesn't seem to want to open an "in_memory" raster: Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> IOError: [Errno 2] No such file or directory: 'in_memory\\my_png.png' Thanks, Jason
... View more
02-24-2017
11:41 AM
|
0
|
3
|
1253
|
POST
|
Does anyone know how to convert an in memory png to a base64 string? My raster is defined as: png = "in_memory\my_png.png" I then try to convert it: import base64 base64_string = str(base64.b64encode(png)) base64_string gets populated as: aW5fbWVtb3J5XG15X3BuZy5wbmc= Which, when decoded is: in_memory\my_png.png ...not exactly what I had in mind. Is this even possible do do in a geoprocessing script? Thanks, Jason
... View more
02-24-2017
10:39 AM
|
0
|
7
|
1894
|
POST
|
Hello, I'm trying to add a list of coordinates to a feature class in arcpy. When I manually add each xy pair as graphics into arc map using the go to xy tool, the points show up where I expect them to: However, when I use arcpy, they are slightly offset: Here is the code I'm using: <code> import arcpy, json, ConversionUtils arcpy.Delete_management("in_memory") coordinates = [ [-118.3436607214932, 34.18465195557297], [-118.3437040116469, 34.18108463923645], [-118.338436218283, 34.18097397459129], [-118.3383716114292, 34.18454551218532], [-118.3421286432001, 34.18221218702963], [-118.3398871274149, 34.18236566520285] ] feature_class = arcpy.CreateFeatureclass_management("in_memory", "temp_feature_class", "POINT") cursor = arcpy.da.InsertCursor(feature_class, ['SHAPE@']) points = [] for (x, y) in coordinates: points.append(arcpy.Point(x, y)) for point in points: cursor.insertRow([point]) sr = arcpy.SpatialReference(4326) arcpy.DefineProjection_management(feature_class, sr) arcpy.FeatureClassToShapefile_conversion(feature_class, "C:/Temp") </code> Is anyone able to reproduce this problem, and if so, what is causing it and what can I do to fix it. Thanks, Jason
... View more
02-17-2017
12:43 PM
|
0
|
2
|
1448
|
POST
|
ArcREST ArcGIS Python API It seems like there's a lot of overlap between the two. Is there an advantage to using one over the other? Will ArcREST eventually be absorbed by the ArcGIS Python API?
... View more
09-13-2016
03:27 PM
|
2
|
4
|
3423
|
POST
|
Hi Michael, I was able to diagnose my problem as "vertical features". I have some 3D models that I was trying to publish into a scene service on AGOL, but they contain several polylines that have multiple vertical segments. Portal doesn't have a problem with it, but apparently, it's a "known limitation" (not a bug) in AGOL. They've reopened it as a bug though and hopefully they'll "add" the functionality soon. My temporary workaround is to loop through each feature to find vertical segments, and offset the x coordinate by a very small amount; the result is an unnoticeable tilt that prevents AGOL from considering it a vertical segment. -Jason
... View more
09-02-2016
09:59 AM
|
0
|
3
|
536
|
POST
|
Yes, you can publish a service on your own ArcGIS Server (using ArcMap, not Pro), and then reference it as an "Item" in AGOL by going to "My Content" -> "Add Item" -> "From the Web". From there, you would add the service's rest endpoint and click "Add Item". -Jason
... View more
09-02-2016
09:52 AM
|
2
|
4
|
1349
|
POST
|
Hi Michael, Were you able to find a resolution to this? I'm running into the same issue with some of my data. I thought I needed to simplify my features (too many vertices), but after running a vertex count, my features max out at 99, so that can't be the problem. -Jason
... View more
08-23-2016
11:39 AM
|
0
|
5
|
536
|
POST
|
This seems to be the way ESRI is headed, tying together with a tight knot ArcGIS Server and Portal/AGOL. I'm very disappointed that this is their road ahead as it forces me to purchase products that I don't have a business use case for. I've used ArcMap and ArcGIS server for years, with no need for Portal/AGOL, and have been patiently waiting for the ability to publish 3D data. So now Pro can publish 3D data, and what do they do? Require you to go through Portal or ArcGIS online. I completely understand why using Portal/AGOL as means to organize/expose your ArcGIS Server services is beneficial, as exclusively using rest endpoints from ArcGIS Server can sometimes get complicated. But I also completely disagree with ESRI's business model here; users should have a choice, not be forced to use something they don't need or want.
... View more
08-18-2016
10:19 AM
|
18
|
0
|
1896
|
POST
|
Thanks Pat. I took a similar approach with the mouse-move event, but used a dojo moveable instead of using the edit toolbar. The event object contains the properties movementX and movementY which are the screen units the cursor travels between the current and last mouse-move event. If I add those up each time I begin a drag, I can get the total change in screen units over the entire move; these values can then be used to shift each vertex in the graphic (with some help from screenUtils) as I move it. I created an example using a polyline here: Updating the coordinates of a moving graphic. - JSFiddle Thank you all for your help, Jason
... View more
04-06-2016
08:26 AM
|
0
|
0
|
1118
|
Title | Kudos | Posted |
---|---|---|
1 | 04-04-2017 04:54 PM | |
2 | 09-02-2016 09:52 AM | |
2 | 09-13-2016 03:27 PM | |
18 | 08-18-2016 10:19 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|