[postgis-users] couldn't get the correct projected values
Obe, Regina
robe.dnd at cityofboston.gov
Fri May 16 03:55:01 PDT 2008
Slight correction to what I said earlier. I guess that is what I get for skimming email so early in th e morning.
What is the SRID of your il_izmir3 geometry to begin with?
If you imported it and incorrectly stated it as 32635 rather than 4269 or 4326, then presumably the transform will do nothing since it will see 32635 -> 32635 (you are already - nothing to do here).
I am going to guess that the SRID of your il_izmir3 is incorrectly stated and that to fix, scrap the second statement and change your first statement to (note if your data is NAD83 longlat rather than WGS long lat change the 4326 to 4269)
create table izmir_il4 as select
gid,il_kod,iladi,transform(ST_SetSRID(the_geom,4326),32635) as the_geom from il_izmir3;
or alternatively change your second statement to
UPDATE izmir_il4 SET the_geom=Transform(ST_SetSRID(the_geom,4326),32635);
Note its safer to recreate the table since who knows what projection you stated the first as so you are still transforming a guess to a guess.
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paragon Corporation
Sent: Friday, May 16, 2008 6:18 AM
To: 'PostGIS Users Discussion'
Subject: RE: [postgis-users] couldn't get the correct projected values
You are confusing setsrid with transform.
Remember setsrid - doesn't change the geometry it simple certifies that a
geometry is of a particular projection - basically
I am because I say I am
Transform - moves a geometry from one projection to another
I am not , but please make me so. Of course the please make me so will fail
if you don't know what it is to begin with
So all being said, your statement 2 is wrong and should be
update izmir_il4 set the_geom=Transform(the_geom,32635);
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of orkun
Sent: Friday, May 16, 2008 4:00 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] couldn't get the correct projected values
hello
whatever I have done, I couldn't get the correct projected values in postgis
environment.
1. # lon/lat to utm projection
create table izmir_il4 as select
gid,il_kod,iladi,transform(the_geom,32635) as the_geom from il_izmir3;
2.
update izmir_il4 set the_geom=setsrid(the_geom,32635);
3.
select extent(the_geom) from izmir_il4;
extent
--------------------------------------------------------------------------
BOX(26.2226982116699 37.8668251037598,28.4587249755859 39.3925666809082)
but these are not utm values. They are still in lon/lat values
I checked extent values with proj values. I got correct values:
echo "26.2226982116699 37.8668251037598" | proj +proj=utm +zone=35
+ellps=WGS84 +datum=WGS84
431631.23 4191323.84
orkun at orkun-desktop:/usr/local/izmir/veri/izmir3$ echo "28.4587249755859
39.3925666809082" | proj +proj=utm +zone=35 +ellps=WGS84 +datum=WGS84
625615.27 4361356.53
how can get values generated from "proj" in postgis environment ?
what am I doing wrong ?
here is the srid values of 32635 :
32635 | +proj=utm +zone=35 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
regards
--
Ahmet Temiz
Jeo. Müh.
Afet Isleri Gen. Md.lügü
Deprem Ar. D.
Ahmet Temiz
Geo. Eng.
General Dir. of
Disaster Affairs
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
_______________________________________________
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
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
More information about the postgis-users
mailing list