Tag Info

Hot answers tagged

5

Here's the ListLayers documentation ListLayers(map_document_or_layer, {wildcard}, {data_frame}) You can use a wildcard if you know the name of the layer. mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] road_layer = arcpy.mapping.ListLayers(mxd, "Road", df)[0] river_layer = arcpy.mapping.ListLayers(mxd, "River", ...


2

Finally I found the answer : using the QgsLegendModelV2()class, and its functions inherited from QgsLayerTreeModel : "index(i,j)" to select each legend item and "rowcount" to obtain the rows number. All in a "for x in xrange" loop. That gives: for i in self.composition.items(): if isinstance(i,QgsComposerLegend): legend = i for i in ...


1

As somebody told in an ESRI forum in 2003 "Feature Layer is a layer in your map" so it means that a Feature Layer is a single entity (polilyne, point or polygon) wich can be put as a simple object in your map or consider as a "mask" of a "Feature Class". But "Feature Class is a dataset that resides on disk".


1

I'm not sure what you're trying to do with the output file name, but constructing it like that will not work - the path needs to start with C:\. Also, in Python it's good practice to use os.path.join to add paths together, e.g. import os ... arcpy.mapping.ExportToPDF(mxd, os.path.join(r"C:\Project_7\Newer_data\Inverts\GO", PDFPath, lyr.name + ".pdf")) ...


1

I'd use data driven pages, each covering the same extent of the map. You can show/hide layers in the view if there is a field to store pages name. Add field to every layer and populate it with relevant page name. Use definition query window of the layer to show/hide it using match/don't match options.



Only top voted, non community-wiki answers of a minimum length are eligible