ogr2ogr GeoJSON to MariaDB/MySQL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ogr2ogr GeoJSON to MariaDB/MySQL

Jonathan Beliën
Hi everyone,

I have a small issue when converting a GeoJSON file to a MariaDB table.
The datatype of every column is set to "TEXT" in my MariaDB table. I tried to find a solution to set the correct datatype but without any success.

The only ""solution"" I found is to convert from GeoJSON to CSV ;
Then to convert from CSV to MySQL using "AUTODETECT_TYPE" and "AUTODETECT_WIDTH" open options.
It works but I suppose there is a smarter and cleaner solution.

Any idea ?

Thanks !
Have a great day.

Jonathan

_______________________________________________
Belgium mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/belgium
Reply | Threaded
Open this post in threaded view
|

Re: ogr2ogr GeoJSON to MariaDB/MySQL

Moritz Lennert
Hi Jonathan,

A general remark: we are not that many on this list, yet, and I think
you will probably have more chance getting a response on the relevant
project mailing lists than here...

On 25/04/16 13:14, Jonathan Beliën wrote:

> Hi everyone,
>
> I have a small issue when converting a GeoJSON file to a MariaDB table.
> The datatype of every column is set to "TEXT" in my MariaDB table. I
> tried to find a solution to set the correct datatype but without any
> success.
>
> The only ""solution"" I found is to convert from GeoJSON to CSV ;
> Then to convert from CSV to MySQL using "AUTODETECT_TYPE" and
> "AUTODETECT_WIDTH" open options.
> It works but I suppose there is a smarter and cleaner solution.

What does ogrinfo give you on the GeoJSON file ?

Moritz
_______________________________________________
Belgium mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/belgium