sql-servergisspatialgeographygeoserver

Geoserver not recognizing spatial column


I'm using Geoserver and SQL Server 2008.

I have a table which has a column of [geography] type. I'm able to see the table showing up in Geoserver (I have installed the extension for SQL server) but it recognizes the column as type byte[] and not geography.

Can somebody suggest me a solution to this problem.

As from a previous post I have tried removing and reattaching the DB in Geoserver multiple times. Also the SQL server is showing that data is of type geography and is mapping it correctly. It's just Geoserver that sees the data as byte[].

I'm using this sql statement to convert the lat long columns into geography.

UPDATE [TestData].[dbo].[ShowMap] SET [Geo] = geography::Point([Latitude], [Longitude], 4326) GO


Solution

  • So I found a solution to this problem. Geoserver can only recognize Geometry data type in SQL Server. When you have a column that is of data-type Geography, Geoserver will recognize it as a byte[].

    Geometry data-type works same way as geography.