[mapserver-dev] Derive units from a layer projection... Possible?

Daniel Morissette dmorissette at mapgears.com
Thu Aug 14 10:50:44 PDT 2014


Have a look at GetMapserverUnitUsingProj() in mapprojhack.c, It is used 
for WMS, SOS and MapContext, and also by PHP MapScript.

Daniel

On 14-08-14 1:19 PM, Even Rouault wrote:
> Steve,
>
> With OGR, you can get the units with :
> - OSRGetAngularUnits() if OSRIsGeographic()
> - OSRGetLinearUnits() if OSRIsProjected()
>
> Even
>
>> Do we have any code to derive a layer's unit based on it's projection? The
>> units can be explicitly set but that's not often the case. I'm reworking the
>> WFS dwithin/beyond code and need a reliable way to derive units to convert
>> the user supplied distance to layer units. Maybe its enough just to use
>> layer->units, and then defer to map->units if not set.
>>
>> Steve
>>
>
>


-- 
Daniel Morissette
T: +1 418-696-5056 #201
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000


More information about the mapserver-dev mailing list