[gdal-dev] Re: Problem converting certain postgis tables to spatialite

Chaitanya kumar CH chaitanya.ch at gmail.com
Wed Sep 7 14:15:52 EDT 2011


Andreas,

Segfaulting is a serious issue. Can you tell the version of GDAL you used?

On Wed, Sep 7, 2011 at 8:35 PM, Andreas Neumann <a.neumann at carto.net> wrote:

> HI Jukka,
>
> Thank you for your thoughts. Yes, perhaps I should use update instead of
> append.
>
> I actually found out what the problem is:
>
> Tables or views that do not have an entry in public.geometry_columns (the
> postgis metadata table) cause the segmentation fault. Once the entry is
> there, it converts fine.
>
> Perhaps ogr2ogr could issue a warning or error message in this case instead
> of segfaulting. It would be nicer.
>
> Thanks again,
> Andreas
>
>
> On Wed, 7 Sep 2011 14:52:31 +0000 (UTC), Jukka Rahkonen wrote:
>
>> Andreas Neumann <a.neumann <at> carto.net> writes:
>>
>>
>>>  Hi,
>>>
>>>  I am converting several tables from Postgis to SpatiaLite using
>>>  ogr2ogr.
>>>
>>>  Here is my command:
>>>
>>>  -----------
>>>  ogr2ogr -append -lco LAUNDER=yes -lco SPATIAL_INDEX=yes -nln
>>>  av_grenzpunkte -f SQLite uster.sqlite PG:"dbname='mydb' host='myserver'
>>>  port='5432' user='username' password='pw' schemas=av_user
>>>  tables=grenzpunkte(the_geom)"
>>>  ----------
>>>
>>
>> Hi,
>>
>> I have used these options:
>>
>> -dsco SPATIALITE=yes
>> -lco SPATIAL_INDEX=no
>> and for polygon layers
>> -nlt MULTIPOLYGON (Spatialite do not want polygons and multipolygons
>> on the same
>> layer, so let them be all multipolygons). Same with mixed lines/multilines
>> if
>> you may have those.
>>
>> -update is needed when adding new layers. Are you adding to an existing
>> table
>> because you have -append?
>>
>> Ogr2ogr does not create totally valid Spatialite databases. Therefore
>> I skip the
>> SPATIAL_INDEX because conversion is faster without. After ogr2ogr
>> process I am
>> cleaning the resulting database by copying the tables into a fresh
>> Spatialite
>> database with OpenLite tool http://www.gaia-gis.it/**OpenLite/<http://www.gaia-gis.it/OpenLite/>
>>
>> -Jukka Rahkonen-
>>
>> ______________________________**_________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/**mailman/listinfo/gdal-dev<http://lists.osgeo.org/mailman/listinfo/gdal-dev>
>>
>
> --
> --
> Andreas Neumann
> Böschacherstrasse 10A
> 8624 Grüt (Gossau ZH)
> Switzerland
> ______________________________**_________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/gdal-dev<http://lists.osgeo.org/mailman/listinfo/gdal-dev>
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110907/a88e740e/attachment.html


More information about the gdal-dev mailing list