POST
|
Hi, Currently it is not possible to create a view from a hosted table using the ArcGIS Python API. That is the answer I got from ESRI. I suggested an ArcGIS Idea, feel free to vote for it https://community.esri.com/ideas/16757-python-api-create-view-for-hosted-table De: José Antonio Anta Viguera Enviado el: miércoles, 16 de octubre de 2019 16:05 Para: Velasco Echeverria, Xabier (NASUVINSA) Asunto: Re: - Re: Create View of Hosted Feature Service using Python API GeoNet, The Esri Community | GIS and Geospatial Professional Community <https://community.esri.com/?et=watches.email.thread> Re: Create View of Hosted Feature Service using Python API reply from José Antonio Anta Viguera<https://community.esri.com/people/joseantonio.antaesri-es-esridist?et=watches.email.thread> in ArcGIS Online - View the full discussion<https://community.esri.com/message/884687-re-create-view-of-hosted-feature-service-using-python-api?commentID=884687&et=watches.email.thread#comment-884687>
... View more
10-16-2019
11:45 PM
|
0
|
1
|
1075
|
POST
|
Hi Richard, what is the size of the data you are downloading? I had tu use the loop as there were issues while downloading big geodatabases (i.e. 1.8GB) without the loop.
... View more
08-06-2019
10:49 PM
|
0
|
1
|
2507
|
DOC
|
Hi Oscar, Yes, it changed to http://www.indusland.es/cAAE_PUBLICA/ Sorry, Xabier PD: I changed in the first entry as well
... View more
08-01-2019
05:35 AM
|
1
|
0
|
4675
|
POST
|
Hi Darryl, In that piece of code there is no reference to the ArcGIS Python API... Best regards, Xabier
... View more
07-01-2019
12:42 AM
|
0
|
0
|
2507
|
POST
|
Ok, could you please post the code you are executing so that I may check what is going on?
... View more
06-28-2019
12:23 AM
|
0
|
2
|
6247
|
POST
|
Hi Darryl, What is the size of the geodatabase that you are trying to download?
... View more
06-27-2019
02:50 AM
|
0
|
4
|
6247
|
IDEA
|
Currently it is not possible to create a view from a hosted table using the ArcGIS Python API. This might be a very useful tool to allow multilanguage implementations without duplicating data in AGOL or Portal. This way, data maintenance and update tasks might be simplified.
... View more
05-30-2019
11:16 PM
|
9
|
3
|
752
|
IDEA
|
Currently it is not possible to create a view from a hosted table using the ArcGIS Python API. This might be a very useful tool to allow multilanguage implementations without duplicating data in AGOL or Portal. This way, data maintenance and update tasks might be simplified.
... View more
05-30-2019
11:16 PM
|
9
|
2
|
698
|
POST
|
Hi, This function works ok def crearVista(coleccionFeatures, nombreVista, permisos, capas, edicionGeometria, limiteConsulta, gruposAGOL):
global vflc ## Declaración uso variable global para usarla fuera de la función
global itemVista
vflc = 0
itemVista = 0
# Eliminar vista si existe
print("nombreVista: " + nombreVista)
items = gis.content.search(nombreVista, "Feature Layer Collection")
if items:
vistaExistente = gis.content.get(items[0].itemid)
print("vista para eliminar: " + str(items[0].itemid))
vistaExistente.delete()
print("vista eliminada")
# Crear vista
vista = coleccionFeatures.manager.create_view(name=nombreVista, spatial_reference=None, extent=None, allow_schema_changes=True, updateable=True, capabilities=permisos, view_layers=capas)
itemVista = gis.content.get(vista.itemid)
print("itemVista: " + str(vista.itemid))
vflc = arcgis.features.FeatureLayerCollection.fromitem(itemVista)
print("vflc: " + str(vflc))
update_dict = {'maxRecordCount': limiteConsulta, 'allowGeometryUpdates': edicionGeometria} ## Se señalan 25.000 puesto que es el límite máximo de todos los elementos consultables, incluyendo establecimientos que es la capa que más elementos puede tener (parcelas y naves solo se consideran las disponibles para el límite, etc.)
vflc.manager.update_definition(update_dict)
for grupo in gruposAGOL:
print(grupo)
idGrupo = gis.groups.search(grupo)[0].groupid
print(idGrupo)
if idGrupo:
itemVista.share(groups=idGrupo)
else:
msg = u"ATENCIÓN: grupo " + grupo + u" sin asignar permisos para el servicio de vista " + nombreVista
print(msg)
arcpy.AddWarning(msg)
return
... View more
10-29-2018
07:39 AM
|
0
|
5
|
2120
|
POST
|
Hi, You should import the arcgis module (ArcGIS Python API): import arcgis
from arcgis.gis import GIS Regards, Xabier
... View more
08-15-2018
10:43 PM
|
2
|
0
|
1138
|
POST
|
Hi Mitch, This sample works fine: gis = GIS("https://www.arcgis.com",usuario,contraseña)
servicio = gis.content.get(idProduccion) ## idProduccion is the itemid of the hosted feature service
flc = arcgis.features.FeatureLayerCollection.fromitem(servicio)
# Delete view if it exists
items = gis.content.search(nombreVista)
if items:
vistaExistente = gis.content.get(items[0].itemid) ## this is how you can get the itemid of a hosted feature service
vistaExistente.delete()
# Crear vista
vista = flc.manager.create_view(name=nombreVista, spatial_reference=None, extent=None, allow_schema_changes=True, updateable=True, capabilities='Query, Update', view_layers= [flc.layers[1],flc.layers[3]]) ## 1 and 3 are the layers in the hosted feature service that you want to include in the view, you define a list with all the layers you want in
Xabier
... View more
08-09-2018
11:14 PM
|
0
|
2
|
1138
|
POST
|
Hi Thomas, I have used your snippet to update the definition of the "fields" parameter. Now I do not get the error mentioned in my previous post, but when I look to the results, the "fields" parameter has not been updated. Surprisingly, other parameters in the same update are properly performed. i.e. 'maxRecordCount': or "viewDefinitionQuery". Any further ideas? I have noticed that if you change the popup configuration in the Visualization tab of the View in AGOL, it does not update "fields" either, although it seems to behave allright. It is quite wierd Thanks, Xabier NOTE: I have found out that the configuration of the popup is not stored in the view definition, but in the item that references the view. I will try to manipulate the view's popup configuration from Item rather than FeatureLayer. Something similar to what is showed in this link for webmaps: https://community.esri.com/thread/211499-configure-popup-attributes-programmatically-with-arcgis-api-for-python
... View more
08-09-2018
04:03 AM
|
0
|
0
|
1138
|
POST
|
By the way, the error is: TypeError: Object of type 'PropertyMap' is not JSON serializable
... View more
08-08-2018
05:10 AM
|
0
|
1
|
1138
|
POST
|
Hi, I am able to create the view and update the definition for the feature view and the layers within. Everything works fine, except when I try to update the "fields" parameter in the layer's definition ('fields': listaCampos in the code below). Any ideas about this issue? from arcgis.gis import GIS
gis = GIS("https://www.arcgis.com",usuario,contraseña)
servicio = gis.content.get(idProduccion)
flc = FeatureLayerCollection.fromitem(servicio)
vista = flc.manager.create_view(name='PRUEBAS6', spatial_reference=None, extent=None, allow_schema_changes=True, updateable=True, capabilities='Query,Update', view_layers=[flc.layers[1],flc.layers[3]])
vflc = FeatureLayerCollection.fromitem(gis.content.get(vista.itemid))
update_dict = {'maxRecordCount': 20000, 'allowGeometryUpdates':False} ## Se señalan 20.000 puesto que es el límite máximo de establecimientos consultables, que es la capa que más elementos puede tener (parcelas y naves solo se consideran las disponibles para el límite, etc.)
vflc.manager.update_definition(update_dict)
vflcAAE = vflc.layers[0]
listaCampos = vflcAAE.properties("fields")
for campo in listaCampos:
if campo["name"] not in ['Promotor','Agua', 'Electricidad', 'Gas', 'Internet', 'Asociacionismo', 'PlanesPropuestas', 'IncidenciaPavimento', 'IncidenciaSaneamiento', 'IncidenciaElectricidad', 'IncidenciaTelecomunicaciones', 'IncidenciaGasNatural', 'IncidenciaLegal', 'IncidenciaAccesos', 'IncidenciaAlumbrado', 'IncidenciaCallejero', 'IncidenciaLicenciaActividad', 'Estado', 'DireccionUnidad', 'TelefonoUnidad', 'CorreoUnidad', 'AguaInfraestructuras', 'InternetInfraestructuras', 'GestionResiduos', 'EnergiaInfraestructuras', 'Aparcamiento', 'ServiciosComunesUnidad', 'ExcepcionQC', 'QC', 'ObsIncAlumbrado', 'ObsIncCallejero', 'ObsIncLicenciaActividad', 'ObsIncPavimento', 'ObsIncSaneamiento', 'ObsIncElectricidad', 'ObsIncTelecomunicaciones', 'ObsIncGasNatural', 'ObsIncLegal', 'ObsIncAccesos']:
campo["editable"] = False
campo["visible"] = True
update_dict = {'maxRecordCount': 2000, "viewDefinitionQuery" : "(cod_mun = '232') OR (cod_mun = '106') OR (cod_mun = '177') OR (last_edited_user = 'industriaEDER')", 'fields': listaCampos}
vflcAAE.manager.update_definition(update_dict) Thanks, Xabier
... View more
08-08-2018
04:34 AM
|
0
|
4
|
1138
|
POST
|
Ok, here it is the answer https://community.esri.com/thread/193315-how-to-create-a-feature-layer-view-in-agol
... View more
08-08-2018
03:00 AM
|
0
|
0
|
2120
|
Title | Kudos | Posted |
---|---|---|
1 | 01-30-2018 03:55 AM | |
1 | 01-24-2018 03:09 AM | |
9 | 05-30-2019 11:16 PM | |
9 | 05-30-2019 11:16 PM | |
1 | 08-01-2019 05:35 AM |
Online Status |
Offline
|
Date Last Visited |
10-03-2022
02:09 PM
|