modifying Shapefile dbfs

P Kishor punkish at EIDESIS.ORG
Sat Jul 22 22:53:20 EDT 2006


Thanks for the suggestions Brent. I solved it... the problem was
Windoze case-insensitivity (and CPAN authors' naming insensitivity!).
Neither CAM::DBF nor Xbase can edit DBF files,  (well, CAM::DBF can
minimally do so, but not what I want). However, XBase (note XBase !=
Xbase) can read and write happily, and even has a DBD style interface
in DBD::XBase. Well, I installed XBase, and then installed Xbase, and
the latter clobbered the former. Re-installed XBase and it works just
peachy.

Thanks for the suggestion re. PostGIS. While that route is tempting,
that is a complexity I can live without for now. I am a firm believer
in text files as much as possible. If all else fails, I will certainly
look at PostGIS, but for now, I want to squeeze as much mileage out of
shapefiles. All this has to end up in Oracle (via SDE), so there is
one db already to make my life difficult.


On 7/22/06, Brent Wood <pcreso at pcreso.com> wrote:
>
>
> --- P Kishor <punkish at EIDESIS.ORG> wrote:
>
> > hmmmm... I can't, for the life of me, figure out how to edit Shapefile
> > dbfs. I am on Windows, and would like a Perl-ish way of doing this...
> > grab a feature, and change its attributes. Xbase and CAM::DBF, the two
> > DBF modules on CPAN can read, but not edit. Any pointers? Does OGR
> > have any way of doing this?
>
> Hmmm...
>
> http://cpan.uwinnipeg.ca/dist/CAM-DBF
>
> suggests it can read & write, but the shapefile structure imposes a seqence
> restriction that could be a pain to work around.
>
>
> You might try shapelib or ogr for a backend, & I believe both v0,8(pre) of QGIS
> & OpenJump are able to edit the geometries as well as the attribute data, but
> they are both GUI apps, not perl type stuff.
>
> I've used PostGIS as the spatial data management tool to facilitate this sort
> of thing as well. It's pretty much just shp2pgsql to load a shapefile or
> pgsql2shp to export a table to shapefile. Having your attr data in RDBMS tables
> instead of dbf's is a vast improvement from a management/edit perspective.
>
> & perl has very good links to Postgresql :-)
>
>
> Cheers,
>
>   Brent Wood
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.ies.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/



More information about the mapserver-users mailing list