New answers tagged

2

Since you mentioned "Select by Attribute", I'll assume you're using ArcGIS. If your time values are stored in a datetime field (as opposed to a text, integer, or other field type) you can do this using the Less Than and Greater Than operators. Less than works as "earlier than" for time values, and greater than is "later than". Greater than/less than can also ...


2

I would use the Count Points in Polygons tool in the Processing Toolbox -> QGIS Geoalgorithms -> Vector Analysis Tools. The result is your layer "province" but with an additional field which lists the number of hotels. Note that this tool counts points, so you'd have to convert your hotel polygonal layer into a point layer using Polygon Centroids or some ...


2

I see a couple things going on here. In your first code example you tried to set fc to a list of two feature classes. The listFields function expects a single feature class, not a list. If you wanted to do that, you'd have to iterate through your feature class list. The next big thing I see is that those funny characters that you're trying to get rid of are ...


5

You need to use the str.replace() to replace the characters in your field values. Also needed to put a for fc in fcs: to loop through your shapefiles, and remove the square brackets from around fieldList in your cursor (this is what is giving you the error 'field_names' must be string or non empty sequence of strings) And note the u in front of u"Ü" so ...


1

This is Linear Referencing task, however Python makes it much easier. Solution below assumes your points and line are in projected coordinate system. Add your line to mxd, call layer "line". Add numeric field to your points table, use advanced mode in field calculator, python and this expression to polulate it: def Chainage(shp): mxd = ...


3

The tool does not carry over source point layer field/attributes. You will have to apply other tools/methods (e.g. spatial join) to bring over those attributes.


6

Short and sweet: Right-click on the layer in the Layers Panel and select Change vector datasource. In the dialog box that appears, just hit OK without changing any of the settings. Basically, you are "changing" the vector datasource to what it already was, but this forces QGIS to reload the layer definition. Tested in QGIS 2.14 on Linux Mint 17.2.


3

Assuming that your working with a PostGIS database, you can update the statistics of the table of interest by using the ANALYSE function: http://www.postgresql.org/docs/current/static/sql-analyze.html In your case you can execute the statement inside the DB-manager by pressing the button marked in the attached image and executing the ANALYSE statement in ...


5

You can set the Attribute Table to be in a dock window which allows you to 'fix' to certain positions. You can set this by going to: Settings > Options > Data Sources > Open attribute table in a dock window You will need to restart QGIS for this to take effect: Now when you access the Attribute Table, it may appear at the bottom. Just drag ...


1

Open Model Builder from ArcMap. Tool 1 in Model Builder: From the Toolbox, drag in "Select Layer by Attribute" tool. Its under "Data Management". Right click on the tool and hover over "Make Variable", then when more options pop out, select "From Parameter". When more options pop out select "Input Layer". When a new circle appears, right click on it ...


2

It's somewhat circuitous, but you may have luck saving a copy of the vector file after you Join the CSV to it. That way, the exported file should contain all of the CSV attributes without it being connected through a Join. Perhaps that would help address the issues you're encountering when using the plugin.


4

I didn't test it it, but I think the MMQGIS plugin can merge a CSV and a vector layer (go to the Attribute Join from CSV File section): It should output a vector layer with the attributes of the original layer and the CSV file, joined according to a field.


4

You can use the Count Points in Polygon process from the Vector->Analysis -> Points in Polygon menu. You simply put your municipality layer in as the polygon layer, and the accommodation as the point layer. Select an output shapefile and then run it. Finally you can merge the file back into your municipalities if you need to.


2

Do I understand well if you mean to refresh the table in QGIS after a change to the columns is made? As far as I know, only close and open the project or re-adding the table will make this happen. As long as you saved the default style in the database that might be the fastest way. When a column is added with the Field Calculator the changes are instantly ...


3

You can enable automatic updates of feature attributes with the following PyQGIS script. In this example, say you have a polygon layer named myPolygons, which has, among others, fields named area and perimeter. Copy and paste the code into the QGIS Python Console. # Initialize required variables myLayer = QgsMapLayerRegistry.instance().mapLayersByName( ...


5

You can use the GroupStats plugin to calculate these things of statistics as it's pretty much a pivot table for QGIS. You can download/install this from the toolbar: Plugins > Manage and Install Plugins Example: Here's an attribute table: And here's how to calculate the count of each Inn (or accomodation) per Province:


0

I hope this sums up the question: Google does not lable polygons but it does lable points. In order to have a label in google earth for the Points you need to fill the column name (of your attribute table in qgis) you want into the NameField in the save as menue from the layer within qgis.


2

It didn't just decide to do the "summary"; that's how you submitted it. It depends on your ultimate goal with the data, but you have at least a couple options: Create one raster for each attribute of interest. My suspicion is that this is what you should do, because I've never encountered a reason to use option 2... or Create another column in your ...


1

KMLs do not support information the same way a shapefile does. KML and shapefile conversions work well enough to display geographical information. Since KMLs do not have a full table structure behind them, you will find it lacking for converting large amounts of information. If you try and convert that KML back to a shapefile, all of that will transfer into ...


2

Since spatial join creates a 1 to 1 relation, the result will be one of the lines joined with the area. Not sure what the algorithm does exactly but probably the first record found will be joined. Not sure what result you need but I would look into intersect, where the line will be cut on the edges of the areas and merging the area attributes to the lines.


0

As commented by @FelixIP: Calculate minimum bounding geometry of modified rectangles. There is an option to calculate bearing The Minimum Bounding Geometry tool which: Creates a feature class containing polygons which represent a specified minimum bounding geometry enclosing each input feature or each group of input features. has a ...


1

As Joseph has asked, most likely some of your field names between the two layers do not match. When doing feature copy and paste the field names and order must be exact for attributes to populate correctly. Here are a few options to remedy this: Create the missing fields in the destination table in the order they exist in the other layer/table Perform a ...


1

Open the Attribute Table, at the bottom there is a button that says "Show All Features". Click this and select "Advanced Filter (Expression)" and use an expression like "Layer" IS NULL OR "Layer" = 0. This should now only show features with doesn't have a value for the "Layer" field. Now you can edit and delete features by selecting the relevant buttons in ...


2

You can run a Spatial Join to create a new feature class with a combination of attributes and geometry from your original layers. Select your destination geometry, and the attributes you want to join to it from the input layers.


1

Unfortunately, you cannot save the dangles ends resultant from the topology checker into a new point shapefile since the points do not have any x,y locations and there is no option to turn the dangles into point shapefile. Hoping that someone can develop such an option to save the output of topology checker into a vector file.


3

You can use the rios (raster input/output simplification) module to read the columns of the RAT, giving you a numpy array which can be written to a csv col_names = rios.rat.getColumnNames(img) rat_values = [] for col in col_names: rat_values.append(rios.rat.readCoumn(img, col) Alternatively it will possibly be easier to create a gdal image directly ...


1

You don't need to go all the way to polygon. When you convert to integer you should get a raster attribute table with a count for the number of cells in each row.


1

Save you polygon in FGDB if its not there Join polygon (right click join) to table Right click on it in table of content and export to file geodatabase feature class NOTE: you'll get N identical polygons with different info attached to them.


3

Usually join attribute has a one-to-one or a many-to-one relationship as shown in the documentation in Vince comment, however there is other solutions presented here you can try it, which is as follows: Open ArcToolbox. Go to "Data Management Tools". Click on "Layers and Table Views". Double click "Make Query Table". Select the correct "Input Tables" you ...


1

The argument of the split function is expecting a string value surrounded by "" or ''. You have three double quotes. Try surrounding the string with single quotes: !other_tags!.split('"int_name"=>"')[1] To remove the last bit of text, run this statement after running the one noted above: !other_tags!.split(',')[0].replace('"','')


1

If they are in the same projection You can use spatial join from Vector -> Data Management Tool -> Join Attributes by location. Try to use "Take attributes of first located feature" as shown below.


0

After lots of trial and error I found a way of doing the spatial filter and then passing the value to a custom form, with a script running alongside. The form takes dialog, the layerid and a featureid. I used featureid to identify the geometry of the point I wanted to test against polygons, obtained the geometry of the polygons to test against and if there ...



Top 50 recent answers are included