[Gfoss] Concetti di base, conversione 3003 -> 4326

Bud P. Bruegger bud a comune.grosseto.it
Ven 14 Mar 2008 11:00:20 CET


On Fri, 14 Mar 2008 09:57:36 +0100
Antonio Falciano <afalciano at yahoo.it> wrote:

> > Domanda su PostGIS, mi sono creato l'SRS 93003, in pratica un 3003 con
> > il campo proj4text modificato secondo la mail di Leonardo.
> > Ho appena finito l'inserimento dei dati (GeomFromText('XXXX', 93003)) in
> > una colonna che ha come SRSID di default il 4326, se adesso modifico
> > l'SRS 93003 con le tue correzioni, PostGIS mi mostra i cambiamenti al
> > volo?
> 
> Dovrebbe... non ho mai sperimentato le trasformazioni in PostGIS,
> poichč generalmente preferisco controllarle a livello client e non di
> DBMS, ma dato che i parametri sono quelli la trasformazione andrą bene
> nei limiti della sua accuratezza.
> Facci sapere se ottieni dei risultati accettabili ai tuoi fini.

Se fai una view con ST_Transform, e' buono di definire anche un indice:

<quote src=
"http://postgis.refractions.net/pipermail/postgis-users/2007-September/017197.html" 

PostGIS is pretty 
good in doing transforms on the fly, so using a view is a good 
approach.  Keep in mind that you may have to create a functional index 
on your multipoint geometry column if you want to use an index in
Albers. CREATE INDEX new_pt_tbl_idx ON new_pt_tbl USING GIST ON 
(ST_Transform(my_multi_pt, <Albers SRID>));
</quote>

o questo:

<quote
src="http://www.postgresonline.com/journal/index.php?/archives/9-How-to-create-an-index-based-on-a-function.html">
Here is another example taken from PostGIS land. Often times you
provide your data in various transformation, but for space savings and
row seek reasons, you want to only transform your data to the less used
projections as needed. One way to do this is to create functional
indexes on the commonly used transformations and create views or just
write raw SQL that uses these alternative transformations.


   CREATE INDEX parcels_idx_geom_nadm  
       ON parcels USING gist(ST_Transform(the_geom, 26986))

So now when I do a select like this that lists all buildings within 100
meters of my NAD 83 MA Meter State Plane point of interest:


    SELECT bldg_name, ST_Transform(the_geom,26986) As newgeom
        FROM buildings 
        WHERE ST_DWithin(ST_Transform(the_geom, 26986) ,ST_GeomFromText
('POINT(235675.754215375 894022.495855985)', 26986),  100) 

it will use indexes
</quote>

-- 
Bud P. Bruegger, Ph.D.          +39-0564-488577 (voice),  -21139 (fax) 
   European Chair, Global Collaboration Forum on eID
   Chair, Porvoo Subgroup on collab. govs/operating systems
   Leader of the Permanent eID Status Observatory (PESO) project
Servizio Elaborazione Dati       e-mail:  bud at comune.grosseto.it
Comune di Grosseto               jabber:  bud at jabber.no
Via Ginori, 43                   http://www.comune.grosseto.it/
58100 Grosseto (Tuscany, Italy)
http://www.comune.grosseto.it/interopEID/



Maggiori informazioni sulla lista Gfoss