Tag Info

Hot answers tagged

6

GDAL suppports that so it should be possible for QGIS as well. However, I could not make it work with my QGIS 2.6.0. Perhaps there is just some missing step and somebody can point what it is. Test with GDAL and VSICURL gdalinfo /vsicurl/http://dl.maptools.org/dl/geotiff/samples/made_up/bogota.tif Driver: GTiff/GeoTIFF Files: ...


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", ...


5

Split Layers by Attributes check out this python toolbox. Split Layer by Attributes, State Name, being the attribute you want.


3

First, feature classes don't have symbology attributes. Symbology is attributed to layers in ArcGIS. When you add a feature class to a table of contents in ArcMap, a layer is created, though not saved anywhere as a .lyr file. If you are having your users add a feature class to ArcMap that they then symbolize as desired, below is the way of saving that ...


3

Error 010246 from ESRI support describe either a state that all input points have the same location, or that one or none point were selected. I believe that the second one applies to your model. I suggest you manually check whethear some polygons don't contain points at all, or contain one point - you might use spatial join to get the counts. After that ...


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.


1

OK, here is the script I wrote a while back, and I just adjusted it for US States, but it will work for any kind of data, as long as it contains a column with unique values. import arcpy print 'imports over' arcpy.env.overwriteOutput = True # load dataset states = r"F:\Data\States\States_2010.shp" # create feature layer ...


1

I suggest a model-builder based solution. You can create a simple work flow that look as follow: Iterate by row selection extract the Name of each country using Get Field Value (model tools) Save Selected with Country name using the copy features tool; using %I_NAME% to mark feature name with the selected country name, where I_NAME is the variable name of ...


1

After adding the layer to the in-memory mxd, you should save the mxd using: mxd.save() or mxd.saveACopy (r"D:/arcgisserver/directories/my_mxd2.mxd") to change the layer name, simply change the name property of the layer: addLayer.name = "NewLayerName" Update: To rename the newly added layer you should make a reference to the layer first: allLayers= ...


1

This should work: import arcpy, os, sys InFolder = sys.argv[1] OutFolder = sys.argv[2] arcpy.env.workspace = InFolder for ThisRas in arcpy.ListRasters(): arcpy.MakeRasterLayer_management (ThisRas,"Layer"); arcpy.SaveToLayerFile_management("Layer",OutFolder + "\\" + ThisRas + ".lyr",True,"CURRENT"); arcpy.Delete_management("Layer") It ...


1

The functionnality has been added recently, see these 2 examples : Tile load events , Image load events



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