R: [postgis-users] precision of GeomFromTex, Transform and text functions

P.Rizzi Ag.Mobilità Ambiente paolo.rizzi at ama-mi.it
Tue Sep 4 02:34:43 PDT 2007


I forget to mention the fact that inside the PostGIS spatial_ref_sys
table, TOWGS parameters are missing for EPSG:26591 and for 3003 too.
So any transform will not be precise in any case.
To add parameters for EPSG:3003, you can use the following SQL
in any DB that you need to.

Bye
Paolo Rizzi


---
--- To add TOWGS parameters, if needed, to:
---
--- EPSG 3003 : Monte Mario / Italy zone 1
---
--- If parameters are already present, no change will take place.
---
UPDATE "spatial_ref_sys" SET
"srtext"='PROJCS["Monte Mario / Italy zone 1",GEOGCS["Monte Mario",DATUM["Monte_Mario",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68],AUTHORITY["EPSG","6265"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4265"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",1500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","3003"]]'
WHERE "srid"=3003 AND "auth_name"='EPSG' AND "srtext" NOT LIKE '%TOWGS%';

UPDATE "spatial_ref_sys" SET
"proj4text"='+proj=tmerc +lat_0=0 +lon_0=9 +k=0.999600 +x_0=1500000 +y_0=0 +ellps=intl +units=m +no_defs +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68'
WHERE "srid"=3003 AND "auth_name"='EPSG' AND "proj4text" NOT LIKE '%towgs%';




> -----Messaggio originale-----
> Da: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net]Per conto di
> P.Rizzi Ag.Mobilità Ambiente
> Inviato: martedì 4 settembre 2007 11.25
> A: PostGIS Users Discussion
> Oggetto: R: [postgis-users] precision of 
> GeomFromTex,Transform and text
> functions
> 
> 
> Probably it does not matter to you in this case,
> but EPSG:26591 has been deprecated in favour of EPSG:3003.
> There is an error (can't remember what) in 26591.
> 
> Bye
> Paolo Rizzi
> 
> 
> > -----Messaggio originale-----
> > Da: postgis-users-bounces at postgis.refractions.net
> > [mailto:postgis-users-bounces at postgis.refractions.net]Per conto di
> > Ludovico Bianchini
> > Inviato: lunedì 3 settembre 2007 21.39
> > A: postgis-users at postgis.refractions.net
> > Oggetto: [postgis-users] precision of GeomFromTex,Transform and text
> > functions
> > 
> > 
> > Hi all,
> > 
> > I'm using this postgis function:
> > - GeomFromText(text, int4) to create a geometry value
> > in 4326 spatial_ref_sys
> > - Transform(geometry, int4) to convert a geometry from
> > 4326 to 26591 when I'm inserting a record and to
> > convert 26591 to 4326 when I'm selecting records
> > - text(geometry) to convert the geometry column in a
> > human-readable string
> > 
> > The problem is that the operations are not precise:
> > the value I obtain via text(transorm(geom_column,
> > 4326)) is different from what I inserted via 
> > Transform(GeomFromText('POINT(' || $10 || ')', 4326),
> > 26591).
> > 
> > Here an example (lon-lat values separated by a space):
> > Insert:37.13953463591601 45.66405322544534
> > Select:37.1321614399253 45.6647733181425
> > 
> > Insert:37.1321614399253 45.6647733181425
> > Read:37.1248077366115 45.6654912656918
> > 
> > Insert:37.1248077366115 45.6654912656918
> > Read:37.1174734269995 45.6662070796171
> > 
> > Is this a 'normal' behaviour?
> > Am I omitting anything?
> > 
> > Thanks in advance for any help!!
> > 
> > Bye,
> > Ludovico 
> > 
> > 
> >       ___________________________________ 
> > L'email della prossima generazione? Puoi averla con la nuova 
> > Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > 
> _______________________________________________
> 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