[gdal-dev] PostgreSQL

Ivan Price Ivan.Price at noveltis.fr
Wed Sep 28 11:29:48 EDT 2011


ah ok. well i reckon if the data's a bit unpredictable its gonna be better to write something that steps through the possible gotchyas.. once its in place you'l be glad for it.. and it'l likely be quicker than code fixes in gdal. good luck

-i


-----Message d'origine-----
De : Andy Colson [mailto:andy at squeakycode.net] 
Envoyé : Wednesday, 28 September 2011 5:23 PM
À : Ivan Price
Cc : gdal-dev at lists.osgeo.org
Objet : Re: [gdal-dev] PostgreSQL

Not simply.  I am receiving data from many different places, some places send nice clean data, other's, not so much (all in different projections which is why I'm trying to find a common ground).  I have hundreds of shapefiles, with many times that of columns, any one of which may have nulls in it.

I could write something but I was hoping I could just get ogr2ogr fixed so my life would be simpler.  (I have other things at work I need to be spending my time on, ya know?)

-Andy

On 9/28/2011 10:13 AM, Ivan Price wrote:
> and you don't want to set the nulls to blank text before uploading ? (you could set them back once they'r up there, as well as perform the reprojection). i've never tried to use nulls in shapes before. can sqllite be used as an intermediatry instead ?
>
> -i
>
>
> -----Message d'origine-----
> De : Andy Colson [mailto:andy at squeakycode.net] Envoyé : Wednesday, 28 
> September 2011 5:09 PM À : Ivan Price Cc : gdal-dev at lists.osgeo.org 
> Objet : Re: [gdal-dev] PostgreSQL
>
> They use a slightly older version of shapelib that doesnt quite work with null's.  If I ogr2ogr shapefile ->  shapefile (to get it in the projection I want), then shp2pgsql will fail with fields that are null.
>
> Which, I could to ask them to update, yes.  It was a 50/50.  Ask gdal or ask postgis.
>
> -Andy
>
> On 9/28/2011 9:53 AM, Ivan Price wrote:
>> is there a reason you don't want to use shp2pgsql ?
>>
>> not sure if its better for everything but i've used it on occasion 
>> when i had a prob in ogr2ogr
>>
>> -i
>>
>>
>>
>> -----Message d'origine-----
>> De : gdal-dev-bounces at lists.osgeo.org 
>> [mailto:gdal-dev-bounces at lists.osgeo.org] De la part de Andy Colson 
>> Envoyé : Wednesday, 28 September 2011 4:50 PM À :
>> gdal-dev at lists.osgeo.org Objet : Re: [gdal-dev] PostgreSQL
>>
>> Sorry to keep pestering.  Is there a better place I should be seeking help?  Would a $bounty$ help?
>>
>> -Andy
>>
>> On 9/22/2011 10:48 AM, Andy Colson wrote:
>>> Hi List,
>>>
>>> I'm using ogr2ogr to convert (and reproject) data from shapefile to 
>>> PG, if I use insert statements the null dates are not a problem, but 
>>> if I set PG_USE_COPY=YES, then I get errors:
>>>
>>> ERROR 1: COPY statement failed.
>>> ERROR: date/time field value out of range: "0000/00/00"
>>> CONTEXT: COPY parcelannov2, line 18, column recorded: "0000/00/00"
>>>
>>> Inserts are really slow, so I'd love to use copy instead.
>>>
>>> On another layer, regardless of insert/copy, I'm getting:
>>>
>>> ERROR: numeric field overflow
>>> DETAIL: A field with precision 19, scale 11 must round to an 
>>> absolute value less than 10^8.
>>> CONTEXT: COPY poltwppoly, line 1, column shape_area:
>>> "1005965403.24000000954"
>>>
>>> I'm using: GDAL 1.9dev, released 2011/01/18
>>>
>>> I can make the shapefiles available if it would be of help. Is there 
>>> anything else I can do/try/offer?
>>>
>>> Thanks,
>>>
>>> -Andy
>>> _______________________________________________
>>> gdal-dev mailing list
>>> gdal-dev at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list