Tag Info

Hot answers tagged

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

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

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


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


5

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


5

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


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

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)


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


3

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


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

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

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

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

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


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

You'd get the app's Map Canvas and set its extent. canvas = qgis.utils.iface.mapCanvas() canvas.setExtent(layer.extent()) You might want to read this tutorial.


2

You can define the floors as subtypes of one layer and then apply the topology rules between subtypes. Topology rules can be defined between subtypes of features in one or another feature class. This could be used, for example, to require street features to be connected to other street features at both ends, except in the case of streets belonging to the ...


2

Well, that is the correct code for setting the active layer in the legend. You have not provided a version for QGIS that you are using, but looking at some of your other questions, I'm going to assume 1.8 (I recommend upgrading to 2.0). There have been numerous user-interaction GUI updates for the layer legend between 1.8->2.0. Namely, the active layer is ...


2

Question: How to make sure GeoServer is providng WMS for my layer? Answer: Use a third party software like QGIS-desktop to add the WMS layer provided by GeoServer. If you are able to present the WMS layer in QGIS-desktop, this varified that GeoServer is providing the Web Map Service.


2

When you are publishing/Editing the layer in the web interface, go to the 'Publishing Tab' and Under Edit layer check the Advertise check box. If this is enabled, then you should see the layer in the Layer Preview.


2

I suggest you search the help file for the topic Layer (arcpy.mapping) as you actually want to be using saveACopy()! There is a subtle difference between save and saveACopy and how they behave depends entirely on how you got a handle on the layer. There is a code "Example 1" showing how it is done. The Desktop Help always provides code snippets, they are ...


2

In place of feature class I would use Spatial Dataset in Vector Format initially, and then shorten to Vector Dataset. I think layer can be considered to be an already vendor independent term.



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