[postgis-users] Transformation problem using transform()

Marc Angelo computrain at paradise.net.nz
Wed May 3 20:42:18 PDT 2006


Hi Everyone
Thank you very much for your answer's. Unfortunately I am very new to all the GIS stuff so I'm flying blind most of the time. Even the questions you have asked me have actually helped my understanding.

What I'll d here is explain a little more of what I am trying to achieve therefore isolating what I'm doing wrong maybe more apparent. The following is the version() I am using (Windows):-

"POSTGIS="1.1.1" GEOS="2.2.1-CAPI-1.0.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS"


What I have been doing is carrying out the following SQL INSERT into Postgres. The text Lon/Lat are only there for me while I'm testing and try to get a better idea of what is happening. The E00.... number is an rfid tag id. The Lat and Long come from a GPS reading using WGS84 datum

"INSERT INTO waypoints(rfid, date,text_lat,text_long,position)VALUES('E004010001CC1B0F', '04May2006','-45.879185','170.50196',GeometryFromText('POINT(170.50196 -45.879185)', 4326))" 



Next is the record that is created:-

"8";"E004010001CC1B0F";"2006-05-02";"-45.879185";"170.50196";"0101000020E6100000CEFC6A0E105065401F11532289F046C0"

The 8 is the SERIAL Primary key.


Now that this is sitting nicely in the Database I am connecting to it and I want to be able to place the "waypoint" in a map (I'm playing with a .Net component called mapWindow) in a projection of the user's choice(ie into the projection of the shapefile). My current level of understanding is I understand the difference between a datum and projection but that's about it. I have bought a small book called "Basic GIS Coordinates" which I'm working through:) 
I am connecting to the database using NPGSQL data connector.

I have also tried overlaying the above record in QGIS over a NZ coastline shape file using NZTM and NZMG projections but the waypoint is several hundred miles to the South of where it should be.

I suppose Rene is correct in asking what am I trying to do. I thought that if I had a NZGD 2000 (for example) shape file, to show the above waypoint on a shape file, I would need to reproject the waypoint into the NZGD 2000 proection first. I realise this is probably where I am going wrong.

Mark - I copied the functions from your response into the arbituary SQL window (eg select asewkt(transform(geomfromtext('POINT(170.50196
-45.879185)', 4326), 2029));) and got the same result as in your email ("SRID=2029;POINT(-2815521.73265803 -12147021.3686016)"). This tells me I have things in the correct order now :) but what is -2815521.73265803 -12147021.3686016 ? Is this the coordinate projected into x, y coords in NAD27(76) projection? (by the way, I tested all the functions from your response and they all worked)

Again I apologise for these simplistic questions. I know once I get my head around projections/datums and the various functions I'll be fine.

Thank you in advance for any assistance that can be given.

Cheers
Marc



  ----- Original Message ----- 
  From: René F. Viancos S. 
  To: PostGIS Users Discussion 
  Sent: Thursday, May 04, 2006 9:04 AM
  Subject: Re: [postgis-users] Transformation problem using transform()


  what do you want? make a reproyection or datum shift ?

  for datum shift you need to define a custom srid, with a custom proj4text field parameters.

  Regards

  -- 
  René F. Viáncos S.
  Director de Geomática y TIC 
  Unidad de Ambiente, Región Territorio y Espacio, UNARTE
  Facultad de Ciencias
  Universidad de Chile
  Tel (56-2) 632 62 09
  Cel (56 9) 933 72 66
  rviancos at uchile.cl
  rviancos at gmail.com 


------------------------------------------------------------------------------


  _______________________________________________
  postgis-users mailing list
  postgis-users at postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users



------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.1.392 / Virus Database: 268.5.2/330 - Release Date: 3/05/2006
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060504/f9670624/attachment.html>


More information about the postgis-users mailing list