Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Kit
2009/8/23 Itzchak Raiskin itzchak.rais...@gmail.com: Hi I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with all heights point along this

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread John Machin
On 23/08/2009 3:08 PM, Itzchak Raiskin wrote: Hi I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with all heights point along this line.

Re: [sqlite] Huge numbers of savepoints.

2009-08-23 Thread Chris Dew
Apologies for multiple posting - these extra copies were sent from googlemail.com, whereas I has subscribed to the list as gmail.com. Chris. On Aug 19, 8:35 am, Chris Dew cms...@googlemail.com wrote: http://www.sqlite.org/lang_savepoint.html I'm looking for a datastore with the following

Re: [sqlite] Huge numbers of savepoints.

2009-08-23 Thread Chris Dew
Hi, thanks for your questions. 1. restarts or OS crashes should leave the data in a sane state - the last savepoint would be fine. 2. there's no requirement to revert to old savepoints set during a previous application run. 3. no need for more than one process to access the data, though letting

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Rich Shepard
On Sun, 23 Aug 2009, Itzchak Raiskin wrote: I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with all heights point along this line. I

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Derrell Lipman
On Sun, Aug 23, 2009 at 01:08, Itzchak Raiskin itzchak.rais...@gmail.comwrote: Hi I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with

Re: [sqlite] Huge numbers of savepoints.

2009-08-23 Thread Pavel Ivanov
With these requirements you can't implement it just on database level because it doesn't fit into the standard savepoint/transaction paradigm of databases. Only committed data and finished transactions will be available after OS crash or to other processes. After transaction is committed it cannot

Re: [sqlite] Huge numbers of savepoints.

2009-08-23 Thread Doug Currie
On Aug 23, 2009, at 6:46 AM, Chris Dew wrote: Note: this is not for production code, just an experiment in keeping a history of application 'state', allowing current state to be recalculated if an historic input is received 'late'. See

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread P Kishor
On Sun, Aug 23, 2009 at 12:08 AM, Itzchak Raiskinitzchak.rais...@gmail.com wrote: Hi I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Simon Slavin
On 23 Aug 2009, at 5:00pm, P Kishor wrote: WHERE a*x - y + c = 0 Here's the problem. This works only when the equation is exact. Which under normal circumstances means that all the numbers fit neatly with some imaginary integer formula. This isn't how real life works, especially when

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Stephen Woodbridge
Itzchak Raiskin wrote: Hi I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with all heights point along this line. I can, of course

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread P Kishor
On Sun, Aug 23, 2009 at 11:11 AM, Simon Slavinslav...@hearsay.demon.co.uk wrote: On 23 Aug 2009, at 5:00pm, P Kishor wrote: WHERE a*x - y + c = 0 Here's the problem.  This works only when the equation is exact. Indeed. We already laid out those presumptions. One, your height coverage has to

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread P Kishor
On Sun, Aug 23, 2009 at 11:34 AM, P Kishorpunk.k...@gmail.com wrote: On Sun, Aug 23, 2009 at 11:11 AM, Simon Slavinslav...@hearsay.demon.co.uk wrote: On 23 Aug 2009, at 5:00pm, P Kishor wrote: WHERE a*x - y + c = 0 Here's the problem.  This works only when the equation is exact. Indeed.

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread P Kishor
On Sun, Aug 23, 2009 at 12:08 AM, Itzchak Raiskinitzchak.rais...@gmail.com wrote: Hi I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Kit
2009/8/23 P Kishor punk.k...@gmail.com: If a line is expressed by (y = ax + c), you need to find all x,y that will satisfy that equation. So, SELECT x, y, z FROM terrain WHERE a*x - y + c = 0 General equation of line is a*x + b*y + c = 0. If you delete parameter b, you will have a problem

Re: [sqlite] can sqlite result be sorted by using prepare-step API

2009-08-23 Thread nick huang
hi all, I am a kind of new to Sqlite and just wonder if the query result row could be sorted by using Sqlite_prepare followed by Sqlite_Step. For example, query statement is something like select * from sometable order by somefield; and we call prepare followed by step. And are all results

Re: [sqlite] can sqlite result be sorted by using prepare-step API

2009-08-23 Thread Igor Tandetnik
nick huang wrote: For example, query statement is something like select * from sometable order by somefield; and we call prepare followed by step. And are all results returned from step in order of somefield? Of course. What would be the point of specifying order by somefield otherwise? As

[sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Tito Ciuro
Hello, Is there a way to optimize this type of queries? (column Value is indexed): SELECT Value FROM MyValues WHERE Value LIKE '%crashed.' I've seen the document where 'begins with' queries can be optimized using = and (end of the '4.0 The LIKE optimization' section):

Re: [sqlite] Using SQLite for GIS Application

2009-08-23 Thread Jean-Christophe Deschamps
I want to use SQLite in a GIS application where I create a database containing terrain data (coordinates, height). I would like to query this database with start and end points of a line and get a vector with all heights point along this line. I can, of course create a query for each point along

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Tito Ciuro
Hi Simon, But that would introduce the overhead of doubling the space required for every string + an additional column index. If the schema contains more columns where this type of query needs to take place, it seems to me that this would not be a good solution. Thanks for your help, --

Re: [sqlite] can sqlite result be sorted by using prepare-step API

2009-08-23 Thread Jay A. Kreibich
On Mon, Aug 24, 2009 at 01:55:41AM +, nick huang scratched on the wall: I am a kind of new to Sqlite and just wonder if the query result row could be sorted by using Sqlite_prepare followed by Sqlite_Step. Prepare/step is the only way to get data out of the database, so yes. For

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Simon Slavin
On 24 Aug 2009, at 3:44am, Tito Ciuro wrote: Is there a way to optimize this type of queries? (column Value is indexed): SELECT Value FROM MyValues WHERE Value LIKE '%crashed.' I've seen the document where 'begins with' queries can be optimized using = and (end of the '4.0 The LIKE

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Simon Slavin
On 24 Aug 2009, at 4:22am, Tito Ciuro wrote: But that would introduce the overhead of doubling the space required for every string + an additional column index. One of the options I mentioned was to store the reversed string and not the original. If you need to reconstruct the original

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Tito Ciuro
Hi Simon, On Aug 23, 2009, at 8:52 PM, Simon Slavin wrote: On 24 Aug 2009, at 4:22am, Tito Ciuro wrote: But that would introduce the overhead of doubling the space required for every string + an additional column index. One of the options I mentioned was to store the reversed string and

Re: [sqlite] Optimizing 'ends with' queries

2009-08-23 Thread Simon Slavin
On 24 Aug 2009, at 5:05am, Tito Ciuro wrote: What I meant is that if a table contains several columns, some or all of which need to be searched using 'ends with', then replicating the columns (by reversing the string) and keeping extra indices could potentially affect performance (obviously,