[postgis-users] Using PostGIS for latitude & longitude
James David Smith
james.david.smith at gmail.com
Wed Dec 19 02:32:32 PST 2012
I would first start with making a proper 'geometry' column rather than
using your Lat and Long columns. You would do this with code like
SELECT AddGeometryColumn ('table_name','the_geom',27700,'POINT',2);
Notes about this:
'the_geom' is an arbitrary column name. Call it what you like.
27700 is the SRID of your data. If you are working with data in WGS84
then it would be replaced with the value 4326
'POINT' defines the type of geometry that is being stored. This could
be 'LINESTRING' or 'LINE' etc.
2 is the dimensions.
Once you have a geometry column, you might then populate it with data
from your latitude and longitude columns by doing this:
SET the_geom = st_makepoint("longitude", "latitude");
On 19 December 2012 09:51, nevillekb <nevillekb at gmail.com> wrote:
> I have a table in postgresql 9.2 that stores the latitude and longitude of
> locations as integer values.
> I intend to do something like when a user searches for a location, he also
> gets information on other locations that are within a 7 mile radius of that
> searched location.
> How do i use postGIS for this since i am new to it. Any idea.?
> View this message in context: http://postgis.17.n6.nabble.com/Using-PostGIS-for-latitude-longitude-tp5002097.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> postgis-users mailing list
> postgis-users at lists.osgeo.org
More information about the postgis-users