|
POST
|
Hi. I have just set up a new ArcGIS Enterprise and Portal. What I would like to do is integrate portal with my previous, non-GIS, system that was based around SQL. Is there a way to view, and ideally manipulate, my tables in SQL from within portal and by extension ArcGIS Pro? I have successfully connected the SQL database and enabled the geodatabase in ArcMap. Thanks ArcGIS Server/Enterprise 10.7.1 It appears that the Server is built on a PostgreSQL database.
... View more
08-14-2019
12:53 PM
|
0
|
0
|
554
|
|
POST
|
In collector vs 18.0.3 I can't see the points where I am standing because the big location/navigation arrow covers up everything. How do I get rid of that circle?
... View more
07-02-2019
12:40 PM
|
0
|
0
|
341
|
|
POST
|
I would like to produce a map like this: I have a spatially enabled data frame with a column with numeric values (integers). I want vary the size of the symbol by value. I have found documentation for changing colors, which works fine, but I can't figure out how to change size. Here is my current code: red_rel.spatial.plot(map_widget= m3,
renderer_type = 'c',
method='esriClassifyNaturalBreaks',
class_count=20,
col='MARK_Red') I imagine it is a matter of changing the 'c' in renderer_type to something else but I haven't figured out what that is. There should also be a way to set a size range. Many Thanks. also, is there a way to clear the symbology so each time I run the script it doesn't just overwrite the previous symbology? ArcGIS API for Python v. 1.6 Jupyter Lab v. 0.35.4
... View more
04-18-2019
05:55 AM
|
0
|
1
|
1137
|
|
POST
|
Thanks for the speedy response Dylan. It is a point feature so only the "Null Geometry" would apply. However, in exploring that possibility I found that deleting the distance units got rid of the error. I set geodesic to True to get meters. arcgis.geometry.distance(r_wkid, cap_point, r_shp, geodesic=True) All the units I tried caused the error so it must be something to do with that element. geodesic will work find for my current application but it would be nice to know why planar with units defined didn't work. Thanks, Ben
... View more
04-09-2019
11:21 AM
|
0
|
1
|
4109
|
|
POST
|
I am trying to measure the distance between two points using the arcgis.geometry.distance function. However, I get this error: RuntimeError: Unable to complete operation. The operation cannot be performed on a non-simple geometry. (Error Code: 400) My code is: # Calculate distance
for index, values in cc_df.iterrows():
cap_point = values['SHAPE'] # A point object
print(type(cap_point), " geometry 1 type")
cap_stid = values['Study_ID'] # (string)
for c in dist_clm: # A list of columns
moi = c[5:] # The specific column
moi = moi[5:] # A part of the column name used to acess the 'SHAPE' value in a dictionary
r_shp = rel_dict[cap_stid][moi]['shp'] # the 'SHAPE' column of a data frame
print(type(r_shp), " geometry 2 type") # Printing the data type as part of testing
r_wkid = rel_dict[cap_stid][moi]['shp']['spatialReference']['wkid'] # The WKID (spatial refrence)
d = arcgis.geometry.distance(r_wkid, cap_point, r_shp, "METERS",
False)) It is basically extracting a point geometry from a dictionary and measuring the distance to another point geometry in a SPED. (Or that is what it is supposed to do) The output is: <class 'arcgis.geometry._types.Point'> geometry 1 type <class 'arcgis.geometry._types.Point'> geometry 2 type Unable to complete operation. The operation cannot be performed on a non-simple geometry. Are point objects not simple geometry? The documentation on this is very sparse and I can't find any examples. Here is a link to the documentation: arcgis.geometry module — arcgis 1.6.0 documentation Any insight would be helpful. Thanks arcgis 1.5.3 pandas 0.24.2
... View more
04-09-2019
10:21 AM
|
0
|
3
|
5156
|
|
POST
|
Searching though something entirely unrelated I found this: The .as_arcpy converts the features into features that can be used in arcpy. I haven't seen any official documentation on this anywhere but it seems to work. Here is a link to the reference visualizing data with the spatially enabled dataframe | ArcGIS for Developers
... View more
04-09-2019
09:58 AM
|
1
|
0
|
4692
|
|
POST
|
I am trying to create a Spatially Enabled Data Frame object from a FeatureLayer object using the ArcGIS API for python version 1.5.3 and pandas version 0.24.1. When I use web layers that don't have date fields it works fine, but as soon as it has a date field it stops working and I get the following error: Exception: Could not load the dataset: dtype '<class 'datetime.datetime'>' not understood I copied the code directly from the Introduction to the Spatially Enabled Data Frame guide page and just substituted the item id for one of my own web layers. Here is my code: from arcgis import GIS
gis = GIS("https://arcgis.com", ***, ***)
item = gis.content.get('The item id')
flayer = item.layers[0]
# create a Spatially Enabled DataFrame object
sdf = pd.DataFrame.spatial.from_layer(flayer)
sdf.head() Any ideas? Has anyone else run into this problem?
... View more
02-12-2019
09:39 AM
|
1
|
5
|
3195
|
|
POST
|
I am going to move this error to a different thread as it is not exactly related. Thank you again for the input.
... View more
02-12-2019
05:16 AM
|
0
|
0
|
4005
|
|
POST
|
Thank you very much for the response. I hadn't realized the change. I am using the arcgis v 1.5.2 pandas v 0.24.0 I am not familiar with the spatially enabled data frame object but after following the guide I am getting the following error: I tried it with several different feature layers including a very simple one with no dates and it always gives me the same error. Am I missing something? Here is the full error message in case it helps: ---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py in from_layer(layer)
1966 from arcgis.features.geo._io.serviceops import from_layer
-> 1967 return from_layer(layer=layer)
1968 except ImportError:
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_io\serviceops.py in from_layer(layer, query)
122 else:
--> 123 return layer.query(where=query, as_df=True)#.sdf
124 return res
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py in query(self, where, out_fields, time_filter, geometry_filter, return_geometry, return_count_only, return_ids_only, return_distinct_values, return_extent_only, group_by_fields_for_statistics, statistic_filter, result_offset, result_record_count, object_ids, distance, units, max_allowable_offset, out_sr, geometry_precision, gdb_version, order_by_fields, out_statistics, return_z, return_m, multipatch_option, quantization_parameters, return_centroid, return_all_records, result_type, historic_moment, sql_format, return_true_curves, return_exceeded_limit_features, as_df, **kwargs)
709 import pandas as pd
--> 710 df = self._query_df(url, params)
711 dt_fields = [fld['name'] for fld in self.properties.fields \
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py in _query_df(self, url, params)
1452 df.loc[q, fld['name']] = 0
-> 1453 df = df.astype(dtypes, False)
1454 if 'geometryType' in featureset_dict:
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\generic.py in astype(self, dtype, copy, errors, **kwargs)
5667 if col_name in dtype:
-> 5668 results.append(col.astype(dtype[col_name], copy=copy))
5669 else:
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\generic.py in astype(self, dtype, copy, errors, **kwargs)
5680 new_data = self._data.astype(dtype=dtype, copy=copy, errors=errors,
-> 5681 **kwargs)
5682 return self._constructor(new_data).__finalize__(self)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\managers.py in astype(self, dtype, **kwargs)
530 def astype(self, dtype, **kwargs):
--> 531 return self.apply('astype', dtype=dtype, **kwargs)
532
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\managers.py in apply(self, f, axes, filter, do_integrity_check, consolidate, **kwargs)
394
--> 395 applied = getattr(b, f)(**kwargs)
396 result_blocks = _extend_blocks(applied, result_blocks)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\blocks.py in astype(self, dtype, copy, errors, values, **kwargs)
533 return self._astype(dtype, copy=copy, errors=errors, values=values,
--> 534 **kwargs)
535
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\internals\blocks.py in _astype(self, dtype, copy, errors, values, **kwargs)
594 # convert dtypes if needed
--> 595 dtype = pandas_dtype(dtype)
596 # astype processing
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\pandas\core\dtypes\common.py in pandas_dtype(dtype)
2028 elif npdtype.kind == 'O':
-> 2029 raise TypeError("dtype '{}' not understood".format(dtype))
2030
TypeError: dtype '<class 'datetime.datetime'>' not understood
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
<ipython-input-5-8e6be27d7403> in <module>
----> 1 spd = pd.DataFrame.spatial.from_layer(feature_layer)
~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\geo\_accessor.py in from_layer(layer)
1971 raise Exception("Malformed response from server, could not load the dataset: %s" % str(je))
1972 except Exception as e:
-> 1973 raise Exception("Could not load the dataset: %s" % str(e))
1974 #----------------------------------------------------------------------
1975 @staticmethod
Exception: Could not load the dataset: dtype '<class 'datetime.datetime'>' not understood
... View more
02-11-2019
05:46 PM
|
0
|
8
|
4005
|
|
POST
|
Hello, I am trying to convert a FeatureLayer object into a SpatialDataFrame object but am running into a strange error: NameError: name 'OLD_PANDAS' is not defined Any ideas what is wrong or how I can fix this? I have imported the requisite packages I believe; Many thanks
... View more
02-11-2019
10:58 AM
|
2
|
14
|
6601
|
|
POST
|
Thanks again Munachiso, What I am really trying to do is compensate for not having ArcGIS for Server and geoprocessing services. I need to run desktop caliber tools in a distributed web environment. I was hoping that this could be accomplished by using arcpy in conjunction with the python API. I get the sense from your's and Joshua's comments that it is not a natural thing. It would be handy if there was a reference that compared the two and outlined any possible touch points. I really appreciate your's and Joshua's insights. Regards
... View more
02-06-2019
09:58 AM
|
0
|
0
|
4692
|
|
POST
|
Hello Munachiso, yes that appears to be the case. The integration of arcpy and the python api is proving more difficult that I thought it would be. Is there a place where I can find more information on how the two work together? thanks
... View more
02-06-2019
05:50 AM
|
0
|
2
|
4692
|
|
POST
|
As my company moves from desktop power users to AGOL web GIS I am finding myself transitioning to the ArcGIS API for Python from Arcpy. However, there doesn't seem to be a clear bridge between the arcpy tools that have lead us to success and the Python API tools that will hopefully spread our influence. Even though both are happy in the python environment their compatibility seems limited. A very real possibility is I just haven't figured it out yet, but I have yet to see clear documentation on how the two are to work together. The most powerful tools are still in arcpy but the most efficient tools for handling and visualizing AGOL data are in the Python API; an effective workflow would allow the combination of the two. Has anyone else run into the same obstacles? Is there documentation out there? Any suggestions on the the gap can be filled.
... View more
02-06-2019
05:47 AM
|
0
|
0
|
474
|
|
POST
|
Hello, I am trying to use some arcpy tools in Jupyter Notebooks but it doesn't appear as though I can use a FeatureLayer object as an input. Here is an example. I obtain my feature layer by getting the feature collection using the item id and then calling the first (and only in this case) layer. This returns a FeatureLayer object. I can easily find the fields as follows: However, when I use the arcpy equivalent function it tells me that OSError: "<FeatureLayer url:"https://services8.arcgis.com/.../FeatureServer/0">" does not exist" even though it actually does. Interestingly when I pass the FeatureLayer object's URL in it works. Can someone explain why I can't use the FeatureLayer object directly or what the difference is? Many thanks.
... View more
02-01-2019
11:59 AM
|
0
|
6
|
5264
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-11-2018 01:56 PM | |
| 1 | 11-01-2018 10:51 AM | |
| 1 | 02-12-2019 09:39 AM | |
| 1 | 02-01-2019 07:35 AM | |
| 1 | 11-13-2019 09:58 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-29-2022
04:13 PM
|