VDS Technologies

 

shape file query

7/15/2014 6:22:49 AM
Total Posts 28

shape file query

Is their any way to display only part of name from shape file.,i.e if their is a name in shape file "Block A Moti nagar"

and i want to display only "Block A." 

7/15/2014 6:48:43 AM
MVP
Total Posts 323

Re: shape file query

An expression for the LabelExpression property can contain VBS functions, for example

layer.LabelExpression = "LEFT(fieldname, 10) & \".\"";  // returns first 10 characters from 'fieldname' and '.'

 

7/15/2014 8:07:16 AM
Total Posts 28

Re: shape file query

thanx..,Its working bro..,

but.,can u tell me another method..,that I can apply on large scale.

because their are lot to label containing this like Block A Rohini,,,,,Block DA Inderlok..,I want only Block A and Block DA appear.

and I will be so greatful to u..if u tell me the meaning of this --> (  & \".\""  )   that u  use in layer.LabelExpression = "LEFT(fieldname, 10) & \".\"";

7/15/2014 8:39:16 AM
MVP
Total Posts 323

Re: shape file query

To extract a word with suffix like 'Block A', you have to write a function, it is difficult, because LabelExpression accepts a single line expression. Maybe like this using InStr, but if an error occurs, the label will not be generated:

"Left(InStr(InStr(field,\" \"),field,\" \")"

 

\".\" is VBS literal - "."  VBS required double quotes for literals

7/15/2014 8:52:15 AM
Total Posts 28

Re: shape file query

thanx bro..,

actually my map become a little messi..,nd all this localities information are within same file..that why its tougher

I thought to create it like google..,that is at one zoom level only area name that is suppose its rohini..,nd on next zoom level its display block name.,that is Block A..,Block B..etc

But unfortunately all this detail are within a single shape file.,nd also that labels that contain complete name i.e Block A Rohini..Block B Rohini.,,,which make it more messi.,

as soon as i find this sol.., I will post this..:)