Jump to content

 
Photo

sql query on labels in ArcView

- - - - -

  • Please log in to reply
5 replies to this topic

#1
Covasnianu Adrian

Covasnianu Adrian

    Contributor

  • Validated Member
  • PipPip
  • 48 posts
  • Gender:Male
  • Location:Iasi
  • Romania

Hi!

I'm trying only to show labels on a shapefile (polyline with elevation attributes). I'm using in ESRI ArcView the define classes of features and label each class differently method. I'm trying to use a SQL query in order to show only the elevation values of 100, 125, 150, 175, 200 and 225 meters representing the principal curves from a shapefile with elevation starting to 85 and ending with 277,5 meters.

Is there a method in the same layer to show only the labels for specific elevations not needed to make some additional operations such as:

- export only the polylines with the needed elevation and then simply to label features
- define classes for 100, 125, 150, 175, 200 and 225 meters. A total of 6 classes.

Any suggestion is useful!
Thanks in advance!
GIS user

PhD geographer
CUGUAT-TIGRIS Research Center
University Al.I.Cuza Iaşi
Faculty of Geography & Geology

email: covasnianu.adrian@gmail.com

#2
jrat

jrat

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 143 posts
  • Gender:Male
  • Location:Hagerstown, MD
  • United States

You should be able to restrict the label generation to the specific values you want using sql.
from the labels tab of the layer properties you already selected define classes of features. Now click SQL query. double click the field name for your elevation data, click = , click get unique values, double click the 1st value you want (i.e. 100), click AND. follow this untill you have all the values you want. don't put and at the end.

I am sure there is a simpler SQL query but that has worked for me.

You would only need to define 6 different classes if you wanted each class to look different.
you would use the same SQL query to select features to export or apply a definition query on your layer. The help in the query builder is usefull

#3
Craig Jr

Craig Jr

    Contributor

  • Validated Member
  • PipPip
  • 15 posts
  • Gender:Male
  • Location:Cold Spring, NY
  • United States

same layer to show only the labels for specific elevations not needed to make some additional operations such as:

- export only the polylines with the needed elevation and then simply to label features
- define classes for 100, 125, 150, 175, 200 and 225 meters. A total of 6 classes.

Any suggestion is useful!
Thanks in advance!


If you only want to label 100, 125, 150, 175, 200 and 225, click the sql query in the label dialogue and use:
"Elevation" in (100, 125, 150, 175, 200, 225) This will only label features with those values. If you need to label each of the contour with different font sizes then you would need to create a class for each of the elevations.

#4
Covasnianu Adrian

Covasnianu Adrian

    Contributor

  • Validated Member
  • PipPip
  • 48 posts
  • Gender:Male
  • Location:Iasi
  • Romania

same layer to show only the labels for specific elevations not needed to make some additional operations such as:

- export only the polylines with the needed elevation and then simply to label features
- define classes for 100, 125, 150, 175, 200 and 225 meters. A total of 6 classes.

Any suggestion is useful!
Thanks in advance!


If you only want to label 100, 125, 150, 175, 200 and 225, click the sql query in the label dialogue and use:
"Elevation" in (100, 125, 150, 175, 200, 225) This will only label features with those values. If you need to label each of the contour with different font sizes then you would need to create a class for each of the elevations.


Thanks a lot!
It worked nice!
GIS user

PhD geographer
CUGUAT-TIGRIS Research Center
University Al.I.Cuza Iaşi
Faculty of Geography & Geology

email: covasnianu.adrian@gmail.com

#5
jrat

jrat

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 143 posts
  • Gender:Male
  • Location:Hagerstown, MD
  • United States

same layer to show only the labels for specific elevations not needed to make some additional operations such as:

- export only the polylines with the needed elevation and then simply to label features
- define classes for 100, 125, 150, 175, 200 and 225 meters. A total of 6 classes.

Any suggestion is useful!
Thanks in advance!


If you only want to label 100, 125, 150, 175, 200 and 225, click the sql query in the label dialogue and use:
"Elevation" in (100, 125, 150, 175, 200, 225) This will only label features with those values. If you need to label each of the contour with different font sizes then you would need to create a class for each of the elevations.


I knew there was a better way. Will that only work with numeric fields?

#6
Craig Jr

Craig Jr

    Contributor

  • Validated Member
  • PipPip
  • 15 posts
  • Gender:Male
  • Location:Cold Spring, NY
  • United States

I knew there was a better way. Will that only work with numeric fields?


The "in" function works with both numeric and text. So you could have "Elevation" in (100, 250, 300) and "City" in ('New York', 'Dallas', 'Boston', 'Los Angeles')

It is a time saver when querying data.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->