[mapserver-users] Shapefile Modification

Keith Baker krbaker at metacarta.com
Mon Nov 4 16:09:37 EST 2002


I was thinking about doing this with the perl shapelib bindings if I
couldn't find anyone with a tool.  Its a pretty simple task which would
make a great utility.

Say I have shapefile with polygons (the us for example)

Then I have another shapefile which has a bunch of lines. (say from all
of north america)

I want to remove all lines within the polygons (US), (ideally) trim the
lines crossing the boundry, keep others...

Here is my issue...  I have all of vmap0 in shapefile.  I want to trim
out the US data that I have duplicated from tiger data.  (roads, lakes,
etc)

What do you think?

On Mon, 2002-11-04 at 15:55, Frank Warmerdam wrote:
> Keith Baker wrote:
> > Humm...  All suggestions turned out negitive.
> > 
> > ogr2ogr can remove things based on extent, but not based on another
> > shapefile.  I may go hack away at it...  not sure yet.  Seems like
> > something someone must have done.  I don't want to have to purchase
> > ArcView for this project if I can avoid it.
> 
> Keith,
> 
> I have been developing Python bindings for OGR.  If you are willing to put
> up with some hassles, we could look at doing your filtering/changes as a
> python script using OGR.  I have only been skimming this thread so you
> might need to repeat to me what you are wanting to do, but in general
> an aweful lot should be possible with OGR/Python.
> 
> Best regards,
> 
> -- 
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
> 
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20021104/5c198da9/attachment.bin


More information about the mapserver-users mailing list