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

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


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

We've recently released some open source software - Open Door Logistics Studio - which lets you perform free territory mapping and free territory design, targeted for the UK. We've also generated, using voronoi etc, postcode areas, districts and sector boundaries for the UK for use in our software - also free. You should be able to just use this directly for ...


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

Found it ! var toner = new OpenLayers.Layer.Stamen("toner-lite");


2

you could unmark the layer (which you dont want to be drawn in one composer) in the layers panel, then do your settings in the print composer and then mark "lock layers for map item" in the Item Properties tab of the print composer. Now you have one print composer without that layer. Now reselect = checkmark this layer again in the layers-panel and create ...


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



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