GISCafe
   >> GIS Education
Thread views: 28176 View all threadsNext thread*Threaded Mode

airickjay
(Stranger )
06/20/07 06:40 AM
Labeling issue Report this article as Inappropriate to us !!!Login to Reply

I work for an oil and gas company, and I am trying to transfer all of our shapefilies to a geodatabase.  In our system, one parcel of land can have several leases associated with it, as several people can own mineral rights.  I need help with figuring out how to display all of the leases associated with the polygon as labels.  I am currently stacking polygons to get all of the labels to display, however this seems very ineffiecient.

Is there any way to get multiple record labels on a single polygon, or do I just need to go ahead and continue stacking polygons to show all of the labels I need to show?





jgarner
(Stranger )
06/21/07 08:06 AM
Re: Labeling issue new [re: airickjay]Report this article as Inappropriate to us !!!Login to Reply

Sice you refer to 'geodatabases' I'll assume that you're using ArcMap?  Go to ArcGis Desktop Help and type in: "stacked labels, creating in ArcMap".  This should answer your questions.

 

Good Luck!

 

Jack





bihodge
(Stranger )
06/21/07 11:10 AM
Re: Labeling issue new [re: airickjay]Report this article as Inappropriate to us !!!Login to Reply

You are right, stacking polygons is a workable, but inneficient way to add labels.  I assume you are in ArcMap;  I also assume that all owners are registered in an attribute field attached with each polygon layer.  If they are not on the same layer, then you will have to stack polygons on top of one another; this technique below will not work- you can only stack labels from the available attribute fields of the same layer.  

The previous post will get you in the right direction.  But this might help: You will go to the Layer Properties dialog box for the layer involved, click 'Labels', then 'Expression'.

 This will then allow you to write a simple expression (all label commands must be typed on the same line of a simple expression- no double spacing allowed in VBScript) to add the labels you select;  and you can add labels from several attribute fields.   Using the character  & vbNewLine &  means that the next title will be placed on the next line.    Keep adding  this code after each label you select until you have satisfied your needs.  

The 'help' button in the Expression portion of the box is helpful, but, if you are not a programmer, you will need to do some head-scratching to get there, but, I assure you that you can!   I did.  Good luck.

Bill,  W TX 

 

 





airickjay
(Stranger )
06/25/07 06:05 AM
Re: Labeling issue new [re: bihodge]Report this article as Inappropriate to us !!!Login to Reply

I don't know anything about VBScript (I used to do a bit of php programming though).  Can you run any script in the expressions box?  I was thinking that I might be able to run a query that would gather up all of the leases that had the same parcel ID and make a list of those leases, which would then be used as a label.

I guess it might be in my best interest to grab up a VBScript book! Smile

 





Waukegan
(Stranger )
07/10/07 06:31 AM
Re: Labeling issue new [re: airickjay]Report this article as Inappropriate to us !!!Login to Reply

I am working on the same issue with soil boring data

it seems that  ArcObjects with VBA is a good way to slove this prob.

let me know if you find any thing





airickjay
(Stranger )
07/10/07 06:38 AM
Re: Labeling issue new [re: Waukegan]Report this article as Inappropriate to us !!!Login to Reply

This is the solution I came up with, it's not pretty but it did get my parcels labeled with the multiple numbers. 

Function FindLabel ( [parcels.OBJECTID] )

Dim strPrclQry, strinfo, LeaseNo

'form query string
strPrclQry = "SELECT DISTINCT LEASE_N FROM GROUPS WHERE GROUPS.PARCEL_N =  " & [parcels.OBJECTID] & " ORDER BY LEASE_N DESC" 'Your query will differ

Dim ADOConn
set ADOConn = CreateObject("ADODB.Connection")
Dim rsPrcl
set rsPrcl = CreateObject("ADODB.Recordset")

ADOConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=DatabaseLocation"

ADOConn.CursorLocation = 3

rsPrcl.Open strPrclQry, ADOConn, 3, 1, 1

'if no record is found, return empty string

Select Case rsPrcl.RecordCount
   Case -1, 0
      strInfo = " "
   Case 1
      'reading only the first record

      LeaseNum = rsPrcl.Fields("LEASE_N").Value
      strInfo = Right (LeaseNum, 4) + strInfo
      

   Case Else

      for I = 1 to rsPrcl.RecordCount
            if I <> 1 then
               strInfo = vbNewLine + strInfo
            end if

            LeaseNum = rsPrcl.Fields("LEASE_N").Value
            strInfo = Right (LeaseNum, 4) + strInfo
            rsPrcl.Movenext
      Next

End Select

'closing connections - this is a must

rsPrcl.Close
ADOConn.Close
Set rsPrcl = Nothing
Set ADOConn = Nothing

  FindLabel = strInfo
End Function






View all threadsNext thread*Threaded Mode
Jump to

 

softmouse 3D
Geographic Data Manager
CADalog.com - Countless CAD add-ons, plug-ins and more.



Click here for Internet Business Systems © 2014 Internet Business Systems, Inc.
595 Millich Dr., Suite 210, Campbell, CA 95008
+1 (408) 850-9202 — Contact Us, or visit our other sites:
AECCafe - Architectural Design and EngineeringEDACafe - Electronic Design AutomationTechJobsCafe - Technical Jobs and Resumes	MCADCafe - Mechanical Design and EngineeringShareCG  - Share Computer Graphic (CG) Animation, 3D Art and 3D Models
  Privacy Policy