Tag Info

Hot answers tagged

18

Depending on your version, you should be able to right-click on the layer you want to export, and select Save As... Choose Comma Separated Value from the dropdown list of the dialog box that appears. Then, in the Layers part of the OGR creation options, type GEOMETRY=AS_XY or GEOMETRY=AS_XYZ depending on the dimensionality of your source data.


12

Use the IN operator instead: "xyz" in (1,2,3,4,5)


12

You would select the rows which are NULL (sounds like you have done that) then simply run the calculate field tool. Right Click the field you want to modify (while objects are selected) Then input your value "newvalue" NOTE: 1. if you don't have a selection this will work on "ALL" rows in your table! 2. Double quotes in this area on your text/date ...


11

The number values in your example query have quotation marks around them, so it looks like the problem is that your house numbers are stored as strings and not as numbers. You can check by right-clicking the field heading and clicking Properties. If the type is String, you'll need to create a new House Number field of the Integer type. Use the Field ...


10

You can change the styles of the shape file in the layer properties. Double click the layer and select style. Select Categorized style and choose a field you want to visualize. Remember to classify your values before leaving the dialog.


10

Yes Regular expressions are probably the best way to do this, and yes you can use regular expressions in the Calculate Field tool First the regular expression >>> import re >>> val = 'National and Provincial capital' >>> print re.sub('al$', 'X', val) National and Provincial capitX I'm subsituting "a" followed by "l" followed by ...


9

Without knowing what your data looks like, the general syntax you need to insert into the select by attributes window is: [FIELD_1] IS NULL OR [FIELD_2] IS NULL OR [FIELD_3] IS NULL and so on for as many fields as you have to work with. For reference the full query would be: SELECT * FROM [TABLE_NAME] WHERE [FIELD_1] IS NULL OR [FIELD_2] IS NULL OR ...


9

Use a Feature Selection iterator in ModelBuilder. You can specify the field you want the selection to be grouped by (your field containing the unique values). It will iterate over your entire feature class, creating a selection layer from each unique value. You can then add more tools for the rest of your workflow.


9

You miss a minus sign before where and the select is not necessary, so it should be: ogr2ogr -where ID="1" outfile.shp infile.shp or if you have to do more complex query on your input data: ogr2ogr -sql "SELECT * FROM infile WHERE ID='1'" outfile.shp infile.shp If ID is a field of Integer type, substitute ID='1' with ID=1. Notes: -f "ESRI Shapefile" ...


8

It is simple in the attribute calculator you may use $x and $y to calculate your coordinates into a new attribute.


7

You may like this for the added detail which is gathered For QGIS 1.7 on Win7 I open the attribute table for the layer, use the buttons to; invert selection to select all rows, copy to clipboard and paste into Excel. The first column contains Well Known Text information which maybe more useful to you. Edit I now use the plugin mmqgis to export geometry ...


7

Iterators would definitely help you here. Just in case you would need to export the feature classes on disk first, I attach the image I've created recently. In case you don't want to bother with the model building, consider using Split by Attributes tool already compiled and available for use as a GP tool that does exactly the same thing as the model ...


7

If your tool supports it, use the modulo operator. e.g. value % 5 = 0 ... all features with a value that divides by five without a remainder.


7

More elegent is "Classes" in ('14','15',....)


6

This type of operation almost always involves writing a WHERE Clause so I think using at least a little bit of Python is in order. Also while this is possible to do with ModelBuilder, IMO, creating a Python script tool with custom validation and more control over parameter settings could provide a better user experience -- for example, by making the Field ...


6

As @Baltok alluded to, you are trying to have the Selection on a particular layer be treated in the same way as other layers are, with respect to drawing order. I think that by default, and design, ArcGIS makes the Selection override the symbology of anything that is underneath it, as a means of making it easy to find the selection. Since you are selecting ...


6

You need to use string formatting when inserting your counter, i, into the SQL query: '\"FID\" = {}'.format(i) As it stands now, your script is asking Arc to find an object with FID = i, and that does not exist.


6

You would need to break up your selection statement into two separate parts: "Classes" = '14' AND "Classes" = '07' Although I'm guessing that you would want to use an OR case rather than AND for this query to work properly.


5

Have you tried paoText is NULL or paoText is not NULL


5

This works for a "relate" (definded in an MXD). I'm not sure if it works for a "relationship class". Please try. If you work with a relate you make a selection in table A and transfer this selection to tabe B (this works in both directions of a relate): Make a selection in the "vegetation table". Open the attribute table of "vegetation table" Click the ...


5

SELECT s.name, s.type, ST_Distance(s.geom, p.geom) As distance, s.geom FROM shops s, people p WHERE p.name = 'tom' AND s.type = 'butcher' AND ST_Intersects(s.geom, ST_Buffer(p.geom, 500)) ORDER BY distance; One note, this assumes that both layers are in the same projection, and that projection can't just be lat/long or you'll need to use ST_Transform ...


4

If your underlying database supports sub queries, you can build a query with a TOP N that returns ObjectIds (or any other field) and use that in your definition query. OBJECTID IN (*query here*) For example, here's a SQL Server query for a TOP 20, random selection: The above query will return 20 different rows each time the map or attribute table is ...


4

I am thinking you could do a spatial join of the points to your buffered polys which will join the attributes of both together, then you can select back the points that have matching ColumnX and ColumnY values.You can do just a Intersect or Identify as well, all three will give you a very similar result to append the attributed from the poly to the point ...


4

Whenever you run Python tools from within ArcMap and reference layers from the Table Of Contents as an input to a geoprocessing tool, it honors current selections, and will ignore unselected features. So your script should only select points that intersect currently selected polygons. Note that this functionality will not work when executing Python scripts ...


4

ArcMap has a built-in tool for that: Select Layer by Location (Data Management). Just select all features from the Select Layer, then use Select by Location (Data Management) with the overlap type "Intersect" and the selection type "Remove_From_Selection." This will remove from the selection all those that intersect the other layer, and you'll be left with ...


4

Consider the following workflow: Add Field to polygon feature class Calculate field (See attached Code Block) Dissolve based on your new reclassified field values (i.e. 1 or 2) Hopefully this simplified approach, or a variation of it, will work for you.


4

The simple trick to select only Integer values, is to use the following syntax: Mod(Round("ELEVATION", 0)*10, 10)=0 This Multiplication by 10, makes all the values Integer, and then we select only those which are multiples of 10. In case you wish to select Multiples of some other number, just multiply 10 by the interval. To get contours at 5 m ...


4

Use the Summary Statistics tool with the following parameters: Input Table: your point feature class Statistics Field: the address value field. Select MIN as the statistic type from the dropdown list. Case Field: the parcel address field. This will group records according to the Case Field, select the minimum address value and write this value to the new ...


4

May be an overkill, but I tried Python with the Field Calculator:


4

I suggest you to install Group Stats plugin. Here is a quick tutorial: Search for the Group Stats icon Select the layer in which you have the Codes Select the attribute (in your case Code) Click on Calculate The Count will appear. If you go to preferences you should be able to select only Count avoiding the other parameters to be displayed (this is not ...



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