|
POST
|
Creating a new network junction feature class in the Catalog tree—ArcMap | Documentation Does anyone know if this is possible with python? And if so is there any documentation on it? Thanks!
... View more
08-13-2020
02:45 PM
|
0
|
0
|
748
|
|
POST
|
You could use dictionaries to count the number of repeating ids. Maybe something like this...
ids = ['D36528',
'D36528',
'D36528',
'D36532',
'D36532',
'D36521',
'D36522',
'D36525',
'D36525', ]
ids_dict = {}
uids = list(set(ids))
for uid in uids:
ids_dict[uid] = []
for id in ids:
ids_dict[id] = ids_dict[id] + [id]
for k, v in ids_dict.items():
print '{k}, {n}'.format(k=k, n=len(v))
Output: D36532, 2 D36528, 3 D36521, 1 D36522, 1 D36525, 2
... View more
08-13-2020
02:35 PM
|
1
|
6
|
3790
|
|
POST
|
lol - you are not exactly filling me with confidence....
... View more
06-15-2020
06:45 PM
|
0
|
1
|
1390
|
|
POST
|
I want to download data from the city's ArcGIS Hub with python and save it in a fgdb to then be loaded into sde. I have started with this tutorial - ArcGIS Hub. While I can get the feature layer with python I am having a hard time understanding how to save it to a gdb. (I have used arcpy a fair bit but I am new to this arcgis API) from arcgis.features import FeatureLayer
shoreliness_url = \
'https://services2.arcgis.com/Ce3DhLRthdwbHlfF/arcgis/rest/services/Shorelines_Hosted/FeatureServer/0'
shoreliness = FeatureLayer(shoreliness_url)
# ??? Suggestions?
... View more
06-15-2020
06:33 PM
|
0
|
4
|
1466
|
|
POST
|
I have seen a combination of keyring · PyPI and windows Windows Credential Vault used in the past. How is python-keyring implemented on Windows? - Stack Overflow
... View more
05-14-2020
09:39 AM
|
0
|
0
|
2902
|
|
POST
|
Maybe post what you have? And document what you have tried...
... View more
05-14-2020
09:28 AM
|
0
|
1
|
3689
|
|
POST
|
you're welcome... I updated the code sample so the output will do the calc for all dates, not just the top two.
... View more
05-11-2020
10:06 AM
|
0
|
0
|
2212
|
|
POST
|
You could do it with dictionaries. Use the FIPS as the key. Each value could be a list of tuples with 2 values (date, case_num) After you build the dictionaries sort each list by the date part of the tuple. Then take the top two list elements and subtract the case number. Output data done! Maybe something like this... (not jupyter notebook) code: import csv
with open('case.csv', 'r') as f:
reader = csv.reader(f)
data = list(reader)
data.pop(0)
data = [x[1:] for x in data]
data_dict = {x[1]: [] for x in data}
for row in data:
data_list = data_dict[row[1]]
data_list.append((row[0], row[2]))
data_dict[row[1]] = data_list
for key, value in data_dict.items():
value.sort(reverse=True)
for i in range(0, len(value) - 1):
diff = int(value[1]) - int(value[i + 1][1])
print '{},{},{},{}'.format(key, value[0], value[1], diff)
print '{},{},{},{}'.format(key, value[-1][0], value[-1][1], 0) csv: ID,Date,FIPS,Cases
7,5/4/20,001,21
8,5/4/20,002,6
1,5/7/20,001,25
2,5/7/20,002,13
3,5/6/20,001,23
4,5/6/20,002,9
5,5/5/20,001,21
6,5/5/20,002,8 output: 002,5/7/20,13,4
002,5/6/20,9,1
002,5/5/20,8,2
002,5/4/20,6,0
001,5/7/20,25,2
001,5/6/20,23,2
001,5/5/20,21,0
001,5/4/20,21,0
... View more
05-07-2020
06:11 PM
|
1
|
2
|
2212
|
|
POST
|
You can build the connection on the fly in your code if you like. But it is simplest to just create one ahead of time as Joe suggested. The python way: Create Database Connection—Help | ArcGIS for Desktop Or in ArcCatalog: - right-click on a folder and select New > Database Connection... - then you will need the user name and password etc.
... View more
04-24-2020
06:05 PM
|
0
|
0
|
2148
|
|
POST
|
So, it looks a little buggy to me--like the xml in the gdb_items_vw is not getting updated when the other sde system tables are. (We are on Oracle).
... View more
03-02-2020
02:06 PM
|
0
|
2
|
1015
|
|
POST
|
After unregistering as versioned all objects in a schema the simple relationships still show up as versioned when I check with sql. There is also one feature dataset that has the same problem. When I check the feature dataset with ArcCatalog it gives me the option to register as versioned. So, I think the sql query is not telling the whole story... Why is this happing? select i.name as name, t.name as type
from sde.gdb_items_vw i
join sde.gdb_itemtypes t
on i.type = t.uuid
where i.definition like '%Versioned>true%'
... View more
03-02-2020
12:56 PM
|
0
|
4
|
1096
|
|
IDEA
|
Create a tool that will export a feature's representation geometry so that it becomes the primary geometry of the feature class, where a geometry override exits, otherwise it would retain the original geometry. The output feature class would not have representations. One use case: We have a bunch of data that has been entered into GIS as-built (in some cases it is survey quality) for an electrical network. So, this is a great resource for engineering folks but not so great for general display because features are placed very close to each other or right on top of each other. So, one option is to implement representations. We get the best of both worlds! We get to keep our survey quality stuff and we have nice looking maps for everyone else. But now we want to export our display gis geometry a different application (not an esri app) for outage management (OMS). The OMS folks need to able to see what is happing in each individual power line, so it is not very helpful to have 6 power lines right on top of each other. How do I provide them with the representation geometry with out of the box esri tools? Looks like I don't at this time...
... View more
01-23-2020
03:15 PM
|
3
|
1
|
1216
|
|
POST
|
I am trying to do the pattern outlined in this post: arcpy - Publishing service using service definition file (sd) through the ArcGIS REST API? - Geographic Information Syst… and the same post on geonet: https://community.esri.com/message/882685-re-how-do-i-publish-a-service-using-a-service-definition-file-sd-through-the-a… But I am stuck on step one upload sd file to the server with rest api. Upload—ArcGIS REST API: Services Directory | ArcGIS for Developers action = 'uploads/upload'
url = "http://{}:{}/arcgis/admin".format(server, port)
requestURL = url + "/{}".format(action)
query_dict = {
'file': r'C:\xx\xx\xxx.sd',
"token": token,
"f": "json"
}
query_string = urllib.urlencode(query_dict)
r = urllib.urlopen(requestURL, query_string)
j = json.loads(r.read())
print j The json output is: {u'status': u'error', u'code': 500, u'messages': [u'This operation must be a multipart request.']} I have also tried with requests without any luck: token = get_token('user', 'password', 'server', '6080', 60)
item = r'C:\xx\xx\xxx.sd'
files = {'file': item}
payload = {'f': 'json', 'token': token}
url = 'http://server:6080/arcgis/admin/uploads/upload'
resp = requests.post(url, files=files, data=payload,
verify=False) # Use verify=False if you don't have a certificate to use
json_data = resp.json() If I look at the resp object in the debugger I see: content = {"status":"error","messages":["No file is associated with the upload request."],"code":500} How can I get this working?
... View more
12-12-2019
06:12 PM
|
0
|
3
|
2962
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-04-2024 05:39 PM | |
| 1 | 07-30-2024 09:05 AM | |
| 1 | 07-08-2024 05:32 PM | |
| 1 | 03-20-2024 10:27 AM | |
| 6 | 03-13-2024 03:38 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-12-2025
11:02 AM
|