|
POST
|
Since you're starting and immediately stopping an edit session, you may as well remove all that and see if it helps.
... View more
09-07-2018
09:27 AM
|
0
|
1
|
1385
|
|
POST
|
Please format your code so it's not single-line: /blogs/dan_patterson/2016/08/14/script-formatting selectList = []
fip = '13245'
for fc in featureclasses:
select = arcpy.MakeFeatureLayer_management(fc, "temp_lyr","FIPS_CODE = '{}'".format(fip))
arcpy.env.workspace = "C:/Workspace/Sandbox/selects.gdb"
selectFeatures = arcpy.CopyFeatures_management(select, "select_{}".format(fip))
selectList.append(selectFeatures) See here for using geoprocessing result objects: Using tools in Python—Help | ArcGIS Desktop I'm guessing you want to use: selectList.append(selectFeatures[0])
# or
selectList.append(selectFeatures.getOutput())
... View more
09-05-2018
03:07 PM
|
2
|
0
|
1083
|
|
POST
|
Try running it in a loop (untested): arr = arcpy.da.TableToNumPyArray(tbl, "*")
for item in arr:
fn = "{}{}{}{}".format(
item['SG_PREFIX'],
item['SG_SUFIX'],
item['SG_PERIO'],
item['SG_FORMA']
)
a = item['VL_A']
b = item['VL_B']
c = item['VL_C']
d = item['VL_D']
eq = a + b*lat + c*lon + d*alt
... output here
... View more
09-05-2018
10:58 AM
|
0
|
1
|
4715
|
|
POST
|
You'd have to physically move the polygons in a copy of your file: Moving a feature by dragging it—Help | ArcGIS for Desktop
... View more
09-05-2018
10:06 AM
|
2
|
1
|
566
|
|
POST
|
Please format your code so we can see the indentation: /blogs/dan_patterson/2016/08/14/script-formatting Is there an error, or what else is going wrong? edit: you pass 'class_name' as the '_searchElementBy' value, so it never meets the if condition, so there are never any stores. Also, you define '_link', but not 'link' so I assume you get an error there.
... View more
09-05-2018
09:29 AM
|
0
|
0
|
978
|
|
POST
|
Your picture shows long (integer), but you say double (float). GetParameterAsText returns a string. This seems to be a data type issue, so I'd start by forcing your parameters into the correct type.
... View more
09-05-2018
09:24 AM
|
1
|
1
|
2755
|
|
POST
|
Can you use the OID/FID rather than incremental number? Alternatively, you might be able to use a timestamp like below: import time
for i in range(0,10):
timestamp = int(time.time()*10000000)
cur_id = 'BA 20160114 ABC {}'.format(timestamp)
print(cur_id)
BA 20160114 ABC 15351426652282692
BA 20160114 ABC 15351426652283268
BA 20160114 ABC 15351426652283508
BA 20160114 ABC 15351426652283718
BA 20160114 ABC 15351426652283840
BA 20160114 ABC 15351426652283930
BA 20160114 ABC 15351426652284028
BA 20160114 ABC 15351426652284128
BA 20160114 ABC 15351426652284510
BA 20160114 ABC 15351426652284910
... View more
08-24-2018
01:22 PM
|
1
|
1
|
2254
|
|
POST
|
Just out of curiosity, what do you get if you run `print(map)`? I get: MapView(basemaps=['dark-gray', 'dark-gray-vector', 'gray', 'gray-vector', 'hybrid', 'national-geographic', 'oceans', 'osm', 'satellite', 'streets', 'streets-navigation-vector', 'streets-night-vector', 'streets-relief-vector', 'streets-vector', 'terrain', 'topo', 'topo-vector'], center=[0, 0])
... View more
08-17-2018
01:24 PM
|
1
|
9
|
2517
|
|
POST
|
It will be hard to say what's going on without seeing the code that came before. Does the following work on its own? from arcgis.gis import GIS
gis = GIS()
map = gis.map("Paris")
map
... View more
08-17-2018
01:06 PM
|
1
|
11
|
2517
|
|
POST
|
I might be barking up the wrong tree, but can you confirm you don't have both of these in your script? import matplotlib.pyplot as plt
import matplotlib as plt
Perhaps more usefully, can you post the script you do have?
... View more
08-16-2018
02:31 PM
|
0
|
2
|
2399
|
|
POST
|
I can't explain your situation, but I will point out that it is by far more common to see the following, so I suggest sticking to that for compatibility: import matplotlib.pyplot as plt
... View more
08-16-2018
11:19 AM
|
1
|
4
|
2399
|
|
POST
|
Oh, if you've got population polygons, then just convert them to raster. The idea is that you'll get two rasters, each with a "score" (population and distance) and combine them in some way so you have a single index of high to low. Perhaps you'll scale the population values to 0-1 range, and distance to 0-1 range. Add them together and you'll have an index from 0-2. But, play around with your data and figure out what works for you - I haven't put that much thought into it.
... View more
08-14-2018
03:42 PM
|
1
|
0
|
1836
|
|
POST
|
There's no one tool that will solve this problem for you. As Dan says, start simple and get more complex as you refine what you want to do. For example, you have two main problems to solve: 1.) calculate population density (Point Density, or possibly Kernel Density), and 2.) calculate distance from existing pharmacies (Euclidean Distance). Combine with Map Algebra. Move on to more complex tools once you've decided the simple tools don't do what you want.
... View more
08-14-2018
03:25 PM
|
0
|
2
|
1836
|
|
POST
|
The libraries you've listed are good at certain things, and don't do some things at all. At the beginning at least, I'd suggest being a jack of all trades and master of none. Learn that numpy is good at handling numbers (e.g. rasters), pandas is good at handling tables, arcpy handles ArcGIS-style data (but not as fast as numpy or pandas), and matplotlib draws your graphs. Do a lot of googling for how to do specific things when you need to do them. Honestly, I wouldn't try to learn everything about any of these libraries.
... View more
08-09-2018
04:02 PM
|
2
|
0
|
1921
|
|
POST
|
The main tool I think you're looking for is Make Feature Layer. I'm not exactly sure what you're trying to accomplish, but I think you'll make a list of the feature classes you want to load in ArcMap, in some way, then loop through the list, calling Make Feature Layer each time. With that said, I also suspect that you want to automate some other analysis. The usual answer to, "how do I load many layers in ArcMap?" is, "don't." Do your analysis in Python, then load the result in ArcMap to view it. Of course, step one is learn Python, so if you haven't done that, do so, and reply with your script for more specific help.
... View more
07-31-2018
03:29 PM
|
1
|
1
|
1328
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|