var
  BL,M: TDoublePoint;
  TR,N: TDoublePoint;
  VEPSG: Integer;
  VCoords: String;
  VLeft: Double;
begin
  // test proj4
  VLeft := GetLLon;
  VCoords := RoundEx(VLeft,9)+','+RoundEx(GetBLat,9)+','+RoundEx(GetRLon,9)+','+RoundEx(GetTLat,9);
  if (GetAfter('EPSG:4326', GetURLBase) <> '') then begin
    // base EPSG:4326 defined in URL
    ResultURL:=GetURLBase+VCoords;
  end else begin
    // no EPSG:4326 - calc utm zone
    VEPSG := (Trunc(VLeft) div 6) + 32631;
    Proj4Conv.SetEPSG(VEPSG);
    if Proj4Conv.AvailableConv then begin
      // use current zone
      BL.x := VLeft;
      BL.y := GetBLat;
      TR.x := GetRLon;
      TR.y := GetTLat;
      M := Proj4Conv.LonLat2XY(BL);
      N := Proj4Conv.LonLat2XY(TR);
      ResultURL:=GetURLBase+RoundEx(M.x,9)+','+RoundEx(M.y,9)+','+RoundEx(N.x,9)+','+RoundEx(N.y,9)+'&SRS=EPSG:'+IntToStr(VEPSG);
    end else begin
      // not available - force EPSG:4326
      ResultURL:=GetURLBase+VCoords+'&SRS=EPSG:4326';
    end;
  end;
end.