[postgis-devel] Bad proj4text strings in spatial_ref_sys?

Paul Ramsey pramsey at refractions.net
Sat Nov 4 12:13:46 PST 2006


These seem to be projections for which proj4 does not have a math  
transform available to handle them.  It looks like the script that  
generates the file makes the entries but omits the bit that cannot be  
handled by proj4, like the PROJECTION 
["Transverse_Mercator_South_Orientated"].

P

On 4-Nov-06, at 11:14 AM, Michael Fuhr wrote:

> I wrote a function to look for unusable SRIDs and it found 29 in
> the latest spatial_ref_sys.  Below are the function and output --
> am I doing something wrong or are these proj4text strings incorrect
> because they're missing a +proj= parameter?
>
> CREATE FUNCTION srid_test(OUT bad_srid integer, OUT error text)
> RETURNS SETOF record
> AS $$
> DECLARE
>     geom  geometry := GeomFromEWKT('SRID=4326;POINT(-100 40)');
>     rec   record;
> BEGIN
>     FOR rec IN SELECT srid FROM spatial_ref_sys LOOP
>         BEGIN
>             PERFORM transform(geom, rec.srid);
>         EXCEPTION
>           WHEN others THEN
>             bad_srid := rec.srid;
>             error := SQLERRM;
>             RETURN NEXT;
>         END;
>     END LOOP;
> END;
> $$ LANGUAGE plpgsql STABLE;
>
> SELECT * FROM srid_test() ORDER BY bad_srid;
>  bad_srid  
> |                                                              error
> ---------- 
> +--------------------------------------------------------------------- 
> ------------------------------------------------------------
>      2046 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2047 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2048 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2049 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2050 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2051 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2052 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2053 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2054 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>      2055 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ':  
> projection not named
>     22275 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22277 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22279 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22281 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22283 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22285 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22287 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22289 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22291 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22293 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.145 +b=6356514.966398753 +units=m +no_defs ':  
> projection not named
>     22300 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+a=6378249.2 +b=6356515 +pm=paris +units=km +no_defs ': projection  
> not named
>     29371 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29373 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29375 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29377 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29379 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29381 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29383 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
>     29385 | AddToPROJ4SRSCache: couldn't parse proj4 string:  
> '+ellps=bess_nam +to_meter=1.0000135965 +no_defs ': projection not  
> named
> (29 rows)
>
> -- 
> Michael Fuhr
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel




More information about the postgis-devel mailing list