|
POST
|
Thanks Derek - so if I don't have a non-enterprise account on the AGOL site, then it would follow that I'm unable to add AGOL utility services to my Portal, correct? Just want to make sure I'm understanding my options.... Jay
... View more
05-17-2017
10:39 AM
|
0
|
1
|
1209
|
|
POST
|
I have access to an AGOL site though which I'd like to configure utility services for my local instance of ArcGIS Portal 10.4. Normally, I would go to Organization --> Edit Settings --> ArcGIS Online tab, check the boxes for services I want to expose to my portal and enter my AGOL credentials for authentication. However, the AGOL site is configured with enterprise login alone, so the credentials are managed on some external system. I don't (to my knowledge) have a password for logging into AGOL directly, I just have my enterprise login password. Therefore, the instance of Portal rejects my credentials because there is no option to use enterprise login credentials when configuring utility services. Is there any workaround to this? Thanks! Jay
... View more
05-11-2017
09:38 AM
|
0
|
3
|
1556
|
|
POST
|
I use ArcMap 10.4 to manage my ArcGIS Server services, federated with my 10.4 Portal. Occasionally I need to overwrite an existing service (for instance if the schema changes, or if I want to change default symbology). The workflow I follow is, using ArcMap, I go to File-->Share As-->Service-->Overwrite an existing service. The problem with this workflow is that it can overwrite it's corresponding Portal item description, thumbnails, and tags. That is, I have put a lot of work into modifying my Portal item descriptions, thumbnails, tags (the description is HTML formatted not just plain text), the thumbnail is a custom image not a snapshot of the map, and the tags are also custom. I make all these modifications though the Portal UI, but they get overwritten when I publish through ArcMap. Unfortunately I can't add a thumbnail to the map document, nor include HTML formatted description or Summary in the ArcMap Service Editor Item Description section. Has anyone found a way around this? My only idea so far is to create a backup of all my federated item thumbnails, descriptions, and tags, and use the Python API to modify the items after I've overwritten the service. But this seems labor intensive, and I can't believe no one has solved this problem yet. Thanks!
... View more
04-25-2017
01:04 PM
|
1
|
1
|
1794
|
|
POST
|
Yeah, I was able to use ArcGIS Online Assistant to set a more granular definitionExpression not available through the Portal UI. It took SQL, something like dateField >= CURRENT_DATE - 4
... View more
03-28-2017
07:21 AM
|
1
|
1
|
1513
|
|
BLOG
|
Throwing my hat into the ring here, I altered the Google Analytics web app builder widget for more granular control of map events, and layer-level logging based on visibility changes via the LayerList widget (essentially tracking how users interact with individual map layers.... GitHub - crackernutter/esri-wab-widget-google-analytics: A google analytics widget & template for use in Esri Web AppBui…
... View more
03-03-2017
11:24 AM
|
1
|
0
|
6904
|
|
POST
|
Thanks - so it seems like Esri still has some work to do on this API....
... View more
02-27-2017
07:58 AM
|
0
|
0
|
3104
|
|
POST
|
Even though I mixed up x and y, it still won't work
... View more
02-24-2017
12:42 PM
|
0
|
0
|
3104
|
|
POST
|
I would love to see a code example if you have one. I could not get this to work. I am able to create a FeatureSet made up of Features (the feature is of type "Polyline"), but I can't pass the FeatureSet into draw (I believe the function only takes one item to draw, not a list). And even if I pass in a single Feature, the map refreshes, but I don't see any graphics... #lines1 = features.FeatureSet(features = df_lines['Lines']) map1 = gis.map() symbol = { "type": "esriSLS", "style": "esriSLSSolid", "color": [115,76,0,255], "width": 3 } for item in df_lines['Lines']: print("drawing " + str(item.geometry)) map1.draw(shape = item.geometry, symbol=symbol) map1 At the very least, I can't even get this simple example to work: can you? my_line = arcgis.geometry.Polyline({"paths": [[38.8,-78.8],[34.2,-117]]}) my_line_feature = arcgis.features.Feature(my_line, attributes=None) map1.draw(my_line, symbol=symbol) OR map1.draw(my_line_feature, symbol=symbol)
... View more
02-24-2017
12:20 PM
|
0
|
3
|
3104
|
|
POST
|
Been playing around with the Python API. I'm using a Pandas dataframe, to which I've added a column that has a Polyline (arcgis.geometry.Polyline class) as it's attribute. I would like to add this dataframe to a map, but the import_data method only seems to work on dataframes with x,y or lat,long column names, and I couldn't find a way to specify the Shape field when invoking the method. Is this possible? My code, in general, looks like: fc_lines = gis.content.import_data(df_lines) map1 = gis.map() map1.add_layer(fc_lines) df_lines is a dataframe with a column, named "Lines" that contains an arcgis.geometry.Polyline object. At least I think it contains an object - when I print out the dataframe, that column has something like {"paths": [[32.08138, 40.17111], [35.182777, 39.4016666]], "spatialReference": {"wkid": 4326}} which is the string representation of the object. But if it's actually stored as a string, that's a different matter (and maybe why it won't work). Is there a way to do what I want using the Python API, or should I somehow export the dataframe to a feature class, if that's even possible.
... View more
02-10-2017
09:06 AM
|
0
|
5
|
4625
|
|
POST
|
I'm trying to create a juptyer notebook that facilities copying and updating a "dev" Portal webmap to my "prod" Portal (I'm working with two internal Portals, same layers published to each). It's easy to copy a web map from one portal to the other, using the copy_item function from clone portal users groups and content | ArcGIS for Developers . However, I'm having problems updating the web map once I've copied it from dev to production. As far as I can tell, all I'd need to do is change the urls (from my development ArcGIS server to my production ArcGIS server) in the json representation of the Portal item. It also seems like I should change the itemId for the layers as well, (I might just have to hardcode the production itemIds unless I want to search for the layers by name and retrieve the ids that way - I have yet to solve the best way to approach that problem). Lastly, once I've modified the data dictionary / json representation from the web map, I just run the update method. See the code below: #####from some of the API documentation examples
TEXT_BASED_ITEM_TYPES = frozenset(['Web Map', 'Feature Service', 'Map Service','Web Scene',
'Image Service', 'Feature Collection',
'Feature Collection Template',
'Web Mapping Application', 'Mobile Application',
'Symbol Set', 'Color Set',
'Windows Viewer Configuration'])
ITEM_COPY_PROPERTIES = ['title', 'type', 'typeKeywords', 'description', 'tags',
'snippet', 'extent', 'spatialReference', 'name',
'accessInformation', 'licenseInfo', 'culture', 'url', ]
def copy_item(target, owner, folder, item):
with tempfile.TemporaryDirectory() as temp_dir:
copy_item = {}
for property_name in ITEM_COPY_PROPERTIES:
copy_item[property_name] = item[property_name]
data_file = None
if item.type in TEXT_BASED_ITEM_TYPES:
# If its a text-based item, then read the text and add it to the request.
if item.size > 0:
text = item.get_data(False)
#textstr = text.decode('utf-8')
copy_item['text'] = text
elif item.size > 0: # download data for all other types, not just item.type in FILE_BASED_ITEM_TYPES:
# download data and add to the request as a file
data_file = item.download(temp_dir)
thumbnail_file = item.download_thumbnail(temp_dir)
metadata_file = item.download_metadata(temp_dir)
# Add the item to the target portal
copied_item = target.content.add(copy_item, data_file, thumbnail_file,
metadata_file, owner, folder)
return copied_item
#####################################
##My Notebook
from arcgis.gis import GIS
from arcgis.gis import Item
from arcgis.gis import User
import tempfile
from IPython.display import display
source = GIS("dev portal", "username","password", verify_cert=False)
target = GIS("prod portal","username","password", verify_cert=False)
myDevMap = Item(source,"d8c2a39f366843e0a5e24c5299aeb57c")
copy_item(target,"user","folder",myDevMap)
######Once I've copied once, I just hardcode the item ID
myProdMap = Item(target,"cc6a02d3e9644cd08cc105ae30a06d87")
#here I'm retrieveing the json representation of the map
data = myProdMap.get_data(try_json=True)
replaceData = data
##this is where I replace the URLS "gis-dev" is the development url, and "gis" is the production
layers = data['operationalLayers']
for index in range(len(layers)):
if 'url' in layers[index].keys():
url = layers[index]['url']
if "gis-dev" in url:
newurl = url.replace("gis-dev","gis")
replaceData['operationalLayers'][index]['url']=newurl
myProdMap.update(data = replaceData)
When I try to run the update method, I get a whole host of errors, and I can't make heads or tails of them. So, am I doing something wrong / is there something I'm missing? I see some http vs https errors in here, along with some key errors as well. Don't really know what's going on but would love some assistance on this one. AttributeError Traceback (most recent call last)
<ipython-input-27-5fe3a5afb862> in <module>()
----> 1 EONHome_fromDev.update(data = replaceData)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis.py in update(self, item_properties, data, thumbnail, metadata)
2846 item_properties['tags'] = ",".join(item_properties['tags'])
2847
-> 2848 ret = self._portal.update_item(self.itemid, item_properties, data, thumbnail, metadata, self.owner, folder)
2849 if ret:
2850 self._hydrate()
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\portalpy.py in update_item(self, itemid, item_properties, data, thumbnail, metadata, owner, folder)
2014 files = []
2015 if data:
-> 2016 if _is_http_url(data):
2017 data = request.urlretrieve(data)[0]
2018 files.append(('file', data, os.path.basename(data)))
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py in _is_http_url(url)
1084 def _is_http_url(url):
1085 if url:
-> 1086 return urlparse(url).scheme in ['http', 'https']
1087
1088 def _unpack(obj_or_seq, key=None, flatten=False):
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\parse.py in urlparse(url, scheme, allow_fragments)
290 Note that we don't break the components up in smaller bits
291 (e.g. netloc is a single string) and we don't expand % escapes."""
--> 292 url, scheme, _coerce_result = _coerce_args(url, scheme)
293 splitresult = urlsplit(url, scheme, allow_fragments)
294 scheme, netloc, url, query, fragment = splitresult
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\parse.py in _coerce_args(*args)
110 if str_input:
111 return args + (_noop,)
--> 112 return _decode_args(args) + (_encode_result,)
113
114 # Result objects are more helpful than simple tuples
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\parse.py in _decode_args(args, encoding, errors)
94 def _decode_args(args, encoding=_implicit_encoding,
95 errors=_implicit_errors):
---> 96 return tuple(x.decode(encoding, errors) if x else '' for x in args)
97
98 def _coerce_args(*args):
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\urllib\parse.py in <genexpr>(.0)
94 def _decode_args(args, encoding=_implicit_encoding,
95 errors=_implicit_errors):
---> 96 return tuple(x.decode(encoding, errors) if x else '' for x in args)
97
98 def _coerce_args(*args):
AttributeError: 'dict' object has no attribute 'decode'
... View more
01-06-2017
10:59 AM
|
0
|
2
|
5419
|
|
POST
|
This falls under a more long term strategy question (which is also related to the Python language long term strategy as well...). Is it the plan to eventually deprecate the Python 2.x arcpy API in place of this? In other words, if I was to refactor all my old arcpy scripts to this Python ArcGIS API supporting Python 3.x, would that be unnecessary work, or is this something that is going to come up eventually anyway? Also, as someone that relies heavily on my arcpy scripts (including arcpy scripts for redeploying server instances, publishing services, ingesting data to RDBMS'), can someone speak to where it might be appropriate to start learning this API and where appropriate to continue using the older arcpy API...if at all? Thanks
... View more
12-22-2016
11:35 AM
|
1
|
4
|
8374
|
|
POST
|
Was curious if, using the JS API v3.18, it's possible to use the FeatureTable dijit to update the location of a record? What I would like to do is have a "location" text attribute stored with the layer. In the FeatureTable, if a user clicks on that attribute for a given record, instead of changing to a text box or domain related drop down menu, it changes to a search dijit. A user can enter in a city, address, or lat/long, and once they hit enter (or unfocus or choose one of the suggested results), the search dijit uses the coordinates to update the location of the feature (as well as the "location" text attribute). I don't know how to override the default behavior for a feature table to get this behavior. Is it even possible? Thanks!
... View more
12-13-2016
02:04 PM
|
0
|
0
|
1438
|
|
POST
|
Is there any way to override a single layer for the legend widget? I'm using JS API v4.0 and have one 3D polygon extruded layer, which doesn't show up in the legend (unlike my other non-3D layers). Was curious if there is a way to "override" the legend in this case - specify a different renderer for this layer that is only used in the legend (while the 3D extruded polygon symbol and associated renderer is what's used on the actual map? Any suggestions for a workaround here?
... View more
12-07-2016
10:37 AM
|
0
|
0
|
1245
|
|
POST
|
Thanks so much! That worked. Don't know why I didn't think of that myself. The examples show two map objects instead of one (the Calcite-Maps examples at least), and that was the example I was basing my app off of, but I guess it's unnecessary to have two Map objects because a MapView doesn't break when fed a Map with a ground parameter specified.
... View more
11-29-2016
01:14 PM
|
0
|
0
|
1494
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 02-23-2026 11:00 AM | |
| 1 | 07-08-2025 11:33 AM | |
| 1 | 11-07-2023 08:32 AM | |
| 2 | 10-01-2025 06:52 AM | |
| 5 | 09-08-2025 07:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-04-2026
01:35 PM
|