[postgis-users] RE: RE: PostGIS - hibernate - EJB3

Markus Schaber schabi at logix-tt.com
Sat Nov 25 01:10:40 PST 2006


Hi, Daniel,

Daniel Martinez wrote:

> Also, after creating my 'Geometry' object I was required to set the
> 'srid' field, like this:
>  
> double x = 10.50;
> double y = 8.20;
> Geometry geometry = new org.postgis.Point(x,y);
> geometry.setSrid(4326);
>  
> Otherwise, I kept getting errors when trying to persist the object into
> the database.

Which error are you getting exactly?

If it's complaining about a constraint violation, then your table has a
check constraint requiring the SRID to be 4326, and so you have to set
it appropriately in your java objects before the database accepts them.

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

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



More information about the postgis-users mailing list