예제 #1
0
파일: gvpy_full.py 프로젝트: arl256/gvpy
def newLayer(layer, path, geometryType):
    #path = "C:/gvsig/test03.shp"
    CRS= gvsig.currentProject().getProjectionCode()
    schema = gvsig.createSchema(layer.getSchema())
    output = gvsig.createShape( schema, path, CRS=CRS, geometryType = geometryType )
    gvsig.currentView().addLayer(output)
    return output
예제 #2
0
파일: gvpy.py 프로젝트: oscar9/gvpy
def newLayer(layer, path, geometryType=None):
    CRS = layer.getProjectionCode()
    schema = gvsig.createSchema(layer.getSchema())
    if geometryType==None: geometryType = layer.getTypeVectorLayer().getType()
    output = gvsig.createShape( schema, path, CRS=CRS, geometryType=geometryType )
    gvsig.currentView().addLayer(output)
    return output
예제 #3
0
def newLayer(layer, path, geometryType):
    #path = "C:/gvsig/test03.shp"
    CRS = gvsig.currentProject().getProjectionCode()
    schema = gvsig.createSchema(layer.getSchema())
    output = gvsig.createShape(schema,
                               path,
                               CRS=CRS,
                               geometryType=geometryType)
    gvsig.currentView().addLayer(output)
    return output
예제 #4
0
def newLayer(layer, path, geometryType=None):
    CRS = layer.getProjectionCode()
    schema = gvsig.createSchema(layer.getSchema())
    if geometryType == None:
        geometryType = layer.getTypeVectorLayer().getType()
    output = gvsig.createShape(schema,
                               path,
                               CRS=CRS,
                               geometryType=geometryType)
    gvsig.currentView().addLayer(output)
    return output
예제 #5
0
파일: gvpy.py 프로젝트: oscar9/gvpy
def addField(layer,field, sType = "STRING",iSize=20):
    #IN: layer, field, *sType, *iSize)
    #OUT: layer
    #addField(layer, "nombre")
    schema = gvsig.createSchema(layer.getSchema())
    schema.modify()
    if isinstance(field,str): schema.append(field,sType,iSize)
    layer.edit()
    layer.updateSchema(schema)
    layer.commit()
    print "Add field ", field, " to ", layer.name
    return layer
예제 #6
0
def addField(layer, field, sType="STRING", iSize=20):
    #IN: layer, field, *sType, *iSize)
    #OUT: layer
    #addField(layer, "nombre")
    schema = gvsig.createSchema(layer.getSchema())
    schema.modify()
    if isinstance(field, str): schema.append(field, sType, iSize)
    layer.edit()
    layer.updateSchema(schema)
    layer.commit()
    print "Add field ", field, " to ", layer.name
    return layer
 def checkErrorsLayer(self, line):
     errorsLayer = gvsig.currentView().getLayer(self.errorsLayerName)
     if errorsLayer == None:
         errorsLayerSchema = gvsig.createSchema()
         errorsLayerSchema.append("GEOMETRY", "GEOMETRY")
         errorsLayerSchema.get("GEOMETRY").setGeometryType(geom.POINT, geom.D2)
         errorsLayer = gvsig.createShape(errorsLayerSchema)
         errorsLayer.setName(self.errorsLayerName)
         errorsLegend = SingleSymbolLegend()
         errorsSymbol = SimpleMarkerSymbol()
         errorsSymbol.setColor(gvsig.utils.getColorFromRGB(255, 0, 51)) # RGB
         errorsSymbol.setSize(10)
         errorsLegend.setDefaultSymbol(errorsSymbol)
         errorsLayer.setLegend(errorsLegend)
         gvsig.currentView().addLayer(errorsLayer)