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

I have loaded a shapefile into a SpatiaLite Database using the spatialite-gui. In which table is the Spatial reference ID or EPSG code (of the stored data)stored in SpatiaLite?

share|improve this question
up vote 7 down vote accepted

The table that holds the description is spatial_ref_sys. The id is contained in the geometry binary blob.

share|improve this answer
Maybe I am doing something wrong here, but when I run "select aswkt(geometry) from Buildings where Id =3;" I do not get the epsg code in the output. Does that mean that the spatial reference for my Buildings Table is not saved? – Devdatta Tengshe Jan 4 '13 at 6:40
No, it means that the WKT format ( doesn't specify the SRID. Try AsEwkt() if you'd like the SRID included. You can also just ask for SRID(geometry) if you just want the id. Note that there is a chance that your SRID is not an EPSG SRID, but its unlikely unless you used something exotic on input. – BradHards Jan 4 '13 at 7:08
Basically I wanted to project Geometries to a UTM projection if they were not in UTM already, so as to get distances in Meters. I see that SRID(Geometry) also works when you use it in a query. Thanks. – Devdatta Tengshe Jan 4 '13 at 7:28
That should be no problem (as long as you know which UTM zone you want). will give you the Transform() function. – BradHards Jan 4 '13 at 7:35
@DevdattaTengshe: does this answer the question / solve your problem for now? – BradHards Jan 6 '13 at 21:57

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.