Tag Info

Hot answers tagged

5

I tested different methods for joining massive shapefile tables: the fastest way is using cursors. Read the join table creating a dictionaries with values of join field as keys and the rest of the fields as dictionary values Create new fields in the target shapefile Update the target shapefile Use the if/else statements to join and populate the target ...


4

You can calculate the values for a column with Python by using either a GP tool Calculate Field or arcpy UpdateCursor (this one is faster when working with large datasets). For calculating the geometrical properties of features, you can either use GP tool Add Geometry Attributes or using tokens (such as SHAPE@AREA) of update cursor.


3

The type of relationship between your two levels of polygons is not perfectly clear, but I think that you could do this in a few automated step in any cases. Case 1 : Many to one relationship. In other word, the smallest polygons are never overlapped by more than one type of the larger polygons. In this case, you can use "intersect" or "spatial join" that ...


3

The simplest way, until you are more familiar with the syntax, would be to use the field calculator as you normally do and then go to Geoprocessing -> Results. From there, you can expand Current Session and, right-clicking on the most recent tool that was run, select Copy as Python Snippet. You'll likely have to change the names of a few inputs, but that ...


2

QGIS 2.2 has a table model that you can use for a QTableView. Use it like this: cache = QgsVectorLayerCache(layer, 10000) model = QgsAttributeTableModel(cache) model.loadLayer() table = QTableView() table.setModel(model)


2

Try this: Add a new text field Using Field Calculator concatenate the block name field with the ZIP4 field - python e.g. str(!blockName!) + ' ' + str(!ZIP4!) Right click on the step 1 field and select Summarize (keep defaults). This should give you a summary table of all block names by ZIP4 values.


1

From what I understood from your question, you can do this in too different approaches. Using Categories You can use the Expression builder to write conditional expressions that will create all your output different combinations: You start by pressing the Expression button and write the expression: CASE WHEN "Score_1"+"Score_2" > 6 THEN 'Bigger than ...


1

You may want to look at doing rule based styling if all you are trying to do is color code features based on attributes in your table. You can access this from the Properties window, then under Style. Within the Style section you can get to the rule based option from the Single Symbol drop down (choose Rule-based). Here you can add rules based on your ...


1

The most likely thing without seeing the text file and knowing what field type the shapefile contains. Is that when you add tabular data (xls, txt) to arcmap it reads the first (or first few) values in a field to determine it's type. You can only join a type to the same type. So fips is most likely being converted to text and when you try to join cntyidfips ...


1

I would suggest you start by reviewing the help files on Joins so that you understand the relationship types (one-to-one, one-to-many, many-to-one, many-to-many) and their implications. Yes, there are two ways to do what you want. However I do want to point out (if it's not already clear and desired) you're going to end up with A number of B polygons ...



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