Does anyone know how to change the formatting of the COGO 'Direction' number format into a text string to import into ArcMap COGO?
I can copy paste from the direction field to a text field and it keeps the formatting but if I try and do a calculate field it just turns into a number...N14°27'50.00"E calculates to 14.4638888893333 but if I copy/paste it returns N14°27'50.00"E.
I want to use Pro but the SDE was set up using ArcMap and the 'direction' format is different.
Any suggestions?
Thanks
Solved! Go to Solution.
You can use both ArcMap and ArcGIS Pro clients against the same feature class.
To use Pro as your primary client you can:
1. Run geoprocessing Enable COGO from ArcGIS Pro against the feature class in your SDE.
2. Download this geoprocessing script tool
3. Run the tool from ArcGIS Pro against the feature class in your SDE
4. Add the feature class to a map in ArcGIS Pro - it will be added with COGO symbology, labeling, display expression etc.
If you really need to have the fields update as strings in the old ArcMap fields, you can use the logic in the label expression to do it or use the Arcade method 'ConvertDirection' and an Attribute Rule Calculation.
Hi mcguerd, here's a quick way to calculate a text field and populate it with the quadrant bearing text by converting it from a double that represents north azimuth, decimal degrees:
1. Open the Attribute table of the line layer:
2. Right-click the column header of the Text field you want to calculate, and click "Calculate Field"
3. Set the Expression type to Arcade:
Copy the following Arcade function and expression into the code block area, and click OK or Apply. Of course, you can adapt the code if you want to change the symbols like the "°" into a "-" etcetera. This expression also assumes your source field name is called "Direction" .
function NorthAzimuth2Quadbearing(azimuth){
return ConvertDirection( azimuth, {directionType:'North', angleType: 'Degrees'}, {directionType:'Quadrant', angleType: 'DMS', outputType: 'text', format: 'pd[°]mm[\']ss["]b'})
}
NorthAzimuth2Quadbearing($feature.Direction)
You can use both ArcMap and ArcGIS Pro clients against the same feature class.
To use Pro as your primary client you can:
1. Run geoprocessing Enable COGO from ArcGIS Pro against the feature class in your SDE.
2. Download this geoprocessing script tool
3. Run the tool from ArcGIS Pro against the feature class in your SDE
4. Add the feature class to a map in ArcGIS Pro - it will be added with COGO symbology, labeling, display expression etc.
If you really need to have the fields update as strings in the old ArcMap fields, you can use the logic in the label expression to do it or use the Arcade method 'ConvertDirection' and an Attribute Rule Calculation.
Thanks - I will have to check out the tool and test it against the sde. I really appreciate your help!!
Actually now I have another question on this for you...since the sde 'COGO' line used in ArcMap is a text, I get an error trying to run the 'Enable Cogo' tool. It just says that the line direction format is incorrect. Do I need to run it in ArcMap instead of Pro?
Because both COGO schemas use the same field name ('Direction') but one is a String and one is a Double, it will not be possible to use both ArcMap and ArcGIS Pro against the same feature class as I have wrongly suggested.
I would recommend moving to Pro following the steps above. It is still a simple feature class that can be viewed in ArcMap.
Hi mcguerd, here's a quick way to calculate a text field and populate it with the quadrant bearing text by converting it from a double that represents north azimuth, decimal degrees:
1. Open the Attribute table of the line layer:
2. Right-click the column header of the Text field you want to calculate, and click "Calculate Field"
3. Set the Expression type to Arcade:
Copy the following Arcade function and expression into the code block area, and click OK or Apply. Of course, you can adapt the code if you want to change the symbols like the "°" into a "-" etcetera. This expression also assumes your source field name is called "Direction" .
function NorthAzimuth2Quadbearing(azimuth){
return ConvertDirection( azimuth, {directionType:'North', angleType: 'Degrees'}, {directionType:'Quadrant', angleType: 'DMS', outputType: 'text', format: 'pd[°]mm[\']ss["]b'})
}
NorthAzimuth2Quadbearing($feature.Direction)
Perfect!!! This is exactly what I was looking for but could not figure out for myself...Thank you sooooo much!!
Hi Tim. Thanks for your response to the question. I found your response to this issue heading to my goal. How can the text be converted so that it uses space and dashes to show the values so instead of N90°00'00"E, I need to read as N 90-00-00 E?
Thanks.
Here is how to do that:
function NorthAzimuth2Quadbearing(azimuth){
return ConvertDirection( azimuth, {directionType:'North', angleType: 'Degrees'}, {directionType:'Quadrant', angleType: 'DMS', outputType: 'text', format: 'p d[-]mm[-]ss b'})
}
NorthAzimuth2Quadbearing($feature.Direction)
Note, I have also made an update to the original answer. The updated code is reduced to a single line within the function, and shows how to use the text output type, and the use of formatting capabilities available on the ConvertDirection function. This approach is also included in the snippet above on this post for your request.
To learn more about this function see: convertdirection
-Tim