[postgis-devel] Reprojection issues

Kevin Neufeld kneufeld at refractions.net
Thu Jul 3 08:21:02 PDT 2008


I can run your query several times, transforming the point to your 
supplied 3785 srid, without error. (Pg8.3.3, PGIS 1.3.3, Proj4.4.9)

I'm not sure what to suggest, except remove and cleanup your Proj 
library and re-install.  Perhaps it's an issue with how the library is 
getting loaded by Postgres and some funny business with your dynamic linker.

-- Kevin

Mark Cave-Ayland wrote:
> Nico Mandery wrote:
>> Hello list,
>>
>> I got a problem reprojecting geometries from EPSG:3785 (the Google or 
>> Web Mercator projection) to WGS84 (EPSG:4236).
>> For example when I try to transform one point postgis gives me the 
>> following - correct - result:
>>
>> projects=# select 
>> astext(st_transform(GeomFromText('POINT(879650.162980923 
>> 6108535.16589579)',3785),4326));
>>                  astext
>> ------------------------------------------
>> POINT(7.90203186083991 48.0100993171653)
>> (1 row)
>>
>> When I try it again with exactly the same query, I get a wrong result 
>> and an error from libproj:
>>
>> projects=# select 
>> astext(st_transform(GeomFromText('POINT(879650.162980923 
>> 6108535.16589579)',3785),4326));
>> WARNING:  transform: -38 (failed to load NAD27-83 correction file)
>>                      astext
>> --------------------------------------------------
>> POINT(1.23892476139034e-06 7.52729195068025e-06)
>> (1 row)
>>
>> Every following query will also return wrong results, until I close 
>> the connection to the database. The first query after establishing a
>> new connection to postgresql returns a correct result again, every 
>> following raises the error again.
>> The NAD correction files exist. Transforming coordinates with cs2cs 
>> from libproj works without any problems.
>>
>> I tried it with Postgresql 8.2.4 and 8.3.3 and postgis 1.3.2 and 
>> 1.3.3. The proj4text in spatial_ref_sys for EPSG:3785 is
>> "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 
>> +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"
>>
>> Thanks a lot,
>> Nico
> 
> 
> Hi Nico,
> 
> I'm not sure about the +wktext part of your proj4text as I've never seen 
> that before - so maybe it is an invalid PROJ.4 string? What happens if 
> you try the transformation using the standard proj executable?
> 
> 
> ATB,
> 
> Mark.
> 



More information about the postgis-devel mailing list