problem with xFillPolygon and over 1million vertices

P.Romero romero619 at hotmail.com
Mon Feb 9 08:53:53 PST 2009


The reason I have so many vertices is because it's a very hi-resolution,
highly detailed shapefile of world coastlines, and one of the "shapes" is
North & South America combined, with over 1.5 million points. I didn't
design the shapefile, so I cant do anything about the size.

Basemap, a toolkit for Matplotlib, a python plotting program, is able to
plot this hi-res shapefile with no problem, but Im not sure how they do it
(I think they use cairo/pygtk as an interface to X). I don't even believe
they use shapefiles, but they do manage to plot the same hi-resolution
coastline data.

Im looking at the big requests extension now...
But, before I read through all of the documentation, can I get a quick
answer: is there a hard limit? What is it? And is there a solution to
this???


-----Original Message-----
From: Peter Harris [mailto:pharris at opentext.com] 
Sent: 2009-02-09 9:43 AM
To: Pablo Romero
Cc: xorg-devel at lists.x.org
Subject: Re: problem with xFillPolygon and over 1million vertices

Pablo Romero wrote:
> Im working on an application that uses xLib, and I'm having a problem
> with a call to xFillPolygon when passing an xy point array that contains
> more than approx. 1million points. Im using putty & xMing, and am
> receiving the following error:
>  
> 
> XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server
> "localhost:10.0"
> 
>       after 3747 requests (76 known processed) with 0 events remaining.
> 
> My program crashes, though my xServer (xMing) continues to run and
> reports no problems, so Im guessing its a problem with xFillPolygon.

You could install an error handler to keep your program from dying. See
XSetErrorHandler().

> My question is: is there a hard limit on the number of points that can
> be rendered by xFillPolygon????

Yes. See documentation on the BigRequests extension.

Also, you appear to be hitting a soft limit (number of points in a
polygon that this server can allocate space for, and/or can process at
once).

> if so, is there any work-around to get
> it to function properly???

Draw smaller polygons. 1 million points is, what, a Mgon? When you have
to start using SI prefixes, it's starting to get out of hand. I can't
imagine what such a thing would look like (aside from maybe a sphere
that should have been drawn with XFillArc instead). Certainly a Mgon
cannot be clearly resolved on a typical monitor (which will have only 1
or 2 Mpixels).

Alternatively, draw it client-side (maybe using cairo or similar).

Peter Harris
-- 
               Open Text Connectivity Solutions Group
Peter Harris                    http://www.opentext.com/connectivity
Research and Development        Phone: +1 905 762 6001
pharris at opentext.com            Toll Free: 1 877 359 4866



More information about the xorg-devel mailing list