Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
up vote 3 down vote accepted

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.

share|improve this answer
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

You may want to ask this on the geoserver mailing list -

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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