How to insert shapefiles into a MySQL database?
I am trying to f开发者_如何学运维ind this shp2mysql
tool. But all I found was a PHP implementation. There is any other version available in the internet?
I found a solution for download. (Windows version)
The readme says it needs Cygwin, but I just executed it and it worked.
I'm not sure you would want to insert files into a database, but if you had to, I don't see why you can't use MySQL's BINARY or BLOB data type (I can't recall if a .shp file is binary or text). Just read in the file using [insert your favorite language] and construct the appropriate MySQL query statement to add it to the database - it's pretty easy, almost trivial.
A better solution would be to store the file in your file system and record a path to it in your database, allowing you to open the file and read it when needed.
精彩评论