<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=610005117-28042009><FONT face=Arial color=#0000ff size=2>You 
could also write a fairly simple python script using the gdal/ogr python 
modules.</FONT></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> 
  mapserver-users-bounces@lists.osgeo.org 
  [mailto:mapserver-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Mohammed 
  Rashad<BR><B>Sent:</B> Tuesday, April 28, 2009 12:17 PM<BR><B>To:</B> 
  mapserver-users@lists.osgeo.org<BR><B>Subject:</B> [mapserver-users] RE: 
  Finding Lat-Long from shp file<BR><BR></FONT></DIV>Hi,<BR><BR>Here is the way 
  you can find lat-long values from shp files. The method is ugly.<BR>I used 
  this method to select lat-long values from a shape file consisting of about 
  150 records. Using this method all lat-long values from a shapefile consisting 
  of place names of country can be selected and saved into files.<BR>I already 
  told method is dirty.<BR><BR>You can find using postgreSQL. first you should 
  install postgis-postgresql package.<BR>and follow instructions in postgis 
  manual. <BR>you want to import some files after installing postgis such as 
  lwpostgis.sql etc...<BR><BR>I think you added necessary attributes in shape 
  files such as name of place etc,..<BR><BR>create a database in postgresql with 
  postgis enabled (say db1)<BR>Now import .shp files into postgresql using 
  cmd:<BR><BR>you should have a database db1 with postgis support.<BR>shp2pgsql 
  /root/vect1.shp vect1 db1 &gt; /root/vect1.sql <BR><BR>now you got vect1.sql 
  file<BR><BR>import sql file into postgresql.<BR>psql -d db1 -f 
  /root/vect1.sql<BR><BR>Now logon to postgresql admin tool such as phppgadmin 
  or you can do these thing from postgresql interactive terminal.<BR><BR>In the 
  database db1 now you have another table name vect1.<BR>vect1 has some other 
  attributes such as gid,the_geom etc..&nbsp; other than attributes you have 
  entered.&nbsp;&nbsp; 'the_geom' is the geometry of shape file.<BR><BR>select 
  X(the_geom) from vect1; query executes to display longitude all entries in 
  shape files <BR><BR>and<BR><BR>select Y(the_geom) from vect1; query executes 
  to display latitude all entries in shape files<BR><BR><BR>this data can also 
  be inserted into table by inserting a new column for latitude and 
  longitude.<BR><BR>If you want table back to shp files using the 
  cmd:<BR>pgsql2shp -f vect1 -p 5432 db1 vect1<BR clear=all><BR>Or <BR><BR>You 
  can also export column&nbsp; latitude and longtiude into mysql also as you 
  wish<BR><BR><BR>-- <BR>Regards,<BR>Mohammed Rashad K.M<BR><A 
  href="http://keralainfo.web4all.in/" 
  target=_blank>http://keralainfo.web4all.in/</A><BR>+919605476742<BR></BLOCKQUOTE></BODY></HTML>