mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Update spatialite.rst (#413)
a line of sql added to create the idx_<table_name> in the python recipe
This commit is contained in:
parent
2855667908
commit
9e8c36793b
1 changed files with 2 additions and 0 deletions
|
|
@ -68,6 +68,8 @@ Here's a recipe for taking a table with existing latitude and longitude columns,
|
|||
UPDATE events SET
|
||||
point_geom = GeomFromText('POINT('||"longitude"||' '||"latitude"||')',4326);
|
||||
''')
|
||||
# Now add a spatial index to that column
|
||||
conn.execute('select CreateSpatialIndex("museums", "point_geom");')
|
||||
# If you don't commit your changes will not be persisted:
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue