[postgis-users] Moving geometry from MySQL to PostGIS

Stephen Woodbridge woodbri at swoodbridge.com
Tue Aug 30 07:47:37 PDT 2011


On 8/30/2011 10:10 AM, Mr. Puneet Kishor wrote:
>
> On Aug 30, 2011, at 8:58 AM, Charles Galpin wrote:
>
>>
>> On Aug 29, 2011, at 2:29 PM, Mr. Puneet Kishor wrote:
>>>
>>> the data themselves are routine points, lines and polygons (MySQL allows defining POINT, LINE, POLYGON, or the all-encompassing GEOMETRY). Other than that, there are the usual MySQL->Pg mismatches such as `mediumint` and `enum`. I tried
>>>
>>> `mysqldump --compatible=postgresql` but that doesn't go far enough. Hand editing of the export file seems to be required.
>>
>> How about generating insert statements compatible with postgresql, using wkt as the common format that you can then run on postgresql?
>
> Since this is a one-time job, I think I will open two db handles in Perl and query one and insert in the other. That will work. Yet, surprising that either a need for this is not as common as I thought it might be, or it is sufficiently variable to preclude a readymade tool to do the job.
>
> Thanks for the ideas,

Can you do this in ogr2ogr?



More information about the postgis-users mailing list