MapInfo and MySql Spatial

860 views
Skip to first unread message

Robert Juan

unread,
Aug 4, 2011, 5:53:39 AM8/4/11
to mapi...@googlegroups.com

Hi guys,

 

I was wondering if anyone has experience on Mapinfo working with the spatial extension from MySQL. I'm thinking in working with Postgis, but the fact is that we allready have MySQL with some non mapable information of the same project. Any suggestions?

 

Thanks in advance for your tips,

 

merry christmas.

 

Robert

JSC

unread,
Aug 18, 2011, 9:20:15 PM8/18/11
to mapi...@googlegroups.com
Pretty easy to set-up:
 
1. Download the mysql connector from the following site
 
 
2. Inside your database create the following table:
-- Table structure for table `mapinfo_mapcatalog`
--
CREATE TABLE IF NOT EXISTS `mapinfo_mapcatalog` (
  `SPATIALTYPE` float default NULL,
  `TABLENAME` char(32) default NULL,
  `OWNERNAME` char(32) default NULL,
  `SPATIALCOLUMN` char(32) default NULL,
  `DB_X_LL` float default NULL,
  `DB_Y_LL` float default NULL,
  `DB_X_UR` float default NULL,
  `DB_Y_UR` float default NULL,
  `COORDINATESYSTEM` char(254) default NULL,
  `SYMBOL` char(254) default NULL,
  `XCOLUMNNAME` char(32) default NULL,
  `YCOLUMNNAME` char(32) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mapinfo_mapcatalog`
 
 
3. Use similar syntax to reference with MySQL statement below in MapBasic
 
Register Table "<Your Table Name>" TYPE ODBC TABLE "Select * FROM <YOUR TABLE>" CONNECTION "DATABASE=<YOUR DATABASE>;DRIVER={MySQL ODBC 5.1 Driver};OPTION=0;PWD=<your password>;PORT=0;SERVER=<your server>;UID=<your mysql user>;" toolkit "ODBC" Versioned Off Workspace "" ParentWorkspace "" Into "C:\LOCATION FOR TABLE REFERENCE"
 
 
***REMEBER TO REPLACE <YOUR's> with actual minus the <> *******
 
4. Happy coding and remember that the SQL statements vary in MapBasic to the Mysql statements for example in MySQL ='4' is good but in MapBasic ="4" is correct.....
 
Good Luck,
-Jeff
Reply all
Reply to author
Forward
0 new messages