[postgis-users] postgis performance

- fratzis@olympiacos.net fratzis at olympiacos.net
Fri Jul 15 12:29:21 PDT 2005



Hello Everybody!

I have a problem and i hope there is somebody can help me.
I use postgresql 8.0/posgis 1.0.1 in a linux pc.

A servlet retrieves data from the database which are in MULTIPOLYGON format.
Then it creates an xml file.The problem is that this process is very slow.
I have to manipulate the MULTIPOLYGON object to create the xml which has the coordinates'values and some other info.
What is going wrong?How can i make it faster?
Here is some of the code:
-----------------------------------------------------------------------------------------------------
query="select gid,nomos,code_nomos,AsText(the_geom) from nomoi";
rs = s.executeQuery( query );

while(rs.next()){
shapes += "<shape> \n";
if( rs.getString(1) != null )
shapes += "<id>"+rs.getString(1)+"</id> \n";
shapes += "<type>polygon</type> \n";

if( rs.getString(2) != null )
shapes += "<name>"+rs.getString(2)+"</name> \n";
shapes += "<status>0</status> \n";

MultiPolygon mpol = new MultiPolygon( rs.getString(4) );

Polygon tmp = new Polygon(  );
tmp = mpol.getPolygon(0);

LinearRing ring = tmp.getRing(0);
shapes += "<npoints>"+ring.numPoints()+"</npoints> \n";
-------------------------------------------------------------------------------------------------------------------------

 

 
______________ ______________ ______________ ______________

Olympiacos Members email service at olympiacos.net
Υπηρεσία email Μελών του Ολυμπιακού Σ.Φ.Π.
______________ ______________ ______________ ______________


 
                   




More information about the postgis-users mailing list