POST
|
I was just about to hop on here an let you know that I think I found that issue, that there are a few records that are blank. My work around which, anything with a date would take precedence over anything without a date. else:
curDate = dict_RelTbl[joinID][1]
compareDate = row[1]
if curDate is None:
dict_RelTbl[joinID] = row
else if compareDate is not None and compareDate > curDate:
dict_RelTbl[joinID] = row I'm going to give your solution a go as well. Thanks for your help thus far!
... View more
05-10-2017
06:42 AM
|
0
|
0
|
1443
|
POST
|
But I am running into this issue.... Traceback (most recent call last):
File "S:/GIS/ValveScriptTesting.py", line 23, in <module>
if row[1] > curDate:
TypeError: can't compare datetime.datetime to NoneType
... View more
05-10-2017
06:05 AM
|
0
|
0
|
1443
|
POST
|
import arcpy
fcPath = r"S:\GIS\DB Connection Files\DEV\DEV04.sde\WaterDistribution\wSystemValve"
relatedTblPath = r"S:\GIS\DB Connection Files\DEV\DEV04.sde\VALVEACTIVITY"
print "system valves and valve activity paths set"
relTblFields = ["FACILITYID", "INSPDATE", "CurrentPosition"]
fcFields = ["FACILITYID", "CurrentPosition"]
print "field dict's created"
dict_RelTbl = {} #Look up dictionary
#Loop through related table and store only the max date for each unique ID.
with arcpy.da.SearchCursor(relatedTblPath, relTblFields) as cursor:
for row in cursor:
joinID = row[0]
if joinID not in dict_RelTbl.keys():
dict_RelTbl[joinID] = row
# if the key is in the dictionary already (one to many relationship), compare the dates and keep the most recent date
else:
curDate = dict_RelTbl[joinID][1]
if row[1] > curDate:
dict_RelTbl[joinID] = row
with arcpy.da.UpdateCursor(fcPath, fcFields) as cursor:
for row in cursor:
joinID = row[0]
relatedRecord = dict_RelTbl[joinID]
currentPosition = relatedRecord[2]
row[1] = currentPosition
cursor.updateRow(row)
... View more
05-10-2017
06:03 AM
|
0
|
1
|
1443
|
POST
|
This will be helpful to use as a backup check, to see if the script I will be running is successfully writing to the Hydrant tables. I was thinking about 1. setting a definition query on the inspections to only show inspections <=Today's Date and >=Todays date minus seven days. That would remove any historical inspections that we performed on any hydrants, as well as any inspections performed this year that have already been accounted for. 2. Joining the now def. queried table to the hydrants table, by FACILITYID. 3. Using the field calculate management tool to calculate the InspectionDate on hydrants, dependent upon the value found in the joined InspectionDate from the inspection table. Then deleting the temp. join and removing the def. query. In theory this works. We'll see what new python tricks I learn along the way! Thanks for you help. If you see something glaringly wrong in my thought process, please let me know.
... View more
05-09-2017
01:44 PM
|
0
|
3
|
1443
|
POST
|
Trying to figure this out but am having trouble understanding what I fundamentally need to do.... I have a one-to-many relationship class. The one is fire hydrant. The many is fire hydrant inspections. They are related by a unique FacilityID. Both tables have a column called "CurrentPosition", and both of those columns have the same domain. I am trying to figure out the correct procedure to make a python script that will parse through the inspections table, find the most recent inspection (by the field InspectionDate), take the value found in that record for CurrentPosition, and write it to the CurrentPosition field of the HydrantTable. I am planning on finalizing this and having it run as a nightly task so any inspections performed, the current position is updated on the hydrant table that night. My first thought was to make a temporary join, after making a definition query that only allows inspections performed between a set period of time. And then using the calculate field management to update the CurrentPosition, and then release the join. But my definition query on the related table was screwy and kept failing. Does anyone have any suggestions or documentation I can look up? Anyone doing anything similar? Thanks very much in advance!
... View more
05-09-2017
12:44 PM
|
0
|
7
|
3099
|
POST
|
Okay makes sense... I will get with our DBA and see about getting our data owner added to db_owner role
... View more
03-01-2017
06:34 AM
|
0
|
0
|
747
|
POST
|
Thanks Jake. I noticed our SDE user is not a db_owner role, and it still has the ability to connect even if connections are disabled. Could this be from the ProccessAdmin fixed role, with View Definition granted?
... View more
03-01-2017
06:28 AM
|
0
|
2
|
747
|
POST
|
Hi everyone, I'm trying to figure out what privileges (we are using SQL), is assigned to the SDE user that allows them to bypass when a database isn't accepting connections? We have a "headless" data owner, and I would like to assign the same privilege to them so that when I am running nightly scripts and have to index and analyze datasets, I don't have to keep dropping the owner connection to index system tables, then allowing connections so the owner can rebuild indexes on all the actual data tables and delta tables. Is it because SDE is a member of the processsadmin fixed server role and granted VIEW DEFINITION on the database? Is that what the data owner should be a member of? We only use the data owner account strictly for owning data. We do not use the owner account, or the SDE for anything related to publishing services, so no web services will constantly be pinging the database when I'm trying to perform maintenance. Thanks!
... View more
03-01-2017
05:13 AM
|
0
|
4
|
1304
|
POST
|
I didn't realize Portal came with a local copy of Javascript. We essentially have everything we need already to run an install of Portal (IIS, ArcServer, Data Store, Local Cache of aerial imagery for basemaps, and SDE). Just no one has gone down the Portal route before me, and no one has really looked at our EOC, the demands it has on GIS, and the situations we could possibly be in if we lose various amounts of connectivity. Apparantley, the person before me didn't look into the underlying sources and dependencies on outside internet connection that AGOL has. I will still probably go with a lightweight viewer that has editing capabilities for when we have lost all outside connectivity (we will still have ArcServer, data sources, cache, our domain controllers, active directory, etc). Then when connectivity comes back up, migrate users to ArcGIS Online web apps. Then eventually down the road do a full Portal install specifically for our EOC center, once they see the added benefit of giving our GIS dept (which is just me) funds and letting me set up a system the can function in all situations.
... View more
02-02-2017
05:47 AM
|
0
|
0
|
597
|
POST
|
We already have 30 AGOL usernames being used by Field Users. An install of ArcGIS Server connected to a Web Server configured with Web Adaptor in our DMZ, secured with our Windows Domain, but using GIS Server authentication. I would just install Portal on a second machine inside our network. More than likely pulling from the same ArcGIS Server. Maybe eventually installing a couple more ArcServers for clustering our map services, geoprocessing, and cache... once I assess how much of a load/demand is being put on the system. We essentially have all the hardware and software we need to run it currently, and I would be the poor bastard that has to look after everything haha
... View more
02-02-2017
05:39 AM
|
0
|
0
|
597
|
POST
|
I plan to download the API and reference it in a lightweight viewer with editing capabilities for when we have intermitten to sever internet connectivity issues. I might go the full Portal route referencing the API internally further down the road, but I don't know if I have the time or man-power to push out a full Portal install and configuration right now. At least using a lightweight html viewer for intermittent connectivity, then once connectivity is restored, migrating to our applications that reference web maps in our ArcGIS Online account. Then maybe for next year in-between hurricane seasons we can put together a plan for migrating to a full Portal initiative for our EOC.
... View more
02-01-2017
03:46 PM
|
0
|
2
|
597
|
POST
|
Okay, so you guys have Portal within your internal network. It has web maps, web apps, and all of it is referencing a local, downloaded copy of the Javascript API? Was it a big pain in the butt after creating all the web maps and apps, to go into their javascript files and change the CDN from ESRI's site, to your local copy? Or when configuring Portal, before creation of any layers, maps, or apps, you can specify for your internal Portal to reference a local copy of the API stored on either your internal web server, or some other web server/fileshare?
... View more
02-01-2017
03:43 PM
|
0
|
2
|
597
|
POST
|
If that is the case, I might launch a Portal specifically for our EOC environment. I'm going to do some digging, and may even call ESRI for confirmation, because if that is true, that eliminates a lot of my concern. I'll get back to you after I've done some more digging to confirm. Thanks
... View more
01-27-2017
10:35 AM
|
0
|
0
|
423
|
POST
|
Yes, we actually server up our own basemaps as image services on our ArcGIS Server so i'm not to concerned about basemaps, as I am the underlying Javascript and HTML files created when you make a "web-app". The whole driving factor behind those files that create the application is ESRI's Javascript API, which is hosted on ESRI Servers. So I was wondering if you use portal. Although the services are local, the web map is local, the web app is local, I think the underlying files that make that app and web map still referencing external sources (ESRI's API).
... View more
01-27-2017
09:30 AM
|
1
|
2
|
423
|
POST
|
We use all of our own basemaps, namely a simple basemap like the the open streets basemap, as well as several image services that are cached aerials that we host internally and serve up through our ArcGIS Server. So if we lost connectivity to the outside world, we still could consume aerial basemaps through our ArcGIS Server. I'm wondering if, when Portal is installed.... underneath the web maps and web apps, isn't the driving factor still ESRI's javascript API? Yes Portal is an internal AGOL, but because it is internal, doesn't mean it isn't accessing and consuming ESRI resources such as the API used to construct the internal applications. I don't know if I'm explaining my thought process clearly or not. Basically, if I have Portal, and everything is from my ArcGIS Server. If we lose complete internet connectivity to the outside world, would all of those maps and apps fail to work because they need a connection to the Javascript API on ESRI's servers that was used to build/configure them? Or does Portal somehow come with a local copy of the API and all maps and apps reference that API, which gets updated automatically, so when internet connectivity gets lost, the maps and apps are still being driven by an internal API, and are thus.... fully functional.
... View more
01-27-2017
09:14 AM
|
0
|
1
|
597
|
Title | Kudos | Posted |
---|---|---|
1 | 11-07-2016 02:13 PM | |
1 | 06-02-2017 05:23 AM | |
1 | 01-26-2017 01:06 PM | |
1 | 01-27-2017 09:30 AM | |
2 | 11-17-2016 01:44 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|