No knowledge of spatialite but here are some suggestions for questions 2 and 3
2) by centre you probably mean the barycenter/centre of gravity/average - which would be the point having the x as mean of the x values of the points and the y as mean of the y values of points. This would hold if you use lat - longs and there is no problem with curvature if you are working on India related data (the only tricky points would be around the polar regions). Another measure of a "centre" could be the barycenter of the points that lie on the convex hull of the set of points you have. 3) point(s) nearest to a set of points can be implemented based on the amount of data and performance required - for a large set of data the most efficient method would be to have the points in a k-d-tree structure but for a small set you could identify candidate points within a limited bounding rectangle around your search point and then search with actual distances to the reduced set of points in the box. You can search within the candidate points within the bounding rect rapidly if you have the lat-longs sorted/indexed but the computations of distance dx*dx+dy*dy (can skip the square root since you only need to find the smallest values) will be a bit of a brute force method but could still be within performance requirements for interactions with small data sets. best wishes Shyamal Shyamal Lakshminarayanan http://muscicapa.blogspot.com http://en.wikipedia.org/wiki/User:Shyamal GIS: Need help <http://groups.google.com/group/datameet/t/7658395aff69fbc9> > > Thejesh GN <[email protected]> Nov 03 12:28AM +0530 > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Hello All, > I am working on the PostBox App. Actual end user application is online > now [ http://openbangalore.org/postbox/ ]. It gets data from Instagram. > Instagram gives me lat, long which are stored as floats in an sqlite DB > [https://bitbucket.org/thejeshgn/postbox/src/tip/db]. Now I haven't > used > SQLite for GIS things in the past. So here are my questions. > > 1. How easy is spatialite and can it work with PHP? I will try n avoid > using it as much as possible. > 2. How to get center point given a set of points? > 3. How to get nearest points give a point? > > Q2 and 3 become difficult if I am not using spatialite. Are there > simple > solutions using just sqlite and php? > > Let me know. > > Thej > > - -- > Thejesh GN > http://thejeshgn.com > > > -- For more details about this list http://datameet.org/discussions/ --- You received this message because you are subscribed to the Google Groups "datameet" group. To unsubscribe from this group, send email to [email protected].
