POST
|
Over the last 24 hours I've discovered an open bug report against the ArcGIS python API that highlights a possibly related issue within the same section of code in feature.py: https://github.com/Esri/arcgis-python-api/issues/600 I'll link my question and observations to that bug report. Example GeoJSON... I use arcpy first in both examples below to map the geojson geometry to check that it looks OK. I then try and create a featureset from the geojson. The 'simple' doughnut works, but the 'complex' doughnut triggers what appears to be an issue in feature.py. Both examples assume ArcGIS Pro 2.6 has been opened and a new Map created. The code is executed in the python window. EDIT: the simple doughnut is a Polygon, the complex is a MultiPolygon. If this is the trigger then I might be able to post a smaller example that causes FeatureSet.from_geojson to fall over. Simple Doughnut: geojson = {'type': 'FeatureCollection', 'features': [{"type": "Feature", "geometry":{"type":"Polygon","coordinates":[[[176.08340699700011,-38.684118549999937],[176.07802846800007,-38.687596664999944],[176.08582733500009,-38.691020994999974],[176.08340699700011,-38.684118549999937]],[[176.08268986000007,-38.685767965999958],[176.08453648800003,-38.689640505999932],[176.08111215500003,-38.687112597999942],[176.08268986000007,-38.685767965999958]]]}, "properties": {"name": "doughnut"}}]} # lets quickly map the geometry using arcpy to see if it looks right geom = arcpy.AsShape(geojson['features'][0]['geometry']) arcpy.management.CreateFeatureclass(arcpy.env.scriptWorkspace,"doughnut","POLYGON",spatial_reference=4326) cursor = arcpy.da.InsertCursor('doughnut',['SHAPE@']) cursor.insertRow([geom]) del cursor # within the newly created 'doughnut' layer in your map, you should be able to zoom to the new feature thus confirming the validity of the geometry # now trying with arcgis python api import arcgis # FeatureSet.from_geojson executes without an error with the simple doughnut: fset = arcgis.features.FeatureSet.from_geojson(geojson) Complex Doughnut: # Complex Doughnut Polygon arcgis API crash example: assuming that ArcGIS Pro 2.6 has just been opened, and a new map added - execute the following in the python window geojson = {'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'geometry': {'type': 'MultiPolygon', 'coordinates': [[[[176.37030675, -38.305125654296276], [176.3695243667, -38.30498478759614], [176.3692713333, -38.305168537596316], [176.3694515833, -38.30545720429661], [176.36861981670003, -38.30585190429698], [176.3684908333, -38.30605207089717], [176.36825398329998, -38.30613775429725], [176.3680026667, -38.30635117089746], [176.3676923, -38.306532537597626], [176.3679374833, -38.30656092089765], [176.3680943333, -38.306546337597645], [176.36892496669998, -38.30619777089731], [176.36915015, -38.30590708759704], [176.36962908330003, -38.305777720896906], [176.36989879999996, -38.306098254297204], [176.3713449833, -38.307033154298104], [176.37171365, -38.30764368759869], [176.37253491669998, -38.30773952089878], [176.37289180000002, -38.3083894875994], [176.3742379167, -38.309207954300184], [176.3748589667, -38.31072793760165], [176.3754008333, -38.31147655430237], [176.37511184999997, -38.31207117090293], [176.3753932833, -38.31250388760334], [176.37485256669999, -38.31294217090377], [176.37331346669998, -38.31290938760374], [176.3717829, -38.3119377209028], [176.37053565, -38.312564587603404], [176.37043173329997, -38.312788920903614], [176.36946801669998, -38.31278613760361], [176.36868585, -38.31294655430377], [176.3679912667, -38.31382375430462], [176.3667350167, -38.314330754305104], [176.36682945, -38.31470753760546], [176.36782843330002, -38.314725770905476], [176.36843613329998, -38.31498260430572], [176.3699562833, -38.31624440430692], [176.3707647667, -38.31605138760674], [176.3725145167, -38.31730725430794], [176.37287485, -38.318000270908605], [176.3726783167, -38.31924188760979], [176.3723840333, -38.319340104309894], [176.37229036669999, -38.31951067091005], [176.3728711833, -38.31995035431048], [176.37292396670003, -38.32015307091068], [176.3731218833, -38.320525537611026], [176.37323905, -38.32059062091109], [176.37365143329998, -38.319913987610455], [176.3739065667, -38.31923197090978], [176.3744011333, -38.31743592090807], [176.3760127167, -38.31452610430528], [176.37685113330002, -38.31374102090454], [176.3773241833, -38.31304428760386], [176.3775591333, -38.31229402090315], [176.37758114999997, -38.311716220902596], [176.3774904333, -38.311376704302276], [176.3769019667, -38.31021517090116], [176.3750496667, -38.308323537599335], [176.3750027333, -38.30826125429928], [176.3748782, -38.30819117089922], [176.3718043833, -38.30659882089768], [176.37151998329998, -38.30645838759756], [176.3711886, -38.30609307089722], [176.37117810000004, -38.3060811042972], [176.37030675, -38.305125654296276]], [[176.37275173329996, -38.31448608760524], [176.3727690833, -38.31448323760523], [176.3728306333, -38.31449037090525], [176.3728823833, -38.31447723760523], [176.37294503330003, -38.31445003760522], [176.37304298329997, -38.31437365430514], [176.37310625, -38.31430297090506], [176.37318808330002, -38.31425227090503], [176.3732169167, -38.31424675430502], [176.37332743330003, -38.314243137605004], [176.37345733330002, -38.314220587604986], [176.3735003667, -38.31420775430498], [176.373588, -38.31415687090492], [176.37361260000003, -38.314126337604904], [176.37366196670004, -38.31401267090479], [176.3736947, -38.31397043760476], [176.3737536, -38.31392733760472], [176.3737764, -38.3139174376047], [176.37413171670002, -38.3138051876046], [176.37421716670002, -38.31376810430455], [176.37428140000003, -38.31371568760451], [176.37432516670003, -38.31366165430446], [176.3743546333, -38.31361267090441], [176.37440409999996, -38.313556170904356], [176.3744621667, -38.3134970876043], [176.37449306670004, -38.31347550430427], [176.37457534999996, -38.31343393760424], [176.3746039667, -38.313423854304226], [176.37470515000004, -38.313409104304206], [176.37474878330002, -38.31340767090421], [176.37477809999996, -38.31341128760422], [176.37479300000004, -38.313417670904215], [176.3748054833, -38.313433254304236], [176.37482691669996, -38.313453137604256], [176.3748619167, -38.31350917090432], [176.37491715, -38.31356223760436], [176.37496755, -38.313578887604365], [176.3749967667, -38.31358022090438], [176.37504875000002, -38.31357165430436], [176.37516254999997, -38.313519904304314], [176.37526326669996, -38.313441137604244], [176.37532035, -38.313418687604226], [176.37537235, -38.313410137604215], [176.3754366833, -38.31341488760422], [176.37544855, -38.31341907090421], [176.3754637, -38.313430004304244], [176.37551155, -38.31345358760426], [176.3755351833, -38.313459687604265], [176.3755788, -38.31345825430426], [176.37559879999998, -38.31345073760425], [176.3756460833, -38.31340803760422], [176.37565118330002, -38.3133941376042], [176.3756500833, -38.31337358760418], [176.3756431833, -38.313353237604154], [176.3755913667, -38.313254320904065], [176.3755836167, -38.31321798760403], [176.3755974333, -38.31320380430402], [176.37565380000004, -38.31316765430398], [176.37571074999997, -38.31314292090396], [176.37574518330004, -38.313132654303956], [176.3757821333, -38.31311543760393], [176.3758799333, -38.31309165430391], [176.3759061, -38.3130908043039], [176.37592671669998, -38.31309468760391], [176.37598206669998, -38.31315005430396], [176.3760748667, -38.31319732090401], [176.37617835, -38.313225954304045], [176.3763105333, -38.313246770904044], [176.37642468330003, -38.31325675430407], [176.3765391833, -38.313273587604094], [176.37656618330004, -38.31334358760416], [176.3765778, -38.31339810430421], [176.37658166669996, -38.31347115430427], [176.3765741333, -38.31349427090429], [176.3765558167, -38.31353373760433], [176.3765421, -38.31360508760441], [176.3765291333, -38.31363523760444], [176.3764643833, -38.31373340430453], [176.3764091167, -38.31379010430457], [176.37619941670002, -38.31395703760473], [176.3761543333, -38.31398595430476], [176.3760734833, -38.31405492090484], [176.37605505, -38.314092120904874], [176.3760403667, -38.314145204304914], [176.3760386667, -38.31416812090493], [176.3760216833, -38.314232704305006], [176.37602299999998, -38.31425782090503], [176.3760297833, -38.314275887605056], [176.37602526669997, -38.314410954305174], [176.37601263330004, -38.3144479543052], [176.3759857333, -38.31449000430525], [176.3755525167, -38.31483805430558], [176.3754862, -38.314906554305644], [176.3754354167, -38.314937954305684], [176.3750991333, -38.31502442090576], [176.3750454333, -38.31505590430578], [176.3750260333, -38.315074837605806], [176.3750100333, -38.315102804305845], [176.3749398, -38.315262887605996], [176.37490175000002, -38.315314437606034], [176.37483785, -38.315373704306104], [176.37464356669997, -38.31550127090621], [176.3745725167, -38.31559048760631], [176.37454596670003, -38.315639387606346], [176.37453141669997, -38.3156947543064], [176.3745323667, -38.31571300430642], [176.37454035, -38.31575390430647], [176.37455633330003, -38.31578082090647], [176.3745594833, -38.31578528760649], [176.3745674667, -38.31582620430652], [176.3745870833, -38.31586672090657], [176.37460100000004, -38.3159097209066], [176.3746169833, -38.31593663760664], [176.3746387833, -38.31596335430665], [176.3746697833, -38.316053820906745], [176.3746741333, -38.31608112090679], [176.3746664833, -38.31615683760684], [176.3746138667, -38.31620885430689], [176.3745576167, -38.316247287606934], [176.3745190667, -38.316289720906965], [176.3744738333, -38.316371237607044], [176.37446255000003, -38.316433354307115], [176.3744684667, -38.316490320907164], [176.37449015, -38.316514770907176], [176.37452975, -38.31654777090722], [176.3745367833, -38.31657042090724], [176.3745328833, -38.31660712090728], [176.3744656167, -38.316657354307324], [176.37442743329999, -38.31670663760738], [176.3744231667, -38.31673648760739], [176.37441541670003, -38.316755054307414], [176.3744167167, -38.31683503760748], [176.37441138330001, -38.316844354307506], [176.3744065333, -38.31686282090752], [176.3743363333, -38.31696802090762], [176.3743003167, -38.31700350430766], [176.37422626669996, -38.31703565430768], [176.37411150000003, -38.31706913760771], [176.37392, -38.317139437607786], [176.3738651, -38.3171480876078], [176.37383650000004, -38.317158170907796], [176.37371435, -38.31716217090782], [176.37354603330002, -38.31711965430776], [176.37348654999997, -38.317096454307745], [176.37345033330004, -38.31707247090772], [176.3734436667, -38.317056687607696], [176.3734127833, -38.31702340430767], [176.3733888, -38.31701045430766], [176.37321745, -38.31696575430762], [176.3731239167, -38.316904787607555], [176.3729829, -38.316827070907486], [176.37296218329996, -38.316820887607484], [176.3728597833, -38.31681280430746], [176.3728511833, -38.31681537090747], [176.37275745, -38.316811587607475], [176.37274620000002, -38.31681883760747], [176.3726220833, -38.3169420876076], [176.3725821667, -38.31695718760761], [176.3725350167, -38.3169473709076], [176.3724962167, -38.31693042090759], [176.3724145167, -38.31687605430753], [176.3723774667, -38.316838454307494], [176.3723560833, -38.316820887607484], [176.3723363833, -38.31667747090735], [176.3723516333, -38.3166380543073], [176.37238723329997, -38.316597937607256], [176.3724563, -38.316531504307214], [176.3724844667, -38.316514504307186], [176.37261483329996, -38.316450537607125], [176.3726926167, -38.31638380430706], [176.37272266669999, -38.316348437607026], [176.37273235, -38.316313804307], [176.37275, -38.31626515430695], [176.37276251669996, -38.316125187606815], [176.3727863167, -38.31603057090672], [176.3727650333, -38.31596268760666], [176.3727496, -38.315947204306646], [176.37268651670004, -38.31591278760661], [176.372536, -38.31577388760649], [176.3723911, -38.31568282090638], [176.3723309167, -38.31564830430636], [176.3722278667, -38.31557638760629], [176.3720654667, -38.315433320906166], [176.37201246670003, -38.315371104306095], [176.3719668833, -38.315285754306004], [176.37195651670004, -38.315256370905985], [176.3719118333, -38.31518700430591], [176.37191005000003, -38.31515505430588], [176.3719144333, -38.31512973760587], [176.37191401670003, -38.3150702709058], [176.3719228167, -38.31501963760577], [176.37198033330003, -38.31490328760565], [176.3720149, -38.314844904305595], [176.37203785, -38.31478692090553], [176.37204703330002, -38.314743154305496], [176.37206695000003, -38.31468298760543], [176.3720678, -38.314646354305395], [176.3721049, -38.31458102090534], [176.372164, -38.3145446709053], [176.37223223330002, -38.31451487090527], [176.37259108329997, -38.314475004305244], [176.3725941167, -38.31447718760524], [176.37275173329996, -38.31448608760524]]]]}, 'properties': {'name': 'complex doughnut'}}]} # lets quickly map the geometry using arcpy to see if it looks right geom = arcpy.AsShape(geojson['features'][0]['geometry']) arcpy.management.CreateFeatureclass(arcpy.env.scriptWorkspace,"doughnut","POLYGON",spatial_reference=4326) cursor = arcpy.da.InsertCursor('doughnut',['SHAPE@']) cursor.insertRow([geom]) del cursor # within the newly created 'doughnut' layer in your map, you should be able to zoom to the new feature thus confirming the validity of the geometry # now for the arcgis python api import arcgis # executing the following line will throw an error. It appears that feature.py is incorrectly passing an arcpy geometry object to json.loads within the code fset = arcgis.features.FeatureSet.from_geojson(geojson)
... View more
08-05-2020
06:34 PM
|
0
|
1
|
1946
|
POST
|
When calling FeatureSet.from_geojson (ArcGIS API for Python) in an ArcGIS Pro 2.6 python command line or an advanced Juypter Notebook in ArcGIS Online, I sometimes receive the following error: TypeError: the JSON object must be str, bytes or bytearray, not 'Polygon' The problem for me occurs when my geojson encodes a complex doughnut polygon and the ArcGIS API for Python appears to be attempting to utilise arcpy. The error seems to originate in the following python module in both ArcGIS Pro and AGOL: lib/site-packages/arcgis/features/feature.py More specifically, around lines 880 and 907 in the feature.py module I've noticed the following code: geom = arcpy.AsShape(geom) geometry = Geometry(json.loads(geom)) I think here that geom is a geometry object, and this is causing json.load to crash. I'm guessing that what is intended here is that Geometry is expecting to be passed a geometry object, so maybe the code could be corrected as follows (not sure): geom = arcpy.AsShape(geom) geometry = Geometry(geom) I'm just wondering if this issue (if it is an issue) has been reported before? And if so is there a fix forthcoming, or a work-a-round?
... View more
08-04-2020
07:42 PM
|
0
|
3
|
2078
|
BLOG
|
Thanks very much for creating this blog post Ismael Chivite. I've used the info in this post to help me create a simple Jupyter Notebook that contains a procedure and python code for automatically converting Survey123 Dropdown field choices into individual scannable QR Codes. Might be useful for those that are wanting to build a solution to track people entering and exiting buildings. The notebook has been created and tested using the new ArcGIS Notebooks public beta for ArcGIS Online. Github repository here if anyone is interested.
... View more
05-12-2020
09:17 PM
|
2
|
0
|
49342
|
POST
|
Yup this is the problem thanks Aaron. I'll follow that link.
... View more
10-13-2019
12:07 PM
|
1
|
0
|
2056
|
POST
|
Using ArcGIS Pro 2.4.2 I'm trying to set the Offset Effect on all symbol classes to the same value when using Unique Values as the Primary symbology for my polygon layer. I can do this for each individual class, but when I select More and then 'Format all symbols' my options are limited. How do I set a common property simultaneously for all classes?
... View more
10-10-2019
04:25 PM
|
0
|
2
|
2272
|
IDEA
|
Using ArcGIS Pro 2.4 and ArcGIS Online in 2019 and this is still a sore point for me. It would be great if labelling in ArcGIS Online was on par with what is available in ArcGIS Pro. It would be amazing if the map I created in ArcGIS Pro looked the same when published to AGOL - both in terms of symbology and labelling.
... View more
09-04-2019
03:05 PM
|
0
|
0
|
451
|
POST
|
Admin command prompt then AccessDatabaseEngine.exe /quiet sorted our issues - thanks!
... View more
07-07-2019
09:18 PM
|
3
|
0
|
3374
|
POST
|
Thanks very much for this info Derek - it will be really helpful. Also, I'm trying to find out if it's possible to configure seamless (no username and password) authentication to Portal or AGOL for those users already authentication to our AD domain. Something like Azure Active Directory Seamless Single Sign-On? Edit: I'm zeroing in on (at least the terminology for) what I'm after now. I see that Integrated Windows Authentication (IWA) can be configured for ArcGIS Enterprise Portal. So with IWA and Portal an authenticated AD user doesn't need to enter username or password. I've not been able to find any mention of IWA and ArcGIS Online - am I out of luck?
... View more
03-04-2019
12:29 PM
|
1
|
1
|
3196
|
POST
|
It’s my understanding that web maps and apps created with ArcGIS Enterprise have the capability to allow ‘pass-through’ authentication when these items are viewed in a web browser within our local Windows-based intranet domain. And by pass-through I mean that the user’s Windows Active Directory credentials are automatically passed to the browser (and ArcGIS Enterprise) without the need to re-enter a username and password. The same functionality is inherited and available (so I’ve been told) to custom web app builder (WAB) applications that are being served within our intranet also. My questions: Are the above statements correct, and if they are can ArcGIS Online (AGOL) also be configured with Windows authentication and the same pass-through authentication? If this is possible what ESRI products do I need within our Windows environment- do I need ArcGIS Enterprise at all to achieve this pass-thorough functionality with AGOL?
... View more
03-02-2019
02:44 PM
|
1
|
9
|
3994
|
POST
|
Modifying the max-height attribute of esri-popup__main-container appears to do the trick. Is there (or is this) an official way to increase the maximum height? Update - the style below stopped working, but this community answer fixed the problem. <link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css">
<style>
.esri-popup__main-container {
max-height: 600px;
}
</style>
... View more
01-28-2019
06:32 PM
|
0
|
0
|
541
|
POST
|
Hi, This question is specific to the Popup class within the ArcGIS API for Javascript 4.10. It appears that the maximum size of a non-docked popup (with custom content) might be 460px wide and 300px high. I'm trying to eliminate vertical scrollbars that appear when the maximum size of a popup is reached, and I think that increasing the maximum height of popups is the best way to do this. Is there a way to increase the maximum height of popups? Thanks, Dion
... View more
01-28-2019
02:57 PM
|
0
|
1
|
977
|
POST
|
I had the same problem upgrading from 10.3.1 to 10.5.1. I used your hint (thank you!), but instead of deleting the Data Stores, I imported the updated 10.5.1 SDE file for the database registrations that were giving me trouble.
... View more
07-28-2017
02:33 AM
|
0
|
0
|
762
|
POST
|
I had the 'Failed to create the site. The machine does not have a valid license...' problem as I was using v10 license files. Upgraded to 10.1 license files, ran through the authorisation process again, but the problem persisted. So I restarted the ArcGIS Server service and now all OK.
... View more
09-30-2012
01:03 PM
|
0
|
0
|
191
|
POST
|
After installing ArcGIS Server 10 Service Pack 2, I am finding that newly published services are not automatically appearing in the REST services directory http://myserver/ArcGIS/rest/services. I've turned on verbose logging and there doesn't appear to be any technical issues with the simple (new) MXD I am trying to publish. I can workaround the issue by logging into the rest admin interface http://myserver/ArcGIS/rest/admin then selecting 'Clear Cache Options' and then 'Clear Cache Now' and then select 'Apply Settings'. The newly published service is then visible. If anyone knows how to get the services to appear automatically again then please let me know.
... View more
05-11-2011
02:14 PM
|
0
|
3
|
2126
|
POST
|
In answer to my own question, I've created the following 'hack': 1. I created my own copy of the 'set_current_version' stored procedure. My 'force_set_current_version' stored procedure removes the owner and protected checks that exist in the original. 2. Grant the Public role the Execute permission on the 'force_set_current_version' stored procedure. 3. The 'force_set_current_version' is then put into a logon trigger so that it is called whenever someone connects to the ArcSDE database. I specify the version to use in the logon trigger. 4. Grant my users the Select permission on the multiversion views.
... View more
09-01-2010
06:04 PM
|
0
|
0
|
117
|
Title | Kudos | Posted |
---|---|---|
1 | 03-04-2019 12:29 PM | |
2 | 05-12-2020 09:17 PM | |
1 | 10-13-2019 12:07 PM | |
3 | 07-07-2019 09:18 PM | |
1 | 03-02-2019 02:44 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|