[postgis] Adding PostGIS data to a table.

Paul Ramsey pramsey at refractions.net
Sat Jul 21 15:43:24 PDT 2001


ted at php.net wrote:
> 
> I have latitude, longitude, and (sometimes) altitude information in my
> database.  How do I convert/add these data as a geometry column?

Converting them in situ might actually be a little tricky, as we do not
have a constructure function for points which works on floats -- the
constructors are for OGC well-known text. Eg: 'POINT(23 23 23)' in your
case. Dumping the points to a text file and then reconstructing them as
POINT text would be one straightforward means. If you have your points
in ESRI Shape format, the shape->postgis data loader is now part of the
0.5 code bundle. 

> The intended use is to compute distances between points, or the number
> of places with in a certain distance of another point.
> I'd be adding them as a POINT.
> Is PostGIS the proper tool?

As your quantity of data grows, you'll find that the PostGIS spatial
indexing massively outperforms the alternatives. If you have small data
volumes, maybe not. The point_inside_circle function requested by Doug
Nebert and included in 0.5 handles one of your requirements. The
distance function is not currectly implemented (because proper
implementation is so hard for things like polygons etc). However, we
could implement a form of the distance function which does the right
thing for points and trivial simplifications for the harder cases.

Paul

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list