[Geoserver-users] Geoserver puts wrong srid to the spatial filter query

Hi all,

I'm having an issue but can't figure out why Geoserver is causing this srid
problem:

Geoserver will always put number 2 as an srid to the Filter, srid should be
3067. "geom".Filter(geometry::STGeomFromText('POLYGON ((-100989.41629392917
6052208.320800154, -100989.41629392917 8361536.260998247, 1004823.3858394071
8361536.260998247, 1004823.3858394071 6052208.320800154, -100989.41629392917
6052208.320800154))', 2)
This query will always return zero rows, if I put the 3067 as an srid it
will return rows.

I have created a layer with SQL view against SQL Server 2008 R2. After
refreshing the attributes geoserver will set the 2 as srid by default. I
have corrected this one to use 3067. That's the only place where I have seen
this number 2 related to this issue.

The layer itself has correct srids by default.

Does anyone know whats wrong? I'm testing this with the latest 2.5 RC1
version of Geoserver.

Br, Tomi

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-puts-wrong-srid-to-the-spatial-filter-query-tp5107048.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Tomi,
Sounds like a bug. I suspect the “2” is supposed to be referencing a variable (at least, that’s how it looks in the logs).
Unless someone who actually knows stuff comments, I’d suggest opening it up as a ticket on Jira.

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain sensitive or protectively marked material up to RESTRICTED and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

On 3 March 2014 08:45, TNU <tomi.nurmiainen@anonymised.com> wrote:

Hi all,

I’m having an issue but can’t figure out why Geoserver is causing this srid
problem:

Geoserver will always put number 2 as an srid to the Filter, srid should be
3067. “geom”.Filter(geometry::STGeomFromText(‘POLYGON ((-100989.41629392917
6052208.320800154, -100989.41629392917 8361536.260998247, 1004823.3858394071
8361536.260998247, 1004823.3858394071 6052208.320800154, -100989.41629392917
6052208.320800154))’, 2)
This query will always return zero rows, if I put the 3067 as an srid it
will return rows.

I have created a layer with SQL view against SQL Server 2008 R2. After
refreshing the attributes geoserver will set the 2 as srid by default. I
have corrected this one to use 3067. That’s the only place where I have seen
this number 2 related to this issue.

The layer itself has correct srids by default.

Does anyone know whats wrong? I’m testing this with the latest 2.5 RC1
version of Geoserver.

Br, Tomi


View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-puts-wrong-srid-to-the-spatial-filter-query-tp5107048.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

On Mon, Mar 3, 2014 at 9:45 AM, TNU <tomi.nurmiainen@anonymised.com> wrote:

Hi all,

I'm having an issue but can't figure out why Geoserver is causing this srid
problem:

Geoserver will always put number 2 as an srid to the Filter, srid should be
3067. "geom".Filter(geometry::STGeomFromText('POLYGON ((-100989.41629392917
6052208.320800154, -100989.41629392917 8361536.260998247,
1004823.3858394071
8361536.260998247, 1004823.3858394071 6052208.320800154,
-100989.41629392917
6052208.320800154))', 2)
This query will always return zero rows, if I put the 3067 as an srid it
will return rows.

I have created a layer with SQL view against SQL Server 2008 R2. After
refreshing the attributes geoserver will set the 2 as srid by default. I
have corrected this one to use 3067. That's the only place where I have
seen
this number 2 related to this issue.

Two possibilities:
* you have geometries in that table with 2 as their srid
* you setup the geometry metadata table, and put 2 as the srid for that view

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------

Hi Andrea,

Query "select distinct geom.STSrid from mytable" will return only one row ->
srid 3067 so thats not the problem.

What do you mean by geometry metadata table? I don't have such table in SQL
Server and I cannot see any query which could possibly try to fetch srid
from the db. I have checked this with the sql server profiler / trace logs.

Br, Tomi

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-puts-wrong-srid-to-the-spatial-filter-query-tp5107048p5107172.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

It seems that this is a bug in Geoserver 2.5, because this will work with
2.4.4 version.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Geoserver-puts-wrong-srid-to-the-spatial-filter-query-tp5107048p5107322.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Mon, Mar 3, 2014 at 6:17 PM, TNU <tomi.nurmiainen@anonymised.com> wrote:

Hi Andrea,

Query "select distinct geom.STSrid from mytable" will return only one row
->
srid 3067 so thats not the problem.

Ok

What do you mean by geometry metadata table? I don't have such table in SQL
Server and I cannot see any query which could possibly try to fetch srid
from the db. I have checked this with the sql server profiler / trace logs.

http://docs.geoserver.org/stable/en/user/data/database/sqlserver.html#using-the-geometry-metadata-table

If this is not the case either then... I don't know. This would need
investigation.
By the way, I've recently run the full sql server test suite back in
GeoTools and got no issues
there, so this would be something new and not covered by the existing tests.

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------