IDEA
|
upon first review of the process to draw measured hatches along lines, that works really well and has a lot of options, it's just buried in there with the many symbol options of pro. That link was helpful but it could use more screenshots, the terminology used in that link to achieve this is so specific to pro (but was very well worded and I could easily figure it out). Also, what can be done to keep the hatched labels from drawing upside down? I set my text angle at 270 to get my hatch labels right-side up.
... View more
10-10-2018
12:26 PM
|
0
|
0
|
2409
|
IDEA
|
good description of the idea, I changed it. Great info on the hatching capability, I will look at that, thanks.
... View more
10-10-2018
10:36 AM
|
1
|
1
|
2409
|
IDEA
|
Arcmap has layer properties specific to Route Feature classes (with measures) allowing the layer to support hatching symbology and labeling, as well as ability to show where measures do not increase as described here: Displaying route measure anomalies—Help | ArcGIS for Desktop The idea is to incorporate the same functionality into ArcGIS Pro.
... View more
10-10-2018
10:09 AM
|
14
|
6
|
3011
|
POST
|
I do it like this because I use LRS. With this script I can use my routes with measures to create points at different increments for different LRS Reference Methods: pydot/HatchFake.py at master · KDOTGIS/pydot · GitHub '''
Created on Jul 14, 2015
This script will create route events as points along the route features at specific increments
the points can be symbolically displayed as route hatches for web mapping
@author: Kyle Gonterwitz with, as always the amazing help from Dirk Talley
@contact: Kyleg@Ksdot.org
'''
#import arcpy
from arcpy import (AddField_management, MakeFeatureLayer_management, CreateTable_management,da, Exists, AddXY_management,
TruncateTable_management, Append_management, MakeRouteEventLayer_lr, Delete_management, FeatureClassToFeatureClass_conversion, env)
#set the geodatabase parameters for the input route data
env.overwriteOutput = True
wsPath = r"Database Connections\shared@SQLGIS_cansys_gis_dev.sde" #enter the workspace path that has the data owner login
StatefcRoutes = r"\\gisdata\arcgis\GISdata\Connection_files\RO@sqlgisprod_GIS_cansys.sde\GIS_CANSYS.SHARED.SMLRS" # State Route feature class with begin/end attribs
CountyfcRoutes = r"\\gisdata\arcgis\GISdata\Connection_files\RO@sqlgisprod_GIS_cansys.sde\GIS_CANSYS.SHARED.CMLRS" #County Route Feature Class with begin/end attribs
#State and County are the Two main Linear Referecing Methods used by KDOT which will be hatched
StateOutTable = "SMHatch"
CountyOutTable= "CMHatch"
StateFields = ["LRS_Route", "BEG_STATE_LOGMILE", "END_STATE_LOGMILE"]
CountyFields = ["LRS_KEY", "BEG_CNTY_LOGMILE", "END_CNTY_LOGMILE"]
#this field sets the hatch separation/spacing. For a hatch point every 1/10 of a mile, enter 0.1. For a hatch every 1/100th of a mile, choose 0.01.
#for mapping in KanPlan 1/10 mile seems plenty sufficient, and will create about 108,000 points for each LRM.
#1/100 would create 1,080,000 points which might suffer from use of in-memory processing, already this script takes a few minutes to run for each LRM
HatchSep = 0.1
countyLRM = [CountyfcRoutes, CountyOutTable, CountyFields]
stateLRM = [StatefcRoutes, StateOutTable, StateFields]
LRMethod = [countyLRM, stateLRM]
for method in LRMethod:
print "creating hatches for " + str(method[1])
#add route table as feature layer
if Exists("RouteLyr"):
Delete_management("RouteLyr")
else:
pass
MakeFeatureLayer_management(method[0], "RouteLyr", "DIRECTION in ( 1 , 2 )")
#create event table in memory
mem_table = "HatchEvents"
if Exists(r"in_memory\\"+mem_table):
print str(mem_table) +"already existed, deleting"
Delete_management(r"in_memory\\"+mem_table)
else:
print "Creating table for processing route increments of " + str(HatchSep)
CreateTable_management("in_memory", mem_table)
mem_table = r"in_memory\\"+mem_table
AddField_management(mem_table, "RouteID", "TEXT")
AddField_management(mem_table, "LogMile", "Double")
for row in sorted(da.SearchCursor("RouteLyr", (method[2]))): # @UndefinedVariable
LRSKEY = row[0]
if LRSKEY == (LRSKEY):
# use this loop to test the script against a single route
iter0 = row[1]
#print row[0]+ ' from '+str(row[1])+' to '+str(row[2]) #print the current LRS Key
#set the begin and end parameters from which to create incremental values
if HatchSep == 0.1:
round_dec = 1
elif HatchSep == 0.01:
round_dec = 2
else:
round_dec = 0
print "check hatch separation value"
minlog = round(row[1], round_dec)
if minlog > row[1]:
minlog = minlog - HatchSep
else:
pass
maxlog = round(row[2], round_dec)
if maxlog < row[2]:
maxlog = maxlog + HatchSep
else:
pass
#set the starting point for the route segment
itermile = minlog
#now loop between the start and end logmiles for each route segment, and insert the step increment into the event table in memory
while itermile <= maxlog and itermile >= minlog:
#print str(itermile)
with da.InsertCursor(mem_table, ("RouteID", "LogMile")) as insert:# @UndefinedVariable
insertfields = [LRSKEY, itermile]
insert.insertRow(insertfields)
itermile = itermile + HatchSep
del minlog
del maxlog
MakeRouteEventLayer_lr("RouteLyr", method[2][0], mem_table, "RouteID POINT LogMile", "HatchPoints_events", "", "ERROR_FIELD", "ANGLE_FIELD", "NORMAL", "COMPLEMENT", "LEFT", "POINT")
#add XY points, later on these coordinates can be used to hyperlink to google street view, bing maps, etc. Make sure we are in NAD83 Lat/Long CRS here.
AddXY_management("HatchPoints_events")
try:
Delete_management(wsPath+'//'+method[1])
FeatureClassToFeatureClass_conversion("HatchPoints_events", wsPath, method[1], "LOC_ERROR = 'NO ERROR'")
except:
TruncateTable_management(wsPath+'//'+method[1])
Append_management("HatchPoints_events", wsPath+'//'+method[1])
cleanup = [mem_table, "RouteLyr", "HatchPoints_events"]
for layer in cleanup:
Delete_management(layer)
... View more
08-20-2018
03:26 PM
|
1
|
0
|
2417
|
POST
|
label the first character of the milepost string, then label the second character on the next line, third char on the next line, like so: Layers/KDOT_reference_post_markers (MapServer)
... View more
08-20-2018
03:22 PM
|
1
|
0
|
946
|
BLOG
|
Have you ever compared the speed of a Data Access cursor update vs using the field calculator? Using data access cursors is a rite of passage for developers using python for ArcGIS, surely. Write a few more lines of code to save some processing time. Next thing you know, your python code is getting complicated. A few years ago I started using pymssql with SQL Servers and cx_Oracle with Oracle Databases in my python scripts. In ArcGIS Pro now, looks like pymssql is getting antiquated, because Conda cant install it - it's not easy to install with a wheel and its less easy to get that wheel to work in the propy conda environment. The ArcGIS Pro Conda package manager has no problem installing pyodbc so I set up a system DSN and used that to call sql scripts with Update TABLE set FIELD = Expression WHERE 1=1 within python scripts as a cursor. Arcpy also gives you ArcSDESQLExecute—ArcPy classes | ArcGIS Desktop to execute native SQL commands using a Geodatabase connection rather than a DSN, so I will have to try that next time. Native SQL can make the da cursor look slow, it gives much more control over join types and integrity, and it can be done in less characters of code, easily, from a python script.
... View more
08-01-2018
07:51 AM
|
0
|
0
|
350
|
BLOG
|
I use an excel workbook to keep track of things, including actions or to-do's, my server names and specs, software billing to departments, projects and status, communication plans, registration of risks and issues, training plans, staff duties, projects plans and pretty much anything else that has to do with GIS management. I even learned how to create GANTT charts in Excel from the internet. Sometimes after a long weekend it helps to get right back to productivity. It also helps me to plan ahead - I would not some bigger to-do items late in the afternoon or on a Friday, I'd work on clearing out smaller to-do items and maybe cleaning up my office/desktop and start the bigger tasks that require more focus on Monday or Tuesday morning on a week when my calendar is relatively clear. That's my method - I copied it from another successful project manager and it works well for me. What's your method for keeping up with the to-do list at work?
... View more
07-02-2018
08:42 AM
|
0
|
0
|
204
|
IDEA
|
I want to add on to these implemented ideas: Pop-up Arcade Expressions in ArcGIS Pro Add Hyperlink with a variable to Pop-Up in ArcGIS Pro and propose the SHAPE field of the feature class get added to the Arcade expression builder and GEOMETRY functions added to the expression builder to act on the SHAPE in a manner similar to python shape tokens. The overall result of the idea is to be able to use the SHAPE field to display tokens that can be used to link to other systems by using the lat/long coordinates. Additionally, some geometry functions specific to coordinate reference system conversions should be added to functions so that dynamic lat/long coordinates can be used in hyperlinks when features are projected.
... View more
06-28-2018
03:25 PM
|
7
|
1
|
1459
|
POST
|
In the popup configuratior for the latest version of pro, there is an option to add text to the popup, then at the bottom of the configurator, a button for expressions. Click that button, then there is another button that says "new". Click NEW then we get this window: In this expression builder, there are only text, number, and date functions. also in this expression builder, the SHAPE field is not presented as an actionable field. So, looks like a "cant be done" for now in pro. To the ideas page!
... View more
06-28-2018
02:19 PM
|
1
|
1
|
2906
|
POST
|
My data is a hosted feature service for the collector app. I don't want to have to calculate attribtues in the hosted feature service layer each time a point is added or moved or set up some nonsense CDC process to do this. I dont actually need the lat/long in the popup, what I really need is the lat/long as URL tokens behind an image to link to google maps, bing maps, and most of all, mapillary at a particular location and scale. If I could get the coordinates in the popup I can get them in a url expression I think, but the popup would be an easy test to see that yes, it can be done. I will look at the math solution there Håkon Dreyer maybe I can get that to work with the point[() function? That is nice to know, I figured a mathematical projection calculation might be part of a solution. Maybe I will take this to the Ideas page.
... View more
06-28-2018
01:50 PM
|
1
|
0
|
2906
|
POST
|
Had some issues yesterday morning. Saw the health was ok for hosted feature services but iffy on geoenrichment. Next time I will report this issue.
... View more
06-28-2018
12:41 PM
|
0
|
0
|
570
|
POST
|
Just FYI, another way to remove the right most string in VB is to use the String Reverse method, remove first string using left or mid, then use the string reverse again. This is a method I have found handy for classifying Schools into Elementary, Junior High, Middle, and High Schools, because a list of schools usually has a format like "MARTIN LUTHER KING JR ELEMENTARY SCHOOL" or "JEFFERSON MIDDLE SCHOOL" so the string reverse method gives you an easy way to work from the right to left by reversing the characters so you are actually working left to right, without having to count characters or string parts. Just make sure to reverse the text again so you arent showing anybody information that looks like "LOOHCS ELDDIM NOSREFFFEJ"
... View more
06-28-2018
11:47 AM
|
0
|
0
|
4093
|
POST
|
Here's the longitude: 0-(float(!LONG![0:2])+float(!LONG![3:5])/60+float(!LONG![6:7])/3600+float(!LONG![9:10])/100000) I'm not sure I got the 9:10 character order of magnitude correct, but this should be close.
... View more
06-28-2018
11:40 AM
|
2
|
0
|
853
|
POST
|
Howdy neighbor. There are so many variations of DMS, I have not seen this one before where the decimal seconds are space delimited rather than just using a decimal. Anyhow, in the case of your example, something like this should work in the field calculator: float(!LAT![0:2])+float(!LAT![3:5])/60+float(!LAT![6:7])/3600+float(!LAT![9:10])/100000
... View more
06-28-2018
11:31 AM
|
1
|
1
|
853
|
POST
|
When I share a pro package to arcgis online using the "Share" menu to share the project, I can share the contents of the ArcGIS Pro project including basemaps and web services (like aerial photo web services) just fine. When I use python to package and share a pro project, it cannot be packaged when any of the maps is using a web service. I reported this as a bug, the python PackageProject_management function will not work with a non-basemap map service, such as valtus imagery or an editable feature service from ArcGIS server. To accommodate this script, those layers have been removed from the project. I wasn't getting the message across to Esri support, I developed my python in pydev for eclipse which they latched on to as the problem because its "outside the pro python environment" or something like that - I do not think that is the issue. The wanted me to run it in idle, and I didn't want to waste any more time on it at that time. So the question is, do you get the same results? If so, would you say this is a bug that needs to be fixed at some point? code snippet: '''
Created on Mar 7, 2018
share the designated ArcGIS Pro project to ArcGIS online
https://pro.arcgis.com/en/pro-app/tool-reference/data-management/share-package.htm
This tool may have limited use in a Python script outside of ArcGIS applications
when sharing a package to a portal that uses OAUTH2 authentication. The ArcGIS Online
for example, uses this authentication method. To authenticate, you must connect directly
to the portal from the application. You will only be able to use this tool in a Python
script if the application is open and connected to the portal, or you're connecting to a
portal which uses traditional authentication mechanisms and allow the user name and
password to be passed in.
reporting a bug, the python PackageProject_management function will not work with a non-basemap map service, such as valtus imagery or
an editable feature service from ArcGIS server. To accomodate this script, those layers have been removed from the project.
@author: kyleg
'''
def ShareProToOnline(onlinepassword):
import datetime
startDateTime = datetime.datetime.now()
print ("this script takes about 8 minutes")
from arcpy import PackageProject_management, SharePackage_management, os, env
env.overwriteOutput = True
#import getpass
from KhubCode25.KhubCode25Config import localProProjectPath, localProProjectName, AGOUser
localproject = os.path.join(localProProjectPath,localProProjectName)
print(localproject)
print ("logging in as"+AGOUser)
try:
username = AGOUser
password = onlinepassword
fileformatDateStr = startDateTime.strftime("%Y%m%d")
summary = "This project contains maps that link to KDOT SQL Server databases AR58 gdb_prod, AR68 gdb_Dev, and a local file geodatabase copied from DT00ar58 gdb_prod for use on Amazon Servers or otherwise outside the KDOT network. The schema presentation matches the schema for the 1spatial extension. For the local geodatabse copy, there is one map displaying highway symbols based on the source LRS network route prefix and direction, and another map displaying highway symbols based on the target network classification and direction"
PackageProject_management(localproject, r"C:\temp\KhubDataCleanup25_"+fileformatDateStr+".ppkx", "INTERNAL", "PROJECT_PACKAGE", "DEFAULT", "ALL", None, summary, "Khub", "CURRENT", "NO_TOOLBOXES", "NO_HISTORY_ITEMS", "READ_WRITE")
#SharePackage_management(SharePackage_management (localProProjectName, "KanDOT", password, summary, "Khub, 1spatial, Roads, Centerlines, LRS, Highways", "KANSAS DOT Restricted Use - 23 U.S.C. 409", "MYGROUPS", "Data Quality Assurance and Quality Control Group", "MYORGANIZATION"))
print("package created, now sharing")
SharePackage_management(r"C:\temp\KhubDataCleanup25_"+fileformatDateStr+".ppkx", username, password, summary, r"Khub,Project Package,ppkx,2D,ArcGIS Pro", "KDOT", "MYGROUPS", "Data Quality Assurance and Quality Control Group", "MYORGANIZATION")
except:
import getpass
username = "kyle.gonterwitz_KSDOT"
password = getpass.getpass("Enter Password for "+str(username)+":")
print("logging in as "+username )
#p = mp.ArcGISProject(localproject)
fileformatDateStr = startDateTime.strftime("%Y%m%d")
summary = "This project contains maps that link to KDOT SQL Server databases AR58 gdb_prod, AR68 gdb_Dev, and a local file geodatabase copied from DT00ar58 gdb_prod for use on Amazon Servers or otherwise outside the KDOT network. The schema presentation matches the schema for the 1spatial extension. For the local geodatabse copy, there is one map displaying highway symbols based on the source LRS network route prefix and direction, and another map displaying highway symbols based on the target network classification and direction"
PackageProject_management(localproject, r"C:\temp\KhubDataCleanup25_"+fileformatDateStr+".ppkx", "INTERNAL", "PROJECT_PACKAGE", "DEFAULT", "ALL", None, summary, "Khub", "CURRENT", "NO_TOOLBOXES", "NO_HISTORY_ITEMS", "READ_WRITE")
#SharePackage_management(SharePackage_management (localProProjectName, "KanDOT", password, summary, "Khub, 1spatial, Roads, Centerlines, LRS, Highways", "KANSAS DOT Restricted Use - 23 U.S.C. 409", "MYGROUPS", "Data Quality Assurance and Quality Control Group", "MYORGANIZATION"))
print("package created, now sharing")
SharePackage_management(r"C:\temp\KhubDataCleanup25_"+fileformatDateStr+".ppkx", username, password, summary, r"Khub,Project Package,ppkx,2D,ArcGIS Pro", "KDOT", "MYGROUPS", "Data Quality Assurance and Quality Control Group", "MYORGANIZATION")
def main():
ShareProToOnline()
if __name__ == '__main__':
import datetime
startDateTime = datetime.datetime.now()
main()
print('project packaged and shared in {} hours, minutes, seconds.'.format(datetime.datetime.now()-startDateTime))
else:
print("functions from KhubShareProProject imported to main script")
... View more
06-27-2018
03:19 PM
|
0
|
0
|
680
|
Title | Kudos | Posted |
---|---|---|
1 | 06-18-2024 03:18 PM | |
1 | 09-01-2023 11:54 AM | |
2 | 02-24-2023 02:56 PM | |
1 | 12-19-2022 07:19 AM | |
1 | 11-04-2022 06:06 AM |
Online Status |
Offline
|
Date Last Visited |
a week ago
|