[postgis-users] Convert from Lat/Long point to postGIS geometry

KhunSanAung khunsanaung.gis at gmail.com
Tue Feb 3 00:08:58 PST 2015


Hi Brent Wood,

Many thanks, it works.
UPDATE public.town SET geom = ST_SetSRID(ST_MakePoint(longitude, latitude),
4326);

I am using postGIS to store the data and using GeoServer for publishing the
data to maps.

I'm thinking to use the GeoExplorer (from OpenGeo Suite) for digitizing and
collecting the location information.
When using GeoExplorer, the geometry information is automatically stored to
the *geom* field of the table and the use have to fill all the attribute
again.

But I already have the full list in a postGIS table.
How can I make my application in such a way that user just need to select
from the list and digitizing the location only. No need to enter the
attribute again.

Many thanks for any  idea.

Best regards



On Tue, Feb 3, 2015 at 10:50 AM, Brent Wood <pcreso at pcreso.com> wrote:

> Hi.
>
> Try something like:
>
> update <table> set <geometry column> = ST_SetSRID(ST_MakePoint(Longitude,
> Latitude),4326);
>
> Essentially create a point geometry from your numeric values, with the
> ST_MakePoint() function, the inform Postgis it is a standard lat/long CS
> (EPSG:4326 - which you should have specified when you created the column),
> & update the table with these values for each row. Make sure you use your
> table & column names....
>
> What mapping/GIS program are you using?
>
> Cheers,
>
>   Brent Wood
>
>   ------------------------------
>  *From:* KhunSanAung <khunsanaung.gis at gmail.com>
> *To:* postgis-users at lists.osgeo.org
> *Sent:* Tuesday, February 3, 2015 5:11 PM
> *Subject:* [postgis-users] Convert from Lat/Long point to postGIS geometry
>
> Hi All,
>
> I have one table (Town info) in postgres without Geometry field.
> I have Latitude and Longitude information for those points data separately
> (collecting & filling).
>
> I created the postGIS extension and add the Geometry field in the above
> postgres table.
> Now, I'd like to add the location information into the postGIS geometry
> field so that I can immediately view those points on the map.
>
> How can I convert the Latitude/Longitude value into postGIS geometry value?
>
> Thank you very much in advance.
>
> --
> Have a nice day!
> --
> *Mr. Khun San Aung*
> * <http://geoportal.icimod.org/>*
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>


-- 
Have a nice day!
--

*Mr. Khun San Aung*
* <http://geoportal.icimod.org/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150203/7235718b/attachment.html>


More information about the postgis-users mailing list