Editing shape files...or altering output.

Jerl Simpson jerl.simpso at GMAIL.COM
Fri Oct 1 17:04:33 EDT 2004


Hello,

I don't know if anyone is interested, but I have written a Perl script
to perform the function I was looking for earlier.
If you like, I can send it to you, it's also very short, so I could
post the code to the list if requested.

It works like:

dbfreplace.pl dbfile field "search string" "replace string"


Let me know if you are interested in such a thing.

Jerl

On Fri, 1 Oct 2004 11:46:07 -0500, Jerl Simpson <jerl.simpso at gmail.com> wrote:
> I notice in the shapelib library, there are example programs to add
> records to the dbf file (dbfadd) I believe.
> That might help you out.
>
> Jerl
>
>
>
>
> On Fri, 1 Oct 2004 11:52:41 -0400, MapServer List
> <mms at gnetconsulting.com> wrote:
> > Hello list:
> >
> > I need to do something similar, except I need to add a record to
> > the DBF and save it, using PHP/MapScript.  Would I use the same
> > steps?  Or would it be easier to do it in a DBF editor of some sort?
> >
> > My platform is Linux 9/PHP/MapServer 4.2.1.  Thanks.
> >
> > Joel
> >
> >
> >
> > ----- Original Message -----
> > From: "Stephen Woodbridge" <woodbri at SWOODBRIDGE.COM>
> > To: <MAPSERVER-USERS at LISTS.UMN.EDU>
> > Sent: Friday, October 01, 2004 11:08 AM
> > Subject: Re: [UMN_MAPSERVER-USERS] Editing shape files...or altering output.
> >
> > > You can do this in Perl using Geo::ShapeFile or Geo::Shapelib which
> > > might be the easiest way to do this. Your plan below is exactly how to
> > > do it, but Perl might be easier to write if you are familiar with it.
> > >
> > > I am not aware of any generic utilities that do this.
> > >
> > > -Steve W.
> > >
> > > Jerl Simpson wrote:
> > >
> > > > Hello,
> > > >
> > > > I'm having a display issue that I need to work out.  I am wondering
> > > > the best way to go about it.  Here's the issue.
> > > > I have an ESRI shape file with US roads.  In this file, the US
> > > > highways are listed as, "United States Highway 400".  When you have a
> > > > lot of those on the map, it gets very messy. I would like to replace
> > > > "United States Highway 400" with "US 400" or even "US Hwy 400".
> > > > Is it best to change the .dbf file?  Or can I do this on the fly?
> > > > I have no idea how to do this on the fly, but here are my thoughts on
> > > > the dbf file.
> > > >
> > > > Use shapelib to open and read the dbf file, read in the values,
> > > > compare, change if needed, then spit out to a new dbf file.
> > > > Currently I would work at writing something to do this, after much
> > > > reading of the documentation.
> > > > Has anyone done this before?  I suspect there might be a utility to do
> > > > just this type of thing.
> > > >
> > > > Thanks in advance,
> > > >
> > > > Jerl
> > > >
> > >
> >
>



More information about the mapserver-users mailing list