POST
|
I found out part of my problem. Part of the problem was that Python was not encoding the URL parameter properly, so the resulting POST data had several "polygons" parameters. Note to Pythonistas, careful when encoding a list using urllib.urlencode. If you don't want Python to mess it up, convert the input to a string using json.dumps. I was able to get around that, there's a follow up question though, was there a change to the REST services Geometry API? This works fine on 10.01. http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/areasAndLengths?sr=102009&polygons=[{%22rings%22%20:%20[[[-628833.344099998,206205.236200001],[-630269.659900002,192298.906100001],[-631848.233800001,173991.394400001],[-616471.690300003,341822.557500001],[-620213.661300004,301450.162799999],[-625923.431999996,237538.0579],[-628833.344099998,206205.236200001]]]}%20]&lengthUnit=9035&areaUnit={%22areaUnit%22%20:%20%22esriAcres%22} But NOT on 10.1 (Java). I have a 10.1 Java server, when I try it I get... Error computing areas and lengths
... View more
08-04-2013
07:08 PM
|
0
|
0
|
580
|
POST
|
I made a POST request to http://server/arcgis/rest/services/Geometry/GeometryServer/areasAndLengths? with params (printed JSON style): {'unitArea': 'esriSquareKilometers', 'inSR': 4326, 'sr': 4326, 'polygons': [{'rings': [[[624737.102378421, 674507.7128967925], [624703.1198332242, 674516.8809703351], [624678.3579736749, 674517.3108766628], [624628.0791328182, 674515.7126848222], [624577.8062321072, 674511.9558324739], [624553.0249462423, 674508.4671935294], [624528.6658106777, 674503.4727325841], [624504.8096018442, 674496.8065548505], [624481.2399919124, 674489.0636258594], [624434.7010280173, 674471.2469288022], [624296.6095075295, 674411.0486390791], [624249.8429077414, 674392.9975878554], [624174.8606508622, 674360.5509152239], [624149.8483882523, 674351.0162198526], [624125.7201276066, 674344.2252632563], [624103.0174248881, 674341.44737241], [624082.2761587613, 674343.9460022575], [624064.7174595818, 674354.6575938597], [624050.1560315224, 674373.2909675441], [624037.260138437, 674396.8217875691], [624024.7008604492, 674422.2257040791], [624011.1435935851, 674446.472500553], [623995.2594895436, 674466.5496456951], [623976.3535060093, 674482.7746448402], [623955.1449854912, 674496.8557094015], [623932.487549421, 674508.5599670123], [623909.2377319265, 674517.6692887793], [623885.3433296183, 674524.4054985167], [623860.5141640035, 674529.2872659322], [623835.2566122548, 674532.5032915722], [623810.0912001948, 674534.2480887137], [623785.5431102891, 674534.5625742475], [623763.0311536252, 674523.6863148771], [623740.7403635175, 674511.6598825476], [623627.4795980266, 674458.0662032078], [623583.9825736773, 674433.7586169936], [623563.1685434177, 674420.1311205938], [623543.0501935505, 674405.4153550249], [623445.994321507, 674326.1676019053], [623425.8807265006, 674311.3426603249], [623363.8456992453, 674268.5031316064], [623321.5504220851, 674241.1732057488], [623299.9380392397, 674228.5315922629], [623277.9283450139, 674216.8641556079], [623255.4635090185, 674206.3927569323], [623232.4658135396, 674197.3187141769], [623208.9121703702, 674189.5624434436], [623160.5624805916, 674177.0170762428], [623061.9462739243, 674156.6700486378], [622915.9572576231, 674121.7377045469], [622842.7641096178, 674105.4411974332], [622793.6627189713, 674096.2947743903], [622694.2343320857, 674084.8645088528], [622669.5693866448, 674080.7425645113], [622591.3764758058, 674070.7785205183], [622567.0143672656, 674064.6229717535], [622545.463610509, 674054.6219027401], [622527.4826991849, 674039.801741851], [622511.2341682597, 674022.3065966967], [622496.1756665751, 674002.9314327925], [622482.1319139139, 673982.0642495903], [622468.9332560182, 673960.0900574647], [622456.398769853, 673937.3968937375], [622421.049981957, 673868.859815256], [622411.7258490853, 673846.4027230933], [622414.0959531623, 673820.7126426708], [622393.6814705118, 673800.2981155802], [622427.4238607121, 674430.7346667841], [623093.208691542, 674801.6406906551], [623716.3647894118, 674813.9181460697], [623716.2944953864, 674809.6631010418], [623716.9522747253, 674781.64823447], [623720.0458727636, 674755.4338718368], [623726.8831027871, 674732.9518129734], [623738.7744669191, 674716.1131717042], [623757.5337275441, 674704.3422295667], [623781.9901260049, 674696.3914522016], [623809.6448599496, 674692.0761249566], [623837.9878522314, 674691.2145475216], [623864.514649832, 674693.6220163811], [623887.033752626, 674699.5045713398], [623907.1719652176, 674712.1297351819], [623925.629780152, 674730.2762999242], [623942.3855223957, 674751.4519420058], [623970.8608605497, 674794.0334948432], [623983.317716217, 674815.5439275162], [623985.2541851108, 674819.2219406321], [624527.706811122, 674829.9329516165], [624825.5482438056, 674577.3451217368], [624819.8354885612, 674572.4137772946], [624756.5039245205, 674524.3599134908], [624737.102378421, 674507.7128967925]]], 'spatialReference': {'wkid': 4326}}, {'rings': [[[622386.9646295855, 673674.806227139], [622408.3993862743, 673674.7638415402], [622433.4885441746, 673676.3282275016], [622457.9672844755, 673679.9401924938], [622481.7551198243, 673685.8099309339], [622505.2825503829, 673693.3026684335], [622528.5873537716, 673702.1523753325], [622551.651191563, 673712.1435903443], [622597.0276620126, 673734.6706876365], [622663.0295802618, 673771.5816338747], [622684.2579235788, 673784.9190249491], [622725.4102074049, 673814.5732068948], [622825.7178164157, 673893.923265717], [622846.2010372757, 673908.5975341029], [622867.0784448811, 673922.2622455643], [622888.4556180175, 673934.6597932418], [622910.4437233815, 673945.5236750797], [622933.1455389655, 673954.5992565388], [622956.663939746, 673961.6466687092], [623004.4813970585, 673973.8346956962], [623076.6371075853, 673991.1278235413], [623173.5786480741, 674012.4927777632], [623246.7739102518, 674027.3611806264], [623344.9268216051, 674045.8221141144], [623443.6126661402, 674062.9275577199], [623542.717145672, 674078.8938362249], [623667.01622315, 674097.5864833111], [623791.5681757014, 674115.2653604096], [624214.0069974023, 674173.0377658441], [624238.8514068106, 674175.2911573999], [624288.7257359553, 674177.921597385], [624489.1040059677, 674179.712438125], [624503.5016099622, 674105.3988687046], [624506.9365803006, 674080.7476478058], [624507.9514772148, 674056.3156807466], [624500.0905132808, 674032.7821568081], [624490.434199264, 674009.1892506361], [624486.5571045027, 673984.5995909754], [624482.2254379163, 673934.8461339144], [624426.1019799834, 673922.5098293921], [624216.9999671963, 673892.5080524479], [623977.3973705921, 673816.0093251087], [623801.599741631, 673744.4155666642], [623502.3963860553, 673680.803946687], [623125.9962688986, 673640.9137515769], [623046.8008378568, 673622.8036922908], [622936.8949516687, 673578.0074531202], [622831.4950426596, 673522.2116770743], [622692.9945214688, 673479.5070118022], [622394.19886963, 673367.4130773579], [622369.9043650574, 673356.0728324337], [622386.9646295855, 673674.806227139]]], 'spatialReference': {'wkid': 4326}}], 'f': 'json'}
... View more
08-04-2013
10:46 AM
|
0
|
0
|
580
|
POST
|
The logs also gave me this error: Internal Server Error. Error handling service request: Could not find a service with JNDI name 'esri/services/GeometryServer/Geometry' in the configured clusters. Service may be stopped or ArcGIS Server may not be running. I also tried it with ESRI's sampleserver1 and got the same 500 so I don't think my server is the problem.
... View more
07-31-2013
02:45 PM
|
0
|
0
|
580
|
POST
|
Hi all, I'm getting a 500 from the ESRI server's Geometry Service when I try to send a request to calculate the area. When I use Python code (requests library) to send the data, I get a 500 "Error computing areas and lengths". When I try to do a manual POST it works. I'm not sure how to reproduce this problem though. So my question essentially is, how do you get a 500 from the Geometry Service? I'm using 10.1.
... View more
07-31-2013
02:44 PM
|
0
|
4
|
4632
|
POST
|
So I have a layer in ArcGIS Server and I have a geometry in JSON (ArcGIS Server) and I want to find out if it intersects with my layer. How do I do that? I want to intersect with a Layer as opposed to an entire MapServer.
... View more
06-19-2013
07:33 PM
|
0
|
1
|
1969
|
POST
|
Hi all, I'm running Python using WSGI under Wamp. The user uploads a shapefile to my server then I try to run arcpy.Describe and even though os.path.exists(...) says the file exists, arcpy it telling me that the file doesn't exist. Is there any particular reason why this would happen? Also, if I run the same function from the console (instead of via the browser), arcpy is able to magically find the file. I'm using an absolute path to the file and I'm not using arcpy.env.workspace at all.
... View more
06-19-2013
05:06 PM
|
0
|
2
|
516
|
POST
|
Ok, here is what I'm doing... My app allows the user to use the map to draw a polygon or upload a polygon shapefile. The script on the server needs to find out if the polygon(s) supplied by the user interact with the layers I have saved already. I was thinking that the feature layers would be stored in ArcGIS server (10.1) as Geodatabase feature classes and also published as services to ArcGIS Server. I was thinking I would use arcpy code to access the geodatabase layers to do the querying and use the Service feature layers on the map to show the user the layer I'm comparing their geom to. Is this the best way to go about doing this? Hi, can anyone help me with this? I'm having serious trouble with this. The method I've done takes way too long. When the user uploads a shapefile I take the following steps: - Open the shapefile and store the geoms in an array - Make a feature layer for the comparison layer in ArcGIS server - Use SelectLayerByLocation then run a SearchCursor to determine intersection I have two main problems with this approach: - It's horrendously slow... I mean, the whole process can take minutes... which is spectacularly frustrating... - Sometimes arcpy.Describe throws an exception, claiming the file I JUST uploaded doesn't exist. - Other times it just sits there until Python dies. I'm currently deploying my solution using Python WSGI under WAMP. You guys have any suggestions? I'm desperate here and working with a past deadline. 😞
... View more
06-19-2013
04:21 PM
|
0
|
0
|
753
|
POST
|
Ok, here is what I'm doing... My app allows the user to use the map to draw a polygon or upload a polygon shapefile. The script on the server needs to find out if the polygon(s) supplied by the user interact with the layers I have saved already. I was thinking that the feature layers would be stored in ArcGIS server (10.1) as Geodatabase feature classes and also published as services to ArcGIS Server. I was thinking I would use arcpy code to access the geodatabase layers to do the querying and use the Service feature layers on the map to show the user the layer I'm comparing their geom to. Is this the best way to go about doing this?
... View more
09-10-2012
01:40 PM
|
0
|
0
|
753
|
POST
|
Sorry if I was unclear. My user is going to draw a polygon on the map or supply a point (dragging and dropping a push pin onto the map). Whichever geom is supplied (point or polygon) I want to convert that to JSON and send it to a script on my server. When the script on the server gets it I want to intersect that point/polygon with a layer that's stored on the server to find out if it intersects with the polygon/point. At worst it'll probably be a couple of polygons or one point, so you're saying I should convert those polygons/point to at least an in-memory feature layer? Maybe a shapefile or geodatabase feature class may be overkill? I'm very new to ArcGIS Python so I'm not sure what approach I should take to getting this done. What's the best way to store these "layers" on the server? In a geodatabase?
... View more
09-07-2012
06:59 AM
|
0
|
0
|
753
|
POST
|
Hi, I just installed and authorized 10.1. I can access the manager from the machine using localhost:6080/arcgis/manager however I can't access it outside using the IP of the machine. Also, I'm not sure what to enter for the ArcGIS server connection to manage the server remotely, elsewhere on the network using ArcCatalog. The IP of the ArcGIS server box is 10.0.40.115. For the host name I just used that IP, and for the server url I've tried the following and none have worked. 10.0.40.115:6080/arcgis 10.0.40.115:6080/arcgis/rest/services 10.0.40.115:6080/arcgis/services Any help? I got the access denied message, either the SOM is not started or the user you're trying to connect with is not a member of the agsadmin or agsuser blah blah.
... View more
09-06-2012
04:10 PM
|
0
|
1
|
3020
|
POST
|
I'm real new to arcpy and am trying to feel my way around. I have an application where the user supplies either a point/polygon in JSON, I convert that to an ESRI geometry and now I'm trying to find out if it intersects with a layer. I'm kind of lost. The touches function provided on each geometry I'm thinking won't do because it seems touch only checks if a geom touches the border of another geom. Is this accurate? Also it seems it can be done using Select_analysis? I saw a caution about it only working for Feature layers and not feature classes. Huh? What's the difference even. I tried using Intersect_analysis. Not sure if this will make sense but here's the code. def geom_intersects(esri_geom, layer):
ts = int(time.time())
intersect_tbl = "in_memory\\tmp_tbl_intersection_%s" % ts
if arcpy.Exists(intersect_tbl):
arcpy.management.Delete(intersect_tbl)
rows = arcpy.SearchCursor(layer)
for (index, row) in enumerate(rows):
arcpy.analysis.Intersect([row.Shape, esri_geom], intersect_tbl + "_" + str(index))
intersect_rows = arcpy.SearchCursor(intersect_tbl + "_" + str(index))
if intersect_rows:
for intersect_row in intersect_rows:
print "Intersection here: ", intersect_row.Shape.area, intersect_row.Shape.length, intersect_row.Shape.type
print " --- We have an intersection here: %s" % row.FID
return True
return False
... View more
08-16-2012
02:37 PM
|
0
|
6
|
1808
|
POST
|
Hi, I'm building an web application will accept a user input and query several layers for their values as well as do some processing to determine intersections, whether the user's geometry touches a layer in the system and so on. I'm very new to arcpy so I just need some general guidelines. Is it a bad approach to try and read the shapefiles on disk or from geodatabase to get all the answers I need, or should I... Should I let the user publish the layers (or use arcpy to publish the layers) then construct the identify url to the ArcGIS Server and work with that response?
... View more
08-15-2012
02:52 PM
|
0
|
0
|
648
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|