4

When using a SQL database as the store, Geoserver requires that the spatial data are stored in a geometry, not geography column. Naturally, as we are dealing with geospatial features and not just Euclidean planar geometry, one would expect the opposite to be true.

Is there any reason for this? Am I missing something important about these two datatypes?

  • What DBMS are you using? – CaptDragon Apr 16 '12 at 13:02
  • I tried this with MS SQL 2008. But I believe that JDBC used by GeoServer is a quite universal interface, so I don't think this is related to a particular DB... or is it? – Imp Apr 16 '12 at 13:04
4

It is not clear as to what backend database you are using? Also need to know the version of GeoServer as well to give a definitive answer. For PostGIS geography is supported in recent versions of geoserver 2.1. If you are referring to SQL server then I do not believe geography support is implemented.

  • 1
    I am using Geoserver 2.1.2 and yes, the DB is MSSQL. If PostGis works fine, then it is probably a bug in the MSSQL plugin for Geoserver. – Imp Apr 16 '12 at 13:06
  • As of today, 7 years later, Geoserver still doesn't support Geography data type from Microsoft SQL Server?? gis.stackexchange.com/questions/330897/… – Giox Aug 4 at 22:03
1

You may want to ask this on the geoserver mailing list - http://geoserver.org/display/GEOS/Mailing+Lists

At least with PostGIS, a geography type is distinct from a geometry type. There's a little information here but basically (as you probably already know):

  • geography is for spherical
  • geometry is for cartesian

In the case of web-mapping in general, the defacto coordinate system has become Mercator/Web-mercator which is cartesian and therefore should be stored in geometry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.