Hello and thanks for the feedback.
It looks as though something could be done within jOOQ's
PostgresFactory to simplify the interaction with PostGis... I hope I
will have time to play around with this at some stage. Optionally, you
could also try to generate the routines in the pg_catalog schema. You
might find those ST_xxx functions in there and use the generated code
with the jOOQ API
Cheers
Lukas
2012/11/13 <
mva...@googlemail.com>:
> Hello,
>
> sorry for the late reply.
>
> Now I'm not using the special Records from tables.records anymore.
> I replace the geometry field in the table's class with
>
>> public final Field<?> POSITION = Factory.fieldByName("position");
>
>
> For reading I add all fields I want to a list of fields.
> This list is then used in
>>
>> create.select(listOfFields).from(...)
>
>
> The geometry field for postgres looks like this.
>>
>> Factory.field("ST_AsText(position)).as("position");
>
> This reads the geometry as a wkt string.
>
> After fetching the result records I get this field's content as a String.
>>
>> record.getValueAsString(table.POSITION);
>
>
> I think to use the special records one must create a special field class
> which uses the appropriate sql functions to read and write geometry as a wkt
> string.
> This way the user could decide for himself which java geometry class he
> wants to use. He just have to create the geometry object from the wkt
> string.
>
> For writing the geometry I use
>>
>>
>> map.put(table.POSITION,Factory.field("ST_GeomFromText("+wktGeometryString+")"));
>
>
> PostGIS can create geometry columns in the database's table. This way it is
> possible to do an area search within the database to select only rows which
> are located inside a given polygon, for example.
> I mean the geometry is stored in an internal format within the database
> which neither has anything to do with org.postgis.Point itself nor is stored
> as a string.
> As seen above it would be necessary to use the sql functions to read and
> write the geometry.
>
> Greetings from Dresden
>
>
>