POST
|
Just arrived at that conclusion. I assumed that python was passing a referer with the request. After I added it manually all was good.
... View more
10-22-2013
05:06 PM
|
0
|
0
|
600
|
POST
|
Thanks, I did that. Although I'm not sure anyone outside of Esri is going to be able to answer this...
... View more
10-22-2013
08:05 AM
|
0
|
0
|
600
|
POST
|
Cross posting from ArcGIS Online forum at the recommendation of Esri. I have to use python and the REST API to geocode records against the ArcGIS Online World Geocoding service. I can successfully request a token, but when the token is passed as part of the geocode request I get an error message returned that it is invalid, with no other information. I've tried passing it as a url parameter and/or a header and both. If I omit the the token and the forStorage parameter I can successfully obtain a response as expected, but I can't use this method because I need to store the results. The server that the python script is running on is a VM in a Microsoft hosting environment. The token request requires the referring "website". In this case it is not a website, but a server so I am substituting the IP address of the server, assuming this is how the geocoding service is validating the geocode request. I've tried both the internal and external IP addresses, but neither have worked. The docs recommend not using the REST API, but I have no choice in this case. I need to know more about how the geocoding service is validating the token and how it interprets "websites" or in my case an ip address. Any help would be much appreciated.
... View more
10-22-2013
04:52 AM
|
0
|
2
|
2846
|
POST
|
Cross posting from ArcGIS Online forum at the recommendation of Esri. I have to use python and the REST API to geocode records against the ArcGIS Online World Geocoding service. I can successfully request a token, but when the token is passed as part of the geocode request I get an error message returned that it is invalid, with no other information. I've tried passing it as a url parameter and/or a header and both. If I omit the the token and the forStorage parameter I can successfully obtain a response as expected, but I can't use this method because I need to store the results. The server that the python script is running on is a VM in a Microsoft hosting environment. The token request requires the referring "website". In this case it is not a website, but a server so I am substituting the IP address of the server, assuming this is how the geocoding service is validating the geocode request. I've tried both the internal and external IP addresses, but neither have worked. The docs recommend not using the REST API, but I have no choice in this case. I need to know more about how the geocoding service is validating the token and how it interprets "websites" or in my case an ip address. Any help would be much appreciated.
... View more
10-22-2013
04:52 AM
|
0
|
0
|
714
|
POST
|
I have to use python and the REST API to geocode records against the ArcGIS Online World Geocoding service. I can successfully request a token, but when the token is passed as part of the geocode request I get an error message returned that it is invalid, with no other information. I've tried passing it as a url parameter and/or a header and both. If I omit the the token and the forStorage parameter I can successfully obtain a response as expected, but I can't use this method because I need to store the results. The server that the python script is running on is a VM in a Microsoft hosting environment. The token request requires the referring "website". In this case it is not a website, but a server so I am substituting the IP address of the server, assuming this is how the geocoding service is validating the geocode request. I've tried both the internal and external IP addresses, but neither have worked. The docs recommend not using the REST API, but I have no choice in this case. I need to know more about how the geocoding service is validating the token and how it interprets "websites" or in my case an ip address. Any help would be much appreciated.
... View more
10-21-2013
05:59 PM
|
0
|
5
|
892
|
POST
|
The proxy config needed to be updated with "http://www.arcgis.com". Apparently I haven't had a need for this one yet. I lost Fiddler when IT upgraded me to Windows 7, but now that I broke all their rules again... Fiddler exposed it, the Post and Host were different in the FF/Chrome request from the IE request. All fixed now. Thanks for reminding me to get and use Fiddler.
... View more
09-17-2012
05:30 AM
|
0
|
0
|
351
|
POST
|
I dropped a copy of the "Add Shapefile" sample, http://help.arcgis.com/EN/webapi/javascript/arcgis/demos/portal/portal_addshapefile.html, on my server, updated the css and proxy links and fired it up and it works fine in Chrome and FF. Btw, the actual sample running on Esri's box works fine in all browsers. In IE* when the esri.request fires it fails with error: "Unable to get value of the property 'value': object is null or undefined". What might be the problem? Is there a work around?
//use the rest generate operation to generate a feature collection from the zipped shapefile
esri.request({
url: portalUrl + '/sharing/rest/content/features/generate',
content: myContent,
form: dojo.byId('uploadForm'),
handleAs: 'json',
load: dojo.hitch(this, function (response) {
dojo.byId('upload-status').innerHTML = '<b>Loaded: </b>' + response.featureCollection.layers[0].layerDefinition.name;
addShapefileToMap(response.featureCollection);
}),
error: dojo.hitch(this, errorHandler)
});
... View more
09-14-2012
11:42 AM
|
0
|
6
|
1567
|
POST
|
I found the problem. The docs show that the defaultSymbology for the UniqueValueRenderer is "optional" so I did not provide one as I am capturing and using all possible values in the target attributeField(s). So I only passed the attributeField name into the new renderer, but by doing this the graphicsLayer renderFields property was not updating. I added a place holder for the default symbology ("") and passed it in with the attributeField to make it work. The refresh method was working all along, but it couldn't apply symbology to an undefined attributeField, duh. Guess the gotcha here was that the defaultSymbology is not really, really optional; you have to pass something in its places so that the required attributeField is read correctly.
... View more
09-12-2012
08:05 AM
|
0
|
0
|
376
|
POST
|
I have graphics layer who's symbology is set by default using a SimpleRenderer. Upon applying a UniqueValueRenderer to the graphics layer I confirmed in Firebug it took... The docs do not show, but Firebug does show a .refresh() method for the graphicsLayer. I tried this, but it doesn't work. How do I get the layer's display to update with the new symbology?
... View more
09-12-2012
06:40 AM
|
0
|
2
|
2997
|
POST
|
Thanks for the explanation. Good thing I came up with this then, I was just looking for an easier way to do it. Obviously only for polygons...
class readGeo:
def __init__(feat, geom):
feat.geom = geom
def returnGeom(feat):
fGeom = feat.geom
partCount = fGeom.partCount
rings = "["
featLst = []
vrtxNum = 0
while vrtxNum < partCount:
part = fGeom.getPart(vrtxNum)
pnt = part.next()
while pnt:
featLst.append("[" + str(int(round(pnt.X))) + ", " + str(int(round(pnt.Y))) + "]")
pnt = part.next()
if not pnt:
for pair in featLst:
rings += pair + ", "
del featLst[:]
rings = rings[0:len(rings)-2] + "]"
pnt = part.next()
if pnt:
rings += ", ["
elif partCount > 1:
rings += ", ["
vrtxNum += 1
if partCount == 1:
return rings
else:
return rings[0:len(rings)-3]
... View more
08-10-2012
04:17 AM
|
0
|
0
|
224
|
POST
|
Okay, question: Using the geo_interface on a multi-part feature with a hole in one of the parts returns the below value for coordinates. If you notice in the midst of the coordinates is "None". The point at which this appears, appears to be the demarcation between the part and its hole. How is "None" going to be interpreted by a program receiving the json? [[(-9254388.2779676616, 3457813.8078284338), (-9377036.4553730804, 3457813.8078284338), (-9377036.4553730804, 3563951.6536600441), (-9254388.2779676616, 3563951.6536600441), (-9254388.2779676616, 3457813.8078284338)], [(-9406523.9989057705, 3626128.8613477843), (-9406523.9989057705, 3519991.0155161736), (-9529172.1763111949, 3519991.0155161736), (-9529172.1763111949, 3626128.8613477843), (-9406523.9989057705, 3626128.8613477843), None, (-9499902.5223645903, 3603858.4769027131), (-9500932.2585095931, 3540838.6248286134), (-9430498.3061914891, 3542486.2026606067), (-9430910.2006494887, 3603858.4769027131), (-9499902.5223645903, 3603858.4769027131)]] This is how the Portal API returns the same geometry: [[[-9254388,3457814],[-9377036,3457814],[-9377036,3563952],[-9254388,3563952],[-9254388,3457814]],[[-9406524,3626129],[-9406524,3519991],[-9529172,3519991],[-9529172,3626129],[-9406524,3626129]],[[-9499903,3603858],[-9500932,3540839],[-9430498,3542486],[-9430910,3603858],[-9499903,3603858]]]
... View more
08-09-2012
12:05 PM
|
0
|
0
|
224
|
POST
|
Anyone know if there is a Geom to Json in python? Essentially the opposite of arcpy.AsShape(), Json to Geometry object.
... View more
08-09-2012
11:05 AM
|
0
|
4
|
590
|
POST
|
Has anybody written any Python code to create a JSON representation of a featureclass, specifically a featureCollection that can be consumed in a Javascript API app as a FeatureLayer? Similar, or rather the same, to what is returned from the Javacript API sample "Add Shapefile": http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jssamples/portal_addshapefile.html Or is there an arcpy function that can do this? Just want to check before I run and recreate the wheel. The GPFeatureRecordSetLayer that is returned by a geoprocessing service is too light weight, i.e. lacks many of the JSON object name/value pairs of shapefile attribute information. Thanks
... View more
07-17-2012
11:53 AM
|
0
|
0
|
491
|
POST
|
See the pics for the best idea of whats happening... Geocode, centerAndZoom(location, 16) results in the infowindow being off from the point Geocode, manual pan and Zoom results in the infowindow being off from the point Geocode at level 16 everything is fine including pan Thoughts? Thanks
... View more
07-12-2012
02:29 PM
|
0
|
1
|
711
|
POST
|
Assuming you are talking about downloading the "Javascript" ArcGIS API, you can find instructions for that in the API documentation: http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jshelp_start.htm > Concepts > Getting Started > Get the ArcGIS API for Javascript But if you are looking to dissect it you may find it difficult since the code is obfuscated.
... View more
07-11-2012
03:56 AM
|
0
|
0
|
259
|
Title | Kudos | Posted |
---|---|---|
1 | 09-28-2010 04:51 AM |
Online Status |
Offline
|
Date Last Visited |
02-21-2022
06:14 PM
|