Tag Info

Hot answers tagged

7

A SearchCursor in arcpy is the most direct route for accomplishing this: import arcpy fc = "c:/data/base.gdb/roads" field = "StreetName" cursor = arcpy.SearchCursor(fc) row = cursor.next() while row: print(row.getValue(field)) row = cursor.next() Note that you can use the where_clause property to perform your selection.


6

You can do this by using Layer Groups. In the Admin interface, Under the 'Data' section on the left click on 'Layer Groups'. Then, in the usual GeoServer way, create a new layer group (by default you may already have a couple of examples) and then follow the intuitive interface to add layers to the group. Once you have your Layer Group created, go back ...


5

The Openstreetmap plugin does what you want. Unfortunately, OSM hit a 64-bit-numbering limit, which forced all software using node numbers to be rewritten. The improved Openstreetmap plugin will be available with QGIS 2.0, which will be out within the next few months. Until then, you can look out for Geofabrik shapefile extracts. They include not all ...


5

Any file included in the Install\ directory of your add-in project will be carried along in the Python add-in when you run makeaddin.py. You can include layer files or anything else really. You'll find the absolute path to them on disk via path_to_layer = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mylayer.lyr') in your whatever_addin.py to ...


4

If you have a contour lines layer with associated elevation attribute, you can query the contour lines in reference to the elevation values. More in detail, you could define a rule-based style in Vector properties --> Style in order to query the elevation values you are interested in. For instance, suppose you have contour lines with equidistance 5 m and ...


4

Your problem is that you have added your data using Postgres data type Point, http://www.postgresql.org/docs/9.3/static/datatype-geometric.html Rather than the PostGIS geometry, or Geography type http://postgis.net/docs/reference.html#PostGIS_Types GeoServer has a PostGIS Data Store connector, rather than a Postgres Data Store connector. Good Luck


4

The styles are normally saved in public.layer_styles. Being in the public schema it should be accessible to every user. If not, make sure it becomes using: GRANT SELECT ON TABLE public.layer_styles TO users; -- "users" is a group with all your #normal users


3

Right click on the layer in table of contents. Select data> repair data source. Then save the layer file again. There could be issues with either your MXD location, or you relative/actual path setting. I use the relative path method but ALWAYS keep my MXD in a folder directly under the data. always keep the mxd file in the folder together Not ...


3

The other way is to list all the layers you want in the LAYERS parameter of your WMS request. If you have GeoServer installed locally you can try ...


3

In QGIS 2.01, there is now a checkbox which enables usage of degree-minutes-seconds. Worked for me 2 weeks ago, but at the moment there might be bugs. In general: This coordinate format is a pain and you should get rid of them as soon as possible, cause there are so many different variations, that it is a horror to create new conversions for them all the ...


3

You are very close, just on the wrong tab! Go Settings->Options->Canvas & Legend and set 'Bold group names' to true and 'Bold layer names' to false. You've got a few other options to play with here too (like capitalising the layer names and displaying the classification attribute names), which might be useful for you too.


3

In ArcMap - you could do the following: Select the polygon you want to copy. Open the Python window and type in the following code: cur,row = None, None cur = arcpy.SearchCursor("NAME OF THE LAYER HERE") x = 113 for row in cur: shp = row.getValue("SHAPE") cur,row = None, None cur = arcpy.InsertCursor("NAME OF THE LAYER HERE") for i in range(0,x): ...


2

Kelso's answer is correct. However, the documentation (and API) is a bit confusing. For example, to create a custom info box, based on this example: http://leafletjs.com/examples/choropleth.html you can do this: var mapInfo = L.control({position:'topleft'}); info.onAdd = function (map) { this._div = L.DomUtil.create('div', 'info'); // create a div with a ...


2

assigning an Action Type of Python you can add multiple column field values (separated with a space), as follows: u'[% "col_name1" %]' + " " + u'[% "col_name2" %]' if you need to add data from numerous rows and create a new table view in QGIS, you should think about creating a plugin


2

Two thoughts: Why not just use QGIS? It performs a lot more functions than what you are looking for, but is ready to go 'out of the box'. This is a plugin for PGAdmin3 that lets you view postgis table geometries as images (maps).


2

First off, I don't think you want to be saving these as layer files (.lyr). A layer file is only a pointer to data. You need to save the data to a feature class or shapefile. The output from the Make XY event layer tool is a "in memory layer" and it is gone once the session is over. That needs to be converted to feature class to save it to your computer. ...


2

The best way to achieve this would be to register an event handler for the map's changelayer event. Within this event handler you can identify the layer whose visibility has changed and its current z-index, which you can then use to calculate a delta that can be used with the map's raiseLayer function - or you could just use setLayerIndex and specify n + 1 ...


2

I am guessing the GPS gpx file gets added as a point layer. Make sure Layers panel is on. View | Panels | Check box for panels If just your Google layer and GPS layer are added, you should see the Google layer above and GPS layer below. Click on the GPS layer, hold, drag and drop above the Google layer. You should be able to see the GPS points on Google ...


2

You could write the geometry to an in-memory dataset using the '/vsimem/path_file.shp' virtual file system. e.g. drv = ogr.GetDriverByName( 'ESRI Shapefile' ) ds = drv.CreateDataSource( "/vsimem/blahblah.shp" )


2

There are two approaches that could be used. The first one is more like what you are trying to achieve. Option 1: Layer max extent You can set the maxExtent property for the layer along with the displayOutsideMaxExtent property to prevent OpenLayers from requesting tiles that would fall outside the maximum extent. If you don't specify a maximum extent for ...


2

QgsMapLayerRegistry::mapLayers() doesn't affect the rendering order of the layers in the map. What you need to do is set the order in QgsMapCanvas::setLayerSet() So something like this: vector = QgsMapCanvasLayer(somevectorlayer) memorylayer = QgsMapCanvasLayer(yourmemlayer) raster = QgsMapCanvasLayer(yourrasterlayer) QgsMapCanvas::setLayerSet([raster, ...


2

You can pass params object in the OpenLayers.Protocol.HTTP. See here http://dev.openlayers.org/docs/files/OpenLayers/Protocol/HTTP-js.html#OpenLayers.Protocol.HTTP.params your protocol part of code should look like protocol: new OpenLayers.Protocol.HTTP({ url: EMS_SOURCES_WS, callbackKey: 'callback', ...


2

You may be encountering bug NIM087647 which suggests: Alternate Solution Use the Add Data button in ArcMap to add the table to the table of contents.


2

An interesting question, but I'm afraid it's a non-trivial job. I have some thoughts but not sure if it's the right way to go. So probably you need to use browser's drag-and-drop feature (if it is supported). Create a custom openlayers control that you can drag and drop features between multiple map instances. When starting drag a feature from one map, get ...


2

The best possible solution for you is to check the logs for your webserver. In our case, we are passing all our requests through Apache, which is functioning as a reverse proxy. We regularly look at Apache's Access Logs and see which of our services are most used, and act accordingly. If your Geoserver is hosted in Tomcat, or Jetty, you can enable the ...


2

If you have a layer in degrees, you are using a geodetic coordinate system, like WGS84. If you want meters as units, you have to save the layer into a projected coordinate system, like UTM. So Rightlick on the layer entry, Save As ... , select a new filename and a different CRS, and add that file to the canvas. There is no simple way to change the layer ...


2

From QGIS 2 advanced changelog you can read : Feature: Save styles in your database If you are using a database vector data store, you can now store the layer style definitions directly in the database. This makes it easy to share styled layers in an enterprise or multi-user environment. (source : http://changelog.linfiniti.com/version/1/) It ...


2

I'd take a look at example 3, here: Scraping through lyr.serviceProperties what you're looking for. lyr.dataSource on an SDE layer will return the file path to the .sde connection file, which you won't have access to. You should be able to loop through the serviceProperties and get what you need. From the linked ArcGIS Help: for lyr in ...


2

The problem in this case appears to be that the shapefile is projected and that the US map is not. The US map does get displayed, but as a tiny dot in the middle of the other map. If you look at the scale of the axes of the two plots above, you'll see why this would be. The solution was to use a shapefile in the same projection to add an outline.


2

I've converted this to AMD below. Specific things to point out: use require() to load modules instead of dojo.require() no longer use any esri.whatever globals no longer use any dojo.whatever globals dojo/domReady (or dojo/ready) replaces dojo.addOnLoad or dojo.ready use object.on to listen to events, this replaces dojo.connect (example is map.on(), this ...



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