[mapserver-users] shapefile error only when zoomed out

Frank Warmerdam warmerdam at pobox.com
Mon Jul 26 15:25:30 EDT 2010


Wendell Turner wrote:
> Why would a shapefile only display when the map display is
> zoomed in?
> 
> When zoomed in, the image displays correctly.  When zoomed
> out, it gets this:
>   msDrawMap(): Image handling error. Failed to draw
>   layer named 'tfr'.; msDrawShape() General error
>   message.  Only polygon shapes can be drawn using
>   a POLYGON layer definition.
> 
> shpdump shows this:
>   Shapefile Type: Polygon   # of Shapes: 2
>   ...
>   Shape:1 (Polygon)  nVertices=0, nParts=0
>     Bounds:(         nan,         nan, 0, 0)
>         to (         nan,         nan, 0, 0)
> Is that a problem?  If so, is there a way of removing that
> shape (possibly using gdal)?


Wendell,

Something like the following might discard a particular shape:

   ogr2ogr out.shp in.shp -where "OGR_FID != 1"

The OGR_FID should be the same as the shape id reported by shpdump.

The shape in question is likely getting translated as something
not polygon-like whenever the view includes "0,0".

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