Changes between Version 1 and Version 2 of MySQLSpatial


Ignore:
Timestamp:
Jul 31, 2009, 11:22:19 AM (15 years ago)
Author:
mikehostetler
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MySQLSpatial

    v1 v2  
    1414 * The method of using OGR with a .ovf file didn't work for us, we were never able to find out why.
    1515
    16 === Mapfile Syntax ===
     16=== Step 1: Create your DSN ===
     17The first step necessary is to craft your OGR DSN.  Documentation on how to craft this is available here: http://trac.osgeo.org/mapserver/wiki/VirtualSpatialData
    1718
    18 Simply specifying the OGR DSN in the CONNECTION statement of your LAYER definition proved successful.
     19For MySQL Specifically, the DSN should be formatted as:
     20{{{
     21MYSQL:##DATABASE##,host=##HOST##,user=##USERNAME##,pass=##PASSWORD##,tables=##TABLE##,##TABLE##,##TABLE##
     22}}}
     23
     24=== Step 2: Test your DSN ===
     25After creating your DSN, test it using the utility `ogrinfo`.
     26
     27{{{
     28ogrinfo -ro -al MYSQL:##DATABASE##,host=##HOST##,user=##USERNAME##,pass=##PASSWORD##,tables=##TABLE## -sql 'SELECT geom FROM ##TABLE##'
     29}}}
     30
     31=== Step 3: Edit your mapfile ===
     32
     33After testing and verifying that OGR can connect and display your data in MySQL, you can drop your DSN and Data statement right into your mapfile.  Specify the '''CONNECTIONTYPE''' as '''OGR'''.
    1934
    2035{{{
     
    4055}}}
    4156
    42 === TABLE Schema and Data ===
     57
     58=== Reference: TABLE Schema and Data ===
    4359
    4460Here's the table structure that was used.