# Tag Info

## Hot answers tagged update

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

10

If you are convenient with Python then writing script for this task is preferred. Take a look at these key things: Get a list of featureclasses/shapefiles in gdb/folder - ListFeatureClasses. In the bottom of this help article there is also an example "Copy shapefiles to a geodatabase" which you can use to start writing script. Check for existence of ...

6

Make a view in PostgreSQL, where the age column can be dynamically created using some useful functions: SELECT date_trunc('month', age(now()::date, '1994-03-19'::date)) AS age; age ----------------- 19 years 5 mons (1 row)

5

You have to include quotes within your expression string. Try this: fcList = arcpy.ListFeatureClasses() fieldName1 = "Author" expression1 = "\"John Doe\"" for fc in fcList: arcpy.AddField_management(fc,fieldName1, "TEXT") arcpy.CalculateField_management(fc, fieldName1, expression1) By adding in escaped double ...

5

for getting one popup info, you should do this: map.popups[0]; // the firstly added popup for removing one popup: map.removePopup(map.popups[0]); // it will destroy firstly added popup map.popups[0].destroy() // the same thing for removing all popup from maps: var pops = map.popups; for(var a = 0; a < pops.length; a++){ ...

4

I've updated the instructions on the website. Hope it's a bit clearer. Nicklas is right you don't really need the makepostgis.bat if you just copy the like folders to your postgresql install (you could also remark out the create db in it since it does copy all the files). You should be able to just overlay ontop since the zip structure is the same as ...

4

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

4

Yes, eco is an object. You need to iterate to see its element. arcpy.env.workspace = "C:\\Users\\Documents\\Scoring\\Ecodis_clip_split" #set workspace to folder with values eco = arcpy.SearchCursor ("NAME.shp", "", "", "area_ha", "") #search for the value in attributetable for row in eco: print(row.getValue("area_ha"))

3

This does not seem like a clear question to me, but I think what you are asking is that now you have the rows in the feature class and the csv data, how do you update the row? The crows variable is the cursor by the way. That is easy, you just need to add in your if-else statement: crows.updateRow(crow) so here is an example in your code, this is ...

3

The two versions can be installed in parallel, but the connection of file appendix .qgs will be set to the latest installation. The older version may break if plugins will be installed that are not compatible with that.

3

During configuration PostGIS is looking for GDAL, the GDAL-config-file that is: http://postgis.net/docs/postgis_installation.html#installation_configuration So yes, I think you need to build PostGIS again; I don't know about a way to point PostGIS to a different/new version of GDAL.

3

Using Field Calculator $x and$y operators, you can over-write the old coordinates in attribute table. Just run it once - after you have moved all points to the desired locations. Field Calculator v.2.x: http://docs.qgis.org/2.0/en/docs/user_manual/working_with_vector/field_calculator.html Field Calculator v2.4+: ...

3

Following the instructions from Installing PostGIS 2.0 on ubuntu on linfiniti.com: 1) sudo apt-add-repository ppa:sharpie/for-science # To get GEOS 3.3.2 sudo apt-add-repository ppa:sharpie/postgis-nightly sudo apt-get update sudo apt-get install postgresql-9.1-postgis 2) create a new database. 3) create postgis extension: CREATE EXTENSION postgis; ...

3

del(insprow) should be: del(inspectionRows)

3

Here's a simple script that would run in same directory and check for and delete shapefiles... You can just run it from IDLE or ArcGIS python window or you could create a toolbox and add it as a script and add parameters. import arcpy, sys OutputFC = sys.path[0] + "\\downloaded1.shp" if arcpy.Exists(OutputFC): ...

3

Edit: The reason that you don't have the extension folder is that you are not on PostgreSQL 9.1 when the extension feature was introduced. What you should do is put the binaries in the bin-folder as described in the beginning of the readme-file. Then running postgis means that you are supposed to run the sql-code in the file postgis.sql to install the ...

3

Provided that the points and polygons overlap (or it is clear which point is closest to each polygon) you should use Spatial Join for this analysis. It will give you all (or specified) columns from your join features (polygons) to your target features (points). You should probably use Join one to one for Join Type and Intersect or Within if your points are ...

3

Have you tried: if row[i] == 9999: row[i] = None cursor.updateRow(row)

3

I dont which one is better idea rule or trigger but here how it is done using trigger CREATE TRIGGER updatetable INSTEAD OF UDATE ON table_name_here FOR EACH ROW EXECUTE PROCEDURE do_magic(); CREATE OR REPLACE FUNCTION do_magic() RETURNS trigger AS $BODY$ DECLARE -- if you need variables they are here ta text := 'table_name' BEGIN ...

3

What you want is available starting from QGIS 2.6 and is called Virtual Field. Just create a new attribute, select "Virtual Field" and insert the expression used to calculate the new column. For your case: CASE WHEN "Age" < 18 THEN 'Child' ELSE 'Adult' END You can use a recent nightly build / test build to use this new feature. The value relation ...

3

No problem, you only need to download QGIS 2.4 and install it. the application (QGIS.app) is placed in /Applications/ the frameworks are in /Library/Frameworks/ (/Library/Frameworks/GDAL.framework for example) the extensions are in /Users/you/.qgis2/python/plugins (hidden folder, /Users/me/.qgis2/python/plugins/tablemanager for example) the Python ...

3

Try using ... set rows = arcpy.UpdateCursor("qcPoints") instead of setting rows to qcPoints_lyr. You should be able to do away with the Append that way. I thought that might work and it sounds like you confirmed it. MakeFeatureLayer is needed for doing selections but you don't need to set your updateCursor to the output.

3

Not sure I am understanding the workflow correctly but like Beck said I think this is does the trick. Foo is the original shapefile you are deleting all the features from, Bar is the layer you are copying features from. import arcpy # Data foo = r'C:\Path\to\layer\that\will\be\blank.shp' bar = r'C:\Path\to\layer\that\gets\copied.shp' # Delete Features ...

3

Those coordinate differences are measured in Angstroms. File geodatabase uses a technique similar to the integer storage representation conversion in enterprise geodatabases (ArcSDE) to snap 64-bit floating-point coordinate values to a feature class coordinate resolution grid. This coordinate resolution is established at feature class creation (and it's ...

2

You should be able to easily achieve that by: implement an on insert/update trigger which puts changed features on a work queue a worker that periodically wales up and grabs stuff to do from the queue and refreshes tiles Item 1 can be easily written in pure sql in postgres by means of a trigger. As for item 2 you just need to call the seed program (all ...

2

Having a quick look at your script I would suggest that you break it up into smaller sections. Rather than continually running the loop to find the highest id, how about you run it once when the map opens and store it as an application variable - application.userproperties(yourID). Then everytime you add a new record (Page OnSetActive event) you have it ...

2

Your issue has to do with the Locking action that happens when an UpdateCursor is called. From the help document: Summary The UpdateCursor function creates a cursor that lets you update or delete rows on the specified feature class, shapefile, or table. The cursor places a lock on the data that will remain until either the script completes or ...

2

I assume that you want to reconcile the crude statelines with the GSHHS data. If your licence allows you to use the Integrate Tool, there is a relatively simple solution: Massively buffer your statelines, but obviously don't dissolve. Then use ArcMap's Integrate tool to integrate the buffered statelines with itself. This will put back all the internal ...

2

If you don't care about losing your postgis geometry columns etc, you can run the uninstall_postgis.sql that is packaged with 1.5 (IT WILL DESTROY ALL POSTGIS DATA so be sure). Then you can install PostGIS 2.0 without needing to restore.

2

Probably not in one step but this is what I would do: join the master attribution shapefile to the updated, detailed boundary shapefile using the reference number as key. save the joined data as a new shapefile now with full attribution and detailed boundary remove the join. select the records to be updated in the master shapefile delete those records (you ...

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