IDEA
|
Usual GIS workflows require to work with browser GIS, using for example cloropleth in Dash Python. Anyone who have tried to display a map in cloropleth dash will face the problem of reducing the size of the GEOJSON, or ESRI-JSON, shapefile, ... The tools currently in arcpy to approach this problem are: * Smooth shared edges * Simplify shared edges After testing a lot with both i found nearly impossible to reduce the size of the map from 10MB to less than 1MB without information loss. The best i could was with simplify shared edges - reatain critical point and even then, i got like 2-3 MB which leads to a lot of seconds waiting for the maps to load in browser. Have found topojson library, which did a better job reducing the size to less than 1MB although with the drawback of completely distorting the external map boundaries. Then i have tested mapshaper, and i was amazed, it did exactly what i wanted to do, https://mapshaper.org/ usually i rely in arcpy for all things GIS, and this was one of those times that arcpy failed in delievering, if you check this project it has a repository with code open source, all i ask is if is possible to either refine the simplify shared edges to actually reduce the complexity of finding the proper values and make it work better like mapshaper does. You will only understand what i am talking about if you ever worked with a GEOJSON or a shapefile to display for example in dash, you will see the importance, and how arcpy is falling behind what should be somehow easy to accomplish. Surely you guyes have a lot in hands and probably this is not priority , although i felt i should contribute with this feedback, because the use cases i am using are resolved using mapshaper if arcpy not accomplish.
... View more
02-07-2023
07:11 PM
|
0
|
0
|
797
|
POST
|
https://community.esri.com/t5/arcgis-pro-ideas/requesting-scenelayer-with-associated-featurelayer/idi-p/1125527/jump-to/first-unread-message I'm very thankfull you consider such request, i have no doubts this will make the communication between ArcGIS Pro > AGOL/Enterprise > ArcGIS JS API even more tight and scene workflows in ESRI will be championing much ahead of competition what is possible to do with scenes, which in my opinion is still quite basic and only touching the surface of what is necessary to improve in terms of scenes workflows, reason of which making this idea. Cheers.
... View more
12-13-2021
10:59 AM
|
0
|
0
|
339
|
IDEA
|
This functionality requires you to write cga rules in cityEngine, export them as rpk, and run them from ArcGIS Pro with the geoprocessing rpk methods. It is actually very powerful, because you have theoretically in your hands the whole CityEngine Power, although should be more covered in documentation, it is how i made it work within a complex workflow with much success.
... View more
12-13-2021
10:53 AM
|
0
|
0
|
1643
|
IDEA
|
SceneLayer with associated FeatureLayer (SLwFL) from Multipatch FeatureClass on FileGeodatabase is the only way to go (or at least the most flexible) for building interactive apps because they offer more functionality than simple standalone SceneLayers. Current state of things (ArcGIS Pro 2.9): Automating the Creation and Overwrite of SLwFL from filegeodatabase multipatch Feature Class: workflow not documented, the most resembling solution is what i posted in here and it does not work well because of layer settings https://community.esri.com/t5/python-questions/can-arcpy-publish-update-web-scene-layer-with/m-p/448... For Overwrite/Edit/Upsert/Update SLwFL already available in AGOL/Enterprise, it simply is not documented and currently the idea is to "republish" although it would create a whole different ItemId, it should be like this for Overwriting FeatureLayers https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/... So if you have a large scale 3D model to deploy, and which is dynamically changing? Current solution is either: do it manually with the ArcGIS Pro GUI which is not viable for multiple models or try your luck using the script i posted in the first link. Regarding overwrites or updates, automation simply is not possible (have to rebuild whole feature class again). So really appreciate your feedback because with this functionality it will be a breeze to do the full workflow: build your Multipatch Feature Class in GIS (ArcGIS Pro) -> Share (AGOL) -> Client Side Powerful Dynamic Dashboards (ArcGIS JS API) all automation. Some ways to make this multi team upgrade could be: i) make an arcpy hook which can mimick when user right clicks on content pane multipatch ArcGIS Pro scene layer > Sharing > As web layer > share as SLwFL ii) for the overwrite would be for example interesting to revamp the ArcGIS Python API feature_layer.append() to be able to work with filegdb and output SLwFL together with feature_layer.delete() and feature_layer.edit() for example. Have developed a DIY map application where users have their own scenes, and i have to manually publish each user scene for his/her own application because this feature is not implemented so many thanks if you can take a look at this. Considering that this particular workflow (of Scene automation) is fronted by ESRI capabilities, being next to none in terms of such capabilities. With this solution would make the communication between your products even more in front of competition. In my opinion is still quite basic and only touching the surface of what is necessary to improve in terms of scenes workflows reason of which making this idea. Cheers.
... View more
12-13-2021
10:48 AM
|
0
|
2
|
809
|
POST
|
SceneLayer with associated FeatureLayer (SLwFL) from Multipatch FeatureClass on FileGeodatabase is the only way to go (or at least the most flexible) for building interactive apps because they offer more functionality than simple standalone SceneLayers. Current state of things (ArcGIS Pro 2.9): -> Automating the Creation of SLwFL from filegeodatabase multipatch Feature Class: workflow not documented, the most resembling solution is what i posted in here and it does not work well because of layer settings https://community.esri.com/t5/python-questions/can-arcpy-publish-update-web-scene-layer-with/m-p/448532 -> Automation of Overwrite SLwFL already available in AGOL/Enterprise, it simply is not documented and currently the idea is to "republish" although it would create a whole different ItemId, it should be like this for Overwriting FeatureLayers https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/ta-p/904457 So if you have a large scale 3D model to deploy, and which is dynamically changing? Current solution is either: do it manually with the ArcGIS Pro GUI which is not viable for multiple models or try your luck using the script i posted in the first link. Regarding overwrites or updates, automation simply is not possible (have to rebuild whole feature class again). In the use example here have made a way to make it work, although these features are such a basic and important set of tools, reason feedbacking over here in. If someone of dev ESRI reads this would be welcome in advance if could add something. cheers
... View more
12-09-2021
04:54 PM
|
0
|
2
|
672
|
POST
|
Ok the example here shown is one of other related to validation with Editor widget which currently are not much optimal let's say in documentation and functionality, because it was not designed having checks on users although here is working with some additional addons. In current application used for demonstration it was sufficing for implementing validation besides the added user ui, if you guys need feedback for improving the tool from community i recommend actively check slack of esri spatial community channels for web dev cheers.
... View more
06-15-2021
12:40 PM
|
0
|
0
|
562
|
POST
|
Currently in the Editor Widget, there should be, when it is in 'awaiting-feature-to-create' status and it receives a polygon (the polyline is closed in the sketchViewModel), and it generates a feature which can get received with esriwatchUtils.when(esriweditor.viewModel.featureFormViewModel, "feature", () => {...}. If for example we test this feature geometry and it fails to pass, when we cancel the editor using esriweditor.cancelWorkflow() the feature is still in the view, as a GraphicsLayer (with another GraphicsLayer for boundingbox), which leaves "hanging" two internal (so they cannot be accessed using map.allLayers or mapview.allLayerViews usual methods) graphiclayers which can only be spotted if you run console.dir(map) or console.dir(view). These cannot be cleared or deleted and they are kept polluting the ui. Example: we are awating for users to put building footprints, would not make sense to have country polygons. esriwatchUtils.when(esriweditor.viewModel.featureFormViewModel, "feature", () => { if (esriweditor.viewModel.state === 'awaiting-feature-to-create') { // validation // max_area let num_area = esrigeometryEngine.geodesicArea( esriweditor.viewModel.featureFormViewModel.feature.geometry, 'square-meters' ) if (num_area > max_area) { alert('Warning: Maximum area accepted for a building is ' + max_area.toString()); esriweditor.cancelWorkflow() } Fixing suggestion: esriweditor.cancelWorkflow() should delete these internal graphiclayers which were made by its associated esriweditor.viewModel.sketchViewModel, since the Editor has been canceled and is in ready state now, and these GraphicLayers should have been propagated the cancel, as they were propagated to be created from Editor widget of course. here is the codepen (based on https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=widgets-editor-basic ) https://codepen.io/engfrancis/pen/RwpeXqX Click Editor Add Feature > pick a polygon from templates > draw a polygon above 10.000 m2 it should not be allowed sending an alert and cancelling along. cheers.
... View more
06-12-2021
02:26 PM
|
0
|
1
|
921
|
POST
|
Hello Jonah, Thanks for those links but i already know them well. The problem is that doing in arcpy publish of slpk you end up with a scene (web) layer only. Which is quite different result in comparison of click the publish button to Scene layer in GUI of AGOL you get a more powerful Scene (web) layer with Associated Feature Web layer. So i'm now sweeping through ArcGIS API for Python documentation to see if that's possible, and it looks like it is not. Conclusion (unless further information is added by folks here): Currently is not very viable to automate the creation of scene (web) layer with associated feature (web) layer, so in the workflow going to publish the slpk to simple scene (web) layer and then try to make it work in my ArcGIS API for JavaScript application which has a lot of dynamic filters, queries and also dashboards.
... View more
07-29-2020
03:27 AM
|
0
|
0
|
607
|
POST
|
Title says it all, how can be created with code a Scene (web) Layer from associated feature (web) layer in AGOL. It can be done manually in AGOL with the GUI. So the best bet would be arcgis.gis module — arcgis 1.8.1 documentation although there is nowhere in documentation explaining how this can be accomplished, and why is that important to have a scene layer with associated feature layer check here: http://140.207.158.228/latest/guide/working-with-scene-layers/
... View more
07-21-2020
09:06 AM
|
0
|
2
|
681
|
POST
|
It currently is not possible with Arcpy alone (can also be done with AGOL). http://140.207.158.228/latest/guide/working-with-scene-layers/
... View more
07-13-2020
08:36 AM
|
0
|
0
|
2915
|
POST
|
So after many attempts of trying with arcpy what is straightforward to do with ArcGIS Pro GUI: share a 3D Scene's Feature Layer (containing 3DObjects or Multipatch) as an AGOL scene layer with associated feature layer (and of course service definition) would like to know what are the current workflows. In the GUI is simply right click in the contents pane, in the feature layer > share > as web layer (it generates the correspondent feature, scene and service definition) Have tried this although either with arcpy.mp.ArcGISProject(str_prjflPath).listMaps()[0].getWebLayerSharingDraft and with the deprecated arcpy.mp.CreateWebLayerSDDraft it only publishes Feature Layers (and not the associated scene layer, as the ArcGIS Pro "Share to Web Layer" does): Basically adapted the last part of the code here: Automate overwrite web layer, feature class with upload of service definition, and the special use case of publishing a feature layer with associated scene layer. import arcpy
import os, sys
### Start setting variables
# Set the path to the project
prjPath = r"D:\testing#2\tests2.aprx"
# Update the following variables to match:
# Feature service/SD name in arcgis.com, user/password of the owner account
sd_fs_name = "MyPublicMap"
portal = "http://www.arcgis.com" # Can also reference a local portal
user = "username"
password = "password"
# Set sharing options
shrOrg = False
shrEveryone = False
shrGroups = ""
### End setting variables
# Local paths to create temporary content
relPath = os.path.dirname(prjPath)
sddraft = os.path.join(relPath, "WebUpdate.sddraft")
sd = os.path.join(relPath, "WebUpdate.sd")
# Create a new SDDraft and stage to SD
print("Creating SD file")
arcpy.env.overwriteOutput = True
prj = arcpy.mp.ArcGISProject(prjPath)
mp = prj.listMaps()[1]
arcpy.mp.CreateWebLayerSDDraft(mp, sddraft, sd_fs_name, 'MY_HOSTED_SERVICES',
'FEATURE_ACCESS','', True, True)
arcpy.StageService_server(sddraft, sd)
arcpy.UploadServiceDefinition_server(
in_sd_file=sd,
in_server="My Hosted Services",
#in_service_name #already specified in service definition
#in_cluster
#in_folder_type #already specified in service definition
#in_folder #already specified in service definition
in_startupType='STARTED',
#sharing configurations overriding default (only owner level access)
in_override='OVERRIDE_DEFINITION', #default False
in_my_contents='SHARE_ONLINE', #default 'SHARE_ONLINE' make it accessible from All My Content
in_public='PRIVATE', #default PRIVATE do not make it shared with everyone
in_organization='NO_SHARE_ORGANIZATION', #default 'NO_SHARE_ORGANIZATION'
in_groups='' #default '', for multiple use string list of groups for example
) Now using the more recent getWebLayerSharingDraft method of arcgis pro map object. Functionality: Create an ArcGIS Pro map python object with arcpy.mp.ArcGISProject('<str_path_aproject>'). Create the desired arcgis pro map layers list object using .listMaps() method of arcgis pro project python object, and .listLayers method of arcgispro map python object. Arcpy Sign in to either AGOL or ArcGIS Enterprise Portal (access and credentials) Create a sharing draft python object and set service properties. Create a Service definition draft (.sddraft file) using .exportToSDDraft('<str_filename>). method of sharing draft object. Create a service definition (.sd file) with arcpy's .StageService_server() method representing the Stage tool which analyses drafts for suitability and sources of potential performance issues. Finally, upload the service definition to AGOL or ArcGIS Enterprise portal as a GIS service with arcpy's .UploadServiceDefinition_server() method representing the Upload Service Definition tool. Independently of asynchronous tasks like upload service being done which can be made in multiprocessing as recomendation algorithm waits for objects to complete e.g. upload service for continue basics. If possible use this as reference: def share_weblayer(
str_prjflPath,
str_servicename
):
#import libs
import arcpy
import os
import shutil
import sys
from arcgis.gis import GIS
#
#variables
str_servicename=str_servicename.replace('-','')
#i) Create an ArcGIS Pro map python object with arcpy.mp.ArcGISProject('<str_path_aproject>').
aprj_working = arcpy.mp.ArcGISProject(str_prjflPath)
#
#ii) Create the desired arcgis pro map layers list object using .listMaps() .listLayers methods repectively of arcgispro project and of map objects.
lst_amaps = aprj_working.listMaps()
amap_working=lst_amaps[0]
lst_alyrs=amap_working.listLayers()
#
#iii) Arcpy Sign in to either AGOL or ArcGIS Enterprise Portal (access and credentials) if necessary
str_portal="https://www.arcgis.com"
str_user="user"
str_password="password"
arcpy.SignInToPortal(str_portal, str_user, str_password)
#
#iv) Create a sharing draft featuresharingdraft arcpy object
sdraft_working=amap_working.getWebLayerSharingDraft(
#server_type
server_type="HOSTING_SERVER",
#service_type
service_type="FEATURE",
#service_name
service_name=str_servicename,
#layers_and_tables=None defaults #filter the Layers and Tables to show
#note that only the 'MapView' layers and tables that belong to default geodatabase are available
layers_and_tables=lst_alyrs
)
#set properties of FeatureSharingDraft class instance (and also representing a type)
sdraft_working.allowExporting=False
sdraft_working.credits = "user"
sdraft_working.description = "My Description"
sdraft_working.offline = True
sdraft_working.overwriteExistingService =True
sdraft_working.portalFolder = "example"
sdraft_working.serverType="HOSTING_SERVER"
sdraft_working.serviceName=str_servicename
sdraft_working.summary = "My Summary"
sdraft_working.tags = "My Tags"
sdraft_working.useLimitations = "My Use Limitations"
#
#v) Create a Service definition draft (.sddraft file)
str_dir=os.path.join(os.path.dirname(str_prjflPath),'folder_output')
str_sddraftflname=str_servicename+".sddraft"
str_sddraftfullpath=os.path.join(str_dir,str_sddraftflname)
if not os.path.isdir(str_dir):
os.makedirs(str_dir)
elif os.path.isfile(str_sddraftfullpath):
os.remove(str_sddraftfullpath)
sdraft_working.exportToSDDraft(str_sddraftfullpath)
#
#vi) Create a service definition (.sd file)
str_sdflname=str_servicename+".sd"
str_sdfullpath=os.path.join(str_dir,str_sdflname)
if os.path.isfile(str_sdfullpath):
os.remove(str_sdfullpath)
arcpy.StageService_server(str_sddraftfullpath, str_sdfullpath)
#
#vii) Finally, upload the service definition to AGOL or ArcGIS Enterprise portal
#report the asynchcronous task (eventually use threads, or even better multiprocessing for this)
display("Uploading Service Definition...")
arcpy.UploadServiceDefinition_server(
in_sd_file=str_sdfullpath,
in_server="My Hosted Services",
#in_service_name #already specified in service definition
#in_cluster
#in_folder_type #already specified in service definition
#in_folder #already specified in service definition
in_startupType='STARTED',
#sharing configurations overriding default (only owner level access)
in_override='OVERRIDE_DEFINITION', #default False
in_my_contents='SHARE_ONLINE', #default 'SHARE_ONLINE' make it accessible from All My Content
in_public='PRIVATE', #default PRIVATE do not make it shared with everyone
in_organization='NO_SHARE_ORGANIZATION', #default 'NO_SHARE_ORGANIZATION'
in_groups='' #default '', for multiple use string list of groups for example
)
print("SUCCESS: Uploaded service definition.")
share_weblayer(
str_prjflPath=r"path_to_aprxfile",
str_servicename=r'example_service'
) So if anyone knows how to do it ideas are welcome in advance.
... View more
07-12-2020
09:45 AM
|
0
|
1
|
3062
|
POST
|
Shaun Walbridge Scott Davis Using Jupyter with ArcGIS Pro open, seems also is occurring , i.e. : ArcGIS Pro v2.4.1 is open: arcpy.env.workspace = 'D:\\some_projects\\cogubem\\scratch.gdb' No locks in here. Jupyter Nb is open: arcpy.env.workspace = 'C:\\%users%\\AppData\\Local\\Temp\\scratch.gdb' ExecuteError: ERROR 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service. Failed to execute (Delete). And Jupyter Nb is running a cloned conda environment of arcpy accordingly. Found way of sorting it although is for case here so i would like to know if in your case this also works.
... View more
09-04-2019
07:49 AM
|
0
|
1
|
4623
|
BLOG
|
Reality is in Europe (and not so much in USA but also a bit of course) Universities are more like power games instances than places where best practices and knowledge is put in practice. Which helps to explain the historical difficulty that "science" at universities has to overcome cultural and reality complex problems. I'm in the one of best (let's be polite to other) Engineering University in Portugal and really had to struggle but thanks to the IT department had success in having access to state of the art software of ESRI. Meanwhile many departments do not share any work or data being afraid of becoming surpassed, this kind of mind setting should be changed to really let improve.
... View more
08-24-2019
12:05 AM
|
0
|
0
|
571
|
POST
|
Although seems to be obvious i have not found a direct way to do in python the equivalent of dragging a feature_class from catalog pane to global scene 3d layer and setting up elevation to above ground and 1 meteroffset for example. Does anyone know a simple way to do this ? which im sure there is in python or arcpy.
... View more
08-23-2019
11:58 AM
|
0
|
0
|
261
|
Title | Kudos | Posted |
---|---|---|
1 | 12-08-2017 03:43 PM | |
1 | 12-11-2017 05:22 PM | |
1 | 08-07-2019 10:01 AM | |
4 | 12-09-2017 09:15 AM | |
2 | 02-26-2018 03:17 AM |
Online Status |
Offline
|
Date Last Visited |
02-08-2023
05:38 PM
|