[Gdal-dev] Beginners question. How to fetch longtitude, latitude coordinates

anakreonmejdi at yahoo.gr anakreonmejdi at yahoo.gr
Mon Oct 15 05:47:52 EDT 2007


Matthew Perry writes:
 > This page might be of some help,
 > 
 > http://mapserver.gis.umn.edu/docs/reference/vector_data/VirtualSpatialData
 > 
 > - matt
Thanks for your reply Matthew.

I managed to fetch data from mysql database.
The problem is how to configure the layer.

The sql statement fetches the name of the site, latitude (degree, min, sec),
longtitude (degree, min, sec).

In total, there are 7 columns fetched. I want to display the name of the site
on the map, and the coordinates taken from the remaining 6 columns.

The configuration of the layer so far (taken from varius examples on the web)
is:
LAYER
  NAME "sites"
  TYPE POINT
  STATUS ON
  CONNECTIONTYPE OGR
  CONNECTION "MYSQL:db,user=user,password="
  DATA "select site_name, c1.cord_deg as c1deg, c1.cord_min as c1min, c1.cord_sec as c1sec,
c2.cord_deg as c2deg, c2.cord_min as c2min, c2.cord_sec as c2sec
from site
inner join coordinate as c1 on c1.coordinate_id = site.coordinate_first
inner join coordinate as c2 on c2.coordinate_id = site.coordinate_second"

    LABELITEM site_name #may need to use table.name or just name depending on your OVF file.
    PROJECTION
      "init=epsg:4326"
    END
    CLASS
      SYMBOL 1
      SIZE 6
      COLOR 255 0 0
      LABEL
	SIZE MEDIUM
	TYPE BITMAP
	COLOR 0 0 0
      END
    END
END


This does not work.
The error message is:
Warning:  [MapServer Error]: msQueryByPoint(): No matching record(s) found.




More information about the Gdal-dev mailing list