|
POST
|
umm... It looks like ArcGIS API for Python does not support the true curves. In order to draw it on the web map, it needs to be converted using the densify function.
... View more
04-11-2018
10:50 PM
|
1
|
0
|
2905
|
|
POST
|
There were some errors in code shown in the screenshot. I tried to tidy up the code and did some copy and paste before I did the snipping. I figured out why the buffer was not drawn: It was because of the projection, the input feature needs to be projected. (the documentation of the API needs to be improved, I have to dive into their source code to find the acceptable input feature types ... ) Here is the working code: Use the default coordinate system (4326) sr= {"wkid": 102100, "latestWkid": 3857}
sr2={"wkid":4326}
#Adelaide = geocode("Adelaide, South Australia",out_sr=sr,as_featureset=False)[0]
Adelaide = geocode("Adelaide, South Australia")[0]
map1.height = '650px'
map1.center=(Adelaide['location']['y'],Adelaide['location']['x'])
map1.zoom=14
p=Point(Adelaide['location']) map1.clear_graphics()
symbol = {"angle":0,"xoffset":0,"yoffset":0,"type":"esriPMS","url":"http://static.arcgis.com/images/Symbols/Basic/RedSphere.png",
"contentType":"image/png","width":24,"height":24}
#draw the point map1.draw(p,symbol=symbol) #important, project the location before buffering
_p=project([p],in_sr=sr2,out_sr=sr)[0]
fill={"type": "esriSFS", "style": "esriSFSSolid", "color": [255,0,0,255]}
buf=buffer(geometries=[_p],in_sr=sr,distances=[500],unit='Meters') #this is the key
buf[0]['spatialReference']=sr
f=Feature(buf[0])
fset=FeatureSet([f],spatial_reference=sr) map1.clear_graphics()
map1.draw(fset,symbol=fill)
map1.draw(p,symbol=symbol)
... View more
04-06-2018
01:27 AM
|
0
|
0
|
3071
|
|
POST
|
Thanks Shan. The use_proximity.create_buffers works. but it's not straight-forward. according to the source code of the API, it should accept geocode result as an input feature, but that will cause and error. reconstruct the result as a tuple works. Adelaide = geocode("Adelaide, South Australia")[0] prox=use_proximity.create_buffers((Adelaide['location']['y'],Adelaide['location']['x']),distances=[10],units='Miles') map1.add_layer(prox)
... View more
04-06-2018
01:21 AM
|
1
|
2
|
3071
|
|
POST
|
Hi, Has anyone ever tried to draw a buffer on the map using geometry.buffer in ArcGIS API for Python? I can draw a point or a simple polygon on the map, but when I try to draw a buffer,a circle around a point, which is a polygon in essence, it won't be dawn, nor does it return me any warning or error. I am stuck and puzzled... screenshots are attached, any advice and suggestions are highly appreciated.
... View more
04-05-2018
12:45 AM
|
0
|
5
|
3755
|
|
POST
|
Hi Robert, I finally makes it working. I did read the article, and tried a few things on the printer drivers and after a few hours I gave up Today I tried my plotter driver using ArcGIS Server Account, it worked! kind of strange though, I am using my own account in the custom print service, the ArcGIS Server Account doesn't work with my print service for unknown reason, but this is another story. Thank you for reassuring me that the solution will work, and I tried it again, it worked Simo
... View more
04-03-2018
07:18 PM
|
0
|
7
|
2650
|
|
POST
|
Hi Rohit, If I use just the hostname of my corporate proxy, it works! gis=GIS(url="http://abc.maps.arcgis.com",username="simoxu",proxy_host="xxx.xxx.abc.gov.au",proxy_port="8080") I am happy my corporate proxy is working now, but my Cntlm proxy does not work with the API. (there was a time my corporate proxy didn't work with my ArcREST python code, I had to set up a local proxy using cntlm to relay the request to the corporate proxy. ) if I use cntlm proxy with ArcGIS API for Python, I can't get the layers and tables. I am sure the cntlm is working. gis=GIS(url="https://abc.maps.arcgis.com",username="XXXX",proxy_host="127.0.0.1",proxy_port="3218")
... View more
04-03-2018
06:01 PM
|
0
|
0
|
1232
|
|
POST
|
No idea why ESRI commented out the following line in the print.js code. //fix issue #7141 // this.printparams.outSpatialReference = this.map.spatialReference;
... View more
04-02-2018
10:31 PM
|
1
|
0
|
1842
|
|
POST
|
I still have the same issue as of today when printing A3-sized pdf map. it seems the png, jpg format works fine. My default printer for the ArcGIS servers are Microsoft XPS Document Writer, the servers are virtual machines....
... View more
03-28-2018
07:16 PM
|
0
|
16
|
2650
|
|
POST
|
Update: The local distributor insists we can only get AppStudio standard license in ArcGIS Developer Subscription (ADS), and we can't renew our AppStudio standard license in our AGO Organisation. and it seems there is no easy way for them to transfer the license from ADS to Organisation either. They gave me some advice in regard to how to share the apps developed in ADS with members of my AGO Organisation. but I still can't understand why I need to create a new ADS AGO site which I will never use other than license an isolated AppStudio for ArcGIS. To share the apps built in the AppStudio, I have to be invited into my AGO Organisation in which I am an administrator using organisational account. What's the rationale in this? What's the benefit of this change of licensing? It does not make any sense from my point of view, neither can I see any business benefit for ESRI. Hopefully, this is only a communication issue among ESRI Inc., ESRI local distributor and us as a customer.
... View more
03-18-2018
04:53 PM
|
2
|
2
|
1728
|
|
POST
|
Hi Ismael, Is it still possible to grant AppStudio for ArcGIS Standard License to developers in my AGO organization? I heard that we can't renew our AppStudio Standard License in our AGO organisation, Instead, we need to buy Standard License through ArcGIS Developer Subscription(ADS) (previously called EDN). If this is true, this will cause some technical inconvenience when sharing the app in the orgnisation. What's the rationale behind this change? Regards, Simo
... View more
03-18-2018
04:19 PM
|
0
|
0
|
1078
|
|
POST
|
Unable to create replica. Please check your parameters. 'geometry' parameter is invalid You are guaranteed to see this error when using geometry filter as parameter to create a replica in the latest ArcGIS API for Python (V1.4.0)! in the signature of function FeatureLayerCollection.replicas.create, it states geometry_filter parameter as the following: geometry_filter - spatial filter from arcgis.geometry.filters module to filter results by a spatial relationship with another geometry Following this instruction, I constructed an filter object: flc=gis.content.get('1bedbababababababab5') aa=flc.layers[0] fset=aa.query() geom=None f=None geo_filter=None count=len(fset.features) if count>0: f=fset.features[0] geom=f.geometry if geom is not None: geo=Polygon(geom) geo_filter=arcgis.geometry.filters.contains(geo,'102100') ..... fs = FeatureLayerCollection(url, gis) ...... result = fs.replicas.create(replica_name='test', layers='0,1,3,4,6,8,10,12,13,15', layer_queries=layerQs, geometry_filter=geo_filter, replica_sr='102100', transport_type="esriTransportTypeUrl", return_attachments=returnAttach, return_attachments_databy_url=returnAttachbyURL, asynchronous=False, attachments_sync_direction=attachSyncDirect, sync_model="none", data_format=format, replica_options=None, wait=False, out_path=r'C:\Temp\fs_replicas', sync_direction='bidirectional', target_type="client") geo_filter will crash the function, 100%. Why? json representation of geo_filter object was posted to the following endpoint (REST Resource) http:// <featureservice-url>/createReplica This resource only accepts geometry, geometryType,inSR, but not geometry.filters format. click the following link to find the acceptable parameters createReplica Create Replica—ArcGIS REST API: Services Directory | ArcGIS for Developers The difference between the acceptable geometry and geometry.filters? just give you an example: geometry: {'rings': [[[14884284.6024463, -3776313.01482297], [15552038.4815454, -3766529.07520247], [15657215.8324658, -4475864.69768871], [15192478.700492, -4307091.73923509], [14884284.6024463, -3776313.01482297]]]} geometry.filters.contains: {'geometry': {"rings": [[[14884284.6024463, -3776313.01482297], [15552038.4815454, -3766529.07520247], [15657215.8324658, -4475864.69768871], [15192478.700492, -4307091.73923509], [14884284.6024463, -3776313.01482297]]]}, 'geometryType': 'esriGeometryPolygon', 'spatialRel': 'esriSpatialRelContains'} How to fix it? Pretty simple, only 3 lines of code. in the layer.py under the following folder: C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis-1.3.0-py3.6.egg\arcgis\features line 1453 (v1.3.0) / line1467 (v1.4.0): if geometry_filter is not None and \ isinstance(geometry_filter, dict): ##comment out the original code and get geometry, geometryType and inSR seperately! ##params['geometry'] = geometry_filter params['geometry'] = geometry_filter['geometry'] params['geometryType'] = geometry_filter['geometryType'] params['inSR'] = geometry_filter['inSR'] #params.update(geometry_filter) Conclusion: It seems just an oversight in the API development, and it won't take much to fix. But, this bug should not slip through the QA process, because creating replica is such an important function, and using geometry to clip data and create a replica is such a common GIS practice. I guess the bug has been around for quite a while, it's already v1.40 ! Please fix it. This puzzled me for the whole afternoon, I hope others can avoid it. Atma Mani John Yaist
... View more
03-15-2018
07:28 PM
|
0
|
2
|
2596
|
|
POST
|
As we all know: ArcGIS API for Python is a Pythonic wrapper for ArcGIS REST API which is specifically designed for Web GIS. ArcPy, I guess, is more a wrapper around ArcObjects which is underpinning ArcGIS Desktop GIS functions. These two sets of Python APIs give us different level of access to our GIS assets using python, I view them supplementary to each other. It makes sense to use common data model. or at least provide some utilities to facilitate data model exchange. Let's see what the others think.
... View more
03-15-2018
04:17 PM
|
1
|
0
|
1766
|
|
POST
|
Hi Rohit, I am migrating some code built roughly 3 years ago using ArcREST. In one piece of the code, I need to download the data in the feature service(create Replica) and save the data in a local database. As you know, the replica will be stored in AGO organization as the following: http://services1.arcgis.com/pdfadfdafkkllADFAA/ArcGIS/rest/services/RIASP22015/FeatureServer/replicafiles/4e70a029d5b742508d33ca2efb87ca29.zip To download the zip file and unzip it, I need a token to access AGO organization. This was required in my old code, and I am doing a like for like migration at the moment. Hope this explains it. Cheers, Simo
... View more
03-15-2018
03:46 PM
|
1
|
2
|
18682
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-28-2019 05:13 PM | |
| 1 | 02-25-2019 04:54 PM | |
| 1 | 03-05-2019 02:08 PM | |
| 1 | 03-12-2019 10:20 PM | |
| 1 | 11-27-2024 04:36 AM |
| Online Status |
Offline
|
| Date Last Visited |
01-17-2025
07:39 AM
|