Tag Info

Hot answers tagged

3

You can technically point right to the image file using add layer method, see code below: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] addLayer = arcpy.mapping.Layer(r"C:\Temp\image.tif") arcpy.mapping.AddLayer(df, addLayer, "BOTTOM") If you want to load the image with a certain saved color scheme you can ...


3

The best way to save all of the settings of a layer (or multiple layers) in a map document, is to create a layer package. Select all of the layers you would like to save in the package Right-click one of the selected layers and click Create Layer Package Follow the Layer Package wizard, making sure to fill in all of the entries (such as summary and tags). ...


3

The reason why this code is failing is down to you missing () off the save method on your MXD, so you were not saving your changes. This code worked for me import arcpy print "This script turns off the following layers:" mxd = arcpy.mapping.MapDocument(r"C:\Scratch\newcode.mxd") for lyr in arcpy.mapping.ListLayers(mxd): print lyr.name lyr.visible = ...


2

Depending on your precise requirements, I think layer files, rather than layer packages, may provide you with a better solution. If you right-click on any layer (or layer group) in the Table of Contents and Save as Layer File you have all the Properties of that layer (but NOT its data) stored in a small file that can be easily added to another map. If you ...


2

This is related to the introduction of the OGR connection pool. [1] Before QGIS 2.10, a file was reopened on every single access (e.g. repaint). Since QGIS 2.10 the file handle is kept open and this means if a file is replaced the handle still points to the old file on Unix based systems. QGIS 2.10: workaround Unfortunately there is no API to nicely ...


2

If you pan or otherwise refresh the map it should update. This article says that you can use the following in PyQGIS: myLayer.triggerRepaint() To refresh all layers following function can be used: def refresh_layers(self): for layer in qgis.utils.iface.mapCanvas().layers(): layer.triggerRepaint()


1

Finally, iant's answer led me to the goal. For completeness I post what I have done: After creating the datasource, main information on the WFS layers are known to geoserver. So I only had to do POST /geoserver/rest/workspaces/my_workspace/datastores/my_datastore/featuretypes with the name of the WFS layer, I wanted to publish ...


1

You have to create a FeatureType before you can create a Layer (i.e. publish it). If you have already created a test layer then fetch the feature type of that one (like http://geoserver.ianturton.com/rest/workspaces/topp/datastores/bgs/featuretypes/test_uk_625k_mapped_feature.xml) but you should be able to delete quite a lot of that and leave it for ...


1

I stumbled upon an old project that made use of the "layers" in the porject.yml file so I inserted my layers in the format noted below and was able to manage the draw order of features this way. Note: The top of the list is the lowest layer and the last list item is draw on top of the preceding items. layers: - landuse - waterway - water - ...


1

Here is a list of all of the Keyboard Shortcuts and Tips that is provided with ArcGIS for Desktop. It looks like pressing spacebar while you have the layer selected will turn it off, and then pressing it again will turn it back on. This way you are free to roam the map and toggle the layer.


1

You could just use a different version of google-maps-api, for example http://maps.google.com/maps/api/js?v=3.5&sensor=false Example: http://jsfiddle.net/expedio/sodserrw/ The same example with your Google-API address (https://maps.googleapis.com/maps/api/js ) is also not working: http://jsfiddle.net/expedio/zx4k29k5/


1

I am not sure you can find a set of layers as you want but, the commands below generate them: Download world borders from http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip or from the Global Administrative Areas (http://www.gadm.org/version2). Unzip the file. Run the following commands in your terminal: $ ogr2ogr -where "REGION = 2" africa.shp ...


1

I'd recommend Natural Earth for this sort of data. It comes as shapefiles which can be read by any GIS system (e.g. QGIS) Each country's record has a lot of associated data, this includes which continent it's in, so for example you could colourize each country by continent. You can also split layers out by field value, using a plugin. That'll give you your ...


1

Open "QGIS Browser 2.10.1 with GRASS 6.4.4". Find the vector or raster layer in the "header window". Click on the layer and drag it over to your QGIS "Layers Box".


1

If you have access to the Geocortex Site, then the easy way to consume your data is by using a Workflow to make the web request from the Geocortex Essentials server, which can then create a new Graphics Layer and add it to their map. If you don't, then making a WMS server is one option. However, it would be simpler to generate a GeoRSS feed of your points ...


1

I found the answer on the gdal-dev mailing list. In summary, there are some .csv-files needed by the S-57 (ENC) reader. These are by default put in the GDAL_HOME/data directory (at least in GDAL 2.0.0), so for using ogrinfo you first need to do SET S57_CSV=C:\gdal\install\dir\data, then everything (both ogrinfo and your own programs) should be able to read ...



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