First incursion in symbology on scripting in gvSIG 2.0

Hello everyone.

Other day a friend wrote in gvSIG user’s list about a project he was dealing in  gvSIG and needed to access symbology from scripting of a layer.

First, scripting’s API has nothing prepared to access symbology… well, we believe that was added a pair of functions for something very basic.

Question is he needed to export symbology’s configuration applied to a set of layers and he asked us how to do it.

As the answer was not “cut it” and could be useful to others gvSIG users we thought bring it here, in gvSIG blog, not only in users’s list.

Well, to grain…

Access legend’s configuration of a layer is relatively simple. With:

layer = currentLayer()
legend = layer.getLegend()

And we have an object legend of gvSIG.

Problem is that in gvSIG legend are recordable. So, doesn’t exist a “Legend”, but the different plugins of gvSIG can record many legends. The result is that it could be very difficult to know what operations the legend we’ll get with calling to getLegend().

We will focus on the basic types of legend that come with gvSIG 2.0 (in gvSIG 2.1 are included more legend types, but if it is necessary we’ll talk about them in other moment).

One classification could be:

  • Vector legends (IVectorLegend)
  • Raster legends (IRaterLegend)

But for now we will talk on vector ones.

Other classification could be:

Each legend type offers many operations, so what we do first is determine  what legend we are working. We let here some little functions to that. Simple, but if we need it, and meanwhile they’re not in scripting library, we can paste the entire block in our script.

#==========================================================
#
# Functions to dealing with basic types of legends
#
from org.gvsig.fmap.mapcontext.rendering.legend import ISingleSymbolLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IClassifiedLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IVectorialIntervalLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IVectorialUniqueValueLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IClassifiedVectorLegend

def getLegendName(legend):
  return legend.getClass().getSimpleName()

def isSingleSymbolLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/ISingleSymbolLegend.html
  return isinstance(legend,ISingleSymbolLegend)

def isVectorialIntervalLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IVectorialIntervalLegend.html
  return isinstance(legend,IVectorialIntervalLegend)

def isVectorialUniqueValueLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IVectorialUniqueValueLegend.html
  return isinstance(legend,IVectorialUniqueValueLegend)

def isClassifiedLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IClassifiedLegend.html
  return isinstance(legend,IClassifiedLegend)

def isClassifiedVectorLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IClassifiedVectorLegend.html
  return isinstance(legend,IClassifiedVectorLegend)

It doesn’t matter to understand mucho the code, it’s enough know that once included in our script we can know our legend is of a type with something like:

layer = currentLayer()
legend = layer.getLegend()
if isVectorialUniqueValueLegend(legend):
  print "The layer has a legend of unique values"

With the lack of API and documentation on scripting for the types of legend, we can go to IVectorialUniqueValueLegend to see what operations or methods we can use. Well, with this information we access the object legend of our layer… but… and now what?

In general, a legend has a symbols definition  and a way to see how to get a certain symbol to apply it to a feature or line of a data table associated to a layer.

For example, the single symbol legend (ISimgleSimbolLegend) has a method  getDefaultSymbol() that will return the symbol to apply to all features of our view, therefore a vector classified legend will have a method getSymbols() that will return that legend’s symbols list. Problem is what’s next that there are many symbols types, like with legends, and each one with own operations or methods. So we’ll find:

Despite there are many symbols types, all respond to a set of basic operations like:

  • getDescription()
  • getColor()
  • getSymbolForSelection(), care with this to do not get confused.

To the rest of the operations, we’ll have to see what symbol type we’re dealing, and like done with legends, we’ll have a set of functions to ask what symbol type we have.

#==========================================================
#
# Functions to dealing with basic symbol types
#
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill import ISimpleFillSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill import IMarkerFillSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill import IPictureFillSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line import ILineSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line import IPictureLineSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker import IMarkerSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker import IPictureMarkerSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker import ISimpleMarkerSymbol
from org.gvsig.fmap.mapcontext.rendering.symbols import ITextSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text import ISimpleTextSymbol

def getSymbolName(symbol):
  return symbol.getClass().getSimpleName()

def isFillSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/IFillSymbol.html
  return isinstance(symbol,ISimpleFillSymbol)

def isMarkerFillSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/IMarkerFillSymbol.html
  return isinstance(symbol,IMarkerFillSymbol)

def isPictureFillSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/IPictureFillSymbol.html
  return isinstance(symbol,IPictureFillSymbol)

def isLineSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/ILineSymbol.html
  return isinstance(symbol,ILineSymbol)

def isPictureLineSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/IPictureLineSymbol.html
  return isinstance(symbol,IPictureLineSymbol)

def isMarkerSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/IMarkerSymbol.html
  return isinstance(symbol,IMarkerSymbol)

def isPictureMarkerSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/IPictureMarkerSymbol.html
  return isinstance(symbol,IPictureMarkerSymbol)

def isSimpleMarkerSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/ISimpleMarkerSymbol.html
  return isinstance(symbol,ISimpleMarkerSymbol)

def isTextSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/symbols/ITextSymbol.html
  return isinstance(symbol,ITextSymbol)

def isSimpleTextSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/text/ISimpleTextSymbol.html
  return isinstance(symbol,ISimpleTextSymbol)

So we can do things like:

layer = currentLayer()
legend = layer.getLegend()
if isSingleSymbolLegend(legend):
  symbol = getDefaultSymbol()
  if isFillSymbol(symbol):
    print symbol.getFillColor()

With this, more or less we can start to investigate about what a legend offers to us, but one of the questions shown to us is How do we know what symbol is applied to each geometry?

The question has an answer easy and other hard. We’re gonna stay with the easy. To the legend we can ask what symbol is applied to a feature, getSymbolByFeature(). For example, we could do something like:

layer = currentLayer()
legend = layer.getLegend()
print 
print "Each feature symbols:"
for feature in layer.features():
  # The following line, is a hack to access the object feature of java  
  # in gvSIG 2.1 probably will not be missed.
  feature = feature() 

  symbol = legend.getSymbolByFeature(feature)
  ...

Here what we do is travel all around layer’s features, and for each feature, we ask legend what symbol would be applied to that feature.

Well,  we’m not gonna linger no more, this is just the start point to those would interest start to prove it, and if there’s any doubts, you can ask by gvSIG users’s list.

We leave here a script “complete” where is all together. The script gets the view active and tries to dump the data console of the layer symbology.

The “complete”, is why we was not exhaustive in verifying  the legends types and symbols, but we think it’s enough to start.

See you.

from gvsig import *

def main():
  #
  # To prove it we uploaded in a view a layer:
  # http://downloads.gvsig.org/download/geodata/vector/SHP2D/provincias_andalucia.zip
  # We activated it and added a unique values legend.
  #
  # This code means to be a start point, it’s not ended.
  # Not just because legends are missing
  # In many points we let na "#ALL" indicating from here you are alone
  # However, we think it’s a good start point
  # To those who want to start manipulate legends from scripting.
  #
  # In functions isXXXX we let below goes the url to javadocs of the
  # corresponding class/interface. In those you’ll see methods 
  # each class has.
  #
  layer = currentLayer()
  print layer.getName()
  #
  # Function dumpLegend is below in this script.
  dumpLegend(layer.getLegend())

  # Well, with the code above, we can see how to access information of the 
  # legend, but if we want to know what symbol corresponds with each layer element
  # we can do something like:

  legend = layer.getLegend()
  print 
  print "Each feature symbol:"
  for feature in layer.features():
  # The following line, is a hack to access the object feature of java
  # in gvSIG 2.1 probably will not be missed.
    feature = feature() 

    print feature.get(0), "(", feature.toString() ,")"
    dumpSymbol( legend.getSymbolByFeature(feature) )

#==========================================================
#
# And here is the code to do a dump in text of the 
# legend and symbols. It’s not exhaustive and surely it can be 
# improved but will Worth to see where to consult
# legend values and symbols.
#
def dumpLegend(legend):
  print getLegendName(legend)

  if isSingleSymbolLegend(legend) :
    # This legend has an unique symbol applied to all 
    # geometries.
    dumpSymbol(legend.getDefaultSymbol())
    return 

  if isClassifiedVectorLegend(legend):
    print "- Classification fields: ", legend.getClassifyingFieldNames()

  if isClassifiedLegend(legend):
    # If it is a classified legend will return a symbols list
    print "- Símbolos:"
    for symbol in legend.getSymbols():
      dumpSymbol(symbol)
      print 
    print "- Descriptions:", legend.getDescriptions()
    print "- Values:", legend.getValues()

  # Now we prove if it is another legend type, that could
  # or not be classified.
  if isVectorialIntervalLegend(legend) :
    # TODO
    print "Legend codifying missing (",getLegendName(legend),")"

  elif isVectorialUniqueValueLegend(legend) :
    # It is a classified legend with some
    # more values.
    print "- colorScheme: ", legend.getColorScheme()

  else:
    print "Don’t know what to do with this legend"

def dumpSymbol(symbol, indentacion=1, selection=False):
  spaces=("  "*indentacion)
  print spaces,"- name: ", getSymbolName(symbol)
  #
  # Attributes we can find in all symbols
  print spaces,"- description: ", symbol.getDescription()
  print spaces,"- color: ", symbol.getColor()
  print spaces,"- symbolForSelection: ", symbol.getSymbolForSelection()
  if not symbol.getSymbolForSelection() is None and not selection: 
    # We call dumpSymbol setting selection on true to avoid getting 
    # confused.

    # We comment it at the moment to avoid a large output on tests
    #dumpSymbol(symbol.getSymbolForSelection(),indentacion+1, selection=True)
    pass
  #
  # The remaining depend on symbol type
  # Careful, there’s no "else"s because can exist symbols that
  # are of many type at a time.
  #
  if isFillSymbol(symbol):
    print spaces,"- hasFill: ", symbol.hasFill()
    print spaces,"- hasOutline: ", symbol.hasOutline()
    print spaces,"- fillAlpha: ", symbol.getFillAlpha()
    print spaces,"- fillColor: ", symbol.getFillColor()
    print spaces,"- outline: ", symbol.getOutline()
    if not symbol.getOutline() is None : 
      # We comment it at the moment to avoid a large output on tests
      #dumpSymbol(symbol.getOutline(),indentacion+1, selection)
      #dumpSymbol(symbol.getOutline(),indentacion+1, selection)
      pass

  if isMarkerFillSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isPictureFillSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isLineSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isPictureLineSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isMarkerSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isPictureMarkerSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isSimpleMarkerSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isTextSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

  if isSimpleTextSymbol(symbol):
    # ALL
    print spaces, "Symbol dump codifying missing (", getSymbolName(symbol),")"

#==========================================================
#
# Basic types of legends functions
#
from org.gvsig.fmap.mapcontext.rendering.legend import ISingleSymbolLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IClassifiedLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IVectorialIntervalLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IVectorialUniqueValueLegend
from org.gvsig.fmap.mapcontext.rendering.legend import IClassifiedVectorLegend

def getLegendName(legend):
  return legend.getClass().getSimpleName()

def isSingleSymbolLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/ISingleSymbolLegend.html
  return isinstance(legend,ISingleSymbolLegend)

def isVectorialIntervalLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IVectorialIntervalLegend.html
  return isinstance(legend,IVectorialIntervalLegend)

def isVectorialUniqueValueLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IVectorialUniqueValueLegend.html
  return isinstance(legend,IVectorialUniqueValueLegend)

def isClassifiedLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IClassifiedLegend.html
  return isinstance(legend,IClassifiedLegend)

def isClassifiedVectorLegend(legend):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/legend/IClassifiedVectorLegend.html
  return isinstance(legend,IClassifiedVectorLegend)

#==========================================================
#
# Basic types of symbols functions
#
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill import ISimpleFillSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill import IMarkerFillSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill import IPictureFillSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line import ILineSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line import IPictureLineSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker import IMarkerSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker import IPictureMarkerSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker import ISimpleMarkerSymbol
from org.gvsig.fmap.mapcontext.rendering.symbols import ITextSymbol
from org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text import ISimpleTextSymbol

def getSymbolName(symbol):
  return symbol.getClass().getSimpleName()

def isFillSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/IFillSymbol.html
  return isinstance(symbol,ISimpleFillSymbol)

def isMarkerFillSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/IMarkerFillSymbol.html
  return isinstance(symbol,IMarkerFillSymbol)

def isPictureFillSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/fill/IPictureFillSymbol.html
  return isinstance(symbol,IPictureFillSymbol)

def isLineSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/ILineSymbol.html
  return isinstance(symbol,ILineSymbol)

def isPictureLineSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/IPictureLineSymbol.html
  return isinstance(symbol,IPictureLineSymbol)

def isMarkerSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/IMarkerSymbol.html
  return isinstance(symbol,IMarkerSymbol)

def isPictureMarkerSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/IPictureMarkerSymbol.html
  return isinstance(symbol,IPictureMarkerSymbol)

def isSimpleMarkerSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/marker/ISimpleMarkerSymbol.html
  return isinstance(symbol,ISimpleMarkerSymbol)

def isTextSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.fmap.mapcontext.api/2.0.18/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/apidocs/org/gvsig/fmap/mapcontext/rendering/symbols/ITextSymbol.html
  return isinstance(symbol,ITextSymbol)

def isSimpleTextSymbol(symbol):
  # https://devel.gvsig.org/sites/org.gvsig.symbology.lib.api/2.0.18/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/apidocs/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/text/ISimpleTextSymbol.html
  return isinstance(symbol,ISimpleTextSymbol)
This entry was posted in community, development, english, gvSIG Desktop, scripting. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s