Tag Info

Hot answers tagged

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

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

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


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

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

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

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

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

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

del(insprow) should be: del(inspectionRows)


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


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

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

Patrick, if you have brought the point data in from a non-spatially-enabled source, you will need to save to a new, spatially-enabled format (and load that into QGIS) before you start your editing. After that, you'll want to use either the Move Feature(s) or Node Tool. Once in edit mode for your point layer, make your adjustments with either of those ...


2

My problem was solved by me, but I am not glad with how I did it. OpenSUSE provided a patch to Postgres 9.1.7 which assumes different directory structure on the disk: / usr/share/postgresql91 / and not as before / usr / share / postgresql / This is the official upgrade OpenSSUSE number 775. However, Postgis (at now - 2012 NOV 18) is not prepared for this ...


2

In my case, I found this solution to updating features. It's working very well: 1) In javascript I create a refresh method in every 5 seconds: window.setInterval(loadUnits, 5000); 2) Create the layer : function createUnitsLayer() { var def_style = new OpenLayers.Style({ pointRadius : "${size}", fillOpacity: 0.5, }); var ...


2

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


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


2

Upgrade to QGIS 1.8: http://hub.qgis.org/projects/quantum-gis/wiki/Download#26-Ubuntu The problem is your sip is too new to work with the older 1.7 release.



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