[Mapserver-users] OGR2OGR spat clipping issue

Frank Warmerdam warmerdam at pobox.com
Thu Apr 29 21:57:41 EDT 2004


Dave Malach wrote:
> I am using OGR2OGR to clip a small rectangle into a shapefile from a 
> larger shapefile.
> 
>  
> 
> The process works fine with the “OGR2OGR –spat” command, except that it 
> omits any polygons that are not completely inside the smaller 
> rectangle.  I was hoping that it would simply clip (and maybe close) 
> those polygons that overlay the edge of the small rectangle.
> 
>  
> 
> Is there a way to get OGR2OGR to do this?

Dave,

Ogr2ogr should be returning complete features with the full geometry for
all features whose MBR (minimum bounding rectangle) intersects the rectangle
you specify in the -spat argument.  It never clips, but a feature should
not need to be completely contained in the query rectangle.

If you actually want to perform geometry operations such as clip to a bound,
I would suggest you look at using the geometry operations in PostGIS.

PS. This question would likely be best asked on the gdal-dev mailing list.

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




More information about the mapserver-users mailing list