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 a sqlite database with a table that has a column for longitude and one for latitude. Is there a way to make this data base 'spatial'?

share|improve this question
up vote 15 down vote accepted

I've described the process of installing and spatially enabling an sqlite db here: SpatiaLite Quick Start. Basically, you need to get init_spatialite-2.3.sql and run it on your db.

You can then create point geometries using this function:

MakePoint( x Double precision , y Double precision , [ , SRID Integer] ) : Geometry
share|improve this answer
thanks, that worked well in combination with Gene's suggestions. – rengis Jan 16 '11 at 15:41

first, you need to enable spatialite in your sqlite database

sqlite> .load ',dll or dylib'   


SELECT load_extension(,dll ou dylib)


After that you need to initialize your database with init_spatialite-2.3.sql

sqlite> .read '~/init_spatialite-2.3.sql'
share|improve this answer
Note that the init_spatialite-2.3.sql step is not applicable for spatialite 3.0 or later. – BradHards Aug 11 '12 at 4:12

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.