Capitalizing and changing font/color in Label Expression using Python Parser of ArcGIS Pro?Altering font size...

Can someone publish a story that happened to you?

What is the term for a person whose job is to place products on shelves in stores?

How do I produce this Greek letter koppa: Ϟ in pdfLaTeX?

Why do games have consumables?

Why doesn't the standard consider a template constructor as a copy constructor?

My bank got bought out, am I now going to have to start filing tax returns in a different state?

Does the damage from the Absorb Elements spell apply to your next attack, or to your first attack on your next turn?

Crossed out red box fitting tightly around image

Nails holding drywall

std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?

How do I check if a string is entirely made of the same substring?

Island of Knights, Knaves and Spies

Why do real positive eigenvalues result in an unstable system? What about eigenvalues between 0 and 1? or 1?

How bug prioritization works in agile projects vs non agile

Prove that the countable union of countable sets is also countable

How to keep bees out of canned beverages?

How can I practically buy stocks?

Is there a word for the censored part of a video?

Suing a Police Officer Instead of the Police Department

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

How much of a wave function must reside inside event horizon for it to be consumed by the black hole?

Does a large simulator bay have standard public address announcements?

Negative Resistance

Find a stone which is not the lightest one



Capitalizing and changing font/color in Label Expression using Python Parser of ArcGIS Pro?


Altering font size using label expression?ArcPy: Using lblclass expression to change font style and colorFormatting label expression with newline using Python parser?Font Formatting in Advanced Label Expression ArcGIS/PythonPython FindLabel Function for Label Expression with Formatting Font?Maplex Label Expression in Python Parser of ArcGIS for Desktop?Using Asterisks in Python parser of ArcGIS Label Expression Builder?If-then expression and font color in Mapinfo label expressionsSpecifying Font Size/Style in Label Expression?Python Label Expression Errors






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Currently Using ArcGIS Pro 2.3.2 and Python.



I am currently trying to label Road names, which are all uppercase in the database. I'm unable to edit the database but would like to Capitalize the road names and pick out one street to change the font and color for the road name.



I'm new to python and am having trouble working out how to combine these two expressions.



def FindLabel ( [road_name1] ):
S = [road_name1]
S = S.title()
return S

def FindLabel ( [road_name1] ):
if str([road_name1]) == 'LOOKOUT ROAD':
return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + [road_name1] + "</FNT></CLR>"
else:
return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + [road_name1] + "</FNT></CLR>"


Your help with this would be greatly appreciated.
Thanks,
Amanda










share|improve this question









New contributor




Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    Currently Using ArcGIS Pro 2.3.2 and Python.



    I am currently trying to label Road names, which are all uppercase in the database. I'm unable to edit the database but would like to Capitalize the road names and pick out one street to change the font and color for the road name.



    I'm new to python and am having trouble working out how to combine these two expressions.



    def FindLabel ( [road_name1] ):
    S = [road_name1]
    S = S.title()
    return S

    def FindLabel ( [road_name1] ):
    if str([road_name1]) == 'LOOKOUT ROAD':
    return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + [road_name1] + "</FNT></CLR>"
    else:
    return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + [road_name1] + "</FNT></CLR>"


    Your help with this would be greatly appreciated.
    Thanks,
    Amanda










    share|improve this question









    New contributor




    Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      Currently Using ArcGIS Pro 2.3.2 and Python.



      I am currently trying to label Road names, which are all uppercase in the database. I'm unable to edit the database but would like to Capitalize the road names and pick out one street to change the font and color for the road name.



      I'm new to python and am having trouble working out how to combine these two expressions.



      def FindLabel ( [road_name1] ):
      S = [road_name1]
      S = S.title()
      return S

      def FindLabel ( [road_name1] ):
      if str([road_name1]) == 'LOOKOUT ROAD':
      return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + [road_name1] + "</FNT></CLR>"
      else:
      return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + [road_name1] + "</FNT></CLR>"


      Your help with this would be greatly appreciated.
      Thanks,
      Amanda










      share|improve this question









      New contributor




      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Currently Using ArcGIS Pro 2.3.2 and Python.



      I am currently trying to label Road names, which are all uppercase in the database. I'm unable to edit the database but would like to Capitalize the road names and pick out one street to change the font and color for the road name.



      I'm new to python and am having trouble working out how to combine these two expressions.



      def FindLabel ( [road_name1] ):
      S = [road_name1]
      S = S.title()
      return S

      def FindLabel ( [road_name1] ):
      if str([road_name1]) == 'LOOKOUT ROAD':
      return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + [road_name1] + "</FNT></CLR>"
      else:
      return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + [road_name1] + "</FNT></CLR>"


      Your help with this would be greatly appreciated.
      Thanks,
      Amanda







      python labeling arcgis-pro






      share|improve this question









      New contributor




      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 1 min ago









      PolyGeo

      54.1k1782247




      54.1k1782247






      New contributor




      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      Amanda.BAmanda.B

      32




      32




      New contributor




      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Amanda.B is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          1














          What you need to do is to create one function instead of two functions and put the S.title() inside the font change function like this:



          def FindLabel ( [road_name1] ):
          S = [road_name1]
          if S == 'LOOKOUT ROAD':
          return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + S.title() + "</FNT></CLR>"
          else:
          return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + S.title() + "</FNT></CLR>"





          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "79"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            Amanda.B is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f320901%2fcapitalizing-and-changing-font-color-in-label-expression-using-python-parser-of%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            What you need to do is to create one function instead of two functions and put the S.title() inside the font change function like this:



            def FindLabel ( [road_name1] ):
            S = [road_name1]
            if S == 'LOOKOUT ROAD':
            return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + S.title() + "</FNT></CLR>"
            else:
            return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + S.title() + "</FNT></CLR>"





            share|improve this answer




























              1














              What you need to do is to create one function instead of two functions and put the S.title() inside the font change function like this:



              def FindLabel ( [road_name1] ):
              S = [road_name1]
              if S == 'LOOKOUT ROAD':
              return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + S.title() + "</FNT></CLR>"
              else:
              return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + S.title() + "</FNT></CLR>"





              share|improve this answer


























                1












                1








                1







                What you need to do is to create one function instead of two functions and put the S.title() inside the font change function like this:



                def FindLabel ( [road_name1] ):
                S = [road_name1]
                if S == 'LOOKOUT ROAD':
                return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + S.title() + "</FNT></CLR>"
                else:
                return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + S.title() + "</FNT></CLR>"





                share|improve this answer













                What you need to do is to create one function instead of two functions and put the S.title() inside the font change function like this:



                def FindLabel ( [road_name1] ):
                S = [road_name1]
                if S == 'LOOKOUT ROAD':
                return "<CLR red='0' blue='0' green='0'><FNT size = '22'>" + S.title() + "</FNT></CLR>"
                else:
                return "<CLR red='128' blue='128' green='128'><FNT size = '14'>" + S.title() + "</FNT></CLR>"






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 30 mins ago









                ahmadhanbahmadhanb

                24k32156




                24k32156






















                    Amanda.B is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    Amanda.B is a new contributor. Be nice, and check out our Code of Conduct.













                    Amanda.B is a new contributor. Be nice, and check out our Code of Conduct.












                    Amanda.B is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f320901%2fcapitalizing-and-changing-font-color-in-label-expression-using-python-parser-of%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                    Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

                    Meter-Bus Содержание Параметры шины | Стандартизация |...