Tag Info

New answers tagged

2

The date field stores the full date. It is your system (combined with the type of database) that defines how a date will be displayed. if you want to store a string with the time using your own format, you can use a text field, then something like str(datetime.datetime.now( )).split()[1] will work, or, better, directly use the date formatting from ...


1

Instead of using a cursor to look at all fields for each record (one at a time using the cursor), what about querying all records from a single field (in bulk) using "Select By Attributes" tool and then calculate all of the selected records using "Calculate Field" tool? Then you could just loop over each field in Python? Using your code as a base, I mocked ...


5

Since I'm most familiar with 10.1+, and cursors in general are a lot better in the da module, here's a potential solution. Currently, you are creating a cursor each time you change fields, which means you are taking a hit there. Furthermore, you are checking the field type for each record instead of just using the field type once to filter initially. I've ...


2

Notice that in this cases you can create a new column with the desired size and precision, and populate it's values with the "old" column values. After saving, your new column will have the wanted precision. Take this exemple. I have a table with a column ("test") with a precision size 20 and precision 15. I will open the field calculator (the abacus ...


2

I experienced the same problem. After fooling around with the issue, I found out that all you need to do is add ::text to the static value and make sure that you name the column with as my_check_boxes. You will have to change the cast if text is not the actual data type. select row_number() over () as rid, 'Visited ( ), count1 ( ), count2 ( ...


0

After writing this I just realized that you were talking about QGIS and not ArcMap but I will keep it here anyway. After doing your join with the unaltered csv table right click the field title in the attribute table and select "Properties". In the Field properties dialog you select the button labeled "Number Format: Numeric" as seen below. After ...


2

Long, but robust: Add 2 fields to line table X, Y Calculate geometry midpoint X and Y Convert table to table and use it for Add XY data Convert XY to points Spatial join points and polygons In points table populate FG by FGV values. Transfer results back to your lines. I assume you have UniqID field in their table


1

Try making the table view permanent by using Table to Table and then try the %n% system variable. Alternatively, call the Value variable: vshed_%Value%_View Additional Information: A quick tour of using inline variable substitution Examples of in-line variable substitution with ModelBuilder system variables


2

I am providing a scripted alternative either in the interactive window or as a stand alone script. layer = "YOURLAYERNAME" #interactive window in quote, standalone script needs path arcpy.AddField_management(layer, "Same", "TEXT") rows = arcpy.UpdateCursor(layer) for row in rows: if str(row.getValue("POLYGON_NM)) == str(row.getValue("NAMING"): ...


2

If it were me... This could be done in a model but it would be a bit fiddly. I think this would be much easier to write in Python. You would essentially query your data 3 times one for each criteria get a count and insert the count into a table. So you need to be looking at the help file at how to use arcpy's SelectLayerByAttribute_management(), ...


3

If I understand correctly, you want to determine if you have duplicate NAME values within the same municipality. Here is a quick way that may do what you want. Create a new field in your table called Merged. Use the field calculator to concatenate the two string columns, [POLYGON_NM] + [NAMING] Right click on the Merged column and choose Summarize from ...


0

I'll offer one suggestion within ArcMAP and another outside of. Since the tables are related by the meter number you can perform the join either within or without ArcMap. The fact that the data has a spatial component to it should be irrelevant when joining based on attributes. I see your tag is ArcMAP 10.0, however this tool requires 10.1+: I would try ...


2

Using the tools in ArcGIS, if I understand your question correctly: You can use 'Tabulate Intersection' to calculate the % of area overlap between your two polygon layers (using FID as your zone field) and join the output to the appropriate polygon layer. Then use spatial join to join the attributes from one layer to the other. You can then delete any ...


0

Updated and re-worded answer: Create a new shapefile based on address point template, so that all the fields are the same. Edit the new shapefile, and then when you find an address you need, select the feature and copy the feature to the new shapefile. The feature attributes should transfer over since the field names are the same. In-fact, in ArcMap, if ...


0

You could include all the values you want to search in your query, but that's impractical for large numbers of records. Using python, you could run a loop and save them out to a file. I don't know of any way to select them all in the attribute table itself other than manually. If they all shared a common feature (e.g. the field value all started with ...


1

I don't believe there is a way to add an additional field in ArcGIS online through your web browser. However, if you have access to ArcMap at work, you can sign into your ArcGIS online account and it will load your map from ArcGIS online. From there you can open up your shapefile and add a new field. However, I'm not sure if the same functionality exists ...


1

Well, you can do that using ogr2ogr, after exporting vectors from GRASS to shp: ogr2ogr -sql "SELECT * FROM file_in WHERE 'category' == 2 AND OGR_GEOM_AREA > 10000" file_out.shp file_in.shp file_in.shp is your data exported from GRASS file_out.shp is your filtered results. Then you can run: ogr2ogr -sql "SELECT count(OGR_GEOM_AREA) FROM file_out" ...


7

You should be able to do a simple 'select by expression' where DATECOLUMN like "% 12%" This is assuming your date is a string column. Essentially; the query is using the 'pattern' that is formed, and saying "Find me every record where there's a space, followed by 12, follow by a colon. Since your data is in 24h format, the only records criteria that ...


0

Not sure if this still exists in QGIS 2.4 but I use QGIS 2.2 and there is an option where you can save your selected attributes as another shapefile. It doesn't matter if you toggle the edits, you just select which fields you want to save into the new layer: Layer > Save Selection as Vector File... The alternative would be to save your layer as a new ...


2

This functionality is under the "Show all features" Button:



Top 50 recent answers are included