Tag Info

Hot answers tagged

11

If I got you right, the answer is yes, QGIS supports dynamic layer names. You would need to write a Python macro to be ran every time the project is opened. This would be the workflow: Go to on QGIS->Project->Project Properties and replace openProject() with the following Python code: def openProject(): import re, qgis iface = ...


8

There is no universal vector format in GIS. However, some formats are proprietary and other are openly specified (like the shapefile) so that they can be read and/or written by other softwares (if they decide to implement). For data sharing, the best solution to date is to use shapefile, which is now the most widespread format. Shapefile is however an old ...


6

This is part of the raison d'être of the OGC. Regarding vector data you may wish to look into these standards: Geographic Markup Language (GML) - an XML grammar for the storage of geographical features. It serves as an open interchange format for the transaction of geo-spatial data between different software. Web Feature Service (WFS) - provides an ...


6

AndreJ and SS_Rebellious provide valid answers. However, there is another option which I find easier than creating the group and dragging layers in to it. You can select all the layers you want in your group (select multiple layers by holding down shift which selects everything between your first selected layer and the second one you click on, or hold ...


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

Your downloaded shapefile already had a coordinate system defined in its *.prj file: ...


5

The reason you cannot edit these layers is because it is not a file. It is a map service. What you are seeing is a web service. A web service is data that is hosted on a server elsewhere, that is not your computer. Your computer is going out and getting the data live from OLIVER when you look at it in ArcMap. In this case the data you want to edit is ...


5

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


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

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


4

The newest and most promising that exists is OGC GeoPackage. The standard was published in February, 2014 and it will take some time before GIS programs support it properly but the list of implementations at http://www.geopackage.org/ is growing fast. There are already well known programs on the list, including ArcGIS, GDAL, and GeoServer. Unlike GML which ...


4

You don't have to save your annotations as a layer. Simply toggle the Text Annotation function in the toolbar and press Ctrl + T to switch it on/off. Your annotations will be saved within your project.


4

It would be better to remove the layer using arcpy.mapping.RemoveLayer. The parameters are the data frame to remove the layer from (possibly a group layer if you are trying to remove from a group) and the layer itself, this alleviates any chance of confusion: def onClick(self): mxd = arcpy.mapping.MapDocument("CURRENT") df = ...


4

http://qgis.org/api/2.2/classQgsSymbolV2.html#aa2c7db61d4234bddf3aa62f294ad6818 void QgsSymbolV2::setColor(const QColor & color) with python: myColour = QtGui.QColor('#ffee00') mySymbol1 = QgsSymbolV2.defaultSymbol(myVectorLayer.geometryType()) mySymbol1.setColor(myColour)


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


3

You will need to use ArcObjects. You are looking for the IDisplayExpressionProperties interface. It is obtained from IDisplayString, which in turn is obtained from IFeatureLayer. Here you will find a fantastic little snippet of code provided by patrick that does the trick: public void annotateLayer(ILayer thisLayer, String geocode, double minScale, double ...


3

You can either duplicate the buildings layer, once on the bottom for the polygon, one on top for the symbol, or create symbol labels. Labels are always on top. See Labels | Background | Shape = SVG


3

This is already documented here. There are two undocumented tileerror events for the layer When a single tile is missing it trigger the event “loadwarning” to indicate that something is wrong with this layer. When all the tiles in a layer are missing it trigger the event “loadfail”. There is also some additional documentation in the code here UPDATE ...


3

for QGIS 2.6 here is the code to identify each layer and group them #make the desired groups for layers root = QgsProject.instance().layerTreeRoot() group1 = root.insertGroup(0, "Group Point") group2 = root.insertGroup(1, "Group Line") group3 = root.insertGroup(2, "Group Polygon") #get the list of layers ...


3

Try printing to pdf, but set the page size to 24x36 (or a larger sheet of preferred), and make all the font as small as possible (font size 4 or 5). When you print to pdf, keep all of the settings on normal, not high-quality. You should be able to open up the pdf an zoom in and see details. thanks and good luck


3

By using the new Layer tree (aka legend or ToC) added by Martin Dobias since QGIS v.2.4, you can load a layer to the top of the ToC following these steps: Get a reference of the layer tree root = QgsProject.instance().layerTreeRoot() Create the layer object from PyQt4.QtCore import QFileInfo fileName = "/path/to/raster/file.tif" fileInfo = ...


3

Nick Ochoski is right about the SearchCursor, but there is a cleaner way to use it WITHOUT a while and manually calling next: import arcpy fc = "c:/data/base.gdb/roads" field = "StreetName" cursor = arcpy.SearchCursor(fc) for row in cursor: print(row.getValue(field))


3

This could easily be converted into a toolbox script or run directly from the python window in Arcmap. It can be improved by validating the layer name before copying, duplicate naming conventions, drilling into group layers, using different data frames, etc. But this should get you started for a simple TOC: import os, arcpy folder = "path\to\folder" ...


3

I just tested using ArcGIS 10.2.2 for Desktop and my expectation was that highlighting a layer (or layer group) in the Table of Contents would activate the Remove button on the Standard toolbar - but it did not. I also tried the Delete key and Ctrl-X but neither of them allow you to remove a selected layer either. As far as I can tell the only ways to ...


3

You can store your annotations in a point layer and label it by [Right click >> Properties]. Follow the simple steps below: Make sure your point feature is not visible. only the label is visible. Right click on layer >>properties>> Style tab. Select Simple marker or simple choose any hollow marker and set Size to 0.00000 as shown in below snap. Click ...


3

According to your edit, you want to create a map (layers, featured services etc) using ArcGis for Desktop, which in turn will be used via the Javascript API in my application This is simply not possible. When you publish a map as MapService, it takes on the projection of the Map. In ArcGIS for Desktop, there is no out of the box way to change the ...


3

First you need to make sure that your watershed are polygons. If not : feature to polygon. Then you can make the intersection (intersect_analysis) between your watershed and your lines. You'll end up with lines that have the fields of the waershed as an attribute table. You can then use summary statstics to have the total length for each watershed. Note ...


3

I think you should check that you are using the List By Drawing Order view of your Table of Contents. Of the four views described in Using the table of contents it is the only one which will allow you to change the drawing order.


3

If you right-click in the Layer's window, there should be an Add group option. Select this to create sub-sections by dragging your layers into it.


3

Assuming you use an ol.layer.Vector with an ol.source.GeoJSON you can use something like this: var vectorSource = new ol.source.GeoJSON({ projection : 'EPSG:3857', url: 'http://examples.org/fearures.json' }); var vectorLayer = new ol.layer.Vector({ source: vectorSource }); map.addLayer(vectorLayer); // show loading icon // ... var listenerKey = ...



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