POST
|
That may be it. I did get the latest (afaik) arcgis module.
... View more
02-28-2021
02:27 PM
|
0
|
0
|
5448
|
POST
|
Thanks @DanPatterson. Maybe so, but prior to a few days ago it would display it. Oh well.
... View more
02-28-2021
10:03 AM
|
0
|
0
|
5450
|
POST
|
Thanks @DanPatterson. Using ArcGIS Pro 2.7.1, cloned Python environment from ArcGIS default to which I've added Spyder. Default Spyder install via this method is Spyder 3.6. This runs but does nothing when I try to view the spatial dataframe in Variable Explorer. Upgrading Spyder to 4.2.1 also runs, but gives error message the pickling error message in original post. Using the upgrade arcgis method you posted tells me that it's already installed. This is really baffling me. Thanks!
... View more
02-26-2021
09:58 AM
|
0
|
0
|
5486
|
POST
|
I upgraded to Spyder 4.2.1 from 3.6, and now when I run my script that creates a spatially enabled dataframe, the dataframe 'sdf' won't open in Variable Explorer. Instead it gives a message stating 'The variable is not picklable'. The console pane shows a long traceback ending in ' _pickle.PicklingError: Can't pickle 'geoprocessing server result object' object: <geoprocessing server result object object at 0x000001F686A82A80>'. This was working before the upgrade, and I'm thinking after it for a while as well (might be wrong there). running things like sdf.head() works fine. Code below. Running Python 3.7.9 64-bit | Qt 5.9.6 | PyQt 5.9.2 | Windows 10 | Spyder 4.2.1 import time as t
import os
import sys
import pandas as pd
import arcpy
from arcpy import env
from arcgis.features import GeoAccessor, GeoSeriesAccessor
gdb = r"C:\Users\Owner\Desktop\Tract_Aggregation\Tract_aggregation.gdb"
fds = 'Detroit_tracts'
# fc = 'All_Detroit_Tracts_TL_Data_lt_4200'
fc = 'Tract_Agg_1_021621_New'
census_tracts = os.path.join(gdb, fds, fc)
mem_tracts = arcpy.management.MakeFeatureLayer(census_tracts, r"memory\tracts")
env.overwriteOutput = True
env.workspace = os.path.join(gdb, fds)
cutoff = 4200
used_gids = []
def create_sdf():
"""
Returns
-------
df : Pandas Dataframe
Census tracts.
"""
print('\tCreating Spatial DataFrame...')
drop_flds = ['OBJECTID',
'objectid_1',
'object_id']
try:
df = pd.DataFrame.spatial.from_featureclass(mem_tracts)
df.dropna(subset=['geoid'], inplace=True)
df.drop(drop_flds, axis=1, inplace=True)
df['under125pe'] = df['under125pe'] * 1.0
df['under200pe'] = df['under200pe'] * 1.0
df['under125pe'].fillna(0.0)
df['under200pe'].fillna(0.0)
df.set_index('geoid', inplace=True, drop=False)
df.rename_axis('gid', inplace=True)
df.sort_values(by='total_hh', axis=0,
ascending=False, inplace=True)
print('\tSpatial DataFrame created\n')
return df
except Exception as e:
print(sys.exc_value)
... View more
02-24-2021
01:26 PM
|
0
|
6
|
5555
|
POST
|
No. The department that's requested this has divided the state into 4 regions. The nearest centroid has to be in the same region. This is fine, definition queries can take care of that. Then, say n = 2100. For all tracts where the number of households is less than 2100, start with the tract that's closest to 2100, e.g. 1997. That tract should be combined with the nearest centroid tract. If that combination = 2100 or more households, good, all done with them. If not, calculate the nearest centroid for the new combined area, check for n, and repeat. Basically, they want to make sure each study area has a minimum n# of households, based on # of households in tracts.
... View more
12-01-2020
11:04 AM
|
0
|
0
|
774
|
POST
|
Definitely test this before relying on it, but in my response above, replace ID by Download Speed in the ORDER BY clause. There are other SQL methods, such as TOP(n), subqueries, etc., but been a while since I've used it much and don't want to mislead you.
... View more
12-01-2020
10:47 AM
|
0
|
0
|
14299
|
POST
|
For SQL, you can may also be able to use SELECT DISTINCT [field] FROM [table] ORDER BY ID. Adjust to your situation.
... View more
12-01-2020
08:12 AM
|
0
|
0
|
14333
|
POST
|
Hello, My task is to combine census tracts for analysis. Starting with the tract with less than n number of households that is closest to n, where n is some arbitrary number, tracts should be combined with the tract with the nearest centroid, and keep being combined until n or greater is reached. Then proceed with the next uncombined tract less than n, and so on. Number of households is a field in the data. What I've done so far is create centroids for all tracts. I can run the Near tool or the Generate Near Table tool to get each tract's nearest centroid, but apart from going through tracts manually (2800 of them) is not something I want to do. I'm pretty sure this will require a Python script (could be wrong!), which is fine, can do that, but hitting a block on figuring out how the workflow should go. Any suggestions? Thanks.
... View more
12-01-2020
07:27 AM
|
0
|
2
|
785
|
POST
|
Thanks again Scott. Not sure what version of Enterprise we're using. The current setup we have is maybe a bit unusual. A couple of the state departments (Michigan) have their own stand alone Portals, while so far the rest of the departments, including mine, currently share one (we may get our own soon). A separate department is the admin for them. I know I have Creator privileges, and can add users to the Viewer level, but not to the Creator level. We can buy more Creator level licenses, but don't know what kind of budgetary/bureaucratic hoops are required to jump through. Above my pay grade. Guess I'll try AGOL.
... View more
08-03-2020
11:48 AM
|
0
|
0
|
1846
|
POST
|
Thanks Scott. Right now I can only add users as Viewers, not Creators. I'm not an admin, so can't change that. Here's what the Licensing screen shows:
... View more
08-03-2020
09:06 AM
|
0
|
2
|
1846
|
POST
|
I used Survey123 Connect to create a survey and publish it to a group in our Portal site. I then added a couple users (limited to Viewer, Level 2, role) to the group. When they use the field app on their mobile device and log into Portal, they get the message 'Denied. You do not have sufficient user level to access this application'. Am I doing something wrong, or do they need a role with higher levels of permission to use the survey? I can port it to AGOL if that's easier. We'd have to purchase a bunch more Level 1 licenses otherwise. Thanks!
... View more
08-03-2020
08:11 AM
|
0
|
4
|
1899
|
POST
|
Another option would be to export the tables in Access to Excel or csv and import those to Pro.
... View more
04-22-2020
04:55 AM
|
0
|
2
|
1674
|
POST
|
Thanks Tom. What I ended up doing is formatting the table in Excel and then inserting it as a picture. Not ideal, but works for now.
... View more
08-26-2019
04:24 AM
|
0
|
2
|
2153
|
POST
|
Thanks Tom. I was afraid of that. Although there are only a few values I want highlighted, there are enough other values that the method you suggest wouldn't be practical. Oh well, over to the ideas page.
... View more
08-23-2019
04:24 AM
|
0
|
4
|
2153
|
POST
|
Is there a way to conditionally format a cell in a table frame, either manually or by setting some condition? I can format an column, but I'd like to set text properties and ideally background color for cells where the value exceeds a certain number. I tried formatting the data in excel and used that as the data source for the frame, but the format settings didn't import with it. Thanks!
... View more
08-22-2019
07:41 AM
|
1
|
6
|
2317
|
Title | Kudos | Posted |
---|---|---|
1 | 08-22-2019 07:41 AM | |
1 | 05-05-2014 04:30 AM | |
1 | 08-15-2018 06:23 AM | |
2 | 08-06-2018 07:31 AM | |
1 | 03-30-2012 08:38 AM |
Online Status |
Offline
|
Date Last Visited |
12-12-2021
01:00 PM
|