[postgis-users] postgis with jdbc

Markus Schaber schabi at logix-tt.com
Tue Jan 10 09:16:03 PST 2006


Hi, Gilbert,

Gilbert, Antoine wrote:

> I have a special question getting no answer. I would like to avoid
> charging all geometry in memory, i.e. having something to browse point
> with a special reader. With my understanding I can't achieve this with
> the PostGIS java object provided with PostGIS.jar. I would have to use
> myself the WKB (well-know binary) specification. Does I'm wrong? It's
> because I want to avoid to load the 100 000 points of a polygon in
> memory to draw them for example, could be nice to be able to read one,
> draw it, read another, draw it, etc... Usually in such produc it's the
> way to do.

Well, the PostGIS java classes just represent a single geometry via a
single object instance.

I don't think that there's an efficient drawing algorithm that gets a
single polygons vertices one-by-one, at least each polygon will have to
exist in Memory once for the filling algorithm to work. But it may help
to clip or simplify the polygon in the PostGIS query before fetching it
to the client.

It is easily possible to get the resultset row-by-row with pgjdbc, just
use statement.setAutoCommit(false) and statement.setFetchSize(1).
However, this is a pgjdbc subject and not postgis specific.

Btw, the CVS version of PostGIS (and AFAIR it was released with the 1.1
release) has experimental support for reading PostGIS data directly into
a Java2D Shape object, which should be the most efficient way to draw
PostGIS data in a java Graphics2D context.


HTH,
Schabi


-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list