Create SoundP labels in ArcGIS Pro

857
3
Jump to solution
11-14-2021 09:38 PM
KeiranBray
Esri Contributor

Hey all,

Quick question, looking at trying to create SoundP labels within ArcGIS Pro, I found in this link here: https://desktop.arcgis.com/fr/arcmap/10.5/extensions/maritime-charting-guide/edit-dnc/labeling-featu... that it could be done in arcmap with the extension.

Is there a similar workflow or available style file for the above? i did have a couple expressions in ArcMap to carry this out but seems a bit tricky to convert them across to pro,

Ideally, taking one collumn with the depth value for example 11.8 and labelling that as per below:

KeiranBray_0-1636954570499.png

I thought with a subscript tag, i also thought there might be an easier way to achieve this,

Any ideas muchly appreciated!

Cheers

Keiran

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

Something like this?

 

// label value
var x = 11.8643
// number of subscripted digits
var digits = 1
// integer part
var x_int = Floor(x)
// decimal part
var x_dec = (x - x_int) * Pow(10, digits)
x_dec = Round(x_dec, 0)
// put it all together
return x_int + '<sub>' + x_dec + '</sub>'

 


Have a great day!
Johannes

View solution in original post

3 Replies
JohannesLindner
MVP Frequent Contributor

Something like this?

 

// label value
var x = 11.8643
// number of subscripted digits
var digits = 1
// integer part
var x_int = Floor(x)
// decimal part
var x_dec = (x - x_int) * Pow(10, digits)
x_dec = Round(x_dec, 0)
// put it all together
return x_int + '<sub>' + x_dec + '</sub>'

 


Have a great day!
Johannes
CraigTGreene
Occasional Contributor

Thanks!

0 Kudos
KeiranBray
Esri Contributor

Hey Johannes, that worked!

Thanks heaps exactly what i was after:

KeiranBray_0-1636973391820.png

 

Awesome!

Cheers

Keiran