From peter.townsend at maplarge.com Wed May 6 11:45:26 2026 From: peter.townsend at maplarge.com (Peter Townsend) Date: Wed, 6 May 2026 13:45:26 -0500 Subject: [PROJ] proj_dmstor accepted inputs Message-ID: I was looking at the proj_dmstor function to try and leverage it, but there really isn't any documentation on what the expected input format is supposed to be. "252423N" returns 4405.6124577616465, which isn't anywhere close to the expected result of 25.40638888 degrees / 0.44342513699807451 radians. "25 24 23 N" gives me 0.43633231299858238, which is wrong. "25d24'23\"N" does get me 0.44342513715321491 though. proj_rtodms(0.44342513715321491, 'N', 'S') does give me "25d24'23\"N" back. Does it require the d, ', and " markers in the string? -- Peter Townsend Senior Software Developer -------------- next part -------------- An HTML attachment was scrubbed... URL: From karney at alum.mit.edu Wed May 6 12:51:55 2026 From: karney at alum.mit.edu (Charles Karney) Date: Wed, 6 May 2026 19:51:55 +0000 Subject: [PROJ] proj_dmstor accepted inputs In-Reply-To: References: Message-ID: <9ADF4ADB-ED51-4E01-BEDD-C46AFCE7965A@alum.mit.edu> I took a quick look at the source and it looks like you've figured out the format. (I see that a degree symbol is also allowed.) Because of the inconvenience of using ' and " as minutes and seconds markers, I would recommend allowing : (colon) to be used as a *separator* character, e.g., 25:24:23. This usage is common for times and so its use for angles is fairly intuitive. (This convention is supported by GeographicLib.) Allowing the digits to be run together, 252423, is a recipe for disaster. -- Charles Karney > On May 6, 2026, at 14:45, Peter Townsend via PROJ wrote: > > I was looking at the proj_dmstor function to try and leverage it, but there really isn't any documentation on what the expected input format is supposed to be. > > "252423N" returns 4405.6124577616465, which isn't anywhere close to the expected result of 25.40638888 degrees / 0.44342513699807451 radians. > "25 24 23 N" gives me 0.43633231299858238, which is wrong. > "25d24'23\"N" does get me 0.44342513715321491 though. > proj_rtodms(0.44342513715321491, 'N', 'S') does give me "25d24'23\"N" back. > > Does it require the d, ', and " markers in the string? > > -- > Peter Townsend > Senior Software Developer > _______________________________________________ > PROJ mailing list > PROJ at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/proj