Tag Info

New answers tagged

4

Yes, very simple: Just use the Categorized Symbology. If you do not have any attributes, you can just use $id as your "Column". Result:


0

You can access the number of features in the cluster strategy object. If there were no more strategies added to the layer, the correct path to the array is the following: mylayer.strategies[1].features


0

based on srussking answer I wrote the following code assuming the main map object called map and it is a global var, I preferred using find layer by name and not by id, here is my code: function moveLayerBefore(old_idx, new_idx){ if((old_idx === -1) && (new_idx === -1)){ return false; } layer = ...


1

i have been working on something similar , at the moment i have it to the point where is a script that can be run from idle. what happens is that you make a tempoary feature layer and then you need to save to have your layer. The second link below , save_to_layer_file has a python code example ...


0

In any case, I solved the problem eventually with some help. You might as well check the Geonet community on ESRI for my solution if someone is curios. It involves using the SearchCursor to get the unique values, followed by a loop to get each value from a list that is used as an input in MakeFeatureLayer tool.


2

No need to write any code, a very simple model as shown below could do all this. You set the group by field to be your integer field and the iterator will create a sub-set which you save out using the select tool.


2

It sounds like all you need is a simple join. Use the join tool and use a common field to combine the table and shapefile together. ESRI Help: About Joining and Relating Tables EDIT: I see now it is a new shapefile you want. In that case I would still do the join and then save the joined shapefile as a new shapefile.


1

You are not providing the code required to add a layer to the map at all. You need a feature layer from the shapefile and then save it on disk as the .lyr file. inputLocationsSavedFcFeatLyr = arcpy.MakeFeatureLayer_management(input_locations_fc,"Stops") arcpy.SaveToLayerFile_management(in_layer=inputLocationsSavedFcFeatLyr, ...


4

Actually, logically Union is the the area shared by both plus the area of each of the two layers not shared by the other. Therefore the area returned must be equal to or greater than the area in the largest layer. This is what you are seeing. The way to extract just the portion where the land use layer and the limit layer intersect is to use the Intersect ...


4

In Python a backslash is an escape character. In order to put a backslash in the string you need to need to put another backslash next to it to stop it from forcing a new line. myString = "this is\\ a string with a backslash" I can see your paths are set correctly but maybe the strings you are parsing only have a single backslash. You can solve this ...


0

You need to change the value of out_layer to include the output path. Add import os to the start of your script and then set the out_layer variable as follows: out_layer = os.path.join("your/output/path/here", in_layer + "lyr")


0

Qgis has got an informative error in the status bar for all the layers being loaded. Try to read what the error says after loading the layer. Another source of error could be that your I'd column is not unique . Test to see if it that is the case


1

I think you correctly understand the first two options. You can specify options at the widget level (global options) which will be applied to all operational layers and you can specify the same options at the individual operational layer level to override widget level configuration. Finally, you can also use the LayerControl in your own widget by ...


2

You need to filter away those map documents which contain "land use" in their names. It is better to test and if the evaluation gave us "false", proceed with the processing. env.workspace = r"C:\Project" Layer1 = arcpy.mapping.Layer("abc.lyr") for mxd in arcpy.ListFiles("*.mxd"): if 'land use' not in mxd: print mxd mapdoc = ...


1

Needed to exclude the last two layers from the layerswitcher by adding a -2 to length like so: for (i = 0, ii = layers.length-2; i < ii; ++i) layers[i].setVisible(i==checkedLayer); This makes the layers visible on load, so set them to false like so: layers[4] = new ol.source.TileWMS({ Visible: false, source: new ...


5

I don't think you can remove features from a selection layer once it's been created, but the workaround that I usually use is to create a new selection layer from your existing one: Select the features in your selection layer that you want to remove. Open the selection layer's attribute table and click Switch Selection, which will make all the features ...


1

Ok, the first error is easy to avoid. It's failing because you are trying to find the datasource of a group layer, and group layers don't have data sources. Filter the group layers out by doing this: for lyr in arcpy.mapping.ListLayers(mxd, "" ,df): if not lyr.supports("DATASOURCE"): continue #further code here for non-group layers ...


1

This is how I would form the query you're asking about using ST_MakeEnvelope() and the && operator. You can request whatever field data you want, in addition to the geometry in GeoJSON format using ST_AsGeoJSON(). Also I recommend taking advantage of that function's ability to specify a max decimal precision value. Here I'm requesting geometries ...


4

The Extent object supports a 'disjoint' (i.e. does not intersect) method. Try something like: for mxdname in arcpy.ListFiles('*.mxd'): print mxdname mxd = arcpy.mapping.MapDocument(os.path.join(env.workspace, mxdname)) df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] for lyr in arcpy.mapping.ListLayers(mxd, "" ,df): if ...


2

One way to do this is to create a polygon feature layer of the dataframe extent, then you may select features in your dataframe to see if they intersect the extent polygon. http://anothergisblog.blogspot.com/2011/06/dataframe-object.html mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] layers = ...


0

When you say "...add graphics as the lowest layer in the active map" Are you trying to add graphics to an annotation group which is associated with a layer? When you turn that layer off then the graphic will disappear too so labels in other layers will show. Whilst that layer is visible the graphic would obscure the labels. I think @Chris W is on the right ...


0

your question isn't a QGIS question, but a QT quetion. Legend tree is managed by QgsLegendTreeView that is a QTreeView. So all what you need is to browse you tree an hide rows to compact your legend with http://doc.qt.io/qt-4.8/qtreeview.html#setRowHidden If you simply want to remove a layer from QGIS (standalone or not) simply unregister it from ...


0

Here are a list of resources (by no means comprehensive) that may be useful to you: NASA's MODIS provides imagery to identify wildfires: https://earthdata.nasa.gov/data/near-real-time-data/data/hazards-and-disasters/fires This website provides weekly global snapshots of fires: http://lance-modis.eosdis.nasa.gov/cgi-bin/imagery/firemaps.cgi This website ...


1

A few days late, but here's a workflow that did what I needed. Open up qGIS ( http://www.qgis.org/en/site/ ) Set up your projection under project -> project properties (I use NAD83 / Alberta 3TM ref merid 114 W EPSG:3776 but hey whatever look you want try a few) and make sure on the fly CRS transformation is checked. Add your .shp : Layer -> add vector ...


1

Here is a working solution: var map = new L.map('map', { center : [42.339926, -83.04137], zoom : 13 }); L.tileLayer('http://tile.stamen.com/toner/{z}/{x}/{y}.png', { attribution: 'Stamen' }).addTo(map); var voices = cartodb.createLayer(map, 'http://opendetroit.cartodb.com/api/v2/viz/08140c18-8a05-11e3-ae46-0e49973114de/viz.json').addTo(map); ...



Top 50 recent answers are included