[postgis-users] invoking inverse transforms

Tony doppelganger at doppelganger.org
Sun Dec 21 18:39:56 PST 2003


So if I take an existing entry's proj text, add the +inv argument, and 
throw in a unique new SRID,
should that do it?

For example, the forward transform uses the following arguments:

+proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 
+lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m

I added +inv:

+proj=lcc +lat_1=41.71666666666667 +lat_2=42.68333333333333 +lat_0=41 
+lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m 
+inv

and inserted a custom spatial_ref_sys entry with a new SRID. I call the 
transform:

select transform(my_evil_geom, 666) from geotest1;

and get this back from postgres:

SRID=666;MULTIPOLYGON(((232250.000000001 903426.499999985,232259 
903417.499999987,232249.5 903409.999999986,232241.000000001 
903418.999999986,232250.000000001 903426.499999985)))

(which is the state plane meters data I started with.)

Am I supposed to alter the units or something?

On Sun, 21 Dec 2003 15:30:31 -0800, Dave Blasby <dblasby at refractions.net> 
wrote:

> Quoting Tony <doppelganger at doppelganger.org>:
>> Is there some way to do the equivalent of invproj?
>>
>> Do I need to build my own special spatial_ref_sys entry?
>
> yes - you need to add rows to the spatial_ref_sys table.  Make sure you 
> fill out the SRID and PROJ_TEXT columns.
>
> The actual transform is fairly easy:
>
> 1. make sure you have SRID entries in spatial_ref_sys for the lat/long 
> projection and your stateplane
> 2. make sure your geometries have the correct srid (ie. your stateplane)
> 3. do a query like:
> SELECT tranform(the_geom, <lat long srid>) FROM table;
>
> dave
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>






More information about the postgis-users mailing list