Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using PostGIS, GeoServer and OpenLayers, and the thing is that i want to display the geometry result from a query like this:

SELECT ST_Buffer(ST_GeomFromText('POINT(100 100)'), 500);

To perform queries I'm using Java, the line I use to perform a query is the following:

resulset = statement.executeQuery(query);

where resulset is a ResulSet type object, when I convert it to String I get the following:


My question is how do I interpret that to display the POLYGON I suppose is in there in a layer? or am I doing something wrong? Hope someone can help me with this question, thanks.

share|improve this question

You can perform operations with WKT you return from consultations in postgis

SELECT ST_ASTEXT(ST_Buffer(ST_GeomFromText('POINT(100 100)'), 500));

you recieve WKT and use Openlayer to convert the wkt to geometry and feature. for example : var elemento = New OpenLayers.Format.WKT().read('textWktFromRecordColumn');

I hope it helps. greetings

share|improve this answer

Have a look at the WPS addon for GeoServer - which provides a clean interface for this sort of query.

share|improve this answer

if you use geodjango from server side, you can achieve this with performing raw SQL queries...

for example :

with models in

Person.objects.raw('''SELECT ST_Buffer(ST_GeomFromText('POINT(100 100)'), 500);''');

or importing some module for connection and directly querying:

from django.db import connection, transaction
cursor = connection.cursor()

cursor.execute(SELECT ST_Buffer(ST_GeomFromText('POINT(100 100)'), 500))
row = cursor.fetchone() # .fetcall()

this is data retrievalling work for executing raw sql...

and last word about this geoquery

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.