All my geometries are in 4326. The generated filter seems to use no SRID or it is set to -1. That's why it works when I change the database's SRID to -1. But this is not an option. I would like to know how to create the proper filter.
Matthias Am 28.06.2011 12:30, schrieb Fred Lehodey: > Hi Matthias, > how do change the srid in postgis table ? > (Editing the geometry_column table doesn t change geometries srid....) > > Fred > > On Tue, Jun 28, 2011 at 11:17 AM, Matthias Lendholt > <[email protected] > <mailto:[email protected]>> wrote: > > Hi all, > > I'm trying to intersect a geometry with PostGIS and it ends up in > org.postgresql.util.. PSQLException: ERROR: Operation on two geometries > with different SRIDs > > LineString TEST_LINE; > Coordinate a = new Coordinate(27.3, 37.0); > Coordinate b = new Coordinate(27.3, 37.6); > LineString TEST_LINE = GEOMETRY_FACTORY.createLineString(new > Coordinate[] { a, b }); > // .. something in between ... > Filter filter= CQL.toFilter("INTERSECTS('the_geom', "+ > wktW.write(TEST_LINE) + ")"); > // ... > featureCollection = featureSource.getFeatures(filter); > > I tried it both with shapefile and postgis. Shapefile works. If > featureSource is based on postgis datastore then I get the exception. > The srid in table geometry_columns is set to 4326. If I change this > value to -1 then it works also but I prefer having it set to 4326. I > tried to manually set the SRID for the LineString (.setSRID(4326)) but > it doesn't help. > > Any ideas? > > Many thanks in advance, > > Matthias > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously > valuable. > Why? It contains a definitive record of application performance, > security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > > -- [[email protected]] GFZ German Research Centre for Geosciences CeGIT Centre for GeoInformation Technology Tel +49 331 288-1687; FAX +49 331 288-1703 Telegrafenberg A20, 14473 Potsdam, Germany Blog http://zeigertelegraph.gfz-potsdam.de Contact MECARD QR Code: http://goo.gl/488J ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
