On Tue, Jun 3, 2014 at 6:18 PM, Bettina Lechner <[email protected]>
wrote:

>  I am working on a web map project with GeoServer 2.4.1, OpenLayers 2.12
> and GeoExt.
>
>
>
> I’m having some trouble with the OpenLayers.Control.WMSGetFeatureInfo.  On
> certain layers, GeoServer returns “ERROR: Operation on mixed SRID
> geometries”.
>
> The request from OpenLayers for one of the layers looks like this:
> http://myserver:8080/geoserver/ows?LAYERS=heartland%3Atraffic_scenario_a&QUERY_LAYERS=heartland%3Atraffic_scenario_a&STYLES=&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BBOX=-10721313.983985%2C5029177.270038%2C-10642507.407823%2C5080619.390073&FEATURE_COUNT=3&HEIGHT=673&WIDTH=1031&FORMAT=image%2Fpng&INFO_FORMAT=application%2Fvnd.ogc.gml&X=265&Y=258
>
>
>
> The query looks like this:
>
> SELECT count(*) AS gt_result_ FROM (SELECT * FROM
> "heartland"."traffic_scenario_a" WHERE  ("geom" && ST_GeomFromText('POLYGON
> ((-10701440.356630858 5061280.821917198, -10700675.986348007
> 5061280.821917198, -10700675.986348007 5060516.45163436,
> -10701440.356630858 5060516.45163436, -10701440.356630858
> 5061280.821917198))', 0) AND ST_Intersects("geom", ST_GeomFromText('POLYGON
> ((-10701440.356630858 5061280.821917198, -10700675.986348007
> 5061280.821917198, -10700675.986348007 5060516.45163436,
> -10701440.356630858 5060516.45163436, -10701440.356630858
> 5061280.821917198))', 0)) AND (("tot_avg__5" > 0 AND "tot_avg__5" <= 4) OR
>  ("tot_avg__5" > 4 AND "tot_avg__5" <= 5) OR ("tot_avg__5" > 5 AND
> "tot_avg__5" <= 6) OR ("tot_avg__5" > 6 AND "tot_avg__5" <= 7) OR
> ("tot_avg__5" > 7 AND "tot_avg__5" <= 8) OR ("tot_avg__5" > 8 AND
> "tot_avg__5" <= 9) OR ("tot_avg__5" > 9 AND "tot_avg__5" <= 10) OR
> ("tot_avg__5" > 10 AND "tot_avg__5" <= 20))) LIMIT 3) gt_limited_
>
>
>
> As you can see, the SRID in the ST_GeomFromText functions is 0.  When I
> manually change the SRID in the query to 3857 (which is the SRID of the
> layer), I can run the query successfully.  The entry in geometry_columns is
> correct (3857).  It also matches the geom column in my traffic_scenario_a
> table.
>
>
>
> How can I fix this so that GeoServer uses the correct SRID in this query?
>

That is a PostGIS backend, isn't it? What is the geometry_columns saying
about that table/column?
Also, any possibility you might have even just one geometry in the table
with srid=0?

Cheers
Andrea

-- 
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to