Select to view content in your preferred language

Apply color scale to shapefile points

531
2
Jump to solution
04-26-2022 07:41 PM
HomeroOriaAguilera
Emerging Contributor

It's possible to apply multiple colors to shapefile points with Runtime SDK QML?

I have a shapefile composed of points, each point has an attribute [HEIGTH] that is a number. The idea is to colorize each point based on a range of color scales. For example, if my point's height is 500 m, the point it's going to render blue (400 - 600 m), however, if my point has 800 m, the color render should be green (700 - 900 m). There are about 5 ranges with their own color and about 100 000 pts.

To accomplish this, I create a ShapefileFeatureTable, QueryParameters, UniqueRenderValue, etc.

For example, to do the query I establish the whereClause:

queryParams.whereClause= "HEIGHT>400 OR HEIGHT<600"

1. How do I chain multiple queries to render each point with their respective color?

2. Which is the best strategy to set the UniqueValueRender in this context?

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Hello,

 

You should consider using ClassBreaksRenderer instead of UniqueValueRenderer. This allows you to define class ranges of values vs individual unique values.

 

The API Reference has a code example of how to create the ClassBreaksRenderer and set it on your FeatureLayer

 

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-classbreaksrenderer.html 

View solution in original post

0 Kudos
2 Replies
LucasDanzinger
Esri Frequent Contributor

Hello,

 

You should consider using ClassBreaksRenderer instead of UniqueValueRenderer. This allows you to define class ranges of values vs individual unique values.

 

The API Reference has a code example of how to create the ClassBreaksRenderer and set it on your FeatureLayer

 

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-classbreaksrenderer.html 

0 Kudos
HomeroOriaAguilera
Emerging Contributor

Thanks @Luka !!! That's the solution I am looking for!

0 Kudos