basically my problem is that pj_init_plus works fine with

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

but fails with

+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +units=degrees

I undestand there is a bit of overspecification there, but that is not conflicting. Or is it?

(proj4-4.9.2 compiled with gcc 5.3, on x64 linux)


Proj.4 documentation about "units" is at https://trac.osgeo.org/proj/wiki/GenParms#Units

Listing the supported units with cs2cs gives this result:

cs2cs -lu
          km 1000.                Kilometer
           m 1.                   Meter
          dm 1/10                 Decimeter
          cm 1/100                Centimeter
          mm 1/1000               Millimeter
         kmi 1852.0               International Nautical Mile
          in 0.0254               International Inch
          ft 0.3048               International Foot
          yd 0.9144               International Yard
          mi 1609.344             International Statute Mile
        fath 1.8288               International Fathom
          ch 20.1168              International Chain
        link 0.201168             International Link
       us-in 1./39.37             U.S. Surveyor's Inch
       us-ft 0.304800609601219    U.S. Surveyor's Foot
       us-yd 0.914401828803658    U.S. Surveyor's Yard
       us-ch 20.11684023368047    U.S. Surveyor's Chain
       us-mi 1609.347218694437    U.S. Surveyor's Statute Mile
      ind-yd 0.91439523           Indian Yard
      ind-ft 0.30479841           Indian Foot
      ind-ch 20.11669506          Indian Chain

Linear units in Proj4 can be to converted into meters with +to_meter parameter but with degrees that is not possible and therefore my conclusion is that +unit=degrees is not valid. Document http://dl.maptools.org/dl/omsug/osgis2004/PROJ4_HandlingCoordinateSystems.pdf says about +proj=latlong that "Units is implicitly degrees" so there is no need to define the units.

Interestingly the documentation of Proj4 javascript port http://proj4js.org/ does have examples where +proj=longlat and units=degrees are used together

proj4.defs('WGS84', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");
  • I know this is old but I'm commenting anyway. From my experience latlong projections are converted to radians (at least with pyproj in python). – djhoese Nov 5 '18 at 20:43
  • 1
    @djhoese, Angular units Degree, Grad and Radian have been introduced in Proj version 5.2.0 proj4.org/operations/conversions/unitconvert.html#angular-units. Internal computing has certainly used radians even before. – user30184 Nov 5 '18 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.