[Qgis-user] QGIS and MySQL

Etienne Tourigny etourigny.dev at gmail.com
Wed Oct 17 09:34:14 PDT 2012


simple question - why not use postgis?  Or is it impossible to convert
your data to postgres?

On Wed, Oct 17, 2012 at 12:36 PM, Sebastiano Lora
<sebastiano.lora at gmail.com> wrote:
> Hallo everybody,
> I have a some difficulties with QGIS and a MySQL database. I try to make it
> not so long, and work enviroment is WIN 7 64b; QGIS dev, MySQL 5.1.63
>
> In my project (a GIS for an archaeological excavation) lot of data are
> stored in a MySQL database which was made before I joined it. Originally no
> geometry field was inserted in the MySQL tables and thereafter I have many
> features without stored geometry. My approach at the beginning was to create
> shapefiles (point and polygons mainly) of the features which I needed and to
> join them with the MySQL table that I imported into QGIS. Then now I have
>
> shapefiles
> MySQL tables
>
> Both have an ID which allow to join them together.
>
> This worked just fine, but now I want to get rid of this double approach and
> use the MySQL database as a complete geodatabase (I know I should transfer
> it in postGRE but it is not a short-term possibility). The reasons are: a) I
> want to create a webgis of the project; b) since we are now more persons who
> are working with  GIS I would like that more than one user could work on the
> same shapefile at the same time; c) it is more "elegant".
>
> Now my question is how I merge the spatial information from the shapefiles
> into the MySQL tables?
>
> for the point shapefiles it was not a big problem since I had the lat long
> coordinates stored in the db, I just create a query which writes them in the
> POINT field.
>
> for the polygons is not so easy.
>
> I tried to install the QGIS plugin "export to MySQL" with the idea:
> - export the shapefile into MySQL
> - update the table with the geometry field
>
> but the plug-in does not work since a module is missing (MySQLdb). There is
> already a lot of documentation on it which I read. An installer for is also
> available BUT it is not working with my OSGEO installation. It seems that it
> is installing the module in a second installation of php that I have and not
> in for the php installed by the OSGEO, which is the one that QGIS is
> calling. Compiling it by myself is out of my skills.
> (of course I could export my shapefile in .csv, import it in MySQL and than
> run the query BUT I was looking for something simpler and that I could use
> often)
>
> Finally:
> somebody who had success in installing the export to Mysql plug-in in one
> OSGEO installation could tell me what I should do?
> Anybody has some suggestion how to solve my problem?
>
> Thanks in advance
> Sebastiano
>
>
>
>
>
> --
> Sebastiano Lora Dr phil
> Deutsches Archäologische Institut Orient-Abteilung
> Podbielskiallee 69-71
> 14195 Berlin, Germany
> Tel. +49-30-187711-265
> Fax +49-30-187711-189
> cell 00491627638459
> sebastiano.lora at gmail.com
> skype: sebastiano.lora
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>



More information about the Qgis-user mailing list