def portal_info_plus(): portal = Portal('http://portaldev.esri.com') print portal.info() pprint(portal.properties()) pprint(portal.languages()) pprint(portal.regions()) pprint(portal.basemaps(['title'])) pprint(portal.color_sets(['title'])) pprint(portal.featured_items(['title'])) pprint(portal.featured_items_homepage(['title'])) pprint(portal.feature_collection_templates(['title'])) pprint(portal.symbol_sets(['title'])) pprint(portal.gallery_templates(['title'])) pprint(portal.webmap_templates(['title']))
def main(argv=None): portal = Portal('http://portaldev.esri.com') template_name = 'Map Notes' file_gdb_path = 'C:/Temp/MapNotes.gdb' # Retrieve the layer definitions (schemas) for the specified # feature collection template template_id = portal.feature_collection_templates(q=template_name)[0]['id'] template = portal.item_data(template_id, return_json=True) template_schemas = [layer['layerDefinition'] for layer in template['layers']] # Create the file GDB with feature classes for each schema create_file_gdb(file_gdb_path, template_schemas) # Get all webmaps, pull out features that match the template schemas, and # then load them into the corresponding feature classes in the file GDB for webmap in portal.webmaps(): for template_schema in template_schemas: features = webmap.features([template_schema]) if features: load_features(file_gdb_path, template_schema['name'], features)
def main(argv=None): portal = Portal('http://portaldev.esri.com') template_name = 'Map Notes' file_gdb_path = 'C:/Temp/MapNotes.gdb' # Retrieve the layer definitions (schemas) for the specified # feature collection template template_id = portal.feature_collection_templates(q=template_name)[0]['id'] template = portal.item_data(template_id, return_json=True) template_schemas = [ layer['layerDefinition'] for layer in template['layers'] ] # Create the file GDB with feature classes for each schema create_file_gdb(file_gdb_path, template_schemas) # Get all webmaps, pull out features that match the template schemas, and # then load them into the corresponding feature classes in the file GDB for webmap in portal.webmaps(): for template_schema in template_schemas: features = webmap.features([template_schema]) if features: load_features(file_gdb_path, template_schema['name'], features)