[Qgis-us-user] DBF table for SHP geo file

javier.valencia at vtgonline.com javier.valencia at vtgonline.com
Tue Dec 29 14:27:57 PST 2020


Thank you so much Karsten,
I am indeed creating the 3 files, in fact 5 files: Test.cpg, Test.dbf,
Test.prj, Test.shp and Test.shx
How are the SHP and DBF file related to each other? It cannot be the
OBJECTID value since I when the values is nulled it still display the line
but in a different color and with the OBJECTID column as NULL. Hmmm..
What we are doing is merging smaller segment (city blocks) into larger
segments (0.5 to 1 mile long) and the entire process is done on a separate
database since there is a lot of programming going on to merge the segments
and the data for the merged segment can be added, averaged, max or min
selected or other calculations for over 100 columns/fields and all the
programming to do this has already been done, we just need to display the
map with segment already merged in on color and the segment to be merged on
a separate color. It would take a lot of effort to reprogram it do it all in
QGIS and at this time my expertise on Qgis is pretty limited.as you can
tell. L
The interesting part is when I edit records, the table does take changes to
some other fields but it always sets the one field to NULL. I have tried
taking a copy of just the DBF file and placing it on a separate directory
and making the changes to that file with the same results. Also, the
segments still display but when using the information tool the OBJECTID
shows as NULL. Perhaps I can use this to show the segments with the OBJECTD
column set to NULL as being already used and the ones with a values as
available.
I will play using MS Access to do the editing since I can easily connect to
it and work with it from R:Base.
I am new to this board and looks like this response goes to the Forum and to
you.
Again, thank you for the help, much appreciated.
 
Best regards,
 
Javier Valencia, PE
14315 S. Twilight Ln.
Olathe, KS 66062
Cell: 913-915-3137
 
From: karsten [mailto:karsten at terragis.net] 
Sent: Tuesday, December 29, 2020 2:40 PM
To: javier.valencia at vtgonline.com; qgis-us-user at lists.osgeo.org
Subject: RE: [Qgis-us-user] DBF table for SHP geo file
 
Hi Javier,
 
> >>  I was provide an application in ArcInfo SHP format and the data
appears to be stored in a DBF file (Dbase) 
Yes it is in dbf format .
 
 >>> The first column in the table is a field OBJECTID which I believe might
hold the line geometric information 
Nope. The geometry is in the *.shp file , while the *.shx is the index that
connects the. Thus, editing the *.dbf does not touch the geometries . So one
'shape* is a file is in fact (at a minimum)  the three files - the *.shp, a
*.dbf and the *.shx file...
 
 >>>  I created a subset of the map, Test.DBF, with just a few columns
including the OBJECTID column and a columns called "merged" that I need to
edit from an external application 
That could work if you actually used a selection in QGIS to do this and have
the saved that selected trifecta of the files  Test.shp, Test.dbf and
Test.shx . If you only created  test.dbf instead that will not work. In that
case recreate a new subset with those 3 files mentioned above (cerate
selection then save layer (only selected) to a new shape file)
 
 >>>  I ATTACH the Test.dfb table using an external database (R:Base) and I
can see the column data just fine, the "merged" column show all values as
NULL.
When I change the value of "merged" from NULL to "Y" either via a grid or
command, it changes it correctly but also changes the value of OBJECTID to
NULL. When I open the map in QGIS and enable the layer "Test", the lines
still display but now the column OBJECT ID shows as NULL.  >>>
I am not exactly sure how you are doing that in detail but in QGIS one can
not usually edit joined data from another source (like other dbf files join
on an id field, or joined xls(x) Excel files or csv data that where joined.
The way to do it is to either 
 
1.) edit the data outside QGIS and then join that table to the shape file it
in QGIS (use the join tab) , or 
 
2.) join the data in QGIS and then save the entire dataset (with those
joined data) to a new shape file. If going that second route one can then
edit the data easily inside QGIS. One good way to edit the data in QGIS is
also using the field calculator - see here e.g.
https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/attribute
_table.html?highlight=calculator#using-the-field-calculator . 
 
Cheers
Karsten
 
www.terragis.net
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-us-user/attachments/20201229/4586e14a/attachment-0001.html>


More information about the Qgis-us-user mailing list