Anna Hentzel | 5 Oct 00:22 2009
Picon

converting WGS84 to NAD27

Hi,

I'm trying to convert WGS84 coordinates to UTM and NAD27. I'm using
the route-me library, which is a thin wrapper on proj4. It just
creates the PJ objects using pj_init_plus on the strings, and calls
pg_transform. The transformation to UTM works correctly, but the NAD27
transformation doesn't change the coordinates. Does anyone know what I
might be doing wrong?

CLLocationCoordinate2D coord = {60, -119};
int zone = ((coord.longitude + 186) / 6);

RMProjection* latLonProj = [[RMProjection alloc]
initWithString: <at> "+proj=latlong +ellps=WGS84 +datum=WGS84"];
RMProjection* utmProj = [[RMProjection alloc] initWithString:
[NSString stringWithFormat: <at> "+proj=utm +zone=%d +ellps=WGS84", zone]];

RMTransform* trans = [[RMTransform alloc] initFrom:latLonProj To:utmProj];

CLLocationCoordinate2D transCoord = [trans projectForward:coord AtZoom:9];
NSLog( <at> "UTM Coord %f, %f %d" , transCoord.latitude, transCoord.longitude, zone);

RMProjection* nad27Proj = [[RMProjection alloc]
initWithString: <at> "+proj=latlong +ellps=WGS84 +datum=NAD27 +no_defs"];
trans = [[RMTransform alloc] initFrom:latLonProj To:nad27Proj];
transCoord = [trans projectForward:coord AtZoom:9];
NSLog( <at> "NAD27 Coord %f, %f" , transCoord.latitude, transCoord.longitude);

**output**
UTM Coord 6653097.435298, 388455.958023 11
(Continue reading)

Tamas Szekeres | 5 Oct 00:43 2009
Picon

Re: converting WGS84 to NAD27

Anna,

You should probably install those 'datum shift grid files' as per http://trac.osgeo.org/proj/, and set up their location in the PROJ_LIB environment setting.
In case if you're on Windows the files are already included in the pre-compiled packages available from here: http://vbkto.dyndns.org:1280/sdk/
The files are located in the /bin/proj/SHARE subdirectory.

Best regards,

Tamas



2009/10/5 Anna Hentzel <wibge <at> gmail.com>
Hi,

I'm trying to convert WGS84 coordinates to UTM and NAD27. I'm using
the route-me library, which is a thin wrapper on proj4. It just
creates the PJ objects using pj_init_plus on the strings, and calls
pg_transform. The transformation to UTM works correctly, but the NAD27
transformation doesn't change the coordinates. Does anyone know what I
might be doing wrong?

CLLocationCoordinate2D coord = {60, -119};
int zone = ((coord.longitude + 186) / 6);

RMProjection* latLonProj = [[RMProjection alloc]
initWithString: <at> "+proj=latlong +ellps=WGS84 +datum=WGS84"];
RMProjection* utmProj = [[RMProjection alloc] initWithString:
[NSString stringWithFormat: <at> "+proj=utm +zone=%d +ellps=WGS84", zone]];

RMTransform* trans = [[RMTransform alloc] initFrom:latLonProj To:utmProj];

CLLocationCoordinate2D transCoord = [trans projectForward:coord AtZoom:9];
NSLog( <at> "UTM Coord %f, %f %d" , transCoord.latitude, transCoord.longitude, zone);

RMProjection* nad27Proj = [[RMProjection alloc]
initWithString: <at> "+proj=latlong +ellps=WGS84 +datum=NAD27 +no_defs"];
trans = [[RMTransform alloc] initFrom:latLonProj To:nad27Proj];
transCoord = [trans projectForward:coord AtZoom:9];
NSLog( <at> "NAD27 Coord %f, %f" , transCoord.latitude, transCoord.longitude);

**output**
UTM Coord 6653097.435298, 388455.958023 11
NAD27 Coord 60.000000, -119.000000


Thanks,
Anna
_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj

_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj
Jorge Ferrando | 12 Oct 19:45 2009
Picon

Getting X Y in a .map OZI calibrated map

I have some .map OZI calibrated maps. From those .map, I can get some calibration points (x y in the jpeg picture + lon lat in WGS84).

MMPXY,1,142,142
MMPXY,2,5217,142
MMPXY,3,5217,3422
MMPXY,4,142,3422
MMPLL,1,  -0.269639,  39.626293
MMPLL,2,  -0.186306,  39.626293
MMPLL,3,  -0.186306,  39.584626
MMPLL,4,  -0.269639,  39.584626

With that I build a coordinates file

-0.269639  39.626293 (142,142)
-0.186306  39.626293 (5217,142)
-0.186306  39.584626 (5217,3422)
-0.269639  39.584626 (142,3422)

From the .map file I can also know that the map projection is UTM

Map Projection,(UTM) Universal Transverse Mercator,PolyCal,No,AutoCalOnly,No,BSBUseWPX,Yes

With proj4 I get the projection of those points in UTM

$ proj +proj=utm +ellps=WGS84 coord
734345.05       4389843.39 (142,142)
741498.53       4390064.29 (5217,142)
741643.45       4385438.93 (5217,3422)
734485.67       4385218.08 (142,3422)

El objetivo es dadas unas coordenadas cualquieras dentro del mapa (p.e. -0.269058 39.599662), obtener el punto x y en el mismo.
The goal is knowing a pair of coordinates in the map (for instance -0.269058 39.599662), get the x y pixel in the map.

$ proj +proj=utm +ellps=WGS84
-0.269058 39.599662
734484.83       4386888.69

How can I calcultate the X Y pixel for those coordinates having all this data? Am I in the right way

Thank you very much

_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj
Adrian Popa | 13 Oct 12:52 2009
Picon

msProcessProjection(): Projection library error. no system list, errno: 13

Hello everyone!

I'm trying to troubleshoot a proj error, and I need your help! I have started this thread also on the mapserver mailing list, but I didn't find a solution yet: http://n2.nabble.com/msProcessProjection-Projection-library-error-no-system-list-errno-13-td3807641.html

I'm running mapserver, and I'm trying to configure it to act as a WMS server. My data is in wgs84 (epsg:4326) and I want to project it to mercator projection (epsg:900913).

I have configured the mapfile and the projections according to the Mapserver documentation and they work as long as the projection sections are defined like:
PROJECTION
    #spherical mercator/google
     "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids= <at> null +no_defs"
END

and

PROJECTION
    #WGS84
    "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
END

If I ask for EPSG projections (through WMS), I get the error in the subject.
Here is my WMS url:
http://terra/cgi-bin/mapserv?map=/var/www/html/map/rtc_base.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=GranitaJudete&STYLES=&SRS=EPSG:900913
I have tried to debug the problem by using shp2img, and it seems that mapserver tries to open /usr/share/proj/null as a file. I created a symlink between /usr/share/proj/epsg and /usr/share/proj/null, and now shp2img reads the file, but I get the same error while trying to call the WMS server.

My question is: how can I try to troubleshoot this issue - to see if there's a problem with proj?

I'd like to mention that I have added <900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids= <at> null +no_defs to my epsg file and my proj version is:
[adrianp <at> terra mapserver]$ rpm -qa | grep proj
proj-devel-4.5.0-1.fc5
proj-4.5.0-1.fc5

Regards,
Adrian
_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj
Jean-Claude REPETTO | 13 Oct 13:40 2009
Picon

Re: msProcessProjection(): Projection library error. no system list, errno: 13

Hello,

Adrian Popa wrote :
> 
> I'd like to mention that I have added <900913> +proj=merc +a=6378137 
> +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m 
> +nadgrids= <at> null +no_defs 

The correct EPSG number for this projection is 3857 (900913 is obsolete).
Recent version of PROJ.4 contain this definition in the epsg file :

<3857> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 
+y_0=0 +k=1.0 +units=m +nadgrids= <at> null +wktext  +no_defs <>

Regards,
Jean-Claude

_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj

Adrian Popa | 13 Oct 15:04 2009
Picon

Re: msProcessProjection(): Projection library error. no system list, errno: 13

Hello Jean-Claude,

Unfortunately I can't upgrade my proj version because it's running on a kind of "legacy" server and changing it would break other things.
I have added the new projection code to the epsg file, but it still doesn't work. It gives the same error.

I would like an example of command line syntax for running proj - because I suspect it doesn't read the correct epsg file.

I don't know if it's important but my epsg file is a symlink to the real file. It may be an issue if the mapserver process running as apache can't read through symlinks...

[root <at> terra map]# ls -l /usr/share/proj/epsg
lrwxrwxrwx 1 root root 24 Oct 13 16:01 /usr/share/proj/epsg -> /usr/share/proj/nad/epsg

UPDATE:

Woohoo - I've changed the symlink to a hard link and now it works!
So, it seems there were some issues with apache, not being able to read through symlinks (maybe because it is disabled by default?)!
The moral of the story? Make sure /usr/share/proj/epsg is not a symlink!


Jean-Claude REPETTO wrote:
Hello, Adrian Popa wrote :
I'd like to mention that I have added <900913> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids= <at> null +no_defs
The correct EPSG number for this projection is 3857 (900913 is obsolete). Recent version of PROJ.4 contain this definition in the epsg file : <3857> +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids= <at> null +wktext +no_defs <> Regards, Jean-Claude _______________________________________________ Proj mailing list Proj <at> lists.maptools.org http://lists.maptools.org/mailman/listinfo/proj


-- --- Adrian Popa NOC Division Network Engineer Divizia Centrul National de Operare Retea Departament Transport IP & Metro Compartiment IP Core & Backbone Phone: +40 21 400 3099
_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj
Bytechanger | 15 Oct 15:30 2009
Picon
Picon

ToWGS84 for Germany, NRW?

Hi,

I want to convert 4326 to 31466....
But there is a difference of 50m !!

I think I need right +towgs84 for Germany , NRW, Rhein-Erft-Kreis ??

Greetings

Byte

_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj

Milo van der Linden | 15 Oct 15:56 2009
Picon

Re: ToWGS84 for Germany, NRW?

Byte,

Do you have the proj string or the EPSG code for the projection you use
natively in Germany? I think it is needed to see what ellipsoid/spheroid
is native to you to determine the +towgs84 transformation.

Bytechanger schreef:
> Hi,
>
> I want to convert 4326 to 31466....
> But there is a difference of 50m !!
>
> I think I need right +towgs84 for Germany , NRW, Rhein-Erft-Kreis ??
>
> Greetings
>
> Byte
>
> _______________________________________________
> Proj mailing list
> Proj <at> lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>
>   

_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj

buddy bajorin | 15 Oct 16:15 2009

(no subject)

Greetings =)

Could someone please help with projection issues?

In trying to convert a raster image (gif) into a geotiff so that it can be reprojected into mercator. I'm very new at this so have attempted to read the docs carefully, but i have clearly made a mistake.

Since i'm new, and am using a linux box I have found that gdal seems to be the way to go, unless someone has a better suggestion (need command line for automation).

The projection information for the gif image is that it is a lambert conformal conic, but specifies a tangent latitude, instead of the normal 1 or two latitudes of natural origin. Here is the info and source information:

########## SOURCE PROJECTION INFORMATION ###################
## REF http://www.nws.noaa.gov/noaaport/html/icdtb48e.html #
############################################################
Eastern CONUS Lambert
Satellite: GOES East
Projection: Lambert Conformal
Tangent Latitude: 25.000N
Reference Longitude: 95.000W
Reference Grid: AWIPS Grid 211*
* The Dx, Dy grid increment (at 25 deg north) w as selected
so that the grid spacing would be exactly 80.0 00 k m at
35 deg north

Lower Left: 16.369N 113.133W
Lower Right: 14.335N 65.091W
Upper Right: 57.289N 49.385W
Upper Left: 59.844N 123.044W

1.0159Km <at> 25.000N Visible
5120x5120

########################

so not knowing what I am doing, and googling for all that i can find I came up with the following means to set the projection, and reproject.

gdal_translate -of gtiff -a_srs '+proj=lcc +lat_ts=25 \
+lon_0=-95 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs' \
-a_ullr -123.044 59.844 -65.091 14.335 test.gif test.tif


I'm guessing the 'lat_ts' parameter is incorrect, i just happened to see it somewhere, but i have also tried setting the two lat parameters to 25 as well, which did not work. I also tried using default lcc projection information from ArcView for that projection to no avail.

Once finished my settings so far to convert to mercator are as follows
gdalwarp -t_srs '+proj=merc +a=6378137 \
 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 \
 +units=m +nadgrids= <at> null +no_defs' test.tif mercator.tif

I would really appreciate any help anyone can offer.. i've been banging my head off the wall trying to figure this out, it has sort of become a quest now... the issue seems to be using a tangent latitude instead of the 1 or 2 latitudes of origin.

thanks much,

--buddy





-- --

_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj
Kristian Thy | 15 Oct 16:17 2009
Picon

Re: ToWGS84 for Germany, NRW?

On Thu, Oct 15, Milo van der Linden wrote:
> Bytechanger schreef:
> > I want to convert 4326 to 31466....
> 
> Do you have the proj string or the EPSG code for the projection you use
> natively in Germany? I think it is needed to see what ellipsoid/spheroid
> is native to you to determine the +towgs84 transformation.

I would hazard a guess that he's trying to convert from EPSG:4326 to
EPSG:31466 ...

+proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel
+datum=potsdam +units=m +no_defs 

\\kristian
--

-- 
... et nemo ex vobis interrogat me: »Quo vadis?«
_______________________________________________
Proj mailing list
Proj <at> lists.maptools.org
http://lists.maptools.org/mailman/listinfo/proj


Gmane