Problem with program on Windows

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with program on Windows

Frank Willett
I'm running Windows 7 Ultimate 64 and have cygwin installed.

I downloaded the proj.4 Windows binary distribution and tried the following command:

proj.exe +proj=utm +ellps=clrk66 +lon_0=0 +lat_0=0 +x_0=500000 +y_0=0 +units=m

expecting an answer of (500000.00, 0.00) and got (166017.00, 0.00)

I then tried:

proj.exe +proj=utm +ellps=clrk66 +lon_0=0 +lat_0=0 +x_0=0 +y_0=0 +units=m

expecting an answer of (0.00, 0.00) and I got the same answer of (166017.00, 0.00).

I then downloaded the source code and compiled/linked under cygwin and tried the above tests
again, obtaining (83398.20, 0.00) for both tests.

I sure hope I'm missing something obvious :-(

Any ideas?

Frank
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Problem with program on Windows

Frank Warmerdam
On Wed, Aug 10, 2011 at 9:09 AM, Frank Willett <[hidden email]> wrote:
> I'm running Windows 7 Ultimate 64 and have cygwin installed.
>
> I downloaded the proj.4 Windows binary distribution and tried the following command:
>
> proj.exe +proj=utm +ellps=clrk66 +lon_0=0 +lat_0=0 +x_0=500000 +y_0=0 +units=m
>
> expecting an answer of (500000.00, 0.00) and got (166017.00, 0.00)

Frank,

You have not indicated what user input you gave, so it is hard to be
sure what the correct output should be.  However, I will note that it
is not normal to try and specify the detailed parameters like +lon_0,
+lat_0, +x_0 and +y_0 with +proj=utm.  With UTM you should provide
a +zone.  If you want to specify the transverse mercator projection
yourself then just use +proj=tmerc instead.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Problem with program on Windows

Frank Willett
Thanks,

My confusion was the difference between tmerc and utm.

BTW: I was inputing (0, 0).

When I switched to tmerc all is well.

Thanks again :-)

Frank

On Aug 10, 2011, at 10:25 AM, Frank Warmerdam wrote:

> On Wed, Aug 10, 2011 at 9:09 AM, Frank Willett <[hidden email]> wrote:
>> I'm running Windows 7 Ultimate 64 and have cygwin installed.
>>
>> I downloaded the proj.4 Windows binary distribution and tried the following command:
>>
>> proj.exe +proj=utm +ellps=clrk66 +lon_0=0 +lat_0=0 +x_0=500000 +y_0=0 +units=m
>>
>> expecting an answer of (500000.00, 0.00) and got (166017.00, 0.00)
>
> Frank,
>
> You have not indicated what user input you gave, so it is hard to be
> sure what the correct output should be.  However, I will note that it
> is not normal to try and specify the detailed parameters like +lon_0,
> +lat_0, +x_0 and +y_0 with +proj=utm.  With UTM you should provide
> a +zone.  If you want to specify the transverse mercator projection
> yourself then just use +proj=tmerc instead.
>
> Best regards,
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Software Developer
> _______________________________________________
> Proj mailing list
> [hidden email]
> http://lists.maptools.org/mailman/listinfo/proj

_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Problem with program on Windows

support.mn
In reply to this post by Frank Willett
Frank,

that is the reason I have been talking about the syntax check
to be connected to Proj.4 ... that would then give at least a warning
(if switched on) that the user is giving meaningless input to Proj.4
and it would handle situations like this here (and maybe several
similar later) and minimize the input data garbage.

Syntax scanning is very easy to implement using "Recursive
descent parser" and will not yield any massive source code.

http://en.wikipedia.org/wiki/Recursive_descent_parser

Regards: Janne.

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

Frank Warmerdam [[hidden email]] kirjoitti:
>
> However, I will note that it
> is not normal to try and specify the detailed parameters like +lon_0,
> +lat_0, +x_0 and +y_0 with +proj=utm.  With UTM you should provide
> a +zone.  If you want to specify the transverse mercator projection
> yourself then just use +proj=tmerc instead.
>

_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Problem with program on Windows

Frank Warmerdam
On Thu, Aug 11, 2011 at 2:53 PM,  <[hidden email]> wrote:
> Frank,
>
> that is the reason I have been talking about the syntax check
> to be connected to Proj.4 ... that would then give at least a warning
> (if switched on) that the user is giving meaningless input to Proj.4
> and it would handle situations like this here (and maybe several
> similar later) and minimize the input data garbage.

Janne,

It would be desirable, but it isn't something I intend to work on in
the near term.  I would note doing it properly would require
someone *knowing* the grammar.  In fact I am often not aware
of the syntax of many of the esoteric options and I'd hate to
break stuff that is working for some people.

> Syntax scanning is very easy to implement using "Recursive
> descent parser" and will not yield any massive source code.
>
> http://en.wikipedia.org/wiki/Recursive_descent_parser

I have written lots of parsers, sometimes using parser generators
and sometimes by hand.  Depending on the interpretation of
"massive" I do not entirely agree with your statement.  I believe
having a proper parser as part of PROJ.4 would non-trivially
bulk up the project.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Problem with program on Windows

support.mn
In reply to this post by Frank Willett
Frank,

I agree that it would be an additional labor but the Proj.4
grammar is so easy that it does not take very many lines
to implement and of course you could always exclude the
scanner from your project if that was not needed since
that would just be some kind of a preprocessor. It would
greatly improve the quality of the definition data and help
users to avoid most obvious mistakes. It would also make
the processing otherwise more simple since the code
would not need to do any repeated checking.

I did also several compiler and language projects in 80's
and 90's even one full relational database language.

Janne.

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

Frank Warmerdam [[hidden email]] kirjoitti:

> On Thu, Aug 11, 2011 at 2:53 PM,  <[hidden email]> wrote:
> > Frank,
> >
> > that is the reason I have been talking about the syntax check
> > to be connected to Proj.4 ... that would then give at least a warning
> > (if switched on) that the user is giving meaningless input to Proj.4
> > and it would handle situations like this here (and maybe several
> > similar later) and minimize the input data garbage.
>
> Janne,
>
> It would be desirable, but it isn't something I intend to work on in
> the near term.  I would note doing it properly would require
> someone *knowing* the grammar.  In fact I am often not aware
> of the syntax of many of the esoteric options and I'd hate to
> break stuff that is working for some people.
>
> > Syntax scanning is very easy to implement using "Recursive
> > descent parser" and will not yield any massive source code.
> >
> > http://en.wikipedia.org/wiki/Recursive_descent_parser
>
> I have written lots of parsers, sometimes using parser generators
> and sometimes by hand.  Depending on the interpretation of
> "massive" I do not entirely agree with your statement.  I believe
> having a proper parser as part of PROJ.4 would non-trivially
> bulk up the project.

_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Problem with program on Windows

Thomas Knudsen
2011/8/12 <[hidden email]>
Frank,

I agree that it would be an additional labor but the Proj.4
grammar is so easy that it does not take very many lines
to implement

I somewhat kind of doubt it since, as Frank says, the syntax for some of the more esoteric projections may be non trivial. And under all circumstances there will be a lot of special cases (e.g. the zone specifier for utm). For each individual projection I agree that it may not be a big thing to implement syntax checking - but there is a lot of projections, and one would need to understand the specifics of all of them. Actually, as far as I can see, this amounts to writing "a significant fraction of N" syntax checkers for the N projections in the library.

If you can see simpler ways to do it, I think you should flesh it out in code and post a patch: Others may want to join the effort once you have actually shown how easy it is.

/thomas


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj