SQLite Forum


3 forum posts by user rwillett

16:45 Reply: Minor documentation fixes (artifact: c437e3dff7 user: rwillett)

Pedant alert, pedant alert ....

Somewhat surprisingly, at least to me, grammar pedants on both sides of the Atlantic (I'm on the eastern side) agree that it should now be "a historic".

However English is an evolving language and up to the 1960's "an historic" e.g. "an historic event" was the norm, however in the last 50 years, it has become "a historic event".

Local pronunciation also comes in, as the aitch in historic can silent or elided, e.g. East and South East London often drops their 'aitches' as does parts of north England.

I am trying to find The Times or The Guardian's guide to grammar as they are usually authoritative and up to date.

I have to say as 1) Being British 2) Living in SE London for 30 years 3) Now living in North Yorkshire that I had to think about this and work out what I would say.

I recognise that in the grand scale of Covid-19, discussions about this are probably not that important, but it's interesting at least to me, how language usage changes.

Now can we discuss colour, aluminium, aesthetic, calibre, dialled, kilogramme, prologue and a few other please :)

Thanks and have a good weekend,


10:40 Reply: Querying first of each month (artifact: c84d629997 user: rwillett)

I agree 100% with this post. If Igor posts, I always read the response as he posts rarely. I often then go back and read the whole thread. A few other people have my attention as well.

It's kinda ironic that the previoys post is made from somebody called 'anonymous' though :)


14:25 Reply: Country-coding from Lat/Long, using GeoPoly and/or R-Tree (artifact: 939084cade user: rwillett)

I implemented something similar for our traffic notification app. We were working on complex shapes which have convex and concave sides, do not intersect and do not have holes in them.

We did it using a combination of techniques.

  1. For each area we create an outer rectangle held in an R-tree to allow a quick check to see if any point matches. This could have overlapping rectangles.

  2. For each group of rectangles matched, we then went and checked against an outer hull, this is the area that is a polygon but has no concave faces.

  3. If we then got a match here we then checked against it being inside the proper polygon as described by Gunter earlier.

We did try to go straight to point 3, but we found that the two earlier checks made things faster as most points are NOT in an area of interest. Your use case would probably be best started at point 2 if you know that the point is always in a country and not over a sea.

Defining the boundaries of a country could be rather complex as borders often follow weird lines as rivers or mountain ranges or roads. Also countries borders do change. How low a level of detail do you want? If you are relying on GPS then the accuracy is variable, sometimes 100m, sometimes 5m.

We could not implement all of this in SQLite so used Perl (yes I'm old school) and JavaScript on the client.