Try using CRS.decode("EPSG:4326") .. rather than DefaultGeographic.WGS84.


--
Jody Garnett

On 15 July 2015 at 06:44, Jacob, Sanju H (N-INCADENCE STRATEGIC SOLUTIONS
CORPORATION) <sanju.h.ja...@lmco.com> wrote:

>  I’m trying to do spatial search on postgis/postgres table using
> FilterFactory spatial operations. I’ve created the a Point geometry using
> the following
>
>
>
> private Point createPoint(double x, double y) {
>
>         org.geotools.geometry.GeometryBuilder builder = new
> GeometryBuilder(DefaultGeographicCRS.WGS84);
>
>         Org.opengis.geometry.primitive.Point point =
> builder.createPoint(x, y);
>
>
>
>         return point;
>
>     }
>
>
>
> My FilterFactory is
>
>
>
> // Create Filter
>
>         Filter query = ff.contains("test1.geolist", createPoint(3.0,
> 5.0));
>
>
>
> I have a class PostGresPreparedFilter extends PostgisPSFilterToSql
>
> My SQL String has a where clause “WHERE test1.geo && Point(3.0 5.0) AND
> ST_Contains(test1.geo,Point(3.0 5.0))…………”
>
>
>
> I am getting the following error on almost all spatial operation except
> “disjoint”.  Disjoint operation does not contain the first part of the
> above where clause
>
>
>
>
>
> org.postgresql.util.PSQLException: ERROR: Operation on mixed SRID
> geometries
>
>
>
> select * from geometry_columns  on postgres DB returns the following
>
>
>
> "test1";"geolist";2;4326;"MULTIPOINT"
>
> "test1";"geo";2;4326;"POINT"
>
>
>
> My columns are with 4326 SRID. Please help.
>
>
>
> Thanks,
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
  • [Geotools-gt2... Jacob, Sanju H (N-INCADENCE STRATEGIC SOLUTIONS CORPORATION)
    • Re: [Geo... Jody Garnett

Reply via email to